instruction
stringlengths
14
27.6k
completion
stringlengths
3
38.3k
__original_row_idx
int64
0
50k
conversations
listlengths
2
2
What is the best way to get and set the meta data for mp3, mp4, avi files etc. with .NET?
In .NET, you can manage metadata for audio and video files (like MP3, MP4, AVI, etc.) using various libraries. Here's an overview of some popular options and how to use them: ### For MP3 Files 1. **TagLib#**: - **Description**: TagLib# is a popular library for reading and writing metadata for various media files, ...
5,665
[ { "from": "human", "value": "What is the best way to get and set the meta data for mp3, mp4, avi files etc. with .NET?\n" }, { "from": "gpt", "value": "In .NET, you can manage metadata for audio and video files (like MP3, MP4, AVI, etc.) using various libraries. Here's an overview of some popula...
What is the difference between == and ===? How exactly does the loosely == comparison work? How exactly does the strict === comparison work? What would be some useful examples?
In JavaScript, `==` and `===` are both comparison operators, but they behave differently in terms of type coercion and strictness: ### Differences Between `==` and `===` 1. **Loose Equality (`==`)**: - Performs type coercion when comparing two values. - If the values are of different types, JavaScript attempts ...
12,319
[ { "from": "human", "value": "What is the difference between == and ===?\n\nHow exactly does the loosely == comparison work?\nHow exactly does the strict === comparison work?\n\nWhat would be some useful examples?\n" }, { "from": "gpt", "value": "In JavaScript, `==` and `===` are both comparison ...
While I know IronRuby isn't quite ready for the world to use it, I was wondering if anyone here tried it and tested how well it faired against the other Rubies out there in terms of raw performance? If so, what are the results, and how did you go about measuring the performance (which benchmarks etc)? Edit: The IronRub...
IronRuby, as a .NET implementation of the Ruby programming language, has been the subject of various performance tests in comparison to other Ruby implementations like MRI (Matz's Ruby Interpreter) and JRuby. While it may not be as mature or widely used as these alternatives, some benchmarks have been conducted. ### P...
5,461
[ { "from": "human", "value": "While I know IronRuby isn't quite ready for the world to use it, I was wondering if anyone here tried it and tested how well it faired against the other Rubies out there in terms of raw performance?\nIf so, what are the results, and how did you go about measuring the performance...
I have been trying to determine a best case solution for registering a COM server using WiX to create a Windows Installer package and am struggling. In this post Deployment Engineering Archive: HOWTO: Use Regsvr32.exe with WIX, there is an open request for the "Setup police" to crack down on using regsvr32 through an e...
When it comes to registering COM servers in Windows Installer packages using WiX, you're right that there are some nuances and best practices that should be adhered to in order to avoid common pitfalls and ensure a smooth installation experience. ### Recommended Approaches: 1. **Use WiX's Built-in Support for COM Reg...
14,015
[ { "from": "human", "value": "I have been trying to determine a best case solution for registering a COM server using WiX to create a Windows Installer package and am struggling.\nIn this post Deployment Engineering Archive: HOWTO: Use Regsvr32.exe with WIX, there is an open request for the \"Setup police\" ...
How can I allow others to create Java, .NET, Ruby, PHP, Perl web user interface components that interact with each other? For example, one web ui component written in .NET selects a customer, and the other web user interface components are written in Java, Ruby or PHP are able to refresh showing information about the s...
To enable interoperability between web UI components written in different programming languages (Java, .NET, Ruby, PHP, Perl, etc.) that can interact with each other, you can consider several approaches. Here are some common strategies: ### 1. **Use Web APIs (RESTful APIs or GraphQL)** 1. **Define APIs**: Develop RES...
9,418
[ { "from": "human", "value": "How can I allow others to create Java, .NET, Ruby, PHP, Perl web user interface components that interact with each other?\nFor example, one web ui component written in .NET selects a customer, and the other web user interface components are written in Java, Ruby or PHP are able ...
With Hibernate, can you create a composite ID where one of the columns you are mapping to the ID can have null values? This is to deal with a legacy table that has a unique key which can have null values but no primary key. I realise that I could just add a new primary key column to the table, but I'm wondering if ther...
In Hibernate, when defining a composite primary key (or a composite ID) for an entity, it's important to note that the composite key must be unique and cannot contain null values for the purpose of defining the entity's identity. This is because primary keys (and composite keys) are used to uniquely identify records in...
12,582
[ { "from": "human", "value": "With Hibernate, can you create a composite ID where one of the columns you are mapping to the ID can have null values?\nThis is to deal with a legacy table that has a unique key which can have null values but no primary key.\nI realise that I could just add a new primary key col...
Start with the simplest task of capturing the URL in Firefox from a C# application. It appears using user32.dll Windows API functions will not work as is the approach for capturing the URL within IE.
Capturing the URL from the Firefox browser in a C# application is not as straightforward as it is with Internet Explorer, primarily because Firefox does not expose its URL through Windows API calls like `user32.dll`. Instead, you can retrieve the URL from Firefox using one of the following methods: ### Method 1: Read ...
11,217
[ { "from": "human", "value": "Start with the simplest task of capturing the URL in Firefox from a C# application. It appears using user32.dll Windows API functions will not work as is the approach for capturing the URL within IE. \n" }, { "from": "gpt", "value": "Capturing the URL from the Fire...
How do I add an instance method to a class using a metaclass (yes I do need to use a metaclass)? The following kind of works, but the func_name will still be "foo": def bar(self): print "bar" class MetaFoo(type): def __new__(cls, name, bases, dict): dict["foobar"] = bar return type(name, bases,...
To correctly set an instance method with the desired name using a metaclass, you need to ensure that the method is bound to the instance and has the right attributes, including the function name. When you directly assign a function to a class dictionary, the name of the function is preserved, which is why you're seeing...
14,329
[ { "from": "human", "value": "How do I add an instance method to a class using a metaclass (yes I do need to use a metaclass)? The following kind of works, but the func_name will still be \"foo\":\ndef bar(self):\n print \"bar\"\n\nclass MetaFoo(type):\n def __new__(cls, name, bases, dict):\n di...
I know there is a way to add a IE control, how do you add a chrome control...? Is it even possible right now? I'm need this because of the fast javascript VM found in chrome.
As of my last knowledge update in October 2023, embedding a Chrome control directly into a Windows application is not as straightforward as embedding an Internet Explorer control (WebBrowser). However, there are several options you can use to achieve a similar outcome with Chrome's rendering engine. ### Options for Em...
9,615
[ { "from": "human", "value": "I know there is a way to add a IE control, how do you add a chrome control...? Is it even possible right now?\nI'm need this because of the fast javascript VM found in chrome.\n" }, { "from": "gpt", "value": "As of my last knowledge update in October 2023, embedding ...
Does anyone have any experience with a good wpf pivot table control?
Yes, there are several good options for WPF pivot table controls that you can consider. Here are some popular ones: 1. **DevExpress Pivot Grid Control**: This is a powerful and versatile control for creating pivot tables. It offers rich features such as data grouping, filtering, sorting, and multiple data summaries. D...
14,432
[ { "from": "human", "value": "Does anyone have any experience with a good wpf pivot table control?\n" }, { "from": "gpt", "value": "Yes, there are several good options for WPF pivot table controls that you can consider. Here are some popular ones:\n\n1. **DevExpress Pivot Grid Control**: This is ...
Any recommended practices for cleaning up "header spaghetti" which is causing extremely slow compilation times (Linux/Unix)? Is there any equvalent to "#pragma once" with GCC? (found conflicting messages regarding this) Thanks.
Cleaning up "header spaghetti" (the excessive or inefficient use of header files in C/C++ projects) can significantly improve compilation times. Here are some recommended practices: ### Recommended Practices 1. **Use Forward Declarations**: Whenever possible, use forward declarations instead of including headers. Thi...
8,560
[ { "from": "human", "value": "Any recommended practices for cleaning up \"header spaghetti\" which is causing extremely\nslow compilation times (Linux/Unix)?\nIs there any equvalent to \"#pragma once\" with GCC? \n(found conflicting messages regarding this)\nThanks.\n" }, { "from": "gpt", "value"...
I asked a somewhat related question but I want it to make it more concrete and 'programming' oriented, so here it goes: Does any body know, if there is a .NET, JAVA or any other Framework, library, .jar file or what ever: to access S.M.A.R.T. Statistics? Thanks!
Yes, there are several libraries and tools available in different programming environments to access S.M.A.R.T. statistics for hard drives. Here’s a brief overview of options for .NET and Java: ### .NET 1. **SMART.NET**: - A .NET library that allows you to access S.M.A.R.T. attributes of drives. It can read the S...
12,057
[ { "from": "human", "value": "I asked a somewhat related question but I want it to make it more concrete and 'programming' oriented, so here it goes:\nDoes any body know, if there is a .NET, JAVA or any other Framework, library, .jar file or what ever: to access S.M.A.R.T. Statistics?\nThanks!\n" }, { ...
We're using TFS Build Server to ensure that all files checked in by developers are going to compile to a working source tree, cuz there's nothing worse than a broken build! Anyway we've having some problems with the drop location that Build Server wants to use, we keep getting this error: TFS209011: Could not create d...
The error you're encountering, `TFS209011`, indicates that the TFS Build Server is having trouble accessing the drop location due to connection limits. Here are several potential reasons and troubleshooting steps you can take to resolve this issue: 1. **Check Network Share Configuration**: Even though you've stated th...
11,389
[ { "from": "human", "value": "We're using TFS Build Server to ensure that all files checked in by developers are going to compile to a working source tree, cuz there's nothing worse than a broken build!\nAnyway we've having some problems with the drop location that Build Server wants to use, we keep getting ...
I have a Java bean like this: class Person { int age; String name; } I'd like to iterate over a collection of these beans in a JSP, showing each person in a HTML table row, and in the last row of the table I'd like to show the total of all the ages. The code to generate the table rows will look something like this...
To calculate the total age of the `Person` objects in your JSP without using scriptlets, you can utilize JSTL (JavaServer Pages Standard Tag Library) functions. Since JSTL doesn't provide a direct way to sum a property of objects in a collection, you can achieve this by using a combination of custom JSTL tags or just p...
13,016
[ { "from": "human", "value": "I have a Java bean like this:\nclass Person {\n int age;\n String name;\n}\n\nI'd like to iterate over a collection of these beans in a JSP, showing each person in a HTML table row, and in the last row of the table I'd like to show the total of all the ages.\nThe code to gener...
I want to log the Poison message that my wcf service is dropping using MSMQ 3.0 and windows 2003
Logging poison messages in a WCF service that uses MSMQ (Microsoft Message Queuing) can be crucial for diagnosing issues with message processing. A poison message is typically a message that causes the consumer to fail repeatedly, which leads to it being moved to the dead-letter queue (DLQ). Here's how you can log pois...
12,023
[ { "from": "human", "value": "I want to log the Poison message that my wcf service is dropping using MSMQ 3.0 and windows 2003\n" }, { "from": "gpt", "value": "Logging poison messages in a WCF service that uses MSMQ (Microsoft Message Queuing) can be crucial for diagnosing issues with message pro...
I'm working on a WPF application that sometimes exhibits odd problems and appears to hang in the UI. It is inconsistent, it happens in different pages, but it happens often enough that it is a big problem. I should mention that it is not a true hang as described below. My first thought was that the animations of some...
It sounds like you are experiencing a frustrating issue with your WPF application, especially since the problem seems to manifest inconsistently and doesn't lock the entire UI. Here are several suggestions and techniques you can use to diagnose and potentially fix the issue: ### 1. Investigate Long-Running Operations ...
8,950
[ { "from": "human", "value": "I'm working on a WPF application that sometimes exhibits odd problems and appears to hang in the UI. It is inconsistent, it happens in different pages, but it happens often enough that it is a big problem. I should mention that it is not a true hang as described below.\nMy fir...
I have a Nintendo Wii, and I've got devkitpro working to load some simple programs. The example source code that I've been able to find is very simplistic, such as drawing and rotating a simple shape. I've been looking for more in depth tutorials, and I haven't been able to find much. Most of the applications avail...
Getting started with more advanced graphics on the Nintendo Wii can be a bit challenging due to the limited resources and documentation available. However, there are several avenues you can explore to gain a better understanding of graphics programming on the Wii. Here are some tutorials and resources you may find help...
11,923
[ { "from": "human", "value": "I have a Nintendo Wii, and I've got devkitpro working to load some simple programs. The example source code that I've been able to find is very simplistic, such as drawing and rotating a simple shape. \nI've been looking for more in depth tutorials, and I haven't been able to ...
I saw this on reddit, and it reminded me of one of my vim gripes: It shows the UI in German. I want English. But since my OS is set up in German (the standard at our office), I guess vim is actually trying to be helpful. What magic incantations must I perform to get vim to switch the UI language? I have tried googling ...
To change the UI language of Vim to English, even when your operating system is set to German, you can set the `LANG` environment variable before starting Vim. Here are a couple of ways to do it: ### Method 1: Temporary Change in the Terminal You can temporarily set the `LANG` variable for the current terminal sessio...
11,362
[ { "from": "human", "value": "I saw this on reddit, and it reminded me of one of my vim gripes: It shows the UI in German. I want English. But since my OS is set up in German (the standard at our office), I guess vim is actually trying to be helpful.\nWhat magic incantations must I perform to get vim to swit...
I'm trying to learn RegEx in Ruby, based on what I'm reading in "The Rails Way". But, even this simple example has me stumped. I can't tell if it is a typo or not: text.gsub(/\s/, "-").gsub([^\W-], '').downcase It seems to me that this would replace all spaces with -, then anywhere a string starts with a non letter or...
It looks like there's a misunderstanding in how the regular expression is written. Let's clarify what's going on in your code snippet. First, let's break down the original code: ```ruby text.gsub(/\s/, "-").gsub([^\W-], '').downcase ``` 1. `gsub(/\s/, "-")` - This part is correct. It replaces all whitespace characte...
13,371
[ { "from": "human", "value": "I'm trying to learn RegEx in Ruby, based on what I'm reading in \"The Rails Way\". But, even this simple example has me stumped. I can't tell if it is a typo or not:\ntext.gsub(/\\s/, \"-\").gsub([^\\W-], '').downcase\n\nIt seems to me that this would replace all spaces with -, ...
I'm trying to get a case-insensitive search with two strings in JavaScript working. Normally it would be like this: var string="Stackoverflow is the BEST"; var result= string.search(/best/i); alert(result); The /i flag would be for case-insensitive. But I need to search for a second string; without the flag it works p...
To perform a case-insensitive search using a variable in JavaScript, you can create a regular expression dynamically by using the `RegExp` constructor. This allows you to use the content of the variable while still applying the case-insensitive flag. Here's how you can do it: ```javascript var string = "Stackoverflow...
16,605
[ { "from": "human", "value": "I'm trying to get a case-insensitive search with two strings in JavaScript working.\nNormally it would be like this:\nvar string=\"Stackoverflow is the BEST\";\nvar result= string.search(/best/i);\nalert(result);\n\nThe /i flag would be for case-insensitive.\nBut I need to searc...
I need to write a java script. This is supposed to validate if the checkbox is selected in the page or not. The problem here is that the check box is inside a grid and is generated dynamically. The reason being the number of check box that need to be rendered is not know at design time. So the id is know only at the se...
To validate if a checkbox inside a dynamically generated grid is selected, you can use JavaScript to iterate through all checkboxes and check their status. Since the IDs of the checkboxes are known only on the server side, you might want to use a common class name or attribute selector to identify them in your JavaScri...
12,499
[ { "from": "human", "value": "I need to write a java script. This is supposed to validate if the checkbox is selected in the page or not. The problem here is that the check box is inside a grid and is generated dynamically. The reason being the number of check box that need to be rendered is not know at desi...
Backgrounder: The PIMPL Idiom (Pointer to IMPLementation) is a technique for implementation hiding in which a public class wraps a structure or class that cannot be seen outside the library the public class is part of. This hides internal implementation details and data from the user of the library. When implementing t...
The PIMPL idiom (Pointer to IMPLementation) is a valuable technique primarily used to achieve implementation hiding and to minimize dependencies in C++ libraries. Your question about why one would implement methods like `Purr` in the `CatImpl` class rather than directly in the public `Cat` class revolves around several...
12,997
[ { "from": "human", "value": "Backgrounder:\nThe PIMPL Idiom (Pointer to IMPLementation) is a technique for implementation hiding in which a public class wraps a structure or class that cannot be seen outside the library the public class is part of.\nThis hides internal implementation details and data from t...
I'm reading text from a flat file in c# and need to test whether certain values are dates. They could be in either YYYYMMDD format or MM/DD/YY format. What is the simplest way to do this in .Net?
To check whether certain values in a flat file are valid dates in either the `YYYYMMDD` or `MM/DD/YY` formats in C#, you can use the `DateTime.TryParseExact` method. This method allows you to specify the exact formats you are looking for and will safely attempt to parse the string into a `DateTime` object without throw...
14,467
[ { "from": "human", "value": "I'm reading text from a flat file in c# and need to test whether certain values are dates. They could be in either YYYYMMDD format or MM/DD/YY format. What is the simplest way to do this in .Net?\n" }, { "from": "gpt", "value": "To check whether certain values in a f...
I've got a DataSet in VisualStudio 2005. I need to change the datatype of a column in one of the datatables from System.Int32 to System.Decimal. When I try to change the datatype in the DataSet Designer I receive the following error: Property value is not valid. Cannot change DataType of a column once it has data...
The error you're encountering indicates that the DataSet you are working with already contains data in the specific column you are trying to change. Visual Studio's DataSet Designer prevents you from changing the data type of a column that already has data, to avoid potential data loss or corruption. Here are a few st...
14,423
[ { "from": "human", "value": "I've got a DataSet in VisualStudio 2005. I need to change the datatype of a column in one of the datatables from System.Int32 to System.Decimal. When I try to change the datatype in the DataSet Designer I receive the following error:\n\nProperty value is not valid. Cannot cha...
When you are learning a new language, what is there a particularly good/effective exercise to help get the hang of it? And why? EDIT: Preferably looking for things that are more complicated that 'Hello World'.
When learning a new programming language, diving into more complex projects can significantly enhance your understanding and proficiency. Here are a few effective exercises that go beyond the "Hello World" level: ### 1. Build a To-Do List Application **Why?** This project covers multiple core programming concepts: d...
11,984
[ { "from": "human", "value": "When you are learning a new language, what is there a particularly good/effective exercise to help get the hang of it? And why?\nEDIT:\nPreferably looking for things that are more complicated that 'Hello World'.\n" }, { "from": "gpt", "value": "When learning a new pr...
I have a pivot table on an olap cube. I can go into a page field and manually deselect multiple items. How can I do this in VBA based on a list of items I need excluded? (n.b. I do not have a corrresponding list of items I need included) I know how to exclude these items in other ways, by altering the underlying query ...
To programmatically deselect items from a PivotTable in Excel VBA based on a list of items you want to exclude, you can loop through the items in the relevant PivotField and set the `Visible` property to `False` for those items that match your exclusion list. Here’s how you can do this step-by-step: 1. **Prepare your...
12,104
[ { "from": "human", "value": "I have a pivot table on an olap cube. I can go into a page field and manually deselect multiple items. How can I do this in VBA based on a list of items I need excluded? (n.b. I do not have a corrresponding list of items I need included)\nI know how to exclude these items in oth...
Something I have always been interested in out of curiosity, is there a tool or utility that will allow me so log post parameters sent to a website? Not a personal website, any site on the web. Reason for this, is that I want to be able to develop a .NET application without having to add the overhead of creating a WebB...
Yes, there are several tools and utilities you can use to log POST parameters and monitor HTTP requests sent to websites. Here are some popular ones: ### 1. **Fiddler** Fiddler is a free web debugging proxy tool that logs all HTTP(S) traffic between your computer and the internet. It allows you to inspect traffic, set...
12,986
[ { "from": "human", "value": "Something I have always been interested in out of curiosity, is there a tool or utility that will allow me so log post parameters sent to a website? Not a personal website, any site on the web.\nReason for this, is that I want to be able to develop a .NET application without hav...
You have multiple network adapters. Bind a UDP socket to an local port, without specifying an address. Receive packets on one of the adapters. How do you get the local ip address of the adapter which received the packet? The question is, "What is the ip address from the receiver adapter?" not the address from the sen...
To determine the local IP address of the adapter that received a UDP packet in a situation where you have multiple network adapters, you need to retrieve information about the socket after receiving the packet. This is because the local IP address is not directly provided by the `recvfrom` function call. Here is a gen...
9,438
[ { "from": "human", "value": "\nYou have multiple network adapters.\nBind a UDP socket to an local port, without specifying an address.\nReceive packets on one of the adapters.\n\nHow do you get the local ip address of the adapter which received the packet?\nThe question is, \"What is the ip address from the...
Is there any way to edit column names in a DataGridView?
Yes, you can edit column names in a `DataGridView` in a WinForms application using C#. Here are the steps to change the column names: ### Method 1: Setting Column Header Text in Designer 1. Open your form in the Visual Studio Designer. 2. Select the `DataGridView` control. 3. In the Properties window, find the `Colum...
10,575
[ { "from": "human", "value": "Is there any way to edit column names in a DataGridView?\n" }, { "from": "gpt", "value": "Yes, you can edit column names in a `DataGridView` in a WinForms application using C#. Here are the steps to change the column names:\n\n### Method 1: Setting Column Header Text...
Using C# .NET 2.0, I have a composite data class that does have the [Serializable] attribute on it. I am creating an XMLSerializer class and passing that into the constructor: XmlSerializer serializer = new XmlSerializer(typeof(DataClass)); I am getting an exception saying: There was an error reflecting type. Insi...
In C#, the `[Serializable]` attribute is used primarily for binary serialization, which is not directly related to XML serialization. When you are using the `XmlSerializer`, it does not require the `[Serializable]` attribute on the classes being serialized. Instead, `XmlSerializer` relies on public properties (or field...
13,082
[ { "from": "human", "value": "Using C# .NET 2.0, I have a composite data class that does have the [Serializable] attribute on it. I am creating an XMLSerializer class and passing that into the constructor:\nXmlSerializer serializer = new XmlSerializer(typeof(DataClass));\n\nI am getting an exception saying:...
Has anyone had and solved a problem where programs would terminate without any indication of why? I encounter this problem about every 6 months and I can get it to stop by having me (the administrator) log-in then out of the machine. After this things are back to normal for the next 6 months. I've seen this on Windo...
The issue you're experiencing with programs terminating unexpectedly and only resolving after logging in and out of the system is certainly unusual. Here are some potential causes and steps you can take to troubleshoot the problem further: ### 1. User Profile Issues Corruption in the user profile can lead to unexpecte...
12,690
[ { "from": "human", "value": "Has anyone had and solved a problem where programs would terminate without any indication of why? I encounter this problem about every 6 months and I can get it to stop by having me (the administrator) log-in then out of the machine. After this things are back to normal for th...
When you use Zedgraph for linegraphs and set IsSmooth to true, the lines are nicely curved instead of having hard corners/angles. While this looks much better for most graphs -in my humble opinion- there is a small catch. The smoothing algorithm makes the line take a little 'dive' or 'bump' before going upwards or down...
The issue you're experiencing with the smoothing algorithm in ZedGraph causing the line to dip below the x-axis is a common one when dealing with sharp transitions in data. While the smoothing provides aesthetically pleasing curves, it can lead to misleading representations of the data, particularly when there are larg...
12,800
[ { "from": "human", "value": "When you use Zedgraph for linegraphs and set IsSmooth to true, the lines are nicely curved instead of having hard corners/angles.\nWhile this looks much better for most graphs -in my humble opinion- there is a small catch. The smoothing algorithm makes the line take a little 'di...
What is the best way to generate a current datestamp in Java? YYYY-MM-DD:hh-mm-ss
To generate a current datestamp in the format `YYYY-MM-DD:hh-mm-ss` in Java, you can use the `java.time` package, which was introduced in Java 8. The `LocalDateTime` class is particularly useful for this purpose. Here's a sample code snippet that demonstrates how to generate the desired datestamp: ```java import java...
14,051
[ { "from": "human", "value": "What is the best way to generate a current datestamp in Java? \nYYYY-MM-DD:hh-mm-ss\n" }, { "from": "gpt", "value": "To generate a current datestamp in the format `YYYY-MM-DD:hh-mm-ss` in Java, you can use the `java.time` package, which was introduced in Java 8. The ...
What delphi function asserts that an object is not nil?
In Delphi, the function that asserts that an object is not nil is `Assert`. You can use it in combination with a condition that checks for nil. For example: ```delphi uses System.SysUtils; procedure SomeProcedure(AObject: TObject); begin Assert(AObject <> nil, 'AObject should not be nil'); // Continue with the ...
17,509
[ { "from": "human", "value": "What delphi function asserts that an object is not nil?\n" }, { "from": "gpt", "value": "In Delphi, the function that asserts that an object is not nil is `Assert`. You can use it in combination with a condition that checks for nil. For example:\n\n```delphi\nuses\n ...
How is it that Ruby allows a class access methods outside of the class implicitly? Example: class Candy def land homer end end def homer puts "Hello" end Candy.new.land #Outputs Hello
In Ruby, the ability for a class instance method to access methods defined outside of its class is due to Ruby's scoping rules, specifically how it handles method visibility and accessibility. Here's an explanation of what's happening in your example: 1. **Global Scope**: In Ruby, methods that are defined at the top l...
12,757
[ { "from": "human", "value": "How is it that Ruby allows a class access methods outside of the class implicitly?\nExample:\nclass Candy\n def land\n homer\n end\nend\n\ndef homer\n puts \"Hello\"\nend\n\nCandy.new.land #Outputs Hello\n\n" }, { "from": "gpt", "value": "In Ruby, the...
JSON text (RFC 4627) has unambigious representation of objects, arrays, strings, numbers, Boolean values (literally true or false) and null. However, it has nothing defined for representing time information like date and time of day, which is very common in applications. What are the current methods in use to represent...
Representing date and time information in JSON, given the constraints of RFC 4627, typically involves using one of the following common methods. Each method has its pros and cons based on various factors such as readability, precision, interoperability, and context-specific requirements. ### 1. ISO 8601 String Represe...
11,302
[ { "from": "human", "value": "JSON text (RFC 4627) has unambigious representation of objects, arrays, strings, numbers, Boolean values (literally true or false) and null. However, it has nothing defined for representing time information like date and time of day, which is very common in applications. What ar...
I'm running git-diff on a file, but the change is at the end of a long line. If I use cursor keys to move right, it loses colour-coding—and worse the lines don't line up—making it harder to track the change. Is there a way to prevent that problem or to simply make the lines wrap instead? I'm running Git 1.5.5 via mingw...
In Git, the default behavior for `git diff` is to use a pager (like `less`) to display output, which may not handle long lines gracefully, especially in older versions like 1.5.5. However, you can adjust how `git diff` outputs its content to improve readability and maintain the color-coding without losing track of chan...
14,725
[ { "from": "human", "value": "I'm running git-diff on a file, but the change is at the end of a long line.\nIf I use cursor keys to move right, it loses colour-coding—and worse the lines don't line up—making it harder to track the change.\nIs there a way to prevent that problem or to simply make the lines wr...
I'm doing some Android development, and I much prefer Visual Studio, but I'll have to use Eclipse for this. Has anyone made a tool which can make Eclipse look and behave more like visual studio? I mainly can't stand its clippyesqe suggestions on how I should program (Yes, I know I have not yet used that private field! ...
While there isn't a specific tool that can make Eclipse completely behave like Visual Studio, there are several plugins and settings you can configure in Eclipse to improve your experience and make it feel a bit more like Visual Studio. Here are some suggestions: 1. **Eclipse Themes and UI Customization**: - You ca...
11,416
[ { "from": "human", "value": "I'm doing some Android development, and I much prefer Visual Studio, but I'll have to use Eclipse for this.\nHas anyone made a tool which can make Eclipse look and behave more like visual studio? I mainly can't stand its clippyesqe suggestions on how I should program (Yes, I kno...
I want to use VBScript to catch errors and log them (ie on error "log something") then resume the next line of the script. For example, On Error Resume Next 'Do Step 1 'Do Step 2 'Do Step 3 When an error occurs on step 1, I want it to log that error (or perform other custom functions with it) then resume at step 2. I...
In VBScript, error handling is done using the `On Error Resume Next` statement, which allows the script to continue executing the next line of code even if an error occurs. However, VBScript does not support custom error-handling labels (like `myErrCatch` in your example) in the way you have outlined. Instead, you can...
13,487
[ { "from": "human", "value": "I want to use VBScript to catch errors and log them (ie on error \"log something\") then resume the next line of the script.\nFor example,\n\nOn Error Resume Next\n'Do Step 1\n'Do Step 2\n'Do Step 3\n\nWhen an error occurs on step 1, I want it to log that error (or perform other...
I made a class from Linq to SQL Clasees with VS 2008 SP1 Framework 3.5 SP1, in this case I extended the partial partial void UpdateMyTable(MyTable instance){ // Business logic // Validation rules, etc. } My problem is when I execute db.SubmitChanges(), it executes UpdateMyTable and makes the validations but it d...
The error message you are encountering typically indicates that the validation rules you implemented in the `UpdateMyTable` partial method are causing the update operation to fail. When you extend the `UpdateMyTable` method, it's crucial that your validation logic does not prevent the update from proceeding. Here are s...
13,460
[ { "from": "human", "value": "I made a class from Linq to SQL Clasees with VS 2008 SP1 Framework 3.5 SP1, in this case I extended the partial\npartial void UpdateMyTable(MyTable instance){\n // Business logic\n // Validation rules, etc.\n}\n\nMy problem is when I execute db.SubmitChanges(), it executes U...
How would I go about binding the following object, Car, to a gridview? public class Car { long Id {get; set;} Manufacturer Maker {get; set;} } public class Manufacturer { long Id {get; set;} String Name {get; set;} } The primitive types get bound easy but I have found no way of displaying anything for Ma...
Yes, you can display the `Manufacturer.Name` in a GridView bound to your `Car` objects. The good news is that you don't necessarily need to store `ManufacturerId` in the `Car` class or set up a lookup repository; you can leverage a custom property in your `Car` class to bind directly to the `Name` property of the `Manu...
9,763
[ { "from": "human", "value": "How would I go about binding the following object, Car, to a gridview?\n\npublic class Car\n{\n long Id {get; set;}\n Manufacturer Maker {get; set;}\n}\n\npublic class Manufacturer\n{\n long Id {get; set;}\n String Name {get; set;}\n}\n\nThe primitive types get bound eas...
I thought that CSIDL_COMMON_APPDATA\company\product should be the place to put files that are common for all users of the application and that the application can modify, however, on Vista this is a read-only location, unless modified by the installer (as per MSDN - http://msdn.microsoft.com/en-us/library/ms995853.aspx...
When dealing with application data locations in Windows, especially on Vista and later versions, it’s important to understand how file access permissions work, particularly with CSIDL_COMMON_APPDATA. CSIDL_COMMON_APPDATA is designed for application data that is shared across all users and can indeed be writable, but ...
12,850
[ { "from": "human", "value": "I thought that CSIDL_COMMON_APPDATA\\company\\product should be the place to put files that are common for all users of the application and that the application can modify, however, on Vista this is a read-only location, unless modified by the installer (as per MSDN - http://msd...
I've never developed a web application that uses distributed memory. Is it common practice to run a tool such as Microsoft Velocity on my local machine as I develop, should I run Velocity on another server as I develop, or should I just develop as normal (default session & cache) and use Velocity only after I've deplo...
When developing a web application that will eventually use a distributed cache like Microsoft Velocity (now known as AppFabric Caching), it's important to consider how your development environment is set up. Here are some approaches you can take: ### 1. **Local Development with Velocity:** Running Velocity on your loc...
13,653
[ { "from": "human", "value": "I've never developed a web application that uses distributed memory. \nIs it common practice to run a tool such as Microsoft Velocity on my local machine as I develop, should I run Velocity on another server as I develop, or should I just develop as normal (default session & cac...
I want to search a directory for all files that match a certain pattern. Surprisingly, I have not had to do this since vb6 (Dir)... I'm sure things have changed since then! -Thanks
Yes, there are many modern ways to search for files in a directory based on specific patterns, especially in languages like Python, PowerShell, and Bash. Here are a few examples using different methods. ### 1. **Using Python** Python has a powerful `os` and `glob` module that can help you search for files. Here's a si...
13,799
[ { "from": "human", "value": "I want to search a directory for all files that match a certain pattern.\nSurprisingly, I have not had to do this since vb6 (Dir)... I'm sure things have changed since then!\n-Thanks\n" }, { "from": "gpt", "value": "Yes, there are many modern ways to search for files...
I've been looking into OSGi recently and think it looks like a really good idea for modular Java apps. However, I was wondering how OSGi would work in a web application, where you don't just have code to worry about - also HTML, images, CSS, that sort of thing. At work we're building an application which has multiple '...
Using OSGi for a web application, especially one using JSF and IceFaces, can indeed be a powerful way to achieve modularity. Here are some ideas and suggestions on how to handle web resources (HTML, CSS, images) and other aspects when integrating OSGi into your application. ### 1. OSGi Bundle Structure Each module of...
10,827
[ { "from": "human", "value": "I've been looking into OSGi recently and think it looks like a really good idea for modular Java apps.\nHowever, I was wondering how OSGi would work in a web application, where you don't just have code to worry about - also HTML, images, CSS, that sort of thing.\nAt work we're b...
Some of my colleagues use special comments on their bug fixes, for example: // 2008-09-23 John Doe - bug 12345 // <short description> Does this make sense? Do you comment bug fixes in a special way? Please let me know.
Using special comments for bug fixes, as your colleagues do, can be quite beneficial for several reasons: 1. **Traceability**: Including the date, author, and bug number makes it easy to track changes and understand the context of the fix. If someone needs to review the history of a particular bug, they can quickly fi...
16,117
[ { "from": "human", "value": "Some of my colleagues use special comments on their bug fixes, for example:\n// 2008-09-23 John Doe - bug 12345\n// <short description>\n\nDoes this make sense?\nDo you comment bug fixes in a special way?\nPlease let me know.\n" }, { "from": "gpt", "value": "Using sp...
I am a totally blind programmer who would like to learn Python. Unfortunately the fact that code blocks are represented with different levels of indentation is a major stumbling block. I was wondering if there were any tools available that would allow me to write code using braces or some other code block delimiter and...
There are a few ways you can work with Python to address your concern about indentation. Although Python uses indentation to define code blocks, there are some tools and techniques you can use to write Python code with braces or other delimiters, and then convert that to the proper indentation. ### 1. Custom Preproces...
12,147
[ { "from": "human", "value": "I am a totally blind programmer who would like to learn Python. Unfortunately the fact that code blocks are represented with different levels of indentation is a major stumbling block. I was wondering if there were any tools available that would allow me to write code using brac...
Working with software day-to-day usually means you have to juggle project work, meetings, calls and other interrupts. What single technique, trick, or tool do you find most useful in managing your time? How do you stay focused? What is your single biggest distraction from your work?
Managing time effectively in a busy software work environment can be challenging. Here are some insights based on common practices in the industry: ### Most Useful Technique **Time Blocking**: This technique involves scheduling specific blocks of time for different tasks or types of work. By allocating dedicated time ...
15,918
[ { "from": "human", "value": "Working with software day-to-day usually means you have to juggle project work, meetings, calls and other interrupts.\nWhat single technique, trick, or tool do you find most useful in managing your time?\nHow do you stay focused?\nWhat is your single biggest distraction from you...
I have to continue to support VB6 applications. I've got both VB6 (Visual Studio 6) installed and Visual Studio 2008 as well. Can I read and write to VB6 projects while in Visual Studio 2008? Will it damage or destroy my VB6 application? It would be very cool if I could free up a lot of space and get rid of Visu...
You can indeed read and write to VB6 projects using Visual Studio 2008, but it is important to note that Visual Studio 2008 does not directly support VB6 projects. VB6 projects (.vbp files) are not compatible with Visual Studio 2008, which primarily supports .NET languages (like VB.NET and C#). Here are a few importan...
14,926
[ { "from": "human", "value": "I have to continue to support VB6 applications. I've got both VB6 (Visual Studio 6) installed and Visual Studio 2008 as well. Can I read and write to VB6 projects while in Visual Studio 2008? Will it damage or destroy my VB6 application? It would be very cool if I could f...
So I'm working on some legacy code that's heavy on the manual database operations. I'm trying to maintain some semblance of quality here, so I'm going TDD as much as possible. The code I'm working on needs to populate, let's say a List<Foo> from a DataReader that returns all the fields required for a functioning Foo. H...
It sounds like you're grappling with the complexities of unit testing database interactions, particularly when mocking DataReader behavior. Since your approach using Rhino.Mocks can quickly become tedious and brittle, here are some strategies that can help streamline your tests while maintaining quality. ### 1. Use a ...
10,412
[ { "from": "human", "value": "So I'm working on some legacy code that's heavy on the manual database operations. I'm trying to maintain some semblance of quality here, so I'm going TDD as much as possible.\nThe code I'm working on needs to populate, let's say a List<Foo> from a DataReader that returns all th...
Objective: use the standard Win32 MonthCal control, and paint days such as holidays in RED. It seems like the Win32's native approach would be use the MCN_GETDAYSTATE notification, which seems to allow only painting specific days in Bold. Possible (but declined) solution would be to write my own painted-at-will MonthCa...
Customizing the Win32 `MonthCal` control to paint specific days, such as holidays, in red can be a bit tricky since the control does not natively support arbitrary coloring of days. However, you can work around this limitation by handling the `MCN_GETDAYSTATE` notification and using the `WM_PAINT` message to perform cu...
10,255
[ { "from": "human", "value": "Objective: use the standard Win32 MonthCal control, and paint days such as holidays in RED.\nIt seems like the Win32's native approach would be use the MCN_GETDAYSTATE notification, which seems to allow only painting specific days in Bold.\nPossible (but declined) solution would...
We have seen what appears to be GDI Object leakage when the Infralution VirtualTree control assigns Icons in the GetRowData event. The VirtualTree is contained in a control that is contained within a TabControl. Tabbing away and back to the tree results in the "GDI Objects" counter in Task Manager to continually incr...
It sounds like you're experiencing a common issue with GDI object leakage in a Windows Forms application, particularly related to the Infralution VirtualTree control and its handling of icons during the `GetRowData` event. GDI object leaks can lead to performance issues and crashes due to exhaustion of resources, espec...
9,136
[ { "from": "human", "value": "We have seen what appears to be GDI Object leakage when the Infralution VirtualTree control assigns Icons in the GetRowData event. The VirtualTree is contained in a control that is contained within a TabControl. Tabbing away and back to the tree results in the \"GDI Objects\" ...
We're looking into developing a product that would use Amazon's cloud tools (EC2, SQS, etc), and I'm curious what tips/gotchas/pointers people that have used these technologies have. One tip/whatever per post, please.
One tip to keep in mind when using Amazon EC2 is to take advantage of **Spot Instances**. Spot Instances allow you to bid on unused EC2 capacity at potentially significantly lower prices than on-demand instances. However, keep in mind that Spot Instances can be interrupted with very little notice, so they are best suit...
18,191
[ { "from": "human", "value": "We're looking into developing a product that would use Amazon's cloud tools (EC2, SQS, etc), and I'm curious what tips/gotchas/pointers people that have used these technologies have.\nOne tip/whatever per post, please.\n" }, { "from": "gpt", "value": "One tip to keep...
I want to find out, with an SQL query, whether an index is UNIQUE or not. I'm using SQLite 3. I have tried two approaches: SELECT * FROM sqlite_master WHERE name = 'sqlite_autoindex_user_1' This returns information about the index ("type", "name", "tbl_name", "rootpage" and "sql"). Note that the sql column is empty wh...
To determine whether an index is UNIQUE or not in SQLite, you can query the `sqlite_master` table and inspect the `sql` column for the index definition. The `sql` column will contain the CREATE statement for the index, which will indicate whether it is a UNIQUE index. Here’s how you can do it: 1. First, query the `sq...
13,304
[ { "from": "human", "value": "I want to find out, with an SQL query, whether an index is UNIQUE or not. I'm using SQLite 3.\nI have tried two approaches:\nSELECT * FROM sqlite_master WHERE name = 'sqlite_autoindex_user_1'\n\nThis returns information about the index (\"type\", \"name\", \"tbl_name\", \"rootpa...
I'm a big fan of the Jadclipse plugin and I'd really like to upgrade to Eclipse 3.4 but the plugin currently does not work. Are there any other programs out there that let you use jad to view source of code you navigate to from Eclipse? (Very useful when delving into ambiguous code in stack traces).
If you're looking for alternatives to Jadclipse that work with Eclipse 3.4 or newer versions, there are several options you can consider for decompiling Java bytecode and viewing the source code directly in Eclipse: 1. **JD-Eclipse (Java Decompiler Eclipse Plugin)**: This is a popular alternative to Jadclipse. JD-Ecli...
15,215
[ { "from": "human", "value": "I'm a big fan of the Jadclipse plugin and I'd really like to upgrade to Eclipse 3.4 but the plugin currently does not work. Are there any other programs out there that let you use jad to view source of code you navigate to from Eclipse? (Very useful when delving into ambiguous c...
I would like to trash the mail received by a single qmail alias. I don't want any mail delivery errors, and I want qmail to be happy about having delivered the mail. How can I do this, preferably without adding another local email account?
To effectively discard emails sent to a specific qmail alias without generating delivery errors, you can create a `.qmail` file for that alias and configure it to discard all incoming messages. Here's how you can do it: 1. **Create the .qmail file**: Navigate to the home directory of the user that owns the alias (usua...
14,916
[ { "from": "human", "value": "I would like to trash the mail received by a single qmail alias. I don't want any mail delivery errors, and I want qmail to be happy about having delivered the mail.\nHow can I do this, preferably without adding another local email account?\n" }, { "from": "gpt", "v...
If I want to create the registry key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application\MyApp with the string value EventMessageFile : C:\Path\To\File.dll how do I define this in my WiX 3.0 WXS file? Examples of what the XML should look like is much appreciated.
To create a registry key in your WiX 3.0 WXS file, you can use the `<RegistryKey>` and `<RegistryValue>` elements. Below is an example of how you can define the registry key `HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application\MyApp` with the string value `EventMessageFile` set to `C:\Path\To\File...
11,057
[ { "from": "human", "value": "If I want to create the registry key\n\nHKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\Eventlog\\Application\\MyApp\n\nwith the string value\n\nEventMessageFile : C:\\Path\\To\\File.dll\n\nhow do I define this in my WiX 3.0 WXS file? Examples of what the XML should loo...
I've been using Eclipse pretty regularly for several years now, but I admit to not having explored all the esoterica it has to offer, particularly in the areas of what formatting features the editors offer. The main thing I miss from (X)emacs is the "align-regex" command, which let me take several lines into a region a...
Eclipse doesn't have a built-in feature that directly replicates Emacs' "align-regex" command for aligning text based on regex patterns. However, there are a few approaches you can take to achieve similar functionality in Eclipse: ### 1. Using the "Format" Feature: Eclipse has a built-in formatting feature that can ha...
15,439
[ { "from": "human", "value": "I've been using Eclipse pretty regularly for several years now, but I admit to not having explored all the esoterica it has to offer, particularly in the areas of what formatting features the editors offer.\nThe main thing I miss from (X)emacs is the \"align-regex\" command, whi...
I've been using Remote Desktop Connection to get into a workstation. But in this environment, I cannot use the power options in Start Menu. I need an alternative way to shutdown or restart. How do I control my computer's power state through the command line?
You can control your computer's power state through the command line using the `shutdown` command. Here are some useful options you can use with it: 1. **Open Command Prompt**: - You can open Command Prompt by pressing `Win + R`, typing `cmd`, and hitting `Enter`. 2. **Shutdown Command Syntax**: - The basic syn...
14,222
[ { "from": "human", "value": "I've been using Remote Desktop Connection to get into a workstation. But in this environment, I cannot use the power options in Start Menu. I need an alternative way to shutdown or restart.\nHow do I control my computer's power state through the command line?\n" }, { "fr...
If I have class ObjA { public ObjB B; } class ObjB { public bool Val; } and class ObjectToMock { public DoSomething(ObjA obj){...} } Is there any way to define an expectation that not only will DoSomething get called but that obj.B.Val == true? I have tried Expect.Call(delegate { mockObj.DoSomething(null...
To set up an expectation in a mocking framework that checks not only if a method is called but also if a property of an object passed to that method meets a certain condition, you need to use an appropriate constraint that checks the value of `obj.B.Val`. In your case, it looks like you are using a mocking framework t...
10,158
[ { "from": "human", "value": "If I have \nclass ObjA {\n public ObjB B;\n}\nclass ObjB {\n public bool Val;\n}\n\nand \nclass ObjectToMock {\n public DoSomething(ObjA obj){...}\n}\n\nIs there any way to define an expectation that not only will DoSomething get called but that obj.B.Val == true?\nI have tri...
Typically when writing new code you discover that you are missing a #include because the file doesn't compile. Simple enough, you add the required #include. But later you refactor the code somehow and now a couple of #include directives are no longer needed. How do I discover which ones are no longer needed? Of course...
Yes, there are several tools and techniques that can help you identify and remove unused `#include` directives in C/C++ projects, streamlining the process significantly compared to manual removal. Here are some options you might consider: 1. **Include-What-You-Use (IWYU)**: This is a popular tool that analyzes you...
12,398
[ { "from": "human", "value": "Typically when writing new code you discover that you are missing a #include because the file doesn't compile. Simple enough, you add the required #include. But later you refactor the code somehow and now a couple of #include directives are no longer needed. How do I discover wh...
This is what I have so far: myArray.map!{ rand(max) } Obviously, however, sometimes the numbers in the list are not unique. How can I make sure my list only contains unique numbers without having to create a bigger list from which I then just pick the n unique numbers? Edit: I'd really like to see this done w/o loop...
To generate an array of unique random numbers without using loops and without creating a larger list to sample from, you can leverage Ruby's `Set` class, which automatically handles uniqueness. Here's how you can do it with a combination of `Set` and `Array#new`: ```ruby require 'set' def unique_random_numbers(count,...
13,449
[ { "from": "human", "value": "This is what I have so far: \nmyArray.map!{ rand(max) }\n\nObviously, however, sometimes the numbers in the list are not unique. How can I make sure my list only contains unique numbers without having to create a bigger list from which I then just pick the n unique numbers?\nEd...
After understanding (quote), I'm curious as to how one might cause the statement to execute. My first thought was (defvar x '(+ 2 21)) `(,@x) but that just evaluates to (+ 2 21), or the contents of x. How would one run code that was placed in a list?
To execute code that is stored in a list in Common Lisp, you can use the `eval` function. When you store an expression in a list, it remains unevaluated until you explicitly evaluate it. In your example, you have the list `x` that contains an expression `(+ 2 21)`. To evaluate that expression, you can use `eval` as f...
16,252
[ { "from": "human", "value": "After understanding (quote), I'm curious as to how one might cause the statement to execute. My first thought was\n(defvar x '(+ 2 21))\n`(,@x)\n\nbut that just evaluates to (+ 2 21), or the contents of x. How would one run code that was placed in a list?\n" }, { "from...
How can someone validate that a specific element exists in an XML file? Say I have an ever changing XML file and I need to verify every element exists before reading/parsing it.
To validate that a specific element exists in an XML file, you can follow these general steps: ### 1. Define the Expected Structure First, you need to define what the expected XML structure looks like. You can do this using an XML schema (XSD) or a Document Type Definition (DTD). This allows you to know which elements...
11,412
[ { "from": "human", "value": "How can someone validate that a specific element exists in an XML file? Say I have an ever changing XML file and I need to verify every element exists before reading/parsing it. \n" }, { "from": "gpt", "value": "To validate that a specific element exists in an XML fi...
I'm trying to fix a non-responsive USB device that's masquerading as a virtual COM port. Manual replugging works, but there may be up to 12 of these units. Is there an API command to do the programmatic equivalent of the unplug/replug cycle?
To programmatically manage USB devices on a system, including effectively performing an "unplug" and "replug" operation, you typically have a few options depending on the operating system you are using. Below are methods for Windows and Linux: ### For Windows: You can use the `DevCon` utility, which is a command-line...
11,828
[ { "from": "human", "value": "I'm trying to fix a non-responsive USB device that's masquerading as a virtual COM port. Manual replugging works, but there may be up to 12 of these units. Is there an API command to do the programmatic equivalent of the unplug/replug cycle?\n" }, { "from": "gpt", "v...
I am trying to do the following in SQL*PLUS in ORACLE. Create a variable Pass it as output variable to my method invocation Print the value from output variable I get undeclared variable error. I am trying to create a variable that persists in the session till i close the SQL*PLUS window. variable subhandle number;...
In Oracle SQL*Plus, you can't create variables in the same way as you would in a programming language. However, you can use SQL*Plus bind variables for this purpose. Bind variables can persist throughout the session and can be used to store values. Here's how you can achieve what you're aiming to do: 1. **Create a bi...
16,034
[ { "from": "human", "value": "I am trying to do the following in SQL*PLUS in ORACLE.\n\nCreate a variable\nPass it as output variable to my method invocation\nPrint the value from output variable\n\nI get\n\nundeclared variable\n\nerror. I am trying to create a variable that persists in the session till i cl...
I would like to distribute my .NET programs without the .NET framework. Is it possible to compile a .NET program to machine code?
Yes, it is possible to compile a .NET program to machine code, which allows you to distribute your application without needing the .NET runtime installed on the target machine. Here are a couple of options you can consider: 1. **Native AOT (Ahead-of-Time Compilation)**: With .NET 6 and later, you can use the Native AO...
14,238
[ { "from": "human", "value": "I would like to distribute my .NET programs without the .NET framework. Is it possible to compile a .NET program to machine code?\n" }, { "from": "gpt", "value": "Yes, it is possible to compile a .NET program to machine code, which allows you to distribute your appli...
Tomcat (version 5 here) stores session information in memory. When clustering this information is periodically broadcast to other servers in the cluster to keep things in sync. You can use a database store to make sessions persistant but this information is only written periodically as well and is only really used for ...
Using a database as the primary session store in Tomcat is possible, though Tomcat's native session management is typically focused on in-memory sessions. To achieve this, you will need to implement a custom session manager that stores session data in a database instead of relying on the default in-memory mechanism. He...
10,260
[ { "from": "human", "value": "Tomcat (version 5 here) stores session information in memory. When clustering this information is periodically broadcast to other servers in the cluster to keep things in sync. You can use a database store to make sessions persistant but this information is only written periodic...
I have a table in SQL Server that I inherited from a legacy system thats still in production that is structured according to the code below. I created a SP to query the table as described in the code below the table create statement. My issue is that, sporadically, calls from .NET to this SP both through the Enterpri...
Dealing with sporadic performance issues in a stored procedure that operates on a large table can be challenging. Here are several strategies to help you diagnose and potentially resolve the performance problem: ### 1. **Execution Plan Analysis** - **Query Execution Plans:** Use SQL Server Management Studio (SSMS) ...
8,586
[ { "from": "human", "value": "I have a table in SQL Server that I inherited from a legacy system thats still in production that is structured according to the code below. I created a SP to query the table as described in the code below the table create statement. My issue is that, sporadically, calls from ...
I want to test ASP.NET applications to get the feel for the MVC extension and compare that to what I can do today with Grails or Rails. The trouble is that being in a corporate environment, I can't install IIS on my workstation, neither on my DEV server. And - you guessed it - Visual Studio is not to be considered at t...
Yes, you can indeed run ASP.NET applications in a lightweight manner without needing to set up IIS on your workstation or DEV server. Here are a few options you can consider: 1. **Kestrel**: ASP.NET Core applications use Kestrel as their web server. Kestrel is a cross-platform web server that is lightweight and easy t...
12,466
[ { "from": "human", "value": "I want to test ASP.NET applications to get the feel for the MVC extension and compare that to what I can do today with Grails or Rails.\nThe trouble is that being in a corporate environment, I can't install IIS on my workstation, neither on my DEV server. And - you guessed it - ...
I need to send large files from silverlight 2 beta 2, so I need to set the sendchuncked property to true, but the property doesn't seem to exist. I've seen other posts on the internet where people have been able to set this in Silverlight. I disassebled the .dll at C:\Program Files\Microsoft SDKs\Silverlight\v2.0\Re...
In Silverlight 2, the `SendChunked` property is not directly accessible or available through the standard APIs, which is likely why you are not finding it. The ability to send chunked requests is something that is more commonly associated with ASP.NET and web protocols, rather than being an explicit feature of Silverli...
15,834
[ { "from": "human", "value": "I need to send large files from silverlight 2 beta 2, so I need to set the sendchuncked property to true, but the property doesn't seem to exist. I've seen other posts on the internet where people have been able to set this in Silverlight. \nI disassebled the .dll at C:\\Progr...
I'm trying to use the Stream.BeginWrite Async I/O API in .NET for a high-throughput situation with many short messages. As such, a scatter/gather API will reduce the number of context switches (and CPU usage) tremendously. Does this API use the LPBUFFERS Win32 API at all? Is there an alternative API for Scatter/Gather ...
The `Stream.BeginWrite` method in .NET does not directly expose or utilize the Win32 API's `LPBUFFERS` for scatter/gather I/O. Instead, .NET's `Stream` class is primarily designed for a more abstract and simpler model for I/O operations, which does not inherently include advanced features like scatter/gather I/O. Howe...
12,984
[ { "from": "human", "value": "I'm trying to use the Stream.BeginWrite Async I/O API in .NET for a high-throughput situation with many short messages. As such, a scatter/gather API will reduce the number of context switches (and CPU usage) tremendously. Does this API use the LPBUFFERS Win32 API at all? Is the...
I need to write code that picks up PGP-encrypted files from an FTP location and processes them. The files will be encrypted with my public key (not that I have one yet). Obviously, I need a PGP library that I can use from within Microsoft Access. Can you recommend one that is easy to use? I'm looking for something tha...
Working with PGP encryption in Microsoft Access can be a bit challenging due to the limitations of the environment, but it can be accomplished by utilizing an external library. One of the options you might consider is using **Gpg4win**, which includes GnuPG (GPG) — a widely used open-source implementation of the OpenPG...
10,903
[ { "from": "human", "value": "I need to write code that picks up PGP-encrypted files from an FTP location and processes them. The files will be encrypted with my public key (not that I have one yet). Obviously, I need a PGP library that I can use from within Microsoft Access. Can you recommend one that is ea...
I have an infopath 2007 form that I am developing which uses 3 different views. The 3 different views are basically the same form, but have different text boxes shown, depending upon what button the user selects. I run into a problem where 'view 1' has some form validation, but the user has selected 'view 2' and submit...
To manage form validation effectively across different views in InfoPath 2007, you can use a combination of conditional formatting and rules to control when validation occurs based on the active view. Here’s a step-by-step approach to implement this: 1. **Set Up a Field to Track the Current View:** - Create a fiel...
14,446
[ { "from": "human", "value": "I have an infopath 2007 form that I am developing which uses 3 different views.\nThe 3 different views are basically the same form, but have different text boxes shown, depending upon what button the user selects.\nI run into a problem where 'view 1' has some form validation, bu...
What are the pros / cons of using pthread_cond_wait or using a semaphore ? I am waiting for a state change like this : pthread_mutex_lock(&cam->video_lock); while(cam->status == WAIT_DISPLAY) { pthread_cond_wait(&cam->video_cond, &cam->video_lock); } pthread_mutex_unlock(&cam->video_lock); Using a properly initial...
When deciding between using `pthread_cond_wait` and `sem_wait` for signaling state changes in a multi-threaded environment, both methods have their merits and drawbacks. Here’s a comparison of the two approaches: ### Pros and Cons of `pthread_cond_wait` **Pros:** 1. **Mutex Association**: `pthread_cond_wait` is desig...
11,425
[ { "from": "human", "value": "What are the pros / cons of using pthread_cond_wait or using a semaphore ?\nI am waiting for a state change like this :\npthread_mutex_lock(&cam->video_lock);\nwhile(cam->status == WAIT_DISPLAY) {\n pthread_cond_wait(&cam->video_cond, &cam->video_lock);\n}\npthread_mutex_unlo...
In SQL, how do update a table, setting a column to a different value for each row? I want to update some rows in a PostgreSQL database, setting one column to a number from a sequence, where that column has a unique constraint. I hoped that I could just use: update person set unique_number = (select nextval('number_sequ...
You're correct that using `nextval('number_sequence')` in the way you've shown will only call it once, resulting in the same value being used for all updated rows. To update a table in PostgreSQL so that each row gets a different value from a sequence, you can use a Common Table Expression (CTE) with the `UPDATE` state...
15,528
[ { "from": "human", "value": "In SQL, how do update a table, setting a column to a different value for each row?\nI want to update some rows in a PostgreSQL database, setting one column to a number from a sequence, where that column has a unique constraint. I hoped that I could just use:\nupdate person set u...
In other words, a block of code like this: (setq initial-major-mode (lambda () (text-mode) (font-lock-mode) )) ... would come out looking like something like this: If something like this already exists, what is it? And if it doesn't exist, how should I go about writing it?
The code you've posted is an example of setting a variable, `initial-major-mode`, to a lambda function that configures the buffer to use `text-mode` and enables `font-lock-mode`. If you're looking to create a similar construct where you define a default mode with specific configurations, it sounds like you may be tryin...
11,384
[ { "from": "human", "value": "In other words, a block of code like this:\n(setq initial-major-mode\n (lambda ()\n (text-mode)\n (font-lock-mode)\n ))\n\n... would come out looking like something like this:\n\nIf something like this already exists, what is it? And if it doesn't exist, how should I g...
Yet again, my teacher was unable to answer my question. I knew who may be able to... So, I've never really learned C. In C++, I would, obviously, use a cout statement all of the time. In a recent assignment, my teacher told us to make sure to put setbuf( stdout , NULL ); at the top of main() in order to get an unbuff...
The statement `setbuf(stdout, NULL);` in C affects output sent to `stdout`, which is the standard output stream used by functions like `printf()` in C. When you call `setbuf(stdout, NULL);`, it disables output buffering for `stdout`, meaning that any output will be flushed immediately instead of being buffered until a ...
12,684
[ { "from": "human", "value": "Yet again, my teacher was unable to answer my question. I knew who may be able to...\nSo, I've never really learned C. In C++, I would, obviously, use a cout statement all of the time. In a recent assignment, my teacher told us to make sure to put \nsetbuf( stdout , NULL );\n\na...
Assemblies A and B are privately deployed and strongly named. Assembly A contains references to Assembly B. There are two versions of Assembly B: B1 and B2. I want to be able to indicate for Assembly A that it may bind to either B1 or B2 -- ideally, by incorporating this information into the assembly itself. What a...
When dealing with strongly named assemblies in .NET and trying to allow an assembly (Assembly A) to work with multiple versions of another assembly (Assembly B), there are several options you can consider: 1. **Assembly Binding Redirects**: Although this is commonly used with the Global Assembly Cache (GAC), it can al...
11,335
[ { "from": "human", "value": "Assemblies A and B are privately deployed and strongly named. Assembly A contains references to Assembly B. There are two versions of Assembly B: B1 and B2. I want to be able to indicate for Assembly A that it may bind to either B1 or B2 -- ideally, by incorporating this info...
How can you find out what are the long running queries are on Informix database server? I have a query that is using up the CPU and want to find out what the query is.
To identify long-running queries on an Informix database server, you can use several methods. Here are some approaches you can take: ### 1. **Using `onstat` Command** The `onstat` command can provide you with a lot of information about currently running sessions, including long-running queries: - **Check Active Sess...
9,621
[ { "from": "human", "value": "How can you find out what are the long running queries are on Informix database server? I have a query that is using up the CPU and want to find out what the query is.\n" }, { "from": "gpt", "value": "To identify long-running queries on an Informix database server, y...
What is the benefit of using the servletContext as opposed the request in order to obtain a requestDispatcher? servletContext.getRequestDispatcher(dispatchPath) and using argRequest.getRequestDispatcher(dispatchPath)
In a Java Servlet environment, both `ServletContext` and `HttpServletRequest` can be used to obtain a `RequestDispatcher`, but there are important differences in terms of scope and application which can influence which one you should use. Here are the benefits of using `ServletContext.getRequestDispatcher()` compared t...
13,550
[ { "from": "human", "value": "What is the benefit of using the servletContext as opposed the request in order to obtain a requestDispatcher?\nservletContext.getRequestDispatcher(dispatchPath)\n\nand using \nargRequest.getRequestDispatcher(dispatchPath)\n\n" }, { "from": "gpt", "value": "In a Java...
I'm trying to do a SQL Server 2008 setup and I've been given a Cross Language Installation failure. More specifically: Rule "cross language installation: failed. the Setup language is different than the language of existing SQL Server features. To continue, use SQL Server Setup installation media of the same language...
The "Cross Language Installation" error typically occurs in SQL Server setups when there is a mismatch between the language of the setup media and the language of an existing SQL Server installation. Even if you don’t see SQL Server in "Add or Remove Programs," it's possible that some components or features were instal...
13,349
[ { "from": "human", "value": "I'm trying to do a SQL Server 2008 setup and I've been given a Cross Language Installation failure. More specifically:\nRule \"cross language installation: failed.\nthe Setup language is different than the language of existing SQL Server features. To continue, use SQL Server S...
Are there any utilities out there which can draw pictures of the merge history of a subversion repo - we always commit merges with a (fairly) consistent log message, and it would be handy to be able to automatically extract this info into a single picture that shows what branches occurred when, and what the state of me...
Yes, there are several utilities and tools that can help visualize the merge history of a Subversion (SVN) repository. Here are a few options you can explore: 1. **SVN Graph**: SVN Graph is a visualization tool specifically designed for Subversion repositories. It can create visual representations of branches and m...
14,675
[ { "from": "human", "value": "Are there any utilities out there which can draw pictures of the merge history of a subversion repo - we always commit merges with a (fairly) consistent log message, and it would be handy to be able to automatically extract this info into a single picture that shows what branche...
HI All, We have a .Net 2.0 application which has a MySQL backend. We want to be able to deploy MySQl and the DB when we install the application and im trying to find the best solution. The current setup is to copy the required files to a folder on the local machine and then perform a "NET START" commands to install an...
To create a more robust and reliable solution for deploying your .NET 2.0 application with a MySQL backend, consider the following approach: ### 1. Use an Installer Package Instead of manual file copying and script execution, use an installer package that can handle installation and setup for you. There are several i...
10,950
[ { "from": "human", "value": "HI All,\nWe have a .Net 2.0 application which has a MySQL backend. We want to be able to deploy MySQl and the DB when we install the application and im trying to find the best solution. The current setup is to copy the required files to a folder on the local machine and then pe...
First, I'd like to establish the acceptable end-to-end latency for a real-time system in the financial world is less than 200ms. Okay, here's what I'm after. In the design of real-time systems, there are "design patterns" (or techniques) that will increase the performance (i.e. reduce processing time, improve scalabili...
You're on the right track by identifying key design patterns and techniques to optimize performance in real-time systems, especially in the financial sector. Here are several additional design patterns and techniques that can help improve performance, scalability, and reduce end-to-end latency in such systems: ### 1. ...
11,785
[ { "from": "human", "value": "First, I'd like to establish the acceptable end-to-end latency for a real-time system in the financial world is less than 200ms. Okay, here's what I'm after. In the design of real-time systems, there are \"design patterns\" (or techniques) that will increase the performance (i.e...
I search for "nurple" in a file. I found it, great. But now, every occurrence of "nurple" is rendered in sick black on yellow. Forever. Forever, that is, until I search for something I know won't be found, such as "asdhfalsdflajdflakjdf" simply so it clears the previous search highlighting. Can't I just hit a magic key...
Yes, you can easily clear the search highlighting in many text editors and IDEs without needing to search for a non-existent string. Here are some common methods for clearing search highlights in various environments: ### In Vim: - You can clear the search highlighting by typing: ``` :nohlsearch ``` - Alternativ...
14,121
[ { "from": "human", "value": "I search for \"nurple\" in a file. I found it, great. But now, every occurrence of \"nurple\" is rendered in sick black on yellow. Forever.\nForever, that is, until I search for something I know won't be found, such as \"asdhfalsdflajdflakjdf\" simply so it clears the previous s...
If I create a test suite for a development project, should those classes be kept under version control with the rest of the project code?
Yes, test suites should generally be kept under version control alongside the rest of your project code. Here are a few reasons why this practice is beneficial: 1. **Traceability**: Keeping test code with your application code allows you to trace changes in your tests alongside changes in your application. This helps ...
14,965
[ { "from": "human", "value": "If I create a test suite for a development project, should those classes be kept under version control with the rest of the project code?\n" }, { "from": "gpt", "value": "Yes, test suites should generally be kept under version control alongside the rest of your proje...
I've been using git for some time now on Windows (with msysGit) and I like the idea of distributed source control. Just recently I've been looking at Mercurial (hg) and it looks interesting. However, I can't wrap my head around the differences between hg and git. Has anyone made a side-by-side comparison between git an...
Sure! Git and Mercurial (hg) are both distributed version control systems, but they have some differences in design philosophy, commands, performance, and user experience. Here’s a side-by-side comparison of key aspects: ### 1. **Design Philosophy** - **Git**: Designed for speed and efficiency. It handles large reposi...
8,148
[ { "from": "human", "value": "I've been using git for some time now on Windows (with msysGit) and I like the idea of distributed source control. Just recently I've been looking at Mercurial (hg) and it looks interesting. However, I can't wrap my head around the differences between hg and git.\nHas anyone mad...
I have a huge ear that uses log4j and there is a single config file that is used to set it up. In this config file there is no mention of certain log files but, additional files apart from those specified in the config file get generated in the logs folder. I've searched for other combinations of (logger|log4j|log).(pr...
Debugging logging issues in a Java application, especially when using a logging framework like Log4j, can be challenging when unexpected log files are being created. Here are steps you can take to track down the source of the additional log files: ### 1. **Identify Logging Framework Version** Ensure you know which ver...
12,480
[ { "from": "human", "value": "I have a huge ear that uses log4j and there is a single config file that is used to set it up. In this config file there is no mention of certain log files but, additional files apart from those specified in the config file get generated in the logs folder. I've searched for oth...
I have a program which needs to behave slightly differently on Tiger than on Leopard. Does anybody know of a system call which will allow me to accurately determine which version of Mac OS X I am running. I have found a number of macro definitions to determine the OS of the build machine, but nothing really good to det...
To determine the version of macOS (formerly Mac OS X) your application is running on, you can use the `Gestalt` API or `NSProcessInfo` in Objective-C. Here’s how you can do it for both approaches: ### Using `Gestalt` API (C/C++) You can use the `Gestalt` function to get the version of macOS. Here's an example in C: ...
13,489
[ { "from": "human", "value": "I have a program which needs to behave slightly differently on Tiger than on Leopard. Does anybody know of a system call which will allow me to accurately determine which version of Mac OS X I am running. I have found a number of macro definitions to determine the OS of the buil...
Given the following: &row->count Would &(row->count) be evaluated or (&row)->count be evaluated in C++? EDIT: Here's a great link for C++ precedence.
In C++, the expression `&(row->count)` would be evaluated rather than `(&row)->count`. Here's the breakdown: 1. The `->` operator has higher precedence than the `&` operator. 2. The `->` operator is used to access a member of a struct or class through a pointer. In `row->count`, `row` is a pointer to an object, and `...
16,333
[ { "from": "human", "value": "Given the following:\n&row->count\n\nWould &(row->count) be evaluated or (&row)->count be evaluated in C++?\nEDIT: Here's a great link for C++ precedence.\n" }, { "from": "gpt", "value": "In C++, the expression `&(row->count)` would be evaluated rather than `(&row)->...
I want something that looks like a file handle but is really backed by an in-memory buffer to use for I/O redirects. How can I do this?
To create an object that looks like a file handle but is backed by an in-memory buffer in Python, you can use the `io` module, specifically `io.StringIO` for text data or `io.BytesIO` for binary data. These classes provide an in-memory stream for text and binary data, respectively, and support the standard file interfa...
12,996
[ { "from": "human", "value": "I want something that looks like a file handle but is really backed by an in-memory buffer to use for I/O redirects. How can I do this?\n" }, { "from": "gpt", "value": "To create an object that looks like a file handle but is backed by an in-memory buffer in Python, ...
When you create a new web user control in visual studio it by default adds the Page_Load event. What is the advantage to using this rather than overriding the base OnLoad event on the control? Is it just that the Page_Load event fires before OnLoad?
When working with web user controls in ASP.NET, both the `Page_Load` event and the `OnLoad` method can be used to handle logic that needs to occur when the control is loading. However, there are some distinctions between these two approaches that can influence your choice of which to use. ### Differences Between `Page...
12,883
[ { "from": "human", "value": "When you create a new web user control in visual studio it by default adds the Page_Load event. What is the advantage to using this rather than overriding the base OnLoad event on the control? Is it just that the Page_Load event fires before OnLoad?\n" }, { "from": "gp...
I'll go first. I'm 100% in the set-operations camp. But what happens when the set logic on the entire desired input domain leads to a such a large retrieval that the query slows down significantly, comes to a crawl, or basically takes infinite time? That's one case where I'll use a itty-bitty cursor (or a while loop) ...
It sounds like you're navigating the complexities of query optimization and performance trade-offs when dealing with large datasets. Your approach of using set operations is valid and often preferred for clarity and maintainability, but, as you've noted, performance can become a significant concern when the data volume...
15,819
[ { "from": "human", "value": "I'll go first.\nI'm 100% in the set-operations camp. But what happens when the set logic\non the entire desired input domain leads to a such a large retrieval that the query slows down significantly, comes to a crawl, or basically takes infinite time?\nThat's one case where I'l...
I have a bunch of Eclipse plugins and features, which I would like to build as part of a nightly (headless) build. I've managed to do this using a complicated setup involving manually specifying paths to Eclipse plugin jars, copying customTargets.xml, etc. Is there really no simpler solution? Isn't there a way to just...
Yes, there is a simpler way to automate the build process for Eclipse plugins and features using a headless build without manually specifying paths or copying files. Eclipse provides a way to build your projects through the PDE (Plug-in Development Environment) build system using a configuration file. ### Steps to set...
13,317
[ { "from": "human", "value": "I have a bunch of Eclipse plugins and features, which I would like to build as part of a nightly (headless) build. I've managed to do this using a complicated setup involving manually specifying paths to Eclipse plugin jars, copying customTargets.xml, etc. \nIs there really no s...
What is the easiest way, preferably using recursion, to find the shortest root-to-leaf path in a BST (Binary Search Tree). Java prefered, pseudocode okay. Thanks!
To find the shortest root-to-leaf path in a Binary Search Tree (BST) using recursion, we can approach the problem by traversing the tree and keeping track of the depth of each leaf node encountered. We will consider a leaf node to be any node that does not have left or right children. Here's how you can implement this...
11,491
[ { "from": "human", "value": "What is the easiest way, preferably using recursion, to find the shortest root-to-leaf path in a BST (Binary Search Tree). Java prefered, pseudocode okay.\nThanks!\n" }, { "from": "gpt", "value": "To find the shortest root-to-leaf path in a Binary Search Tree (BST) ...
Most Scrum teams have some sort of whiteboard or other board upon which the stories/tasks for the current sprint are visualized. I'm curious as to how people organize this board? Do you use post-it notes? Are they color-coded? How do you group tasks? How do you distinguish the state of tasks? Etc...
Organizing a Scrum board effectively is crucial for visualizing work and managing the flow of tasks during a sprint. While there are variations in practices among teams, here are some common approaches to organizing the board, including the use of post-it notes, color-coding, grouping tasks, and distinguishing states: ...
13,725
[ { "from": "human", "value": "Most Scrum teams have some sort of whiteboard or other board upon which the stories/tasks for the current sprint are visualized.\nI'm curious as to how people organize this board? Do you use post-it notes? Are they color-coded? How do you group tasks? How do you distinguish the ...
I am running some queries to track down a problem with our backup logs and would like to display datetime fields in 24-hour military time. Is there a simple way to do this? I've tried googling and could find nothing.
Yes, you can display datetime fields in 24-hour military time format using SQL queries. The specific syntax may vary slightly depending on the database system you are using (e.g., MySQL, SQL Server, PostgreSQL, Oracle, etc.), but here are general examples for common database systems: ### 1. MySQL In MySQL, you can use...
12,895
[ { "from": "human", "value": "I am running some queries to track down a problem with our backup logs and would like to display datetime fields in 24-hour military time. Is there a simple way to do this? I've tried googling and could find nothing.\n" }, { "from": "gpt", "value": "Yes, you can di...
How universally is the C99 standard supported in today's compilers? I understand that not even GCC fully supports it. Is this right? Which features of C99 are supported more than others, i.e. which can I use to be quite sure that most compilers will understand me?
As of my last knowledge update in October 2023, the C99 standard is quite well supported across most modern C compilers, including GCC, Clang, and MSVC. However, there are still some nuances in the implementation of certain features. ### GCC Support GCC, one of the most widely used compilers for C, has supported a si...
13,187
[ { "from": "human", "value": "How universally is the C99 standard supported in today's compilers? I understand that not even GCC fully supports it. Is this right?\nWhich features of C99 are supported more than others, i.e. which can I use to be quite sure that most compilers will understand me?\n" }, { ...
When designing a REST API or service are there any established best practices for dealing with security (Authentication, Authorization, Identity Management) ? When building a SOAP API you have WS-Security as a guide and much literature exists on the topic. I have found less information about securing REST endpoints. Wh...
When designing a REST API, security is a crucial consideration, and several best practices have emerged over the years to help secure these endpoints effectively. While REST does not have a single comprehensive specification like WS-Security for SOAP, you can follow established guidelines and patterns to implement robu...
4,214
[ { "from": "human", "value": "When designing a REST API or service are there any established best practices for dealing with security (Authentication, Authorization, Identity Management) ?\nWhen building a SOAP API you have WS-Security as a guide and much literature exists on the topic. I have found less inf...