instruction
stringlengths
14
27.6k
completion
stringlengths
3
38.3k
__original_row_idx
int64
0
50k
conversations
listlengths
2
2
Icon I set in properties is visible in taskbar and when on application window, but application icon in explorer is different.
It sounds like you are experiencing a discrepancy between the application icon that appears in the taskbar and the one that shows up in Windows Explorer. This can happen for a few reasons, and here are some steps you can take to resolve the issue: ### 1. **Check Your Project Settings:** Ensure that the icon set in ...
40,632
[ { "from": "human", "value": "Icon I set in properties is visible in taskbar and when on application window, but application icon in explorer is different.\n" }, { "from": "gpt", "value": "It sounds like you are experiencing a discrepancy between the application icon that appears in the taskbar a...
I am using Visual Assist X for C/C++ code in Visual Studio 2005 but I see that, sometime, when visual studio take focus, the processor is working too much and I cannot type code. If I am waiting somes seconds, it return the focus.
It sounds like you're experiencing performance issues with Visual Studio 2005 when using Visual Assist X. Here are some steps you can take to troubleshoot and potentially resolve this problem: 1. **Disable Unnecessary Extensions:** - Ensure that only necessary extensions are enabled in Visual Studio. Other extensio...
31,773
[ { "from": "human", "value": "I am using Visual Assist X for C/C++ code in Visual Studio 2005 but I see that, sometime, when visual studio take focus, the processor is working too much and I cannot type code. If I am waiting somes seconds, it return the focus.\n" }, { "from": "gpt", "value": "It ...
Ok. So I'm building this site which is accessible through two different domains. So I can't use RewriteBase in my .htaccess. The rules (below) I use to work around this problem seem to work fine. However, when I use the below .htaccess settings on my local box with clean URLS (WAMP) it all works fine but the moment I u...
Hi Luke, It looks like you're trying to set up URL rewriting for two different domains using mod_rewrite in your `.htaccess` file. The issue where every page navigates back to the home page can be caused by a few different things in your configuration. Here are some suggestions to troubleshoot and potentially resolve ...
42,161
[ { "from": "human", "value": "Ok. So I'm building this site which is accessible through two different domains. So I can't use RewriteBase in my .htaccess. The rules (below) I use to work around this problem seem to work fine. However, when I use the below .htaccess settings on my local box with clean URLS (W...
Does updating statistics cause tables to be inaccessible? In other words, can you run this procedure without downtime? Specifically for SQL Server 2005
In SQL Server 2005, updating statistics does not cause tables to be inaccessible. You can run the `UPDATE STATISTICS` command without incurring downtime, as this operation does not lock the entire table. However, there are some considerations to keep in mind: 1. **Locking Behavior**: While updating statistics, SQL Ser...
45,392
[ { "from": "human", "value": "Does updating statistics cause tables to be inaccessible? In other words, can you run this procedure without downtime? \nSpecifically for SQL Server 2005\n" }, { "from": "gpt", "value": "In SQL Server 2005, updating statistics does not cause tables to be inaccessibl...
Check out this test: [TestFixture] public class Quick_test { [Test] public void Test() { Assert.AreEqual(0, GetByYield().Count()); Assert.AreEqual(0, GetByEnumerable().Count()); } private IEnumerable<string> GetByYield() { yield break; } private IEnumerable<string> GetByEnume...
When comparing the two methods of creating empty `IEnumerable<T>`, both using `yield break` and `Enumerable.Empty<T>()`, there are some key aspects to consider regarding visual appeal, performance, and potential gotchas. ### Visual Appeal - **Enumerable.Empty<T>()**: This method is concise and directly expresses the i...
42,013
[ { "from": "human", "value": "Check out this test:\n[TestFixture]\npublic class Quick_test\n{\n [Test]\n public void Test()\n {\n Assert.AreEqual(0, GetByYield().Count());\n Assert.AreEqual(0, GetByEnumerable().Count());\n }\n\n private IEnumerable<string> GetByYield()\n {\n yield ...
Many applications require server time frequently. What are the best ways for maintaining server time on client machine with minimized request to server.
Maintaining accurate server time on a client machine while minimizing requests to the server involves a combination of techniques. Here are some best practices to achieve this: ### 1. **Initial Synchronization** - **NTP (Network Time Protocol):** Use NTP for the initial synchronization of the client's clock with th...
41,159
[ { "from": "human", "value": "Many applications require server time frequently.\nWhat are the best ways for maintaining server time on client machine with minimized request to server.\n" }, { "from": "gpt", "value": "Maintaining accurate server time on a client machine while minimizing requests t...
I want to learn how to create truly robust applications in .net - ones that are fault tolerant and are capable of withstanding unexpected situations. Where can I find literature/guidance on this subject? So far, I am not having much luck.
Creating robust and fault-tolerant applications in .NET requires a mix of architectural knowledge, design patterns, and practical implementation strategies. Here are some resources and topics to guide you in your learning journey: ### Books 1. **"Designing Data-Intensive Applications" by Martin Kleppmann**: While not...
42,330
[ { "from": "human", "value": "I want to learn how to create truly robust applications in .net - ones that are fault tolerant and are capable of withstanding unexpected situations. Where can I find literature/guidance on this subject? So far, I am not having much luck.\n" }, { "from": "gpt", "valu...
I'm trying to create a Users table that only has OpenId registrations, exactly like StackOverflow. I'm storing in the table OpenId Identifier (their login name) Alias (which is the display name to show to the public) Some other openId stuff So... I want to make sure that there is only ONE user in the system that has ...
To enforce the uniqueness constraints for both the OpenId Identifier and the Alias in your Users table, you have a couple of options. Here's a breakdown of the two approaches you mentioned: 1. **Two Unique Key Indexes**: - You can create two separate unique indexes: one for the OpenId Identifier and another for th...
44,269
[ { "from": "human", "value": "I'm trying to create a Users table that only has OpenId registrations, exactly like StackOverflow.\nI'm storing in the table\n\nOpenId Identifier (their login name)\nAlias (which is the display name to show to the public)\nSome other openId stuff\n\nSo... I want to make sure tha...
Guys, I am going to use Enterprise Library (4.1) and especially DAAB. Here is I have questions: What is the best approach and why: Every time when I need to run a DbCommand I create Database instance using DatabaseFactory.CreateDatabase(); I have a base class with instanced Database (using the same CreateDatabase() s...
When working with the Enterprise Library Data Access Application Block (DAAB), you have a couple of options regarding how to manage the `Database` instances. Let’s discuss the pros and cons of both approaches you mentioned. ### Approach 1: Create a new `Database` instance every time ```csharp DbCommand command = Data...
43,803
[ { "from": "human", "value": "Guys, I am going to use Enterprise Library (4.1) and especially DAAB. Here is I have questions:\n\nWhat is the best approach and why:\n\nEvery time when I need to run a\nDbCommand I create Database instance\nusing\nDatabaseFactory.CreateDatabase();\nI have a base class with inst...
How do I ignore all files within a folder under source control? /project/published/ is a folder I want to keep /project/published/some_file(s) are files/folders I don't want More Details: Currently when I go to commit changes for my project I see a lot of files that I don't want to. They are files that get published to...
To ignore all files and subfolders within a specific folder in SVN (Subversion), you'll need to set the `svn:ignore` property on the parent directory that contains the folder you want to ignore. However, the way to specify the folder in your case would be a little different than you initially tried. Here's how you can...
44,734
[ { "from": "human", "value": "How do I ignore all files within a folder under source control?\n/project/published/ is a folder I want to keep\n/project/published/some_file(s) are files/folders I don't want\nMore Details: Currently when I go to commit changes for my project I see a lot of files that I don't w...
For those of you who aren't familiar with the concept, abstraction inversion is the implementation of low-level constructs on top of high-level constructs, and is generally considered a bad thing because it adds both needless complexity and needless overhead. Of course, this is a somewhat imprecise, subjective definit...
Abstraction inversion can occur in programming languages that enforce a single-paradigm design, such as Java or C#, where everything must be part of a class and low-level constructs (like pointers) are abstracted away. While not all programming using these languages will inevitably lead to abstraction inversion, certai...
42,453
[ { "from": "human", "value": "For those of you who aren't familiar with the concept, abstraction inversion is the implementation of low-level constructs on top of high-level constructs, and is generally considered a bad thing because it adds both needless complexity and needless overhead. Of course, this is...
How to run NAnt scripts in command line and get the timings of each task on the log file? using nant <record> task or NAnt -buildfile:testscript.build testnanttarget This produces console output but I can't see any timing information. All I want each log message prefixed with datatime.
To run NAnt scripts from the command line and capture the timing of each task in the log file, you can follow these steps: 1. **Create a NAnt Script**: Make sure your NAnt build script (e.g., `testscript.build`) is set up correctly. 2. **Use the Command Line**: To run the NAnt script from the command line, you can u...
41,028
[ { "from": "human", "value": "How to run NAnt scripts in command line and get the timings of each task on the log file?\nusing nant <record> task or \nNAnt -buildfile:testscript.build testnanttarget\n\nThis produces console output but I can't see any timing information.\nAll I want each log message prefixed ...
i connecting to a access database with php and adodb. Strings with characters like ® are saved in the database as ® . What can i do to store it correctly?
The issue you are experiencing with special characters like ® being stored as ® in your Access database is likely due to a mismatch in character encoding between your PHP application and the Access database. Here are some steps you can take to resolve this issue: ### 1. Check PHP File Encoding Ensure that your PHP f...
42,504
[ { "from": "human", "value": "i connecting to a access database with php and adodb. Strings with characters like ® are saved in the database as ® . \nWhat can i do to store it correctly?\n" }, { "from": "gpt", "value": "The issue you are experiencing with special characters like ® being stored a...
When using FxCop 1.36 for a WPF application with a single window that has yet to be modified, I get the InterfaceMethodsShouldBeCallableByChildTypes error with the following details: Target : #System.Windows.Markup.IComponentConnector.Connect(System.Int32,System.Object) (IntrospectionTargetMember) Resolu...
The FxCop warning you're encountering is about the explicit interface implementation of the `IComponentConnector.Connect(int, object)` method in your WPF application. This warning (CA1033) suggests that the design could cause issues for derived classes that may want to use this method. Let's break down the situation: ...
44,397
[ { "from": "human", "value": "When using FxCop 1.36 for a WPF application with a single window that has yet to be modified, I get the InterfaceMethodsShouldBeCallableByChildTypes error with the following details:\n Target : #System.Windows.Markup.IComponentConnector.Connect(System.Int32,System.Objec...
Does Lucene QueryParser.parse(string) still work? If it is deprecated, what is the new syntax? Query query = QueryParser.parse("Ophelia"); Thanks Tatyana
Yes, the `QueryParser.parse(String)` method in Apache Lucene has been deprecated since version 8.0.0. The recommended way to parse queries now is to use the `QueryParser` class constructor directly with a field and a query string. Here’s an example of how to do it with the updated syntax: ```java import org.apache.lu...
46,688
[ { "from": "human", "value": "Does Lucene QueryParser.parse(string) still work?\nIf it is deprecated, what is the new syntax?\nQuery query = QueryParser.parse(\"Ophelia\");\nThanks\nTatyana\n" }, { "from": "gpt", "value": "Yes, the `QueryParser.parse(String)` method in Apache Lucene has been depr...
Is this possible via CSS? I'm trying tr.classname { border-spacing: 5em; } to no avail. Maybe I'm doing something wrong?
It looks like you're trying to apply `border-spacing` to a table row (`<tr>`) using CSS, but `border-spacing` is a property that applies to the `<table>` element itself, not individual rows or cells. If you want to achieve spacing between the cells of a table, you should apply the `border-spacing` property to the `<t...
44,024
[ { "from": "human", "value": "Is this possible via CSS? \nI'm trying \ntr.classname {\n border-spacing: 5em;\n}\n\nto no avail. Maybe I'm doing something wrong?\n" }, { "from": "gpt", "value": "It looks like you're trying to apply `border-spacing` to a table row (`<tr>`) using CSS, but `border-s...
I would like to know whether it is possible to force LWP::UserAgent to accept an expired SSL certificate for a single, well-known server. The issue is slightly complicated by the Squid proxy in between. I went as far as to set up a debugging environment like: use warnings; use strict; use Carp; use LWP::UserAgent; use ...
To force `LWP::UserAgent` to accept an expired SSL certificate for a specific server, you can use the `IO::Socket::SSL` module along with the `LWP::UserAgent` settings. By configuring `IO::Socket::SSL` to ignore SSL certificate verification for the target server, you can work around the issue with an expired certificat...
41,660
[ { "from": "human", "value": "I would like to know whether it is possible to force LWP::UserAgent to accept an expired SSL certificate for a single, well-known server. The issue is slightly complicated by the Squid proxy in between.\nI went as far as to set up a debugging environment like:\nuse warnings;\nus...
I am trying to find out how to use usercontrols in asp.net mvc. I know how to add a usercontrol to a view and how to pass data to it. What I haven't been able to figure out is how do you do this without having to retrieve and pass the data in every single controller? For example, if I have a user control that display...
In ASP.NET MVC, the approach for sharing common data across multiple views is quite different from Web Forms. In Web Forms, user controls can independently fetch their own data, while in MVC, you typically rely on controller actions and view models. However, you can still achieve a similar outcome by using several stra...
42,151
[ { "from": "human", "value": "I am trying to find out how to use usercontrols in asp.net mvc. I know how to add a usercontrol to a view and how to pass data to it. What I haven't been able to figure out is how do you do this without having to retrieve and pass the data in every single controller?\nFor exam...
How do I get the reference to a folder for storing per-user-per-application settings when writing an Objective-C Cocoa app in Xcode? In .NET I would use the Environment.SpecialFolder enumeration: Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData); What's the Cocoa equivalent?
In a Cocoa application, you can get the path to the per-user-per-application settings folder using the `NSSearchPathForDirectoriesInDomains` function. Specifically, you would typically use `NSApplicationSupportDirectory` as the folder for storing application-specific data. Here’s how you can do it in Objective-C: ```...
44,237
[ { "from": "human", "value": "How do I get the reference to a folder for storing per-user-per-application settings when writing an Objective-C Cocoa app in Xcode?\nIn .NET I would use the Environment.SpecialFolder enumeration:\nEnvironment.GetFolderPath(Environment.SpecialFolder.ApplicationData);\n\nWhat's t...
I have a logical error. I provided the following as input: the salary is 30000 the child n° is 9 So the the net salary will be: the family bonus + salary - tax (750) + (30000) - (3000) but my program count them as (1500) + (30000) + (6000) My program doubled (accumulated) the family bonus and the tax...
The problem you are experiencing with the logical error in your program is due to the way you are calculating the tax and family bonus. In your current implementation, the `familybonus` and `tax` are static fields, which means they retain their values between calls. This leads to accumulation (or doubling) of the calcu...
40,389
[ { "from": "human", "value": "I have a logical error. I provided the following as input:\n\nthe salary is 30000\nthe child n° is 9\n\nSo the the net salary will be:\n\nthe family bonus + salary - tax\n (750) + (30000) - (3000)\n\nbut my program count them as \n (1500) + (30000) + (6000)\n\n\nMy pro...
I'd like to give customers a choice of the database engine, but also want to minimize my troubles of such a decision. The engines in question are MySQL (5 or later) and SQL Server (2005 or later).
Allowing customers to choose between MySQL and SQL Server as their database engine can be a great way to cater to different preferences and requirements. However, it can also introduce complexity in your development and maintenance processes. Here are some strategies to minimize potential issues: ### 1. **Abstract Dat...
41,439
[ { "from": "human", "value": "I'd like to give customers a choice of the database engine, but also want to minimize my troubles of such a decision.\nThe engines in question are MySQL (5 or later) and SQL Server (2005 or later).\n" }, { "from": "gpt", "value": "Allowing customers to choose between...
I've run into a strange situation that seems to involve long text overflowing. I'm using fn_pcre_replace (from the xp_pcre extended stored procedure) on an nvarchar(max) column, and when I replace with more characters than were there originally, it returns NULL if the original string was over 8000 characters long. For ...
The issue you're encountering with the `fn_pcre_replace` function (from the `xp_pcre` extended stored procedure) returning `NULL` when the input string length exceeds 8000 characters seems to be related to the handling of large text data types in SQL Server and the limitations inherent in the `xp_pcre` implementation. ...
43,354
[ { "from": "human", "value": "I've run into a strange situation that seems to involve long text overflowing. I'm using fn_pcre_replace (from the xp_pcre extended stored procedure) on an nvarchar(max) column, and when I replace with more characters than were there originally, it returns NULL if the original s...
I'm looking for something simple to use where the grammar is easy to define.
If you're looking for a simple tool to define grammar, you might want to consider the following options: 1. **Context-Free Grammars (CFG)**: These are straightforward and can be defined using production rules. For example: ``` S → aSb | ε ``` You can use tools like ANTLR or Bison to implement CFGs for pars...
45,843
[ { "from": "human", "value": "I'm looking for something simple to use where the grammar is easy to define.\n" }, { "from": "gpt", "value": "If you're looking for a simple tool to define grammar, you might want to consider the following options:\n\n1. **Context-Free Grammars (CFG)**: These are str...
I need to write some Prolog programs for a class. Any recommendations?
Absolutely! Here are several ideas for Prolog programs, ranging from beginner to more advanced levels, that you can work on for your class: ### Beginner Projects: 1. **Family Tree:** - Create a simple family tree that defines relationships (parent, sibling, etc.) and allows querying for family relationships (e.g.,...
41,309
[ { "from": "human", "value": "I need to write some Prolog programs for a class.\nAny recommendations?\n" }, { "from": "gpt", "value": "Absolutely! Here are several ideas for Prolog programs, ranging from beginner to more advanced levels, that you can work on for your class:\n\n### Beginner Projec...
Where I work, people mostly think that objects are best initialised using C++-style construction (with parentheses), whereas primitive types should be initialised with the = operator: std::string strFoo( "Foo" ); int nBar = 5; Nobody seems to be able to explain why they prefer things this way, though. I can see that ...
The distinction between using parentheses `()` for construction and the `=` operator for assignment (especially for primitive types) is not uncommon, but it's not universal either. Here are some thoughts on the reasoning behind this style and conventions: ### Rationale Behind the Convention 1. **Clarity of Intent**: ...
42,448
[ { "from": "human", "value": "Where I work, people mostly think that objects are best initialised using C++-style construction (with parentheses), whereas primitive types should be initialised with the = operator:\nstd::string strFoo( \"Foo\" );\nint nBar = 5;\n\nNobody seems to be able to explain why they p...
Consider the following HTML: <div class="foo" id="obj"> I should be changed red <div class="bar" style="color:black;"> I should not be changed red. <div class="foo">I should be changed red.</div> </div> </div> Given a DOM element obj and an expression, how do I go about selecting any children and ...
Yes, there is a more elegant solution using jQuery's `find` method in conjunction with the `is` method and a bit of chaining. You can achieve the desired selection and coloring with a cleaner approach. Here is an optimized way to do it: ```javascript var obj = $("#obj")[0]; // Select all descendants that match the s...
45,099
[ { "from": "human", "value": "Consider the following HTML:\n<div class=\"foo\" id=\"obj\">\n I should be changed red\n <div class=\"bar\" style=\"color:black;\">\n I should not be changed red.\n <div class=\"foo\">I should be changed red.</div>\n </div>\n</div>\n\nGiven a DOM element obj and ...
I doing a function in Javascript like the VisualBasic DateDiff. You give two dates and the returning time interval (Seconds, Minutes, Days, etc...) DateDiff(ByVal Interval As Microsoft.VisualBasic.DateInterval, _ ByVal Date1 As Date, ByVal Date2 As Date) as Long So what's the best way to calculate the difference of ...
To implement a function similar to the VisualBasic `DateDiff` in JavaScript, you can create a function that takes two dates and an interval string (like "seconds", "minutes", "hours", "days", etc.) as arguments, and returns the difference between the two dates in the specified interval. Here's a simple implementation ...
43,392
[ { "from": "human", "value": "I doing a function in Javascript like the VisualBasic DateDiff.\nYou give two dates and the returning time interval (Seconds, Minutes, Days, etc...)\nDateDiff(ByVal Interval As Microsoft.VisualBasic.DateInterval, _\n ByVal Date1 As Date, ByVal Date2 As Date) as Long\n\nSo what'...
I don't understand, why does the following regular expression: ^*$ Match the string "127.0.0.1"? Using Regex.IsMatch("127.0.0.1", "^*$"); Using Expresso, it does not match, which is also what I would expect. Using the expression ^.*$ does match the string, which I would also expect. Technically, ^*$ should match the b...
The confusion stems from the behavior of the regular expression `^*$` in the context of how regular expressions handle anchors and quantifiers. Let's break down what `^*$` means in detail: 1. **Anchors (`^` and `$`)**: - The caret (`^`) asserts the position at the start of a line/string. - The dollar sign (`$`) ...
43,603
[ { "from": "human", "value": "I don't understand, why does the following regular expression:\n^*$\n\nMatch the string \"127.0.0.1\"? Using Regex.IsMatch(\"127.0.0.1\", \"^*$\");\nUsing Expresso, it does not match, which is also what I would expect. Using the expression ^.*$ does match the string, which I wou...
Unlike many of the ASP.NET documentation and examples, I'm doing a gridview list on one page, and it links to a 2nd page to do the edit/update view, sending the ID for the record in the GET string. On my edit/update view, I'm using an ASP:DetailsView for viewing, editing and inserting records. All of this works fine. ...
To create a seamless experience where you can navigate from an external page to the insert view of an ASP.NET DetailsView, you'll want to ensure that your insert form is properly configured to recognize when it should display a new record entry form instead of displaying existing record details. Here’s a step-by-step ...
43,076
[ { "from": "human", "value": "Unlike many of the ASP.NET documentation and examples, I'm doing a gridview list on one page, and it links to a 2nd page to do the edit/update view, sending the ID for the record in the GET string.\nOn my edit/update view, I'm using an ASP:DetailsView for viewing, editing and in...
I have written an ASP.NET composite control which includes some Javascript which communicates with a web service. I have packaged the classes for the control and the service into a DLL to make it nice and easy for people to use it in other projects. The problem I'm having is that as well as referencing the DLL in their...
To avoid the requirement of having a .ASMX file for your web service while still enabling AJAX calls, you can consider using the following approaches: ### 1. **Using ASP.NET Web API**: Instead of using ASMX for your web service, you can create a Web API. This provides a more modern and RESTful way to expose your serv...
39,439
[ { "from": "human", "value": "I have written an ASP.NET composite control which includes some Javascript which communicates with a web service.\nI have packaged the classes for the control and the service into a DLL to make it nice and easy for people to use it in other projects.\nThe problem I'm having is t...
I want to create an MSI in WiX such that it can take a command line parameter to indicate whether it is a per-machine or per-user installation and consequently whether to raise a UAC dialog. What is the best way to accomplish this?
To create an MSI with WiX that can handle command line parameters for per-machine or per-user installations, you need to follow these steps: 1. **Define a property for installation mode**: Create a property that will hold the installation mode (e.g., `INSTALL_MODE`). 2. **Use the property to set installation context*...
37,266
[ { "from": "human", "value": "I want to create an MSI in WiX such that it can take a command line parameter to indicate whether it is a per-machine or per-user installation and consequently whether to raise a UAC dialog.\nWhat is the best way to accomplish this?\n" }, { "from": "gpt", "value": "T...
How should a relational database be designed to handle multi-valued attributes ? edit: To elaborate: There are two ways I could think of for doing this - Trying something like putting comma separated values in the field, which appears a bit clumsy. Create another table for the field and let the multiple values go to ...
Designing a relational database to handle multi-valued attributes requires careful consideration of normalization principles. The two methods you proposed are common approaches, but there are additional strategies to consider. Let's explore the options. ### Common Approaches to Handle Multi-Valued Attributes 1. **Sep...
42,537
[ { "from": "human", "value": "How should a relational database be designed to handle multi-valued attributes ?\nedit: To elaborate: \nThere are two ways I could think of for doing this -\n\nTrying something like putting comma separated values in the field, which appears a bit clumsy.\nCreate another table fo...
I need to do some quick-and-dirty Perl GUI building. I can't afford a Komodo License. What would people recommend as a free (as in beer) alternative. I don't care if it is UNIX or Windows or both. I would be using either Win32 Perl or Perl/Tk depending on what has the best solution. I would also look at any PM's that u...
If you're looking for free alternatives to build GUIs in Perl without the need for a paid IDE like Komodo, there are several options you can consider: ### GUI Toolkits for Perl 1. **Perl/Tk**: - A well-known GUI toolkit that allows you to create native-looking GUIs on various platforms. - It comes with a large ...
43,273
[ { "from": "human", "value": "I need to do some quick-and-dirty Perl GUI building. I can't afford a Komodo License.\nWhat would people recommend as a free (as in beer) alternative. I don't care if it is UNIX or Windows or both. I would be using either Win32 Perl or Perl/Tk depending on what has the best solu...
I'm trying to pass a complex object (that can be serialized, if that helps) to another view. Currently this is the code i have, in some controller method :- User user = New User { Name = "Fred, Email = "xxxx" }; return RedirectToAction("Foo", user); now, i have the following action in the same controller ... [AcceptVe...
In ASP.NET MVC, when you redirect to another action using `RedirectToAction`, the data you pass to it cannot be directly serialized to the query string parameters, which is why your `User` object is coming through as `null` in the target action (`Foo`). The `RedirectToAction` method creates a new HTTP GET request for...
38,665
[ { "from": "human", "value": "I'm trying to pass a complex object (that can be serialized, if that helps) to another view.\nCurrently this is the code i have, in some controller method :-\nUser user = New User { Name = \"Fred, Email = \"xxxx\" };\nreturn RedirectToAction(\"Foo\", user);\n\nnow, i have the fo...
I haven't worked much with Visual Studio before. I've started a personal project in my spare time and I would like to use test-driven development since it has been a huge benefit to me in my Java development. I started this project quite a while ago, and I used CppUnit. I know there are probably other frameworks that a...
Your assessment is mostly on the right track. The LNK2019 "unresolved external symbol" errors typically indicate that the linker is unable to find the implementation of functions that your unit tests are trying to call. This is often because the object files generated from your implementation files (.cpp) are not being...
43,293
[ { "from": "human", "value": "I haven't worked much with Visual Studio before. I've started a personal project in my spare time and I would like to use test-driven development since it has been a huge benefit to me in my Java development. I started this project quite a while ago, and I used CppUnit. I know t...
If a packed Javascript saves 20kb off the download size, but takes a perfomance hit to unpack, then are there any benefits, besides obfuscating the code? I've made this a community wiki because it may be open to some discussion.
When it comes to using packed or minified JavaScript, there are several benefits beyond just saving bandwidth and obfuscating the code. Here are some key points to consider: ### Benefits of Packed/Minified JavaScript: 1. **Reduced Load Times**: The primary benefit of packing and minifying JavaScript is the reduction ...
43,545
[ { "from": "human", "value": "If a packed Javascript saves 20kb off the download size, but takes a perfomance hit to unpack, then are there any benefits, besides obfuscating the code?\nI've made this a community wiki because it may be open to some discussion.\n" }, { "from": "gpt", "value": "When...
Two installations of SSRS 2005 on two separate machines in my shop seem to have lost their encryption keys at exactly the same time. These are developer machines with the development edition of SQL Server 2005 running, so I'm hoping that perhaps someone here has an explanation for this. Yesterday, both machines began...
Experiencing simultaneous issues with the encryption keys in SSRS 2005 on two separate machines can indeed be puzzling. Here are some potential explanations and troubleshooting steps you can consider: 1. **Shared Environment**: If both installations are part of a shared environment (e.g., using the same network, domai...
43,107
[ { "from": "human", "value": "Two installations of SSRS 2005 on two separate machines in my shop seem to have lost their encryption keys at exactly the same time. These are developer machines with the development edition of SQL Server 2005 running, so I'm hoping that perhaps someone here has an explanation ...
In this question & answer, I found one way to make ASP.NET MVC support asynchronous processing. However, I cannot make it work. Basically, the idea is to create a new implementation of IRouteHandler which has only one method GetHttpHandler. The GetHttpHandler method should return an IHttpAsyncHandler implementation ins...
To enable asynchronous processing in your ASP.NET MVC application using a custom `IRouteHandler`, you need to make sure that your MVC action methods support async operations. The problem you're experiencing comes from how ASP.NET MVC handles routes and what it expects from the handler. ### Steps to Enable Asynchronous...
41,045
[ { "from": "human", "value": "In this question & answer, I found one way to make ASP.NET MVC support asynchronous processing. However, I cannot make it work.\nBasically, the idea is to create a new implementation of IRouteHandler which has only one method GetHttpHandler. The GetHttpHandler method should retu...
I'm pretty new to the Spring Framework, I've been playing around with it and putting a few samples apps together for the purposes of evaluating Spring MVC for use in an upcoming company project. So far I really like what I see in Spring MVC, seems very easy to use and encourages you to write classes that are very unit ...
Welcome to the Spring Framework! You're right that Spring MVC and the entire Spring ecosystem offer a lot of flexibility and encourage good design practices. Let’s break down your questions about `BeanFactory` and `ApplicationContext`, and I'll provide some guidance on which to use in various scenarios. ### Difference...
41,975
[ { "from": "human", "value": "I'm pretty new to the Spring Framework, I've been playing around with it and putting a few samples apps together for the purposes of evaluating Spring MVC for use in an upcoming company project. So far I really like what I see in Spring MVC, seems very easy to use and encourages...
What is the best way to close a browser window of an AJAX ASP.NET application after the server-side has been executed. I found this solution, but it seems a little complex for what I want to accomplish. Or is this the best way to accomplish my task. UPDATE: I have to close the window after the button is pressed UPDATE...
Closing a browser window programmatically in a web application can be tricky due to various browser security measures that prevent malicious scripts from doing so without user interaction. If you're dealing with an AJAX ASP.NET application and you want to close the window after a button click, there are a few things to...
43,443
[ { "from": "human", "value": "What is the best way to close a browser window of an AJAX ASP.NET application after the server-side has been executed.\nI found this solution, but it seems a little complex for what I want to accomplish. Or is this the best way to accomplish my task.\nUPDATE: I have to close th...
Is it possible to get a list of control events that are going to fire before they happen, say inside the Page_Load handler? For example if a button was clicked can I figure this out before the button_click event handler is called?
In ASP.NET Web Forms, control events such as button clicks are handled in a specific order during the page lifecycle. However, there's no built-in method to predict or "listen to" upcoming events before they are fired. The lifecycle of a Web Forms page is quite structured, and events are raised as the lifecycle progres...
39,518
[ { "from": "human", "value": "Is it possible to get a list of control events that are going to fire before they happen, say inside the Page_Load handler?\nFor example if a button was clicked can I figure this out before the button_click event handler is called?\n" }, { "from": "gpt", "value": "In...
During .NET v1 days, I have tried without much success to convince colleagues to develop test-driven and automated-build work habits using the additional tools of NUnit and NAnt. When .NET Framework 2.0 and Visual Studio 2005 Team Suite came into picture, I was able to "force" my team into writing tests and provide the...
In the current ecosystem of .NET development, especially given your context of working within a Microsoft-centric environment, there are indeed some compelling arguments for considering NUnit and NAnt, despite the robust offerings of MSBuild and MSTest. Here are some potential value propositions for both NUnit and NAnt...
41,368
[ { "from": "human", "value": "During .NET v1 days, I have tried without much success to convince colleagues to develop test-driven and automated-build work habits using the additional tools of NUnit and NAnt. When .NET Framework 2.0 and Visual Studio 2005 Team Suite came into picture, I was able to \"force\"...
I'm building a with-source system which I am giving out on the 'net for providing adoptable virtual pets. The system will be owned mainly by kids. Since I want it to be usable for absolute beginner programmers, there are several complexity constraints on my system: It can't use libraries that don't commonly ship with P...
Given your constraints and requirements for creating a simple, beginner-friendly, and obfuscation-based system for your virtual pet project, you can use a straightforward approach without relying on external libraries. Here’s a simple strategy that meets your needs: ### Using Base64 Encoding with a Salt You can creat...
42,524
[ { "from": "human", "value": "I'm building a with-source system which I am giving out on the 'net for providing adoptable virtual pets. The system will be owned mainly by kids. Since I want it to be usable for absolute beginner programmers, there are several complexity constraints on my system: It can't use ...
I have a SharePoint site extended for forms authentication. The Active Directory site is example.com and the forms authentication site is forms.example.com. When I type my (forms) username/password I get redirected (302) to the machine name (moss-01) like so: http://moss-01/. If I type http://forms.example.com/ into...
The issue you're experiencing—being redirected to the machine name (http://moss-01/) instead of the intended forms authentication URL (http://forms.example.com/Pages/Default.aspx)—can occur due to a few common misconfigurations or issues in your SharePoint setup. Here are some steps to troubleshoot and resolve this pro...
43,149
[ { "from": "human", "value": "I have a SharePoint site extended for forms authentication. The Active Directory site is example.com and the forms authentication site is forms.example.com. When I type my (forms) username/password I get redirected (302) to the machine name (moss-01) like so: http://moss-01/. ...
I'm currently trying to read text from a file and append it to a element in my html page using the DOM and Javascript. I can't get the text to format though. I've tried using innerHtml but isn't formating at all( no line breaks ). Here is the javascript: http = new XMLHttpRequest(); http.open("GET",FILE,false); http.se...
To properly format text with line breaks when inserting it into your HTML, you can either replace the line breaks in the text with `<br>` tags or use a `<pre>` or `<textarea>` element which maintains whitespace and line breaks. If you're facing issues with using `<pre>` on your server but want to use it in a more sta...
42,280
[ { "from": "human", "value": "I'm currently trying to read text from a file and append it to a element in my html page using the DOM and Javascript. I can't get the text to format though. I've tried using innerHtml but isn't formating at all( no line breaks ).\nHere is the javascript:\nhttp = new XMLHttpRequ...
I have an have an ASP.Net page which contains a button. This Page contains a ServerSide Paypal button. When pushed my server does various clever things on the back end and then rewrites the response as a form and some javascript which posts this form to paypal.. This all works great. However, if the user then elects to...
To prevent the generated form page from appearing in the browser history, there are several approaches you can take. The main idea is to ensure that the user cannot return to the form page after it has been submitted. Below are a few methods you can consider: ### 1. Use the HTTP 1.1 `Pragma` Header You can set header...
40,551
[ { "from": "human", "value": "I have an have an ASP.Net page which contains a button. This Page contains a ServerSide Paypal button.\nWhen pushed my server does various clever things on the back end and then rewrites the response as a form and some javascript which posts this form to paypal..\nThis all works...
This is a question brought up in a local user group mailing list at dot.net.nz ... I when I create an XHTML page old-fashioned way, I used to use the following syntax for my CSS declarations: <link rel=”stylesheet” type=”text/css” media=”screen” href=”css/screen.css” /> <link rel=”stylesheet” type=”text/css” m...
In ASP.NET 2.0 and beyond, themes allow you to create a consistent look and feel for your web application without having to manually link to stylesheets on each page. To use different CSS files based on the media type (like screen and print) with themes, you can follow these steps: ### Step 1: Create a Theme 1. Creat...
41,198
[ { "from": "human", "value": "This is a question brought up in a local user group mailing list at dot.net.nz ...\n\nI when I create an XHTML page\n old-fashioned way, I used to use the\n following syntax for my CSS\n declarations:\n\n<link rel=”stylesheet” type=”text/css” media=”screen” href=”css/screen.c...
I have a two-dimensional array (of Strings) which make up my data table (of rows and columns). I want to sort this array by any column. I tried to find an algorithm for doing this in C#, but have not been successful. Any help is appreciated.
Sorting a two-dimensional array (or table) in C# can be achieved using LINQ (Language Integrated Query), which provides an elegant way to manipulate collections. Here's how you can do it by specifying which column to sort by. ### Step-by-Step Guide 1. **Convert the two-dimensional array to a list of arrays or lists**...
43,445
[ { "from": "human", "value": "I have a two-dimensional array (of Strings) which make up my data table (of rows and columns). I want to sort this array by any column. I tried to find an algorithm for doing this in C#, but have not been successful.\nAny help is appreciated.\n" }, { "from": "gpt", ...
I'm attempting to write a couple of NAnt tasks for interacting with Microsoft Virtual Server 2005 R2 SP1, and I've lifted the code found on "Virtual PC Guy's WebLog", in the "Controlling Virtual Server through PowerShell" post. It doesn't work: I always get a failure when calling CreateVirtualMachine: System.Runtime.In...
To solve the issue you're experiencing with the COM exception when trying to use the Microsoft Virtual Server 2005 R2 SP1 API from within your NAnt task, you'll need to ensure that the appropriate security settings are configured correctly. Since you're working with COM objects, security settings can be tricky, especia...
42,618
[ { "from": "human", "value": "I'm attempting to write a couple of NAnt tasks for interacting with Microsoft Virtual Server 2005 R2 SP1, and I've lifted the code found on \"Virtual PC Guy's WebLog\", in the \"Controlling Virtual Server through PowerShell\" post.\nIt doesn't work: I always get a failure when c...
I'm trying to make a script that sleeps my wireless card in linux. For that I'm using the deepsleep command of iwpriv: iwpriv wlan0 deepsleep 1 The problem is that this command only works if the wireless card is disconnected and disassociated. When it's connected there is no problem because if I disconnect, it disasso...
Yes, there are more direct ways to disassociate a wireless card in Linux without having to change its mode. You can use the `iw` command or the `nmcli` command if you're using NetworkManager. Here are a couple of methods you can try: ### Method 1: Using `iw` The `iw` command is a powerful tool for managing wireless d...
43,940
[ { "from": "human", "value": "I'm trying to make a script that sleeps my wireless card in linux. For that I'm using the deepsleep command of iwpriv:\niwpriv wlan0 deepsleep 1\n\nThe problem is that this command only works if the wireless card is disconnected and disassociated. When it's connected there is no...
Let's say I have some code like this: <html> <head><title>Title</title></head> <body> <?php if (!$someCondition){ die(); } else{ #Do something } ?> </body> <html> I hope the purpose of this code is straightforward. If a certain condition is met (ie can't connect to database), then the program should die, but oth...
Yes, you can achieve this by using the `exit` function in combination with output buffering. The `die()` function and `exit()` function effectively do the same thing in PHP, which is to stop the execution of the script. However, in order to ensure that your HTML content is sent to the browser even if the script termina...
46,386
[ { "from": "human", "value": "Let's say I have some code like this:\n<html>\n<head><title>Title</title></head>\n<body>\n\n<?php\nif (!$someCondition){\n die();\n}\nelse{\n #Do something\n}\n?>\n</body>\n<html>\n\nI hope the purpose of this code is straightforward. If a certain condition is met (ie can't c...
Is it possible to bubble up newer records in lucene search results? ie.I want Lucene to give a higher score to records which are closer to today's date. Thanks!
Yes, it is possible to give higher scores to newer records in Lucene search results. To achieve this, you can utilize a combination of custom scoring and boosting techniques. Here are some approaches you can consider: ### 1. **Using Boosting with Date Fields:** You can boost records based on their date field when inde...
42,540
[ { "from": "human", "value": "Is it possible to bubble up newer records in lucene search results?\nie.I want Lucene to give a higher score to records which are closer to today's date.\nThanks!\n" }, { "from": "gpt", "value": "Yes, it is possible to give higher scores to newer records in Lucene se...
Today our virtual W2003 server storing our SVN repository (too) became very-very busy. It turned out that it had only 88KB free space left on the C: drive. Not that good. Due to access problems, the only way we could reboot it by killing the busy processes from task manager (McAffee, SqlServer, services.exe) and then g...
It sounds like you went through quite a bit with your SVN repository! Based on your description, it appears that the SVN service on your Windows Server 2003 instance was corrupted during the high load and subsequent crash, even though the actual data files remain intact. Here’s a summary of the situation and the steps...
44,578
[ { "from": "human", "value": "Today our virtual W2003 server storing our SVN repository (too) became very-very busy. It turned out that it had only 88KB free space left on the C: drive. Not that good. Due to access problems, the only way we could reboot it by killing the busy processes from task manager (McA...
With multiple developers working on the same Tomcat application, I'd like to tell the application to install to a different path, based on the current user and revision control client/view. So, if Bob is building, the app should be installed in Bob's test environment, maybe /bob1 or something like that. Bob might have...
Yes, you can achieve your goal by using Ant's ability to accept command-line arguments or environment variables. This way, you can avoid checking out and modifying the `build.properties` file for each user or workspace. Here's how you can do it: ### Using Command-Line Arguments You can pass properties directly to the...
43,409
[ { "from": "human", "value": "With multiple developers working on the same Tomcat application, I'd like to tell the application to install to a different path, based on the current user and revision control client/view.\nSo, if Bob is building, the app should be installed in Bob's test environment, maybe /bo...
Which JDBC jar should I use with java 1.5.0_16 and PostgreSQL 8.3.5?
For Java 1.5.0_16 and PostgreSQL 8.3.5, you should use the PostgreSQL JDBC driver version 8.3.x, as this driver is specifically designed for compatibility with PostgreSQL 8.3. You can download the PostgreSQL JDBC driver from the PostgreSQL JDBC website or from the Maven repository. The driver file will typically have...
47,743
[ { "from": "human", "value": "Which JDBC jar should I use with java 1.5.0_16 and PostgreSQL 8.3.5?\n" }, { "from": "gpt", "value": "For Java 1.5.0_16 and PostgreSQL 8.3.5, you should use the PostgreSQL JDBC driver version 8.3.x, as this driver is specifically designed for compatibility with Postg...
Simple question: I have loaded an Apt package record with libept. There is a method to get file list? It should sound like record.GetFileList(); and it should return a vector string like the output of dpkg -L packagename
In libept, the method you're looking for is not exactly `GetFileList()`, but you can achieve the same result using the appropriate methods provided by the library. To get the file list for an Apt package, you generally follow these steps: 1. Load the package record using libept. 2. Use the method to retrieve the file...
44,651
[ { "from": "human", "value": "Simple question: I have loaded an Apt package record with libept. There is a method to get file list? It should sound like\n record.GetFileList();\n\nand it should return a vector string like the output of\n dpkg -L packagename\n\n" }, { "from": "gpt", "value": "In l...
How can I detect keyboard event in C language without using third party libraries? Should I use signal handling?
In C, detecting keyboard events directly without third-party libraries is platform-dependent. You typically won't use signal handling for this purpose because signals are more suited for handling asynchronous events like interrupts rather than keyboard input. For keyboard detection, you usually rely on specific system...
39,051
[ { "from": "human", "value": "How can I detect keyboard event in C language without using third party libraries? Should I use signal handling?\n" }, { "from": "gpt", "value": "In C, detecting keyboard events directly without third-party libraries is platform-dependent. You typically won't use sig...
I'm using this database where the date colomn is a numeric value instead of a Date value. Yes, I know I can change that with a mouseclick, but all the applications using that database were made by one of my predecessors (and everyone after him just ignored it and built on). So if I'd change it to Date a lot af applica...
Yes, there is a practical solution to convert standard date formats into the numeric format used in your database. Given that you're using ASP with VBScript and an Access database, here's a step-by-step approach: ### Numeric Date Format The numeric date format in your database is likely stored as an integer representi...
42,454
[ { "from": "human", "value": "I'm using this database where the date colomn is a numeric value instead of a Date value. \nYes, I know I can change that with a mouseclick, but all the applications using that database were made by one of my predecessors (and everyone after him just ignored it and built on). So...
I am using this HTML <html> <head> <Title>EBAY Search</title> </head> <script language="JavaScript" src="ajaxlib.js"></script> <body> Click here <a href="#" OnClick="GetEmployee()">link</a> to show content <div id="Result"><The result will be fetched here></div> </body> </htm...
It looks like there are a few issues with your HTML and JavaScript code that may prevent the JavaScript from executing correctly when you click the link. Here's a corrected version of your code and explanations of the changes made: ### Corrected HTML ```html <!DOCTYPE html> <html lang="en"> <head> <meta charset="...
36,777
[ { "from": "human", "value": "I am using this HTML\n<html>\n <head>\n <Title>EBAY Search</title>\n </head>\n <script language=\"JavaScript\" src=\"ajaxlib.js\"></script>\n <body>\n Click here <a href=\"#\" OnClick=\"GetEmployee()\">link</a> to show content\n <div id=\"Result\...
I have the following piece of code which replaces "template markers" such as %POST_TITLE% with the contents of a variable called $post_title. function replaceTags( $template, $newtext ) { $template = preg_replace( '/%MYTAG%/', $newtext, $template ); return $template; } The issue is that when $post_full has a '...
The issue you are encountering arises because PHP interprets `$` as the beginning of a variable when it is encountered in a double-quoted string. In your case, when `$newtext` contains `$1,000,000`, PHP is attempting to interpret `$1` as a variable, and since there is no variable named `1`, it results in an empty value...
41,340
[ { "from": "human", "value": "I have the following piece of code which replaces \"template markers\" such as %POST_TITLE% with the contents of a variable called $post_title.\nfunction replaceTags( $template, $newtext ) {\n $template = preg_replace( '/%MYTAG%/', $newtext, $template );\n return $template...
I am developing a site that makes extensive use of JavaScript (jQuery). I regularly get the IE 'Stop running this script?' error dialog when I try to close the browser. I'm guessing the problem occurs because the site is a single page that uses AJAX, so there are no postbacks to reset IE's count of commands executed. ...
The "Stop running this script?" error dialog in Internet Explorer typically occurs when a script runs for an extended period without yielding control back to the browser. In your case, the presence of multiple interval timers that poll continuously can contribute to this issue, especially if the intervals are set too a...
40,889
[ { "from": "human", "value": "I am developing a site that makes extensive use of JavaScript (jQuery). I regularly get the IE 'Stop running this script?' error dialog when I try to close the browser. \nI'm guessing the problem occurs because the site is a single page that uses AJAX, so there are no postbacks ...
I tried doing this but this only display the radiobutton without text beside it.. <% foreach (string s in Html.RadioButtonList("rbl")) {%> <% =s %> <% } %>
It looks like you are trying to create a list of radio buttons using ASP.NET Web Forms, but the code snippet you provided has some issues. The `Html.RadioButtonList` method does not exist in ASP.NET Web Forms, and your current usage does not output radio buttons properly. To create a list of radio buttons with associa...
42,267
[ { "from": "human", "value": "I tried doing this but this only display the radiobutton without text beside it..\n<% foreach (string s in Html.RadioButtonList(\"rbl\")) {%>\n <% =s %>\n<% } %> \n\n" }, { "from": "gpt", "value": "It looks like you are trying to create a list of radio buttons usi...
I am using .NET 3.5 to call a FedEx web service. In Fedex's sample code (VS2005) it has things like: AddressValidationService addressValidationService = new AddressValidationService(); AddressValidationReply reply = addressValidationService.addressValidation(request); This is nice. I like that. I'm calling a method on...
The behavior you are seeing is due to the differences in how WCF (Windows Communication Foundation) services are generated and structured in .NET 3.5 compared to older methods (like ASMX web services) used in earlier versions of .NET (e.g., .NET 2.0, which was commonly used with VS2005). ### Understanding `PortTypeCli...
42,294
[ { "from": "human", "value": "I am using .NET 3.5 to call a FedEx web service.\nIn Fedex's sample code (VS2005) it has things like:\nAddressValidationService addressValidationService = new AddressValidationService();\nAddressValidationReply reply = addressValidationService.addressValidation(request);\n\nThis...
I have written a toolbar that runs on the taskbar. Unfortunately, after it is installed, the user has to enable it manually. Is there a way to tell explorer to open (or close) a given toolbar? I would like for the installer, NSIS, to turn on the toolbar when the installation is complete (I realize that a plugin would...
Enabling a custom toolbar in Windows Explorer programmatically, especially through an installer like NSIS, can be tricky and might require some specific approaches. ### Enable/Disable Toolbars via Shell API 1. **Using the Shell API**: The Windows Shell provides interfaces that can control the visibility of toolbars, ...
43,761
[ { "from": "human", "value": "I have written a toolbar that runs on the taskbar. Unfortunately, after it is installed, the user has to enable it manually. Is there a way to tell explorer to open (or close) a given toolbar?\nI would like for the installer, NSIS, to turn on the toolbar when the installation ...
I am having some trouble grasping some concepts behind the MVC framework. I am doing a very simple application which categorizes products. The Creation screen will simply use a dropdown list showing the list of categories, the name of the product and submit. On a normal .Net app, I would databind a server dropdownlist ...
No need to apologize for your question! Understanding how the MVC (Model-View-Controller) pattern works can take some time, especially if you're transitioning from a Web Forms model. Let's break down how to handle populating a dropdown list in an MVC application step by step. ### Overview of MVC In an MVC application...
36,806
[ { "from": "human", "value": "I am having some trouble grasping some concepts behind the MVC framework. I am doing a very simple application which categorizes products.\nThe Creation screen will simply use a dropdown list showing the list of categories, the name of the product and submit.\nOn a normal .Net a...
Hey! I was looking at this code at http://www.gnu.org/software/m68hc11/examples/primes_8c-source.html I noticed that in some situations they used hex numbers, like in line 134: for (j = 1; val && j <= 0x80; j <<= 1, q++) Now why would they use the 0x80? I am not that good with hex but I found an online hex to decimal ...
Using hexadecimal (hex) numbers in programming is common, especially when dealing with low-level programming, hardware registers, or when performing bitwise operations. Let's break down your questions and provide explanations and examples. ### Why Use Hexadecimal? 1. **Readability**: Hexadecimal numbers can make it e...
43,103
[ { "from": "human", "value": "Hey! I was looking at this code at http://www.gnu.org/software/m68hc11/examples/primes_8c-source.html\nI noticed that in some situations they used hex numbers, like in line 134:\nfor (j = 1; val && j <= 0x80; j <<= 1, q++)\n\nNow why would they use the 0x80? I am not that good w...
I've been looking at NHibernate recently and trying to learn the ins and outs. One thing I did notice in a few articles was the use of BuildSchema to create a testable database. The particular example used SqlLite as the database. Can BuildSchema be trusted to create your database or is it still best to create your own...
Using NHibernate's `BuildSchema` is a common practice, especially in early development and testing scenarios. Here are some points to consider when deciding whether to rely on `BuildSchema` or to create your own database schema: ### Pros of Using `BuildSchema` 1. **Speed of Development**: `BuildSchema` allows you to ...
43,287
[ { "from": "human", "value": "I've been looking at NHibernate recently and trying to learn the ins and outs. One thing I did notice in a few articles was the use of BuildSchema to create a testable database.\nThe particular example used SqlLite as the database. Can BuildSchema be trusted to create your datab...
I have to choose a server pages technology for a few server components that are written in Java and hosted by Tomcat, like Lucene search service and a flex BlazeDS graphic component. Not sure whether to use JSP or PHP. On one hand JSP can integrate with the components Java API easily while PHP will require another way ...
Choosing between JSP (JavaServer Pages) and PHP for your server components can indeed be a significant decision, especially when considering the architecture of your application and the technologies you are already using. Here are some points to consider for both options: ### JSP Advantages: 1. **Integration with Java...
43,669
[ { "from": "human", "value": "I have to choose a server pages technology for a few server components that are written in Java and hosted by Tomcat, like Lucene search service and a flex BlazeDS graphic component.\nNot sure whether to use JSP or PHP.\nOn one hand JSP can integrate with the components Java API...
I'm racking my brain trying to come up with an elegant solution to a DLL load problem. I have an application that statically links to other lib files which load DLLs. I'm not loading the DLLs directly. I'd like to have some DLLs in another folder other than the folder that the executable is in. Something like %working_...
You are encountering a common issue when dealing with DLLs in Windows, especially when you want to manage DLL locations dynamically. Here are several approaches you can consider to tackle your DLL loading problem without the complications of a helper application: ### 1. Use `SetDllDirectory` Windows provides a functi...
42,494
[ { "from": "human", "value": "I'm racking my brain trying to come up with an elegant solution to a DLL load problem. I have an application that statically links to other lib files which load DLLs. I'm not loading the DLLs directly. I'd like to have some DLLs in another folder other than the folder that the e...
We were using stringstream to prepare select queries in C++. But we were strongly advised to use QUERY PARAMETERS to submit db2 sql queries to avoid using of stringstream. Can anyone share what exactly meant by query parameter in C++? Also, share some practical sample code snippets. Appreciate the help in advance. Edit...
Certainly! The use of query parameters in database queries is an important aspect of writing secure and efficient SQL queries. When you use parameters instead of constructing SQL queries directly (e.g., using `stringstream`), you protect your application from SQL injection attacks and improve the performance of query e...
37,015
[ { "from": "human", "value": "We were using stringstream to prepare select queries in C++. But we were strongly advised to use QUERY PARAMETERS to submit db2 sql queries to avoid using of stringstream. Can anyone share what exactly meant by query parameter in C++? Also, share some practical sample code snipp...
We have a custom written on-line job application... application. HR is requesting a "skill sheet" added to the application. While we have yet to work with them to determine what all this could entail, I am starting to research if this is even feasible. At this point I am envisioning something similar to some of these ...
Creating a "skill sheet" for an online job application involves a few key components: defining the questions, storing them, displaying the forms, and storing the responses for reporting. Below, I’ll outline how to handle each of these components, and I'll also provide sample code snippets and resources to help you get ...
34,357
[ { "from": "human", "value": "We have a custom written on-line job application... application. HR is requesting a \"skill sheet\" added to the application. While we have yet to work with them to determine what all this could entail, I am starting to research if this is even feasible. \nAt this point I am env...
I have set up a sort of introspection-enabling C++ library that allows, using minimum macros and a fair amount of template trickery, to declare structures and classes that get enriched with some meta-information. This meta-information captures all important details about each field of the struct/class that you declare,...
Your problem indeed resembles a dynamic data-dictionary interpretation scenario, where you have a schema (in XML format) that describes the data structure, and binary data that you want to interpret based on that schema. Here’s a general approach to designing the reader component of your system: ### Steps to Design th...
41,151
[ { "from": "human", "value": "I have set up a sort of introspection-enabling C++ library that allows, using minimum macros and a fair amount of template trickery, to declare structures and classes that get enriched with some meta-information.\nThis meta-information captures all important details about each f...
I am quantitatively studying various metrics associated with automated tests. Chrome seems to have a reasonable set, so I wanted to add it to my data set. I downloaded the Chrome source code and tried to build it with VisualStudio but got several hundred errors--types not defined, identifiers not defined, etc. Has anyo...
Building the Chrome browser from source can indeed be challenging, especially on Windows, due to the complex dependencies and the way the build system is set up. However, it's definitely possible. Here are some steps and tips to help you succeed in building Chrome under Windows: ### Prerequisites 1. **Use WSL (Window...
40,245
[ { "from": "human", "value": "I am quantitatively studying various metrics associated with automated tests. Chrome seems to have a reasonable set, so I wanted to add it to my data set. I downloaded the Chrome source code and tried to build it with VisualStudio but got several hundred errors--types not define...
I've run into strange problem in my Flex/Flashcom application. If client application unexpectedly disconnects from server latter does not call application.onDisconnect handler function. In witch direction should I look? Thank you. Update I'm not using server components, but I do host this thing on Linux.
It sounds like you're dealing with a problem where the server doesn't properly invoke the `onDisconnect` handler when a client unexpectedly disconnects. This can be frustrating, especially in a Flex/FlashCom environment. Here are a few areas you might consider investigating to diagnose and resolve this issue: 1. **Net...
44,316
[ { "from": "human", "value": "I've run into strange problem in my Flex/Flashcom application. If client application unexpectedly disconnects from server latter does not call application.onDisconnect handler function. In witch direction should I look? Thank you.\nUpdate I'm not using server components, but I d...
So standard Agile philosophy would recommend making your domain classes simple POCOs which are Persisted using a separate proxy layer via data access objects (like NHibernate does it). It also recommends getting as high unit test coverage as possible. Does it make any sense to write tests for these simple POCO object...
Testing simple Plain Old CLR Objects (POCOs) like your `Container` class may seem less impactful at first glance, especially if they primarily consist of properties. However, there are still some useful tests you can perform. Here are a few ideas: 1. **Constructor Tests**: If your class has a constructor (especiall...
43,219
[ { "from": "human", "value": "So standard Agile philosophy would recommend making your domain classes simple POCOs which are Persisted using a separate proxy layer via data access objects (like NHibernate does it). It also recommends getting as high unit test coverage as possible. \nDoes it make any sense t...
I am using some C++ code that employs the CreateDIBSection function to create a bitmap and return a HBITMAP handle. What is the best way of getting this information into my .NET assembly?
To transfer a `HBITMAP` handle created in C++ to a .NET assembly, you can use PInvoke (Platform Invocation Services). This allows you to call native functions from .NET code. Below are the steps you can follow to achieve this: ### Step 1: Define Your C++ Function First, ensure you have a C++ function that creates a `...
42,945
[ { "from": "human", "value": "I am using some C++ code that employs the CreateDIBSection function to create a bitmap and return a HBITMAP handle. What is the best way of getting this information into my .NET assembly?\n" }, { "from": "gpt", "value": "To transfer a `HBITMAP` handle created in C++ ...
I'm developing web project in struts2 and I want validation in my own customized validation by disabling the struts2 validation, because if one field is being sent back it will check all fields but I want to check only at the time of submit.
To implement custom validation in a Struts2 application while disabling the default Struts2 validation mechanism, you can follow these steps: 1. **Disable Default Validation**: You can prevent Struts2 from performing its default validation by using the `@SkipValidation` annotation or by configuring your action in the ...
41,075
[ { "from": "human", "value": "I'm developing web project in struts2 and I want validation in my own customized validation by disabling the struts2 validation, because if one field is being sent back it will check all fields but I want to check only at the time of submit.\n" }, { "from": "gpt", "v...
I am looking to setup a transition between two levels(after one level is complete, use one of cocos2d's slick transition to transition into the next level). In my GameLayer implementation, I have methods setup to do things like [self buildLevel: 3] to build the playfield. What do I need to do to instantiate a new Gam...
In Cocos2d, transitioning between levels typically involves creating a new scene for the next level and using one of Cocos2d’s transition effects to move from the current scene to the new one. It's common practice to separate the setup of your game's scenes from their initialization so that you can easily transition be...
43,254
[ { "from": "human", "value": "I am looking to setup a transition between two levels(after one level is complete, use one of cocos2d's slick transition to transition into the next level). In my GameLayer implementation, I have methods setup to do things like [self buildLevel: 3] to build the playfield. What...
I am compiling a legacy C code here and there is a lot of variables and struct members named "interface", but VC2008 express is complaining about these, do you know how to disable this? I already changed settings to compile the code only as a C code, but no effect on this.
In Visual Studio 2008 (VC2008), the word "interface" is a reserved keyword in C++. If your codebase is being treated as C++ instead of C, it will generate compilation errors when encountering identifiers that conflict with reserved keywords. To compile your code as C code and avoid these errors, you should do the foll...
42,977
[ { "from": "human", "value": "I am compiling a legacy C code here and there is a lot of variables and struct members named \"interface\", but VC2008 express is complaining about these, do you know how to disable this?\nI already changed settings to compile the code only as a C code, but no effect on this.\n"...
I am trying to FTP some apple DMG files, if we do it by hand through Safari or IE it ends up at the destination just fine and uncorrupted. However, if I use a freeware FTP client that we had been using with great success for zip's and exe's or if I use a Powershell script I finished off (adapted from another stackover ...
It sounds like you're experiencing issues specifically related to the transmission of DMG files via FTP, even when other file types are transferring without issue. Here are some steps and considerations to help you troubleshoot the problem: ### 1. **Ensure Binary Mode Transfer** Even though you mentioned you're using ...
40,483
[ { "from": "human", "value": "I am trying to FTP some apple DMG files, if we do it by hand through Safari or IE it ends up at the destination just fine and uncorrupted. However, if I use a freeware FTP client that we had been using with great success for zip's and exe's or if I use a Powershell script I fini...
I am attempting to create a UML diagram representative of some Java code. In a class I have a method that is overloaded. As far as I know, parameters for methods aren't shown in UML diagrams. How do I represent method overloading in UML? Thanks.
In UML diagrams, method overloading can be represented by listing the method names with the same name but differentiating them with their parameter types. While UML does not display parameter names, it does include the parameter types to distinguish overloaded methods. Here’s how you can represent method overloading i...
44,573
[ { "from": "human", "value": "I am attempting to create a UML diagram representative of some Java code.\nIn a class I have a method that is overloaded.\nAs far as I know, parameters for methods aren't shown in UML diagrams.\nHow do I represent method overloading in UML?\nThanks.\n" }, { "from": "gpt"...
I write a Text Editor with Java , and I want to add Undo function to it but without UndoManager Class , I need to use a Data Structure like Stack or LinkedList but the Stack class in Java use Object parameters e.g : push(Object o) , Not Push(String s) I need some hints or links . Thanks
To implement an undo feature in your text editor without using the `UndoManager` class, you can use a `Stack` data structure. Since Java's `Stack` class operates on generic objects (meaning it can accept any type of object, including `String`), you can certainly use it to manage your text states. Here’s a general appro...
43,738
[ { "from": "human", "value": "I write a Text Editor with Java , and I want to add Undo function to it \nbut without UndoManager Class , I need to use a Data Structure like Stack or LinkedList but the Stack class in Java use Object parameters e.g : push(Object o) , Not Push(String s)\nI need some hints or l...
I converted my web application from preview 3 to beta1 and am now trying to put the new functions of the framework to use. One of them is ModelBinding. For this particular situation I created a class that is (for now) just a container of a bunch of simple-type properties. If I create a form with a bunch of textboxes, I...
To use model binding in your web application, especially when transitioning from a preview version to a beta release of a framework (e.g., ASP.NET Core), you can leverage the built-in model binding functionalities for your `SearchBag` class. Here are some steps and explanations to get you started: ### Step 1: Define Y...
34,711
[ { "from": "human", "value": "I converted my web application from preview 3 to beta1 and am now trying to put the new functions of the framework to use. One of them is ModelBinding.\nFor this particular situation I created a class that is (for now) just a container of a bunch of simple-type properties.\nIf I...
I've a table with two columns are a unique key together and i cannot change the schema. I'm trying to execute an update using psql in which i change the value of one of the column that are key. The script is similar to the following: BEGIN; UPDATE t1 SET P1='23' where P1='33'; UPDATE t1 SET P1='23' where P1='55'; COMMI...
The error you are encountering (`ERROR: duplicate key violates unique constraint "<key_name>"`) suggests that when you are trying to execute your updates in the manner described, there is a conflict with the unique constraint on the combination of the columns that form your unique key. When you update the first row wi...
43,569
[ { "from": "human", "value": "I've a table with two columns are a unique key together and i cannot change the schema.\nI'm trying to execute an update using psql in which i change the value of one of the column that are key. The script is similar to the following:\nBEGIN;\nUPDATE t1 SET P1='23' where P1='33'...
I'm using WCF and want to upload a large file from the client to the server. I have investigated and decided to follow the chunking approach outlined at http://msdn.microsoft.com/en-us/library/aa717050.aspx However, this approach (just like streaming) restricts the contract to limited method signitures: [OperationContr...
In WCF, when using chunking to upload files via a stream, the limitation you mentioned is that you can't directly include additional parameters in the method signature along with the `Stream` parameter. However, there are workarounds to accomplish your goal of passing additional metadata (like filename and file path) a...
38,358
[ { "from": "human", "value": "I'm using WCF and want to upload a large file from the client to the server. I have investigated and decided to follow the chunking approach outlined at http://msdn.microsoft.com/en-us/library/aa717050.aspx\nHowever, this approach (just like streaming) restricts the contract to ...
Well I've gotten myself in a pickle I did the subversion 1 click setup and it worked great. However, in setting up my repository I accidentally committed a file that I shouldn't have. Rather than jumping through the hoops of purging a file I deleted the repository and recreated it using "svnadmin create" as recommend...
It looks like you're dealing with a few issues here: the repository format error and the trouble with uninstalling and reinstalling Subversion. Let’s tackle these one by one. ### Expected Format Error The "Expected format '3' of repository; found format '5'" error indicates that you're trying to access a repository t...
41,509
[ { "from": "human", "value": "Well I've gotten myself in a pickle\nI did the subversion 1 click setup and it worked great. However, in setting up my repository I accidentally committed a file that I shouldn't have. Rather than jumping through the hoops of purging a file I deleted the repository and recreat...
Does anyone have a Powershell script to change the credentials used by a Windows service?
Certainly! You can change the credentials used by a Windows service using PowerShell. Below is a script that demonstrates how to do this. Make sure to run the script with administrative privileges, as changing service credentials requires elevated permissions. ### PowerShell Script to Change Windows Service Credential...
36,329
[ { "from": "human", "value": "Does anyone have a Powershell script to change the credentials used by a Windows service?\n" }, { "from": "gpt", "value": "Certainly! You can change the credentials used by a Windows service using PowerShell. Below is a script that demonstrates how to do this. Make s...
I have balls bouncing around and each time they collide their speed vector is reduced by the Coefficient of Restitution. Right now my balls CoR for my balls is .80 . So after many bounces my balls have "stopped" rolling because their speed has becoming some ridiculously small number. In what stage is it appropriate t...
You're on the right track with the idea of using an epsilon value to avoid jittering due to very small velocity values. In physics simulations, it's common to treat velocities that are very small as zero to prevent unnecessary computations and visual artifacts. Here's a breakdown of how you might implement this: ### 1...
43,458
[ { "from": "human", "value": "I have balls bouncing around and each time they collide their speed vector is reduced by the Coefficient of Restitution.\nRight now my balls CoR for my balls is .80 . So after many bounces my balls have \"stopped\" rolling because their speed has becoming some ridiculously small...
I have a quite big XML output from an application. I need to process it with my program and then feed it back to the original program. There are pieces in this XML which needs to be filled out our replaced. The interesting part looks like this: <sys:customtag sys:sid="1" sys:type="Processtart" /> <sys:tag>value</sy...
Using regular expressions to parse XML is generally not a good idea due to the complexity of XML syntax and the potential for nested structures. Instead, you should use XML parsing methods that are designed to handle the XML format properly. The `XmlDocument` class in C# provides a more reliable way to navigate and man...
39,318
[ { "from": "human", "value": "I have a quite big XML output from an application. I need to process it with my program and then feed it back to the original program. There are pieces in this XML which needs to be filled out our replaced. The interesting part looks like this:\n<sys:customtag sys:sid=\"1\" sys:...
I am trying to run client server UDP program . My both machines are in different networks. I have set up port forwarding in my router. My server has two IP Address : 1) External 200.?.?.? 2) Internal 192.168.0.100 While creating UDP server I need to create a socket which is binded to addresss. What address should I bin...
When setting up a UDP server that is expected to receive traffic from an external client, you should bind the socket to the internal (local) address of the server. However, to ensure that the server can accept packets directed to its external IP address, you have a couple of options: 1. **Bind to All Interfaces:** ...
41,352
[ { "from": "human", "value": "I am trying to run client server UDP program .\nMy both machines are in different networks. I have set up port forwarding in my router.\nMy server has two IP Address :\n1) External 200.?.?.?\n2) Internal 192.168.0.100\nWhile creating UDP server I need to create a socket which is...
I need to have my installer include the .NET Framework 3.5 SP1 as well as SQL Compact 3.5. I remember seeing a place somewhere in the Visual Studio IDE where these could be included in the install, but I can't find them. Does anyone know how to do this? Thanks!
To include the .NET Framework 3.5 SP1 and SQL Server Compact 3.5 in your installer using Visual Studio, you can use the **Setup Project** or **Visual Studio Installer Project** option. Here’s a step-by-step guide on how to do this: ### Prerequisites - Make sure you have the Visual Studio Installer Projects extension i...
39,562
[ { "from": "human", "value": "I need to have my installer include the .NET Framework 3.5 SP1 as well as SQL Compact 3.5. I remember seeing a place somewhere in the Visual Studio IDE where these could be included in the install, but I can't find them. Does anyone know how to do this? Thanks!\n" }, { ...
I am looking for good ideas for implementing a generic way to have a single line (or anonymous delegate) of code execute with a timeout. TemperamentalClass tc = new TemperamentalClass(); tc.DoSomething(); // normally runs in 30 sec. Want to error at 1 min I'm looking for a solution that can elegantly be implemented ...
To implement a generic timeout mechanism for executing a method in C#, you can leverage the `Task`, `CancellationTokenSource`, and `Task.WhenAny` constructs. This allows you to run the method in a separate task and apply a timeout to it. If the method does not complete in the allotted time, you can cancel its execution...
40,127
[ { "from": "human", "value": "I am looking for good ideas for implementing a generic way to have a single line (or anonymous delegate) of code execute with a timeout.\nTemperamentalClass tc = new TemperamentalClass();\ntc.DoSomething(); // normally runs in 30 sec. Want to error at 1 min\n\nI'm looking for ...
I don't know how to save object with where clause. I need it to prevent saving object with range of dates overlapping on others. public class TaskEvent { public DateTime StartDate {get;set;} public DateTime EndDate {get;set;} } I want to check overlaping in criteria within saving operation but I don't know how...
To prevent saving an object with overlapping date ranges, you can implement a method to check for overlaps before you save the `TaskEvent`. This will generally involve querying your data store for existing `TaskEvent` objects and checking if their date ranges intersect with the date range of the new event. Assuming yo...
43,983
[ { "from": "human", "value": "I don't know how to save object with where clause. I need it to prevent saving object with range of dates overlapping on others.\npublic class TaskEvent\n{\n public DateTime StartDate {get;set;}\n public DateTime EndDate {get;set;}\n}\n\nI want to check overlaping in crite...
How do I embed a WMV file in an ASP.NET Web page? I want it visible as a player, not just a link. Is there an ASP.NET control for this? I don't see one on the VS 2008 toolbar, and can't find one in the help. And I'm not yet ready to move this site to Silverlight, where media is really easy.
To embed a WMV file in an ASP.NET web page, you can use the HTML `<object>` or `<embed>` tag since there isn't a specific ASP.NET control for embedding media like WMV files. Below are some examples of how to do this: ### Using the `<object>` Tag This is the recommended approach as it is more standard and offers bette...
43,294
[ { "from": "human", "value": "How do I embed a WMV file in an ASP.NET Web page? I want it visible as a player, not just a link. Is there an ASP.NET control for this? I don't see one on the VS 2008 toolbar, and can't find one in the help. And I'm not yet ready to move this site to Silverlight, where media is ...
I hava an ajax application that will not display an image, or make a popup window from html stored in a file. This is the code I am usiong for the popup: echo '<script> function makewindows(){ child1 = window.open ("about:blank"); child1.document.write(' . json_encode($row2["ARTICLE_DESC"]) . '); child1.document.close...
It looks like you're experiencing two primary issues in your AJAX application: 1. **Image Source Issue**: The `img src` attribute returns an empty string, which means that the variable `$lastImg` is not being set correctly or isn't assigned a value before being used in the HTML. 2. **Popup Window Content Issue**: Th...
42,521
[ { "from": "human", "value": "I hava an ajax application that will not display an image, or make a popup window from html stored in a file.\nThis is the code I am usiong for the popup:\necho '<script> \nfunction makewindows(){\nchild1 = window.open (\"about:blank\");\nchild1.document.write(' . json_encode($r...
Where can I find description of how to map ODBC datatypes to JDBC? Or maybe anybody knows where source code of a jdbc-odbc bridge driver can be downloaded?
Mapping ODBC data types to JDBC data types is not standardized, but there are some general guidelines that can help you understand how the mapping typically works. Here are some common ODBC to JDBC type mappings: - **ODBC SQL CHAR / VARCHAR** maps to **JDBC java.sql.Types.VARCHAR** - **ODBC SQL LONGVARCHAR** maps to *...
42,180
[ { "from": "human", "value": "Where can I find description of how to map ODBC datatypes to JDBC?\nOr maybe anybody knows where source code of a jdbc-odbc bridge driver can be downloaded?\n" }, { "from": "gpt", "value": "Mapping ODBC data types to JDBC data types is not standardized, but there are...
Can anyone point to live examples of SOAP or REST web services? How do you use or test an existing web service with a client?
Certainly! Here are live examples of both SOAP and REST web services, along with guidance on how to use or test them using clients. ### Examples of Web Services #### SOAP Web Service - **Example**: [The Calculator Web Service](http://www.dneonline.com/calculator.asmx) - This is a simple SOAP web service that allows...
40,925
[ { "from": "human", "value": "Can anyone point to live examples of SOAP or REST web services? How do you use or test an existing web service with a client?\n" }, { "from": "gpt", "value": "Certainly! Here are live examples of both SOAP and REST web services, along with guidance on how to use or t...
I'm using Windows XP Service Pack 3 and have Command Extensions enabled by default in the Windows Registry. Somehow, the following command does not work on this version of Windows but if I run it in Windows Server 2003 or Windows Vista Business, it works just fine. Any clue? The problem is that on Windows XP, it seems ...
The issue you're experiencing with the `for /f` command on Windows XP is likely due to how the command's output from `tasklist` is being parsed. In Windows XP, the output of `tasklist /FI "IMAGENAME eq python.exe" /NH` can behave differently compared to later versions like Windows Server 2003 or Windows Vista. Specif...
43,976
[ { "from": "human", "value": "I'm using Windows XP Service Pack 3 and have Command Extensions enabled by default in the Windows Registry.\nSomehow, the following command does not work on this version of Windows but if I run it in Windows Server 2003 or Windows Vista Business, it works just fine. Any clue?\nT...
I have Perl on Mac, Windows and Ubuntu. How can I tell from within the script which one is which? Edit: I was asked what I am doing. It is a script, part of our cross-platform build system. The script recurses directories and figures out what files to build. Some files are platform-specific, and thus, on Linux I don't ...
You can determine the operating system from within a Perl script by checking the value of the special variable `$^O`, which contains the name of the operating system. Here's how you can check for the three platforms you've mentioned (macOS, Windows, and Ubuntu): ```perl use strict; use warnings; my $os = $^O; if ($o...
45,629
[ { "from": "human", "value": "I have Perl on Mac, Windows and Ubuntu. How can I tell from within the script which one is which?\nEdit: I was asked what I am doing. It is a script, part of our cross-platform build system. The script recurses directories and figures out what files to build. Some files are plat...
I have a word : [lesserthen] , that I need to replace with < zero or more times in a string. I'm using the String.replace method to do so. But the word is only replaced one time in the string, I need to be replaced more then one time. I'm very weak with regular expressions and I'm interested to find a solution for this...
The issue you're encountering is that the `String.replace` method in JavaScript (and many other programming languages) replaces only the first occurrence of the substring when you pass a string as the first argument. To replace all occurrences of a substring, you can use a regular expression with the global flag `g`. ...
45,036
[ { "from": "human", "value": "I have a word : [lesserthen] , that I need to replace with < zero or more times in a string. I'm using the String.replace method to do so. But the word is only replaced one time in the string, I need to be replaced more then one time. I'm very weak with regular expressions and I...