instruction
stringlengths
14
27.6k
completion
stringlengths
3
38.3k
__original_row_idx
int64
0
50k
conversations
listlengths
2
2
I'm trying to decode the result of the Python os.wait() function. This returns, according to the Python docs: a tuple containing its pid and exit status indication: a 16-bit number, whose low byte is the signal number that killed the process, and whose high byte is the exit status (if the signal number is zero); the h...
To decode the exit status indication from the `os.wait()` function in Python, you can use bit manipulation to extract the high and low bytes from the integer status. In this case, you will want to extract: - The high byte to determine the exit status of the process. - The low byte to determine the signal number that k...
4,670
[ { "from": "human", "value": "I'm trying to decode the result of the Python os.wait() function. This returns, according to the Python docs:\n\na tuple containing its pid and exit status indication: a 16-bit number, whose low byte is the signal number that killed the process, and whose high byte is the exit s...
I've been using Linq to SQL for some time now and I find it to be really helpful and easy to use. With other ORM tools I've used in the past, the entity object filled from the database normally has a property indicating the length of the underlying data column in the database. This is helpful in databinding situations ...
Linq to SQL does not provide a built-in way to directly access the metadata of database columns (such as length constraints) via the entity objects it generates. However, you can access this information by querying the database schema directly using SQL or ADO.NET. Here's how you can accomplish that: ### Option 1: Usi...
3,228
[ { "from": "human", "value": "I've been using Linq to SQL for some time now and I find it to be really helpful and easy to use. With other ORM tools I've used in the past, the entity object filled from the database normally has a property indicating the length of the underlying data column in the database. T...
The printf function takes an argument type, such as %d or %i for a signed int. However, I don't see anything for a long value.
In C, the `printf` function does indeed support format specifiers for printing long integers. To print a `long` or `unsigned long`, you should use the following format specifiers: - For a `long int`, use `%ld`. - For an `unsigned long int`, use `%lu`. Here are some examples: ```c #include <stdio.h> int main() { ...
6,060
[ { "from": "human", "value": "The printf function takes an argument type, such as %d or %i for a signed int. However, I don't see anything for a long value.\n" }, { "from": "gpt", "value": "In C, the `printf` function does indeed support format specifiers for printing long integers. To print a `l...
In this question someone asked for ways to display disk usage in Linux. I'd like to take this one step further down the cli-path... how about a shell script that takes the output from something like a reasonable answer to the previous question and generates a graph/chart from it (output in a png file or something)? Thi...
Creating a shell script that displays disk usage and generates a graph from it can be done with a combination of command-line tools. Below, I'll provide you with a script that does this using `df` for disk usage, `awk` for processing the data, and `gnuplot` for generating a PNG graph. Make sure you have `gnuplot` inst...
4,484
[ { "from": "human", "value": "In this question someone asked for ways to display disk usage in Linux. I'd like to take this one step further down the cli-path... how about a shell script that takes the output from something like a reasonable answer to the previous question and generates a graph/chart from it...
Unit testing is, roughly speaking, testing bits of your code in isolation with test code. The immediate advantages that come to mind are: Running the tests becomes automate-able and repeatable You can test at a much more granular level than point-and-click testing via a GUI Rytmis My question is, what are the curre...
Unit testing is an essential practice in software development that ensures individual components of your code function as intended. The current best practices around unit testing involve the selection of appropriate tools and methodologies, as well as an understanding of when and where to incorporate unit testing into ...
1,933
[ { "from": "human", "value": "\nUnit testing is, roughly speaking, testing bits of your code in isolation with test code. The immediate advantages that come to mind are:\n\nRunning the tests becomes automate-able and repeatable\nYou can test at a much more granular level than point-and-click testing via a GU...
does anyone know of a macro or add-on for VS 2008 which reformats xml-comments? There has been this really smart CommentReflower for the older version of VS, but I couldn't find a release supporting VS 2008. Any ideas? Thanks in advance! Matthias
For Visual Studio 2008, there are a few options you can consider to reformat XML comments, even though specific tools like CommentReflower may not have direct support for that version. Here are some suggestions: 1. **XML Formatter Extensions**: While they might not be specifically for XML comments, you can look for an...
4,147
[ { "from": "human", "value": "does anyone know of a macro or add-on for VS 2008 which reformats xml-comments? There has been this really smart CommentReflower for the older version of VS, but I couldn't find a release supporting VS 2008.\nAny ideas? Thanks in advance!\nMatthias\n" }, { "from": "gpt",...
Does any know a good rule of thumb for the appropriate pagefile size for a Windows 2003 server running SQL Server?
When configuring the page file (also known as the swap file) on a Windows Server 2003 system running SQL Server, a common rule of thumb is to set the page file size to be 1.5 to 2 times the amount of physical RAM installed on the server. However, the ideal page file size can vary based on specific workloads and server ...
2,400
[ { "from": "human", "value": "Does any know a good rule of thumb for the appropriate pagefile size for a Windows 2003 server running SQL Server?\n" }, { "from": "gpt", "value": "When configuring the page file (also known as the swap file) on a Windows Server 2003 system running SQL Server, a comm...
I'm looking for a multiline regex that will match occurrences after a blank line. For example, given a sample email below, I'd like to match "From: Alex". ^From:\s*(.*)$ works to match any From line, but I want it to be restricted to lines in the body (anything after the first blank line). Received: from a server Da...
To create a multiline regex that matches occurrences of "From:" lines that appear after a blank line, you can make use of the `(?s)` flag (to enable dot-all mode) and look for a blank line before your desired pattern. Here's the regex that you can use: ```regex (?s)(?:\n\s*\n.*?\n)(From:\s*.*) ``` ### Explanation: -...
6,382
[ { "from": "human", "value": "I'm looking for a multiline regex that will match occurrences after a blank line. For example, given a sample email below, I'd like to match \"From: Alex\". ^From:\\s*(.*)$ works to match any From line, but I want it to be restricted to lines in the body (anything after the fi...
I got a webserver with a running application. There's a webpage with a form: some text data and a file upload field. Now, what I would like to have is it working like this: The file is sent to the dedicated server, diffrent then the one application is running on. The server should return some kind of path (or anything ...
To achieve the functionality you're looking for, where a file is uploaded to a different server from the one hosting your application, you can follow a multi-step approach that utilizes server-side handling for file uploads. Here's a suggested workflow to implement this: ### Step-by-Step Solution 1. **File Upload For...
2,383
[ { "from": "human", "value": "I got a webserver with a running application. There's a webpage with a form: some text data and a file upload field. Now, what I would like to have is it working like this:\nThe file is sent to the dedicated server, diffrent then the one application is running on. The server sho...
I have a few C# .dll projects which are common to many applications. Currently, I have one big repository. I have each DLL stored as a separate project within the repository and every application project stored as a project within the same repository. I recently switched to Subversion for source control and I fear tha...
When structuring a repository for a collection of C# .dll projects along with various application projects, it's important to strike a balance between organization, ease of use, and maintainability. Here are some common practices and considerations for structuring your repository effectively: ### 1. Repository Structu...
3,910
[ { "from": "human", "value": "I have a few C# .dll projects which are common to many applications. Currently, I have one big repository. I have each DLL stored as a separate project within the repository and every application project stored as a project within the same repository.\nI recently switched to Su...
Excel usually treats Conditional Formatting formulas as if they are array formulas, except when loading them from an Excel 2002/2003 XML Spreadsheet file. This is only an issue with the Excel 2002/2003 XML Spreadsheet format... the native Excel format works fine, as does the newer Excel 2007 XML format (xlsx). After l...
Thank you for sharing your detailed experience with this issue in Excel 2002/2003's handling of conditional formatting when using XML Spreadsheet files. It highlights the intricacies of Excel's behavior, especially regarding array formulas in conditional formatting. As you've noted, the problem seems to stem from how...
4,564
[ { "from": "human", "value": "Excel usually treats Conditional Formatting formulas as if they are array formulas, except when loading them from an Excel 2002/2003 XML Spreadsheet file.\nThis is only an issue with the Excel 2002/2003 XML Spreadsheet format... the native Excel format works fine, as does the n...
I've read some about .egg files and I've noticed them in my lib directory but what are the advantages/disadvantages of using then as a developer?
`.egg` files are a distribution format for Python packages, similar to the more modern `.whl` (wheel) files. They were part of the older setuptools framework and have some specific advantages and disadvantages. Here’s a breakdown to help you understand their role in Python development: ### Advantages of Using `.egg` F...
4,086
[ { "from": "human", "value": "I've read some about .egg files and I've noticed them in my lib directory but what are the advantages/disadvantages of using then as a developer?\n" }, { "from": "gpt", "value": "`.egg` files are a distribution format for Python packages, similar to the more modern `...
When an ASP.NET application errors out and generates the yellow-screen display, I'd like to create some kind of link from the error page which would jump directly to the correct line of code in Visual Studio. I'm not sure how to approach this, or if there are any tools already in existence which accomplish it - but I'd...
To achieve your goal of linking directly to the line of code in Visual Studio from the ASP.NET yellow screen error display, and to customize the error page across an entire web server, you can follow these approaches: ### Link to Visual Studio Code 1. **Use the `file://` URI Scheme**: You can generate a link that...
2,917
[ { "from": "human", "value": "When an ASP.NET application errors out and generates the yellow-screen display, I'd like to create some kind of link from the error page which would jump directly to the correct line of code in Visual Studio.\nI'm not sure how to approach this, or if there are any tools already ...
Does anyone know how many options a drop down list can have? Is it unlimited? How many before performance degrades?
The number of options a dropdown list can have is not strictly unlimited; it depends on several factors, including the platform or framework you're using, the performance of the device, and the user experience you want to achieve. ### General Guidelines: 1. **User Experience**: From a usability standpoint, dropdown l...
5,472
[ { "from": "human", "value": "Does anyone know how many options a drop down list can have? Is it unlimited? How many before performance degrades?\n" }, { "from": "gpt", "value": "The number of options a dropdown list can have is not strictly unlimited; it depends on several factors, including th...
As popular as Ruby and Rails are, it seems like this problem would already be solved. JRuby and mod_rails are all fine and dandy, but why isn't there an Apache mod for just straight Ruby?
The reason there isn't a dedicated Apache module for running straight Ruby, akin to how there are modules for languages like PHP (mod_php) or Python (mod_wsgi), primarily revolves around the architectural design and performance considerations of web applications. Here are a few key reasons: 1. **Concurrency and Threa...
5,544
[ { "from": "human", "value": "As popular as Ruby and Rails are, it seems like this problem would already be solved. JRuby and mod_rails are all fine and dandy, but why isn't there an Apache mod for just straight Ruby?\n" }, { "from": "gpt", "value": "The reason there isn't a dedicated Apache modu...
I'm a very experienced Java programmer who has spent my entire time working with Java 1.4 and earlier. Where can I find a quick reference that will give me everything I need to know about the new features in Java5 and later in a quick reference?
If you are transitioning from Java 1.4 to Java 5 (also known as Java 1.5) and later versions, you'll find that there are several new features and enhancements introduced. Here are some resources and topics to help you get up to speed quickly: ### Key Features in Java 5 and Later 1. **Generics**: Introduction of type ...
2,243
[ { "from": "human", "value": "I'm a very experienced Java programmer who has spent my entire time working with Java 1.4 and earlier. Where can I find a quick reference that will give me everything I need to know about the new features in Java5 and later in a quick reference?\n" }, { "from": "gpt", ...
How do I tokenize the string: "2+24*48/32" Into a list: ['2', '+', '24', '*', '48', '/', '32']
To tokenize the string `"2+24*48/32"` into a list of its components, you can use regular expressions in Python. Here’s a way to do that using the `re` module: ```python import re # Define the input string input_string = "2+24*48/32" # Use regex to find all numbers and operators tokens = re.findall(r'\d+|[+\-*/]', in...
7,638
[ { "from": "human", "value": "How do I tokenize the string:\n\"2+24*48/32\"\n\nInto a list:\n['2', '+', '24', '*', '48', '/', '32']\n\n" }, { "from": "gpt", "value": "To tokenize the string `\"2+24*48/32\"` into a list of its components, you can use regular expressions in Python. Here’s a way to ...
Joe Van Dyk asked the Ruby mailing list: Hi, In Ruby, I guess you can't marshal a lambda/proc object, right? Is that possible in lisp or other languages? What I was trying to do: l = lamda { ... } Bj.submit "/path/to/ruby/program", :stdin => Marshal.dump(l) So, I'm sending BackgroundJob a lambda object, which co...
Joe's question touches on a fundamental aspect of serialization in programming languages. In Ruby, `lambda` (or `Proc`) objects cannot be marshaled directly due to their closure behavior and the potential for capturing their execution context (like local variables). This means that when you try to serialize a `Proc` or...
4,739
[ { "from": "human", "value": "Joe Van Dyk asked the Ruby mailing list:\n\nHi,\nIn Ruby, I guess you can't marshal a lambda/proc object, right? Is\n that possible in lisp or other languages?\nWhat I was trying to do:\n\nl = lamda { ... }\nBj.submit \"/path/to/ruby/program\", :stdin => Marshal.dump(l)\n\n\nS...
I'm writing a web service, and I want to return the data as XHTML. Because it's data, not markup, I want to keep it very clean - no extra <div>s or <span>s. However, as a convenience to developers, I'd also like to make the returned data reasonably readable in a browser. To do so, I'm thinking a good way to go about it...
To achieve your desired layout where each label displays inline with its corresponding input field, you can utilize the `display: inline-block;` CSS property on the `<input>` elements as well as the labels for better control over their placement. Unfortunately, using `content` with pseudo-elements like `::after` won'...
5,112
[ { "from": "human", "value": "I'm writing a web service, and I want to return the data as XHTML. Because it's data, not markup, I want to keep it very clean - no extra <div>s or <span>s. However, as a convenience to developers, I'd also like to make the returned data reasonably readable in a browser. To do s...
I'm using jQuery and SimpleModal in an ASP.Net project to make some nice dialogs for a web app. Unfortunately, any buttons in a modal dialog can no longer execute their postbacks, which is not really acceptable. There is one source I've found with a workaround, but for the life of me I can't get it to work, mostly bec...
Using jQuery and SimpleModal can indeed interfere with the normal postback mechanism in ASP.NET web applications. This is mainly because the modal dialog can alter how events are handled in the DOM, preventing the default postback from occurring. Below are a few approaches you can take to restore postback functionality...
4,191
[ { "from": "human", "value": "I'm using jQuery and SimpleModal in an ASP.Net project to make some nice dialogs for a web app. Unfortunately, any buttons in a modal dialog can no longer execute their postbacks, which is not really acceptable.\nThere is one source I've found with a workaround, but for the lif...
I have a Person object with two constructors - one takes an int (personId), the other a string (logonName). I would like another constructor that takes a string (badgeNumber). I know this can't be done, but seems it might be a common situation. Is there a graceful way of handling this? I suppose this would apply to...
In scenarios where you want to add a new constructor to a class that already has multiple overloaded constructors, you can certainly do so without any problems, provided that each constructor has a unique signature. However, if you want to avoid code duplication or centralize your loading logic, you can use a common pr...
3,670
[ { "from": "human", "value": "I have a Person object with two constructors - one takes an int (personId), the other a string (logonName). I would like another constructor that takes a string (badgeNumber). I know this can't be done, but seems it might be a common situation. Is there a graceful way of hand...
I want to return StudentId to use elsewhere outside of the scope of the $.getJSON() j.getJSON(url, data, function(result) { var studentId = result.Something; }); //use studentId here I would imagine this has to do with scoping, but it doesn't seem to work the same way c# does
You're correct that the issue here is related to scoping and asynchronous operations in JavaScript. The `$.getJSON()` function is asynchronous, meaning that it does not block the execution of subsequent lines of code while it waits for the JSON data to be retrieved. As a result, any code that tries to use `studentId` o...
3,378
[ { "from": "human", "value": "I want to return StudentId to use elsewhere outside of the scope of the $.getJSON()\nj.getJSON(url, data, function(result)\n{\n var studentId = result.Something;\n});\n\n//use studentId here\n\nI would imagine this has to do with scoping, but it doesn't seem to work the same ...
In Javascript: How does one find the coordinates (x, y, height, width) of every link in a webpage?
To find the coordinates `(x, y, height, width)` of every link (`<a>` tags) in a webpage using JavaScript, you can iterate over all the links and use the `getBoundingClientRect()` method. This method provides information about the size of an element and its position relative to the viewport. Here's a simple example of ...
5,961
[ { "from": "human", "value": "In Javascript:\nHow does one find the coordinates (x, y, height, width) of every link in a webpage?\n" }, { "from": "gpt", "value": "To find the coordinates `(x, y, height, width)` of every link (`<a>` tags) in a webpage using JavaScript, you can iterate over all the...
In my DSL project I have a shape with a number of decorators that are linked to properties on my domain class. But even though ieach decorator has a DisplayName property (set to a meaningfull value) it does not appear in the generated DSL project. (I have not forgtten to use regenerate the t4 files.) Do I have to creat...
In Domain-Specific Language (DSL) projects, especially when using a visual designer, it’s not uncommon to encounter issues with decorators and their properties not displaying as expected in the generated code. Here are some steps you can take to resolve the issue of your `DisplayName` not appearing: 1. **Check Decora...
5,247
[ { "from": "human", "value": "In my DSL project I have a shape with a number of decorators that are linked to properties on my domain class. But even though ieach decorator has a DisplayName property (set to a meaningfull value) it does not appear in the generated DSL project. (I have not forgtten to use reg...
I am displaying a list of items using a SAP ABAP column tree model, basically a tree of folder and files, with columns. I want to load the sub-nodes of folders dynamically, so I'm using the EXPAND_NO_CHILDREN event which is firing correctly. Unfortunately, after I add the new nodes and items to the tree, the folder is ...
In your ABAP application, when you are dynamically adding nodes and items to your tree in response to the `EXPAND_NO_CHILDREN` event, it is important to ensure that the expanded state of the parent folder remains as it is after you add the new nodes. Typically, when nodes are added, the tree control may reset its view,...
4,271
[ { "from": "human", "value": "I am displaying a list of items using a SAP ABAP column tree model, basically a tree of folder and files, with columns.\nI want to load the sub-nodes of folders dynamically, so I'm using the EXPAND_NO_CHILDREN event which is firing correctly.\nUnfortunately, after I add the new ...
The documentation for the round() function states that you pass it a number, and the positions past the decimal to round. Thus it should do this: n = 5.59 round(n, 1) # 5.6 But, in actuality, good old floating point weirdness creeps in and you get: 5.5999999999999996 For the purposes of UI, I need to display 5.6. I p...
The behavior you're encountering is due to the way floating-point numbers are represented in computer memory. This can sometimes lead to unexpected results, especially when performing arithmetic operations or displaying numbers. To solve your issue and ensure that you display the number in the format you want, you hav...
5,418
[ { "from": "human", "value": "The documentation for the round() function states that you pass it a number, and the positions past the decimal to round. Thus it should do this:\nn = 5.59\nround(n, 1) # 5.6\n\nBut, in actuality, good old floating point weirdness creeps in and you get:\n5.5999999999999996\n\nFo...
I have a product, X, which we deliver to a client, C every month, including bugfixes, enhancements, new development etc.) Each month, I am asked to err "guarantee" the quality of the product. For this we use a number of statistics garnered from the tests that we do, such as: reopen rate (number of bugs reopened/number...
Estimating the number and type of bugs that remain in your software and ensuring quality in the face of limited testing resources is indeed a complex challenge. Here are some strategies and considerations that might help: ### 1. **Use Risk-Based Testing** - **Identify High-Risk Areas:** Focus on areas of the code t...
1,218
[ { "from": "human", "value": "I have a product, X, which we deliver to a client, C every month, including bugfixes, enhancements, new development etc.) Each month, I am asked to err \"guarantee\" the quality of the product.\nFor this we use a number of statistics garnered from the tests that we do, such as:\...
When attempting to call functions in math.h, I'm getting link errors like the following undefined reference to sqrt But I'm doing a #include <math.h> I'm using gcc and compiling as follows: gcc -Wall -D_GNU_SOURCE blah.c -o blah Why can't the linker find the definition for sqrt?
The reason you're encountering "undefined reference" errors for math functions like `sqrt` is because the math library (`libm`) is not being linked with your program. In GCC, the math library must be explicitly included in the linking stage. You can do this by adding `-lm` to your compile command. Here's how you shoul...
8,060
[ { "from": "human", "value": "When attempting to call functions in math.h, I'm getting link errors like the following \nundefined reference to sqrt\n\nBut I'm doing a #include <math.h>\nI'm using gcc and compiling as follows:\ngcc -Wall -D_GNU_SOURCE blah.c -o blah\n\nWhy can't the linker find the definitio...
I want to set something up so that if an Account within my app is disabled, I want all requests to be redirected to a "disabled" message. I've set this up in my ApplicationController: class ApplicationController < ActionController::Base before_filter :check_account def check_account redirect_to :controller => ...
To implement the desired functionality in your Rails application without encountering an infinite loop, you need to check if the current request is already for the "disabled" action in the "main" controller before performing the redirect. Since you mentioned that you're using Rails 2.1, you'll want to use instance me...
5,687
[ { "from": "human", "value": "I want to set something up so that if an Account within my app is disabled, I want all requests to be redirected to a \"disabled\" message.\nI've set this up in my ApplicationController:\nclass ApplicationController < ActionController::Base\n before_filter :check_account\n\n d...
Is there any IDE that simplifies creating Swing applications (ideally something along the lines of Visual Studio)
Yes, there are several Integrated Development Environments (IDEs) that can simplify the process of creating Swing applications in Java. Here are some of the most popular options: 1. **NetBeans**: - NetBeans provides a GUI builder called Matisse, which allows developers to drag and drop components to create Swing in...
5,159
[ { "from": "human", "value": "Is there any IDE that simplifies creating Swing applications (ideally something along the lines of Visual Studio)\n" }, { "from": "gpt", "value": "Yes, there are several Integrated Development Environments (IDEs) that can simplify the process of creating Swing applic...
I'm programming WCF using the ChannelFactory which expects a type in order to call the CreateChannel method. For example: IProxy proxy = ChannelFactory<IProxy>.CreateChannel(...); In my case I'm doing routing so I don't know what type my channel factory will be using. I can parse a message header to determine the typ...
In C#, you cannot create generic types dynamically at runtime in the way that you're trying to do with `List<t>`. However, you can achieve similar behavior using reflection. This is particularly useful in your WCF scenario where you need to work with types known only at runtime. Here are a couple of approaches to solv...
5,083
[ { "from": "human", "value": "I'm programming WCF using the ChannelFactory which expects a type in order to call the CreateChannel method. For example: \nIProxy proxy = ChannelFactory<IProxy>.CreateChannel(...);\n\nIn my case I'm doing routing so I don't know what type my channel factory will be using. I can...
Is there is any way to change the datasource location for a report and all of it's subreports without having to open each of them manually?
Yes, there are ways to change the data source location for a report and all of its subreports without manually opening each one, especially if you're using reporting tools like SQL Server Reporting Services (SSRS) or similar report generation software. Here are some general approaches: ### Using SSRS 1. **Shared Data ...
3,476
[ { "from": "human", "value": "Is there is any way to change the datasource location for a report and all of it's subreports without having to open each of them manually?\n" }, { "from": "gpt", "value": "Yes, there are ways to change the data source location for a report and all of its subreports ...
I'm looking at ways to embed PDF viewing in a Flex application. Currently the only option I've seen is by using the flash.html.HTMLLoader class, which only works if you're using AIR. This isn't a big deal -- I'm willing to use AIR if I have to -- but based on my experimentation with viewing a PDF this way it appears th...
Embedding a PDF viewer in a Flex application using AIR can indeed be a challenge if you want a minimalist approach without the standard Adobe controls. Here are a few options you might consider to achieve a more customized PDF viewing experience: ### 1. **Using PDF.js** PDF.js is a popular open-source JavaScript libra...
3,195
[ { "from": "human", "value": "I'm looking at ways to embed PDF viewing in a Flex application.\nCurrently the only option I've seen is by using the flash.html.HTMLLoader class, which only works if you're using AIR. This isn't a big deal -- I'm willing to use AIR if I have to -- but based on my experimentation...
Has anyone integrated an "Open in Google Docs" in their web app yet? Gmail has this for opening attachments. How about any other sightings of this in a non-google web app?
Yes, several web applications have integrated the "Open in Google Docs" functionality, allowing users to open and edit documents directly in Google Docs from their platforms. Here are some examples of types of applications where this integration is commonly found: 1. **Document Management Systems**: Many document mana...
6,139
[ { "from": "human", "value": "Has anyone integrated an \"Open in Google Docs\" in their web app yet? Gmail has this for opening attachments. How about any other sightings of this in a non-google web app?\n" }, { "from": "gpt", "value": "Yes, several web applications have integrated the \"Open in ...
I have a custom installer action that updates the PATH environment, and creates an additional environment variable. Appending a directory to the existing path variable is working fine, but for some reason my attempts to create a new environment variable have been unsuccessful. The code I am using is: using (Reg...
When working with environment variables in Windows, especially in a 32-bit XP environment, there are a few common pitfalls that can lead to issues like the one you are experiencing. Here's a checklist and some steps to ensure that your code successfully creates the environment variable. 1. **Check Permissions**: Ensur...
4,758
[ { "from": "human", "value": "I have a custom installer action that updates the PATH environment, and creates an additional environment variable. Appending a directory to the existing path variable is working fine, but for some reason my attempts to create a new environment variable have been unsuccessful. T...
I would like to know which dependency described in my pom.xml brings a transitive dependency in my target directory. To be more precise, I have the library "poi-2.5.1-final-20040804.jar" in my WEB-INF/lib directory and I would like to know which dependency in my pom.xml brings that.
To determine which dependency in your `pom.xml` brings in the transitive dependency for the library "poi-2.5.1-final-20040804.jar" (or any other dependency), you can use the following methods: ### Method 1: Maven Dependency Plugin 1. **Using the Maven Dependency Plugin**: This is a straightforward way to visualize th...
3,880
[ { "from": "human", "value": "I would like to know which dependency described in my pom.xml brings a transitive dependency in my target directory.\nTo be more precise, I have the library \"poi-2.5.1-final-20040804.jar\" in my WEB-INF/lib directory and I would like to know which dependency in my pom.xml bring...
Why in this millennium should Python PEP-8 specify a maximum line length of 79 characters? Pretty much every code editor under the sun can handle longer lines. What to do with wrapping should be the choice of the content consumer, not the responsibility of the content creator. Are there any (legitimately) good reasons...
The 79-character line length guideline in PEP 8, Python's style guide, is indeed a topic of discussion among developers, particularly in the context of modern development environments that can easily accommodate longer lines. Here are some legitimate reasons for adhering to this guideline: 1. **Readability**: Shorter ...
5,188
[ { "from": "human", "value": "Why in this millennium should Python PEP-8 specify a maximum line length of 79 characters?\nPretty much every code editor under the sun can handle longer lines. What to do with wrapping should be the choice of the content consumer, not the responsibility of the content creator....
To make it short: hibernate doesn't support projections and query by example? I found this post: The code is this: User usr = new User(); usr.setCity = 'TEST'; getCurrentSession().createCriteria(User.class) .setProjection( Projections.distinct( Projections.projectionList() .add( Projections.property("name"), "name") .a...
Hibernate does support projections and Query by Example (QBE), but there are some nuances in how they can be used together, especially with the Criteria API. From the code snippet and description you've provided, it looks like you're trying to combine both a projection (to return specific fields) with an example query...
4,330
[ { "from": "human", "value": "To make it short: hibernate doesn't support projections and query by example? I found this post:\nThe code is this:\nUser usr = new User();\nusr.setCity = 'TEST';\ngetCurrentSession().createCriteria(User.class)\n.setProjection( Projections.distinct( Projections.projectionList()\...
I am having trouble with IE7. I have a header, which is an IMG. Under it I have a div that represents a menu, they have to be attached to each other without space in between. Both are 1000px width. In Opera and FireFox the header and the menu are neatly attached to each other. However, in IE7, there is a small space be...
The issue you're encountering with Internet Explorer 7 is likely due to its handling of inline elements and vertical alignment of images. By default, images are treated as inline elements, which can lead to extra spacing below them due to the baseline alignment. Here are a few potential solutions you can try to elimin...
1,331
[ { "from": "human", "value": "I am having trouble with IE7. I have a header, which is an IMG. Under it I have a div that represents a menu, they have to be attached to each other without space in between. Both are 1000px width. In Opera and FireFox the header and the menu are neatly attached to each other. H...
I understand that there are several ways to blend XNA and WPF within the same application. I find it enticing to use WPF for all GUI and HUD stuff in my XNA games. Does anyone have any practical experience on how well this approach works in real life using .NET 3.5 SP1 ? Any pitfalls (such as the "airspace problem")? A...
Blending XNA and WPF can indeed enhance the GUI and HUD experience in your games by leveraging the rich features of WPF for user interface elements. However, it also comes with its own set of challenges, particularly due to the differences in how XNA and WPF handle rendering and how they manage the application’s messag...
4,139
[ { "from": "human", "value": "I understand that there are several ways to blend XNA and WPF within the same application. I find it enticing to use WPF for all GUI and HUD stuff in my XNA games. Does anyone have any practical experience on how well this approach works in real life using .NET 3.5 SP1 ? Any pit...
Does any one know how the event handler manages the posted events? In my app i have two threads (guiThread and computationThread). After an exception is thrown I call postEvent(..) to an existing dialog. The Qt-Event-Handler holds this one back until the dialog is closed. Sorry my question is a bit cloudy. I will wri...
In Qt, event handling is primarily managed through the event loop and event dispatching system. Here’s a breakdown of how events are processed, particularly in the context of using `postEvent()`, threads, and dialogs: ### Qt Event Handling Basics 1. **Event Loop**: Qt applications typically run an event loop that wai...
4,514
[ { "from": "human", "value": "Does any one know how the event handler manages the posted events?\nIn my app i have two threads (guiThread and computationThread). After an exception is thrown I call postEvent(..) to an existing dialog. The Qt-Event-Handler holds this one back until the dialog is closed. \n\nS...
I use the VS2008 command prompt for builds, TFS access etc. and the cygwin prompt for grep, vi and unix-like tools. Is there any way I can 'import' the vcvars32.bat functionality into the cygwin environment so I can call "tfs checkout" from cygwin itself?
Yes, you can import the functionality of `vcvars32.bat` into your Cygwin environment to set up the necessary environment variables for using Visual Studio tools, including TFS commands, directly from Cygwin. Here's a step-by-step approach to achieve that: ### 1. Create a Wrapper Script You can create a shell script ...
3,397
[ { "from": "human", "value": "I use the VS2008 command prompt for builds, TFS access etc. and the cygwin prompt for grep, vi and unix-like tools. Is there any way I can 'import' the vcvars32.bat functionality into the cygwin environment so I can call \"tfs checkout\" from cygwin itself?\n" }, { "from...
Soooo, I am starting this new job soon where most of the code is legacy MFC. The end goal is to convert/rewrite to C#. I'm a little rusty with MFC so writing some code so I can try and spark my memory. Anyway, was wondering the best way to connect to a SS2005 database with MFC. Back in the day CDatabase via ODBC was th...
Connecting to a SQL Server 2005 database using MFC can still be done using ODBC with the `CDatabase` class, and this is a reliable method that has not changed significantly over the years. While there are alternative approaches, such as using ADO (ActiveX Data Objects), many developers find ODBC straightforward and fam...
794
[ { "from": "human", "value": "Soooo, I am starting this new job soon where most of the code is legacy MFC. The end goal is to convert/rewrite to C#.\nI'm a little rusty with MFC so writing some code so I can try and spark my memory.\nAnyway, was wondering the best way to connect to a SS2005 database with MFC...
Suppose you have two seperate ASP.NET Web Application projects that both need to use a common MasterPage. What's the best way to share the MasterPage across projects without having to duplicate code? Preferably without having to resort to source control or file system hacks.
To share a MasterPage across multiple ASP.NET Web Application projects without duplicating code, you can create a Class Library project (DLL) that contains the MasterPage, and then reference that library in your web application projects. Here’s a step-by-step guide on how to do this: ### Step 1: Create a Class Library...
2,482
[ { "from": "human", "value": "Suppose you have two seperate ASP.NET Web Application projects that both need to use a common MasterPage.\nWhat's the best way to share the MasterPage across projects without having to duplicate code? Preferably without having to resort to source control or file system hacks.\n...
I know WCF supports many WS-* protocols but WS-Eventing does seem to be listed. I do know that WCF has a pub/sub model, but is it WS-Eventing compliant?
Windows Communication Foundation (WCF) does provide support for various WS-* protocols, but it does not natively support WS-Eventing out of the box. WS-Eventing is a protocol used for enabling event notifications in a standardized way, and it is often associated with the WS-Management protocol. While WCF has a robust ...
7,304
[ { "from": "human", "value": "I know WCF supports many WS-* protocols but WS-Eventing does seem to be listed.\nI do know that WCF has a pub/sub model, but is it WS-Eventing compliant?\n" }, { "from": "gpt", "value": "Windows Communication Foundation (WCF) does provide support for various WS-* pro...
Lets say I have a loop in Bash: for foo in `some-command` do do-something $foo done do-something is cpu bound and I have a nice shiny 4 core processor. I'd like to be able to run up to 4 do-something's at once. The naive approach seems to be: for foo in `some-command` do do-something $foo & done This will run a...
To manage a fixed number of concurrent jobs in Bash, you can use a combination of a job control technique along with a wait command to ensure that you don't exceed a specified number of concurrent processes. Below is an example of how to implement this using a loop with a maximum of 4 concurrent `do-something` executio...
5,281
[ { "from": "human", "value": "Lets say I have a loop in Bash:\nfor foo in `some-command`\ndo\n do-something $foo\ndone\n\ndo-something is cpu bound and I have a nice shiny 4 core processor. I'd like to be able to run up to 4 do-something's at once.\nThe naive approach seems to be:\nfor foo in `some-command...
I need to empty an LDF file before sending to a colleague. How do I force SQL Server to truncate the log?
To truncate the log file (LDF) in SQL Server, you need to perform a series of steps. Truncating the transaction log is often necessary before you can safely detach the database or reduce the size of the log file. However, it's important to note that truncating the log means that the transaction log will no longer conta...
2,532
[ { "from": "human", "value": "I need to empty an LDF file before sending to a colleague. How do I force SQL Server to truncate the log?\n" }, { "from": "gpt", "value": "To truncate the log file (LDF) in SQL Server, you need to perform a series of steps. Truncating the transaction log is often ne...
What is the best method to get objects out of a BlockingQueue, in a concurrent program, without hitting a race condition? I'm currently doing the following and I'm not convinced it is the best method: BlockingQueue<Violation> vQueue; /* in the constructor I pass in a BlockingQueue object full of violations that need...
Your current approach of using `poll` with a timeout to retrieve objects from the `BlockingQueue` is a reasonable way to handle this scenario in a concurrent environment. The `BlockingQueue` interface is designed specifically to handle concurrency issues and provides thread-safe operations. Here's a breakdown of your ...
4,596
[ { "from": "human", "value": "What is the best method to get objects out of a BlockingQueue, in a concurrent program, without hitting a race condition? I'm currently doing the following and I'm not convinced it is the best method:\nBlockingQueue<Violation> vQueue;\n/* \nin the constructor I pass in a Blocki...
long, long ago in a galaxy far far away, You used to be able to toggle snapping in Flash with the ctrl key. Let's say you were dragging the end of a line very close to another object. You could very easily hold the ctrl key down to shut off the snapping and get it in there nice and close without the snap. At some p...
In more recent versions of Adobe Flash (now known as Adobe Animate), the ability to toggle snapping with a single key was indeed changed. As of the updates following the acquisition by Adobe, there is no longer a default single-key toggle for snapping like there was with the Ctrl key. However, you can toggle snapping ...
6,688
[ { "from": "human", "value": "long, long ago in a galaxy far far away, You used to be able to toggle snapping in Flash with the ctrl key. Let's say you were dragging the end of a line very close to another object. You could very easily hold the ctrl key down to shut off the snapping and get it in there ni...
I'm using the Infragistics grid and I'm having a difficult time using a drop-down list as the value selector for one of my columns. I tried reading the documentation but Infragistics' documentation is not so good. I've also taken a look at this discussion with no luck. What I'm doing so far: col.Type = ColumnType.DropD...
To ensure that your Infragistics grid properly displays a drop-down list in a column, there are a few key aspects you need to verify and consider. Based on the code snippet and description you provided, it appears you are on the right track, but let’s ensure everything is set up correctly. Here are some steps to follo...
1,458
[ { "from": "human", "value": "I'm using the Infragistics grid and I'm having a difficult time using a drop-down list as the value selector for one of my columns.\nI tried reading the documentation but Infragistics' documentation is not so good. I've also taken a look at this discussion with no luck.\nWhat I'...
I have an ActiveX control written using the MS ATL library and I am firing events via pDispatch->Invoke(..., DISPATCH_METHOD). The control will be used by a .NET client and my question is this - is the firing of the event a synchronous or asynchronous call? My concern is that, if synchronous, the application that han...
When you invoke an event in an ActiveX control using `pDispatch->Invoke(..., DISPATCH_METHOD)`, the call is synchronous. This means that the call will block until the event handler in the client application (in this case, the .NET client) has completed executing. This synchronous behavior can indeed lead to performanc...
4,298
[ { "from": "human", "value": "I have an ActiveX control written using the MS ATL library and I am firing events via pDispatch->Invoke(..., DISPATCH_METHOD). The control will be used by a .NET client and my question is this - is the firing of the event a synchronous or asynchronous call? My concern is that,...
I wish to know all the pros and cons about using these two methods. In particular the implications on web security. Thanks.
Certainly! To provide a thorough comparison and implications on web security, I need to know which two methods you are referring to. Could you please specify?
8,885
[ { "from": "human", "value": "I wish to know all the pros and cons about using these two methods. In particular the implications on web security.\nThanks.\n" }, { "from": "gpt", "value": "Certainly! To provide a thorough comparison and implications on web security, I need to know which two method...
Can anyone recommend a tool for quickly posting test messages onto a JMS queue? Description: The tool should allow the user to enter some data, perhaps an XML payload, and then submit it to a queue. I should be able to test consumer without producer.
There are several tools you can use to quickly post test messages onto a JMS (Java Message Service) queue. Here are a few recommendations: 1. **Apache ActiveMQ Web Console**: - If you're using ActiveMQ as your JMS provider, it has a web-based management console that allows you to send messages to queues. - You c...
4,613
[ { "from": "human", "value": "Can anyone recommend a tool for quickly posting test messages onto a JMS queue?\nDescription:\n\nThe tool should allow the user to enter some data, perhaps an XML\npayload, and then submit it to a queue.\nI should be able to test consumer without producer.\n\n" }, { "fro...
Is it possible (in Vb.Net 2005), without manually parsing the dataset table properties, to create the table and add it to the database? We have old versions of our program on some machines, which obviously has our old database, and we are looking for a way to detect if there is a missing table and then generate the tab...
In VB.NET 2005, while there's no built-in functionality that directly generates a database table from a DataSet schema without manually parsing the DataSet table properties, you can automate the process to some extent. Here's a general approach you can take to check for missing tables and create them based on your Data...
836
[ { "from": "human", "value": "Is it possible (in Vb.Net 2005), without manually parsing the dataset table properties, to create the table and add it to the database?\nWe have old versions of our program on some machines, which obviously has our old database, and we are looking for a way to detect if there is...
How do I write a clean implementation of the strategy pattern in Perl? I want to do it in a way that leverages Perl's features.
Implementing the Strategy Pattern in Perl can be elegantly done using its object-oriented capabilities and the flexibility of references. Below is a clean implementation of the Strategy Pattern in Perl that leverages these features. ### Overview of the Strategy Pattern The Strategy Pattern allows you to define a fami...
4,092
[ { "from": "human", "value": "How do I write a clean implementation of the strategy pattern in Perl? I want to do it in a way that leverages Perl's features.\n" }, { "from": "gpt", "value": "Implementing the Strategy Pattern in Perl can be elegantly done using its object-oriented capabilities and...
Basically I have some code to check a specific directory to see if an image is there and if so I want to assign a URL to the image to an ImageControl. if (System.IO.Directory.Exists(photosLocation)) { string[] files = System.IO.Directory.GetFiles(photosLocation, "*.jpg"); if (files.Length > 0) { // ...
To assign the URL of the first `.jpg` file found in a specific directory to an `ImageControl`, you can modify your code as follows. I will assume that you have an `ImageControl` named `imageControl` where you want to display the image. Here's how you could implement the logic: ```csharp using System; using System.IO; ...
5,858
[ { "from": "human", "value": "Basically I have some code to check a specific directory to see if an image is there and if so I want to assign a URL to the image to an ImageControl.\nif (System.IO.Directory.Exists(photosLocation))\n{\n string[] files = System.IO.Directory.GetFiles(photosLocation, \"*.jpg\"...
I am writing a DDL script to drop a number of tables but need to identify all dependencies for those tables first. Those dependencies include foreign key constraints, stored procedures, views, etc. Preferably, I want to programmatically script out dropping those dependencies using the system tables/views before droppin...
To script out the dropping of dependencies for tables in SQL Server, you can utilize system views to identify foreign key constraints, stored procedures, views, and any other objects that depend on the tables you're planning to drop. Below is an approach that you can take to identify and drop those dependencies program...
5,765
[ { "from": "human", "value": "I am writing a DDL script to drop a number of tables but need to identify all dependencies for those tables first. Those dependencies include foreign key constraints, stored procedures, views, etc. Preferably, I want to programmatically script out dropping those dependencies usi...
Can someone tell me how to get path geometry from a WPF FlowDocument object? Please note that I do not want to use FormattedText. Thanks.
To get the path geometry from a WPF `FlowDocument`, you can't directly extract geometries because a `FlowDocument` is primarily intended for rich text layout and doesn't expose a direct API to obtain path geometries. However, there is a workaround by rendering the text to a visual and extracting the geometry from there...
4,542
[ { "from": "human", "value": "Can someone tell me how to get path geometry from a WPF FlowDocument object? Please note that I do not want to use FormattedText. Thanks.\n" }, { "from": "gpt", "value": "To get the path geometry from a WPF `FlowDocument`, you can't directly extract geometries becaus...
I've got the task of displaying a web form to represent the properties in a .NET class. In WinForms, there's a pre-fab control named PropertyGrid that is a lot like what I need. I'm just looking for something to display a simple layout of property names next to an appropriate control like a textbox for strings or a d...
In ASP.NET, there isn't a built-in control that is exactly equivalent to WinForms' `PropertyGrid`. However, there are several options that you can consider to implement a similar functionality for displaying properties of a .NET class in a web form. ### Options to Consider: 1. **Custom User Control:** - You could...
2,684
[ { "from": "human", "value": "I've got the task of displaying a web form to represent the properties in a .NET class. In WinForms, there's a pre-fab control named PropertyGrid that is a lot like what I need. I'm just looking for something to display a simple layout of property names next to an appropriate ...
Even though I always strive for complete validation these days, I often wonder if it's a waste of time. If the code runs and it looks the same in all browsers (I use browsershots.org to verify) then do I need to take it any further or am I just being overly anal? What level do you hold your code to when you create it ...
Your concerns about code validation are shared by many developers, and finding the right balance between validation and practicality can indeed be challenging. Here are some thoughts regarding code validation for both personal and client projects: ### A) Code for Yourself When coding for yourself, you have the flexibi...
998
[ { "from": "human", "value": "Even though I always strive for complete validation these days, I often wonder if it's a waste of time. If the code runs and it looks the same in all browsers (I use browsershots.org to verify) then do I need to take it any further or am I just being overly anal?\nWhat level do...
I'm using a Java socket, connected to a server. If I send a HEADER http request, how can I measure the response time from the server? Must I use a provided java timer, or is there an easier way? I'm looking for a short answer, I don't want to use other protocols etc. Obviously do I neither want to have a solution that...
You can measure the response time of an HTTP request using `System.nanoTime()` or `System.currentTimeMillis()` in Java to track the time before and after the request. Here’s a short example: ```java import java.io.*; import java.net.Socket; public class HttpClient { public static void main(String[] args) { ...
5,907
[ { "from": "human", "value": "I'm using a Java socket, connected to a server. \nIf I send a HEADER http request, how can I measure the response time from the server? Must I use a provided java timer, or is there an easier way?\nI'm looking for a short answer, I don't want to use other protocols etc. Obviousl...
It seems like anything you can do with bytecode you can do just as easily and much faster in native code. In theory, you could even retain platform and language independence by distributing programs and libraries in bytecode then compiling to native code at installation, rather than JITing it. So in general, when would...
There are several scenarios in which executing bytecode instead of native code might be advantageous. Here are a few key reasons: 1. **Platform Independence**: Bytecode is typically designed to be platform-independent, allowing the same code to run on different systems without modification. This is especially useful f...
4,814
[ { "from": "human", "value": "It seems like anything you can do with bytecode you can do just as easily and much faster in native code. In theory, you could even retain platform and language independence by distributing programs and libraries in bytecode then compiling to native code at installation, rather ...
Current code opens up an Outlook Calendar database as follow: my $outlook = Win32::OLE->GetActiveObject('Outlook.Application') || Win32::OLE->new('Outlook.Application', 'Quit'); my $namespace = $outlook->GetNamespace("MAPI"); ## only fetch entries from Jan 1, 2007 onwards my $restrictDates = "[Start] >= '01/01/2007'"...
Your current code snippet is set up to interface with Microsoft Outlook using Win32::OLE in Perl. It retrieves the Outlook application and its MAPI namespace, and it contains a filter (`$restrictDates`) that only includes entries from January 1, 2007, onwards. If you want to proceed with fetching calendar entries and ...
4,995
[ { "from": "human", "value": "Current code opens up an Outlook Calendar database as follow:\nmy $outlook = Win32::OLE->GetActiveObject('Outlook.Application') || Win32::OLE->new('Outlook.Application', 'Quit');\n\nmy $namespace = $outlook->GetNamespace(\"MAPI\");\n\n## only fetch entries from Jan 1, 2007 onwar...
How do I save a jpg image to database and then load it in Delphi using FIBplus and TImage?
To save a JPEG image to a database and then load it in Delphi using FIBPlus and `TImage`, you need to follow a sequence of steps. This generally involves converting the image to a suitable format (usually a binary format) for storage in a database, storing it in a BLOB field, and then retrieving it for display. Here's...
3,467
[ { "from": "human", "value": "How do I save a jpg image to database and then load it in Delphi using FIBplus and TImage?\n" }, { "from": "gpt", "value": "To save a JPEG image to a database and then load it in Delphi using FIBPlus and `TImage`, you need to follow a sequence of steps. This generall...
Does anyone known of a a good reference for canonical CS problems? I'm thinking of things like "the sorting problem", "the bin packing problem", "the travailing salesman problem" and what not. edit: websites preferred
Sure! Here are some excellent websites where you can find references and resources on canonical computer science problems: 1. **GeeksforGeeks**: - Offers a wide range of articles on various canonical CS problems, including explanations, algorithms, and solutions. - [GeeksforGeeks - Computer Science Problems](htt...
5,450
[ { "from": "human", "value": "Does anyone known of a a good reference for canonical CS problems?\nI'm thinking of things like \"the sorting problem\", \"the bin packing problem\", \"the travailing salesman problem\" and what not.\nedit: websites preferred\n" }, { "from": "gpt", "value": "Sure! He...
What does "Client-only Framework subset" in Visual Studio 2008 do?
In Visual Studio 2008, the term "Client-only Framework subset" refers to a specific set of functionalities within the .NET Framework that are intended for applications running on the client side, as opposed to those that might be running on a server. When developing applications, especially with a focus on Windows For...
6,019
[ { "from": "human", "value": "What does \"Client-only Framework subset\" in Visual Studio 2008 do?\n" }, { "from": "gpt", "value": "In Visual Studio 2008, the term \"Client-only Framework subset\" refers to a specific set of functionalities within the .NET Framework that are intended for applicat...
I need to dynamically create a Video object in ActionScript 2 and add it to a movie clip. In AS3 I just do this: var videoViewComp:UIComponent; // created elsewhere videoView = new Video(); videoView.width = 400; videoView.height = 400; this.videoViewComp.addChild(videoView); Unfortunately, I can't figure out ho...
In ActionScript 2, you can create a `Video` object and add it to a movie clip, but the approach differs from ActionScript 3. While the `Video` class in AS2 does not have a direct `addChild()` method, you can achieve your goal by using the `attachMovie()` method for MovieClips, and for the `Video` object, you can simply...
4,395
[ { "from": "human", "value": "I need to dynamically create a Video object in ActionScript 2 and add it to a movie clip. In AS3 I just do this:\nvar videoViewComp:UIComponent; // created elsewhere \n\nvideoView = new Video();\nvideoView.width = 400;\nvideoView.height = 400;\nthis.videoViewComp.addChild(vi...
I currently use nant, ccnet (cruise control), svn, mbunit. I use msbuild to do my sln build just because it was simpler to shell out. Are there any merits to switching my whole build script to MSBuild? I need to be able to run tests, watir style tests, xcopy deploy. Is this easier? Update: Any compelling features that...
Switching your entire build script from NAnt to MSBuild can have several merits, especially given your current setup and requirements. Here are some compelling reasons to consider making the shift, along with features of MSBuild that may be beneficial for your use case: ### 1. Integration with Visual Studio - **Native...
687
[ { "from": "human", "value": "I currently use nant, ccnet (cruise control), svn, mbunit. I use msbuild to do my sln build just because it was simpler to shell out. \nAre there any merits to switching my whole build script to MSBuild? I need to be able to run tests, watir style tests, xcopy deploy. Is this ea...
If you have an 68K application written using CodeWarrior for Palm OS, how do you assign individual functions to different segments without manually moving files around in the segment tab in the IDE?
To assign individual functions to different segments in a 68K application for Palm OS using CodeWarrior without manually moving files around in the segment tab of the IDE, you can utilize the `#pragma segment` directive in your code. This allows you to specify the segment for particular functions or sections of code di...
6,247
[ { "from": "human", "value": "If you have an 68K application written using CodeWarrior for Palm OS, how do you assign individual functions to different segments without manually moving files around in the segment tab in the IDE?\n" }, { "from": "gpt", "value": "To assign individual functions to d...
I've recently inherited an application that makes very heavy use of session, including storing a lot of custom data objects in session. One of my first points of business with this application was to at least move the session data away from InProc, and off load it to either a stateserver or SQL Server. After I made all...
When transitioning from InProc session state to a state server or SQL Server for session management, it's important to understand the implications of serialization and object identity. Here are some key points to consider regarding the `GetHashCode()` and `Equals()` methods in the context of your application: 1. **Ob...
4,747
[ { "from": "human", "value": "I've recently inherited an application that makes very heavy use of session, including storing a lot of custom data objects in session. One of my first points of business with this application was to at least move the session data away from InProc, and off load it to either a st...
In C# is there a shorthand way to write this: public static bool IsAllowed(int userID) { return (userID == Personnel.JohnDoe || userID == Personnel.JaneDoe ...); } Like: public static bool IsAllowed(int userID) { return (userID in Personnel.JohnDoe, Personnel.JaneDoe ...); } I know I could also use switch, bu...
In C#, there's no built-in shorthand syntax like `in` for checking if a value is contained within a set of values (like you might find in Python). However, you can achieve a cleaner and more concise code structure using the following approaches: ### 1. Using `HashSet<int>` or `List<int>` You can use a `HashSet<int>` o...
5,539
[ { "from": "human", "value": "In C# is there a shorthand way to write this:\npublic static bool IsAllowed(int userID)\n{\n return (userID == Personnel.JohnDoe || userID == Personnel.JaneDoe ...);\n}\n\nLike:\npublic static bool IsAllowed(int userID)\n{\n return (userID in Personnel.JohnDoe, Personnel.J...
In general, I occasionally have a chain of nested macros with a few preprocessor conditional elements in their definitions. These can be painful to debug since it's hard to directly see the actual code being executed. A while ago I vaguely remember finding a compiler (gcc) flag to expand them, but I had trouble gettin...
You're correct that debugging complex nested macros in C or C++ can be quite challenging. Fortunately, GCC provides a way to help with this by allowing you to see the expanded source code after preprocessing. You can use the `-E` flag with `gcc` to run the preprocessor only, which will show you the code after macro ex...
6,706
[ { "from": "human", "value": "In general, I occasionally have a chain of nested macros with a few preprocessor conditional elements in their definitions. These can be painful to debug since it's hard to directly see the actual code being executed.\nA while ago I vaguely remember finding a compiler (gcc) fla...
What are your opinions on developing for the command line first, then adding a GUI on after the fact by simply calling the command line methods? eg. W:\ todo AddTask "meeting with John, re: login peer review" "John's office" "2008-08-22" "14:00" loads todo.exe and calls a function called AddTask that does some val...
Your approach of developing a command-line interface (CLI) first and then building a graphical user interface (GUI) on top of it is generally considered a solid strategy in software development for several reasons: ### Advantages of CLI-First Development 1. **Simplicity and Focus**: Building the CLI first allows you ...
2,321
[ { "from": "human", "value": "What are your opinions on developing for the command line first, then adding a GUI on after the fact by simply calling the command line methods?\neg.\n\nW:\\ todo AddTask \"meeting with John, re: login peer review\" \"John's office\" \"2008-08-22\" \"14:00\" \n\nloads todo.exe...
I have been working with JXTA 2.3 for the last year or so for a peer-to-peer computing platform I am developing. I am migrating to JXTA 2.5 and in the process I am trying to clean up a lot of my use of JXTA. For the most part, I approached JXTA with a just make it work attitude. I used it to jumpstart creating and mana...
Migrating from JXTA 2.3 to 2.5 is a significant step, and taking advantage of the new features in JXTA 2.5, including the META-INF.services infrastructure, can enhance the flexibility and maintainability of your peer-to-peer application. ### Overview of META-INF.services in JXTA The META-INF.services mechanism in Jav...
2,556
[ { "from": "human", "value": "I have been working with JXTA 2.3 for the last year or so for a peer-to-peer computing platform I am developing. I am migrating to JXTA 2.5 and in the process I am trying to clean up a lot of my use of JXTA. For the most part, I approached JXTA with a just make it work attitude....
It's 2008, and I'm still torn on this one. So I'm developing a web method that needs a complex type passed into it and returned from it. The two options I'm toying with are: Pass and return actual business objects with both data and behavior. When wsdl.exe is run, it will automatically create proxy classes that con...
Your dilemma between using actual business objects versus Data Transfer Objects (DTOs) for your web method is a classic one, especially around the time of 2008 when web services were gaining popularity. Let's break down the pros and cons of each approach: ### Option 1: Pass and Return Business Objects **Pros:** - **R...
5,500
[ { "from": "human", "value": "It's 2008, and I'm still torn on this one. So I'm developing a web method that needs a complex type passed into it and returned from it. The two options I'm toying with are:\n\nPass and return actual business objects with both data and behavior. When wsdl.exe is run, it will ...
I need to display some interactive (attaching with DOM listeners etc. and event handling) vector graphics in web site I am working on. There is a W3C recommendation for SVG though this format is still not recognized by Internet Explorer support of which is a must (for a public website). IE handles VML though and there ...
Your requirements for displaying interactive vector graphics in a cross-browser manner while supporting older versions of Internet Explorer can indeed be challenging. Here’s a breakdown addressing your questions and concerns: ### Cross-Browser JavaScript Libraries for Vector Graphics: 1. **Raphael.js**: - **Descri...
2,270
[ { "from": "human", "value": "I need to display some interactive (attaching with DOM listeners etc. and event handling) vector graphics in web site I am working on. There is a W3C recommendation for SVG though this format is still not recognized by Internet Explorer support of which is a must (for a public w...
I'm looking for a good way to perform multi-row inserts into an Oracle 9 database. The following works in MySQL but doesn't seem to be supported in Oracle. INSERT INTO TMP_DIM_EXCH_RT (EXCH_WH_KEY, EXCH_NAT_KEY, EXCH_DATE, EXCH_RATE, FROM_CURCY_CD, TO_CURCY_CD, EXCH_EFF_DATE, EXCH_EFF_END_DATE, EXCH_LAS...
In Oracle, you cannot perform multi-row inserts using the `VALUES` clause in the same way that you can in MySQL. However, there are several ways to achieve similar functionality. Here are a few options: ### Option 1: Using Multiple `INSERT` Statements The simplest way is to use multiple `INSERT` statements. This is st...
640
[ { "from": "human", "value": "I'm looking for a good way to perform multi-row inserts into an Oracle 9 database. The following works in MySQL but doesn't seem to be supported in Oracle.\nINSERT INTO TMP_DIM_EXCH_RT \n(EXCH_WH_KEY, \n EXCH_NAT_KEY, \n EXCH_DATE, EXCH_RATE, \n FROM_CURCY_CD, \n TO_CURCY_CD, \...
Assuming there are 5 items in the settings file (MySetting1 to MySetting5), why does PropertyValues have 0 items while Properties has the correct number? Console.WriteLine( Properties.Settings.Default.PropertyValues.Count); // Displays 0 Console.WriteLine( Properties.Settings.Default.Properties.Count); // Displays...
In .NET's settings management, there's a key distinction between `Properties.Settings.Default.PropertyValues` and `Properties.Settings.Default.Properties`. 1. **Properties**: This property provides a collection of all the settings defined in your settings file, each represented as a `SettingProperty`. The count of thi...
5,340
[ { "from": "human", "value": "Assuming there are 5 items in the settings file (MySetting1 to MySetting5), why does PropertyValues have 0 items while Properties has the correct number? \nConsole.WriteLine( Properties.Settings.Default.PropertyValues.Count); // Displays 0\nConsole.WriteLine( Properties.Settings...
I'm starting a hobby game project on Windows that will make heavy use of 3D graphics effects. It will most likely be written in C++. Should I use OpenGL or Direct3D for my graphics backend? Why? Or should I use a ready-made graphics engine such as OGRE 3D? Which one? Some "how to get started" links would be useful. (On...
Choosing between OpenGL and Direct3D, or opting for a graphics engine like OGRE 3D, largely depends on your project requirements, your familiarity with the technologies, and the goals you want to achieve with your hobby game project. Below are some considerations for each option: ### OpenGL **Pros:** - **Cross-Platfor...
41
[ { "from": "human", "value": "I'm starting a hobby game project on Windows that will make heavy use of 3D graphics effects. It will most likely be written in C++.\nShould I use OpenGL or Direct3D for my graphics backend? Why?\nOr should I use a ready-made graphics engine such as OGRE 3D? Which one?\nSome \"h...
The only nice way I've found is: import sys import os try: os.kill(int(sys.argv[1]), 0) print "Running" except: print "Not running" (Source) But is this reliable? Does it work with every process and every distribution?
The approach you've shared uses the `os.kill()` function with the signal `0` to check if a process is running. This method is indeed a common technique in Unix-like systems, including Linux and macOS. Here's a breakdown of how it works and its reliability: 1. **Signal `0`**: The signal `0` is a special case in the `os...
5,227
[ { "from": "human", "value": "The only nice way I've found is:\nimport sys\nimport os\n\ntry:\n os.kill(int(sys.argv[1]), 0)\n print \"Running\"\nexcept:\n print \"Not running\"\n\n(Source)\nBut is this reliable? Does it work with every process and every distribution?\n" }, { "fr...
I would like my JSON output in Ruby on Rails to be "pretty" or nicely formatted. Right now, I call to_json and my JSON is all on one line. At times this can be difficult to see if there is a problem in the JSON output stream. Is there way to configure to make my JSON "pretty" or nicely formatted in Rails?
Yes, you can format JSON output to be pretty-printed in Ruby on Rails. The `to_json` method, by default, generates compact JSON output, but you can customize this behavior to generate nicely formatted JSON. Here are a couple of ways to achieve pretty-printed JSON in Rails: ### 1. Using `JSON.pretty_generate` You can...
4,744
[ { "from": "human", "value": "I would like my JSON output in Ruby on Rails to be \"pretty\" or nicely formatted. \nRight now, I call to_json and my JSON is all on one line. At times this can be difficult to see if there is a problem in the JSON output stream.\nIs there way to configure to make my JSON \"pre...
I'm in Quality Assurance and use Fisheye to track checkins to CVS. What other options do people use? We have tens of thousands of files and have plans for migrating to Team Foundation Server's code management tool 'at some point' When we do that, there will be lots of information that will be available.
In addition to Fisheye for tracking check-ins to CVS, there are several other tools and options that people in Quality Assurance and development teams commonly use for version control, code reviews, and tracking changes across different systems. Here are some alternatives: ### 1. **Git & GitHub/GitLab/Bitbucket** -...
4,126
[ { "from": "human", "value": "I'm in Quality Assurance and use Fisheye to track checkins to CVS. What other options do people use?\nWe have tens of thousands of files and have plans for migrating to Team Foundation Server's code management tool 'at some point' When we do that, there will be lots of informati...
I've been looking at ways to implement gmail-like messaging inside a browser, and arrived at the Comet concept. However, I haven't been able to find a good .NET implementation that allows me to do this within IIS (our application is written in ASP.NET 2.0). The solutions I found (or could think of, for that matter) re...
Implementing Comet (also known as long polling) in an ASP.NET environment, particularly in versions as old as ASP.NET 2.0, can indeed be challenging. The traditional model of handling requests in ASP.NET doesn't lend itself well to long-lived connections or maintaining threads for each user, primarily due to the limita...
4,533
[ { "from": "human", "value": "I've been looking at ways to implement gmail-like messaging inside a browser, and arrived at the Comet concept. However, I haven't been able to find a good .NET implementation that allows me to do this within IIS (our application is written in ASP.NET 2.0). \nThe solutions I fou...
So I'm embarking on an ASP.NET MVC project and while the experience has been a good one overall, I'm not quite as pleased with the spaghetti mess that my controllers have become. I've looked around online (CodeCampServer, etc...) and they all seem to suffer the same issue wherein controller methods violate SRP (single ...
It sounds like you're facing some common issues that many developers encounter when working with ASP.NET MVC. Here are some strategies to help you maintain clean, maintainable, and organized controller logic while adhering to principles like SRP: ### 1. **Separate Concerns with Services** Instead of having your contro...
837
[ { "from": "human", "value": "So I'm embarking on an ASP.NET MVC project and while the experience has been a good one overall, I'm not quite as pleased with the spaghetti mess that my controllers have become. I've looked around online (CodeCampServer, etc...) and they all seem to suffer the same issue wherei...
After I was convinced that labeled breaks/continues are a total "nono" over here, I need help to remove the label out of my code. I have a square matrix and a vector that has the same length. The vector has already some values in it an depending on the values in the matrix the vector is changed in the loop. I hope, the...
Absolutely! Using labeled breaks or continues can make your code harder to read and understand. You can refactor your code to avoid using labels by restructuring your loops and using flags to control the flow instead. Here's a version of your code without labeled breaks/continues: ```cpp for (int idx = 0; idx < vector...
5,135
[ { "from": "human", "value": "After I was convinced that labeled breaks/continues are a total \"nono\" over here, I need help to remove the label out of my code.\nI have a square matrix and a vector that has the same length. The vector has already some values in it an depending on the values in the matrix th...
What is the maximum bandwith I can handle with an USRP2?
The USRP2 (Universal Software Radio Peripheral 2) has a maximum bandwidth of approximately 20 MHz. This bandwidth can be affected by various factors, including the specific daughterboard being used, the sampling rate, and the signal processing being performed. The USRP2 can typically handle sampling rates of up to 50 M...
8,004
[ { "from": "human", "value": "What is the maximum bandwith I can handle with an USRP2?\n" }, { "from": "gpt", "value": "The USRP2 (Universal Software Radio Peripheral 2) has a maximum bandwidth of approximately 20 MHz. This bandwidth can be affected by various factors, including the specific daug...
I'm in the process of starting a User Group in my area related to .NET development. The format of the community will be the average free food, presentation, and then maybe free swag giveaway. What would you, as a member of a user community, look for in order to keep you coming back month to month?
Starting a user group is a fantastic way to foster community, learning, and networking among .NET developers! Here are some key elements to consider that can help ensure members keep coming back: ### Content & Learning Opportunities 1. **Relevant Topics:** Ensure the presentations cover a range of topics from beginner...
4,286
[ { "from": "human", "value": "I'm in the process of starting a User Group in my area related to .NET development. The format of the community will be the average free food, presentation, and then maybe free swag giveaway.\nWhat would you, as a member of a user community, look for in order to keep you coming...
Given the following XML: <current> <login_name>jd</login_name> </current> <people> <person> <first>John</first> <last>Doe</last> <login_name>jd</login_name> </preson> <person> <first>Pierre</first> <last>Spring</last> <login_name>ps</login_name> </preson> </people> How can I get "John...
It seems like there are a few issues with your current XSLT code and the provided XML structure, particularly with the way you are trying to match and retrieve data. First, I'll correct a couple of typos in your XML structure (for instance, `<preson>` should be `<person>`), and then I'll show you how to correctly retri...
3,371
[ { "from": "human", "value": "Given the following XML:\n<current>\n <login_name>jd</login_name>\n</current>\n<people>\n <person>\n <first>John</first>\n <last>Doe</last>\n <login_name>jd</login_name>\n </preson>\n <person>\n <first>Pierre</first>\n <last>Spring</last>\n <login_name>ps</...
At my university most of my classes have been in Java. I have also recently learned C# (and the Visual Studio environment) at a summer internship. Now I'm taking an Intro to Computer Graphics class and the grad student teaching the class prefers us to use C++ to access the OpenGL bindings via GLUT. Does anyone have a...
Transitioning from Java and C# to C++ can be a bit challenging, especially since C++ has its own paradigms and complexities, but it's definitely manageable with the right resources. Here are some key areas to focus on and resources that can help you make the transition smoother: ### Key Differences to Focus On: 1. **...
3,635
[ { "from": "human", "value": "At my university most of my classes have been in Java. I have also recently learned C# (and the Visual Studio environment) at a summer internship. Now I'm taking an Intro to Computer Graphics class and the grad student teaching the class prefers us to use C++ to access the Ope...
How do I find out which process is listening on a TCP or UDP port on Windows?
To find out which process is listening on a TCP or UDP port on a Windows machine, you can use several methods. Here are a couple of common approaches: ### Method 1: Using Command Prompt 1. **Open Command Prompt**: - Press `Win + R`, type `cmd`, and hit `Enter`. 2. **Use the `netstat` Command**: You can use the...
4,918
[ { "from": "human", "value": "How do I find out which process is listening on a TCP or UDP port on Windows?\n" }, { "from": "gpt", "value": "To find out which process is listening on a TCP or UDP port on a Windows machine, you can use several methods. Here are a couple of common approaches:\n\n##...
One of my favourite tools for linux is lsof - a real swiss army knife! Today I found myself wondering which programs on a WinXP system had a specific file open. Is there any equivalent utility to lsof? Additionally, the file in question was over a network share so I'm not sure if that complicates matters.
On Windows, there isn't a direct equivalent to `lsof`, but there are several tools you can use to find out which programs have a specific file open, even if it is located on a network share. ### Tools to Use: 1. **Handle**: - **Description**: This is a command-line utility from Microsoft's Sysinternals suite. It c...
4,276
[ { "from": "human", "value": "One of my favourite tools for linux is lsof - a real swiss army knife!\nToday I found myself wondering which programs on a WinXP system had a specific file open. Is there any equivalent utility to lsof? Additionally, the file in question was over a network share so I'm not sure ...
Is it possible in C# to have a Struct with a member variable which is a Class type? If so, where does the information get stored, on the Stack, the Heap, or both?
Yes, it is possible in C# to have a struct that contains a member variable of a class type. Structs in C# are value types, while classes are reference types. When a struct contains a class member, the struct itself is stored on the stack (if it is created as a local variable), and the class instance is stored on the he...
4,900
[ { "from": "human", "value": "Is it possible in C# to have a Struct with a member variable which is a Class type? If so, where does the information get stored, on the Stack, the Heap, or both?\n" }, { "from": "gpt", "value": "Yes, it is possible in C# to have a struct that contains a member vari...
The Setting: The program in question tries to post form data via an AJAX call to a target procedure contained in the same package as the caller. This is done for a site that uses a secure connection (HTTPS). The technology used here is PLSQL and the DOJO JavaScript library. The development tool is basically a text edit...
It sounds like you encountered a classic case of incompatibility between the way different browsers handle form submissions and AJAX requests, especially when it comes to parameter handling in JavaScript and server-side processing. ### Troubleshooting Techniques 1. **Check the Network Tab**: Use developer tools (if av...
3,431
[ { "from": "human", "value": "The Setting:\nThe program in question tries to post form data via an AJAX call to a target procedure contained in the same package as the caller. This is done for a site that uses a secure connection (HTTPS). The technology used here is PLSQL and the DOJO JavaScript library. The...
I am experiencing some oddities when working with a Grid component in flex, I have the following form that uses a grid to align the fields, as you can see, each GridRow has a border. My problem is that the border is still visible through GridItems that span multiple rows (observe the TextArea that spans 4 rows, the Gri...
It sounds like you're encountering a common issue with the visual layout of components in Flex, particularly when using a Grid with borders on the rows. When you have a `TextArea` (or other components) that spans multiple rows, it can disrupt the visual separation provided by the `GridRow` borders. Here are some potent...
4,360
[ { "from": "human", "value": "I am experiencing some oddities when working with a Grid component in flex, I have the following form that uses a grid to align the fields, as you can see, each GridRow has a border.\nMy problem is that the border is still visible through GridItems that span multiple rows (obser...
I've got a whole directory of dll's I need to register to the GAC. I'd like to avoid registering each file explicitly- but it appears that gacutil has no "register directory" option. Anyone have a fast/simple solution?
While `gacutil.exe` does not provide a direct way to register all DLLs in a directory in a single command, you can easily achieve this by using a simple script. Below are examples using both PowerShell and a batch file (CMD) to register all DLLs in a specified directory. ### PowerShell Script You can use a PowerShell...
2,571
[ { "from": "human", "value": "I've got a whole directory of dll's I need to register to the GAC. I'd like to avoid registering each file explicitly- but it appears that gacutil has no \"register directory\" option. Anyone have a fast/simple solution?\n" }, { "from": "gpt", "value": "While `gacuti...
So I came across an interesting problem today. We have a WCF web service that returns an IList. Not really a big deal until I wanted to sort it. Turns out the IList interface doesn't have a sort method built in. I ended up using the ArrayList.Adapter(list).Sort(new MyComparer()) method to solve the problem but it just...
Sorting an `IList` can indeed be a bit tricky since the `IList` interface does not provide a built-in `Sort` method. However, there are several elegant ways to handle this situation. Here are a few approaches you can consider: ### 1. Using LINQ If you have access to LINQ, you can use the `Cast<T>` method to convert th...
3,483
[ { "from": "human", "value": "So I came across an interesting problem today. We have a WCF web service that returns an IList. Not really a big deal until I wanted to sort it.\nTurns out the IList interface doesn't have a sort method built in. \nI ended up using the ArrayList.Adapter(list).Sort(new MyComparer...
While answering Static class variables in Python I noticed that PythonWin PyWin32 build 209.2 interpreter seems to evaluate twice? PythonWin 2.5 (r25:51908, Mar 9 2007, 17:40:28) [MSC v.1310 32 bit (Intel)] on win32. Portions Copyright 1994-2006 Mark Hammond - see 'Help/About PythonWin' for further copyright informat...
What you're observing is a behavior that can be attributed to the specific version of PythonWin you're using, which seems to evaluate or display the class variable in a manner that results in it appearing to append more than once. Let's break down what's happening in the code: ```python class X: l = [] d...
6,016
[ { "from": "human", "value": "While answering Static class variables in Python \nI noticed that PythonWin PyWin32 build 209.2 interpreter seems to evaluate twice?\nPythonWin 2.5 (r25:51908, Mar 9 2007, 17:40:28) [MSC v.1310 32 bit (Intel)] on win32.\nPortions Copyright 1994-2006 Mark Hammond - see 'Help/Abo...
Even though Python and Ruby have one kernel thread per interpreter thread, they have a global interpreter lock (GIL) that is used to protect potentially shared data structures, so this inhibits multi-processor execution. Even though the portions in those languajes that are written in C or C++ can be free-threaded, that...
Achieving concurrency and parallelism in languages like Python and Ruby, which are limited by the Global Interpreter Lock (GIL), requires careful consideration of architecture and design. Here are some effective strategies to bypass the limitations of the GIL and take advantage of multi-core processors: 1. **Multiproc...
5,105
[ { "from": "human", "value": "Even though Python and Ruby have one kernel thread per interpreter thread, they have a global interpreter lock (GIL) that is used to protect potentially shared data structures, so this inhibits multi-processor execution. Even though the portions in those languajes that are writt...
Is it good practice to delegate data validation entirely to the database engine constraints? Validating data from the application doesn't prevent invalid insertion from another software (possibly written in another language by another team). Using database constraints you reduce the points where you need to worry about...
The question of whether to delegate data validation entirely to database engine constraints is a nuanced one, and there are pros and cons to both approaches. Here are some key considerations: ### Pros of Relying on Database Constraints 1. **Centralized Validation**: Database constraints provide a single point of enfo...
5,213
[ { "from": "human", "value": "Is it good practice to delegate data validation entirely to the database engine constraints?\nValidating data from the application doesn't prevent invalid insertion from another software (possibly written in another language by another team). Using database constraints you reduc...
Say I have: <ul> <li id="x"> <a href="x">x</a> </li> <li id="y"> <a href="y">y</a> <ul> <li id="z"> <a href="z">z</a> </li> </ul> </li> </ul> I want to add a class value to all the list items that are the parents of z. So, I want...
You can achieve this with a combination of string replacement and regular expressions in a programming language that supports regex (such as Python, JavaScript, etc.). The goal is to modify the HTML structure so that the parent `<li>` of `z` (which is `y`) gets a class added to it. Here is an example of how you can do...
5,822
[ { "from": "human", "value": "Say I have:\n<ul>\n <li id=\"x\">\n <a href=\"x\">x</a>\n </li>\n\n <li id=\"y\">\n <a href=\"y\">y</a>\n\n <ul>\n <li id=\"z\">\n <a href=\"z\">z</a>\n </li>\n </ul>\n </li>\n</ul>\n\nI want to add a c...