instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
I've been trying to modify the following menu to make it look indentical in IE, Firefox, and Safari/Chrome but I can't seem to get it to look right in Safari/Chrome.
Could anyone tell me how to fix it? When viewed in Safari or Chrome, notice that the menu is ignoring the padding.
View flickr-like menu
Thanks in advanc... | To ensure a menu appears identical across different browsers like Internet Explorer, Firefox, Chrome, and Safari, you can follow several best practices related to CSS and HTML structure. Here are some steps you can take to troubleshoot and fix the issues you're experiencing with padding in Safari/Chrome:
### 1. Normal... | 24,576 | [
{
"from": "human",
"value": "I've been trying to modify the following menu to make it look indentical in IE, Firefox, and Safari/Chrome but I can't seem to get it to look right in Safari/Chrome.\nCould anyone tell me how to fix it? When viewed in Safari or Chrome, notice that the menu is ignoring the paddi... |
I've been writing PHP web applications for some time, and have come across very nice Javascript frameworks, such as JQuery, ExtJS, Scriptaculous, etc. I can't say the same about the PHP side - I always coded that part of the client-server dialog from scratch.
I've used CodeIgniter (http://codeigniter.com/) and it is ni... | There isn't a single, universal PHP library that directly integrates with JavaScript frameworks like jQuery or ExtJS for all the functionalities you mentioned, but there are several PHP frameworks and libraries that provide robust tools for handling AJAX, session management, input validation, and more. Here are some op... | 14,664 | [
{
"from": "human",
"value": "I've been writing PHP web applications for some time, and have come across very nice Javascript frameworks, such as JQuery, ExtJS, Scriptaculous, etc. I can't say the same about the PHP side - I always coded that part of the client-server dialog from scratch.\nI've used CodeIgni... |
I have been tinkering with BSP trees for a while now and am also playing with threads. When adding a triangle to a BSP tree, an opportunity arises to create a new thread for the purposes of processing data in parallel.
insert(triangle, bspnode)
{
....
else if(triangle spans bspnode)
{
(frontpiece, backpiece... | Using threads to parallelize operations in your BSP tree insertion algorithm is a common approach to improve performance, especially on multi-core processors. However, there are several important considerations and best practices you should keep in mind:
### 1. **Thread Creation Overhead**
Creating a new thread has a ... | 23,578 | [
{
"from": "human",
"value": "I have been tinkering with BSP trees for a while now and am also playing with threads. When adding a triangle to a BSP tree, an opportunity arises to create a new thread for the purposes of processing data in parallel.\n\ninsert(triangle, bspnode)\n{\n ....\n else if(triangle... |
<input type="submit"/>
<style>
input {
background: url(tick.png) bottom left no-repeat;
padding-left: 18px;
}
</style>
But the bevel goes away, how can I add an icon to submit button and keep the bevel?
Edit: I want it to look like the browser default.
| To add an icon to a submit button while preserving the browser's default button styling (including its bevel), you can achieve this by using a combination of CSS and a background image. Instead of applying the background directly to the `<input>` element, which may alter its default styles, you can use a wrapper elemen... | 23,235 | [
{
"from": "human",
"value": "<input type=\"submit\"/>\n\n<style>\ninput {\n background: url(tick.png) bottom left no-repeat;\n padding-left: 18px;\n}\n</style>\n\nBut the bevel goes away, how can I add an icon to submit button and keep the bevel?\nEdit: I want it to look like the browser default.\n"
},
... |
I'm involved in building a donation form for non-profits. We recently got hit by a fast round of low dollar submissions. Many were invalid cards, but a few went through. Obviously someone wrote a script to check a bunch of card numbers for validity, possibly so they can sell them later.
Any ideas on how to prevent or l... | It sounds like you're facing an issue with automated scripts attempting to validate credit card numbers via your donation form. Here are several strategies you can implement to help prevent or limit the impact of this kind of activity:
### 1. Rate Limiting
- **Implement Rate Limiting:** Use techniques to limit the num... | 24,803 | [
{
"from": "human",
"value": "I'm involved in building a donation form for non-profits. We recently got hit by a fast round of low dollar submissions. Many were invalid cards, but a few went through. Obviously someone wrote a script to check a bunch of card numbers for validity, possibly so they can sell the... |
I've made a custom DataGridViewCell that displays a custom control instead of the cell; but if the DataGridView uses shared rows, then the custom control instance is also shared, so you get strange behaviour (for example, hovering over buttons highlights all the buttons). Also, I can't access the DataGridViewCell.Sele... | In a standard WinForms `DataGridView`, row sharing is a fundamental feature to enhance performance, especially for large data sets. However, when you implement custom controls within `DataGridViewCell` or `DataGridViewRow`, this row sharing behavior can lead to unexpected results, such as the issues you described with ... | 23,124 | [
{
"from": "human",
"value": "I've made a custom DataGridViewCell that displays a custom control instead of the cell; but if the DataGridView uses shared rows, then the custom control instance is also shared, so you get strange behaviour (for example, hovering over buttons highlights all the buttons). Also,... |
This is baffling me, maybe somebody can shine the light of education on my ignorance. This is in a C# windows app. I am accessing the contents of a listbox from a thread. When I try to access it like thisprgAll.Maximum = lbFolders.SelectedItems.Count;
I get the error. However, here is the part I don't get. If I co... | The behavior you're encountering is related to how the Windows Forms (WinForms) handles cross-thread operations. In WinForms, controls are not thread-safe, meaning that accessing their properties or methods from a thread other than the one that created the control can lead to undefined behavior or exceptions.
In your ... | 25,435 | [
{
"from": "human",
"value": "This is baffling me, maybe somebody can shine the light of education on my ignorance. This is in a C# windows app. I am accessing the contents of a listbox from a thread. When I try to access it like thisprgAll.Maximum = lbFolders.SelectedItems.Count;\nI get the error. Howev... |
The WebBrowser control has a property called "IsWebBrowserContextMenuEnabled" that disables all ability to right-click on a web page and see a context menu. This is very close to what I want (I don't want anyone to be able to right-click and print, hit back, hit properties, view source, etc).
The only problem is this ... | To achieve the desired behavior of disabling the context menu for the `WebBrowser` control while still allowing the context menu for `TextBox` controls, you'll need to handle the `ContextMenuShowing` event of the web browser and provide your own logic to determine whether to suppress the context menu or not.
Here's ho... | 24,753 | [
{
"from": "human",
"value": "The WebBrowser control has a property called \"IsWebBrowserContextMenuEnabled\" that disables all ability to right-click on a web page and see a context menu. This is very close to what I want (I don't want anyone to be able to right-click and print, hit back, hit properties, v... |
We have different steps in our planning for online webprojects:
1) Information Architecture
Provides user stories
Provides wireframes
2) Design
Use Wireframes to develop a nice design
3) Development
4) Testing
I know that working agile asks for dedicated teams. But it is impossible to have a dedicted IA until the e... | Planning resources for multiple small projects and new initiatives can be challenging, especially when working in an agile environment where team members may need to collaborate across different projects. Here are some strategies you can consider to effectively plan resources:
### Resource Planning Strategies
1. **Cr... | 23,433 | [
{
"from": "human",
"value": "We have different steps in our planning for online webprojects:\n1) Information Architecture\n\nProvides user stories\nProvides wireframes\n\n2) Design\n\nUse Wireframes to develop a nice design\n\n3) Development\n4) Testing\nI know that working agile asks for dedicated teams. B... |
We are localizing our application and need to change the name displayed in the Start menu based on the current UI culture. We would like to do this using a Custom Action during the installation. We are using Windows Installer deployment projects and do not plan on using any third party deployment tools.
Thank you!
| To change the name displayed in the Start menu based on the current UI culture using a Custom Action in a Windows Installer deployment project, you can follow the steps below:
### Step 1: Create a Custom Action
1. **Create a new class library** that will contain your custom action. Ensure it is referenced in your pro... | 22,997 | [
{
"from": "human",
"value": "We are localizing our application and need to change the name displayed in the Start menu based on the current UI culture. We would like to do this using a Custom Action during the installation. We are using Windows Installer deployment projects and do not plan on using any th... |
Visual Studio gives many navigation hotkeys:
F8 for next item in current panel (search results, errors ...),
Control+K, N for bookmarks,
Alt+- for going back and more.
There is one hotkey that I can't find, and I can't even find the menu-command for it, so I can't create the hotkey myself.
I don't know if such exist: P... | In Visual Studio, there are indeed keyboard shortcuts for navigating through the call stack during debugging, but they might not be directly assigned by default. As of my last update, there are no built-in shortcuts specifically for moving to the next or previous call stack frame.
However, you can achieve this by crea... | 23,103 | [
{
"from": "human",
"value": "Visual Studio gives many navigation hotkeys:\nF8 for next item in current panel (search results, errors ...),\nControl+K, N for bookmarks,\nAlt+- for going back and more.\nThere is one hotkey that I can't find, and I can't even find the menu-command for it, so I can't create the... |
I have a grid that is binded to a collection. For some reason that I do not know, now when I do some action in the grid, the grid doesn't update.
Situation : When I click a button in the grid, it increase a value that is in the same line. When I click, I can debug and see the value increment but the value doesn't chang... | It sounds like you're facing an issue with data binding in your grid, particularly when dealing with cached data objects. Here are some potential reasons for the behavior you're experiencing and how to resolve it:
### Potential Issues and Solutions
1. **INotifyPropertyChanged Implementation**:
Make sure that the o... | 23,325 | [
{
"from": "human",
"value": "I have a grid that is binded to a collection. For some reason that I do not know, now when I do some action in the grid, the grid doesn't update.\nSituation : When I click a button in the grid, it increase a value that is in the same line. When I click, I can debug and see the v... |
so I'm using LinQ2SQL quite heavily in my current application, and although I have most stuff in partial classes, some things have to be adjusted in the VS Designer (like Accessors for fields I wrap). Then, sometimes I like to name Fields differently in the Model than they do in the DB.
So, my problem now is. When goin... | Unfortunately, the Visual Studio LINQ to SQL designer does not provide a built-in "refresh" functionality that allows you to seamlessly update the model with changes made to the underlying database schema without losing any custom properties or manual changes you've made in the designer.
However, there are a few worka... | 25,242 | [
{
"from": "human",
"value": "so I'm using LinQ2SQL quite heavily in my current application, and although I have most stuff in partial classes, some things have to be adjusted in the VS Designer (like Accessors for fields I wrap). Then, sometimes I like to name Fields differently in the Model than they do in... |
Maybe this is a dumb question, but I have the following behavior in Visual Studio 2005 while designing forms:
1 - Drop a control onto the form (suppose it's a Label, just for discussion)
2 - Drag that label to a specific location (aligning w/other controls, whatever)
3 - Release the mouse button
4 - The control is stil... | This issue you're experiencing with Visual Studio 2005 could be related to the environment in which you're running it. Here are a few potential solutions and workarounds that you can try to resolve the problem:
1. **Update Visual Studio**: Make sure you have the latest updates and service packs installed for Visual St... | 20,569 | [
{
"from": "human",
"value": "Maybe this is a dumb question, but I have the following behavior in Visual Studio 2005 while designing forms:\n1 - Drop a control onto the form (suppose it's a Label, just for discussion)\n2 - Drag that label to a specific location (aligning w/other controls, whatever)\n3 - Rele... |
I am using a library that has headers without the .h
This defeats visual studio's intellisense (declaration/definition lookup)
Anyone know how to tell VS2008 that a file is a header?
| In Visual Studio 2008, if you are dealing with header files that do not have the standard `.h` extension, you can still enable IntelliSense for those files by using a couple of methods:
### Method 1: Rename the Files Temporarily
If possible, you can temporarily rename the header files to have a `.h` extension. This is... | 22,728 | [
{
"from": "human",
"value": "I am using a library that has headers without the .h\nThis defeats visual studio's intellisense (declaration/definition lookup)\nAnyone know how to tell VS2008 that a file is a header?\n"
},
{
"from": "gpt",
"value": "In Visual Studio 2008, if you are dealing with he... |
How do you go about doing a daily build and striving for a zero-defect environment? Does it mean I never get to go home until I've killed all the bugs in my new code? Or does it mean I just don't check my code back in until I've fully tested it, which leaves the code effectively branched for a much longer time?
I'm wor... | Adopting a daily build process and striving for a zero-defect environment can significantly improve the quality and reliability of your software. However, it’s important to approach this systematically and pragmatically, especially as you transition to working with a larger team. Here are some strategies to consider:
... | 22,566 | [
{
"from": "human",
"value": "How do you go about doing a daily build and striving for a zero-defect environment? Does it mean I never get to go home until I've killed all the bugs in my new code? Or does it mean I just don't check my code back in until I've fully tested it, which leaves the code effectively... |
I want to deserialize an object but don't know the class up front. So, consider the following code...
IFormatter formatter = new BinaryFormatter();
Stream stream = new FileStream("MyFile.bin", FileMode.Open, FileAccess.Read, FileShare.Read);
MyObject obj = (MyObject)formatter.Deserialize(stream);
What could I do if I... | To handle deserialization when you don't know the specific type of the object in advance, you can take advantage of the fact that the serialized object often includes type information when using formats like binary serialization. In .NET, the `BinaryFormatter` includes type information, which allows you to deserialize ... | 24,399 | [
{
"from": "human",
"value": "I want to deserialize an object but don't know the class up front. So, consider the following code...\nIFormatter formatter = new BinaryFormatter();\nStream stream = new FileStream(\"MyFile.bin\", FileMode.Open, FileAccess.Read, FileShare.Read);\nMyObject obj = (MyObject)format... |
I am wondering - What's the most effective way of parsing something like:
{{HEADER}}
Hello my name is {{NAME}}
{{#CONTENT}}
This is the content ...
{{#PERSONS}}
<p>My name is {{NAME}}.</p>
{{/PERSONS}}
{{/CONTENT}}
{{FOOTER}}
Of course this is intended to be somewhat of a templating system i... | Creating a templating system that can handle nested and repeatable structures, as you've described, is a bit complex but entirely achievable. You can use a combination of string manipulation and recursive functions to parse and replace the placeholders in your template with data from your hashmap.
### Steps to Create ... | 21,099 | [
{
"from": "human",
"value": "I am wondering - What's the most effective way of parsing something like:\n{{HEADER}}\n\nHello my name is {{NAME}}\n\n{{#CONTENT}}\n This is the content ...\n\n {{#PERSONS}}\n\n <p>My name is {{NAME}}.</p>\n\n {{/PERSONS}}\n\n{{/CONTENT}}\n\n{{FOOTER}}\n\nOf cour... |
I have a JApplet which I contains various Swing components. It also starts a couple of extra threads in the init() and generally does other pretty standard applet-y things.
If I close the browser window containing the Applet, the JRE doesn't die (the icon remains in the system tray) until all the browser's windows hav... | When it comes to Java Applets and their lifecycle, it's important to understand how they interact with the browser and the Java Runtime Environment (JRE). In your case, you are observing that the JRE does not terminate immediately when you close the browser window containing your JApplet. This behavior can be influence... | 25,303 | [
{
"from": "human",
"value": "I have a JApplet which I contains various Swing components. It also starts a couple of extra threads in the init() and generally does other pretty standard applet-y things.\nIf I close the browser window containing the Applet, the JRE doesn't die (the icon remains in the system... |
I have an index on columns A, B, C, D of table T
I have a query that pulls from T with A, B, C in the WHERE clause.
Will the index be used or will a separate index be needed that only includes A, B, C?
| In most database systems, an index on columns A, B, C, and D can still be effectively used for queries that filter on just columns A, B, and C. Indexes generally work in a hierarchical manner, meaning that if a query uses the first few columns of a multi-column index, it can still utilize that index efficiently.
Here'... | 26,160 | [
{
"from": "human",
"value": "I have an index on columns A, B, C, D of table T\nI have a query that pulls from T with A, B, C in the WHERE clause.\nWill the index be used or will a separate index be needed that only includes A, B, C?\n"
},
{
"from": "gpt",
"value": "In most database systems, an i... |
Is there a way to programmatically create a compressed folder in Windows? I can't see a way to do this using the FileSystemObject (although there is the 'Compressed' attribute).
I've seen zip dll's but I'd prefer to avoid having to re-distribute a dll if possible. Windows XP natively supports compressed folders after a... | Yes, you can programmatically create a compressed folder in Windows without needing to redistribute any DLLs. Although the `FileSystemObject` in VBScript does not provide direct methods to create compressed folders, you can use the built-in capabilities of Windows using a script with the `Shell.Application` object.
He... | 18,448 | [
{
"from": "human",
"value": "Is there a way to programmatically create a compressed folder in Windows? I can't see a way to do this using the FileSystemObject (although there is the 'Compressed' attribute).\nI've seen zip dll's but I'd prefer to avoid having to re-distribute a dll if possible. Windows XP na... |
When you attempt to declare an unsigned variable in C#.NET with a value outside its value range it is flagged as a compiler error, but if you produce a negative value at runtime and assign it to that variable at runtime the value wraps.
uint z = -1; // Will not compile
uint a = 5;
uint b = 6;
uint c = a - b; // Will r... | In C#, the behavior you've observed regarding unsigned integers and their wrapping behavior is consistent with the design choices made in the language for performance, behavior consistency, and compatibility with the underlying hardware and other programming languages.
### Reasons for Wrap-Around Behavior
1. **Perfor... | 24,708 | [
{
"from": "human",
"value": "When you attempt to declare an unsigned variable in C#.NET with a value outside its value range it is flagged as a compiler error, but if you produce a negative value at runtime and assign it to that variable at runtime the value wraps.\nuint z = -1; // Will not compile\n\nuint ... |
How can dynamic Key-value pairs of objects be stored in app.config in using the application settings api, at runtime?
I've been trying to get my head around, and I can't find any meaningful example or documentation.
I seems that .Net dictionary classes can't be serialized in XML to store them in app.config
Is the only ... | Storing dynamic key-value pairs in `app.config` at runtime using the application settings API can be a bit challenging, especially when it comes to using .NET's built-in configuration management, as it does not directly support dictionaries or other complex data types out of the box. Here are some approaches to tackle ... | 18,471 | [
{
"from": "human",
"value": "How can dynamic Key-value pairs of objects be stored in app.config in using the application settings api, at runtime?\nI've been trying to get my head around, and I can't find any meaningful example or documentation.\nI seems that .Net dictionary classes can't be serialized in X... |
I work on an application that has a both a GUI (graphical) and API (scripting) interface. Our product has a very large installed base. Many customers have invested a lot of time and effort into writing scripts that use our product.
In all of our designs and implementation, we (understandably) have a very strict requi... | Balancing the conflicting needs of innovation and backwards compatibility is a common challenge in software development, especially for applications with a large and entrenched user base. Here are some strategies that can help manage this juggling act effectively:
1. **Versioning**: Consider implementing versioning fo... | 22,237 | [
{
"from": "human",
"value": "I work on an application that has a both a GUI (graphical) and API (scripting) interface. Our product has a very large installed base. Many customers have invested a lot of time and effort into writing scripts that use our product.\nIn all of our designs and implementation, we... |
What are the dangerous characters that should be replaced in user input when the users' input will be inserted in a MySQL query? I know about quotes, double quotes, \r and \n. Are there others?(I don't have the option of using a smart connector that accepts parameters so I have to build the query myself and this will b... | When constructing SQL queries by concatenating user input, it's crucial to avoid SQL injection vulnerabilities. While you've identified quotes, double quotes, `\r`, and `\n`, there are several other characters and considerations to keep in mind when sanitizing user input for MySQL:
### Dangerous Characters to Consider... | 23,390 | [
{
"from": "human",
"value": "What are the dangerous characters that should be replaced in user input when the users' input will be inserted in a MySQL query? I know about quotes, double quotes, \\r and \\n. Are there others?(I don't have the option of using a smart connector that accepts parameters so I hav... |
How does sharepoint identify a file type? For example, SharePoint will not allow you to upload executable files. Suppose if i rename a file extension from .exe to say, .doc, will the sharepoint allow the upload of this file?
| SharePoint uses a combination of file extension checks and content type settings to identify and manage file types. When you attempt to upload a file, SharePoint looks at the file's extension and compares it against a list of blocked file types configured in the SharePoint environment.
### Key Points:
1. **File Exten... | 27,429 | [
{
"from": "human",
"value": "How does sharepoint identify a file type? For example, SharePoint will not allow you to upload executable files. Suppose if i rename a file extension from .exe to say, .doc, will the sharepoint allow the upload of this file? \n"
},
{
"from": "gpt",
"value": "SharePoi... |
How do I add a new signature file in Microsofts Dynamics GP. I already have the signature scanned into a .bmp file. What do I need to do next?
| To add a new signature file in Microsoft Dynamics GP using a scanned BMP file, you need to follow these steps:
1. **Prepare Your BMP File**: Ensure that your BMP file is properly formatted. It should ideally be a 16-color or 256-color bitmap. Make sure the dimensions are suitable for a signature.
2. **Open Microsoft ... | 25,442 | [
{
"from": "human",
"value": "How do I add a new signature file in Microsofts Dynamics GP. I already have the signature scanned into a .bmp file. What do I need to do next?\n"
},
{
"from": "gpt",
"value": "To add a new signature file in Microsoft Dynamics GP using a scanned BMP file, you need t... |
I'm trying to build an in-game Tell A Friend form like in AppStore. Does anybody know if it can be found anywhere in the SDK? I wouldn't like to reinvent the sliced bread.
Thanks!
| While there isn't a specific "Tell A Friend" form built directly into the iOS SDK, you can create a similar feature using existing iOS capabilities. You can use the `UIActivityViewController` to allow users to share your app via various methods such as email, messages, or social media.
Here’s a basic way to implement ... | 26,541 | [
{
"from": "human",
"value": "I'm trying to build an in-game Tell A Friend form like in AppStore. Does anybody know if it can be found anywhere in the SDK? I wouldn't like to reinvent the sliced bread.\nThanks!\n"
},
{
"from": "gpt",
"value": "While there isn't a specific \"Tell A Friend\" form b... |
Can anyone give me some tips about how to read a Cumulative Flow Diagram. I'm not sure what kind of things its telling me.
| A Cumulative Flow Diagram (CFD) is a powerful visual tool used in Agile project management to track the progress of work items over time. It helps teams understand the flow of tasks through different stages of a process. Here are some tips on how to read and interpret a CFD:
### 1. **Understand the Axes**:
- **Hori... | 24,563 | [
{
"from": "human",
"value": "Can anyone give me some tips about how to read a Cumulative Flow Diagram. I'm not sure what kind of things its telling me.\n"
},
{
"from": "gpt",
"value": "A Cumulative Flow Diagram (CFD) is a powerful visual tool used in Agile project management to track the progres... |
I have this large C++ project that I need to build on a platform that does not have a parallel make (like make -j on Linux). The server has 6 CPU's and I want to do a parallel build manually.
I can generate a task list like this for about 300 object files. I use the Makefile for the dependency checks and incremental b... | You can achieve parallel execution of tasks in a KornShell (Ksh) script while limiting the number of concurrent tasks. Below is a sample Ksh script that uses a combination of background processes and a wait mechanism to ensure that no more than 6 tasks run concurrently.
Here is a simple implementation:
```ksh
#!/bin/... | 25,572 | [
{
"from": "human",
"value": "I have this large C++ project that I need to build on a platform that does not have a parallel make (like make -j on Linux). The server has 6 CPU's and I want to do a parallel build manually. \nI can generate a task list like this for about 300 object files. I use the Makefile f... |
I am trying to figure out the proper procedure for applying a new tsk based theme file in windows mobile 6.1.
I have tried working off of the page http://www.pocketpcdn.com/articles/changetodaytheme.html But this only changes the background, not the system colors for things such as the top and bottom bars on the screen... | Applying a TSK-based theme file on Windows Mobile 6.1 involves more than just changing the background; it also needs to update system colors, icons, and other UI elements. Here are steps to ensure that your TSK files are applied correctly:
### Basic Steps for Applying a TSK Theme:
1. **Create the TSK File:**
Ensur... | 24,910 | [
{
"from": "human",
"value": "I am trying to figure out the proper procedure for applying a new tsk based theme file in windows mobile 6.1.\nI have tried working off of the page http://www.pocketpcdn.com/articles/changetodaytheme.html But this only changes the background, not the system colors for things suc... |
I have a gridview containing some data from db, and after a check I want to see a small cross/tick image in each row, due to the result of the check.How can I change the image url dynamically?
| To dynamically change the image URL in a GridView based on certain conditions, you can handle this in your code-behind file. Below, I'll guide you through the process using ASP.NET Web Forms as an example.
### Step 1: Define your GridView in the ASPX file
In your ASPX file, you will define a GridView with a template ... | 23,364 | [
{
"from": "human",
"value": "I have a gridview containing some data from db, and after a check I want to see a small cross/tick image in each row, due to the result of the check.How can I change the image url dynamically? \n"
},
{
"from": "gpt",
"value": "To dynamically change the image URL in a... |
I know plenty about the different ways of handling parsing text for information. For parsing integers for example, what kind of performance can be expected. I am wondering if anyone knows of any good stats on this. I am looking for some real numbers from someone who has tested this.
Which of these offers the best perfo... | When comparing different methods for parsing integers in C# (or similar languages), performance can vary significantly depending on the specific approach used. Each method has its own advantages and trade-offs in terms of performance, error handling, and code clarity. Here’s a breakdown of the methods you mentioned alo... | 23,939 | [
{
"from": "human",
"value": "I know plenty about the different ways of handling parsing text for information. For parsing integers for example, what kind of performance can be expected. I am wondering if anyone knows of any good stats on this. I am looking for some real numbers from someone who has tested t... |
I couldn't figure out why NHibernate is doing this.
Here's part of my table in MS SQL
CREATE TABLE Person (
nameFamily text,
nameGiven text
)
Here's Person.hbm.xml
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
<class name="Infosci.Dpd.Model.Person,Infosci.Dpd.Model" table="Person" lazy="true">
<prop... | The behavior you are experiencing is due to the `ImprovedNamingStrategy` that you have set in your NHibernate configuration. This naming strategy automatically converts property names from C# PascalCase to snake_case for the corresponding database columns.
In your case, `NameFamily` becomes `name_family` and `NameGiv... | 23,473 | [
{
"from": "human",
"value": "I couldn't figure out why NHibernate is doing this. \nHere's part of my table in MS SQL\nCREATE TABLE Person ( \nnameFamily text,\nnameGiven text\n)\n\nHere's Person.hbm.xml\n<hibernate-mapping xmlns=\"urn:nhibernate-mapping-2.2\">\n\n <class name=\"Infosci.Dpd.Model.Person,In... |
I want to do some benchmarking of a C# process, but I don't want to use time as my vector - I want to count the number of IL instructions that get executed in a particular method call. Is this possible?
Edit I don't mean static analysis of a method body - I'm referring to the actual number of instructions that are exec... | Yes, counting the number of Intermediate Language (IL) instructions executed at runtime in a specific method call can be a bit challenging, but it is possible. You'll need to use some specialized tools or techniques to achieve this, as the .NET runtime does not provide direct support for counting IL instructions execut... | 22,317 | [
{
"from": "human",
"value": "I want to do some benchmarking of a C# process, but I don't want to use time as my vector - I want to count the number of IL instructions that get executed in a particular method call. Is this possible?\nEdit I don't mean static analysis of a method body - I'm referring to the a... |
I am writing a component that, given a ZIP file, needs to:
Unzip the file.
Find a specific dll among the unzipped files.
Load that dll through reflection and invoke a method on it.
I'd like to unit test this component.
I'm tempted to write code that deals directly with the file system:
void DoIt()
{
Zip.Unzip(the... | You're right to think critically about how to structure your code for testability while ensuring that your unit tests remain meaningful. This dilemma of balancing testability with code complexity is a common one.
### Key Concepts
1. **Separation of Concerns**: By using interfaces, you're allowing your main logic to f... | 20,943 | [
{
"from": "human",
"value": "\nI am writing a component that, given a ZIP file, needs to:\n\nUnzip the file.\nFind a specific dll among the unzipped files.\nLoad that dll through reflection and invoke a method on it.\n\nI'd like to unit test this component.\nI'm tempted to write code that deals directly wit... |
Sometimes you need to skip execution of part of a method under certain non-critical error conditions. You can use exceptions for that, but exceptions generally are not recommended in normal application logic, only for abnormal situations.
So I do a trick like this:
do
{
bool isGood = true;
.... some code
if(... | Using a "fake" loop like you've described can indeed be a clever trick to control flow in your method, but whether it's considered good or bad practice often depends on context and code readability. Here are some points to consider:
### Pros:
1. **Encapsulation of Logic**: It allows you to encapsulate a sequence of op... | 24,859 | [
{
"from": "human",
"value": "Sometimes you need to skip execution of part of a method under certain non-critical error conditions. You can use exceptions for that, but exceptions generally are not recommended in normal application logic, only for abnormal situations.\nSo I do a trick like this:\ndo\n{\n b... |
I've been trying to consider how Row Level Security could be implemented with the Entity Framework. The idea is to have a database agnostic means that would offer methods to restrict the rows coming from the ObjectContext.
Some of my inital ideas have involved modifying the partial classes created by the EDMGEN tool a... | Implementing Row Level Security (RLS) in Entity Framework in a database-agnostic manner can be a challenging task, especially since Entity Framework (EF) does not provide built-in support for RLS out of the box. However, you can design a comprehensive solution that abstracts the RLS concerns and integrates seamlessly w... | 14,316 | [
{
"from": "human",
"value": "I've been trying to consider how Row Level Security could be implemented with the Entity Framework. The idea is to have a database agnostic means that would offer methods to restrict the rows coming from the ObjectContext.\nSome of my inital ideas have involved modifying the pa... |
I'm working with an old Access database (yes, it's very ugly and I hate it). I need to modify some of the columns from a VB app that I'm creating. I have most the modifications setup correctly, but I'm fighting with the fact that modifying a column to text has it default to "Allow Zero Length" to false.
SO
ALTER TAB... | To modify a column in an Access database and set it to allow zero-length strings, you need to use a slightly different approach than standard SQL syntax. In Microsoft Access, setting "Allow Zero Length" isn't done using `NULL`, but rather through an option that is specific to Access.
To change the column definition, y... | 24,763 | [
{
"from": "human",
"value": "I'm working with an old Access database (yes, it's very ugly and I hate it). I need to modify some of the columns from a VB app that I'm creating. I have most the modifications setup correctly, but I'm fighting with the fact that modifying a column to text has it default to \"... |
I'm not quite sure if this is specific to Sun Java Systems Application Server but there are occasions where I run into a NoClassDefFoundError where the class in question, the one not found, is not mentioned in the error.
Does anyone know what conditions would lead to a NoClassDefFoundError being raised without specif... | A `NoClassDefFoundError` indicates that the Java Virtual Machine (JVM) found a class definition during compilation, but could not find the class at runtime. This can happen under various circumstances, and it's indeed possible to encounter this error without a specific class name being mentioned. Here are some common r... | 22,453 | [
{
"from": "human",
"value": "I'm not quite sure if this is specific to Sun Java Systems Application Server but there are occasions where I run into a NoClassDefFoundError where the class in question, the one not found, is not mentioned in the error. \nDoes anyone know what conditions would lead to a NoClas... |
For example, suppose I have a batch file called 'test.cmd' and it simply contains:
echo %1
I can call this directly from the command prompt with 'test.cmd some¬arg' and the result is that the string 'some¬arg' is printed.
However if I place that same call in a second batch file, called 'tester.cmd' for the sake of arg... | The behavior you're experiencing is likely due to how the command line interprets special characters and how batch files handle them. The character `¬` in your case may be causing issues due to encoding or how batch files parse arguments.
When you pass an argument like `some¬arg` through one batch file to another, the... | 26,946 | [
{
"from": "human",
"value": "For example, suppose I have a batch file called 'test.cmd' and it simply contains:\necho %1\n\nI can call this directly from the command prompt with 'test.cmd some¬arg' and the result is that the string 'some¬arg' is printed.\nHowever if I place that same call in a second batch ... |
What is the best pattern for instrumentation. I have an application and i want to be able to track metrics on everytime a users does a number of functions in the app (brings up a form, views a certain feature, etc) but i dont want to have code all over the application that is doing this instrumentation. what are my o... | Instrumenting an application to track user behavior without cluttering your codebase can be achieved through several design patterns and approaches. Below are some options to consider for achieving effective instrumentation in your application:
### 1. **Event-Driven Architecture**
- **Description**: Utilize an event-d... | 22,440 | [
{
"from": "human",
"value": "What is the best pattern for instrumentation. I have an application and i want to be able to track metrics on everytime a users does a number of functions in the app (brings up a form, views a certain feature, etc) but i dont want to have code all over the application that is d... |
I'm building up a library of filters for a validation class in PHP, some of them using regular expressions. I have a lot of filters in mind, but I also don't want to potentially miss any. What do you most often use regular expressions to check? What are some of the not-so-common things that you've had to check that wou... | When building a library of filters for validation in PHP using regular expressions, there are several common and not-so-common use cases you may want to consider:
### Common Validation Uses:
1. **Email Addresses**: Validating the format of email addresses.
2. **URLs**: Ensuring a string is a valid URL.
3. **Phone Num... | 25,014 | [
{
"from": "human",
"value": "I'm building up a library of filters for a validation class in PHP, some of them using regular expressions. I have a lot of filters in mind, but I also don't want to potentially miss any. What do you most often use regular expressions to check? What are some of the not-so-common... |
Is there any way to determine a removable drive speed in Windows without actually reading in a file. And if I do have to read in a file, how much needs to be read to get a semi accurate speed (e.g. determine whether a device is USB2 or USB1)?
EDIT: Just to clarify, USB2 and USB1 were an example. These could be Compac... | To determine the relative speed of a removable drive programmatically in Windows using C++, you can use several approaches. Given your requirements to assess the device speed without extensive file reading, you can consider utilizing the Windows Management Instrumentation (WMI) to get information about the drive.
###... | 16,495 | [
{
"from": "human",
"value": "Is there any way to determine a removable drive speed in Windows without actually reading in a file. And if I do have to read in a file, how much needs to be read to get a semi accurate speed (e.g. determine whether a device is USB2 or USB1)?\nEDIT: Just to clarify, USB2 and US... |
Sometimes whenever I write a program in Linux and it crashes due to a bug of some sort, it will become an uninterruptible process and continue running forever until I restart my computer (even if I log out). My questions are:
What causes a process to become uninterruptible?
How do I stop that from happening?
This is ... | Your questions are quite valid, and it's great that you're seeking to understand more about processes in Linux. Let’s address each of your questions:
### 1. What causes a process to become uninterruptible?
A process can become uninterruptible (often shown as `D` state in `ps` command output) when it is waiting for I/... | 23,316 | [
{
"from": "human",
"value": "Sometimes whenever I write a program in Linux and it crashes due to a bug of some sort, it will become an uninterruptible process and continue running forever until I restart my computer (even if I log out). My questions are:\n\nWhat causes a process to become uninterruptible?\... |
I've been considering experimenting with game development and XNA. I'm already an expert C/C++ programmer. I read through some C# books, but haven't done any development in C# yet.
What's a good resource for learning XNA, from the point of view of someone who's already an expert programmer?
| Since you’re already proficient in C/C++ and have some familiarity with C#, you can leverage that knowledge to get up to speed with XNA more efficiently. Here are some resources that can help you learn XNA from an advanced programmer's perspective:
1. **XNA Game Studio Documentation**: The official Microsoft documenta... | 16,061 | [
{
"from": "human",
"value": "I've been considering experimenting with game development and XNA. I'm already an expert C/C++ programmer. I read through some C# books, but haven't done any development in C# yet.\nWhat's a good resource for learning XNA, from the point of view of someone who's already an exp... |
I am using the code below to display all the files from a directory in a drop down menu. Does anyone know how to make this alphabetical? I presume it has something to do with the sort function, I just can't figure out how!
<?php
$dirname = "images/";
$images = scandir($dirname);
$dh = opendir($dirname);
while ($file =... | To display files in alphabetical order in your dropdown menu, you can use the `sort()` function on the array that holds your file names after filtering them. Below is the modified version of your code:
```php
<?php
$dirname = "images/";
$images = scandir($dirname);
$options = array();
// Read the files from the direc... | 27,355 | [
{
"from": "human",
"value": "I am using the code below to display all the files from a directory in a drop down menu. Does anyone know how to make this alphabetical? I presume it has something to do with the sort function, I just can't figure out how!\n<?php\n$dirname = \"images/\";\n$images = scandir($dirn... |
I've just had to write a string reverse function in C# 2.0 (i.e. LINQ not available) and came up with this:
public string Reverse(string text)
{
char[] cArray = text.ToCharArray();
string reverse = String.Empty;
for (int i = cArray.Length - 1; i > -1; i--)
{
reverse += cArray[i];
}
retur... | Your current implementation of the string reversal function in C# is functional but not very efficient, particularly because using the `+=` operator with strings creates a new string each time it's used, which leads to a lot of unnecessary memory allocations.
A more efficient approach would involve using a `StringBuil... | 25,828 | [
{
"from": "human",
"value": "I've just had to write a string reverse function in C# 2.0 (i.e. LINQ not available) and came up with this:\npublic string Reverse(string text)\n{\n char[] cArray = text.ToCharArray();\n string reverse = String.Empty;\n for (int i = cArray.Length - 1; i > -1; i--)\n ... |
I am trying to connect to simple webparts in my sharepoint team site, i need one of the webparts to filter its information based on what it recieves from another webpart
I am using the query string filter webpart and the a list view webpart but no matter how i connect them always i am getting this error
"Web Part Erro... | It sounds like you are encountering a couple of different issues with your SharePoint web parts.
### 1. Data Fetch Limit Error
The error message "This page has exceeded its data fetch limit for connected Web Parts" typically indicates that the number of items being retrieved by the connected web parts exceeds the Shar... | 25,632 | [
{
"from": "human",
"value": "I am trying to connect to simple webparts in my sharepoint team site, i need one of the webparts to filter its information based on what it recieves from another webpart\nI am using the query string filter webpart and the a list view webpart but no matter how i connect them alwa... |
I make a request to an xml web service, and get back a response. This response, being a stream, is then saved to a string. The problem is, the response is full of tags, CDATA, etc (as you would expect). There is no line breaking either, as to be expected.
I want to take this string, which represents an xml document, an... | You can achieve this by using an XML parser to process the XML string, extract the values of interest, and then format the output as you described. Below is an example using C# with the `System.Xml` namespace, specifically using `XmlDocument` or `XDocument` (from `System.Xml.Linq`), which is suitable for parsing XML.
... | 25,008 | [
{
"from": "human",
"value": "I make a request to an xml web service, and get back a response. This response, being a stream, is then saved to a string. The problem is, the response is full of tags, CDATA, etc (as you would expect). There is no line breaking either, as to be expected.\nI want to take this st... |
Often when I post a comment or answer on a site I like to keep an eye out for additional responses from other people, possibly replying again if appropriate. Sometimes I'll bookmark a page for a while, other times I'll end up re-googling keywords to locate the post again. I've always thought there should be something b... | It sounds like you're looking for a way to easily track and revisit conversations and comments across various platforms on the web. Here are some tools and methods that might help you:
1. **Social Bookmarking Services**: While traditional services like Delicious have fallen out of favor, you can try newer ones like **... | 23,144 | [
{
"from": "human",
"value": "Often when I post a comment or answer on a site I like to keep an eye out for additional responses from other people, possibly replying again if appropriate. Sometimes I'll bookmark a page for a while, other times I'll end up re-googling keywords to locate the post again. I've a... |
I want to stitch 2 pieces of png side by side. In Cocoa, I would use [NSImage initWithSize], and then just drawInRect.
But UIImage don't have initWithSize class, how would I do this now?
| In UIKit, you can create a new `UIImage` by drawing into a graphics context. Since `UIImage` does not have an `initWithSize` method like `NSImage`, you can achieve the desired result by using `UIGraphicsBeginImageContextWithOptions` to create a graphics context of the desired size, drawing your two images into it, and ... | 24,711 | [
{
"from": "human",
"value": "I want to stitch 2 pieces of png side by side. In Cocoa, I would use [NSImage initWithSize], and then just drawInRect. \nBut UIImage don't have initWithSize class, how would I do this now?\n"
},
{
"from": "gpt",
"value": "In UIKit, you can create a new `UIImage` by d... |
How cheap can MySQL be compared to MS SQL when you have tons of data (and joins/search)? Consider a site like stackoverflow full of Q&As already and after getting dugg.
My ASP.NET sites are currently on SQL Server Express so I don't have any idea how cost compares in the long run. Although after a quick research, I'm... | When comparing MySQL to Microsoft SQL Server (MS SQL), especially in the context of large datasets with complex joins and searches, there are several factors to consider regarding cost, performance, and licensing.
### Cost Considerations
1. **Licensing Costs**:
- **MySQL**: MySQL is open-source and free to use un... | 11,383 | [
{
"from": "human",
"value": "How cheap can MySQL be compared to MS SQL when you have tons of data (and joins/search)? Consider a site like stackoverflow full of Q&As already and after getting dugg. \nMy ASP.NET sites are currently on SQL Server Express so I don't have any idea how cost compares in the long... |
I have a form with a textarea. Users enter a block of text which is stored in a database.
Occasionally a user will paste text from Word containing smart quotes or emdashes. Those characters appear in the database as: –, ’, “ ,â€
What function should I call on the input string to convert smart quotes to regular qu... | It sounds like you're encountering issues with character encoding when users paste content that includes smart quotes and em dashes from Word. To handle this correctly in PHP and ensure that the text is properly displayed in your application, you can take the following steps:
1. **Ensure UTF-8 Encoding**:
Make sur... | 25,055 | [
{
"from": "human",
"value": "I have a form with a textarea. Users enter a block of text which is stored in a database.\nOccasionally a user will paste text from Word containing smart quotes or emdashes. Those characters appear in the database as: –, ’, “ ,â€\nWhat function should I call on the input s... |
I have a .NET web-service client that has been autogenerated from a wsdl-file using the wsdl.exe tool.
When I first instantiate the generated class, it begins to request a bunch of documents from w3.org and others. The first one being http://www.w3.org/2001/XMLSchema.dtd
Besides not wanting to cause unnecessary traffic... | The issue you're experiencing is related to the fact that the autogenerated .NET web service client is trying to access external DTDs (Document Type Definitions) from the internet to validate the XML schema, specifically from W3C. This can cause problems when there is no internet connection and also generates unnecessa... | 23,402 | [
{
"from": "human",
"value": "I have a .NET web-service client that has been autogenerated from a wsdl-file using the wsdl.exe tool.\nWhen I first instantiate the generated class, it begins to request a bunch of documents from w3.org and others. The first one being http://www.w3.org/2001/XMLSchema.dtd\nBesid... |
I want to do something like this:
const
MyFirstConstArray: array[0..1] of string = ('Hi', 'Foo');
MySecondConstArrayWhichIncludesTheFirstOne: array[0..2] of string =
MyFirstConstArray + ('Bar');
Basically I want the following result:
MyFirstConstArray -> ('Hi', 'Foo');
MySecondConstArrayWhichIncludesTheFirst... | In Delphi (or Object Pascal), you cannot directly concatenate arrays in the way you've described. However, you can achieve the desired result by using a combination of declaring the first array and then populating the second array with its elements along with the additional element. Here's how you can do it:
```pascal... | 28,151 | [
{
"from": "human",
"value": "I want to do something like this:\nconst\n\n MyFirstConstArray: array[0..1] of string = ('Hi', 'Foo');\n MySecondConstArrayWhichIncludesTheFirstOne: array[0..2] of string = \n MyFirstConstArray + ('Bar');\n\nBasically I want the following result:\nMyFirstConstArray -> ('Hi'... |
Sometimes you don't have the source code and need to reverse engineer a program or a black box. Any fun war stories?
Here's one of mine:
Some years ago I needed to rewrite a device driver for which I didn't have source code. The device driver ran on an old CP/M microcomputer and drove a dedicated phototypesetting mac... | That sounds like a fascinating and challenging project! Reverse engineering can often feel like detective work, piecing together clues to understand how a system operates. Here’s a fun war story from the world of reverse engineering:
Several years ago, I was involved in a project where we needed to integrate with a le... | 26,112 | [
{
"from": "human",
"value": "Sometimes you don't have the source code and need to reverse engineer a program or a black box. Any fun war stories?\nHere's one of mine:\nSome years ago I needed to rewrite a device driver for which I didn't have source code. The device driver ran on an old CP/M microcomputer... |
I want to expose the functionality of an SAP program (transaction) as a BAPI.
I need to call a report and supply range filters such that the GUI is bypassed.
Does anyone have a working example of the SUBMIT ... WITH ... ABAP construct, or other suggestions on how to accomplish what I need to do?
| To expose the functionality of an SAP transaction (or report) as a BAPI and bypass the GUI, you can indeed use the `SUBMIT` statement in ABAP. This allows you to execute a report programmatically and pass parameters, including range filters.
### Basic Syntax of `SUBMIT`
Here’s a simplified example of how to use the `... | 23,566 | [
{
"from": "human",
"value": "I want to expose the functionality of an SAP program (transaction) as a BAPI.\nI need to call a report and supply range filters such that the GUI is bypassed.\nDoes anyone have a working example of the SUBMIT ... WITH ... ABAP construct, or other suggestions on how to accomplish... |
What is the best online forum site about project management? It must cover PM-related news, articles, case studies and discussion boards.
| One of the best online forum sites for project management is **ProjectManagement.com**. This platform offers a wide range of resources including articles, case studies, and discussion boards, all focused on project management topics. Users can engage in discussions, ask questions, and share insights with other project ... | 29,256 | [
{
"from": "human",
"value": "What is the best online forum site about project management? It must cover PM-related news, articles, case studies and discussion boards.\n"
},
{
"from": "gpt",
"value": "One of the best online forum sites for project management is **ProjectManagement.com**. This pla... |
Obviously I could create a Calendar object with the date and use get(DAY) on it, but knowing Groovy, I would guess there is an easier, quicker way I just don't know about?
Answer
(date1..date2).size() == 1 // true if two dates are on same calendar day
| Yes, in Groovy, you can check if two dates are on the same calendar day using a range of dates. The approach you mentioned is both concise and effective:
```groovy
def date1 = Date.parse("yyyy-MM-dd", "2023-10-01")
def date2 = Date.parse("yyyy-MM-dd", "2023-10-01")
boolean sameDay = (date1..date2).size() == 1 // true... | 27,044 | [
{
"from": "human",
"value": "Obviously I could create a Calendar object with the date and use get(DAY) on it, but knowing Groovy, I would guess there is an easier, quicker way I just don't know about?\nAnswer\n(date1..date2).size() == 1 // true if two dates are on same calendar day\n\n"
},
{
"from":... |
I've been playing with some algorithms on the internet for a while and I can't seem to get them to work, so I'm tossing the question out here;
I am attempting to render a velocity vector line from a point. Drawing the line isn't difficult: just insert a line with length velocity.length into the graph. This puts the lin... | It looks like you're working on computing a rotation matrix from a velocity vector to orient an arrow or similar representation in 3D space. Your algorithm seems to be mostly in the right direction, but I can provide a clearer breakdown of the steps needed to compute the rotation matrix based on a directional vector.
... | 21,465 | [
{
"from": "human",
"value": "I've been playing with some algorithms on the internet for a while and I can't seem to get them to work, so I'm tossing the question out here;\nI am attempting to render a velocity vector line from a point. Drawing the line isn't difficult: just insert a line with length velocit... |
I want to create a list of methods to execute. Each method has the same signature.
I thought about putting delegates in a generic collection, but I keep getting this error:
'method' is a 'variable' but is used like a 'method'
In theory, here is what I would like to do:
List<object> methodsToExecute;
int Add(int x, ... | The error you're encountering is due to how you're trying to store method references in a list and then invoke them later. To achieve what you want, you can use a list of delegates instead of a list of objects. Here's how you can modify your code to correctly implement this:
1. Declare a list of the delegate type `Bin... | 26,134 | [
{
"from": "human",
"value": "I want to create a list of methods to execute. Each method has the same signature.\nI thought about putting delegates in a generic collection, but I keep getting this error:\n\n'method' is a 'variable' but is used like a 'method'\n\nIn theory, here is what I would like to do:\n... |
So I have a ListView with an upper limit of about 1000 items. I need to be able to filter these items using a textbox's TextChanged event. I have some code that works well for a smaller number of items (~400), but when I need to re-display a full list of all 1000 items, it takes about 4 seconds.
I am not creating new... | If you're experiencing performance issues when filtering and displaying a large number of items in a ListView, there are several approaches you can take to optimize the performance. Here are some suggestions to improve your code:
### 1. Virtual Mode
If you are using a Windows Forms ListView, you can enable "Virtual Mo... | 17,081 | [
{
"from": "human",
"value": "So I have a ListView with an upper limit of about 1000 items. I need to be able to filter these items using a textbox's TextChanged event. I have some code that works well for a smaller number of items (~400), but when I need to re-display a full list of all 1000 items, it tak... |
What are the differences between pipes in Windows and Linux?
| Pipes are a fundamental concept in both Windows and Linux for inter-process communication, allowing the output of one process to be used as the input for another. However, there are notable differences in how pipes are implemented and used in the two operating systems. Here are some key distinctions:
### 1. **Syntax a... | 23,709 | [
{
"from": "human",
"value": "What are the differences between pipes in Windows and Linux?\n"
},
{
"from": "gpt",
"value": "Pipes are a fundamental concept in both Windows and Linux for inter-process communication, allowing the output of one process to be used as the input for another. However, t... |
The following two forms of jQuery selectors seem to do the same thing:
$("div > ul.posts")
$("div ul.posts")
which is to select all the "ul" elements of class "posts" under "div" elements.
Is there any difference?
| Yes, there is a significant difference between the two jQuery selectors you provided:
1. **`$("div > ul.posts")`**: This selector uses the child combinator (`>`) and selects only the `ul` elements with the class `posts` that are **direct children** of `div` elements. In other words, the `ul.posts` must be immediately ... | 26,379 | [
{
"from": "human",
"value": "The following two forms of jQuery selectors seem to do the same thing:\n\n$(\"div > ul.posts\") \n$(\"div ul.posts\")\n\nwhich is to select all the \"ul\" elements of class \"posts\" under \"div\" elements.\nIs there any difference?\n"
},
{
"from": "gpt",
"value": "Y... |
Currently I have this (edited after reading advice):
struct Pair<T, K> : IEqualityComparer<Pair<T, K>>
{
readonly private T _first;
readonly private K _second;
public Pair(T first, K second)
{
_first = first;
_second = second;
}
public T First { get { return _first; } }
pu... | Your implementation of the `Pair<T, K>` struct is on the right track, but there are some improvements and fixes needed, especially regarding equality and hash code calculations. Below are the issues and a revised version of the code that addresses them:
### Issues:
1. **Equality Comparison**: In the `Equals` method, y... | 16,511 | [
{
"from": "human",
"value": "Currently I have this (edited after reading advice):\nstruct Pair<T, K> : IEqualityComparer<Pair<T, K>>\n{\n readonly private T _first;\n readonly private K _second;\n\n public Pair(T first, K second)\n {\n _first = first;\n _second = second;\n\n }\n... |
In WCF, what is the difference between Binding.RecieveTimeout and Binding.ReliableSession.InactivityTimeout?
| In Windows Communication Foundation (WCF), both `Binding.ReceiveTimeout` and `Binding.ReliableSession.InactivityTimeout` are properties that deal with timeouts, but they serve different purposes and are used in different contexts.
### `Binding.ReceiveTimeout`
- **Definition**: `ReceiveTimeout` specifies the time peri... | 20,468 | [
{
"from": "human",
"value": "In WCF, what is the difference between Binding.RecieveTimeout and Binding.ReliableSession.InactivityTimeout?\n"
},
{
"from": "gpt",
"value": "In Windows Communication Foundation (WCF), both `Binding.ReceiveTimeout` and `Binding.ReliableSession.InactivityTimeout` are ... |
I have a defined MenuItem that I would like to share between two different menus on one page. The menu contains functionallity that is the same between both menus and I do not want two copies of it. Is there anyway to define a MenuItem in the Page.Resources and reference it in the ContextMenu XAML below?
<Page.Resource... | Yes, you can define a `MenuItem` in the `<Page.Resources>` section and reference it in a `ContextMenu` using the `{StaticResource}` markup extension. However, because `MenuItem` can't be directly reused in XAML due to the way WPF handles element trees, you'll need to use a `DynamicResource` if you want to reference it ... | 24,539 | [
{
"from": "human",
"value": "I have a defined MenuItem that I would like to share between two different menus on one page. The menu contains functionallity that is the same between both menus and I do not want two copies of it. Is there anyway to define a MenuItem in the Page.Resources and reference it in t... |
I'm trying to print out the date in a certain format:
NSDate *today = [[NSDate alloc] init];
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"yyyyMMddHHmmss"];
NSString *dateStr = [dateFormatter stringFromDate:today];
If the iPhone is set to 24 hour time, this works fine,... | It looks like you've encountered an issue with the `NSDateFormatter` that can occur when the user's locale settings change, particularly with regards to the 12-hour and 24-hour time formats. The behavior you're experiencing—where the AM/PM symbols are unexpectedly appended to your formatted date string—can indeed be in... | 26,072 | [
{
"from": "human",
"value": "I'm trying to print out the date in a certain format:\nNSDate *today = [[NSDate alloc] init];\nNSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];\n[dateFormatter setDateFormat:@\"yyyyMMddHHmmss\"];\nNSString *dateStr = [dateFormatter stringFromDate:today];\n\nIf th... |
Among other text and visual aids on a form submission, post-validation, I'm coloring my input boxes red to signify the interactive area needing attention.
On Chrome (and for Google Toolbar users) the auto-fill feature re-colors my input forms yellow. Here's the complex issue: I want auto-complete allowed on my forms, a... | It sounds like you're facing a challenging situation with the styling of input fields, especially when using Chrome's autofill feature, which can override your styles. Unfortunately, there are limited options for directly modifying the autofill styles in web browsers. However, here are some suggestions to help you achi... | 25,166 | [
{
"from": "human",
"value": "Among other text and visual aids on a form submission, post-validation, I'm coloring my input boxes red to signify the interactive area needing attention.\nOn Chrome (and for Google Toolbar users) the auto-fill feature re-colors my input forms yellow. Here's the complex issue: I... |
In a Visual Basic project, I created a homemade TabControl in order to fix a visual bug. The control works properly, however whenever I modify the form using my tab, Visual Studio adds MyProject in front of the control in its declaration:
Me.tabMenu = New MyProject.MyClass 'Gives a BC30002 compile error
If I remove t... | The issue you're experiencing with the `MyProject.` prefix being automatically added to the declaration of your custom tab control (`MyClass`) in Visual Studio typically stems from how namespaces are defined in your project.
To resolve the issue where Visual Studio keeps adding the `MyProject.` prefix, follow these st... | 25,636 | [
{
"from": "human",
"value": "In a Visual Basic project, I created a homemade TabControl in order to fix a visual bug. The control works properly, however whenever I modify the form using my tab, Visual Studio adds MyProject in front of the control in its declaration:\nMe.tabMenu = New MyProject.MyClass 'Gi... |
Right now I have a visual studio project which contains a custom content type that I made. It also contains all the necessary files for making a sharepoint solution (wsp) file and a script to generate this.
Now, I would like to do 2 things.
First, I'd like to create a custom display form for the content type and incl... | To address your needs for the SharePoint solution you're developing, let's break down both tasks: creating a custom display form for your content type and modifying the Content Query Web Part (CQWP).
### 1. Creating a Custom Display Form for the Content Type
To create and include a custom display form for your conten... | 19,305 | [
{
"from": "human",
"value": "Right now I have a visual studio project which contains a custom content type that I made. It also contains all the necessary files for making a sharepoint solution (wsp) file and a script to generate this. \nNow, I would like to do 2 things. \nFirst, I'd like to create a custom... |
I have a lot of XML files and I'd like to generate a report from them. The report should provide information such as:
root 100%
a*1 90%
b*1 80%
c*5 40%
meaning that all documents have a root element, 90% have one a element in the root, 80% have one b element in the root, 40% have 5 c elements in b.
If for example ... | There are a few tools and libraries you can use to analyze XML files and generate reports like the one you described. While there may not be a dedicated free tool that exactly fits your needs out-of-the-box, several programming libraries and command-line tools can help you achieve similar results with a bit of custom s... | 24,551 | [
{
"from": "human",
"value": "I have a lot of XML files and I'd like to generate a report from them. The report should provide information such as:\nroot 100%\n a*1 90%\n b*1 80%\n c*5 40%\n\nmeaning that all documents have a root element, 90% have one a element in the root, 80% have one b element in the ro... |
I know there are tools to get text files to resource files for Visual Studio. But I want to get the text from my resource files to a text file so they can be translated. Or is there a better way to do this?
| Yes, extracting text from resource files for translation is a common requirement, especially for applications that support multiple languages. Here are a few approaches you can take:
### 1. Manual Extraction
If your resource files are in a format like `.resx` (XML format), you can manually open these files and copy th... | 24,168 | [
{
"from": "human",
"value": "I know there are tools to get text files to resource files for Visual Studio. But I want to get the text from my resource files to a text file so they can be translated. Or is there a better way to do this? \n"
},
{
"from": "gpt",
"value": "Yes, extracting text fr... |
When are objects or something else said to be "first-class" in a given programming language, and why? In what way do they differ from languages where they are not?
When one says "everything is an object" (like in Python), do they indeed mean that "everything is first-class"?
| In programming languages, an object or entity is said to be "first-class" when it can be treated as a first-class citizen. This typically means that the object can be:
1. **Assigned to a variable**: You can store it in a variable.
2. **Passed as an argument**: You can pass it as an argument to a function.
3. **Returne... | 26,109 | [
{
"from": "human",
"value": "When are objects or something else said to be \"first-class\" in a given programming language, and why? In what way do they differ from languages where they are not?\nWhen one says \"everything is an object\" (like in Python), do they indeed mean that \"everything is first-class... |
When creating a new file with vim, I would like to automatically add some skeleton code.
For example, when creating a new xml file, I would like to add the first line:
<?xml version="1.0"?>
Or when creating an html file, I would like to add:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org... | You can achieve this in Vim by creating an auto-command that automatically inserts a skeleton code template based on the file type when you create a new file. Here's a step-by-step guide on how to set it up:
### Step 1: Open Your Vim Configuration
1. Open your Vim configuration file (usually `~/.vimrc`):
```bash
... | 14,766 | [
{
"from": "human",
"value": "When creating a new file with vim, I would like to automatically add some skeleton code.\nFor example, when creating a new xml file, I would like to add the first line:\n <?xml version=\"1.0\"?>\n\nOr when creating an html file, I would like to add:\n<!DOCTYPE html PUBLIC \"-//... |
what is the naming convention for message bundle property files when using variants?
for instance, if the locale is EN US, the property file lookup will be
message_en_US.properties
though, what if I instantiate a local EN US though the variant string is "DEVL"
what is the search order?
| When dealing with message bundle property files in a localized application, especially when variants are involved, the naming convention follows a specific order.
For the locale `en_US` (English - United States) and a variant such as `DEVL`, the search order for property files typically follows this pattern:
1. **Wi... | 28,525 | [
{
"from": "human",
"value": "what is the naming convention for message bundle property files when using variants?\nfor instance, if the locale is EN US, the property file lookup will be\nmessage_en_US.properties\nthough, what if I instantiate a local EN US though the variant string is \"DEVL\"\nwhat is the ... |
i know how to import an sql file via the cli:
mysql -u USER -p DBNAME < dump.sql
but that's if the dump.sql file is local. how could i use a file on a remote server?
| To import an SQL file that is located on a remote server via the command line, you will typically need to first transfer the file to your local machine or directly to the MySQL server where the database resides. Here are some methods to achieve this:
### Method 1: SSH and `mysql`
1. **SSH into the remote server**: If... | 25,492 | [
{
"from": "human",
"value": "i know how to import an sql file via the cli:\nmysql -u USER -p DBNAME < dump.sql\n\nbut that's if the dump.sql file is local. how could i use a file on a remote server?\n"
},
{
"from": "gpt",
"value": "To import an SQL file that is located on a remote server via the... |
I am working on a web application developed on C#/ASP.NET. We are using third-party controls for displaying Grids, Tabs, Trees and other complex controls in our pages. The problem is that these controls render a huge amount of HTML. Due to this the size of pages have grown heavily and the browser takes a while to load ... | Optimizing HTML rendering in web applications is crucial for improving loading times and overall performance, especially when dealing with complex controls that generate a significant amount of HTML. Here are several techniques you can apply to make your web application more efficient:
### 1. **Optimize Control Usage*... | 18,114 | [
{
"from": "human",
"value": "I am working on a web application developed on C#/ASP.NET. We are using third-party controls for displaying Grids, Tabs, Trees and other complex controls in our pages. The problem is that these controls render a huge amount of HTML. Due to this the size of pages have grown heavi... |
For explanation imagine a simple address. Written in a HTML paragraph with line breaks it would like this:
Street: Example Street 1
City: Vienna
Zip Code: 1010
Country: Austria
Most of the time that's completely okay, but sometimes I have to achieve the following output:
Street: Example Street 1
City: Vienna
Zip... | To achieve the desired output with proper alignment while adhering to semantic HTML practices, you can use a combination of CSS for styling and semantic HTML elements. Below are two approaches to achieve this: using a definition list (`<dl>`) and using a combination of `<span>` and CSS for spacing.
### Approach 1: Usi... | 22,105 | [
{
"from": "human",
"value": "For explanation imagine a simple address. Written in a HTML paragraph with line breaks it would like this:\nStreet: Example Street 1\nCity: Vienna\nZip Code: 1010\nCountry: Austria\n\nMost of the time that's completely okay, but sometimes I have to achieve the following output:\... |
I know you can use C++ keyword 'explicit' for constructors of classes to prevent an automatic conversion of type. Can you use this same command to prevent the conversion of parameters for a class method?
I have two class members, one which takes a bool as a param, the other an unsigned int. When I called the function... | The `explicit` keyword in C++ is specifically used to prevent implicit conversions for constructors and conversion operators. However, it does not apply to member functions in the same way. If you want to prevent implicit conversions for parameters in member functions, you can use a different strategy.
In your case, w... | 24,864 | [
{
"from": "human",
"value": "I know you can use C++ keyword 'explicit' for constructors of classes to prevent an automatic conversion of type. Can you use this same command to prevent the conversion of parameters for a class method?\nI have two class members, one which takes a bool as a param, the other an... |
I'd like to do the equivalent of the following in LINQ, but I can't figure out how:
IEnumerable<Item> items = GetItems();
items.ForEach(i => i.DoStuff());
What is the real syntax?
| In LINQ, there is no direct equivalent of the `ForEach` method that you might find in other programming languages. However, you can achieve similar functionality using the `foreach` statement in C#. Here’s how you can do it:
```csharp
IEnumerable<Item> items = GetItems();
foreach (var item in items)
{
item.DoStuf... | 28,033 | [
{
"from": "human",
"value": "I'd like to do the equivalent of the following in LINQ, but I can't figure out how:\nIEnumerable<Item> items = GetItems();\nitems.ForEach(i => i.DoStuff());\n\nWhat is the real syntax?\n"
},
{
"from": "gpt",
"value": "In LINQ, there is no direct equivalent of the `Fo... |
I have been developing a C# windows form application in XP. It all works just fine. But in Vista it was not able to write the log or scoreboard file to the hard drive. I found out that I needed a manifest file to allow the popup to ask it to be run as admin.
This all worked well and I am very pleased. My problem is... | To remove the administrator permissions granted by a manifest file in your C# Windows Forms application, you can follow these steps:
### Option 1: Remove or Update the Manifest File
1. **Locate the Manifest File**: Find the manifest file you added to your project. This file typically has a `.manifest` extension and m... | 25,838 | [
{
"from": "human",
"value": "I have been developing a C# windows form application in XP. It all works just fine. But in Vista it was not able to write the log or scoreboard file to the hard drive. I found out that I needed a manifest file to allow the popup to ask it to be run as admin.\nThis all worked ... |
In Django, given excerpts from an application animals likeso:
A animals/models.py with:
from django.db import models
from django.contrib.contenttypes.models import ContentType
class Animal(models.Model):
content_type = models.ForeignKey(ContentType,editable=False,null=True)
name = models.CharField()
class Dog(An... | To achieve a solution where you can use generic views to edit both `Dog` and `Cat` instances using the same form, you can utilize Django's `formsets` or a single form class that dynamically generates fields based on the model class of the instance being edited. Here’s how you can structure it:
### Step 1: Define a Sin... | 21,064 | [
{
"from": "human",
"value": "In Django, given excerpts from an application animals likeso:\nA animals/models.py with: \nfrom django.db import models\nfrom django.contrib.contenttypes.models import ContentType\n\nclass Animal(models.Model):\n content_type = models.ForeignKey(ContentType,editable=False,null=... |
Does visual studio 2008 support classic asp development?
It's been years since I created a classic ASP website and I was wondering if I can use my current toolset or if I have to resign myself to notepad.
Thanks
Matt
| Yes, Visual Studio 2008 does support Classic ASP development, although it's primarily geared towards ASP.NET development. You can create and edit Classic ASP files (with the `.asp` extension) in Visual Studio 2008, and it provides basic features such as syntax highlighting and IntelliSense for VBScript, which is common... | 27,894 | [
{
"from": "human",
"value": "Does visual studio 2008 support classic asp development?\nIt's been years since I created a classic ASP website and I was wondering if I can use my current toolset or if I have to resign myself to notepad.\nThanks\nMatt\n"
},
{
"from": "gpt",
"value": "Yes, Visual St... |
What is the most efficient way to convert a MySQL query to CSV in PHP please?
It would be best to avoid temp files as this reduces portability (dir paths and setting file-system permissions required).
The CSV should also include one top line of field names.
| Converting a MySQL query result to a CSV format in PHP without using temporary files can be achieved using output buffering. Here's a step-by-step guide to create a CSV file directly in the browser or download it:
### Step 1: Connect to MySQL Database
Make sure you have the database connection setup using either MySQ... | 23,572 | [
{
"from": "human",
"value": "What is the most efficient way to convert a MySQL query to CSV in PHP please?\nIt would be best to avoid temp files as this reduces portability (dir paths and setting file-system permissions required).\nThe CSV should also include one top line of field names.\n"
},
{
"fr... |
I'm a big fan of TFS, but unfortunately they seem to have omitted any sort of method of linking to individual items (be they work items, documents, or files under version control). This blog post discusses using TSWA Power Tools to link directly to things (which is useful for building linkified notification emails), b... | You raise a valid concern about the challenges of linking directly to specific items in Team Foundation Server (TFS). While TFS does have some limitations when it comes to user-friendly URLs, there are a few strategies you can consider for easier navigation and sharing of links to work items, documents, and source-cont... | 20,988 | [
{
"from": "human",
"value": "I'm a big fan of TFS, but unfortunately they seem to have omitted any sort of method of linking to individual items (be they work items, documents, or files under version control). This blog post discusses using TSWA Power Tools to link directly to things (which is useful for b... |
I have a very simple Java RMI Server that looks like the following:
import java.rmi.*;
import java.rmi.server.*;
public class CalculatorImpl extends UnicastRemoteObject implements Calculator {
private String mServerName;
public CalculatorImpl(String serverName) throws RemoteException
... | The issue you're experiencing arises because you're calling `System.exit(1)` in your `exit()` method of the RMI server. When you call `System.exit(1)`, it terminates the Java Virtual Machine (JVM) immediately, which means that all running threads—including the RMI server and any client connections—are abruptly stopped.... | 25,841 | [
{
"from": "human",
"value": "I have a very simple Java RMI Server that looks like the following:\n import java.rmi.*;\n import java.rmi.server.*;\n\n public class CalculatorImpl extends UnicastRemoteObject implements Calculator {\n\n private String mServerName;\n\n public CalculatorIm... |
I've been trying to call Page Methods from my own JavaScript code but it doesn't work. If I use jQuery AJAX I can sucessfully call the Page Methods, but I need to do this from my own JavaScript code because we can't use third-party libraries (we are building our own library).
Whenever I use jQuery AJAX methods I get th... | It looks like you've gone through quite a journey figuring out how to call ASP.NET Page Methods using custom JavaScript. The key points in your findings are very helpful for anyone looking to make AJAX requests without relying on libraries like jQuery. Let me summarize the important changes and provide a bit of context... | 20,385 | [
{
"from": "human",
"value": "I've been trying to call Page Methods from my own JavaScript code but it doesn't work. If I use jQuery AJAX I can sucessfully call the Page Methods, but I need to do this from my own JavaScript code because we can't use third-party libraries (we are building our own library).\nW... |
http://localhost/XYZ/Client/(S(enlodz55ov4ncafza0gpp045))/Info/Rates.aspx
Does anyway know what /(S(enlodz55ov4ncafza0gpp045))/ means?
Any help appreciated.
| The portion of the URL that includes `/(S(enlodz55ov4ncafza0gpp045))/` typically represents a session state identifier in ASP.NET applications. The `(S(...))` segment is often used to maintain a unique session identifier for a user's session, allowing the server to track the user's state across multiple requests.
Here... | 28,464 | [
{
"from": "human",
"value": "http://localhost/XYZ/Client/(S(enlodz55ov4ncafza0gpp045))/Info/Rates.aspx\nDoes anyway know what /(S(enlodz55ov4ncafza0gpp045))/ means?\nAny help appreciated.\n"
},
{
"from": "gpt",
"value": "The portion of the URL that includes `/(S(enlodz55ov4ncafza0gpp045))/` typi... |
I'm working on a java web-application, trying to be xml-friendly and writing my jsp files using the jspx/xml syntax. It took me hours of dissecting examples and configuration files to find out that with tomcat 5.5 files using the new syntax should end in .jspx, or tomcat won't translate tag libraries and stuff.
Both fi... | Yes, you are correct that JSP files with the `.jspx` extension are intended to be used with the XML-based syntax, while `.jsp` files use the traditional syntax. In Tomcat 5.5, there are some specific considerations to ensure that your `.jspx` files are processed correctly:
1. **File Extension**: Make sure your XML syn... | 20,243 | [
{
"from": "human",
"value": "I'm working on a java web-application, trying to be xml-friendly and writing my jsp files using the jspx/xml syntax. It took me hours of dissecting examples and configuration files to find out that with tomcat 5.5 files using the new syntax should end in .jspx, or tomcat won't t... |
Does anybody know if there is an SVN:externals property equivalent in TFS2005?
Definition of an SVN External property
Sometimes it is useful to construct a working copy that is made out of a number of different checkouts. For example, you may want different subdirectories to come from different locations in a repositor... | TFS (Team Foundation Server) 2005 does not have a direct equivalent to SVN's `svn:externals` property for handling dependencies on other repositories or versioned resources within a workspace. However, there are a few workarounds you can consider:
1. **Branching and Merging**: You can manually branch and merge code fr... | 28,112 | [
{
"from": "human",
"value": "Does anybody know if there is an SVN:externals property equivalent in TFS2005?\nDefinition of an SVN External property\nSometimes it is useful to construct a working copy that is made out of a number of different checkouts. For example, you may want different subdirectories to c... |
I'm looking for a generic "Row Picker" for JQuery.
We've all seen the cool "Picker" tools like date pickers, color pickers, time pickers, etc, where you click in a text box and a little calendar or color palate or clock or something comes up. You select something (like a date) and the text box is then populated with a... | Creating a generic "Row Picker" with jQuery is a great idea! While there are existing libraries that may partially fulfill your requirements, you can also create a simple custom solution. Below is a basic implementation of a "Row Picker" that allows users to select from a list of time zones.
### HTML Structure
Create ... | 20,564 | [
{
"from": "human",
"value": "I'm looking for a generic \"Row Picker\" for JQuery.\nWe've all seen the cool \"Picker\" tools like date pickers, color pickers, time pickers, etc, where you click in a text box and a little calendar or color palate or clock or something comes up. You select something (like a d... |
How do I iterate over the words of a string composed of words separated by whitespace?
Note that I'm not interested in C string functions or that kind of character manipulation/access. I prefer elegance over efficiency. My current solution:
#include <iostream>
#include <sstream>
#include <string>
using namespace std;
... | Your current solution is already quite elegant and uses the `istringstream` class effectively to iterate over the words in a string. However, the do-while loop condition checks `iss`, which might lead to an extra output after the last word has been read. A more conventional way to handle this would be to use a while lo... | 27,153 | [
{
"from": "human",
"value": "How do I iterate over the words of a string composed of words separated by whitespace?\nNote that I'm not interested in C string functions or that kind of character manipulation/access. I prefer elegance over efficiency. My current solution:\n#include <iostream>\n#include <sstre... |
We're moving a solution with 20+ projects from .net 2.0 to 3.5 and at the same time moving from Visual Studio 2005 to 2008. We're also at the same time switching from MS Entlib 2.0 to 4.0.
Is there any reasons not to let the
Visual Studio wizard convert the
solution for us?
Is 3.5 fully backwards compatible
with 2.0?... | Moving a solution from .NET Framework 2.0 to 3.5 and updating the development environment from Visual Studio 2005 to 2008 can be a significant undertaking. Here are some insights regarding the concerns you've raised:
### 1. Using the Visual Studio Wizard to Convert the Solution
**Reasons to use the wizard:**
- **Conv... | 25,041 | [
{
"from": "human",
"value": "We're moving a solution with 20+ projects from .net 2.0 to 3.5 and at the same time moving from Visual Studio 2005 to 2008. We're also at the same time switching from MS Entlib 2.0 to 4.0. \n\nIs there any reasons not to let the\nVisual Studio wizard convert the\nsolution for us... |
Examples could be Infragistics or DevExpress.
But I'm also looking for your opinions on other frameworks. It could even be WPF if that is your favorite.
| Certainly! Here’s a breakdown of some popular UI frameworks, including Infragistics and DevExpress, along with opinions on their strengths and other noteworthy options:
### 1. **Infragistics**
- **Strengths**: Infragistics offers a wide range of components, especially for data visualization and enterprise-level app... | 22,981 | [
{
"from": "human",
"value": "Examples could be Infragistics or DevExpress.\nBut I'm also looking for your opinions on other frameworks. It could even be WPF if that is your favorite.\n"
},
{
"from": "gpt",
"value": "Certainly! Here’s a breakdown of some popular UI frameworks, including Infragist... |
I'm working on some code that uses a pattern in its business and data tiers that uses events to signal errors e.g.
resource = AllocateLotsOfMemory();
if (SomeCondition())
{
OnOddError(new OddErrorEventArgs(resource.StatusProperty));
resource.FreeLotsOfMemory();
return;
}
This looked superficially ... | The pattern you've described can be seen as a mix of event-driven programming and exception handling, each with its own set of advantages and disadvantages. Let's break down the considerations regarding this pattern:
### Advantages of the Event-Driven Pattern
1. **Loose Coupling**: Using events allows the business ti... | 17,373 | [
{
"from": "human",
"value": "I'm working on some code that uses a pattern in its business and data tiers that uses events to signal errors e.g. \nresource = AllocateLotsOfMemory();\nif (SomeCondition())\n{ \n OnOddError(new OddErrorEventArgs(resource.StatusProperty));\n resource.FreeLotsOfMemory();... |
I've got to get a quick and dirty configuration editor up and running. The flow goes something like this:
configuration (POCOs on server) -> Xml (serialized, transferred as XElements to website) -> text (edit in place in web page)
(make changes)
text editor -> XElement (Parse submitted form value) -> Configuration
The... | To handle the serialization of XML safely and ensure that your POCOs are properly serialized and deserialized without running into issues with invalid characters (like those in a regular expression), you can follow these guidelines:
### 1. Use CDATA Sections for Special Characters
When you know that certain values may... | 24,962 | [
{
"from": "human",
"value": "I've got to get a quick and dirty configuration editor up and running. The flow goes something like this:\nconfiguration (POCOs on server) -> Xml (serialized, transferred as XElements to website) -> text (edit in place in web page)\n(make changes)\ntext editor -> XElement (Pars... |
Is there a way to configure a Visual Studio 2005 Web Deployment Project to install an application into a named Application Pool rather than the default app pool for a given web site?
| Yes, you can configure a Visual Studio 2005 Web Deployment Project to install an application into a named Application Pool instead of the default app pool. Here’s how you can achieve this:
1. **Create a Web Deployment Project**: Ensure you have a Web Deployment Project created for your web application.
2. **Update th... | 25,791 | [
{
"from": "human",
"value": "Is there a way to configure a Visual Studio 2005 Web Deployment Project to install an application into a named Application Pool rather than the default app pool for a given web site?\n"
},
{
"from": "gpt",
"value": "Yes, you can configure a Visual Studio 2005 Web Dep... |
Anyone understand why the following doesn't work?
What I want to do is copy current route data plus whatever I add via an anonymous object into new routedata when forming new links on the view.
For example if I have the parameter "page" as a non route path (i.e. so it overflows the route path and its injected into th... | Your approach to extending the route data to include the `page` parameter when generating links in your view seems generally reasonable. However, there are a few things that could be improved or clarified in your code to ensure it works as intended. Here are some potential issues and suggestions:
1. **Adding to RouteD... | 23,050 | [
{
"from": "human",
"value": "Anyone understand why the following doesn't work? \nWhat I want to do is copy current route data plus whatever I add via an anonymous object into new routedata when forming new links on the view. \nFor example if I have the parameter \"page\" as a non route path (i.e. so it over... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.