instruction
stringlengths
14
27.6k
completion
stringlengths
3
38.3k
__original_row_idx
int64
0
50k
conversations
listlengths
2
2
I receive this message (see image below) when I try to edit in debugging. This occur only in my Vista64bits OS, not in my XP computer. Why and what should I do? Update I found that I need to compile in x86 to be able to change value when debugging. So my question is WHY that I can't do it in x64? alt text http://img183...
When debugging applications on a 64-bit operating system (like Vista 64-bit), you may encounter issues when trying to edit values in the debugger due to differences in how memory management and type sizes work between 32-bit (x86) and 64-bit (x64) architectures. Here are some key points to understand why you're facing ...
29,226
[ { "from": "human", "value": "I receive this message (see image below) when I try to edit in debugging. This occur only in my Vista64bits OS, not in my XP computer. Why and what should I do?\nUpdate\nI found that I need to compile in x86 to be able to change value when debugging. So my question is WHY that I...
We are embarking on some R&D for a staff rostering system, and I know that there are some suggested algorithms such as the memetic algorithm etc., but I cannot find any additional information on the web. Does anyone know any research journals, or pseudocode out there which better explains these algorithms? Thanks, Deva...
Hi Devan, When developing a staff rostering system, various algorithms can be employed to optimize schedules. Here are some common approaches, along with suggested research journals and resources that can help you understand these algorithms better. ### Algorithms for Staff Rostering 1. **Genetic Algorithms (GAs)**:...
32,652
[ { "from": "human", "value": "We are embarking on some R&D for a staff rostering system, and I know that there are some suggested algorithms such as the memetic algorithm etc., but I cannot find any additional information on the web.\nDoes anyone know any research journals, or pseudocode out there which bett...
There seem to be 3 ways of telling GCC to weak link a symbol: __attribute__((weak_import)) __attribute__((weak)) #pragma weak symbol_name None of these work for me: #pragma weak asdf extern void asdf(void) __attribute__((weak_import, weak)); ... { if(asdf != NULL) asdf(); } I always get a link error like this: U...
The issue you are facing with weak linking in GCC stems from a couple of factors related to the specific attributes and the way they are implemented. Let's break it down: 1. **Attributes and Pragmas**: - `__attribute__((weak))` makes the symbol weak, meaning that if there’s no strong definition of the symbol, it c...
32,732
[ { "from": "human", "value": "There seem to be 3 ways of telling GCC to weak link a symbol:\n\n__attribute__((weak_import))\n__attribute__((weak))\n#pragma weak symbol_name\n\nNone of these work for me:\n#pragma weak asdf\nextern void asdf(void) __attribute__((weak_import, weak));\n...\n{\n if(asdf != NUL...
I'm currently working on a WebSphere 6.1 Web Project. In my java code, how can i get the current running application port?
In a WebSphere Application Server (WAS) environment, the application server itself does not provide a direct API for retrieving the current running application port. However, you can achieve this by using the `ServletRequest` object within your servlets or JSPs. This object has methods that allow you to extract informa...
32,661
[ { "from": "human", "value": "I'm currently working on a WebSphere 6.1 Web Project.\nIn my java code, how can i get the current running application port?\n" }, { "from": "gpt", "value": "In a WebSphere Application Server (WAS) environment, the application server itself does not provide a direct A...
How do I drop a Groovlet into a Grails app? Say, for example, in web-app/groovlet.groovy import java.util.Date if (session == null) { session = request.getSession(true); } if (session.counter == null) { session.counter = 1 } println """ <html> <head> <title>Groovy Servlet</title> </head> <b...
To drop a Groovlet into a Grails app, you need to follow a specific process since Grails is built on top of the Spring framework and uses a specific directory structure. However, Groovlets are not typically a feature used in standard Grails applications. Instead, Grails uses controllers and GSP (Groovy Server Pages) fo...
31,660
[ { "from": "human", "value": "How do I drop a Groovlet into a Grails app? Say, for example, in web-app/groovlet.groovy\n\nimport java.util.Date\n\nif (session == null) {\n session = request.getSession(true);\n}\n\nif (session.counter == null) {\n session.counter = 1\n}\n\nprintln \"\"\"\n<html>\n <head...
I'm currently working on someone else's database where the primary keys are generated via a lookup table which contains a list of table names and the last primary key used. A stored procedure increments this value and checks it is unique before returning it to the calling 'insert' SP. What are the benefits for using a ...
Using a custom primary key generation method, such as a lookup table to manage the last used primary key, offers several benefits compared to traditional auto-incrementing identity columns or GUIDs. Here are some advantages: ### 1. **Centralized Control** - A lookup table for last used keys provides a central point...
33,118
[ { "from": "human", "value": "I'm currently working on someone else's database where the primary keys are generated via a lookup table which contains a list of table names and the last primary key used. A stored procedure increments this value and checks it is unique before returning it to the calling 'inser...
We have a set of applications that I want to use JMS for messaging between. Right now, our applications all make TCP connections to the ActiveMQ broker. Is it possible to make the 15 or so applications that are on the same host use the inVM connections or use a form of shared memory while the remaining 20 or so appli...
Yes, you can indeed set up an ActiveMQ broker to allow both in-VM connections and TCP connections from different applications. In ActiveMQ, you have the flexibility to configure the broker to accept multiple transport protocols simultaneously. ### Here's how you can achieve this: 1. **Single Broker Configuration:** ...
35,202
[ { "from": "human", "value": "We have a set of applications that I want to use JMS for messaging between. Right now, our applications all make TCP connections to the ActiveMQ broker. Is it possible to make the 15 or so applications that are on the same host use the inVM connections or use a form of shared ...
Assuming a Perl script that allows users to specify several text filter expressions in a config file, is there a safe way to let them enter regular expressions as well, without the possibility of unintended side effects or code execution? Without actually parsing the regexes and checking them for problematic constructs...
It's great to see your progress on working with user-defined regular expressions in a Perl script! You're correct that using the default regex behavior (without the `re 'eval'` pragma) should keep you safe from unintended code execution through regex. Here's a summary of your approach and some additional insights: 1...
32,525
[ { "from": "human", "value": "Assuming a Perl script that allows users to specify several text filter expressions in a config file, is there a safe way to let them enter regular expressions as well, without the possibility of unintended side effects or code execution? Without actually parsing the regexes and...
I am looking to incorporate scanning as a way of collecting feedback from paper questionnaires in my desktop application (a feedback management app). Questionnaires are completed using tick or cross marks as well as free text. The questionnaires are designed using the applications' designer. I am looking for a componen...
Incorporating scanning capabilities for collecting feedback from paper questionnaires can significantly enhance the user experience and efficiency of your feedback management application. Here are some considerations for both off-the-shelf software like Remark and developing your own solution using .NET components: ##...
30,075
[ { "from": "human", "value": "I am looking to incorporate scanning as a way of collecting feedback from paper questionnaires in my desktop application (a feedback management app).\nQuestionnaires are completed using tick or cross marks as well as free text. The questionnaires are designed using the applicati...
I'm looking to add some lookup lists in the database, but I want them to be easy localizable (SQL 2005, ADO.NET) This would include: Easy Management of multiple languages at the same time Easy Retrieval of values from the database Fallback language (in case the selected language is missing) I was thinking about havin...
Creating a multilingual lookup system in SQL Server 2005 using ADO.NET that allows for easy localization while also providing a fallback mechanism can be approached in several ways. The goal is to avoid explicitly passing the language parameter in every query, while still making it flexible for multilingual support. He...
32,565
[ { "from": "human", "value": "I'm looking to add some lookup lists in the database, but I want them to be easy localizable (SQL 2005, ADO.NET)\nThis would include:\n\nEasy Management of multiple languages at the same time\nEasy Retrieval of values from the database\nFallback language (in case the selected la...
I'm having trouble sending out a simple HTTP request using Actionscript 3's Socket() object. My onConnect listener is below: function sConnect(e:Event):void { trace('connected'); s.writeUTFBytes('GET /outernet/client/rss/reddit-feeds HTTP/1.1\r\n'); s.writeUTFBytes('Host: 208.43.71.50:8080\r\n'); s.writ...
It looks like you're sending an HTTP request using the `Socket` class in ActionScript 3, but there are a few details you might be overlooking which could lead to the request being malformed. Here are some potential issues and their solutions: 1. **End of Request**: HTTP headers must be terminated by an additional CRLF...
35,369
[ { "from": "human", "value": "I'm having trouble sending out a simple HTTP request using Actionscript 3's Socket() object. My onConnect listener is below:\nfunction sConnect(e:Event):void {\n trace('connected');\n s.writeUTFBytes('GET /outernet/client/rss/reddit-feeds HTTP/1.1\\r\\n');\n s.writeUTFB...
I was wondering peoples opinions on the naming of ID columns in database tables. If I have a table called Invoices with a primary key of an identity column I would call that column InvoiceID so that I would not conflict with other tables and it's obvious what it is. Where I am workind current they have called all ID co...
The naming conventions for ID columns in database tables can indeed be a topic of debate, and your points highlight some important considerations. Here are some thoughts on both approaches, including the concerns you've raised: ### Your Approach: Specific Naming (e.g., `InvoiceID`) 1. **Clarity**: Naming ID columns w...
33,433
[ { "from": "human", "value": "I was wondering peoples opinions on the naming of ID columns in database tables.\nIf I have a table called Invoices with a primary key of an identity column I would call that column InvoiceID so that I would not conflict with other tables and it's obvious what it is.\nWhere I am...
I got an image with which links to another page using <a href="..."> <img ...> </a>. How can I make it make a post like if it was a button <input type="submit"...>?
To make an image act like a button that submits a form using a POST request, you can wrap the image in a form element and use a button input of type `submit`. Here's how you can do it: ### HTML Code Example ```html <form action="your_post_url_here" method="post"> <button type="submit" style="border: none; backgro...
33,369
[ { "from": "human", "value": "I got an image with which links to another page using <a href=\"...\"> <img ...> </a>.\nHow can I make it make a post like if it was a button <input type=\"submit\"...>?\n" }, { "from": "gpt", "value": "To make an image act like a button that submits a form using a P...
Is it possible to run the 32-bit version of Visual Studio 2008 Professional on a Windows Vista 64-bit system? Are there any known caveats that I would need to be aware of? Would have to install the x64 version of the .NET Framework? Would there be any issues on building software targeted for x86? Would there be any (...
Yes, it is possible to run the 32-bit version of Visual Studio 2008 Professional on a Windows Vista 64-bit system. Windows Vista 64-bit is capable of running 32-bit applications without any issues through its built-in WOW64 (Windows 32-bit on Windows 64-bit) compatibility layer. ### Caveats to Consider: 1. **Install...
32,714
[ { "from": "human", "value": "Is it possible to run the 32-bit version of Visual Studio 2008 Professional on a Windows Vista 64-bit system? \n\nAre there any known caveats that I would need to be aware of?\nWould have to install the x64 version of the .NET Framework?\nWould there be any issues on building so...
I have a WordPress site (2.6.2) in which I have set the Home page to a static page instead of the normal posts page. The ID of this page is 2, so in the WordPress template I have changed the wp_list_pages to look like this: <?php wp_list_pages('exclude=2&title_li=&depth=1' ); ?> this works fine, but now the Home page ...
In WordPress, when you set a static page as the home page and exclude it from the menu using `wp_list_pages`, it won't get highlighted because it doesn't appear in the list generated by `wp_list_pages`. ### Easy Solution One straightforward approach is to manually add the "Home" link to your menu and style it as nee...
32,643
[ { "from": "human", "value": "I have a WordPress site (2.6.2) in which I have set the Home page to a static page instead of the normal posts page. The ID of this page is 2, so in the WordPress template I have changed the wp_list_pages to look like this:\n<?php wp_list_pages('exclude=2&title_li=&depth=1' ); ?...
My app open file in subdirectory of directory where it is executed, subdirectory is called sample and it contains files: example.raf (example extension, non significant) background.gif example.raf contains relative path to background.gif (in this case only file name cause the files is in same directory as raf) and op...
The issue you're encountering stems from the way relative paths are resolved in your application. When you use the `OpenFileDialog`, it sets the current working directory to the location of the file you opened, so relative paths in the RAF file resolve correctly to the same directory. However, when you directly specify...
31,207
[ { "from": "human", "value": "My app open file in subdirectory of directory where it is executed, subdirectory is called sample and it contains files:\n\nexample.raf (example extension, non significant)\nbackground.gif\n\nexample.raf contains relative path to background.gif (in this case only file name cause...
I have been using Flex for a while and have not used remoting as of yet. Currently my apps use a webservice that generates xml that I use for databinding. What would be the benefit to using remoting over an xml webservice in this use case? Is there a general guideline when I should choose remoting over webservices? W...
Using remoting (such as the one provided by FluorineFX) versus XML web services for data binding in your Flex applications can offer several benefits and considerations. Here’s a breakdown of when to choose remoting over web services and the advantages it might bring: ### Benefits of Remoting 1. **Performance**: -...
33,684
[ { "from": "human", "value": "I have been using Flex for a while and have not used remoting as of yet. Currently my apps use a webservice that generates xml that I use for databinding. \nWhat would be the benefit to using remoting over an xml webservice in this use case? Is there a general guideline when I s...
I am working in a new part of an existing system. What are the disadvantages of auto-generating the classes for Hibernate for an existing database? I just think that whatever design failures we have at the moment (and there are plenty) we will port to this new part of the system.
Auto-generating classes for Hibernate from an existing database can be a tempting approach, especially for quickly getting up and running. However, there are several disadvantages to this method, particularly when dealing with an existing database that may have design flaws or inefficiencies. Here are some key points t...
31,024
[ { "from": "human", "value": "I am working in a new part of an existing system. What are the disadvantages of auto-generating the classes for Hibernate for an existing database?\nI just think that whatever design failures we have at the moment (and there are plenty) we will port to this new part of the syste...
I need to pause for maybe 500 miliseconds before I submit a form. Here is what I have so far: $(".rowqty input").bind("keyup", function() { $("#ViewCartPage form").animate({ opacity: 1.0 }, 3000).submit() }); so when someone changes the quantity of the input field it submits the form, but I want it to wait for a sli...
You can achieve this by using `setTimeout` to delay the form submission. This way, you can wait for a specified amount of time before actually submitting the form. Additionally, you can clear the timeout if the user keeps typing, ensuring that the form is only submitted after the user has paused for a certain duration....
35,414
[ { "from": "human", "value": "I need to pause for maybe 500 miliseconds before I submit a form. Here is what I have so far:\n $(\".rowqty input\").bind(\"keyup\", function() { $(\"#ViewCartPage form\").animate({ opacity: 1.0 }, 3000).submit() });\n\nso when someone changes the quantity of the input field it...
I have a small web server application I've written in Python that goes and gets some data from a database system and returns it to the user as XML. That part works fine - I can run the Python web server application from the command line and I can have clients connect to it and get data back. At the moment, to run the w...
To properly handle the stopping of your Windows service that runs a web server, you need to ensure that the server stops gracefully when the service receives a stop command. The main issue in your current implementation is that you create a new instance of `BaseHTTPServer.HTTPServer` inside the `while` loop of the `Svc...
27,323
[ { "from": "human", "value": "I have a small web server application I've written in Python that goes and gets some data from a database system and returns it to the user as XML. That part works fine - I can run the Python web server application from the command line and I can have clients connect to it and g...
I have created a reference to an IIS hosted WCF service in my ASP.NET website project on my local workstation through the "Add Service Reference" option in Visual Studio 2008. I was able to execute the service from my local workstation. When I move the ASP.NET web site using the "Copy Web Site" feature in Visual Studi...
The error you're encountering when moving your ASP.NET website to the development server may be related to a few common issues that can arise when working with WCF services. Here are some steps you can take to troubleshoot and resolve the problem: ### 1. Check the Service URL Ensure that the WCF service URL is access...
33,766
[ { "from": "human", "value": "I have created a reference to an IIS hosted WCF service in my ASP.NET website project on my local workstation through the \"Add Service Reference\" option in Visual Studio 2008. I was able to execute the service from my local workstation.\nWhen I move the ASP.NET web site using...
I would like to create a DLNA server in VB.NET. Since a lot of multimedia devices start supporting DLNA, i would like to see what is possible. Not only streaming video/audio and pictures but see what else can be done. Anybody any starting points? protocol info, some basic code to get started? DLNA is based on UPnP so i...
Creating a DLNA (Digital Living Network Alliance) server in VB.NET is a great project that leverages the UPnP (Universal Plug and Play) protocol as the underlying framework. DLNA is built on top of UPnP, and it defines specific media sharing protocols and profiles that allow devices to communicate and share media over ...
31,469
[ { "from": "human", "value": "I would like to create a DLNA server in VB.NET.\nSince a lot of multimedia devices start supporting DLNA, i would like to see what is possible. Not only streaming video/audio and pictures but see what else can be done.\nAnybody any starting points? protocol info, some basic code...
I have two tables (renamed/refactored for illustrative purposes) with a Many-To-Many relationship in an HSQL database. I want everything to be wiped out when I delete from one side of a Many-to-Many relationship (without querying the table; this is performance critical) Here are my main tables: CREATE TABLE PERSON ( ...
To achieve the desired behavior where deleting a person from the `PERSON` table also results in the deletion of the associated jobs from the `JOB` table if they would become orphaned (i.e., if there are no remaining associations in the `JOB_PERSON` table), you will need to implement additional logic beyond what foreign...
30,006
[ { "from": "human", "value": "I have two tables (renamed/refactored for illustrative purposes) with a Many-To-Many relationship in an HSQL database. I want everything to be wiped out when I delete from one side of a Many-to-Many relationship (without querying the table; this is performance critical)\nHere a...
I tried this on J2ME try { Image immutableThumb = Image.createImage( temp, 0, temp.length); } catch (Exception ex) { System.out.println(ex); } I hit this error: java.lang.IllegalArgumentException: How do I solve this?
In J2ME, the `Image.createImage(byte[] imageData, int offset, int length)` method creates an image from a byte array. The `IllegalArgumentException` you're encountering indicates that the arguments you're passing to this method are not valid. Here are a few common causes of this error and how to solve them: 1. **Check...
33,466
[ { "from": "human", "value": "I tried this on J2ME\ntry {\n Image immutableThumb = Image.createImage( temp, 0, temp.length);\n} catch (Exception ex) {\n System.out.println(ex);\n}\n\nI hit this error: \njava.lang.IllegalArgumentException:\nHow do I solve this?\n" }, { "from": "gpt", "value"...
I have modified (very slightly) the Mootools class noobSlide (http://www.efectorelativo.net/laboratory/noobSlide/) to create a flickr style photostream. Here is the modified html (note you can see the original on the above page) print("code sample");<h2>Sample 2</h2> <div class="sample"> <div class="mask4"> <div id...
To integrate an AJAX call into your `noobSlide` implementation using MooTools, you can follow these steps: 1. **Set up your server-side to return a set of images.** You will want to create an endpoint (e.g., `images.php`) that returns a JSON array of image URLs. For simplicity, let's assume your endpoint returns an ar...
32,952
[ { "from": "human", "value": "I have modified (very slightly) the Mootools class noobSlide (http://www.efectorelativo.net/laboratory/noobSlide/) to create a flickr style photostream.\nHere is the modified html (note you can see the original on the above page)\nprint(\"code sample\");<h2>Sample 2</h2>\n<div c...
I'm writing an application in PHP 5. I want to delete some rows in a SQLite v2 database file. I'm doing something like this: $sqliteConnection = new SQLiteDatabase('path/to/db'); $queryString = "DELETE FROM myTable WHERE status='not good'"; $result = $sqliteConnection->query($queryString); how can I know how many rows...
In SQLite, after executing a DELETE operation (or any operation that modifies data), you can use the `changes()` method of the SQLiteDatabase object to get the number of rows that were affected by the last operation. Here's how you can modify your code to check how many rows were deleted: ```php $sqliteConnection = ...
36,253
[ { "from": "human", "value": "I'm writing an application in PHP 5. I want to delete some rows in a SQLite v2 database file. I'm doing something like this:\n$sqliteConnection = new SQLiteDatabase('path/to/db');\n$queryString = \"DELETE FROM myTable WHERE status='not good'\";\n$result = $sqliteConnection->quer...
As I mention in an earlier question, I'm refactoring a project I'm working on. Right now, everything depends on everything else. Everything is separated into namespaces I created early on, but I don't think my method of separtion was very good. I'm trying to eliminate cases where an object depends on another object in ...
You're facing a common challenge in software design—managing dependencies and ensuring that your components are loosely coupled while still providing the necessary functionality. Both of the approaches you mentioned have their pros and cons, so let’s explore them further and consider the best practices for your situati...
33,979
[ { "from": "human", "value": "As I mention in an earlier question, I'm refactoring a project I'm working on. Right now, everything depends on everything else. Everything is separated into namespaces I created early on, but I don't think my method of separtion was very good. I'm trying to eliminate cases wher...
My stored procedure has an output parameter: @ID INT OUT How can I retrieve this using ado.net? using (SqlConnection conn = new SqlConnection(...)) { SqlCommand cmd = new SqlCommand("sproc", conn); cmd.CommandType = CommandType.StoredProcedure; // add parameters conn.Open(); // *** read output p...
To retrieve an output parameter from a stored procedure using ADO.NET, you need to define the output parameter in your `SqlCommand` object, execute the command, and then read the value after execution. Below is a step-by-step example of how to do this: ```csharp using System; using System.Data; using System.Data.SqlCl...
34,998
[ { "from": "human", "value": "My stored procedure has an output parameter:\n@ID INT OUT\n\nHow can I retrieve this using ado.net?\nusing (SqlConnection conn = new SqlConnection(...))\n{\n SqlCommand cmd = new SqlCommand(\"sproc\", conn);\n cmd.CommandType = CommandType.StoredProcedure;\n\n // add pa...
Does anyone know if an API exists for Linq's DataContext generator? I reflected SqlMetal.exe, but every class was marked internal. I would like to generate a datacontext .cs like sqlmetal, but from my own assembly. Thanks! James
As of my last knowledge update in October 2023, there isn't a direct public API exposed for the `SqlMetal.exe` tool or the LINQ to SQL `DataContext` generator. The `SqlMetal` tool is primarily a command-line utility provided by Microsoft to generate the DataContext and entity classes from a database schema. However, y...
35,426
[ { "from": "human", "value": "Does anyone know if an API exists for Linq's DataContext generator? I reflected SqlMetal.exe, but every class was marked internal. I would like to generate a datacontext .cs like sqlmetal, but from my own assembly. \nThanks!\nJames\n" }, { "from": "gpt", "value": ...
Is there any clever method out there to make my executeEveryDayMethod() execute once a day, without having to involve the Windows TaskScheduler?
Certainly! If you want to execute a method once a day without using Windows Task Scheduler, you can achieve this in several ways depending on the context in which you are running your code. Below are a few clever methods you might consider, especially if you're working in an environment like a desktop application, a we...
33,318
[ { "from": "human", "value": "Is there any clever method out there to make my executeEveryDayMethod() execute once a day, without having to involve the Windows TaskScheduler?\n" }, { "from": "gpt", "value": "Certainly! If you want to execute a method once a day without using Windows Task Schedule...
I'm trying to find a way to automate some exception logging code to add to the stack information already available. Is there any way to use reflection to retrieve the values of all variables on the stack (locals and parameters) - I sincerely doubt the names of the variables are available, but in many cases it would be ...
In .NET, using reflection to inspect local variables and parameters on the call stack of a method is not directly supported. However, you can use the `System.Diagnostics.StackTrace` and `System.Diagnostics.StackFrame` classes to capture the stack trace and get some information about method calls, including parameter va...
31,573
[ { "from": "human", "value": "I'm trying to find a way to automate some exception logging code to add to the stack information already available.\nIs there any way to use reflection to retrieve the values of all variables on the stack (locals and parameters) - I sincerely doubt the names of the variables are...
Folks, TIBCO has announced support for WCF channels back in April - has anything of that materialized by now?? Where and how can I download either these new WCF channel bits, or where can I get my hands on a current .NET 2.0/3.5 version of the "TIBCO.EMS .NET client library" ?? We're a small ISV without any ties to TI...
Hi Marc, It sounds like you've had quite the experience trying to get TIBCO EMS working with your .NET application. When it comes to integrating with TIBCO EMS, there are a few options available to you: 1. **TIBCO EMS .NET Client Library**: The native TIBCO EMS .NET client library is typically the preferred method fo...
35,608
[ { "from": "human", "value": "Folks,\nTIBCO has announced support for WCF channels back in April - has anything of that materialized by now??\nWhere and how can I download either these new WCF channel bits, or where can I get my hands on a current .NET 2.0/3.5 version of the \"TIBCO.EMS .NET client library\"...
I have a VB application which extracts data and creates 3 CSV files (a.csv, b.csv, c.csv). Then I use another Excel spreadsheet (import.xls) to import all the data from the above CSV files into this sheet. import.xls file has a macro which opens the CSV files one by one and copies the data. The problem I am facing is t...
To solve the issue of the date formatting when copying data from CSV files to your Excel sheet, you can modify the Excel VBA macro in your `import.xls` file. The goal is to convert the dates from mm/dd/yyyy format to dd/mm/yyyy format as you copy them. Here's a general approach you can take within your Excel macro: 1...
27,123
[ { "from": "human", "value": "I have a VB application which extracts data and creates 3 CSV files (a.csv, b.csv, c.csv). Then I use another Excel spreadsheet (import.xls) to import all the data from the above CSV files into this sheet.\nimport.xls file has a macro which opens the CSV files one by one and cop...
I am modifying some code and came across a declaration that I am having trouble understanding: int *userMask[3][4] = {0}; What exactly is this pointing to? Is it a matrix where every element is a pointer? Or is it pointing to a matrix of size [3][4]? Thanks I guess my question is how userMask[2][maskElement][user] ...
Let's break down the declaration: ```c int *userMask[3][4] = {0}; ``` 1. **Understanding the Declaration**: - `userMask` is an array of pointers. - It is a two-dimensional array with dimensions `[3][4]`, meaning it can hold 12 pointers (3 rows and 4 columns). - Each element in this array (`userMask[i][j]`) i...
32,971
[ { "from": "human", "value": "I am modifying some code and came across a declaration that I am having trouble understanding:\nint *userMask[3][4] = {0};\n\nWhat exactly is this pointing to? Is it a matrix where every element is a pointer? Or is it pointing to a matrix of size [3][4]?\nThanks\n\nI guess my ...
I have been scouring the web for a code sample that shows how to use pbuffer with GLUT but I could not find anything... I am puzzled with the context switching between pbuffer and the rendering window. I guess that I will have to use glutSetWindow to switch between the two rendering surface but I am not too sure about...
Using pixel buffers (pbuffers) with GLUT can be somewhat complex, as GLUT itself does not natively support pbuffers. However, you can still manage pbuffers by using OpenGL and extensions, specifically WGL for Windows or GLX for Linux. Below, I will outline a simple example of how to create and use a pbuffer in a GLUT a...
26,628
[ { "from": "human", "value": "I have been scouring the web for a code sample that shows how to use pbuffer with GLUT but I could not find anything... \nI am puzzled with the context switching between pbuffer and the rendering window. I guess that I will have to use glutSetWindow to switch between the two ren...
Some databases support commands such as: SELECT TOP 10 START AT 10 * FROM <TABLE> Essentially I need to pull the first 10 records, then the next 10, then the next 10 etc. Maybe there is another way to do this but in the past I've done it like the above for databases that support 'START AT'.
To achieve pagination in SQL, where you pull a specific number of records (e.g., 10) starting from a specific offset (e.g., 10 for the second page), you can use different approaches depending on the SQL dialect supported by your database. Here's how to do it in various popular SQL databases: ### SQL Server In SQL Serv...
33,196
[ { "from": "human", "value": "Some databases support commands such as:\nSELECT TOP 10 START AT 10 * FROM <TABLE>\n\nEssentially I need to pull the first 10 records, then the next 10, then the next 10 etc. Maybe there is another way to do this but in the past I've done it like the above for databases that su...
I'm working on an online tool for students in my faculty to calculate their final grade for their degrees, and for a while I've had little problems. Students seem to like using the new UI and I've suffered no criticism for a while. Now, I need to add some functionality to the program, meaning the UI will have to chance...
When it comes to user interfaces (UIs), especially in applications that are used frequently by a specific audience, there are several considerations you should keep in mind when thinking about updates or changes: ### 1. **User Feedback and Needs:** - **Understand User Needs:** Before making any changes, gather feed...
35,246
[ { "from": "human", "value": "I'm working on an online tool for students in my faculty to calculate their final grade for their degrees, and for a while I've had little problems. Students seem to like using the new UI and I've suffered no criticism for a while. Now, I need to add some functionality to the pr...
I have a class which is marked with a custom attribute, like this: public class OrderLine : Entity { ... [Parent] public Order Order { get; set; } public Address ShippingAddress{ get; set; } ... } I want to write a generic method, where I need to get the Property on a Entity which is marked with th...
To create a generic method that retrieves the property marked with the `Parent` attribute from a given entity type, you can make use of reflection in C#. Here's how you can implement this: 1. Create a generic method that takes a type parameter for the entity. 2. Use reflection to get the properties of that type. 3. Ch...
33,101
[ { "from": "human", "value": "I have a class which is marked with a custom attribute, like this:\npublic class OrderLine : Entity\n{\n ...\n [Parent]\n public Order Order { get; set; }\n public Address ShippingAddress{ get; set; }\n ...\n}\n\nI want to write a generic method, where I need to g...
In an application I work on, any business logic error causes an exception to be thrown, and the calling code handles the exception. This pattern is used throughout the application and works well. I have a situation where I will be attempting to execute a number of business tasks from inside the business layer. The ...
In .NET 3.5, since you do not have access to `AggregateException` (introduced in .NET 4.0), you can create your own custom exception that can hold multiple exceptions. This custom exception can encapsulate a collection of the caught exceptions and provide a way for the calling code to access them. Here’s an approach y...
31,202
[ { "from": "human", "value": "In an application I work on, any business logic error causes an exception to be thrown, and the calling code handles the exception. This pattern is used throughout the application and works well. \nI have a situation where I will be attempting to execute a number of business t...
The C++ friend keyword allows a class A to designate class B as its friend. This allows Class B to access the private/protected members of class A. I've never read anything as to why this was left out of C# (and VB.NET). Most answers to this earlier StackOverflow question seem to be saying it is a useful part of C++ a...
The absence of the `friend` keyword in C# is a design choice that reflects a different approach to access control and encapsulation compared to C++. While `friend` provides a fine-grained control mechanism allowing specific classes to access another class's private and protected members, C# relies on other constructs t...
25,747
[ { "from": "human", "value": "The C++ friend keyword allows a class A to designate class B as its friend. This allows Class B to access the private/protected members of class A.\nI've never read anything as to why this was left out of C# (and VB.NET). Most answers to this earlier StackOverflow question seem...
I was reading Java Platform Performance (sadly the link seems to have disappeared from the internet since I originally posed this question) and section A.3.3 worried me. I had been working on the assumption that a variable that dropped out of scope would no longer be considered a GC root, but this paper appears to cont...
Your concerns about garbage collection (GC) and local variable scoping in Java are understandable, especially considering the potential implications for memory management in long-running applications. Let's clarify some of the points you raised and see how they apply to modern JVMs, particularly those after the version...
33,212
[ { "from": "human", "value": "I was reading Java Platform Performance (sadly the link seems to have disappeared from the internet since I originally posed this question) and section A.3.3 worried me.\nI had been working on the assumption that a variable that dropped out of scope would no longer be considered...
I am trying to make a library that wraps libpurple (you shouldn't need to know anything about libpurple to help here). Libpurple in turn loads "plugins" which are just .so's accessed via something like dlopen. Those plugins in turn call back to functions in libpurple. I can build my library just fine, but when it calls...
It seems like you're encountering a common issue related to symbol visibility and dynamic linking in shared libraries. The error message indicates that when the plugin (`autoaccept.so`) tries to use the `purple_user_dir` function, it cannot find it, even though it is defined in the `libpurple` shared library. Here are...
32,887
[ { "from": "human", "value": "I am trying to make a library that wraps libpurple (you shouldn't need to know anything about libpurple to help here). Libpurple in turn loads \"plugins\" which are just .so's accessed via something like dlopen. Those plugins in turn call back to functions in libpurple.\nI can b...
I am using the ASP.Net plugin and control provided by reCAPTCHA. I can successfully get the control to work if the submit button on the web form is not in a validationgroup. There is no validationgroup attribute for the reCAPTCHA control. Has anybody had any success with this or any solutions to get the reCAPTCHA cont...
Using the reCAPTCHA control with ASP.NET validation groups can be a bit tricky, since reCAPTCHA does not have a built-in mechanism to directly tie its validation to a validation group. However, you can implement a workaround to ensure that the reCAPTCHA validation works properly in conjunction with your validation grou...
33,696
[ { "from": "human", "value": "I am using the ASP.Net plugin and control provided by reCAPTCHA. I can successfully get the control to work if the submit button on the web form is not in a validationgroup. There is no validationgroup attribute for the reCAPTCHA control. \nHas anybody had any success with this ...
I have a little javascript function which is attached to an onClick event of a button. It appears to work perfectly in Firefox(3.0.4), but both Opera(9.62) and IE fails to execute any other JS from the same .js file, including what normally works. The following function is the culprit: function deleteComment(id){ $....
The issue you're encountering may not necessarily be due to jQuery itself but could stem from a syntax error or conflict elsewhere in your JavaScript code. The snippet you provided looks correct in terms of syntax. However, since you've mentioned that there's a syntax error being reported in the second line, it's worth...
35,381
[ { "from": "human", "value": "I have a little javascript function which is attached to an onClick event of a button. It appears to work perfectly in Firefox(3.0.4), but both Opera(9.62) and IE fails to execute any other JS from the same .js file, including what normally works. The following function is the c...
I love programming with and for Windows Presentation Framework. Mostly I write browser-like apps using WPF and XAML. But what really annoys me is the slowness of WPF. A simple page with only a few controls loads fast enough, but as soon as a page is a teeny weeny bit more complex, like containing a lot of data entry fi...
I understand your frustration with the performance of WPF applications, especially when dealing with complex UI components. Here are some strategies to help you speed up WPF applications, as well as ways to profile bottlenecks: ### Ways to Speed Up WPF 1. **Virtualization**: - Use `VirtualizingStackPanel` for cont...
31,719
[ { "from": "human", "value": "I love programming with and for Windows Presentation Framework. Mostly I write browser-like apps using WPF and XAML.\nBut what really annoys me is the slowness of WPF. A simple page with only a few controls loads fast enough, but as soon as a page is a teeny weeny bit more compl...
How can I tell if an App is ASP.NET 2.0 or ASP.NET 1.1. This is in C# I don't have the source code and I don't have access to IIS Manager. But I can ftp and check the ASPX files. Any Ideas?
Identifying whether an ASP.NET application is built on version 1.1 or 2.0 can be somewhat tricky, especially if you do not have direct access to the server settings or source code. However, there are a few approaches you can take to infer the version based on the ASPX files and behavior of the application. Here are som...
32,231
[ { "from": "human", "value": "How can I tell if an App is ASP.NET 2.0 or ASP.NET 1.1. This is in C#\nI don't have the source code and I don't have access to IIS Manager. But I can ftp and check the ASPX files. Any Ideas?\n" }, { "from": "gpt", "value": "Identifying whether an ASP.NET application...
I have a loop running that will process 1000's of records, currently once the loop is running it can't be stopped and the user must wait until it is finished. How can I stop the loop when someone clicks a 'Cancel' button? How do I break into that other routine? Thanks
To make your loop responsive to user input, such as a 'Cancel' button, you can use several techniques depending on the environment and programming language you are using. Below are some general approaches: ### In a GUI Application If you are developing a graphical user interface (GUI) application, you can utilize mult...
30,694
[ { "from": "human", "value": "I have a loop running that will process 1000's of records, currently once the loop is running it can't be stopped and the user must wait until it is finished. How can I stop the loop when someone clicks a 'Cancel' button? How do I break into that other routine?\nThanks\n" }, ...
I designed a data model which is represented by an XSD scheme. The data model also provides the types that are being used as web service parameters in a WSDL descriptor. I would like to send the XSD scheme around and ask the people involved to peer review the data model. What tool or presentation method would you sugge...
To facilitate a peer review of your XSD schema while making it accessible and understandable to individuals without deep technical expertise, consider the following tools and methods: ### 1. **Documentation Generation Tools** You can use tools that generate readable documentation from your XSD schema, similar to JavaD...
30,784
[ { "from": "human", "value": "I designed a data model which is represented by an XSD scheme.\nThe data model also provides the types that are being used as web service parameters in a WSDL descriptor.\nI would like to send the XSD scheme around and ask the people involved to peer review the data model.\nWhat...
Spring Workflow has now been published. Have you tried it yet? For what kind of scenario? What is your impression? How do you find it stacks up against other workflow libs? Found any good docs or tutorials?
As of my last update in October 2023, I don’t have the capability to try software or libraries myself, including Spring Workflow. However, I can provide insights based on existing knowledge and typical scenarios for workflow libraries. ### Scenarios for Using Spring Workflow 1. **Microservices Orchestration**: If you...
35,162
[ { "from": "human", "value": "Spring Workflow has now been published.\n\nHave you tried it yet? For what kind of scenario?\nWhat is your impression? How do you find it stacks up against other workflow libs?\nFound any good docs or tutorials?\n\n" }, { "from": "gpt", "value": "As of my last update...
I am using a simple Zend_Auth setup to authenticate users for one of my applications, using a check in the preDispatch() method in a controller plugin. When anonymous users navigate to /users/view/id/6 for example, they should be redirected to the above URI after authentication. What is the best way to do this? I'd p...
When using Zend Framework's `Zend_Auth` for user authentication and needing to redirect users back to their originally requested URL after they log in, there are a few different approaches you can take. Storing the entire Zend Request object may not be the best option, as it could lead to unnecessary complexity or larg...
35,184
[ { "from": "human", "value": "I am using a simple Zend_Auth setup to authenticate users for one of my applications, using a check in the preDispatch() method in a controller plugin. When anonymous users navigate to \n/users/view/id/6\n\nfor example, they should be redirected to the above URI after authentica...
When you plot things in Matlab, the most recently plotted data series is placed on top of whatever's already there. For example: figure; hold on plot(sin(linspace(0,pi)),'linewidth',4,'color',[0 0 1]) plot(cos(linspace(0,pi)),'linewidth',4,'color',[1 0 0]) Here, the red line is shown on top of the blue line (where the...
In MATLAB, the order of plotted objects in a figure is determined by the order in which they are plotted, with later plots appearing on top of earlier ones. However, MATLAB doesn't have a built-in functionality to specify "depth" of lines directly, but you can manage the z-order of graphical objects by utilizing the `u...
32,488
[ { "from": "human", "value": "When you plot things in Matlab, the most recently plotted data series is placed on top of whatever's already there. For example:\nfigure; hold on\nplot(sin(linspace(0,pi)),'linewidth',4,'color',[0 0 1])\nplot(cos(linspace(0,pi)),'linewidth',4,'color',[1 0 0])\n\nHere, the red li...
I need to create a web application installer. Install Shield seems like overkill, is there something that can reliably install a web application (IIS setup + sql server db setup). Suggestions?
If you're looking for a simpler solution than InstallShield for creating an installer for your web application that sets up IIS and a SQL Server database, consider the following options: ### 1. **WiX Toolset** - **Description:** WiX (Windows Installer XML) is a free toolset that builds Windows installation packages fr...
29,312
[ { "from": "human", "value": "I need to create a web application installer.\nInstall Shield seems like overkill, is there something that can reliably install a web application (IIS setup + sql server db setup).\nSuggestions?\n" }, { "from": "gpt", "value": "If you're looking for a simpler solutio...
I am trying to get Silverlight to work with a quick sample application and am calling a rest service on a another computer. The server that has the rest service has a clientaccesspolicy.xml which looks like: <access-policy> <cross-domain-access> <policy> <allow-from http-request-headers="*"> ...
The issue you're encountering with Silverlight and the `SecurityException` when making a cross-domain request can stem from several potential reasons, even if your `clientaccesspolicy.xml` is set up to allow cross-domain access. Here are several things you can check and troubleshoot to resolve the problem: 1. **Check ...
32,370
[ { "from": "human", "value": "I am trying to get Silverlight to work with a quick sample application and am calling a rest service on a another computer. The server that has the rest service has a clientaccesspolicy.xml which looks like:\n<access-policy>\n <cross-domain-access>\n <policy>\n ...
I have been trying to get PEAR::mail to successfully deliver emails to hotmail users without being flagged as SPAM and ending up in the junk folder, i have no problems with yahoo/gmail only with hotmail. google suggested that this is a common problem with hotmail and that possible causes can include incorrect reverse ...
It sounds like you have already done a good amount of troubleshooting regarding your email delivery issues with Hotmail. Here are several additional suggestions to help improve your email deliverability to Hotmail users: 1. **Authenticate Your Email**: - Ensure that your SPF, DKIM, and DMARC records are properly se...
34,093
[ { "from": "human", "value": "I have been trying to get PEAR::mail to successfully deliver emails to hotmail users without being flagged as SPAM and ending up in the junk folder, i have no problems with yahoo/gmail only with hotmail.\ngoogle suggested that this is a common problem with hotmail and that possi...
So... I used to think that when you accessed a file but specified the name without a path (CAISLog.csv in my case) that .NET would expect the file to reside at the same path as the running .exe. This works when I'm stepping through a solution (C# .NET2.* VS2K5) but when I run the app in normal mode (Started by a We...
When you're working with file paths in .NET (and more generally in programming), it's important to understand how relative paths are resolved. The behavior you're observing stems from the working directory of the process rather than the location of the executable itself. Here's a clearer breakdown of the concepts invol...
31,414
[ { "from": "human", "value": "So... I used to think that when you accessed a file but specified the name without a path (CAISLog.csv in my case) that .NET would expect the file to reside at the same path as the running .exe. \nThis works when I'm stepping through a solution (C# .NET2.* VS2K5) but when I r...
So I'm generating a random number using Rnd and Randomize to set a seed that looks like this: Randomize lSeed Response.Write Rnd I'm noticing that it's returning the same result for two values in a row for lSeed (e.g. 123, 124) but then on say 125 it will return a new value but 126 will be the same as the on for 125. ...
The behavior you're observing with the `Rnd` function in VBScript (or similar environments) is due to how the `Randomize` function initializes the random number generator and how the `Rnd` function generates its values. ### Explanation of `Randomize` and `Rnd` 1. **Randomize Function**: The `Randomize` function initi...
32,931
[ { "from": "human", "value": "So I'm generating a random number using Rnd and Randomize to set a seed that looks like this:\nRandomize lSeed\nResponse.Write Rnd\n\nI'm noticing that it's returning the same result for two values in a row for lSeed (e.g. 123, 124) but then on say 125 it will return a new value...
Is there an efficient way to take a subset of a C# array and pass it to another peice of code (without modifying the original array)? I use CUDA.net which has a function which copies an array to the GPU. I would like to e.g. pass the function a 10th of the array and thus copy each 10th of the array to the GPU seperatel...
In C#, you can efficiently create a subset of an array without modifying the original array by using the `Array.Copy` method or by using the `ArraySegment<T>` struct. However, if you're looking for performance close to using unsafe code, you can also consider using pointers and unsafe code blocks. ### Option 1: Using ...
34,320
[ { "from": "human", "value": "Is there an efficient way to take a subset of a C# array and pass it to another peice of code (without modifying the original array)? I use CUDA.net which has a function which copies an array to the GPU. I would like to e.g. pass the function a 10th of the array and thus copy ea...
I have essentially a survey that is shown, and people answer questions a lot like a test, and there are different paths, it is pretty easy so far, but i wanted to make it more dynamic, so that i can have a generic rule that is for the test with all the paths, to make the evaluator easier to work with currently i just ...
It sounds like you want to simplify the logic of your survey rules by making it easier to express AND/OR combinations without having to manually create a large number of rules. This can indeed be done effectively by employing a tree or graph structure to evaluate the rules dynamically. Here's a simplified approach to a...
31,614
[ { "from": "human", "value": "I have essentially a survey that is shown, and people answer questions a lot like a test,\nand there are different paths, it is pretty easy so far, but i wanted to make it more dynamic, so that i can have a generic rule that is for the test with all the paths, to make the evalu...
Pexpect can be used to automate tasks in python (does not need TCL to be installed). One of the simplest routines of this class is the 'run()' routine. It accepts a dictionary of expected question patterns as keys and the responses as values. For example pexpect.run ('scp foo myname@host.example.com:.', events={'(?i)pa...
In the context of the `pexpect` library and the regular expression syntax used within it, the `(?i)` notation is a modifier that indicates case-insensitive matching. To break it down: - `(?i)`: This is a case-insensitive flag that tells the regex engine to ignore the case of the letters when matching. For example, i...
35,404
[ { "from": "human", "value": "Pexpect can be used to automate tasks in python (does not need TCL to be installed). One of the simplest routines of this class is the 'run()' routine. It accepts a dictionary of expected question patterns as keys and the responses as values. For example\npexpect.run ('scp foo m...
I'm interested to find which way of creating box shadows with css is most effective. But that I mean : ease of implementation, flexibility, and cross browser compatibility.
Creating box shadows in CSS can be done primarily with the `box-shadow` property, which is the most effective and widely supported method for adding shadows to elements. Let's explore the criteria you mentioned: ease of implementation, flexibility, and cross-browser compatibility. ### 1. Ease of Implementation The `b...
31,046
[ { "from": "human", "value": "I'm interested to find which way of creating box shadows with css is most effective. But that I mean : ease of implementation, flexibility, and cross browser compatibility. \n" }, { "from": "gpt", "value": "Creating box shadows in CSS can be done primarily with the `...
I'm not talking about a pointer to an instance, I want a pointer to a class itself.
In C++, you can get a pointer to a class itself by using the class's type. In this context, it's important to distinguish between pointers to instances (objects) of a class and pointers to the class type itself. While C++ does not have a direct construct like "pointer to a class," you typically refer to the class typ...
33,232
[ { "from": "human", "value": "I'm not talking about a pointer to an instance, I want a pointer to a class itself.\n" }, { "from": "gpt", "value": "In C++, you can get a pointer to a class itself by using the class's type. In this context, it's important to distinguish between pointers to instance...
Is there any way in JavaScript to create a "weak reference" to another object? Here is the wiki page describing what a weak reference is. Here is another article that describes them in Java. Can anyone think of a way to implement this behavior in JavaScript?
In JavaScript, you can create weak references to objects using the `WeakRef` class, which was introduced in ECMAScript 2021 (ES12). A weak reference allows you to hold a reference to an object without preventing it from being garbage collected. This is particularly useful for caching or for scenarios where you want to ...
32,346
[ { "from": "human", "value": "Is there any way in JavaScript to create a \"weak reference\" to another object? Here is the wiki page describing what a weak reference is. Here is another article that describes them in Java. Can anyone think of a way to implement this behavior in JavaScript?\n" }, { "f...
My account is in the securityadmin role and I cannot grant myself sysadmin permission. I wish to gain access to a database so I can add my account to a particular role within it. As I don't yet have access to the database I can't use the UI. Does anyone know if this is possible and what SQL commands will achieve this ...
In SQL Server 2005, if your account is in the `securityadmin` fixed server role, you do have the ability to manage logins and their properties but not the ability to grant `sysadmin` privileges or directly access databases where you don't have permissions. If you wish to gain access to a specific database in order to ...
35,144
[ { "from": "human", "value": "My account is in the securityadmin role and I cannot grant myself sysadmin permission. I wish to gain access to a database so I can add my account to a particular role within it. \nAs I don't yet have access to the database I can't use the UI.\nDoes anyone know if this is possib...
How would I go about writing my own scrollbar using standard Java 2D. I really don't want to use swing, and I've already made up my own component parts for everything else such as buttons etc. I'm not really looking for code, rather the math involved in the event changes and the drawing.
Creating your own scrollbar using standard Java 2D without relying on Swing can be an interesting challenge. Below is a conceptual breakdown of the math and steps involved in implementing a custom scrollbar. ### Understanding the Scrollbar A scrollbar generally consists of three main components: 1. **Track**: The are...
30,330
[ { "from": "human", "value": "How would I go about writing my own scrollbar using standard Java 2D.\nI really don't want to use swing, and I've already made up my own component parts for everything else such as buttons etc.\nI'm not really looking for code, rather the math involved in the event changes and t...
I have a class, and I want to inspect its fields and report eventually how many bytes each field takes. I assume all fields are of type Int32, byte, etc. How can I find out easily how many bytes does the field take? I need something like: Int32 a; // int a_size = a.GetSizeInBytes; // a_size should be 4
In C#, you can use the `System.Runtime.InteropServices.Marshal` class to get the size of various types in bytes. However, since you want to inspect fields of a class, you can also use reflection to iterate through the fields of the class and determine their sizes. Here's an example of how you could achieve this: 1. ...
32,994
[ { "from": "human", "value": "I have a class, and I want to inspect its fields and report eventually how many bytes each field takes. I assume all fields are of type Int32, byte, etc.\nHow can I find out easily how many bytes does the field take?\nI need something like:\nInt32 a;\n// int a_size = a.GetSizeI...
I recently rolled an application that automatically encrypted a file output from another internal system using PGP and then sftp’d to a foreign target server directory where it was to be consumed by a third-party application. I have been trying to trouble shoot the whole process for about a week and was getting no resp...
Case sensitivity in file naming is often a nuanced topic, but there are several contexts in which an application might want to honor case sensitivity for user inputs beyond just passwords. Here are some scenarios where this could be important: 1. **Operating System Differences**: Different operating systems handle cas...
31,581
[ { "from": "human", "value": "I recently rolled an application that automatically encrypted a file output from another internal system using PGP and then sftp’d to a foreign target server directory where it was to be consumed by a third-party application. I have been trying to trouble shoot the whole process...
I need to backup the original data from a table so I can fill it with test data, then restore it again after deving / testing etc.. Anyone know any quick ways to achieve this? I'm on SQL Server 2005. Thanks.
Certainly! Backing up and restoring data in SQL Server 2005 can be accomplished using several methods, but the most straightforward approach is to use a temporary table to store the original data before you insert your test data. Here’s a step-by-step guide on how to do this: ### Step 1: Backup Original Data 1. **Cre...
33,774
[ { "from": "human", "value": "I need to backup the original data from a table so I can fill it with test data, then restore it again after deving / testing etc.. Anyone know any quick ways to achieve this? I'm on SQL Server 2005.\nThanks.\n" }, { "from": "gpt", "value": "Certainly! Backing up and...
In a database prototype, I have a set of fields (like name, description, status) that are required in multiple, functionally different tables. These fields always have the same end user functionality for labeling, display, search, filtering etc. They are not part of a foreign key constraint. How should this be modeled?...
When dealing with common fields that are required across multiple, functionally different tables in a database prototype, it's crucial to ensure clarity, maintainability, and performance. Let's break down the options you've considered and evaluate their merits and drawbacks. ### Option 1: Each Table Gets All These Att...
30,756
[ { "from": "human", "value": "In a database prototype, I have a set of fields (like name, description, status) that are required in multiple, functionally different tables.\nThese fields always have the same end user functionality for labeling, display, search, filtering etc. They are not part of a foreign k...
In VB.NET, which is better to use: function overloading or default parameters?
The choice between using function overloading and default parameters in VB.NET depends on the specific use case, code readability, maintainability, and developer preference. Here’s a breakdown of the pros and cons of each approach to help you decide which might be better for your situation: ### Function Overloading *...
34,842
[ { "from": "human", "value": "In VB.NET, which is better to use: function overloading or default parameters?\n" }, { "from": "gpt", "value": "The choice between using function overloading and default parameters in VB.NET depends on the specific use case, code readability, maintainability, and dev...
Is there any IDE (like VS) with drag and drop support for building python GUI, connecting to dbs etc? Eventhough I am an emacs guy, I find it much easier to create GUI with VS.
Yes, there are several Integrated Development Environments (IDEs) and tools that offer drag-and-drop support for building Python GUI applications, along with database connectivity features. Here are some popular options: 1. **PyQt Designer**: - PyQt includes a tool called Qt Designer, which allows you to create GUI...
34,641
[ { "from": "human", "value": "Is there any IDE (like VS) with drag and drop support for building python GUI, connecting to dbs etc?\nEventhough I am an emacs guy, I find it much easier to create GUI with VS.\n" }, { "from": "gpt", "value": "Yes, there are several Integrated Development Environmen...
Does anyone know if it is possible to install SQL 2000 Reporting Services Server side by side with SQL 2005 Reporting Services Server? The Reports and ReportServer virual directories are both virtual directories in the default website and they use different .net frameworks. Is this even allowed? Do I need to create a n...
Installing SQL Server 2000 Reporting Services side by side with SQL Server 2005 Reporting Services on the same server can be a bit tricky due to the differences in the .NET Framework versions and other configurations. Here's a summary of what you should consider: 1. **.NET Framework Requirements**: SQL Server 2000 Rep...
35,394
[ { "from": "human", "value": "Does anyone know if it is possible to install SQL 2000 Reporting Services Server side by side with SQL 2005 Reporting Services Server?\nThe Reports and ReportServer virual directories are both virtual directories in the default website and they use different .net frameworks. Is ...
In C++, is it possible to have a base plus derived class implement a single interface? For example: class Interface { public: virtual void BaseFunction() = 0; virtual void DerivedFunction() = 0; }; class Base { public: virtual void BaseFunction(){} }; class Derived : public Base, publi...
Yes, your understanding is correct; in C++, when you have a derived class that inherits from both a base class and an interface, the derived class must implement all the pure virtual functions from the interface, and also ensure that the base class’s methods fulfill any interface requirements. In your case, the `Deri...
35,191
[ { "from": "human", "value": "In C++, is it possible to have a base plus derived class implement a single interface?\nFor example:\nclass Interface\n{\n public:\n virtual void BaseFunction() = 0;\n virtual void DerivedFunction() = 0;\n};\n\nclass Base\n{\n public:\n virtual void Ba...
I have been hearing a lot about Ruby and possibly even Javascript being "true" object oriented languages as opposed to C++ and C# which are class oriented (or template based) languages. What is meant by true OO and what are the advantages of this over the class/template approach?
The terms "true object-oriented" (OO) and "class-oriented" can be somewhat misleading and are often a source of confusion in the programming community. Here’s a breakdown of the concepts involved: ### True Object-Oriented Languages **True Object-Oriented Languages** are often described as those that treat everything a...
33,685
[ { "from": "human", "value": "I have been hearing a lot about Ruby and possibly even Javascript being \"true\" object oriented languages as opposed to C++ and C# which are class oriented (or template based) languages. What is meant by true OO and what are the advantages of this over the class/template approa...
What tool or method do you recommend to find and replace values in your code? If code is on Linux/Unix, are find and grep the best method?
In a Linux/Unix environment, `find` and `grep` are powerful tools for locating files and searching through their contents, but they aren't typically used together for find-and-replace operations directly. Here are a few recommended methods and tools you might consider for finding and replacing values in your code: 1. ...
32,871
[ { "from": "human", "value": "What tool or method do you recommend to find and replace values in your code? If code is on Linux/Unix, are find and grep the best method?\n" }, { "from": "gpt", "value": "In a Linux/Unix environment, `find` and `grep` are powerful tools for locating files and search...
I plan to have 2 projects. 1. mbtech.crm.mvc 2. mbtech.crm.tests I will have a solution named mbtech.crm What is the best way to set these up so that I can track them in Subversion? Option 1 (then where does my solution file go)? - mbtech.crm.mvc    - tags    - trunk    - branches - mbtech.crm.tests    - tags    -...
When structuring a project repository in Subversion (SVN), the main goals are to maintain clarity, facilitate collaboration, and organize your code effectively. Given the two options you've provided, here's a breakdown to help you decide: ### Option 1 ``` mbtech.crm.mvc - tags - trunk - branches mbtech.crm.t...
32,945
[ { "from": "human", "value": "I plan to have 2 projects.\n1. mbtech.crm.mvc\n2. mbtech.crm.tests\nI will have a solution named mbtech.crm\nWhat is the best way to set these up so that I can track them in Subversion?\nOption 1 (then where does my solution file go)?\n- mbtech.crm.mvc\n   - tags\n   - trunk\n...
I have a large c# solution file (~100 projects), and I am trying to improve build times. I think that "Copy Local" is wasteful in many cases for us, but I am wondering about best practices. In our .sln, we have application A depending on assembly B which depends on assembly C. In our case, there are dozens of "B" and...
Improving build times in a large C# solution can indeed be quite challenging, especially with respect to project references and the "Copy Local" setting. Here are some insights on how to address both the "Copy Local" issue and the problem of managing different build configurations when splitting your solution into mult...
34,284
[ { "from": "human", "value": "I have a large c# solution file (~100 projects), and I am trying to improve build times. I think that \"Copy Local\" is wasteful in many cases for us, but I am wondering about best practices.\nIn our .sln, we have application A depending on assembly B which depends on assembly ...
In my SQL database, I have a one-to-many relationship, something like this: Teacher Student John Alex John Mike John Sean Bob Jack Gary George Gary Paul I'd like to display a table listing each teacher, with their students as a comma-delimited list, like this: Teacher Students John Ale...
Yes, you can achieve a comma-delimited list of students for each teacher in SQL Server Reporting Services (SSRS) without having to manipulate the SQL query itself. This can be done by using SSRS expressions and grouping features. Here's how you can set it up: ### Steps to Create the Report in SSRS 1. **Set Up Your Da...
34,361
[ { "from": "human", "value": "In my SQL database, I have a one-to-many relationship, something like this:\n\nTeacher Student\nJohn Alex\nJohn Mike\nJohn Sean\nBob Jack\nGary George\nGary Paul\n\nI'd like to display a table listing each teacher, with their students as a comma-delimit...
I am the tech intern for an online independent newspaper, and the writers on the staff are not tech-savvy. They don't quite understand how web pages work, and often they upload and include images straight from their digital cameras, or scanned from original media. These images become a burden when there are 10 images...
It's great that you're thinking about both training the writers and exploring automation for image optimization. Both approaches have their merits, and the best solution may actually involve a combination of the two. ### Automated Image Resampling with PHP and GD Library Creating a PHP function to automatically resiz...
34,008
[ { "from": "human", "value": "I am the tech intern for an online independent newspaper, and the writers on the staff are not tech-savvy. They don't quite understand how web pages work, and often they upload and include images straight from their digital cameras, or scanned from original media. These images...
I have a small project that require a storage (I choose SQLite) and I got good result with the ADO DLL for .Net for Sqlite. After the Install, I noticed that it contain a SQLLinq.dll. Before investigating too much effort, and because I haven't see any good example on the web, I would like to know if anyone got any good...
LINQ (Language Integrated Query) is a powerful feature in .NET that allows you to query various data sources using a consistent syntax. When it comes to using LINQ with SQLite, there are several options available to you, including LINQ to SQL and Entity Framework, both of which can work with SQLite databases. ### LINQ...
33,703
[ { "from": "human", "value": "I have a small project that require a storage (I choose SQLite) and I got good result with the ADO DLL for .Net for Sqlite.\nAfter the Install, I noticed that it contain a SQLLinq.dll. Before investigating too much effort, and because I haven't see any good example on the web, I...
I'm interested in finding out why this is used on some Web sites for processing user-initiated search submissions, how it affects the request and response flow, and programmatically why it would be necessary (or beneficial). In an MVC framework it seems difficult to execute since you are injecting another page into the...
The practice you're referring to is often associated with the implementation of a loading or processing screen that appears when a user submits a request, such as a search or a transaction. This loading screen typically informs users that their request is being processed and helps manage the user's experience during po...
33,741
[ { "from": "human", "value": "I'm interested in finding out why this is used on some Web sites for processing user-initiated search submissions, how it affects the request and response flow, and programmatically why it would be necessary (or beneficial). In an MVC framework it seems difficult to execute sinc...
Here is my code: ThreadStart threadStart = controller.OpenFile; Thread thread = new Thread(threadStart); thread.Start(); In the OpenFile function, my code looks like: System.Console.Error.WriteLine("Launching"); The code in OpenFile doesn't get executed for 30 seconds exactly. It starts immediately on my machine, bu...
When you encounter a situation where a thread's execution is delayed, especially in a production environment, there are several potential causes to investigate. Here are some suggestions to help identify and resolve the issue: 1. **Thread Pool Saturation**: If your application is utilizing thread pooling and there are...
33,301
[ { "from": "human", "value": "Here is my code: \nThreadStart threadStart = controller.OpenFile;\nThread thread = new Thread(threadStart);\nthread.Start();\n\nIn the OpenFile function, my code looks like:\nSystem.Console.Error.WriteLine(\"Launching\");\n\nThe code in OpenFile doesn't get executed for 30 secon...
From some forum I came to know that Multiple database support is added in Django at lower level, but the higher level apis are not added yet. Can anyone please tell me how one can achieve multiple database connections in Django. Does anyone have any idea by when Django will fully/officially support Multiple database co...
Django has supported multiple database connections for quite some time. You can configure multiple databases in your Django project's `settings.py` file and then use these databases for different operations. Here’s how you can set up and use multiple databases in Django: ### Configuring Multiple Databases In your `se...
32,988
[ { "from": "human", "value": "From some forum I came to know that Multiple database support is added in Django at lower level, but the higher level apis are not added yet.\nCan anyone please tell me how one can achieve multiple database connections in Django.\nDoes anyone have any idea by when Django will fu...
I run into this obstacle when my debugger steps into some classfile without corresponding source. Finding it is often difficult: You have to search for the site hosting the respective project, and find its ``download source'' page (for instance, last time I searched for the JPA API, and it took me hours to obtain the...
You've raised a common challenge faced by developers working with third-party libraries or frameworks in Java and other programming languages. The mismatch between compiled bytecode and its corresponding source code can indeed create obstacles in debugging and understanding the code. Here are some thoughts on the situa...
35,006
[ { "from": "human", "value": "I run into this obstacle when my debugger steps into some classfile\nwithout corresponding source. Finding it is often difficult:\n\nYou have to search for the site hosting the respective project,\nand find its ``download source'' page (for instance, last time I searched\nfor t...
I'm writing a lightweight XML editor, and in cases where the user's input is not well formed, I would like to indicate to the user where the problem is, or at least where the first problem is. Does anyone know of an existing algorithm for this? If looking at code helps, if I could fill in the FindIndexOfInvalidXml me...
To create a method that identifies the first index of invalid XML, you'll need to implement a simple parsing logic to check for well-formedness. For XML to be well-formed, it needs to satisfy certain criteria, including: 1. Properly nested tags. 2. Correctly closed tags. 3. No overlapping tags. 4. The proper encoding ...
27,360
[ { "from": "human", "value": "I'm writing a lightweight XML editor, and in cases where the user's input is not well formed, I would like to indicate to the user where the problem is, or at least where the first problem is. Does anyone know of an existing algorithm for this? If looking at code helps, if I c...
Does anyone know how to detect if an instance of a configuration section exists in a .net configuration file without actually having to load the configuration section into memory, and without having to parse the xml file manually - ie, using the System.Configuration namespace. I have tried using System.Configuration.Co...
In .NET, detecting whether a configuration section exists without fully loading it into memory can be a bit tricky, especially since `ConfigurationManager.GetSection()` returns a default instance if the section isn't found. To check if a configuration section exists without loading it into memory, you can directly acc...
30,520
[ { "from": "human", "value": "Does anyone know how to detect if an instance of a configuration section exists in a .net configuration file without actually having to load the configuration section into memory, and without having to parse the xml file manually - ie, using the System.Configuration namespace.\n...
I am struggling with a creating a query. It is related to a large and complicated database but for the sake of this post I have boiled the problem down to something simpler. I have three tables X, Y, Z defined as CREATE TABLE [dbo].[X]( [ID] [bigint] NOT NULL ) CREATE TABLE [dbo].[Y]( [ID] [nchar](10) NOT NULL ) ...
You're on the right track with using a cross join to combine the values from the three tables. However, to get the desired results, you need to ensure that all combinations of `IDX` and `IDY` are accounted for, including those not present in `Z`. You can achieve this by using a `CROSS JOIN` between `X` and `Y`, and t...
34,906
[ { "from": "human", "value": "I am struggling with a creating a query. It is related to a large and complicated database but for the sake of this post I have boiled the problem down to something simpler.\nI have three tables X, Y, Z defined as\nCREATE TABLE [dbo].[X](\n [ID] [bigint] NOT NULL\n)\n\nCREATE T...
We have a system where customers, mainly European enter texts (in UTF-8) that has to be distributed to different systems, most of them accepting UTF-8, but now we must also distribute the texts to a US system which only accepts US-Ascii 7-bit So now we'll need to translate all European characters to the nearest US-Asci...
Yes, there are several Java libraries and approaches you can consider for converting UTF-8 (or any other character encoding) to US-ASCII. This process is commonly referred to as "transliteration," where you replace non-ASCII characters with their closest ASCII equivalents. ### 1. Apache Commons Lang Apache Commons La...
34,758
[ { "from": "human", "value": "We have a system where customers, mainly European enter texts (in UTF-8) that has to be distributed to different systems, most of them accepting UTF-8, but now we must also distribute the texts to a US system which only accepts US-Ascii 7-bit\nSo now we'll need to translate all ...
I'm having some trouble with the Google Maps API; I want to determine a LatLong for a certain place (for example, from the name of a city), then focus my map on it. The LatLong part is working, and so is centering the map on that point. However, I cannot figure out how to determine what a good zoomlevel might be when I...
To dynamically determine a suitable zoom level based on the location provided (e.g., a city name or larger geographic area), you can take a systematic approach that leverages the geographic boundaries of the place you're zooming into. Here's how you can do it: ### Step 1: Use the Google Places API You can use the Goo...
35,539
[ { "from": "human", "value": "I'm having some trouble with the Google Maps API; I want to determine a LatLong for a certain place (for example, from the name of a city), then focus my map on it. The LatLong part is working, and so is centering the map on that point. However, I cannot figure out how to determ...
I am using: set constraints all deferred; (lots of deletes and inserts) commit; This works as expected. If there are any broken relationships then the commit fails and an error is raised listing ONE of the FKs that it fails on. The user fixes the offending data and runs again. then hits another FK issue and repeats ...
In PostgreSQL, when you set constraints to be deferred, the enforcement of those constraints is postponed until the end of the transaction. Unfortunately, when a violation occurs at the time of commit, PostgreSQL will only return an error for one of the foreign key constraints that has been violated. To obtain a list ...
33,386
[ { "from": "human", "value": "I am using:\nset constraints all deferred;\n(lots of deletes and inserts)\ncommit;\n\nThis works as expected. If there are any broken relationships then the commit fails and an error is raised listing ONE of the FKs that it fails on.\nThe user fixes the offending data and runs ...
I'm trying to set up a system that displays calendar items from a resource calendar on a web page using Exchange 2007 and EWS (Exchange Web Services). I've managed to get access to the calendars of the resources, but when getting the items in the calendars, the subject of each calendar item is not the original subject ...
The issue you're experiencing with the subject of the calendar items being displayed as the username of the account that created the meeting rather than the actual subject of the meeting is a common scenario when accessing calendar items through EWS in Exchange. This typically occurs due to permissions or the way the m...
33,493
[ { "from": "human", "value": "I'm trying to set up a system that displays calendar items from a resource calendar on a web page using Exchange 2007 and EWS (Exchange Web Services).\nI've managed to get access to the calendars of the resources, but when getting the items in the calendars, the subject of each ...
I need to convert strings with optional trailing signs into actual numbers using Powershell. Possible strings are: 1000- 323+ 456 I'm trying to use System.Int.TryParse with a NumberStyles of AllowTrailingSign, but I can't work out how to make System.Globalization.NumberStyles available to Powershell.
In PowerShell, you can use .NET types directly, including `System.Globalization.NumberStyles`. To convert strings that might have optional trailing signs into actual numbers using `System.Int32.TryParse`, you can follow the steps below. Here is a complete example of how you can do this in PowerShell: ```powershell # ...
34,504
[ { "from": "human", "value": "I need to convert strings with optional trailing signs into actual numbers using Powershell.\nPossible strings are:\n\n1000-\n323+\n456\n\nI'm trying to use System.Int.TryParse with a NumberStyles of AllowTrailingSign, but I can't work out how to make System.Globalization.Number...
I'm writing a DSL in Ruby to control an Arduino project I'm working on; Bardino. It's a bar monkey that will be software controlled to serve drinks. The Arduino takes commands via the serial port to tell the Arduino what pumps to turn on and for how long. It currently reads a recipe (see below) and prints it back out...
It's great to hear that you're working on a DSL for your Arduino-controlled bar project! Creating a domain-specific language can be a fun and rewarding endeavor, especially when it leads to clearer and more intuitive code. I'll provide you with some critiques, suggestions for improvements, and references for best pract...
27,753
[ { "from": "human", "value": "I'm writing a DSL in Ruby to control an Arduino project I'm working on; Bardino. It's a bar monkey that will be software controlled to serve drinks. The Arduino takes commands via the serial port to tell the Arduino what pumps to turn on and for how long.\nIt currently reads a...
According to MSDN The return value specifies the result of the message processing; it depends on the message sent. I know it is defined as typedef LONG_PTR LRESULT; Meaning it will be 8 bytes on 64bit machine but it doesn't! Does anyone know if it is safe to assume that only the lower 4 bytes are used and store...
The confusion you're encountering with `LRESULT` and its size is common when working with different data types in Windows API programming, especially when dealing with message processing in a 32-bit vs 64-bit environment. ### Understanding LRESULT 1. **Definition**: `LRESULT` is defined as a `LONG_PTR`, which is a ty...
34,698
[ { "from": "human", "value": "According to MSDN\n\nThe return value specifies the result\n of the message processing; it depends\n on the message sent.\n\nI know it is defined as \ntypedef LONG_PTR LRESULT;\n\nMeaning it will be 8 bytes on 64bit machine but it doesn't!\nDoes anyone know if it is safe to as...
I am investigating GDI leaks issue in one of our smart-client application. I am looking for a tool (like tasklist) to get the GDI objects associated to a process. I can see the GDI objects in taskmanager, But my requirement to capture it periodically somewhere. For example in a text file.
To monitor GDI objects associated with a process and capture the output periodically, you can use the `GetProcessHandleCount` API or other tools and scripts to extract this information from Windows. Here are a few approaches you can take to achieve this: ### Option 1: Using `tasklist` with `findstr` While `tasklist` ...
32,168
[ { "from": "human", "value": "I am investigating GDI leaks issue in one of our smart-client application.\nI am looking for a tool (like tasklist) to get the GDI objects associated to a process. I can see the GDI objects in taskmanager, But my requirement to capture it periodically somewhere. For example in a...
I know it's by design that you can't control what happens when an object is destroyed. I am also aware of defining some class method as a finalizer. However is the ruby idiom for C++'s RAII (Resources are initialized in constructor, closed in destructor)? How do people manage resources used inside objects even when e...
In Ruby, the idiom for resource management is indeed different from C++'s RAII (Resource Acquisition Is Initialization). Ruby provides built-in mechanisms, particularly using block-based resource management, that help handle resources more cleanly, including dealing with exceptions and ensuring resources are released. ...
31,765
[ { "from": "human", "value": "I know it's by design that you can't control what happens when an object is destroyed. I am also aware of defining some class method as a finalizer.\nHowever is the ruby idiom for C++'s RAII (Resources are initialized in constructor, closed in destructor)? How do people manage...
I have a Visual Studio 2008 solution with two projects (a Word-Template project and a VB.Net console application for testing). Both projects reference a database project which opens a connection to an MS-Access 2007 database file and have references to System.Data.OleDb. In the database project I have a function whic...
The error you're encountering indicates that the Microsoft Access Database Engine (ACE OLEDB provider) is not available for the console application. This typically happens if: 1. **Architecture Mismatch**: Your console application may be targeting a different architecture (x86 vs x64) than the installed version of the...
24,660
[ { "from": "human", "value": "I have a Visual Studio 2008 solution with two projects (a Word-Template project and a VB.Net console application for testing). Both projects reference a database project which opens a connection to an MS-Access 2007 database file and have references to System.Data.OleDb. In th...
I have a variable last_login and want to output a message if the last login was yesterday, today or elsewise output the date. The last two cases are clear but how can I check if a given date in classic asp was yesterday? I'm blockheaded right now...
In Classic ASP, you can check if a given date is yesterday by comparing it to yesterday's date. You can use the `Date()` function to get today's date and then subtract one day from it to get yesterday's date. Here’s how you can implement this logic: 1. Get the current date using `Date()`. 2. Use the `DateAdd` function...
33,704
[ { "from": "human", "value": "I have a variable last_login and want to output a message if the last login was yesterday, today or elsewise output the date. The last two cases are clear but how can I check if a given date in classic asp was yesterday?\nI'm blockheaded right now...\n" }, { "from": "gpt...
How do I specify the username and password in order for my program to open a file for reading? The program that needs to access the file is running from an account that does not have read access to the folder the file is in. Program is written in C# and .NET 2, running under XP and file is on a Windows Server 2003 mach...
To enable a program written in C# and .NET 2 to access a file in a secured folder using a different username and password, you will need to use the Windows API to impersonate a user. Below is a high-level guide on how to accomplish this: ### Steps to Access a File with Different Credentials 1. **Import Necessary Name...
29,808
[ { "from": "human", "value": "How do I specify the username and password in order for my program to open\na file for reading?\nThe program that needs to access the file is running from an account that\ndoes not have read access to the folder the file is in.\nProgram is written in C# and .NET 2, running under...
Here is my situation: I know almost nothing about Perl, but it is the only language available on a porting machine. I only have permissions to write in my local work area and not the Perl install location. I need to use the Parallel::ForkManager Perl module from CPAN. How do I use this Parallel::ForkManager without doi...
To use the `Parallel::ForkManager` Perl module (or any other CPAN module) without needing administrative permissions to install it centrally, you can install the module locally in your own workspace. Here are the steps you can follow: ### Step 1: Create a Local Directory for Perl Modules First, create a directory in ...
33,577
[ { "from": "human", "value": "Here is my situation: I know almost nothing about Perl, but it is the only language available on a porting machine. I only have permissions to write in my local work area and not the Perl install location. I need to use the Parallel::ForkManager Perl module from CPAN.\nHow do I ...
I have the following text tooooooooooooon According to this book I'm reading, when the ? follows after any quantifier, it becomes non greedy. My regex to*?n is still returning tooooooooooooon. It should return ton shouldn't it? Any idea why?
The regex `to*?n` you are using should actually work to match the shortest possible string that fits the pattern, which in this case should be `ton`. However, the behavior you’re experiencing may be due to how the regex engine interprets the quantifier and the way the pattern is constructed. Let's break down the rege...
28,718
[ { "from": "human", "value": "I have the following text\ntooooooooooooon\n\nAccording to this book I'm reading, when the ? follows after any quantifier, it becomes non greedy.\nMy regex to*?n is still returning tooooooooooooon.\nIt should return ton shouldn't it?\nAny idea why?\n" }, { "from": "gpt",...