instruction
stringlengths
14
27.6k
completion
stringlengths
3
38.3k
__original_row_idx
int64
0
50k
conversations
listlengths
2
2
recently I was given the task to discover a C# solution I have never seen before, and give suggestions on refactoring it. I think I will use NDepend (for the first time ever) to see the overall picture, and also to check a lot of code metrics to figure out what could be refactored. NDepend is pretty good at showing the...
When tasked with discovering and understanding a codebase for the first time—especially one that lacks design documentation and comments—it's essential to approach it methodically. Here are some effective strategies to help you understand the structure and identify areas for refactoring: ### 1. **Leverage Tools like N...
18,329
[ { "from": "human", "value": "recently I was given the task to discover a C# solution I have never seen before, and give suggestions on refactoring it. I think I will use NDepend (for the first time ever) to see the overall picture, and also to check a lot of code metrics to figure out what could be refactor...
I have used fork() in C to start another process. How do I start a new thread?
In C, you can create a new thread using the POSIX Threads (pthreads) library, which provides a set of APIs for thread creation and management. Below is a simple example that demonstrates how to create and run a new thread in C using pthreads. 1. First, make sure to include the necessary headers: ```c #include <s...
20,349
[ { "from": "human", "value": "I have used fork() in C to start another process. How do I start a new thread?\n" }, { "from": "gpt", "value": "In C, you can create a new thread using the POSIX Threads (pthreads) library, which provides a set of APIs for thread creation and management. Below is a s...
What aspects of the UpdatePanel are sensitive to time? I have an UpdatePanel that works fine. If I leave the page for a few minutes and come back, the UpdatePanel doesn't work. Looking at firebug, I see that it sends the Request and gets a Response back. However, the page itself doesn't update. I'm not seeing any s...
The issue you're experiencing with the UpdatePanel not working after leaving the page for a few minutes could be attributed to several factors, often related to session management, JavaScript execution context, or state management. Here are some possible aspects that could be sensitive to time: 1. **Session Timeout**:...
23,011
[ { "from": "human", "value": "What aspects of the UpdatePanel are sensitive to time?\nI have an UpdatePanel that works fine. If I leave the page for a few minutes and come back, the UpdatePanel doesn't work. Looking at firebug, I see that it sends the Request and gets a Response back. However, the page it...
When I insert a DVD or CD, I want to programmatically know what type of media(DVD or CD) is it.
To programmatically determine the type of media (CD or DVD) inserted into a drive, you can use various programming languages and libraries depending on your operating system. Below are examples of how you can achieve this in different environments. ### Windows On Windows, you can use the Windows API, and specifically...
15,906
[ { "from": "human", "value": "When I insert a DVD or CD, I want to programmatically know what type of media(DVD or CD) is it.\n" }, { "from": "gpt", "value": "To programmatically determine the type of media (CD or DVD) inserted into a drive, you can use various programming languages and libraries...
I have a Makefile building many C files with long long command lines and we've cleaned up the output by having rules such as: .c${MT}.doj: @echo "Compiling $<";\ $(COMPILER) $(COPTS) -c -o $@ $< Now this is great as the @ suppresses the compilation line being emitted. But when we get an error, all we...
You're right in that the usual `@` in front of a command in a Makefile suppresses the command output, which can make debugging compilation errors more challenging since you don't see the full command being executed. Instead of writing the command line to a file and reading it later, you can approach this in a cleaner w...
24,418
[ { "from": "human", "value": "I have a Makefile building many C files with long long command lines and we've cleaned up the output by having rules such as:\n.c${MT}.doj:\n\n @echo \"Compiling $<\";\\\n $(COMPILER) $(COPTS) -c -o $@ $<\n\nNow this is great as the @ suppresses the compilation li...
Given a source color of any hue by the system or user, I'd like a simple algorithm I can use to work out a lighter or darker variants of the selected color. Similar to effects used on Windows Live Messenger for styling the user interface. Language is C# with .net 3.5. Responding to comment: Color format is (Alpha)RGB. ...
To create lighter or darker variants of a color in C#, you can manipulate the RGB components of the color. Here's a simple algorithm to achieve this using the `System.Drawing.Color` structure. We will create two methods: one for making the color lighter and another for making it darker. ### Algorithm: 1. **Lighten**: ...
10,118
[ { "from": "human", "value": "Given a source color of any hue by the system or user, I'd like a simple algorithm I can use to work out a lighter or darker variants of the selected color. Similar to effects used on Windows Live Messenger for styling the user interface.\nLanguage is C# with .net 3.5.\nRespondi...
I have noticed that some apps like Safari and Mail show a loading indicator in the status bar (the bar at the very top of the phone) when they are accessing the network. Is there a way to do the same thing in SDK apps, or is this an Apple only thing?
In iOS, the loading indicator in the status bar (often referred to as the network activity indicator) is a feature that was traditionally available through the `UIApplication` class. However, starting with iOS 13, Apple deprecated the network activity indicator in the status bar for standard use, meaning that it won't ...
21,363
[ { "from": "human", "value": "I have noticed that some apps like Safari and Mail show a loading indicator in the status bar (the bar at the very top of the phone) when they are accessing the network. Is there a way to do the same thing in SDK apps, or is this an Apple only thing?\n" }, { "from": "gpt...
What's wrong with Linq to SQL? Or - what about Linq to SQL would make it unsuitable for a project, either new or existing? I want to hear about why you would not choose Linq to SQL for a particular project - including what project parameters make it unsuitable.
LINQ to SQL is an Object-Relational Mapping (ORM) framework for .NET that allows developers to query databases using LINQ (Language Integrated Query). While it has its advantages, there are several reasons why it might be unsuitable for certain projects: ### Limitations of LINQ to SQL: 1. **Single Database Support**:...
18,338
[ { "from": "human", "value": "What's wrong with Linq to SQL?\nOr - what about Linq to SQL would make it unsuitable for a project, either new or existing? I want to hear about why you would not choose Linq to SQL for a particular project - including what project parameters make it unsuitable.\n" }, { ...
I have a SQL script that creates a package with a comment containing an ampersand (&). When I run the script from SQL Plus, I am prompted to enter a substitute value for the string starting with &. How do I disable this feature so that SQL Plus ignores the ampersand?
In SQL Plus, the ampersand (`&`) is used to denote substitution variables, which is why you're being prompted for input. To disable this feature and prevent SQL Plus from treating the ampersand as a substitution variable, you can use the `SET DEFINE` command. Here's how you can do it: 1. At the beginning of your SQL ...
25,078
[ { "from": "human", "value": "I have a SQL script that creates a package with a comment containing an ampersand (&). When I run the script from SQL Plus, I am prompted to enter a substitute value for the string starting with &. How do I disable this feature so that SQL Plus ignores the ampersand?\n" }, {...
I wound up modifying the source from a publically posted POC: http://datacogs.com/datablogs/archive/2007/08/26/641.aspx, which is a custom field definition for cascading drop downs. The modifications were to allow parent-child list boxes where a user can multiselect for filtering and selecting the values to be written...
Hi Peter, It sounds like you're making good progress on your custom field definition for cascading dropdowns and parent-child list boxes in SharePoint. To enable multi-selection and ensure that all selected values are saved correctly to your SharePoint list, there are a few key points to check: 1. **Correct Base Type...
23,904
[ { "from": "human", "value": "I wound up modifying the source from a publically posted POC: http://datacogs.com/datablogs/archive/2007/08/26/641.aspx, which is a custom field definition for cascading drop downs. The modifications were to allow parent-child list boxes where a user can multiselect for filteri...
We're getting ready to translate our PHP website into various languages, and the gettext support in PHP looks like the way to go. All the tutorials I see recommend using the english text as the message ID, i.e. gettext("Hi there!") But is that really a good idea? Let's say someone in marketing wants to change the text...
Using the English text as the message ID in gettext can indeed lead to challenges, particularly when content needs to be updated or changed frequently. Here are some considerations to help you decide between using the English text as the message ID or a more generic identifier: ### Pros of Using English Text as Messag...
21,585
[ { "from": "human", "value": "We're getting ready to translate our PHP website into various languages, and the gettext support in PHP looks like the way to go.\nAll the tutorials I see recommend using the english text as the message ID, i.e.\ngettext(\"Hi there!\")\nBut is that really a good idea? Let's say...
I would like to ask you which automated build environment you consider better, based on practical experience. I'm planning to do some .Net and some Java development, so I would like to have a tool that supports both these platforms. I've been reading around and found out about CruiseControl.NET, used on stackoverflow d...
Both CruiseControl.NET and TeamCity are popular options for Continuous Integration (CI) and Continuous Deployment (CD) environments. Here’s a comparative analysis based on ease of use, management, and compatibility with .NET and Java: ### CruiseControl.NET **Pros:** - **Open Source**: Being open-source, it can be mod...
21,330
[ { "from": "human", "value": "I would like to ask you which automated build environment you consider better, based on practical experience. I'm planning to do some .Net and some Java development, so I would like to have a tool that supports both these platforms.\nI've been reading around and found out about ...
Some of my data are 64-bit integers. I would like to send these to a JavaScript program running on a page. However, as far as I can tell, integers in most JavaScript implementations are 32-bit signed quantities. My two options seem to be: Send the values as strings Send the values as 64-bit floating point numbers Opt...
Handling 64-bit integers in JavaScript can indeed be tricky since JavaScript uses the IEEE 754 double-precision floating-point format for all numeric values, which can accurately represent integers up to \(2^{53} - 1\) (or 9,007,199,254,740,991). Beyond this range, integers can lose precision, making your second option...
22,039
[ { "from": "human", "value": "Some of my data are 64-bit integers. I would like to send these to a JavaScript program running on a page.\nHowever, as far as I can tell, integers in most JavaScript implementations are 32-bit signed quantities.\nMy two options seem to be:\n\nSend the values as strings\nSend th...
I have a bit of a hybrid situation on my hands. I'm writing an intranet asp.net web app. I don't want to use full blown Windows Authentication, because I don't have proper groups set up in Active Directory to be able to authenticate users simply based on what group they are in. Up until now, I had created a membership ...
Yes, it is possible to create a custom membership provider that allows you to authenticate users based on their NT (Windows) login while still using Forms Authentication. This way, you can leverage the ASP.NET provider framework, including the Membership and Roles providers, without needing to use full-blown Windows Au...
19,831
[ { "from": "human", "value": "I have a bit of a hybrid situation on my hands. I'm writing an intranet asp.net web app. I don't want to use full blown Windows Authentication, because I don't have proper groups set up in Active Directory to be able to authenticate users simply based on what group they are in. ...
In order to improve performance reading from a file, I'm trying to read the entire content of a big (several MB) file into memory and then use a istringstream to access the information. My question is, which is the best way to read this information and "import it" into the string stream? A problem with this approach (s...
To read the entire content of a large file into memory and then access it using an `istringstream` without unnecessary copying, you can directly construct the `std::string` using the buffer and then create the `istringstream` from that string. The key is to avoid the extra copy that occurs when creating the `std::strin...
22,296
[ { "from": "human", "value": "In order to improve performance reading from a file, I'm trying to read the entire content of a big (several MB) file into memory and then use a istringstream to access the information.\nMy question is, which is the best way to read this information and \"import it\" into the st...
How do you generate a random number within a range while excluding certain range(s). Eg. range 1-10 but not in 2-4 or 7. Solutions I've used so far: Generate a random an test if it is within the dis-allowed range. Based on result either output the number or try again. Map allowed ranges to a uniform range. Get a rando...
Your existing solutions are valid approaches to generating a random number within a specified range while excluding certain numbers or ranges. Here's a concise overview of each method, along with a new alternative solution that combines some of the concepts you've mentioned. ### Existing Solutions 1. **Retry Until Su...
21,854
[ { "from": "human", "value": "How do you generate a random number within a range while excluding certain range(s). Eg. range 1-10 but not in 2-4 or 7.\nSolutions I've used so far:\n\nGenerate a random an test if it\nis within the dis-allowed range.\nBased on result either output the\nnumber or try again.\nMa...
From C#, is it possible to detect the number of context switches that occurred while executing a block of code on a particular thread? Ideally, I'd like to know how many times and what CPU my thread code was scheduled on. I know I can use tools like Event Tracing for Windows and the associated viewers, but this seemed ...
Detecting the exact number of context switches that occur while executing a block of code on a specific thread is not straightforward in C#. The .NET framework does not provide built-in APIs to directly access low-level thread scheduling information such as context switch counts, as it's abstracted away from managed co...
21,843
[ { "from": "human", "value": "From C#, is it possible to detect the number of context switches that occurred while executing a block of code on a particular thread? Ideally, I'd like to know how many times and what CPU my thread code was scheduled on.\nI know I can use tools like Event Tracing for Windows an...
When I debug locally in fire fox 2.0x many times my page won't have the styles added properly or the page will not completely render (the end is seemingly cut off). Sometimes it takes multiple refreshes or shift-refreshes to fix this. Is this a common issue or is it just me? Any solutions? I want to add that this is ha...
It sounds like you're encountering issues related to caching and file loading when debugging your application locally in Firefox and IE. Here are some common causes and potential solutions: ### Causes: 1. **Caching Issues**: Browsers often cache files (like CSS and JavaScript), and if you are making changes to those f...
21,598
[ { "from": "human", "value": "When I debug locally in fire fox 2.0x many times my page won't have the styles added properly or the page will not completely render (the end is seemingly cut off). Sometimes it takes multiple refreshes or shift-refreshes to fix this. Is this a common issue or is it just me? Any...
The following snippet is supposed to take the value of PROJECT (defined in the Makefile) and create an include file name. For example, if PROJECT=classifier, then it should at the end generate classifier_ir.h for PROJECTINCSTR I find that this code works as long as I am not trying to use an underscore in the suffix. Ho...
The problem in your code arises from the use of the `##` operator in the `MAKEINC` macro. This operator is used for token pasting in C/C++ preprocessor macros, but it requires the arguments to be valid tokens. When you use `PROJECT`, the preprocessor expects it to be a valid token, but as a result of the token pasting ...
21,998
[ { "from": "human", "value": "The following snippet is supposed to take the value of PROJECT (defined in the Makefile)\nand create an include file name. For example, if PROJECT=classifier, then it should at the end generate classifier_ir.h for PROJECTINCSTR\nI find that this code works as long as I am not tr...
I am trying to call a COM object from PHP using the COM interop extension. One function requires an OLE_COLOR as an argument? Is there any way to pass this kind of value from PHP? I have tried passing a simple integer value with no success. $this->oBuilder->Font->Color = 255;
In the context of calling a COM object from PHP, particularly when working with OLE_COLOR, it's important to ensure that you're passing the value in the format that the COM object expects. OLE_COLOR is typically represented as a 32-bit unsigned integer, and its values can be in the form of `0x00RRGGBB`, where `RR`, `GG...
22,154
[ { "from": "human", "value": "I am trying to call a COM object from PHP using the COM interop extension. One function requires an OLE_COLOR as an argument? Is there any way to pass this kind of value from PHP?\nI have tried passing a simple integer value with no success.\n$this->oBuilder->Font->Color = 255;\...
I apologize if this is slightly off-topic. I'm hoping to find a software-as-a-service CRM system that can be easily integrated with our custom user management application. Fundamentally, we have user our own accounts and provide services to these registered users; frequently, we have email conversations with people th...
There are several CRM vendors that might meet your requirements for email integration and a robust API for accessing email records. Here are a few options you could consider: 1. **HubSpot CRM**: HubSpot offers a comprehensive CRM with strong email tracking capabilities. You can set up a shared inbox or use their email...
21,765
[ { "from": "human", "value": "I apologize if this is slightly off-topic. \nI'm hoping to find a software-as-a-service CRM system that can be easily integrated with our custom user management application. Fundamentally, we have user our own accounts and provide services to these registered users; frequently, ...
I'm a .Net developer and would like to investigate building and running our framework on Mono. If the initial project is successful I will happily invest in an OS learning curve, but right now I want to focus on getting things up and running and seeing the code working. What would be the best distribution to start wi...
It's great to hear that you're diving into Mono and exploring Linux as part of your .NET development journey! Here’s a concise guide to help you get started. ### Distribution Recommendations Given your background as a developer and your current focus on getting up and running quickly, **Ubuntu** is typically one of th...
21,443
[ { "from": "human", "value": "I'm a .Net developer and would like to investigate building and running our framework on Mono. \nIf the initial project is successful I will happily invest in an OS learning curve, but right now I want to focus on getting things up and running and seeing the code working.\nWhat...
I have a Winform application built with C# and .Net 2.0. I have a textbox set with the MultiLine property. The problem is when someone writes text with multiple lines (press few enters), presses the save button, and then closes and loads the form again, all the new lines disappear (the text is there at least). For exam...
It sounds like you're encountering an issue with how the new line characters are being handled when you retrieve the text from your database and display it in the multiline TextBox. In Windows Forms, multiline TextBoxes recognize newline characters as `\r\n` (carriage return + line feed) for line breaks. However, it's ...
17,261
[ { "from": "human", "value": "I have a Winform application built with C# and .Net 2.0. I have a textbox set with the MultiLine property.\nThe problem is when someone writes text with multiple lines (press few enters), presses the save button, and then closes and loads the form again, all the new lines disapp...
In PHP, replace one URL with another within a string e.g. New post on the site <a href="http://stackoverflow.com/xyz1">http://stackoverflow.com/xyz1</a></p> becomes: New post on the site <a href="http://yahoo.com/abc1">http://yahoo.com/abc1</a></p> Must work for repeating strings as above. Appreciate this is simple ...
You can easily achieve this using the `str_replace` function in PHP, which allows you to replace all occurrences of a given string with another string. Here's an example of how you can replace one URL with another in a given string: ```php <?php // Original string containing the URL $originalString = 'New post on th...
23,671
[ { "from": "human", "value": "In PHP, replace one URL with another within a string e.g. \nNew post on the site <a href=\"http://stackoverflow.com/xyz1\">http://stackoverflow.com/xyz1</a></p>\n\nbecomes:\nNew post on the site <a href=\"http://yahoo.com/abc1\">http://yahoo.com/abc1</a></p>\n\nMust work for rep...
I'm adding windows event logging functionality to an existing Java application and I'd like to utilize event ids(our admin is using them already). Is there a way to specify the event ID when logging with NTEventLogAppender?
Yes, you can specify the event ID when logging with `NTEventLogAppender` in Java, which is commonly used in logging frameworks such as Log4j or Logback for Windows Event Log integration. To use `NTEventLogAppender` and specify an event ID, you'll typically need to configure it properly in your logging configuration fi...
19,512
[ { "from": "human", "value": "I'm adding windows event logging functionality to an existing Java application and I'd like to utilize event ids(our admin is using them already). Is there a way to specify the event ID when logging with NTEventLogAppender?\n" }, { "from": "gpt", "value": "Yes, you c...
I am going to be starting a javascript reporting engine for my website, and have started some prototyping using MooTools. I really like being able to do things like this: function showLeagues(leagues) { var leagueList = $("leagues"); leagueList.empty(); for(var i = 0; i<leagues.length; ++i) { var l...
In jQuery, while there isn't a direct equivalent to MooTools' `Element` constructor, you can achieve similar functionality by chaining jQuery methods together. In your case, creating elements, attaching HTML, and binding events can all be done with jQuery. Here’s how you can rewrite your `showLeagues` and `getLeagueLi...
20,367
[ { "from": "human", "value": "I am going to be starting a javascript reporting engine for my website, and have started some prototyping using MooTools. I really like being able to do things like this:\nfunction showLeagues(leagues) {\n var leagueList = $(\"leagues\");\n leagueList.empty();\n for(va...
How do I check if an object is of a given type, or if it inherits from a given type? How do I check if the object o is of type str? Beginners often wrongly expect the string to already be "a number" - either expecting Python 3.x input to convert type, or expecting that a string like '1' is also simultaneously an integ...
In Python, you can check if an object is of a specific type or if it inherits from a certain type using the built-in `isinstance()` function. This function checks whether the object is an instance of the specified class or a subclass thereof. To check if an object `o` is of type `str`, you would use: ```python if isi...
22,500
[ { "from": "human", "value": "How do I check if an object is of a given type, or if it inherits from a given type?\nHow do I check if the object o is of type str?\n\nBeginners often wrongly expect the string to already be \"a number\" - either expecting Python 3.x input to convert type, or expecting that a s...
I have a revision that has been committed to SVN trunk which I would like to roll back. However, I would like to retain the changes in some fashion such as a branch or even a patch file. Any suggestions?
If you need to roll back a revision in SVN but want to keep the changes for future reference, you can follow these steps: ### Option 1: Creating a Branch 1. **Create a Branch**: First, create a branch from the current trunk. This way, you can keep a copy of the changes made in that revision. ```bash svn copy...
22,172
[ { "from": "human", "value": "I have a revision that has been committed to SVN trunk which I would like to roll back. However, I would like to retain the changes in some fashion such as a branch or even a patch file. Any suggestions?\n" }, { "from": "gpt", "value": "If you need to roll back a r...
I have a website with all my photos, I would like people to be able to click on my pictures and order prints, etc through a third party service (Shutterfly, etc). Does anyone have any best practices or code examples of doing this in C#, ASP.NET?
Integrating a third-party service like Shutterfly for ordering prints from a photo website built with C# and ASP.NET involves several steps. Below, I’ll outline best practices and provide a basic example of how to implement this functionality. ### Best Practices 1. **API Integration**: If Shutterfly has an API, use i...
19,686
[ { "from": "human", "value": "I have a website with all my photos, I would like people to be able to click on my pictures and order prints, etc through a third party service (Shutterfly, etc). Does anyone have any best practices or code examples of doing this in C#, ASP.NET?\n" }, { "from": "gpt", ...
I've incorporated Apple's Reachability sample into my own project so I know whether or not I have a network connection - if I don't have a network connection, I don't bother sending out and requests. I decided to go with the status notification implementation because it seemed easier to have the reachablity updated in ...
It sounds like you're encountering a common issue related to detecting network connectivity on older devices like the first-generation iPhone, especially when relying on the Reachability class from Apple's sample code. Here are some suggestions to improve the detection of your network connection, particularly with EDGE...
19,646
[ { "from": "human", "value": "I've incorporated Apple's Reachability sample into my own project so I know whether or not I have a network connection - if I don't have a network connection, I don't bother sending out and requests. I decided to go with the status notification implementation because it seemed e...
I've been using jQuery to do the whole AJAX magic in my web based applications. But I came to a decision that I don’t need all these amazing features jQuery has, except its AJAX functions (like $.ajax(), $.get(), $.post, getJSON() and load();). Can you recommend a lightweight crossbrowser AJAX library/framework (up to...
If you're looking for a lightweight library to handle AJAX requests without the full overhead of jQuery, here are some great options, all of which are relatively small in size: 1. **Axios**: - **Size**: Approximately 14 KB (minified and gzipped), slightly above your desired limit but very popular. - **Descriptio...
22,995
[ { "from": "human", "value": "I've been using jQuery to do the whole AJAX magic in my web based applications.\nBut I came to a decision that I don’t need all these amazing features jQuery has, except its AJAX functions (like $.ajax(), $.get(), $.post, getJSON() and load();). \nCan you recommend a lightweight...
I'm using VisualC++ 6.0. (and, yes, I'm using Mosaic browser..;) My VC++ project has different dependency setting for 'Debug' and 'Release' build configuration. So, when I switch from one configuration to other, I have to change the dependency by hand every time. Is there any better way to do this? Can I keep my depen...
In Visual C++ 6.0, managing dependencies for different configurations (Debug vs. Release) typically requires some manual effort, as you’ve experienced. However, there are a few strategies you can consider to manage your dependencies more effectively: 1. **Use Project Settings**: You can set dependencies on a per-confi...
24,463
[ { "from": "human", "value": "I'm using VisualC++ 6.0. (and, yes, I'm using Mosaic browser..;)\nMy VC++ project has different dependency setting for 'Debug' and 'Release' build configuration.\nSo, when I switch from one configuration to other, I have to change the dependency \nby hand every time.\nIs there a...
I'm trying to create an access control system. Here's a stripped down example of what the table I'm trying to control access to looks like: things table: id group_id name 1 1 thing 1 2 1 thing 2 3 1 thing 3 4 1 thing 4 5 2 thing 5 And the access control ...
To achieve your desired result, we will need to use a combination of a `LEFT JOIN` and a `CASE` statement to prioritize access rules for individual things over group rules. This can be done effectively with a Common Table Expression (CTE) or a subquery to aggregate the access levels and handle the logic for prioritizat...
20,147
[ { "from": "human", "value": "I'm trying to create an access control system. \nHere's a stripped down example of what the table I'm trying to control access to looks like:\nthings table:\nid group_id name\n1 1 thing 1\n2 1 thing 2\n3 1 thing 3\n4 1 thing 4\...
I am building Java web applications, and I hate the traditional "code-compile-deploy-test" cycle. I want to type in one tiny change, then see the result INSTANTLY, without having to compile and deploy. Fortunately, Jetty is great for this. It is a pure-java web server. It comes with a really nice maven plugin which let...
You can achieve a more seamless development experience with Jetty by using a few different strategies for handling your static assets like JavaScript and CSS files. Here are a couple of approaches to allow you to modify these files without having Jetty lock them: ### 1. Use the `--dev` Mode of Jetty Jetty has a develo...
23,369
[ { "from": "human", "value": "I am building Java web applications, and I hate the traditional \"code-compile-deploy-test\" cycle. I want to type in one tiny change, then see the result INSTANTLY, without having to compile and deploy.\nFortunately, Jetty is great for this. It is a pure-java web server. It com...
Scenario: I'm currently writing a layer to abstract 3 similar webservices into one useable class. Each webservice exposes a set of objects that share commonality. I have created a set of intermediary objects which exploit the commonality. However in my layer I need to convert between the web service objects and my obje...
The issue you're facing stems from the fact that when you create an array of objects (i.e., `object[]`), it doesn't automatically allow you to cast that array to a strongly typed array (like `Property[]`). Even though the individual elements of the array are of the desired type, the array itself is still treated as an ...
20,521
[ { "from": "human", "value": "Scenario:\nI'm currently writing a layer to abstract 3 similar webservices into one useable class. Each webservice exposes a set of objects that share commonality. I have created a set of intermediary objects which exploit the commonality. However in my layer I need to convert b...
Currently I monitoring a particular file with a simple shell one-liner: filesize=$(ls -lah somefile | awk '{print $5}') I'm aware that Perl has some nice modules to deal with Excel files so the idea is to, let's say, run that check daily, perhaps with cron, and write the result on a spreadsheet for further statistica...
To achieve your goal of monitoring a file size and writing the result to an Excel file daily using a cron job, you can utilize Perl along with a module like `Spreadsheet::WriteExcel` or `Excel::Writer::XLSX`. Below is a step-by-step guide on how to do this: ### Step 1: Install Required Perl Module First, you'll need ...
19,058
[ { "from": "human", "value": "Currently I monitoring a particular file with a simple shell one-liner:\nfilesize=$(ls -lah somefile | awk '{print $5}')\n\nI'm aware that Perl has some nice modules to deal with Excel files so the idea is to, let's say, run that check daily, perhaps with cron, and write the re...
When developing WPF UserControls, what is the best way to expose a DependencyProperty of a child control as a DependencyProperty of the UserControl? The following example shows how I would currently expose the Text property of a TextBox inside a UserControl. Surely there is a better / simpler way to accomplish this? ...
Exposing a DependencyProperty of a child control in a WPF UserControl can indeed be simplified. Instead of using a `Binding` in the XAML to bind the TextBox's Text property to the UserControl's DependencyProperty, you can directly bind the TextBox's Text property to the UserControl's DependencyProperty in code-behind. ...
9,165
[ { "from": "human", "value": "When developing WPF UserControls, what is the best way to expose a DependencyProperty of a child control as a DependencyProperty of the UserControl? The following example shows how I would currently expose the Text property of a TextBox inside a UserControl. Surely there is a b...
Here's the jist of the problem: Given a list of sets, such as: [ (1,2,3), (5,2,6), (7,8,9), (6,12,13), (21,8,34), (19,20) ] Return a list of groups of the sets, such that sets that have a shared element are in the same group. [ [ (1,2,3), (5,2,6), (6,12,13) ], [ (7,8,9), (21,8,34) ], [ (19,20) ] ] Note the stickeynes...
To solve the problem of grouping sets based on shared elements, you can model this as a graph problem where sets are nodes and shared elements define edges between those nodes. Below is a step-by-step approach using SQL and Python for clarity, along with a possible strategy for large datasets. ### Step 1: Create the G...
18,286
[ { "from": "human", "value": "Here's the jist of the problem: Given a list of sets, such as:\n[ (1,2,3), (5,2,6), (7,8,9), (6,12,13), (21,8,34), (19,20) ]\n\nReturn a list of groups of the sets, such that sets that have a shared element are in the same group.\n[ [ (1,2,3), (5,2,6), (6,12,13) ], [ (7,8,9), (2...
I use ListBox to show Images. However I found if the Listbox contain more than 1000 Image Items, It is really slow if I want to zoom the thumbnails. I asked the qestion in In a WPF ListBox with more than 1000 Image Items the Zoom Images become slow And tried lots of method, however I can't solve the problem by simply c...
To implement a "fake" ListBox that efficiently manages a large number of images in WPF, you can create a virtualized control that loads only the items currently visible in the viewport, along with a few extra items above and below for smoother scrolling. This approach is commonly referred to as "virtualization." ### H...
18,701
[ { "from": "human", "value": "I use ListBox to show Images.\nHowever I found if the Listbox contain more than 1000 Image Items, It is really slow if I want to zoom the thumbnails.\nI asked the qestion in\nIn a WPF ListBox with more than 1000 Image Items the Zoom Images become slow\nAnd tried lots of method, ...
I'm planning on doing my next project in c# rather than c++ (using SlimDX). All of directX uses floats, however System.Math uses doubles. This means constantly converting between floats and doubles. So ideally I'd like to write all the code using floats, since I'm not getting any added precision converting to floats fr...
If you're working with floats in C# for a project involving SlimDX and DirectX, and you want to avoid the constant conversion between floats and doubles, there are a few options you might consider: 1. **Vector and Matrix Classes from SlimDX**: SlimDX itself provides various types for working with 2D and 3D vectors and...
21,345
[ { "from": "human", "value": "I'm planning on doing my next project in c# rather than c++ (using SlimDX).\nAll of directX uses floats, however System.Math uses doubles. This means constantly converting between floats and doubles.\nSo ideally I'd like to write all the code using floats, since I'm not getting ...
I'm doing some research into using log4net, and I found the IObjectRenderer interface interesting. It would allow us to control how types are logged and provide a different, possibly more user-friendly ToString() implementation. I just started looking at log4net though, and can't seem to find a logical way to program...
In log4net, the `IObjectRenderer` interface allows you to customize the way specific types are rendered when logging. This is useful if you want to provide a more user-friendly string representation for certain object types. To associate types with their corresponding object renderers programmatically, you can use the...
20,893
[ { "from": "human", "value": "I'm doing some research into using log4net, and I found the IObjectRenderer interface interesting. It would allow us to control how types are logged and provide a different, possibly more user-friendly ToString() implementation. I just started looking at log4net though, and ca...
In order to verify the data coming from the Google Safe Browsing API, you can calculate a Message Authentication Code (MAC) for each update. The instructions to do this (from Google) are: The MAC is computed from an MD5 Digest over the following information: client_key|separator|table data|separator|client_key....
It looks like there are a couple of issues in your approach that might be causing the mismatch in the computed MAC. Here's the correct way to compute the MAC according to the specifications provided by Google. 1. Ensure you are correctly concatenating the strings with the separator. 2. Make sure you are correctly hand...
20,914
[ { "from": "human", "value": "In order to verify the data coming from the Google Safe Browsing API, you can calculate a Message Authentication Code (MAC) for each update. The instructions to do this (from Google) are:\n\nThe MAC is computed from an MD5 Digest\n over the following information:\n client_key...
When I use this code to output some XML I parsed (and modified) with XmlParser XmlParser parser = new XmlParser() def root = parser.parseText(feedUrl.toURL().text) def writer = new StringWriter() new XmlNodePrinter(new PrintWriter(writer)).print(root) println writer.toString() the namespace declarations on the root no...
When using `XmlNodePrinter` to print an XML structure, it's common to run into issues where certain aspects of the XML, such as namespace declarations, are not printed as expected. This is often due to the default behavior of `XmlNodePrinter`, which might not handle namespaces as one might hope. To ensure that namespa...
23,866
[ { "from": "human", "value": "When I use this code to output some XML I parsed (and modified) with XmlParser\nXmlParser parser = new XmlParser()\ndef root = parser.parseText(feedUrl.toURL().text)\ndef writer = new StringWriter()\nnew XmlNodePrinter(new PrintWriter(writer)).print(root)\nprintln writer.toStrin...
I have a filter in a combobox with a number of entries. Instead of filtering the datagrid with an exact match, I would like to take the selected value and only display records where the selected value is contained in the datafield. For example: the user selects a value of "New" and the datagrid displays records where t...
To achieve the filtering functionality you're looking for—displaying records in a DataGrid based on whether the selected value from a ComboBox is contained within a specific data field—you can use a method that does not require regular expressions unless you have a specific reason to use them. Instead, you can use the...
19,130
[ { "from": "human", "value": "I have a filter in a combobox with a number of entries. Instead of filtering the datagrid with an exact match, I would like to take the selected value and only display records where the selected value is contained in the datafield.\nFor example: the user selects a value of \"New...
This seems like it should be simple but after a couple hours of googling I have not figured it out. I know I can add iCal links using ICS files, but this does not work on the iPhone. BTW, when I say iPhone I would like it to work on the touch also. Anyone have any luck with this?
It sounds like you're trying to import iCalendar (ICS) files into an iPhone or iPod Touch. Here are several methods to help you achieve this: ### Method 1: Email the ICS File 1. **Create the ICS File**: If you haven’t already created the ICS file, you can do so using a calendar application (like Google Calendar, Outl...
20,921
[ { "from": "human", "value": "This seems like it should be simple but after a couple hours of googling I have not figured it out. I know I can add iCal links using ICS files, but this does not work on the iPhone.\nBTW, when I say iPhone I would like it to work on the touch also. Anyone have any luck with t...
What are the easiest steps to make a small circuit with an LED flash from a C/C++ program? I would prefer the least number of dependencies and packages needed. What port would I connect something into? Which compiler would I use? How do I send data to that port? Do I need to have a micro-processor? If not I don't wan...
Creating a simple LED flash circuit controlled by a C/C++ program typically involves using a microcontroller (like an Arduino), or interfacing with GPIO pins on a Raspberry Pi or a similar SBC (Single Board Computer). Since you've mentioned you want to avoid using a microprocessor and are looking for OS-specific soluti...
21,612
[ { "from": "human", "value": "What are the easiest steps to make a small circuit with an LED flash from a C/C++ program?\nI would prefer the least number of dependencies and packages needed. \n\nWhat port would I connect something into?\nWhich compiler would I use?\nHow do I send data to that port?\nDo I nee...
Let's say that I create a Sub (not a function) whose mission in life is to take the active cell (i.e. Selection) and set an adjacent cell to some value. This works fine. When you try to convert that Sub to a Function and try to evaluate it from from spreadsheet (i.e. setting it's formula to "=MyFunction()") Excel wil...
In Excel, user-defined functions (UDFs) are designed to return values based on their inputs without modifying any cells outside of their own context. This is a core design principle of Excel to ensure that functions are predictable and don’t produce side effects, which is why you're encountering the #VALUE! error when ...
23,890
[ { "from": "human", "value": "Let's say that I create a Sub (not a function) whose mission in life is to take the active cell (i.e. Selection) and set an adjacent cell to some value. This works fine.\nWhen you try to convert that Sub to a Function and try to evaluate it from from spreadsheet (i.e. setting i...
I am interested in writing static code analyzer for vb.net to see if it conforms to my company standard coding guidelines. Please advise from where i have to start.
Creating a static code analyzer for VB.NET is a comprehensive task, but it's a great way to ensure code quality and adherence to your company's coding standards. Below are some steps to guide you through the process: ### 1. Define Your Coding Standards Before you start writing the analyzer, clearly define your coding ...
13,661
[ { "from": "human", "value": "I am interested in writing static code analyzer for vb.net to see if it conforms to my company standard coding guidelines. Please advise from where i have to start.\n" }, { "from": "gpt", "value": "Creating a static code analyzer for VB.NET is a comprehensive task, b...
I want to create a function like a for loop where I will ideally enter a variable for the times the iteration should happen and some functions inside brackets my function will execute. I hope I was clear enough. Example superFor (1) { // Commands to be executed here add(1 + 2); }
It sounds like you're looking to create a custom loop function in a programming language that allows you to specify the number of iterations and execute a block of commands within that loop. In many programming languages, such as JavaScript or Python, you can achieve this using functions and callback concepts. Here's ...
20,526
[ { "from": "human", "value": "I want to create a function like a for loop where I will ideally enter a variable for the times the iteration should happen and some functions inside brackets my function will execute. I hope I was clear enough.\nExample\nsuperFor (1)\n{\n // Commands to be executed here \n ...
I've read ASP.NET Routing… Goodbye URL rewriting? and Using Routing With WebForms which are great articles, but limited to simple, illustrative, "hello world"-complexity examples. Is anyone out there using ASP.NET routing with web forms in a non-trivial way? Any gotchas to be aware of? Performance issues? Further recom...
ASP.NET Routing is a powerful feature that can greatly enhance the usability and SEO of your Web Forms applications. While the examples often provided in tutorials are simplistic, there are definitely ways to implement routing in more complex scenarios. Below are some considerations, tips, and potential challenges you ...
19,885
[ { "from": "human", "value": "I've read ASP.NET Routing… Goodbye URL rewriting? and Using Routing With WebForms which are great articles, but limited to simple, illustrative, \"hello world\"-complexity examples.\nIs anyone out there using ASP.NET routing with web forms in a non-trivial way? Any gotchas to be...
I want to be able to specify the file name stem for the log file in a Specman test. I need to hard-code the main *.elog filename so that I don't get variance between tests and confuse the post-processing scripts. Is there a constraint or command line I can pass into Specman?
In Specman, you can specify the log file name using a combination of command-line options and configuration settings within your testbench. To set a specific filename for the log file, you can use the following command-line option when invoking your Specman simulation: ``` -elog_file <filename>.elog ``` Replace `<fi...
23,685
[ { "from": "human", "value": "I want to be able to specify the file name stem for the log file in a Specman test. I need to hard-code the main *.elog filename so that I don't get variance between tests and confuse the post-processing scripts. Is there a constraint or command line I can pass into Specman?\n...
How do I add the Swedish interactive user, NT INSTANS\INTERAKTIV or the English interactive user, NT AUTHORITY\INTERACTIVE or any other localised user group with write permissions to a program folder's ACL? Is this question actually "How do I use secureObject"? I cannot use the LockPermissions Table because I...
To add the Swedish interactive user (`NT INSTANS\INTERAKTIV`) or the English interactive user (`NT AUTHORITY\INTERACTIVE`) or any other localized user group with write permissions to a program folder's Access Control List (ACL), you would typically use the `System.Security.AccessControl` namespace in C#. Below are the ...
19,526
[ { "from": "human", "value": "How do I add the Swedish interactive user, \nNT INSTANS\\INTERAKTIV \n\nor the English interactive user, \nNT AUTHORITY\\INTERACTIVE \n\nor any other localised user group with write permissions to a program folder's ACL?\nIs this question actually \"How do I use secureObject...
I am using C#. By default, when I add a web form in Visual Studio 2008 with or without a master page, the AutoEventWireup attribute is set to true in the page directive. This attribute is also set to true inside the master page master directive. What value should I have AutoEventWireup set to (true/false)? What are th...
The `AutoEventWireup` attribute in ASP.NET specifies whether the event handler for page events (like `Page_Load`, `Page_Init`, etc.) should be automatically wired up. When set to `true`, ASP.NET automatically connects event handler methods to their corresponding events based on naming conventions. When set to `false`, ...
23,973
[ { "from": "human", "value": "I am using C#. By default, when I add a web form in Visual Studio 2008 with or without a master page, the AutoEventWireup attribute is set to true in the page directive. This attribute is also set to true inside the master page master directive.\nWhat value should I have AutoEv...
This is a simple one. I want to replace a sub-string with another sub-string on client-side using Javascript. Original string is 'original READ ONLY' I want to replace the 'READ ONLY' with 'READ WRITE' Any quick answer please? Possibly with a javascript code snippet...
Certainly! You can replace a substring in a string using the `replace` method in JavaScript. Here’s a quick code snippet that demonstrates how to replace "READ ONLY" with "READ WRITE": ```javascript let originalString = 'original READ ONLY'; let newString = originalString.replace('READ ONLY', 'READ WRITE'); console.l...
26,838
[ { "from": "human", "value": "This is a simple one. I want to replace a sub-string with another sub-string on client-side using Javascript.\nOriginal string is 'original READ ONLY'\nI want to replace the 'READ ONLY' with 'READ WRITE'\nAny quick answer please? Possibly with a javascript code snippet...\n" }...
I've created a program in Delphi that uses Google's AJAX Search API to evaluate search phrase occurrences on specific sites, mine included. What surprised me was it doesn't appear Google is indexing some words on my pages, or I am forming my search queries via the API incorrectly. For example the search site:www.del...
It sounds like you are encountering some differences in how Google returns search results based on the queries you are constructing and the way the AJAX Search API handles those queries. ### Understanding Google Search Operators 1. **Site Operator**: The `site:` operator restricts the search results to a specific dom...
20,924
[ { "from": "human", "value": "I've created a program in Delphi that uses Google's AJAX Search API to evaluate search phrase occurrences on specific sites, mine included. What surprised me was it doesn't appear Google is indexing some words on my pages, or I am forming my search queries via the API incorrect...
I'm working on a control to tie together the view from one ListView to another so that when the master ListView is scrolled, the child ListView view is updated to match. So far I've been able to get the child ListViews to update their view when the master scrollbar buttons are clicked. The problem is that when click...
To synchronize the scrolling of multiple `ListView` controls in a Windows Forms application when one of them is scrolled (including when dragging the scrollbar), you can indeed handle the scrollbar notifications correctly. Your approach is largely on track, but there are some aspects to refine to ensure that the view i...
20,090
[ { "from": "human", "value": "I'm working on a control to tie together the view from one ListView to another so that when the master ListView is scrolled, the child ListView view is updated to match. \nSo far I've been able to get the child ListViews to update their view when the master scrollbar buttons ar...
Is there any performance comparison of System.IO.File.ReadAllxxx / WriteAllxxx methods vs StreamReader / StremWriter classes available on web. What you think is the best way(from a performance perspective) to read/write text files in .net 3.0? When I checked the MSDN page of System.IO.File class, in the sample code MS ...
When it comes to reading and writing text files in .NET, there are different approaches that can be taken, and the choice can significantly affect performance, especially for large files. ### Performance Comparison 1. **File.ReadAllText() / File.ReadAllLines() / File.WriteAllText() / File.WriteAllLines()** - These...
19,304
[ { "from": "human", "value": "Is there any performance comparison of System.IO.File.ReadAllxxx / WriteAllxxx methods vs StreamReader / StremWriter classes available on web. What you think is the best way(from a performance perspective) to read/write text files in .net 3.0?\nWhen I checked the MSDN page of Sy...
I'm trying to get tags working in my rails application and want to use acts_as_taggable. Firstly I followed the instructions I found in Rails Recipies (a free sample bit online) that used the acts_as_taggable plugin. However, I then found this site which seems to have a gem for acts_as_taggable which is more advanced (...
It seems like you're experiencing issues with getting the `acts_as_taggable` gem to work in your Rails application. Here are the steps and suggestions to help you troubleshoot and properly set up the gem. ### Step 1: Gem Installation First, make sure that you are installing the correct gem. Instead of using `gem inst...
22,756
[ { "from": "human", "value": "I'm trying to get tags working in my rails application and want to use acts_as_taggable. Firstly I followed the instructions I found in Rails Recipies (a free sample bit online) that used the acts_as_taggable plugin. However, I then found this site which seems to have a gem for ...
Present: The product development is done in Visual Studio at the moment using .Net technologies, so it's important to stay in the same set of tools. Roles apart from developers are using spreadsheets, docs and diagramming tools, photoshop to do their work. Future: We want to build a workflow (a sequential process with ...
Creating a comprehensive workflow for product development using Visual Studio as the central tool can be quite beneficial, particularly when you have a well-defined process that spans multiple roles. Since you've mentioned that Visual Studio Team System (VSTS) is already in use but lacks custom workflows for non-develo...
20,985
[ { "from": "human", "value": "Present:\nThe product development is done in Visual Studio at the moment using .Net technologies, so it's important to stay in the same set of tools. Roles apart from developers are using spreadsheets, docs and diagramming tools, photoshop to do their work.\nFuture:\nWe want to ...
OK, so instead of writing a whole bunch of access control specs, and duplicating them across many of my spec files, I'm looking to create a custom matcher. So instead of this: describe "access control" do it "should prevent access by non-logged-in users" it "should prevent access by normal users" it "should preve...
Creating a custom matcher in RSpec for access control can help streamline your specs and reduce duplication. You can achieve this by defining a matcher that checks the access levels for the given action. Here’s a step-by-step guide on how to implement this. ### Step 1: Create the Custom Matcher You can define a custo...
20,806
[ { "from": "human", "value": "OK, so instead of writing a whole bunch of access control specs, and duplicating them across many of my spec files, I'm looking to create a custom matcher. So instead of this:\ndescribe \"access control\" do\n it \"should prevent access by non-logged-in users\"\n it \"should p...
I have an array NSMutableArray with happy objects. These objects viciously turn on (leak) me whenever I try to clear the array of all the objects and repopulate it. It's allocated in the init function like so self.list = [NSMutableArray array]; The different methods I have used to clear it out include: self.list = nil...
Based on the details you've provided, it sounds like you're encountering a memory leak when trying to clear and repopulate your `NSMutableArray` called `self.list`. The leak may not be directly related to how you're clearing the array itself but could instead be due to how the objects in that array are being managed. H...
21,267
[ { "from": "human", "value": "I have an array NSMutableArray with happy objects. These objects viciously turn on (leak) me whenever I try to clear the array of all the objects and repopulate it.\nIt's allocated in the init function like so\nself.list = [NSMutableArray array];\n\nThe different methods I have ...
Has anyone got to some good code to zoom into an image using javascript? I know I could just resize it etc but was being lazy and looking for something clever to zoom to different levels, move around when zoomed etc
Certainly! You can achieve a zoomable image feature using HTML, CSS, and JavaScript. One popular approach is to utilize the HTML `<canvas>` element or simply manipulate an `<img>` element using CSS transformations. Here's a simple example using CSS for zooming and panning functionality: ### Example: Zooming and Pannin...
18,542
[ { "from": "human", "value": "Has anyone got to some good code to zoom into an image using javascript?\nI know I could just resize it etc but was being lazy and looking for something clever to zoom to different levels, move around when zoomed etc\n" }, { "from": "gpt", "value": "Certainly! You ca...
I'm trying to run some commands in paralel, in background, using bash. Here's what I'm trying to do: forloop { //this part is actually written in perl //call command sequence print `touch .file1.lock; cp bigfile1 /destination; rm .file1.lock;`; } The part between backticks (``) spawns a new shell and executes th...
Yes, you can run a set of commands in the background in Perl using the `system` function combined with `&` to run them in the background. You can achieve this without needing to resort to threads. Here's how you can modify your approach: 1. Use a subshell to execute your commands. 2. Add the `&` at the end to run it i...
24,504
[ { "from": "human", "value": "I'm trying to run some commands in paralel, in background, using bash. Here's what I'm trying to do:\nforloop {\n //this part is actually written in perl\n //call command sequence\n print `touch .file1.lock; cp bigfile1 /destination; rm .file1.lock;`;\n}\n\nThe part between b...
Is there a way to statically/globally request a copy of the ApplicationContext in a Spring application? Assuming the main class starts up and initializes the application context, does it need to pass that down through the call stack to any classes that need it, or is there a way for a class to ask for the previously cr...
Yes, in a Spring application, you can access the `ApplicationContext` statically, although it's generally not recommended to do so as it can lead to tightly coupled code and make your application harder to test. However, if you still want to access the `ApplicationContext` globally, you can do so by holding a static re...
21,851
[ { "from": "human", "value": "Is there a way to statically/globally request a copy of the ApplicationContext in a Spring application?\nAssuming the main class starts up and initializes the application context, does it need to pass that down through the call stack to any classes that need it, or is there a wa...
Is there any library function for this purpose, so I don't do it by hand and risk ending in TDWTF? echo ceil(31497230840470473074370324734723042.6); // Expected result 31497230840470473074370324734723043 // Prints <garbage>
In PHP, when dealing with very large numbers like the one you provided, the `ceil()` function will not work as expected because the number exceeds PHP's maximum integer size and is treated as a floating-point number, which can lead to precision issues. Instead of using floating-point numbers, you can use the `BCMath` ...
25,013
[ { "from": "human", "value": "Is there any library function for this purpose, so I don't do it by hand and risk ending in TDWTF?\necho ceil(31497230840470473074370324734723042.6);\n\n// Expected result\n31497230840470473074370324734723043\n\n// Prints\n<garbage>\n\n" }, { "from": "gpt", "value": ...
Especially when considering a fresh Rails project, what does your version control and deployment workflow look like? What tools do you use? I'm interested in answers for Mac, *nix and Windows work machines. Assume a *nix server. I'll edit for clarity if need be.
When setting up version control and deployment workflows for a fresh Rails project, it is essential to have a well-defined process that can work across different operating systems such as macOS, Linux (*nix), and Windows for development, while deploying to a *nix server. Here’s a general overview of the workflow, tools...
19,493
[ { "from": "human", "value": "Especially when considering a fresh Rails project, what does your version control and deployment workflow look like? What tools do you use?\nI'm interested in answers for Mac, *nix and Windows work machines. Assume a *nix server.\nI'll edit for clarity if need be.\n" }, { ...
I have a web application using JPA and JTA with Spring. I would like to support both JBoss and Tomcat. When running on JBoss, I'd like to use JBoss' own TransactionManager, and when running on Tomcat, I'd like to use JOTM. I have both scenarios working, but I now find that I seem to need two separate Spring configurati...
To achieve the desired functionality of using a single Spring configuration for both JBoss and Tomcat, you can utilize Spring profiles or conditional beans to manage the configuration based on the environment. **Using Spring Profiles:** 1. **Define Profiles**: You can define different profiles for JBoss and Tomcat. ...
20,709
[ { "from": "human", "value": "I have a web application using JPA and JTA with Spring. I would like to support both JBoss and Tomcat. When running on JBoss, I'd like to use JBoss' own TransactionManager, and when running on Tomcat, I'd like to use JOTM.\nI have both scenarios working, but I now find that I se...
Is there a Entity Attribute Value framework out there for PHP/MySQL? I'm starting to write my own, but I feel like its been done already. Any suggestions?
Yes, the Entity-Attribute-Value (EAV) model is a common design pattern that has been implemented in various PHP/MySQL frameworks and libraries. Here are a few options you might consider: 1. **Laravel EAV Packages**: - **Laravel EAV**: This is a package that can be integrated into your Laravel application to manage ...
24,707
[ { "from": "human", "value": "Is there a Entity Attribute Value framework out there for PHP/MySQL? I'm starting to write my own, but I feel like its been done already. Any suggestions?\n" }, { "from": "gpt", "value": "Yes, the Entity-Attribute-Value (EAV) model is a common design pattern that h...
Using assorted matrix math, I've solved a system of equations resulting in coefficients for a polynomial of degree 'n' Ax^(n-1) + Bx^(n-2) + ... + Z I then evaulate the polynomial over a given x range, essentially I'm rendering the polynomial curve. Now here's the catch. I've done this work in one coordinate system we...
Given that your coordinate systems are linearly related, this simplifies the process significantly. Let's denote the transformation from the original coordinate system (data space) to the new coordinate system as: \[ \begin{pmatrix} x' \\ y' \end{pmatrix} = \begin{pmatrix} a & 0 \\ 0 & b \end{pmatrix} \begin{pmatrix} ...
18,661
[ { "from": "human", "value": "Using assorted matrix math, I've solved a system of equations resulting in coefficients for a polynomial of degree 'n'\nAx^(n-1) + Bx^(n-2) + ... + Z\n\nI then evaulate the polynomial over a given x range, essentially I'm rendering the polynomial curve. Now here's the catch. I'v...
What is the functional programming approach to convert an IEnumerable<string> to a delimited string? I know I can use a loop, but I'm trying to wrap my head around functional programming. Here's my example: var selectedValues = from ListItem item in checkboxList.Items where item.Selected select item.Valu...
In functional programming, you often use methods that operate on collections, such as `Select`, `Where`, `Aggregate`, and `String.Join` in C#. To convert an `IEnumerable<string>` to a delimited string, you can use `String.Join`, which is a straightforward and efficient way to concatenate the elements of a collection wi...
24,679
[ { "from": "human", "value": "What is the functional programming approach to convert an IEnumerable<string> to a delimited string? I know I can use a loop, but I'm trying to wrap my head around functional programming. \nHere's my example: \nvar selectedValues =\nfrom ListItem item in checkboxLis...
I might be an exception here but I have never worked on a team with more than three developers and / or five people. Still we could manage to get the job done (somehow). Is there a software development process which fits this "extreme" scenario? And, if you work as a standalone programmer is there something you can ada...
Absolutely! There are several software development methodologies and practices that are particularly well-suited for small teams or even for individual developers. Here are a few approaches that can help make your development process more predictable, coherent, and well-documented: ### 1. **Agile/Scrum with Adjustment...
19,179
[ { "from": "human", "value": "I might be an exception here but I have never worked on a team with more than three developers and / or five people. Still we could manage to get the job done (somehow).\nIs there a software development process which fits this \"extreme\" scenario? And, if you work as a standalo...
So I'm teaching myself Python, and I'm having an issue with lists. I want to pass my function a list and pop items off it while retaining the original list. How do I make python "instance" the passed list rather that passing a pointer to the original one? Example: def burninate(b): c = [] for i in range(3): ...
To achieve your desired output while retaining the original list, you can create a copy of the list that you pass to your function instead of directly modifying the original. In Python, you can create a shallow copy of a list using various methods such as slicing, using the `list()` constructor, or the `copy` method. ...
25,511
[ { "from": "human", "value": "So I'm teaching myself Python, and I'm having an issue with lists. I want to pass my function a list and pop items off it while retaining the original list. How do I make python \"instance\" the passed list rather that passing a pointer to the original one?\nExample:\ndef burnin...
We are creating an XBAP application that we need to have rounded corners in various locations in a single page and we would like to have a WPF Rounded Corner container to place a bunch of other elements within. Does anyone have some suggestions or sample code on how we can best accomplish this? Either with styles on...
To create a rounded corner container in an XBAP (XAML Browser Application), you can achieve this by creating a custom control or by using styles with a `Border` element in WPF. Below, I'll provide a sample code snippet for both methods. ### Method 1: Using a Border with Corner Radius You can use a `Border` control w...
16,576
[ { "from": "human", "value": "We are creating an XBAP application that we need to have rounded corners in various locations in a single page and we would like to have a WPF Rounded Corner container to place a bunch of other elements within. Does anyone have some suggestions or sample code on how we can best...
When I do an "os.execute" in Lua, a console quickly pops up, executes the command, then closes down. But is there some way of getting back the console output only using the standard Lua libraries?
In Lua, the standard `os.execute` function does not capture the output of a command; it only executes it. If you want to capture the output of a command while still using standard libraries, you can use `io.popen`. This function opens a process and allows you to read its output. Here's an example of how you can use `i...
22,342
[ { "from": "human", "value": "When I do an \"os.execute\" in Lua, a console quickly pops up, executes the command, then closes down. But is there some way of getting back the console output only using the standard Lua libraries?\n" }, { "from": "gpt", "value": "In Lua, the standard `os.execute` f...
Okay, we know that the following two lines are equivalent - (0 == i) (i == 0) Also, the first method was encouraged in the past because that would have allowed the compiler to give an error message if you accidentally used '=' instead of '=='. My question is - in today's generation of pretty slick IDE's and intellig...
Your question highlights an important discussion about coding practices and the evolution of programming tools and environments. Let's break it down. ### Historical Context The practice of writing comparisons in the form `if (0 == i)` instead of `if (i == 0)` was indeed promoted to prevent bugs caused by accidental as...
16,120
[ { "from": "human", "value": "Okay, we know that the following two lines are equivalent - \n\n(0 == i)\n(i == 0)\n\nAlso, the first method was encouraged in the past because that would have allowed the compiler to give an error message if you accidentally used '=' instead of '=='.\nMy question is - in today'...
In deploying to a new (Solaris 9) environment recently, one of the steps was to copy a set of files and directories to their new location and then to apply the group UID bit (using "chmod -R g+s") to all files in the directory tree giving a mode of -rwxr-s--- to everything. The result was that none of our shell scripts...
The "s" bit, also known as the "setuid" (user ID) or "setgid" (group ID) bit, behaves differently depending on whether it is applied to files or directories. Here’s a breakdown of its effects in both contexts: ### 1. **Setuid and Setgid on Files:** - **Setuid (s)**: When the setuid bit is set on an executable file, t...
17,946
[ { "from": "human", "value": "In deploying to a new (Solaris 9) environment recently, one of the steps was to copy a set of files and directories to their new location and then to apply the group UID bit (using \"chmod -R g+s\") to all files in the directory tree giving a mode of -rwxr-s--- to everything. Th...
I've noticed that sometimes wrapper scripts will use ${1:+"$@"} for the parameters rather than just "$@". For example, http://svn.macosforge.org/repository/macports/trunk/dports/editors/vim-app/files/gvim.sh uses exec "$binary" $opts ${1:+"$@"} Can anyone break ${1:+"$@"} down into English and explain why it would be ...
The syntax `${1:+"$@"}` is a way to conditionally expand a set of parameters in shell scripting, and it has a specific behavior that differs from simply using `"$@"`. Let's break down `${1:+"$@"}`: 1. **`${1}`**: This represents the first positional parameter passed to the script. If there is at least one argument pr...
22,178
[ { "from": "human", "value": "I've noticed that sometimes wrapper scripts will use ${1:+\"$@\"} for the parameters rather than just \"$@\".\nFor example, http://svn.macosforge.org/repository/macports/trunk/dports/editors/vim-app/files/gvim.sh uses\nexec \"$binary\" $opts ${1:+\"$@\"}\n\nCan anyone break ${1:...
Is there any function that converts an escaped Url string to its unescaped form? System.Web.HttpUtility.UrlDecode() can do that job but I don't want to add a reference to System.Web.dll. Since my app is not a web application, I don't want to add a dependency for only using a function in an assembly. UPDATE: Check Rick ...
If you want to decode an escaped URL string without using `System.Web.HttpUtility`, you can use the `Uri` class in .NET, which provides a method to achieve this without needing to add a reference to `System.Web.dll`. The `Uri` class has a method called `UnescapeDataString` that you can use to decode URL-encoded strings...
26,403
[ { "from": "human", "value": "Is there any function that converts an escaped Url string to its unescaped form? System.Web.HttpUtility.UrlDecode() can do that job but I don't want to add a reference to System.Web.dll. Since my app is not a web application, I don't want to add a dependency for only using a fun...
In the latest MVC preview, I'm using this route for a legacy URL: routes.MapRoute( "Legacy-Firefox", // Route name "Firefox-Extension/", // URL with parameters new { controller = "Home", action = "Firefox", id = "" } // Parameter defaults ); The problem is that both of these URL's work: http://example.com/Firefox-Exte...
To ensure that your routing only responds to URLs with a trailing slash and to have your generated links include the trailing slash as well, you can take the following steps: 1. **Modify the Route Configuration**: Adjust your route to only match the URL with a trailing slash by specifying the trailing slash in the URL...
20,622
[ { "from": "human", "value": "In the latest MVC preview, I'm using this route for a legacy URL:\nroutes.MapRoute(\n\"Legacy-Firefox\", // Route name\n\"Firefox-Extension/\", // URL with parameters\nnew { controller = \"Home\", action = \"Firefox\", id = \"\" } // Parameter defaults\n);\n\nThe problem is that...
On occasion, my local Rails app loses its connection to MySQL. I get some error that the connection failed, but if I just refresh the page, it works fine. This has never happpened in my STAGE or PROD environments (I deploy to Ubuntu), so it has not been that big a deal. Does this happen to anybody else? Is there somet...
Experiencing intermittent connection issues between your Rails application and MySQL, especially in a local development environment, is not uncommon. These connection failures can be caused by various factors, and it's important to consider both your Rails setup and the MySQL configuration. Here are some potential caus...
19,708
[ { "from": "human", "value": "On occasion, my local Rails app loses its connection to MySQL. I get some error that the connection failed, but if I just refresh the page, it works fine. This has never happpened in my STAGE or PROD environments (I deploy to Ubuntu), so it has not been that big a deal.\nDoes th...
Are there any methods/systems that you have in place to incentivize your development team members to write "good" code and add comments to their code? I recognize that "good" is a subjective term and it relates to an earlier question about measuring the maintainability of code as one measurement of good code.
Incentivizing development team members to write "good" code and add comments can be achieved through a combination of organizational practices, cultural shifts, and specific techniques. Here are some methods and systems that can help promote this behavior: ### 1. **Code Reviews** - **Peer Review Process:** Establis...
18,615
[ { "from": "human", "value": "Are there any methods/systems that you have in place to incentivize your development team members to write \"good\" code and add comments to their code? I recognize that \"good\" is a subjective term and it relates to an earlier question about measuring the maintainability of co...
I would like to be able to know, in run-time in my code, how much memory a certain object is taking (a Dataset in this case, but i'm looking for a "general" solution). Is this possible through reflection? This is for .Net 2.0. Thanks!
In .NET, particularly in versions like 2.0, there isn't a direct built-in way to get the size of an object in memory using reflection. However, you can estimate the size of an object by using a few approaches: ### Using `GC.GetTotalMemory` One way to get an estimate of the memory consumed by an object is to use the `...
23,598
[ { "from": "human", "value": "I would like to be able to know, in run-time in my code, how much memory a certain object is taking (a Dataset in this case, but i'm looking for a \"general\" solution).\nIs this possible through reflection?\nThis is for .Net 2.0.\nThanks!\n" }, { "from": "gpt", "val...
How can I limit my post-build events to running only for one type of build? I'm using the events to copy DLL files to a local IIS virtual directory, but I don't want this happening on the build server in release mode.
You can control when your post-build events run by using preprocessor directives in your project file or by using environment variables to conditionally execute the commands. Here are a couple of methods to achieve this: ### Method 1: Using Preprocessor Directives 1. **Edit Your Project File**: Open your `.csproj` or ...
23,361
[ { "from": "human", "value": "How can I limit my post-build events to running only for one type of build?\nI'm using the events to copy DLL files to a local IIS virtual directory, but I don't want this happening on the build server in release mode.\n" }, { "from": "gpt", "value": "You can control...
I have a large collection of raw data (around 300million rows) with about 10% replicated data. I need to get the data into a database. For the sake of performance I'm trying to use SQL copy. The problem being when I commit the data, primary key exceptions prevent any of the data from being processed. Can I change the b...
When working with large datasets and trying to load them into a database with primary key constraints, you have a couple of options to handle duplicate data: ### 1. Use `ON CONFLICT` or `INSERT IGNORE` If you're using PostgreSQL, you can leverage the `ON CONFLICT` clause to handle duplicate primary keys. You can use ...
21,822
[ { "from": "human", "value": "I have a large collection of raw data (around 300million rows) with about 10% replicated data. I need to get the data into a database. For the sake of performance I'm trying to use SQL copy. The problem being when I commit the data, primary key exceptions prevent any of the data...
I want to hold onto packets that fail the crc check. To do this I have commented out a section of the CC2420RecieveP readDone function that checks the msb bit of the LQI byte in the received buffer. I think this is working, However, once I receive the packet in my own receive function I send it through the serial compo...
Hi Mike, It sounds like you're working with a specific implementation of a packet receiving system using the CC2420 radio. If you're trying to retain packets that fail CRC checks and then send them through a serial interface, it's important to ensure that the whole packet, including the CRC value, is properly copied a...
22,392
[ { "from": "human", "value": "I want to hold onto packets that fail the crc check. To do this I have commented out a section of the CC2420RecieveP readDone function that checks the msb bit of the LQI byte in the received buffer.\nI think this is working,\nHowever, once I receive the packet in my own receive ...
I am referring to a truly visual environment, and not something that claims to be visual but requires mountains of hand-coded script, or a code generator that farts out a Web site and leaves you to start editing in Visual Studio. Are there any truly visual Web dev platforms out there?
Yes, there are several truly visual web development platforms designed to allow users to create websites and web applications without requiring extensive hand coding or heavy reliance on code generators. Here are some popular options: 1. **Webflow**: Webflow combines a visual design interface with powerful CMS capabil...
21,067
[ { "from": "human", "value": "I am referring to a truly visual environment, and not something that claims to be visual but requires mountains of hand-coded script, or a code generator that farts out a Web site and leaves you to start editing in Visual Studio. Are there any truly visual Web dev platforms out...
I have a scenario in a system which I've tried to simplify as best as I can. We have a table of (lets call them) artefacts, artefacts can be accessed by any number of security roles and security roles can access any number of artefacts. As such, we have 3 tables in the database - one describing artefacts, one describin...
In NHibernate, managing the relationships between entities, especially in many-to-many associations, can be tricky when it comes to maintaining data integrity during deletions. In your case, the goal is to automatically clear the associations in the join table when a role is deleted. Since NHibernate does not automatic...
20,873
[ { "from": "human", "value": "I have a scenario in a system which I've tried to simplify as best as I can. We have a table of (lets call them) artefacts, artefacts can be accessed by any number of security roles and security roles can access any number of artefacts. As such, we have 3 tables in the database ...
OK, so I'm trying to teach myself the CakePHP framework, and I'm trying to knock up a simple demo app for myself. I have the controllers, views and models all set up and working, but I want to do something slightly more than the basic online help shows. I have a guitars_controller.php file as follows... <?php class Gui...
In CakePHP, you can set the page title dynamically based on the data you retrieve in your controller methods. In your `view` method, you can access the guitar object after retrieving it from the model and set the `pageTitle` property accordingly. Here's how you can modify your `view` method in the `GuitarsController` ...
23,256
[ { "from": "human", "value": "OK, so I'm trying to teach myself the CakePHP framework, and I'm trying to knock up a simple demo app for myself.\nI have the controllers, views and models all set up and working, but I want to do something slightly more than the basic online help shows.\nI have a guitars_contro...
I am writing a site that uses strongly typed datasets. The DBA who created the table made gave a column a value that represents a negative. The column is 'Do_Not_Estimate_Flag' where the column can contain 'T' or 'F'. I can't change the underlying table or the logic that fills it. What I want to do is to add a 'ESTIMA...
To achieve the desired outcome where the `ESTIMATION_ALLOWED` property is utilized when binding data in your ASP.NET web page, you'll need to ensure that the data binding is referencing the property correctly rather than the underlying DataRow. In your current implementation, `DataBinder.Eval(Container.DataItem, "EST...
21,457
[ { "from": "human", "value": "I am writing a site that uses strongly typed datasets. \nThe DBA who created the table made gave a column a value that represents a negative. The column is 'Do_Not_Estimate_Flag' where the column can contain 'T' or 'F'. I can't change the underlying table or the logic that fills...
I hate Physics, but I love software development. When I go back to school after Thanksgiving, I'll be taking two more quarters of Physics before I'm done with the horrid thing. I am currently reading postings on the F# units of measurement feature, but I've never used a language like F#. Would it be suitable to write a...
It's great that you're looking for ways to combine your interests in software development and physics, even if physics isn't your favorite subject. F# can indeed be a suitable choice for creating command-line applications to help you learn physics concepts, especially with its strong support for units of measure. This ...
17,021
[ { "from": "human", "value": "I hate Physics, but I love software development. When I go back to school after Thanksgiving, I'll be taking two more quarters of Physics before I'm done with the horrid thing. I am currently reading postings on the F# units of measurement feature, but I've never used a language...
How do I print debug messages in the Google Chrome JavaScript Console? Please note that the JavaScript Console is not the same as the JavaScript Debugger; they have different syntaxes AFAIK, so the print command in JavaScript Debugger will not work here. In the JavaScript Console, print() will send the parameter to the...
In the Google Chrome JavaScript Console, you can print debug messages using the following methods: 1. **Using `console.log()`**: This is the most common way to print messages to the console. You can use `console.log()` to output strings, variables, objects, and more. ```javascript console.log("This is a debu...
24,039
[ { "from": "human", "value": "How do I print debug messages in the Google Chrome JavaScript Console?\nPlease note that the JavaScript Console is not the same as the JavaScript Debugger; they have different syntaxes AFAIK, so the print command in JavaScript Debugger will not work here. In the JavaScript Conso...
I'm an expert C# 3 / .NET 3.5 programmer looking to start doing some runtime codegen using System.Reflection.Emit.DynamicMethod. I'd love to move up to the next level by becoming intimately familiar with IL. Any pointers (pun intended)?
That's great to hear that you want to dive into runtime code generation and Intermediate Language (IL)! Working with `System.Reflection.Emit` and IL can be quite powerful and open up a lot of possibilities in your programming. Here are some pointers to help you get started and deepen your understanding: ### Understand...
21,111
[ { "from": "human", "value": "I'm an expert C# 3 / .NET 3.5 programmer looking to start doing some runtime codegen using System.Reflection.Emit.DynamicMethod. I'd love to move up to the next level by becoming intimately familiar with IL.\nAny pointers (pun intended)?\n" }, { "from": "gpt", "va...
I want to add the link tags to redirect my web-site to my OpenID provider. These tags should go in the head element. What's the best way to add them in Plone? I understand that filling the head_slot is a way to do it, but that can only happen when you are adding a template to the page and that template is being rendere...
In Plone, if you're looking to add link tags to the `<head>` element without modifying `main_template.pt`, you can achieve this using a couple of approaches that are more modular and maintainable. Here are some recommended methods: ### 1. Use a Custom Product You can create a custom product or add-on and utilize an `o...
11,270
[ { "from": "human", "value": "I want to add the link tags to redirect my web-site to my OpenID provider. These tags should go in the head element. What's the best way to add them in Plone?\nI understand that filling the head_slot is a way to do it, but that can only happen when you are adding a template to t...
I'm using the mechanize module to execute some web queries from Python. I want my program to be error-resilient and handle all kinds of errors (wrong URLs, 403/404 responsese) gracefully. However, I can't find in mechanize's documentation the errors / exceptions it throws for various errors. I just call it with: se...
When using the `mechanize` module in Python, it is important to handle different types of exceptions that may arise when trying to open URLs or interact with the web. While `mechanize` does not document all possible exceptions explicitly, you can infer the possible exceptions from the underlying libraries it uses (like...
19,874
[ { "from": "human", "value": "I'm using the mechanize module to execute some web queries from Python. I want my program to be error-resilient and handle all kinds of errors (wrong URLs, 403/404 responsese) gracefully. However, I can't find in mechanize's documentation the errors / exceptions it throws for va...
I need to create an access (mdb) database without using the ADOX interop assembly. How can this be done?
Creating an Access (MDB) database programmatically without using the ADOX interop assembly can be accomplished using the Microsoft Office Access Database Engine (ACE). You can use OLE DB connections to perform the tasks. Below is a basic example using C# to create an Access database (.mdb) file without ADOX. It uses t...
21,673
[ { "from": "human", "value": "I need to create an access (mdb) database without using the ADOX interop assembly. \nHow can this be done?\n" }, { "from": "gpt", "value": "Creating an Access (MDB) database programmatically without using the ADOX interop assembly can be accomplished using the Micros...
I want a Java IDE with a compiler for Linux and that does not require a a big amount of RAM. I have 256 MB of ram, so my options are limited
With only 256 MB of RAM, your options for a Java IDE will be quite limited since most modern IDEs are resource-intensive. However, you can still work with a lightweight setup that allows you to compile and run Java code. Here are some options you can consider: ### 1. **JEdit** - **Description:** JEdit is a programmer'...
24,042
[ { "from": "human", "value": "I want a Java IDE with a compiler for Linux and that does not require a a big amount of RAM.\nI have 256 MB of ram, so my options are limited\n" }, { "from": "gpt", "value": "With only 256 MB of RAM, your options for a Java IDE will be quite limited since most modern...
I have a table called logs which has a datetime field. I want to select the date and count of rows based on a particular date format. How do I do this using SQLAlchemy?
To count rows based on a date from a `datetime` field in SQLAlchemy, you can use the `func` module to extract the date part and then group the results accordingly. Here is an example of how you might achieve this, assuming you have a `logs` table defined in your SQLAlchemy ORM model. ### Example SQLAlchemy Model Assum...
21,728
[ { "from": "human", "value": "I have a table called logs which has a datetime field. \nI want to select the date and count of rows based on a particular date format. \nHow do I do this using SQLAlchemy?\n" }, { "from": "gpt", "value": "To count rows based on a date from a `datetime` field in SQLA...
I want to access a UIImage programmatically... i.e. myImage.hidden = TRUE; etc. I can do this fine for UILabel but when I repeat the process for UIImage it doesn't work. Specifically when I drag the blue line in Interface Builder over the icon I don't get a popup menu like I do when using UILabel. Perhaps using UIIma...
You're correct that you should use `UIImageView` instead of `UIImage` for displaying images in your iOS app. The `UIImage` class is a model object that represents image data, while `UIImageView` is a view that can display that image on the screen. To access and manipulate your image in code (e.g., hiding it, changing ...
25,116
[ { "from": "human", "value": "I want to access a UIImage programmatically... i.e. myImage.hidden = TRUE; etc. I can do this fine for UILabel but when I repeat the process for UIImage it doesn't work. Specifically when I drag the blue line in Interface Builder over the icon I don't get a popup menu like I d...
Let's just assume for now that you have narrowed down where the typical bottlenecks in your app are. For all you know, it might be the batch process you run to reindex your tables; it could be the SQL queries that runs over your effective-dated trees; it could be the XML marshalling of a few hundred composite objects. ...
Measuring performance effectively is crucial to understanding whether the changes you implement are having a positive impact on the bottleneck you’ve identified. Here’s a structured approach to measuring the performance of your bottleneck: ### 1. **Baseline Measurement** - Before making any changes, measure the per...
21,894
[ { "from": "human", "value": "Let's just assume for now that you have narrowed down where the typical bottlenecks in your app are. For all you know, it might be the batch process you run to reindex your tables; it could be the SQL queries that runs over your effective-dated trees; it could be the XML marshal...
I'm trying to compile/link a very old piece of software on a linux system and I can't for some reason link with a shared library that's installed on my system. I get the following error from the linker: /usr/bin/ld: cannot find -lXaw However, the lib itself is installed. If I run ldconfig -v | grep libXaw I get (amo...
It sounds like the linker is unable to find the `libXaw` library despite it being installed. This can occur for several reasons. Here are some steps to troubleshoot and resolve the issue: 1. **Check Library Paths**: Ensure that the library path `/usr/lib` (or wherever the `libXaw.so` is located) is in the library sear...
20,947
[ { "from": "human", "value": "I'm trying to compile/link a very old piece of software on a linux system and I can't for some reason link with a shared library that's installed on my system.\nI get the following error from the linker:\n/usr/bin/ld: cannot find -lXaw\n\nHowever, the lib itself is installed. If...