instruction
stringlengths
14
27.6k
completion
stringlengths
3
38.3k
__original_row_idx
int64
0
50k
conversations
listlengths
2
2
I found a wonderful open source Java program that I'm translating into C#. The built-in translator in Visual Studio got me started and I've now spent about a month translating the rest manually line by line. I've completed over 15,000 lines of translation and the only thing that remains is trying to figure out how to c...
In Java, `MemoryImageSource` is typically used in conjunction with AWT (Abstract Window Toolkit) for rendering images, and it allows you to create an image from an array of pixel data. In .NET, particularly in Windows Forms or WPF, there are built-in classes to handle similar functionality. ### Using Windows Forms If...
21,227
[ { "from": "human", "value": "I found a wonderful open source Java program that I'm translating into C#. The built-in translator in Visual Studio got me started and I've now spent about a month translating the rest manually line by line. I've completed over 15,000 lines of translation and the only thing that...
What is the technical difference between a process and a thread? I get the feeling a word like 'process' is overused and there are also hardware and software threads. How about light-weight processes in languages like Erlang? Is there a definitive reason to use one term over the other?
The concepts of processes and threads are fundamental in the field of computer science and operating systems. Here's a breakdown of their technical differences, along with clarifications on terms like hardware threads, software threads, and lightweight processes. ### Processes - **Definition**: A process is an indepe...
27,217
[ { "from": "human", "value": "What is the technical difference between a process and a thread?\nI get the feeling a word like 'process' is overused and there are also hardware and software threads. How about light-weight processes in languages like Erlang? Is there a definitive reason to use one term over th...
I have some linq entities that inherit something like this: public abstract class EntityBase { public int Identifier { get; } } public interface IDeviceEntity { int DeviceId { get; set; } } public abstract class DeviceEntityBase : EntityBase, IDeviceEntity { public abstract int DeviceId { get; set; } } public part...
The issue you're encountering relates to Entity Framework's mapping process and how it handles properties in abstract classes and interfaces. Let's go through a few steps and possible solutions to resolve the `InvalidOperationException` related to the unmapped `DeviceId` property. ### 1. Ensure Property Mapping Since...
23,499
[ { "from": "human", "value": "I have some linq entities that inherit something like this:\npublic abstract class EntityBase { public int Identifier { get; } }\n\npublic interface IDeviceEntity { int DeviceId { get; set; } }\n\npublic abstract class DeviceEntityBase : EntityBase, IDeviceEntity\n{\n public ab...
I have a combo box with the following DataTemplate: <DataTemplate x:Key="ComboBoxDataTemplate"> <StackPanel> <TextBlock Text="{Binding Path='Name'}"/> <Path Data="{Binding Path='PathGeometry'}" Width="64" Height="64" Stroke="Black" Stretch="Fill" StrokeThickness="1"/> ...
The issue you're encountering seems to stem from the way the `PathGeometry` is being defined and how it is bound to the `Path` in your `DataTemplate`. The error message "Value is out of range" suggests that there may be a problem with the data being provided to the `Path`. This can happen for a few reasons: 1. **Inval...
28,596
[ { "from": "human", "value": "I have a combo box with the following DataTemplate:\n<DataTemplate x:Key=\"ComboBoxDataTemplate\">\n <StackPanel>\n <TextBlock Text=\"{Binding Path='Name'}\"/>\n <Path Data=\"{Binding Path='PathGeometry'}\" Width=\"64\" Height=\"64\" Stro...
I recently got involved in a Java project at work: we're using MyEclipse for the IDE, and Subclipse for source control integration. Since I am new to the project, I am currently submitting any changes I make as patches, to make it easier for the other team members to review my changes and decide whether or not to commi...
Creating patches with relative paths in Subclipse for Eclipse is not a straightforward built-in feature. However, there are a few approaches you can take to work around the limitation of absolute paths in your patches. ### Approaches to Create Patches with Relative Paths 1. **Use the Command Line with `svn diff`:** ...
28,506
[ { "from": "human", "value": "I recently got involved in a Java project at work: we're using MyEclipse for the IDE, and Subclipse for source control integration. Since I am new to the project, I am currently submitting any changes I make as patches, to make it easier for the other team members to review my c...
I've heard that there are some things one cannot do as a computer programmer, but I don't know what they are. One thing that occurred to me recently was: wouldn't it be nice to have a class that could make a copy of the source of the program it runs, modify that program and add a method to the class that it is, and the...
Yes, it is indeed possible for code to write code, and this practice is generally referred to as "metaprogramming." In various programming languages, metaprogramming allows you to generate code dynamically or modify existing code during runtime. ### Key Concepts of Code Writing Code 1. **Dynamic Code Generation**: Ma...
28,627
[ { "from": "human", "value": "I've heard that there are some things one cannot do as a computer programmer, but I don't know what they are. One thing that occurred to me recently was: wouldn't it be nice to have a class that could make a copy of the source of the program it runs, modify that program and add ...
I'm creating a really complex dynamic sql, it's got to return one row per user, but now I have to join against a one to many table. I do an outer join to make sure I get at least one row back (and can check for null to see if there's data in that table) but I have to make sure I only get one row back from this outer jo...
In your scenario, where you want to ensure that you retrieve only one row per user from a one-to-many relationship while still maintaining the outer join semantics, you could consider using a Common Table Expression (CTE) or a derived table (subquery in the FROM clause) to pre-aggregate or filter the second table befor...
27,018
[ { "from": "human", "value": "I'm creating a really complex dynamic sql, it's got to return one row per user, but now I have to join against a one to many table. I do an outer join to make sure I get at least one row back (and can check for null to see if there's data in that table) but I have to make sure I...
I need to be able to contribute to a relatively large Adobe AIR project and I'm starting from scratch with this technology. What's the best way to go about it? I usually get a good book/tutorial and work my way through it but this time it seems there's just too much to learn for this to be feasible within a reasonable ...
Getting up to speed with a relatively large Adobe AIR project can indeed be overwhelming, especially since it encompasses multiple technologies like ActionScript and Flex. Here’s a structured approach that you might find effective: ### 1. **Understand the Basics:** - **Documentation and Guides:** Start with the off...
25,162
[ { "from": "human", "value": "I need to be able to contribute to a relatively large Adobe AIR project and I'm starting from scratch with this technology. What's the best way to go about it?\nI usually get a good book/tutorial and work my way through it but this time it seems there's just too much to learn fo...
I'm looking to use Java to parse an ongoing stream of event drive XML generated by a remote device. Here's a simplified sample of two events: <?xml version="1.0"?> <Event> DeviceEventMsg <Param1>SomeParmValue</Param1> </Event> <?xml version="1.0"?> <Event> DeviceEventMsg <Param1>SomeParmValue</Param1> </Event> It see...
The issue you're facing stems from the fact that XML parsers expect well-formed XML documents. Your sample XML data includes two separate XML documents, which is not valid because XML documents cannot be "chained" together like that. Each XML document must be a standalone entity, which means it must be enclosed in a si...
20,206
[ { "from": "human", "value": "I'm looking to use Java to parse an ongoing stream of event drive XML generated by a remote device. Here's a simplified sample of two events:\n<?xml version=\"1.0\"?>\n<Event> DeviceEventMsg\n<Param1>SomeParmValue</Param1>\n</Event>\n<?xml version=\"1.0\"?>\n<Event> DeviceEvent...
What is the difference between applying the visitor design pattern to your code and the following approach: interface Dointerface { public void perform(Object o); } public class T { private Dointerface d; private String s; public String getS() { return s; } public T(String s) { ...
The Visitor design pattern and the approach you've provided have some similarities, particularly in the way they allow different operations to be performed on objects without modifying their classes. However, they differ significantly in their intent, structure, and design principles. ### Visitor Pattern 1. **Intent*...
18,207
[ { "from": "human", "value": "What is the difference between applying the visitor design pattern to your code and the following approach:\ninterface Dointerface {\n public void perform(Object o);\n}\n\npublic class T {\n private Dointerface d;\n private String s;\n\n public String getS() {\n ...
I was recently tasked with debugging a strange problem within an e-commerce application. After an application upgrade the site started to hang from time to time and I was sent in to debug. After checking the event log I found that the SQL-server wrote ~200 000 events in a couple of minutes with the message saying that ...
The behavior you're experiencing with the stored procedure is related to how the SQL Server handles transactions and locks when executing the `DELETE` operation, particularly with the use of a join in your `SELECT` statement. ### Problem Analysis: 1. **Locking Behavior**: When you perform the `DELETE` operation withi...
25,573
[ { "from": "human", "value": "I was recently tasked with debugging a strange problem within an e-commerce application. After an application upgrade the site started to hang from time to time and I was sent in to debug. After checking the event log I found that the SQL-server wrote ~200 000 events in a couple...
I am curious to do what happens when you edit a post on this site. I am using wmd for my markdown editor, of course when I goto edit, I get the HTML it generated not the markdown like on stackoverflow. Now, is there a way I can store both? or is it reliable enough to simply convert the HTML back to markdown to show i...
When you edit a post on platforms that utilize a WYSIWYG (What You See Is What You Get) editor, such as the WMD (Markdown) editor you mentioned, the typical behavior is that the original Markdown is converted to HTML for display. When you go to edit the post, you often see the generated HTML rather than the original Ma...
24,495
[ { "from": "human", "value": "I am curious to do what happens when you edit a post on this site.\nI am using wmd for my markdown editor, of course when I goto edit, I get the HTML it generated not the markdown like on stackoverflow. Now, is there a way I can store both? or is it reliable enough to simply c...
I am currently publishing code behind .aspx in SharePoint. I can automatically publish the .dll to the bin folder of the virtual directory, but I cannot figure out how to push the .aspx pages and images to the server without manually using SharePoint Designer. Where does the folder exist? Or do I need to create a Share...
When working with SharePoint and ASPX pages, it's important to understand that manually copying files to the SharePoint directories or using tools like SharePoint Designer is not always the best practice. Instead, using SharePoint Features or SharePoint solutions is the preferred way to deploy files such as ASPX pages ...
25,538
[ { "from": "human", "value": "I am currently publishing code behind .aspx in SharePoint. I can automatically publish the .dll to the bin folder of the virtual directory, but I cannot figure out how to push the .aspx pages and images to the server without manually using SharePoint Designer.\nWhere does the fo...
In the Render method of an ASP.NET web-control, I need to alter the output of the Html based on whether JavaScript is enabled or disabled on the clients browser, Does anyone know the right incantation to figure that out?
In ASP.NET web controls, you can't directly detect whether JavaScript is enabled or disabled on the client's browser during the server-side `Render` method, as this is a server-side operation and the detection of JavaScript capability is inherently a client-side concern. However, you can use a common pattern involving...
29,075
[ { "from": "human", "value": "In the Render method of an ASP.NET web-control, I need to alter the output of the Html based on whether JavaScript is enabled or disabled on the clients browser,\nDoes anyone know the right incantation to figure that out?\n" }, { "from": "gpt", "value": "In ASP.NET w...
My Program overrides public void paint(Graphics g, int x, int y); in order to draw some stings using g.drawString(someString, x+10, y+30); Now someString can be quite long and thus, it may not fit on one line. What is the best way to write the text on multiple line. For instance, in a rectangle (x1, y1, x2, y2)?
To draw a long string in multiple lines within a specified rectangular area, you'll need to split the string into smaller parts that can fit into the defined width of the rectangle. You can achieve this by measuring the string's width and breaking it into lines accordingly. Here’s a sample implementation using Java’s ...
26,311
[ { "from": "human", "value": "My Program overrides public void paint(Graphics g, int x, int y); in order to draw some stings using g.drawString(someString, x+10, y+30);\nNow someString can be quite long and thus, it may not fit on one line.\nWhat is the best way to write the text on multiple line. For instan...
When I type git diff, I want to view the output with my visual diff tool of choice (SourceGear "diffmerge" on Windows). How do I configure git to do this?
To configure Git to use your preferred visual diff tool, such as SourceGear DiffMerge, you need to set it up in Git's configuration. Here's how you can do it on Windows: 1. **Open a Command Prompt** (cmd) or **Git Bash**. 2. **Set the Diff Tool**: Run the following commands to set DiffMerge as your diff tool: ```...
26,688
[ { "from": "human", "value": "When I type git diff, I want to view the output with my visual diff tool of choice (SourceGear \"diffmerge\" on Windows). How do I configure git to do this?\n" }, { "from": "gpt", "value": "To configure Git to use your preferred visual diff tool, such as SourceGear D...
What conventions do you use for log categories in log4j or similar libraries ? Usually you see class names as categories, but have you used other systems ? What about log levels ? What levels do you use and in which case ? Update: as some of you replied, there is no 'right' answer. I'm just looking for what different c...
In logging frameworks like Log4j, establishing conventions for log categories and log levels is essential for maintaining clarity, consistency, and usability of logs. Here are some common practices and alternative approaches: ### Log Categories 1. **Class Names as Categories**: This is the most common approach where ...
22,288
[ { "from": "human", "value": "What conventions do you use for log categories in log4j or similar libraries ?\nUsually you see class names as categories, but have you used other systems ?\nWhat about log levels ? What levels do you use and in which case ?\nUpdate: as some of you replied, there is no 'right' a...
We're working on an hospital information system that is being written on C# and using NHibernate to map objects to database. MVC pattern is being used to separate business logic from UI. Here is the problem, How do you get variable sized different set of strings to UI? For example a Contact object have a property named...
Your problem involves managing dynamic and static data efficiently in a C# MVC application using NHibernate. Let’s analyze the solutions you provided and consider their implications. ### Solutions Analysis 1. **All String Values Statically Written to Combo Box**: - **Pros**: Simple implementation; no external depe...
24,688
[ { "from": "human", "value": "We're working on an hospital information system that is being written on C# and using NHibernate to map objects to database. MVC pattern is being used to separate business logic from UI. Here is the problem,\nHow do you get variable sized different set of strings to UI?\nFor exa...
I try to add an addons system to my Windows.Net application using Reflection; but it fails when there is addon with dependencie. Addon class have to implement an interface 'IAddon' and to have an empty constructor. Main program load the addon using Reflection: Assembly assembly = Assembly.LoadFile(@"C:\Temp\TestAddon\...
When loading assemblies in .NET, the runtime looks for dependencies in specific locations, and if those dependencies aren't in the same directory as the executing assembly (or in the Global Assembly Cache), you'll encounter a `FileNotFoundException`. In your case, since you want to allow the .NET runtime to resolve dep...
20,696
[ { "from": "human", "value": "I try to add an addons system to my Windows.Net application using Reflection; but it fails when there is addon with dependencie.\nAddon class have to implement an interface 'IAddon' and to have an empty constructor. \nMain program load the addon using Reflection:\nAssembly assem...
I am trying to debug an ActiveResource call that is not working. What's the best way to view the HTTP response to the request ActiveResource is making?
To debug an ActiveResource call and view the HTTP response, you can take several approaches: ### 1. Enable Logging for ActiveResource ActiveResource uses the logger from Rails. You can enable detailed logging for the HTTP requests and responses by setting the log level to `debug`. Add this to your `config/environments...
25,732
[ { "from": "human", "value": "I am trying to debug an ActiveResource call that is not working.\nWhat's the best way to view the HTTP response to the request ActiveResource is making?\n" }, { "from": "gpt", "value": "To debug an ActiveResource call and view the HTTP response, you can take several ...
I am trying the following code: <?php $link = mysql_connect('localhost', 'root', 'geheim'); if (!$link) { die('Could not connect: ' . mysql_error()); } echo 'Connected successfully'; $query = "SELECT * FROM Auctions"; $result = mysql_query($query); while($row = mysql_fetch_array...
The error message you're receiving indicates that the `$result` variable is not a valid MySQL result resource, which usually means that the `mysql_query` function failed to execute the query. Here are a few potential issues and solutions: 1. **Check the MySQL Connection**: Make sure your MySQL server is running and ...
26,861
[ { "from": "human", "value": "I am trying the following code:\n<?php\n\n $link = mysql_connect('localhost', 'root', 'geheim');\n if (!$link) {\n die('Could not connect: ' . mysql_error());\n }\n echo 'Connected successfully';\n\n\n\n $query = \"SELECT * FROM Auctions\";\n $result = m...
We have a file that has a 64 bit integer as a string in it. How do we scanf() or otherwise parse this numeric string into an unsigned 64 bit integer type in C++ ? We are aware of things like %lld etc., but a lot of ways to do this parse seem to break compiles under different compilers and stdlibs. The code should comp...
In C++, you can use `std::stoull` to safely convert a string representing an unsigned 64-bit integer into an `unsigned long long` type, which is typically used to represent 64-bit integers in C++. This method is portable and works consistently across different compilers and standard libraries, ensuring that your code a...
26,944
[ { "from": "human", "value": "We have a file that has a 64 bit integer as a string in it. How do we scanf() or otherwise parse this numeric string into an unsigned 64 bit integer type in C++ ? \nWe are aware of things like %lld etc., but a lot of ways to do this parse seem to break compiles under different c...
How can I change my GNUemacs to open up a cygwin terminal rather then a cmd one with the shell command? Closed as duplicate of How can I run Cygwin Bash Shell from within Emacs?.
To configure GNU Emacs to open a Cygwin terminal (Bash shell) instead of the default CMD terminal when you use the shell command, you need to modify your Emacs configuration file (usually `.emacs` or `init.el`). Here’s how to do it: 1. **Locate your Emacs configuration file**: - You can find your configuration file...
29,296
[ { "from": "human", "value": "How can I change my GNUemacs to open up a cygwin terminal rather then a cmd one with the shell command?\n\nClosed as duplicate of How can I run Cygwin Bash Shell from within Emacs?.\n\n" }, { "from": "gpt", "value": "To configure GNU Emacs to open a Cygwin terminal ...
Been creating a simple program using VBA that I can use to review vocabulary in Chinese. I've gotten a fair bit working so far, but have run into a huge problem with inputting a macron-character such as "ā" (unicode 257). The specific application I am working on right now involves changing the contents of the text-box...
Dealing with Unicode characters like "ā" in VBA can indeed be a challenge since VBA doesn't natively support the direct input of Unicode characters using the standard keyboard shortcuts you might expect. However, there are a few approaches you can take to work around this limitation: ### 1. Use ChrW Function You can ...
28,265
[ { "from": "human", "value": "Been creating a simple program using VBA that I can use to review vocabulary in Chinese.\nI've gotten a fair bit working so far, but have run into a huge problem with inputting a macron-character such as \"ā\" (unicode 257). The specific application I am working on right now in...
I am having a lot of trouble with mod_rewrite, and for a while I had it going, but for some reason everything has stopped working. Is there any sort of basic test that I can do to make sure that it is not something fundamental broken. It does show up in phpinfo();
Certainly! If you want to troubleshoot `mod_rewrite` and ensure it's working properly on your server, you can follow these basic steps: ### 1. Check Apache Configuration First, make sure that the `mod_rewrite` module is enabled in your Apache configuration. You can do this by running the following command in the term...
26,037
[ { "from": "human", "value": "I am having a lot of trouble with mod_rewrite, and for a while I had it going, but for some reason everything has stopped working.\nIs there any sort of basic test that I can do to make sure that it is not something fundamental broken.\nIt does show up in phpinfo();\n" }, { ...
OK, I am trying to generate the rDoc for paperclip, but the rake task is choking on another plugin before it gets to it, so this is out of the question: rake doc:plugins I could go and fix up the broken plugin, but I'm busy and lazy, so I just want to generate the docs for paperclip. Is there any way of doing this?
If you're looking to generate documentation for the Paperclip gem without having to fix a broken plugin, you can do so by directly generating the RDoc for just the Paperclip gem itself. Here’s how you can do that: 1. **Navigate to the Paperclip directory**: First, go to the directory where Paperclip is located in your...
29,113
[ { "from": "human", "value": "OK, I am trying to generate the rDoc for paperclip, but the rake task is choking on another plugin before it gets to it, so this is out of the question:\nrake doc:plugins\n\nI could go and fix up the broken plugin, but I'm busy and lazy, so I just want to generate the docs for p...
And how do you keep them in synch between test and production environments? When it comes to indexes on database tables, my philosophy is that they are an integral part of writing any code that queries the database. You can't introduce new queries or change a query without analyzing the impact to the indexes. So I do ...
Maintaining database indexes in synchronization between test and production environments can indeed be challenging, especially if you aim to integrate this process into your development lifecycle. Here are some strategies that can help you automate and streamline the management of indexes: ### 1. Source Control for Da...
26,712
[ { "from": "human", "value": "And how do you keep them in synch between test and production environments?\nWhen it comes to indexes on database tables, my philosophy is that they are an integral part of writing any code that queries the database. You can't introduce new queries or change a query without ana...
Do you know an easy and straight-forward method/sub/module which allows me to convert a number (say 1234567.89) to an easily readable form - something like 1.23M? Right now I can do this by making several comparisons, but I'm not happy with my method: if($bytes > 1000000000){ $bytes = ( sprintf( "%0.2f", $bytes/100...
You can simplify your code for converting numbers to a more readable format (like "1.23M" for millions) by creating a more generic function that handles the conversions for you. Here’s a simple implementation in Python, which you can easily adapt to other languages like PHP or JavaScript as needed. Here's a straightfo...
26,583
[ { "from": "human", "value": "Do you know an easy and straight-forward method/sub/module which allows me to convert a number (say 1234567.89) to an easily readable form - something like 1.23M?\nRight now I can do this by making several comparisons, but I'm not happy with my method:\nif($bytes > 1000000000){ ...
Having recently discovered this method of development, I'm finding it a rather nice methodology. So, for my first project, I have a small DLL's worth of code (in C#.NET, for what it's worth), and I want to make a set of tests for this code, but I am a bit lost as to how and where to start. I'm using NUnit, and VS 2008,...
It's great to hear that you're diving into Test-Driven Development (TDD) using NUnit in C#. Here's a structured approach to help you get started with writing tests for your DLL project: ### 1. Understanding the Basics of TDD Before jumping into writing tests, it's crucial to understand the TDD cycle: - **Red**: Write ...
24,396
[ { "from": "human", "value": "Having recently discovered this method of development, I'm finding it a rather nice methodology. So, for my first project, I have a small DLL's worth of code (in C#.NET, for what it's worth), and I want to make a set of tests for this code, but I am a bit lost as to how and wher...
I have a table (volunteers_2009) that has all the volunteers stored within, then I have a table (venues) that list all the different venues a volunteer could work (volunteers are assigned to one venue each, and that is stored within volunteers_2009.venue_id, which equals venues.id) The venues table also has a column fo...
Your approach to sending emails with CSV attachments tailored for each chairman sounds like a solid plan! Let’s break down the steps more clearly and ensure that you have an efficient process in place. ### Step-by-Step Process 1. **Fetch Venue Information**: - Query the `venues` table to get a list of all venues,...
27,989
[ { "from": "human", "value": "I have a table (volunteers_2009) that has all the volunteers stored within, then I have a table (venues) that list all the different venues a volunteer could work (volunteers are assigned to one venue each, and that is stored within volunteers_2009.venue_id, which equals venues....
I've got two collections (generic Lists), let's call them ListA and ListB. In ListA I've got a few items of type A. In ListB I've got some items of type B that have the SAME ID (but not same type) as the items in ListA, plus many more. I want to remove all the items from ListB that have the same ID as the ones in ListA...
Given that you have two lists (`ListA` and `ListB`) where items in each list are of different types but share a common `Id` property, you can use LINQ to efficiently filter out the items in `ListB` that have IDs matching those in `ListA`. Here's how you can achieve this: 1. First, extract the IDs from `ListA`. 2. Th...
25,328
[ { "from": "human", "value": "I've got two collections (generic Lists), let's call them ListA and ListB.\nIn ListA I've got a few items of type A. In ListB I've got some items of type B that have the SAME ID (but not same type) as the items in ListA, plus many more. I want to remove all the items from ListB ...
I have a DataGridViewComboBoxColumn in a DataGridView in a windows application. The user can change settings elsewhere to potentially invalidate a selection in a DataGridViewComboBoxColumn. I have a requirement to retain/display the invalid item while only leaving valid items selectable in the list. Without correctin...
In a `DataGridViewComboBoxColumn`, if you want to retain the currently selected value (which may be invalid based on the current list of selectable values) while only allowing valid items to be selectable, you can use a combination of event handling and manual management of the cell's value. Here's a common approach ...
27,646
[ { "from": "human", "value": "I have a DataGridViewComboBoxColumn in a DataGridView in a windows application. The user can change settings elsewhere to potentially invalidate a selection in a DataGridViewComboBoxColumn. I have a requirement to retain/display the invalid item while only leaving valid items ...
Looking for a better Windows XP command-line interface. The Visual Studio Command Prompt isn't near as nice as the Linux/OSX terminals. Thoughts? edit: Answers: Console on Sourceforge, and the Windows Powershell. Thanks, I'll go dig them up and evaluate them. The Cygwin package is too much overhead for what I want. ed...
If you're looking for a better command-line interface for Windows XP beyond the traditional command prompt, here are a few options you might consider: 1. **Windows PowerShell**: As you mentioned, PowerShell is a powerful shell that offers more features than the traditional command prompt, including object-oriented out...
28,176
[ { "from": "human", "value": "Looking for a better Windows XP command-line interface. The Visual Studio Command Prompt isn't near as nice as the Linux/OSX terminals. \nThoughts?\nedit:\nAnswers: Console on Sourceforge, and the Windows Powershell. Thanks, I'll go dig them up and evaluate them.\nThe Cygwin pac...
I want to use JOGL (for Clojure, not Java). There seems to be quite a combination of alternatives for JDKs and OpenGL bindings, and I don't want to use a scatter gun approach and clog up my machine installing too much cruft. Please help me get started! What Ubuntu/Debian packages do I need to install? (starting with s...
To get started with JOGL (Java Binding for OpenGL) in Clojure on Ubuntu/Debian, you'll need to set up your development environment by installing the necessary packages and configuring JOGL properly. Below is a comprehensive guide to help you through the setup process. ### Step 1: Install the JDK Since you mentioned s...
28,148
[ { "from": "human", "value": "I want to use JOGL (for Clojure, not Java). There seems to be quite a combination of alternatives for JDKs and OpenGL bindings, and I don't want to use a scatter gun approach and clog up my machine installing too much cruft. Please help me get started!\n\nWhat Ubuntu/Debian pack...
Any ideas why this won't validate here: http://validator.w3.org/#validate_by_input It seems the form input tags are wrong but reading through the XHTML spec they should validate fine. Any ideas? <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="ht...
The XHTML document you've provided has a few minor issues that could be causing it to fail validation. Here are a couple of things to consider: 1. **Self-Closing Tags**: In XHTML, void elements (like `<br />`, `<img />`, and `<input />`) must be self-closed. However, the `<input>` tags you've provided are self-closing...
27,283
[ { "from": "human", "value": "Any ideas why this won't validate here:\nhttp://validator.w3.org/#validate_by_input\nIt seems the form input tags are wrong but reading through the XHTML spec they should validate fine. Any ideas?\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR...
Does anyone know of a decent UML standards guide? My company currently relies on UML 2.0 (rightly or wrongly) to do the majority (read all) of their design work. I have been asked to come up with a draft 'best practice' guide to help other developers develop better models. The main problem I face is that Im slightly bi...
Creating a best practices guide for UML can be challenging, especially if you have a bias against its complexity. However, focusing on clarity, purpose, and simplicity will help make your document useful for others. Here are some suggestions and resources that may help you in developing your guide: ### Key Considerati...
25,356
[ { "from": "human", "value": "Does anyone know of a decent UML standards guide?\nMy company currently relies on UML 2.0 (rightly or wrongly) to do the majority (read all) of their design work. I have been asked to come up with a draft 'best practice' guide to help other developers develop better models. The ...
What do I put in my order by?? I want to order by Name. I have moved the orderby after the distinct because I read that it needs to be done last. var result = (from r in db.RecordDocs where r.RecordID == recordID select new { ...
To order the results by the `Name` property in your LINQ query, you should provide the property to `OrderBy()` inside the parentheses. Here's how you can modify your code: ```csharp var result = (from r in db.RecordDocs where r.RecordID == recordID select new { ...
30,827
[ { "from": "human", "value": "What do I put in my order by?? I want to order by Name. I have moved the orderby after the distinct because I read that it needs to be done last.\n var result = (from r in db.RecordDocs\n where r.RecordID == recordID\n select new\n ...
I have OS X 10.5 set up with the precompiled versions of PHP 5 and Apache 2. I'm trying to set up the Zend Debugger, but with no luck. Here's what I did: I downloaded ZendDebugger-5.2.14-darwin8.6-uni.tar I created the directory /Developer/Extras/PHP and set the permissions to: Permissions: drwxrwxr-x Owner: root:...
It sounds like you're on the right track with setting up the Zend Debugger, but since it's not appearing in your `phpinfo()` output when accessed through Apache, there are a few things you can check and try: 1. **Check Apache's PHP Configuration**: Ensure that the Apache instance is using the same `php.ini` file as th...
28,169
[ { "from": "human", "value": "I have OS X 10.5 set up with the precompiled versions of PHP 5 and Apache 2. I'm trying to set up the Zend Debugger, but with no luck. Here's what I did:\n\nI downloaded ZendDebugger-5.2.14-darwin8.6-uni.tar\nI created the directory /Developer/Extras/PHP and set the permission...
I'm using Delphi 2007. How can I put a GIF/PNG image on a BitBtn component? (Preferably, with alpha transparency supported)
Delphi 2007 does not natively support displaying animated GIFs or PNG images with alpha transparency directly on a `TBitBtn` component. However, you can achieve this effect by using a few workarounds, such as using a `TImage` component for the image and overlaying it on a `TBitBtn` or creating a custom button. ### Met...
25,600
[ { "from": "human", "value": "I'm using Delphi 2007. How can I put a GIF/PNG image on a BitBtn component? (Preferably, with alpha transparency supported)\n" }, { "from": "gpt", "value": "Delphi 2007 does not natively support displaying animated GIFs or PNG images with alpha transparency directly ...
Exception is: 'Country' has a SelectedValue which is invalid because it does not exist in the list of items. Parameter name: value UserService.DsUserAttributes dsCountry = us_service.GetUserAttributeDropDown(systemId, "Country"); Country.DataSource = dsCountry.tblDropDownValues; Country.DataTextField = "AttrValue"; Co...
The error message you're encountering indicates that the `SelectedValue` of the `Country` control is not present in the list of items bound to it. This typically occurs when the `SelectedValue` property is set to a value that doesn't exist in the data source (in this case, `dsCountry.tblDropDownValues`). Here’s a bre...
23,953
[ { "from": "human", "value": "Exception is: \n'Country' has a SelectedValue which is invalid because it does not exist in the list of items.\nParameter name: value\nUserService.DsUserAttributes dsCountry = us_service.GetUserAttributeDropDown(systemId, \"Country\");\nCountry.DataSource = dsCountry.tblDropDown...
I have two PHP scripts, both using the same session by calling session_name('MySessID'). When the first script calls the second script using curl, the second script hangs when session_start() is called. Why would this happend?
When you are calling a PHP script using cURL and both scripts are using the same session (via `session_name('MySessID')`), you may encounter issues such as the second script hanging during the `session_start()` call. Here are some potential reasons why this could happen: 1. **Session File Locking**: PHP sessions typic...
26,824
[ { "from": "human", "value": "I have two PHP scripts, both using the same session by calling session_name('MySessID').\nWhen the first script calls the second script using curl, the second script hangs when session_start() is called.\nWhy would this happend?\n" }, { "from": "gpt", "value": "When ...
Is there an easy way to convert a string that contains this: Date: Wed, 5 Nov 2008 13:12:12 -0500 (EST) into a string that contains this: 20081105_131212 UPDATE: I ended up using date.tryparse which is similar to tryParseExact except you don't have to specify the format string. I did have to eliminate the () and the...
Your approach to convert the date string into the desired format is almost complete. You've correctly used string manipulation to clean up the input date string and `Date.TryParse` for parsing it. Here's a step-by-step code sample that follows your logic and incorporates best practices: ```vb Dim originalString As S...
28,661
[ { "from": "human", "value": "Is there an easy way to convert a string that contains this:\nDate: Wed, 5 Nov 2008 13:12:12 -0500 (EST)\n\ninto a string that contains this:\n20081105_131212\n\nUPDATE:\nI ended up using date.tryparse which is similar to tryParseExact except you don't have to specify the format...
We have a C# service that is deployed to a remote customer system. The application writes a substantial amount of "diagnostic" information to the console (i.e. Console.WriteLine()). The service isn't "doing what it should." How can we capture the console output from the service in another application? A WinForm vers...
To capture the console output from a C# service, especially if you want to avoid making major changes to the existing codebase, you can consider the following approaches: ### 1. Redirect Console Output to a File One quick way to capture console output is to redirect it to a file. You can modify the service's entry po...
26,773
[ { "from": "human", "value": "We have a C# service that is deployed to a remote customer system. The application writes a substantial amount of \"diagnostic\" information to the console (i.e. Console.WriteLine()). The service isn't \"doing what it should.\" How can we capture the console output from the s...
I have a custom control that I created for my project. In this control there are several child controls like a Label, a PictureBox, and a LinkLabel. Other then the LinkLabel, I want the mouse over event currently on the parent control and have the control respond to the mouse over. The background color changes when you...
To achieve the behavior you want where clicking on any child control (like a `Label`, `PictureBox`, or `LinkLabel`) should also trigger the click event of the parent control, you can implement the click event on the child controls and then invoke the parent control's click event from there. Here’s a step-by-step appro...
25,903
[ { "from": "human", "value": "I have a custom control that I created for my project. In this control there are several child controls like a Label, a PictureBox, and a LinkLabel. Other then the LinkLabel, I want the mouse over event currently on the parent control and have the control respond to the mouse ov...
What's the best way to embed Ruby as a scripting language in C++? Using ruby.h? SWIG? Something else? What I need is to expose some C++ objects to Ruby and have the Ruby interpreter evaluate scripts that access these objects. I don't care about extending Ruby or accessing it in C++. I've found this article on embedding...
Embedding Ruby in C++ can indeed be accomplished in a few different ways, each with its own pros and cons. Let's explore some popular methods and provide resources and considerations for your use case: ### 1. Using `ruby.h` (C API) The most direct way to embed Ruby is to use the Ruby C API provided by `ruby.h`. This m...
28,114
[ { "from": "human", "value": "What's the best way to embed Ruby as a scripting language in C++? Using ruby.h? SWIG? Something else? What I need is to expose some C++ objects to Ruby and have the Ruby interpreter evaluate scripts that access these objects. I don't care about extending Ruby or accessing it in ...
We are deploying our ASP.NET 3.5 app to a production server for beta testing. Each page is secured using SSL. On our homepage (default.aspx) we have web services which populate flash objects. I am getting an error: The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header...
The issue you're encountering is likely related to the authentication settings on your server and how your ASP.NET application is configured to interact with web services. Here’s a breakdown of potential causes and solutions to address the error: ### Causes 1. **Authentication Mode**: The server may be configured to u...
25,681
[ { "from": "human", "value": "We are deploying our ASP.NET 3.5 app to a production server for beta testing.\nEach page is secured using SSL.\nOn our homepage (default.aspx) we have web services which populate flash objects.\nI am getting an error:\nThe HTTP request is unauthorized with client authentication ...
Functional languages are good because they avoid bugs by eliminating state, but also because they can be easily parallelized automatically for you, without you having to worry about the thread count. As a Win32 developer though, can I use Haskell for some DLL files of my application? And if I do, is there a real advant...
Using Haskell for developing DLLs in a Win32 application is certainly possible, and you can potentially benefit from its functional programming paradigm. Let's explore your questions one by one: ### Haskell and DLLs in Win32 1. **Creating DLLs**: Haskell can be used to create Dynamic Link Libraries (DLLs) for Windows...
23,892
[ { "from": "human", "value": "Functional languages are good because they avoid bugs by eliminating state, but also because they can be easily parallelized automatically for you, without you having to worry about the thread count.\nAs a Win32 developer though, can I use Haskell for some DLL files of my applic...
I have an Access form where each record has some info that is computed on the fly. I'm using the Form_Current() event; each time a record is selected, I compute some information and change some form controls to reflect it, based on the record's ID. I want to print a bunch of these records. However, in this situation th...
To handle the situation where you want to print records in an Access form and still have the dynamic information that you compute in the `Form_Current()` event, you have a few options to consider: ### 1. Use the Print Event Instead of relying on the `Form_Current()` event, you can explicitly call your computation met...
27,372
[ { "from": "human", "value": "I have an Access form where each record has some info that is computed on the fly. I'm using the Form_Current() event; each time a record is selected, I compute some information and change some form controls to reflect it, based on the record's ID.\nI want to print a bunch of th...
POSIX allows mutexes to be recursive. That means the same thread can lock the same mutex twice and won't deadlock. Of course it also needs to unlock it twice, otherwise no other thread can obtain the mutex. Not all systems supporting pthreads also support recursive mutexes, but if they want to be POSIX conform, they ha...
Your question raises important considerations regarding the design choices made in various threading and synchronization libraries. Non-recursive mutexes do have their own use cases and advantages, even though they may seem counterintuitive at first. Here are some points to consider: ### 1. Simplicity and Clarity - **...
26,362
[ { "from": "human", "value": "POSIX allows mutexes to be recursive. That means the same thread can lock the same mutex twice and won't deadlock. Of course it also needs to unlock it twice, otherwise no other thread can obtain the mutex. Not all systems supporting pthreads also support recursive mutexes, but ...
Here are the declarations of the variables: string strFirstName; string strLastName; string strAddress; string strCity; string strState; double dblSalary; string strGender; int intAge; ...Do some "cin" statements to get data... retcode = SQLPrepare(StatementHandle, (SQLCHAR *)"INSERT INTO EMPLOYEE ([FirstName], [LastN...
It seems like you're trying to bind string parameters to a SQL statement using ODBC, but the way you're doing it has some issues, especially with the way you bind C++ strings to the SQL parameters. The major issues are: 1. You're using `&strFirstName`, `&strLastName`, etc., which is incorrect for `std::string`. You n...
19,546
[ { "from": "human", "value": "Here are the declarations of the variables:\nstring strFirstName;\nstring strLastName;\nstring strAddress;\nstring strCity;\nstring strState;\ndouble dblSalary;\nstring strGender;\nint intAge;\n\n...Do some \"cin\" statements to get data...\nretcode = SQLPrepare(StatementHandle,...
I have a database table named call with columns call_time, location, emergency_type and there are three types of emergency: paramedics, police and firefighters. In the windows form I created CheckBoxes 'paramedics', 'police', 'firefighters' and I want to retrieve all table columns which meet user's selection. I created...
To make your function cleaner and more maintainable, you can use a `List<string>` to dynamically build your `WHERE` clause based on the user's selections. This way, you won't need to write a lot of `if` statements for each combination of emergency types. Here's a revised version of your function: ```csharp public stat...
26,998
[ { "from": "human", "value": "I have a database table named call with columns call_time, location, emergency_type and there are three types of emergency: paramedics, police and firefighters. In the windows form I created CheckBoxes 'paramedics', 'police', 'firefighters' and I want to retrieve all table colum...
I am building a FAQ module for my site and I want to be able to control single elements on the page even though they all have the same class. I believe this comes under siblings which I am not yet familiar with. Basically I want the user to be able to click the question div and then when they click it the answer div wi...
You can achieve this functionality using JavaScript to add click event listeners to each question. When a question is clicked, you can toggle the visibility of the corresponding answer within the same parent `.set` div. Here's an example implementation: ### HTML Structure Make sure your HTML structure is consistent, ...
27,388
[ { "from": "human", "value": "I am building a FAQ module for my site and I want to be able to control single elements on the page even though they all have the same class. I believe this comes under siblings which I am not yet familiar with.\nBasically I want the user to be able to click the question div and...
When using Lucene.Net with ASP.NET, I can imagine that one web request can trigger an update to the index while another web request is performing a search. Does Lucene.Net have built in it the ability to manage concurrent access, or do I have to manage it, to avoid "being used by another process" errors? EDIT: After...
Your understanding of Lucene.Net's concurrency model is indeed on point. Lucene.Net is designed to ensure thread safety when it comes to manipulating the index, but managing concurrent access requires careful consideration. Let's clarify some key aspects related to your points: 1. **Thread Safety**: Lucene.Net's desig...
28,815
[ { "from": "human", "value": "When using Lucene.Net with ASP.NET, I can imagine that one web request can trigger an update to the index while another web request is performing a search. Does Lucene.Net have built in it the ability to manage concurrent access, or do I have to manage it, to avoid \"being use...
It should be hands-on, complete, targeted to programmers and detailed on layout techniques!
Absolutely! Below is a comprehensive guide focused on layout techniques for programmers. This guide will provide practical insights and methods used in web and application design, including CSS layouts, grid systems, and responsive design principles. ### Layout Techniques for Programmers #### 1. **Understanding Layo...
17,936
[ { "from": "human", "value": "It should be hands-on, complete, targeted to programmers and detailed on layout techniques!\n" }, { "from": "gpt", "value": "Absolutely! Below is a comprehensive guide focused on layout techniques for programmers. This guide will provide practical insights and method...
I'm going to build a Classic Music website and the client already has several podcasts for about 3 min each, and I want to know if should I just add as QT / WMP file to listen and a ZIP to download, or should I use a web podcast hosting solution and just add the link to them? ...having full cross browser and os system ...
When building a classic music website that features podcasts, you have several options for how to present the audio files, each with its own advantages and disadvantages. Here are some considerations for the two approaches you mentioned: ### 1. Direct File Hosting (QT/WMP and ZIP) **Pros:** - **Simplicity:** Directly...
27,941
[ { "from": "human", "value": "I'm going to build a Classic Music website and the client already has several podcasts for about 3 min each, and I want to know if should I just add as QT / WMP file to listen and a ZIP to download, or should I use a web podcast hosting solution and just add the link to them?\n....
So this might be really simple, but I haven't been able to find any examples to learn off of yet, so please bear with me. ;) Here's basically what I want to do: <div>Lots of content! Lots of content! Lots of content! ...</div> .... $("div").html("Itsy-bitsy bit of content!"); I want to smoothly animate between the...
Animating the height of a `<div>` when you change its content can create a smooth transition effect that enhances user experience. You can achieve this using jQuery. Here's a step-by-step guide on how to do this. ### Step 1: Set Up Your HTML First, make sure you have a basic HTML structure like this: ```html <!DOCTY...
25,552
[ { "from": "human", "value": "So this might be really simple, but I haven't been able to find any examples to learn off of yet, so please bear with me. ;) \nHere's basically what I want to do:\n<div>Lots of content! Lots of content! Lots of content! ...</div>\n\n.... \n\n$(\"div\").html(\"Itsy-bitsy bit of c...
How do I generate an audio sine or square wave of a given frequency? I am hoping to do this to calibrate equipment, so how precise would these waves be?
Generating audio sine or square waves of a specific frequency can be done using various methods depending on your requirements, such as software applications, programming libraries, or hardware solutions. Here’s an overview of some common methods and considerations regarding precision. ### Method 1: Software Applicati...
27,953
[ { "from": "human", "value": "How do I generate an audio sine or square wave of a given frequency?\nI am hoping to do this to calibrate equipment, so how precise would these waves be?\n" }, { "from": "gpt", "value": "Generating audio sine or square waves of a specific frequency can be done using ...
I want to setup a CRON that runs a PHP script that in turn moves XML file (holding non-sensitive information) from one server to another. I have been given the proper username/password, and want to use SFTP protocol. The jobs will run daily. There is the potential that one server is Linux and the other is Windows. Bo...
To set up a CRON job that runs a PHP script to move an XML file from one server to another using SFTP, you'll follow these steps: ### Step 1: Install Required Tools Ensure that you have PHP and the necessary libraries installed on the server where the PHP script will run. If your PHP installation does not have the re...
25,537
[ { "from": "human", "value": "I want to setup a CRON that runs a PHP script that in turn moves XML file (holding non-sensitive information) from one server to another. \nI have been given the proper username/password, and want to use SFTP protocol. The jobs will run daily. There is the potential that one ser...
I am trying to design a 4-bit adder subtracter in verilog. This is only the second thing I have ever written in verilog, and I don't know all the correct syntax yet. This is the module I have so far: module Question3(carryin, X, Y, Z, S, carryout, overflow); parameter n = 4; input carryin, Z; input [n-1:0]X...
Your approach to creating a 4-bit adder-subtractor in Verilog is on the right track, but there are several syntax issues and conceptual adjustments needed to make it work correctly. Below is a corrected version of your module, along with explanations of the changes made. ### Corrected Verilog Module ```verilog module...
26,783
[ { "from": "human", "value": "I am trying to design a 4-bit adder subtracter in verilog. This is only the second thing I have ever written in verilog, and I don't know all the correct syntax yet. This is the module I have so far:\nmodule Question3(carryin, X, Y, Z, S, carryout, overflow);\n parameter n = ...
I want to create an NSOpenPanel that can select any kind of file, so I do this NSOpenPanel* panel = [NSOpenPanel openPanel]; if([panel runModalForTypes:nil] == NSOKButton) { // process files here } which lets me select all files except symbolic links. They're simply not selectable and the obvious setResolvesAl...
The behavior you're observing with `NSOpenPanel` in macOS Leopard (10.5.5) versus Tiger (10.4.8) regarding symbolic links is indeed consistent with changes in the behavior of file selection in these operating system versions. In Leopard, `NSOpenPanel` does not allow the selection of symbolic links by default, while in ...
17,835
[ { "from": "human", "value": "I want to create an NSOpenPanel that can select any kind of file, so I do this\nNSOpenPanel* panel = [NSOpenPanel openPanel];\n\nif([panel runModalForTypes:nil] == NSOKButton) {\n // process files here\n}\n\nwhich lets me select all files except symbolic links.\nThey're si...
I'm writing a utility in Python that will attach changed files in Subversion to an email and send it when a subset of folders that are under source control in SVN have been changed. I am using the pysvn library to access the repository. I have a copy of the files on my local file system and I do an update to check if ...
Your current approach for translating SVN paths to local paths is mostly fine, but there are some improvements you can make to enhance readability and efficiency. The `os.path` module can help with handling path manipulations in a more platform-independent way. You might also consider handling edge cases (like paths no...
26,458
[ { "from": "human", "value": "I'm writing a utility in Python that will attach changed files in Subversion to an email and send it when a subset of folders that are under source control in SVN have been changed. I am using the pysvn library to access the repository.\nI have a copy of the files on my local f...
I have looked over the Repository pattern and I recognized some ideas that I was using in the past which made me feel well. However now I would like to write an application that would use this pattern BUT I WOULD LIKE TO HAVE THE ENTITY CLASSES DECOUPLED from the repository provider. I would create several assemblies :...
To implement the Repository pattern while keeping your entity classes decoupled from your data access layer (like LINQ to SQL), you can use several approaches. Below, I'll outline a method using a combination of interfaces and data transfer objects (DTOs) to achieve the level of decoupling you desire. ### 1. Define Yo...
23,237
[ { "from": "human", "value": "I have looked over the Repository pattern and I recognized some ideas that I was using in the past which made me feel well.\nHowever now I would like to write an application that would use this pattern BUT I WOULD LIKE TO HAVE THE ENTITY CLASSES DECOUPLED from the repository pro...
I have some code that raises PropertyChanged events and I would like to be able to unit test that the events are being raised correctly. The code that is raising the events is like public class MyClass : INotifyPropertyChanged { public event PropertyChangedEventHandler PropertyChanged; protected void NotifyPro...
Your method of testing events is generally correct, but it can be improved to handle cases where multiple property changes occur in succession. In your current unit test setup, you're capturing the last `PropertyChanged` event that fires, which is why you're only receiving the notification for `MyOtherProperty` when yo...
26,206
[ { "from": "human", "value": "I have some code that raises PropertyChanged events and I would like to be able to unit test that the events are being raised correctly.\nThe code that is raising the events is like\npublic class MyClass : INotifyPropertyChanged\n{\n public event PropertyChangedEventHandler Pr...
I'm currently facing a problem with my single instance clickonce deployed app, and maybe someone has a good idea about it. My app is called by a web application, which passes parameters to this exe. Now the problem is, if the application is already running, it takes quite a long time, until the new instance is started,...
In a single-instance ClickOnce application, one way to improve the handling of incoming parameters and reduce the delay in processing those parameters when the application is already running is to use some inter-process communication (IPC) mechanism to detect the running instance and pass parameters directly to it with...
23,931
[ { "from": "human", "value": "I'm currently facing a problem with my single instance clickonce deployed app, and maybe someone has a good idea about it.\nMy app is called by a web application, which passes parameters to this exe. Now the problem is, if the application is already running, it takes quite a lon...
The question is if a database connection should be passed in by reference or by value? For me I'm specifically questioning a PHP to MySQL connection, but I think it applies to all databases. I have heard that in PHP when you pass a variable to a function or object, that it is copied in memory and therefore uses twice a...
When considering whether to pass a database connection in PHP by reference or by value, there are several factors to keep in mind. Let's break this down: ### PHP Variable Passing 1. **Pass by Value vs. Pass by Reference**: - **Pass by Value**: A copy of the variable is made. In the case of a resource like a databa...
28,526
[ { "from": "human", "value": "The question is if a database connection should be passed in by reference or by value?\nFor me I'm specifically questioning a PHP to MySQL connection, but I think it applies to all databases.\nI have heard that in PHP when you pass a variable to a function or object, that it is ...
Do you know of any tool that would do like Ruby on Rails' Scaffolding (create simple CRUD pages for any particular class to allow quickly populating a database with dummy data), only which used Java classes with Hibernate for database access, and JSP/JSF for the pages? It is a drag when you are programming one part of ...
Yes, there are several tools and frameworks in the Java ecosystem that can provide functionality similar to Ruby on Rails' scaffolding for quickly generating CRUD interfaces and populating databases. Here are a few options you can consider: 1. **JHipster**: JHipster is a development platform that can generate Spring B...
26,697
[ { "from": "human", "value": "Do you know of any tool that would do like Ruby on Rails' Scaffolding (create simple CRUD pages for any particular class to allow quickly populating a database with dummy data), only which used Java classes with Hibernate for database access, and JSP/JSF for the pages?\nIt is a ...
What's the best method of displaying report data in a chart format in an Access 2003 ADP project? I know this can be done in normal MDBs but this seems to use a Jet Crosstab query behind the scenes and this is not available in the ADP. I've experimented with the Office 11 Chart control but this seems a bit hit and miss...
In Access 2003 ADP projects, displaying report data in a chart format can indeed be more challenging than in MDBs because of the differences in how data is handled. While you can't use the Jet Crosstab queries in ADP, you have several options to work with charts effectively: ### Options for Charting in ADP Projects 1...
28,132
[ { "from": "human", "value": "What's the best method of displaying report data in a chart format in an Access 2003 ADP project? I know this can be done in normal MDBs but this seems to use a Jet Crosstab query behind the scenes and this is not available in the ADP. I've experimented with the Office 11 Chart ...
I have stumbled into several methods of looping in JavaScript, what I like the most is: for(var i = 0; i < a.length; i++){ var element = a[i]; } But as tested here (http://www.robertnyman.com/2008/04/11/javascript-loop-performance/), it should probably be written so that the length is only calculated once. In jQu...
You're correct that in traditional JavaScript, the `for` loop you've mentioned can be improved for performance by caching the length of the array, especially if the array is large. Here’s an optimized version of your loop: ```javascript for (var i = 0, len = a.length; i < len; i++) { var element = a[i]; // Do ...
28,557
[ { "from": "human", "value": "I have stumbled into several methods of looping in JavaScript, what I like the most is:\nfor(var i = 0; i < a.length; i++){\n var element = a[i];\n}\n\nBut as tested here (http://www.robertnyman.com/2008/04/11/javascript-loop-performance/), it should probably be written so th...
There was no endpoint listening at http;//localhost:8080/xdxservice/xdsrepository that could accept the message. This is often caused by an incorrect address or SOAP action.
The error message you are encountering indicates that there is a problem with the service endpoint you are trying to access. Here are some steps to troubleshoot and resolve the issue: 1. **Check the URL**: - Ensure that the URL is correct. The URL you've provided has a typo: "http;//" should be "http://". - The ...
29,233
[ { "from": "human", "value": "There was no endpoint listening at http;//localhost:8080/xdxservice/xdsrepository that could accept the message. This is often caused by an incorrect address or SOAP action. \n" }, { "from": "gpt", "value": "The error message you are encountering indicates that there...
I can't seem to find the _findfirst / findfirst, _findnext / findnext API on gcc for Linux, and would actually rather use the Standard Template Library (STL) for that if it is included there. Does anyone know what API there is available for listing files in a directory under Linux for C++ (gcc)?
In C++, if you're using GCC on Linux and want to list files in a directory, you can use the facilities provided by the C++ standard library, specifically the filesystem library introduced in C++17. This library makes it easy to perform operations on files and directories. Here’s a simple example of how to list all fil...
24,616
[ { "from": "human", "value": "I can't seem to find the _findfirst / findfirst, _findnext / findnext API on gcc for Linux, and would actually rather use the Standard Template Library (STL) for that if it is included there.\nDoes anyone know what API there is available for listing files in a directory under Li...
Is there any way of batch renaming files in sub directories? For example: Rename *.html to *.htm in a folder which has directories and sub directories.
Yes, you can batch rename files in subdirectories using various methods depending on your operating system. Below are methods for Windows, macOS, and Linux. ### Windows You can use PowerShell to rename files in subdirectories: 1. Open PowerShell. 2. Navigate to the parent directory where you want to start the rename...
27,966
[ { "from": "human", "value": "Is there any way of batch renaming files in sub directories?\nFor example:\nRename *.html to *.htm in a folder which has directories and sub directories.\n" }, { "from": "gpt", "value": "Yes, you can batch rename files in subdirectories using various methods dependin...
I have implemented a YUI split button with a menu. The button with menu appears in a scrolling div between header and a footer divs. When exposing the menu near the footer div, the menu appears behind the div. I have tried positioning the footer div with a z-index of -1. I have tried positioning the div (within the ...
When dealing with issues related to `z-index` and the stacking context in CSS, it's important to understand how elements are rendered in relation to one another, especially when it comes to the position of elements and their stacking context. ### Potential Solutions 1. **Check Positioning**: Ensure that any parent el...
25,695
[ { "from": "human", "value": "I have implemented a YUI split button with a menu. The button with menu appears in a scrolling div between header and a footer divs. When exposing the menu near the footer div, the menu appears behind the div.\nI have tried positioning the footer div with a z-index of -1. I h...
I'm trying to configure my WAR project build to fail if the line or branch coverage is below given thresholds. I've been using the configuration provided on page 455 of the excellent book Java Power Tools, but with no success. Here's the relevant snippet of my project's Maven 2 POM: <build> ... <plugins> <plugin> ...
To enforce coverage thresholds using the Cobertura Maven Plugin, you need to make sure that the `check` goal is executed in the right phase and that it is configured correctly. It looks like your setup is close to what is needed, but there are a couple of adjustments that may help you achieve the desired behavior. 1. ...
28,301
[ { "from": "human", "value": "I'm trying to configure my WAR project build to fail if the line or branch coverage is below given thresholds. I've been using the configuration provided on page 455 of the excellent book Java Power Tools, but with no success. Here's the relevant snippet of my project's Maven 2 ...
A lot of my C# code follows this pattern: void foo(string param1, string param2, string param3) { try { // do something... } catch(Exception ex) { LogError(String.Format("Error in foo(param1={0}, param2={1}, param3={2}), exception={3}", param1, param2, param3, ex.Message)); } } ...
In C#, there isn't a built-in way to automatically obtain a key-value list of method parameters directly. However, you can achieve cleaner and more maintainable error logging in several ways. Here are a few approaches you can consider: ### 1. Use `nameof` and a Dictionary for Parameter Logging You can create a dictio...
27,073
[ { "from": "human", "value": "A lot of my C# code follows this pattern:\nvoid foo(string param1, string param2, string param3)\n{\n try\n {\n // do something...\n }\n catch(Exception ex)\n {\n LogError(String.Format(\"Error in foo(param1={0}, param2={1}, param3={2}), exception={...
Attempting to print out a list of values from 2 different variables that are aligned correctly. foreach finalList ($correctList $wrongList) printf "%20s%s\n" $finalList end This prints them out an they are aligned, but it's one after another. How would I have it go through each item in each list and THEN go to a new ...
To print two lists (one representing correct values and another representing incorrect values) in two columns with proper alignment, you need to iterate over both lists concurrently rather than using a nested loop. Here's how you can accomplish this in your script: Assuming you are using a shell like `tcsh`, you can u...
29,887
[ { "from": "human", "value": "Attempting to print out a list of values from 2 different variables that are aligned correctly.\nforeach finalList ($correctList $wrongList)\nprintf \"%20s%s\\n\" $finalList\nend\n\nThis prints them out an they are aligned, but it's one after another. How would I have it go thr...
The windows installed on my machine has the locale en_AU and that's what JasperReports uses. I already tried changing the locale of all users, including the Administrator but it still uses en_AU. How can I change that locale? Is it possible to change the REPORT_LOCALE parameter on my report?
Yes, you can change the locale in JasperReports by modifying the `REPORT_LOCALE` parameter directly within your report. Here’s how you can do it: 1. **Modify the Report Parameters**: Open your JasperReports report (.jrxml file) in a report designer (like Jaspersoft Studio or iReport). Then, look for the `REPORT_LOCALE...
25,581
[ { "from": "human", "value": "The windows installed on my machine has the locale en_AU and that's what JasperReports uses. I already tried changing the locale of all users, including the Administrator but it still uses en_AU.\nHow can I change that locale? Is it possible to change the REPORT_LOCALE parameter...
I'm involved in creating a web based business solution. The idea is that the customers will use it, get their business processes and information into one place and also receive added business value by inter-system communication. In short they will use it as a core tool in their daily work and will depend highly upon it...
Creating a secure web-based business solution involves careful planning and consideration of a variety of factors. Below, I'll address your questions and provide advice to help you build a robust, secure solution. ### Hosting Considerations 1. **Data Center Reliability**: Choose a reputable hosting provider with multi...
23,215
[ { "from": "human", "value": "I'm involved in creating a web based business solution. The idea is that the customers will use it, get their business processes and information into one place and also receive added business value by inter-system communication. In short they will use it as a core tool in their ...
I just noticed that java.beans.Introspector getBeanInfo does not pickup any superinterface's properties. Example: public interface Person { String getName(); } public interface Employee extends Person { int getSalary(); } Introspecting on Employee only yields salary even though name is inherited from Person. W...
The behavior you are observing with `java.beans.Introspector.getBeanInfo()` not picking up properties from superinterfaces is indeed by design. The `Introspector` class is primarily focused on the direct properties of a class, and it does not automatically traverse up the interface hierarchy to find inherited propertie...
29,731
[ { "from": "human", "value": "I just noticed that java.beans.Introspector getBeanInfo does not pickup any superinterface's properties. Example:\npublic interface Person {\n String getName();\n}\npublic interface Employee extends Person {\n int getSalary();\n}\n\nIntrospecting on Employee only yields sa...
Is there any built-in functionality for classical set operations on the java.util.Collection class? My specific implementation would be for ArrayList, but this sounds like something that should apply for all subclasses of Collection. I'm looking for something like: ArrayList<Integer> setA ... ArrayList<Integer> setB .....
You're correct in noting that the `java.util.Collection` interface does not provide built-in methods for performing classical set operations like intersection and subtraction (difference). The `Collection` interface is more general and includes structures that can contain duplicates, while the `Set` interface is specif...
27,286
[ { "from": "human", "value": "Is there any built-in functionality for classical set operations on the java.util.Collection class? My specific implementation would be for ArrayList, but this sounds like something that should apply for all subclasses of Collection. I'm looking for something like:\nArrayList<In...
Not sure if there is any Firefox add-on tool for checking JavaScript syntax, var declaration, or even pre-compiling available? I find out is very difficult to debug JavaScript in a web html page. I have to add some script there. When the scripts get very big or long, it stops working. Basically, there must be some bug...
Debugging JavaScript can indeed be a challenge, especially when dealing with large scripts. While Firebug was a popular tool, it has been discontinued and its features have been integrated into the Firefox Developer Tools. Here are some tools and methods that can help you debug JavaScript more effectively: ### 1. **Fi...
26,445
[ { "from": "human", "value": "Not sure if there is any Firefox add-on tool for checking JavaScript syntax, var declaration, or even pre-compiling available? \nI find out is very difficult to debug JavaScript in a web html page. I have to add some script there. When the scripts get very big or long, it stops ...
By which I mean this: Given the input set of numbers: 1,2,3,4,5 becomes "1-5". 1,2,3,5,7,9,10,11,12,14 becomes "1-3, 5, 7, 9-12, 14" This is the best I managed to come up with: [C#] Which feels a little sloppy to me, so the question is, is there somehow more readable and/or elegant solution to this? public static stri...
Your implementation of formatting a range of integers into a more readable string format is good, but it can be simplified for better readability and elegance. Below is a refactored version of your C# code that reduces complexity and improves readability: ```csharp using System; using System.Collections.Generic; using...
27,611
[ { "from": "human", "value": "By which I mean this:\nGiven the input set of numbers: \n1,2,3,4,5 becomes \"1-5\".\n1,2,3,5,7,9,10,11,12,14 becomes \"1-3, 5, 7, 9-12, 14\"\nThis is the best I managed to come up with: [C#]\nWhich feels a little sloppy to me, so the question is, is there somehow more readable a...
I am using Direct3D to display a number of I-sections used in steel construction. There could be hundreds of instances of these I-sections all over my scene. I could do this two ways: Using method A, I have fewer surfaces. However, with backface culling turned on, the surfaces will be visible from only one side. If ba...
Yes, you can indeed achieve the desired behavior without having to create separate triangle strips for each side of the plates. Here are several approaches to consider: ### 1. **Using Different Render States** While Direct3D does not natively support switching backface culling on a per-draw call basis, you can set the...
26,080
[ { "from": "human", "value": "I am using Direct3D to display a number of I-sections used in steel construction. There could be hundreds of instances of these I-sections all over my scene.\nI could do this two ways:\n\nUsing method A, I have fewer surfaces. However, with backface culling turned on, the surfac...
Is user profiles an appropriate place to store things like number of items per page in a custom grid user selected? (I you can store it in the view, but it won't be per user this way). My first though was to store these settings in user profiles, but there are problems with access permissions for programmatically creat...
Storing user-specific settings like "number of items per page in a custom grid" in user profiles is a common practice, but as you identified, it comes with challenges, particularly related to permissions and the need to manage those settings securely and efficiently. ### Alternative Approaches 1. **ASP.NET Profile Pr...
27,145
[ { "from": "human", "value": "Is user profiles an appropriate place to store things like number of items per page in a custom grid user selected? (I you can store it in the view, but it won't be per user this way).\nMy first though was to store these settings in user profiles, but there are problems with acc...
i tried the following svnadmin create svn_repos svn import my_first_proj file:///c:/svn_repos -m "initial import" svn checkout file:///c:/svn_repos and the command returned A svn_repos\trunk A svn_repos\trunk\Sample.txt.txt A svn_repos\branches A svn_repos\branches\my_pers_branch Checked out revision 1. ...
The issue you're encountering is likely due to the way you are checking out the repository. The commands you provided indicate that you're checking out directly from the repository root rather than specifying a path to a specific project structure. Here's a brief breakdown of the issue and how to resolve it: 1. **Re...
29,509
[ { "from": "human", "value": "i tried the following\n\nsvnadmin create svn_repos\nsvn import my_first_proj file:///c:/svn_repos -m \"initial import\"\nsvn checkout file:///c:/svn_repos\n\nand the command returned\nA svn_repos\\trunk\nA svn_repos\\trunk\\Sample.txt.txt\nA svn_repos\\branches\nA sv...
My style of coding includes the following idiom: class Derived : public Base { public : typedef Base super; // note that it could be hidden in // protected/private section, instead // Etc. } ; This enables me to use "super" as an alias to Base, for example, in constructo...
Your approach to using a `typedef` named `super` in C++ to provide a shorthand for the base class has both advantages and disadvantages. Here’s a breakdown of the questions you raised: ### 1. Is this use of `typedef super` common/rare/never seen in the code you work with? Using a `typedef` called `super` is relativel...
28,227
[ { "from": "human", "value": "My style of coding includes the following idiom:\nclass Derived : public Base\n{\n public :\n typedef Base super; // note that it could be hidden in\n // protected/private section, instead\n \n // Etc.\n} ;\n\nThis enables me to use \"su...
Whats the best 3D game engine available for java? I am looking for something that has a good set visual development tools. I have checked out the list available on wikipedia: http://en.wikipedia.org/wiki/List_of_game_engines But I can't figure out the tool set provided by each engine and which free java 3d engine has ...
When it comes to Java game engines with strong visual development tools for 3D game development, you have a few good options to consider. Here are some of the most notable ones: 1. **jMonkeyEngine**: - **Overview**: jMonkeyEngine is a powerful, open-source game engine designed specifically for Java. It is great for...
29,027
[ { "from": "human", "value": "Whats the best 3D game engine available for java? I am looking for something that has a good set visual development tools. I have checked out the list available on wikipedia:\nhttp://en.wikipedia.org/wiki/List_of_game_engines\nBut I can't figure out the tool set provided by eac...
I want to automate SVN adds using NAnt. I want to add to SVN all new files in a given directory. The NAnt script will successfully execute the add command, however it displays the Tortoise SVN add dialog and this is not acceptable because it will execute on a build server running CruiseControl. The build server is runn...
To automate SVN commands without invoking the TortoiseSVN GUI, you should use the command-line SVN client instead of TortoiseSVN. TortoiseSVN is primarily a GUI tool, and while it can be used in scripts, it is not designed for headless operation, such as in a build server environment. You can install the command-line ...
27,299
[ { "from": "human", "value": "I want to automate SVN adds using NAnt. I want to add to SVN all new files in a given directory. The NAnt script will successfully execute the add command, however it displays the Tortoise SVN add dialog and this is not acceptable because it will execute on a build server runnin...
How to dynamically bind data to <%Html.Dropdownlist.... in ASP.NET MVC?
In ASP.NET MVC, you can dynamically bind data to a dropdown list using the `Html.DropDownList` or `Html.DropDownListFor` helper methods. This involves creating a list of items, usually coming from a model or a database, and then passing that list to the dropdown in your view. Here’s a step-by-step guide on how to do t...
25,154
[ { "from": "human", "value": "How to dynamically bind data to <%Html.Dropdownlist.... in ASP.NET MVC?\n" }, { "from": "gpt", "value": "In ASP.NET MVC, you can dynamically bind data to a dropdown list using the `Html.DropDownList` or `Html.DropDownListFor` helper methods. This involves creating a ...
I am playing around with MVC and have started setting up an existing site we have built in standard .Net Forms. I am only including a JS file and as all the requests are being routed via .Net it is trying to compile it. It is the standard compilation error you would see with invalid c#: CS1012: Too many characters in c...
When you are transitioning from traditional ASP.NET Web Forms to an MVC architecture, it's important to ensure that your static client assets (like JavaScript, CSS, images, etc.) are not being processed by the ASP.NET runtime. The error you're encountering, which indicates that your JavaScript file is being treated as ...
27,914
[ { "from": "human", "value": "I am playing around with MVC and have started setting up an existing site we have built in standard .Net Forms.\nI am only including a JS file and as all the requests are being routed via .Net it is trying to compile it.\nIt is the standard compilation error you would see with i...
In Microsoft Oslo SDK CTP 2008 (using Intellipad) the following code compiles fine: module M { type T { Text : Text; } } while compiling the below code leads to the error "M0197: 'Text' cannot be used in a Type context" module M { type T { Text : Text; Value : Text; // error } ...
The issue you're encountering with the Microsoft Oslo SDK and the Intellipad is indeed related to how the Oslo language treats intrinsic types versus user-defined types in the context of field declarations. ### Explanation of Behavior 1. **Intrinsic Types vs. User-defined Types:** - The `Text` type is a built-in (...
27,739
[ { "from": "human", "value": "In Microsoft Oslo SDK CTP 2008 (using Intellipad) the following code compiles fine:\nmodule M {\n type T {\n Text : Text;\n }\n}\n\nwhile compiling the below code leads to the error \"M0197: 'Text' cannot be used in a Type context\"\nmodule M {\n type T {\n ...
How do I get the directory where the rakefile.rb is located? I want to use this as my root directory to locate everything off.
To get the directory where your `Rakefile` (or `rakefile.rb`) is located, you can use Ruby's built-in methods to determine the path of the current file. Here's how you can do it within your Rakefile: ```ruby # Get the directory where the Rakefile is located root_directory = File.dirname(__FILE__) # Output the root di...
30,767
[ { "from": "human", "value": "How do I get the directory where the rakefile.rb is located?\nI want to use this as my root directory to locate everything off.\n" }, { "from": "gpt", "value": "To get the directory where your `Rakefile` (or `rakefile.rb`) is located, you can use Ruby's built-in meth...
Lately I've been in the habit of assigning integer values to constants and simply using the constant name as a means of identifying its purpose. However, in some cases this has resulted in the need to write a function like typeToString($const) when a string representation is needed. Obviously this is inefficient and un...
When considering the two cases you've presented for managing user types in your code, there are several trade-offs to consider, including clarity, maintainability, performance, and standards compliance. Let's explore each case in more detail: ### Case 1: Using Integer Constants #### Pros: 1. **Performance**: Integer ...
25,121
[ { "from": "human", "value": "Lately I've been in the habit of assigning integer values to constants and simply using the constant name as a means of identifying its purpose. However, in some cases this has resulted in the need to write a function like typeToString($const) when a string representation is nee...
I got this logic in a control to create a correct url for an image. My control basically needs to diplay an image, but the src is actually a complex string based on different parameters pointing at an image-server. So we decided to to create a control MyImage derived from asp:Image - it works like a charm. Now i need t...
Your situation is a common one when customizing controls in ASP.NET. Let's analyze the options you've provided and evaluate them for your scenario. ### Option 1: Derive from `asp:ImageButton` While deriving `MyImage` from `asp:ImageButton` may seem straightforward, it does indeed mean that every instance of `MyImage` ...
28,710
[ { "from": "human", "value": "I got this logic in a control to create a correct url for an image. My control basically needs to diplay an image, but the src is actually a complex string based on different parameters pointing at an image-server.\nSo we decided to to create a control MyImage derived from asp:I...
I've been looking for a good PHP ORM tool to use, and I recently found a good ORM class in Kohana. It has a fairly good and simple ORM implementation. The problem is, the code is unreusable outside of the Kohana framework without a rewrite/refactor. It relies on the Kohana class loader and various framework loading str...
When refactoring the ORM implementation from the Kohana framework for reuse outside of it, there are several factors to consider to make it clean, maintainable, and easy to use for others: 1. **Package Organization**: - Yes, you should package the necessary files into a single directory or a well-organized structu...
26,558
[ { "from": "human", "value": "I've been looking for a good PHP ORM tool to use, and I recently found a good ORM class in Kohana. It has a fairly good and simple ORM implementation. The problem is, the code is unreusable outside of the Kohana framework without a rewrite/refactor. It relies on the Kohana class...
I have a database full of small HTML documents and I need to programmatically insert several into, say, a PDF document with iText or a Word document with Aspose.Words. I need to preserve any formatting within the HTML documents (within reason, honouring <b> tags is a must, CSS like <span style="blah"> is a nice-to-have...
To handle the conversion of HTML to PDF using iText or to Word documents using Aspose.Words, you can use a combination of libraries to parse and convert the HTML content while preserving formatting. Here’s a step-by-step guide to approach this problem effectively: ### Step 1: Parse HTML You can use a library like **J...
25,118
[ { "from": "human", "value": "I have a database full of small HTML documents and I need to programmatically insert several into, say, a PDF document with iText or a Word document with Aspose.Words. I need to preserve any formatting within the HTML documents (within reason, honouring <b> tags is a must, CSS l...
I want to continuously sample from my PC's audio line in using C# (then process that data). What is the best way to do the sampling?
To continuously sample from your PC's audio line-in using C#, you can use the **NAudio** library, which is a popular audio library for .NET. NAudio provides a straightforward way to capture audio input and process it in real-time. Here’s how to set up audio line-in sampling with NAudio: 1. **Install NAudio**: You can...
22,547
[ { "from": "human", "value": "I want to continuously sample from my PC's audio line in using C# (then process that data). What is the best way to do the sampling?\n" }, { "from": "gpt", "value": "To continuously sample from your PC's audio line-in using C#, you can use the **NAudio** library, whi...
I am building a Flex Application that calls a .aspx page on the same webserver which builds a PDF report using SQL Reporting Services. When the report is built it prompts the user to open or save the PDF. We are trying to find a way to display a Progress Bar to let the user know that the report they requested is being ...
To achieve a progress indication while generating a PDF report in a Flex application that interacts with a .aspx page, you can follow a strategy that involves using asynchronous calls and managing the user interface accordingly. Since you mentioned you've already tried methods like opening a new window and using `XMLHt...
24,435
[ { "from": "human", "value": "I am building a Flex Application that calls a .aspx page on the same webserver which builds a PDF report using SQL Reporting Services. When the report is built it prompts the user to open or save the PDF.\nWe are trying to find a way to display a Progress Bar to let the user kno...
I work with a lot of web applications that are driven by databases of varying complexity on the backend. Typically, there's an ORM layer separate from the business and presentation logic. This makes unit-testing the business logic fairly straightforward; things can be implemented in discrete modules and any data needed...
Testing database-driven applications can indeed be challenging, especially when trying to balance the need for effective testing while avoiding pitfalls related to data consistency, maintainability, and the accuracy of tests. Here are some strategies that have worked well for various scenarios, along with some addition...
22,886
[ { "from": "human", "value": "I work with a lot of web applications that are driven by databases of varying complexity on the backend. Typically, there's an ORM layer separate from the business and presentation logic. This makes unit-testing the business logic fairly straightforward; things can be implemente...
I'm sure this is going to be a long shot, but I need help with a query involving QuickBooks Items. I need to query for all QuickBooks Items that are linked to an Income account. Is there an easy way to do this, or do I need to make 2 queries (one for items ans one for accounts) and then check the account reference? alb...
In QuickBooks, to query for all items linked to an Income account, you indeed typically need to use two queries. First, you need to identify which accounts are categorized as Income accounts, and then you can use those accounts to filter your item queries. Here's a step-by-step approach on how to achieve this: 1. **Q...
24,808
[ { "from": "human", "value": "I'm sure this is going to be a long shot, but I need help with a query involving QuickBooks Items.\nI need to query for all QuickBooks Items that are linked to an Income account. Is there an easy way to do this, or do I need to make 2 queries (one for items ans one for accounts)...
If you are using Java or JavaScript, is there a good way to do something like a String subtraction so that given two strings: org.company.project.component org.company.project.component.sub_component you just get: sub_component I know that I could just write code to walk the string comparing characters, but I was hop...
Certainly! In Java and JavaScript, you can achieve string subtraction or finding the diff between two strings in a fairly concise manner using built-in methods. Here's how you can approach it in both languages: ### Java Example In Java, you can use the `String` methods along with some additional logic to achieve this...
22,817
[ { "from": "human", "value": "If you are using Java or JavaScript, is there a good way to do something like a String subtraction so that given two strings:\norg.company.project.component\norg.company.project.component.sub_component\n\nyou just get:\nsub_component\n\nI know that I could just write code to wal...