instruction
stringlengths
14
27.6k
completion
stringlengths
3
38.3k
__original_row_idx
int64
0
50k
conversations
listlengths
2
2
This is a brief description of my db. You have issues which have categories. I have various queries that get issues based on all sorts of criteria, but that's not important to the question. I want to be able to take a list of issues I have queried, lets say for example, that occured yesterday and group them by category...
To group the issues by category while only including the issues from your provided set (rather than retrieving all issues in that category), you can modify your `GroupIssuesByCategory` method to return a structure that contains the category along with only the issues you are interested in. Instead of selecting `c.Key...
48,787
[ { "from": "human", "value": "This is a brief description of my db. You have issues which have categories. I have various queries that get issues based on all sorts of criteria, but that's not important to the question.\nI want to be able to take a list of issues I have queried, lets say for example, that oc...
I've used MSDataSetGenerator a fair bit and it causes a bunch of pain because the XMLSerializer rarely works on the output. Are there any other code generators that come with the SDK?
Yes, besides `MSDataSetGenerator`, which is a commonly used tool for generating data sets from SQL Server database schemas, there are a few other code generation tools in the Microsoft SDK and Visual Studio that you might find useful. Here are some alternatives: 1. **Entity Framework (EF)**: - If you're using Entit...
48,404
[ { "from": "human", "value": "I've used MSDataSetGenerator a fair bit and it causes a bunch of pain because the XMLSerializer rarely works on the output. Are there any other code generators that come with the SDK?\n" }, { "from": "gpt", "value": "Yes, besides `MSDataSetGenerator`, which is a comm...
If somebody may knows a blog posting with a basic example, that would help a lot. Google search gives me mostly links to add-in-express.com. tia
It seems like you are looking for blog posts or resources that provide basic examples related to a specific topic, possibly involving add-ins or a related technology. While I can't provide direct links, I can suggest some ways to find the resources you need: 1. **Search Terms**: Use specific search terms in Google lik...
47,124
[ { "from": "human", "value": "If somebody may knows a blog posting with a basic example, that would help a lot.\nGoogle search gives me mostly links to add-in-express.com.\ntia\n" }, { "from": "gpt", "value": "It seems like you are looking for blog posts or resources that provide basic examples r...
I'm trying to get Cruisecontrol.NET running with Server 2008/IIS7 and when I try and navigate to the dashboard I get the following error: HTTP Error 404.17 - Not Found The requested content appears to be script and will not be served by the static file handler. I'm a bit lost in IIS7 so it could be something pretty str...
The HTTP Error 404.17 indicates that the request is being routed to a handler that is not configured correctly in IIS 7. This issue usually occurs when the server is trying to serve a script file (like ASP.NET pages) but the appropriate handler is not registered in IIS. Here are some steps you can follow to troublesho...
42,337
[ { "from": "human", "value": "I'm trying to get Cruisecontrol.NET running with Server 2008/IIS7 and when I try and navigate to the dashboard I get the following error:\nHTTP Error 404.17 - Not Found\nThe requested content appears to be script and will not be served by the static file handler.\nI'm a bit lost...
Is it possible to pass command line arguments into a function from within a bourne script, in order to allow getopts to process them. The rest of my script is nicely packed into functions, but it's starting to look like I'll have to move the argument processing into the main logic. The following is how it's written now...
Yes, you can definitely pass command line arguments to a function in a Bourne shell script and process them using `getopts`. The issue with your current implementation is that when you call `processArgs`, you do not pass any arguments to it. By default, when you call a function without any arguments, it does not have a...
46,653
[ { "from": "human", "value": "Is it possible to pass command line arguments into a function from within a bourne script, in order to allow getopts to process them.\nThe rest of my script is nicely packed into functions, but it's starting to look like I'll have to move the argument processing into the main lo...
I am executing the following code that worked fine in a vs2003(1.1) but seems to have decided otherwise now that I'm using vs2008(2.0/3.5): Dim wordApp As Microsoft.Office.Interop.Word.Application Dim wordDoc As Microsoft.Office.Interop.Word.Document missing = System.Reflection.Missing.Value wordApp = New Microsoft.Of...
The error "Attempted to read or write protected memory. This is often an indication that other memory is corrupt." usually suggests that there might be an issue with how the Interop assemblies are being called or managed, especially when moving from an older version of Visual Studio to a newer one. Here are several st...
44,156
[ { "from": "human", "value": "I am executing the following code that worked fine in a vs2003(1.1) but seems to have decided otherwise now that I'm using vs2008(2.0/3.5):\nDim wordApp As Microsoft.Office.Interop.Word.Application\nDim wordDoc As Microsoft.Office.Interop.Word.Document\n\nmissing = System.Reflec...
Here is the problem, I have written an event loop to detect keydown and keyup events. The problem I am running into is that a keydown event is generating a keydown and a keyup event when the key is pressed and held down. I am using the arrow keys to move an object and then to stop moving when the key is released(keyu...
I'm glad to hear that you've resolved your issue with the key event handling! It can indeed be tricky when working with input events like keydown and keyup, especially in a game loop. Just to summarize what you've done and to provide some additional tips for handling key input in SDL (Simple DirectMedia Layer): ### K...
43,812
[ { "from": "human", "value": "Here is the problem, I have written an event loop to detect keydown and keyup events. The problem I am running into is that a keydown event is generating a keydown and a keyup event when the key is pressed and held down. I am using the arrow keys to move an object and then to ...
I´m working on a project, in Visual Studio 2008, which DLL currently surpasses 20 MB. Is there a way to profile that DLL, searching the main contributors to this size? I suspect that breaking it in smaller projects inside the solution would help, but I'm looking for a faster solution (although not better, I'm afraid)....
Profiling a DLL in Visual Studio 2008 to determine the contributors to its size can be somewhat challenging, but there are a few approaches you can take to identify large components without refactoring your project immediately. Here are some strategies to consider: ### 1. Analyze Project References - **Project Structu...
43,570
[ { "from": "human", "value": "I´m working on a project, in Visual Studio 2008, which DLL currently surpasses 20 MB. Is there a way to profile that DLL, searching the main contributors to this size? \nI suspect that breaking it in smaller projects inside the solution would help, but I'm looking for a faster s...
I am looking to implement (or build as a last resort) a type of survey engine that allows for extensibility and integration into an existing workflow engine. The survey/questionnaire engine should allow for admin users to add new questions and response types (text/bool/multiple/etc), should use SQL Server for persisten...
There are several options for survey/questionnaire engines that can integrate with SQL Server, ASP.NET, and use Active Directory for authentication. While there may not be a perfect off-the-shelf solution that meets all your requirements, here are some recommendations that might be useful: 1. **SurveyJS**: - **Desc...
45,685
[ { "from": "human", "value": "I am looking to implement (or build as a last resort) a type of survey engine that allows for extensibility and integration into an existing workflow engine.\nThe survey/questionnaire engine should allow for admin users to add new questions and response types (text/bool/multiple...
Ok, i have done a bunch of asp as well as asp.net right when it came out. A friend is starting a non profit organization and he wants me to put together a site for him. I figured i would kill 2 birds with one stone and look to freshen up my skills on the latest that the web has to offer in asp.net, web 2.0, etc. The...
It's great to hear that you're looking to refresh your ASP.NET skills while helping out your friend with their non-profit organization! Given your requirements and the ASP.NET 3.5 hosting environment, here are some suggestions to help you get started: ### Frameworks and Tools 1. **ASP.NET Web Forms**: Since you're wo...
43,818
[ { "from": "human", "value": "Ok, i have done a bunch of asp as well as asp.net right when it came out. A friend is starting a non profit organization and he wants me to put together a site for him. I figured i would kill 2 birds with one stone and look to freshen up my skills on the latest that the web h...
I user sun jdk 1.5 ThreadPoolExecutor( 24, 24,60,TimeUnit.SECONDS, new LinkedBlockingQueue()). soemtime I use jdb tool to find the status of all threads in thread pool are " waiting in a monitor", the code is : String key = getKey(dt.getPrefix(), id); synchronized (key.intern()) { -----> Is there a prob...
The issue you're experiencing with `synchronized (key.intern())` leading to multiple threads being in a "waiting in a monitor" state is related to how the `String.intern()` method works in Java and the implications of using it in a multi-threaded environment. ### Understanding String.intern() - The `String.intern()` ...
44,632
[ { "from": "human", "value": "I user sun jdk 1.5 ThreadPoolExecutor( 24, 24,60,TimeUnit.SECONDS, new LinkedBlockingQueue()). soemtime I use jdb tool to find the status of all threads in thread pool are \" waiting in a monitor\", the code is : \n String key = getKey(dt.getPrefix(), id);\n synchronized ...
I need to store large amount of data using RMS API through J2ME. How can I store that multiple-column data, given they must be hardcoded so I need to store those multiple columns and rows data. How can I do this in this, should I use structs?
In J2ME, the Record Management System (RMS) API provides a way to store persistent data on mobile devices. However, since the API does not support multi-dimensional data structures like arrays or structs directly, you will need to implement a way to store and retrieve your multi-column data effectively. Here’s a genera...
42,566
[ { "from": "human", "value": "I need to store large amount of data using RMS API through J2ME. \nHow can I store that multiple-column data, given they must be hardcoded so I need to store those multiple columns and rows data.\nHow can I do this in this, should I use structs?\n" }, { "from": "gpt", ...
I have a Guid.NewGuid() call that is creating an Empty Guid. What would cause such a problem and how can I fix it? Edit: The code: <WebMethod()> _ Public Function CreateRow(rowValue As String) as String Dim rowPointer As Guid = System.Guid.NewGuid() Dim rowPointerValue As String = rowPointer.ToString() T...
It seems like you've already identified the issue with your code. The problem arose because you were passing the `rowPointer` (which is a `Guid` type) directly to `SqlHelper.ExecuteNonQuery`, and it ended up being treated incorrectly in the stored procedure, leading to the impression that an "empty Guid" was being crea...
45,492
[ { "from": "human", "value": "I have a Guid.NewGuid() call that is creating an Empty Guid. \nWhat would cause such a problem and how can I fix it?\nEdit: The code:\n<WebMethod()> _\nPublic Function CreateRow(rowValue As String) as String\n Dim rowPointer As Guid = System.Guid.NewGuid()\n Dim rowPointe...
How to read the proxy details (address and port) from a vcl.net application (Rad Studio 2007) ?. Heard about InternetGetProxyInfo. But didnt find the details any where. Thank you.
To read the proxy details (address and port) in a VCL.NET application using RAD Studio 2007, you can utilize the `InternetGetProxyInfo` function from the Windows API. However, `InternetGetProxyInfo` is not the most straightforward function to use, and it may require a bit of work to set up. Here’s a simple step-by-ste...
43,355
[ { "from": "human", "value": "How to read the proxy details (address and port) from a vcl.net application (Rad Studio 2007) ?. \nHeard about InternetGetProxyInfo. But didnt find the details any where.\nThank you.\n" }, { "from": "gpt", "value": "To read the proxy details (address and port) in a V...
What exactly are the Python scoping rules? If I have some code: code1 class Foo: code2 def spam..... code3 for code4..: code5 x() Where is x found? Some possible choices include the list below: In the enclosing source file In the class namespace In the function definition In the for l...
Python's scoping rules can indeed be confusing at first, but they follow a well-defined set of principles. The key to understanding scoping in Python is to know about the LEGB rule, which stands for **Local**, **Enclosing**, **Global**, and **Built-in** scopes. Let’s break this down with respect to your example: 1. **...
43,138
[ { "from": "human", "value": "What exactly are the Python scoping rules?\nIf I have some code:\ncode1\nclass Foo:\n code2\n def spam.....\n code3\n for code4..:\n code5\n x()\n\nWhere is x found? Some possible choices include the list below:\n\nIn the enclosing source file\nIn the ...
I am coding a feature in a program where users can edit documents stored in a database, it saves the document to a temporary folder then uses Process.Start to launch the document into the editing application, let's say Microsoft Word for example. Then my app needs to wait until they've closed the called process and rep...
To ensure that you start a new instance of an application like Microsoft Word, even if it is already running, you have a couple of options. However, forcing a new instance depends on how the application is designed. Microsoft Word and many other applications have a feature that reuses existing instances when opened. He...
44,701
[ { "from": "human", "value": "I am coding a feature in a program where users can edit documents stored in a database, it saves the document to a temporary folder then uses Process.Start to launch the document into the editing application, let's say Microsoft Word for example.\nThen my app needs to wait until...
Give me some of your thoughts on which is a better coding practice/makes more efficient code/looks prettier/whatever: Increasing and improving your ability to use if statements to anticipate and catch potential problems? Or simply making good use of try/catch in general? Let's say this is for Java (if it matters). Ed...
When it comes to error handling in Java (or programming in general), both using `if` statements for validation and employing `try/catch` blocks have their place, and choosing between them often depends on the context and what you're trying to achieve. Here’s a breakdown of the two approaches: ### Using `if` Statements...
41,133
[ { "from": "human", "value": "Give me some of your thoughts on which is a better coding practice/makes more efficient code/looks prettier/whatever: Increasing and improving your ability to use if statements to anticipate and catch potential problems? Or simply making good use of try/catch in general?\nLet'...
Are there any "Alert" (or Notification) frameworks in Java out there. In my web application I would like our users to be able to configure which (of the available alerts) they would like to receive and in which (e.g via email) form. As a simple example, a user chooses to be alerted only via email when his/her order has...
Yes, there are several frameworks and libraries in Java that can help you implement alerting or notification systems in your web application. Below are some of the popular options and approaches you can consider: ### 1. **Spring Framework** If you are using the Spring Framework, you can take advantage of its features ...
42,502
[ { "from": "human", "value": "Are there any \"Alert\" (or Notification) frameworks in Java out there.\nIn my web application I would like our users to be able to configure which (of the available alerts) they would like to receive and in which (e.g via email) form.\nAs a simple example, a user chooses to be ...
I have a large dataset (over 100,000 records) that I wish to load into a DataGridView. The stored procedure that does this can take 10 seconds or more to complete. So far I have a BackgroundWorker preventing the UI from locking up, and have implemented a rudimentary 'Please Wait' dialog. What I'd like to do is somehow ...
To achieve a real-time data loading experience in a `DataGridView` similar to SQL Server Management Studio, you can implement a solution that allows you to stream data from your database as it is being retrieved. This involves executing your query in a way that supports fetching rows incrementally rather than waiting f...
33,547
[ { "from": "human", "value": "I have a large dataset (over 100,000 records) that I wish to load into a DataGridView. The stored procedure that does this can take 10 seconds or more to complete.\nSo far I have a BackgroundWorker preventing the UI from locking up, and have implemented a rudimentary 'Please Wai...
I have data from a table in a database (string) that contain text and price. I extract the price from the data but my problem is that sometime I can Convert it to float and sometime not. I have noticed that : Convert.ToSingle(m.Groups[1].Value); It works but not always because sometime the period is the problem (it re...
Dealing with price formats can be tricky because of variations in how numbers are represented, particularly with respect to decimal separators (commas and periods). To handle these differences, you should consider a more robust approach that accounts for the user's culture settings or specified formats. Here’s a gener...
44,040
[ { "from": "human", "value": "I have data from a table in a database (string) that contain text and price. I extract the price from the data but my problem is that sometime I can Convert it to float and sometime not.\nI have noticed that :\nConvert.ToSingle(m.Groups[1].Value);\n\nIt works but not always beca...
I need to receive the key press events during cell editing in DataGridView control. From what I have found on the net the DataGridView is designed to pass all key events from DataGridView to the cell editing control and you cannot get these events easily. I found this piece of code that traps those events for DataGrid ...
Indeed, the `DataGridView` control in Windows Forms is designed to encapsulate cell editing in a way that key events are generally processed by the editing control, making it a bit trickier to capture key events during cell editing. However, you can handle this scenario by overriding certain methods or subscribing to s...
44,188
[ { "from": "human", "value": "I need to receive the key press events during cell editing in DataGridView control.\nFrom what I have found on the net the DataGridView is designed to pass all key events from DataGridView to the cell editing control and you cannot get these events easily.\nI found this piece of...
I'd like to have some of the ScriptManager features in the new Asp.net MVC model: 1- Script combining 2- Resolving different paths for external Javascript files 3- Minify and Gzip Compression Here is what I found, but I'm not sure is the best way for MVC approach. In general what is a good approach to deal with Javas...
In ASP.NET MVC, managing JavaScript files and optimizing their delivery can indeed be approached differently compared to Web Forms with `ScriptManager`. Here are some strategies you can employ to achieve the features you mentioned: ### 1. Script Combining For script combining, you can use a bundling and minification ...
38,439
[ { "from": "human", "value": "I'd like to have some of the ScriptManager features in the new Asp.net MVC model:\n1- Script combining\n2- Resolving different paths for external Javascript files\n3- Minify and Gzip Compression \nHere is what I found, but I'm not sure is the best way for MVC approach. In gener...
I would like to match "approximate" matches in Web.SiteMap The Web.Sitemap static sitemap provider works well, except for one thing. IT'S STATIC! So, if I would have to have a sitemapnode for each of the 10,000 articles on my page like so : site.com/articles/1/article-title site.com/articles/2/another-article-title s...
When working with static sitemaps in ASP.NET WebForms, as you've noted, there are limitations to handle dynamic content efficiently, especially when you have a large number of articles. Below are a couple of approaches you can consider to manage this, including creating a custom SiteMap Provider. ### 1. Custom SiteMap...
42,846
[ { "from": "human", "value": "I would like to match \"approximate\" matches in Web.SiteMap\nThe Web.Sitemap static sitemap provider works well, except for one thing. IT'S STATIC!\nSo, if I would have to have a sitemapnode for each of the 10,000 articles on my page like so :\n\nsite.com/articles/1/article-ti...
On a page I want to dynamically list years and all the months in each year so an archive for each month can be viewed. I want to show the current year first but the current year may not be over yet so I only want to show the months that have passed, and the current month. Then I want all years and all months in the pas...
Your existing PHP code does the job, but there are ways to make it more concise and efficient, particularly by reducing redundancy and avoiding multiple array initializations. Below is a refactored version that streamlines the process by leveraging arrays and functions: ```php $current_year = date('Y'); $current_month...
47,113
[ { "from": "human", "value": "On a page I want to dynamically list years and all the months in each year so an archive for each month can be viewed. I want to show the current year first but the current year may not be over yet so I only want to show the months that have passed, and the current month. Then I...
I'm trying to use cygwin sqlplus to connect to a remote oracle installation located at myserver.mycompany.com port 1530. When I try sqlplus username@myserver.mycompany.com:1530/orcl I get the error: ORA-12154: TNS:could not resolve the connect identifier specified When I set ORACLE_HOME to /cygdrive/c/oracle/product...
It seems you're running into a couple of issues when trying to connect to your Oracle database using SQL*Plus from Cygwin. Let's address each issue step by step. ### 1. TNS Resolution Error The first error, `ORA-12154: TNS:could not resolve the connect identifier specified`, suggests that SQL*Plus is having trouble f...
42,372
[ { "from": "human", "value": "I'm trying to use cygwin sqlplus to connect to a remote oracle installation located at myserver.mycompany.com port 1530. When I try\nsqlplus username@myserver.mycompany.com:1530/orcl\n\nI get the error:\nORA-12154: TNS:could not resolve the connect identifier specified\n\nWhen ...
I'm curious as to the exact conditions that cause an application to be Just In-Time Compiled? I think we all know the first visit to a non pre-compiled site will cause a JIT. What about throwing new code into the App_Code directory? I'm pretty sure some actions like saving the web.config simply cause the cause the App...
Just-In-Time (JIT) compilation in ASP.NET occurs when the runtime compiles the application’s code into native machine code at runtime, rather than compiling it ahead of time (as in pre-compilation). Here are the typical scenarios and conditions under which JIT compilation occurs: ### Conditions for JIT Compilation: 1...
44,870
[ { "from": "human", "value": "I'm curious as to the exact conditions that cause an application to be Just In-Time Compiled?\nI think we all know the first visit to a non pre-compiled site will cause a JIT. \nWhat about throwing new code into the App_Code directory?\nI'm pretty sure some actions like saving t...
I'm having a little bit of trouble making a sticky form that will remember what is entered in it on form submission if the value has double quotes. The problem is that the HTML is supposed to read something like: <input type="text" name="something" value="Whatever value you entered" /> However, if the phrase: "How do ...
The issue you're encountering stems from how the double quotes in the input value are being handled in the HTML output. When you directly insert user input into HTML attributes, quotes in the input can break the attribute syntax, which results in malformed HTML. To safely handle input values that may contain double qu...
46,242
[ { "from": "human", "value": "I'm having a little bit of trouble making a sticky form that will remember what is entered in it on form submission if the value has double quotes. The problem is that the HTML is supposed to read something like:\n<input type=\"text\" name=\"something\" value=\"Whatever value yo...
Is there a tool out there for visualizing dynamic call graphs? I saw a reference to one for Visual Basic 6 but I'd like one for .NET. If I had to build a visualizer myself should I bother with the .NET profiling API or should I do something with Mono.Cecil? I started writing a CLI runtime with Cecil, but I guess it'd b...
There are several tools available for visualizing dynamic call graphs in .NET applications. Here are a few you might consider: 1. **dotTrace**: This is a profiling tool from JetBrains that allows you to visualize call graphs and analyze performance bottlenecks in your .NET applications. It can capture the execution fl...
44,241
[ { "from": "human", "value": "Is there a tool out there for visualizing dynamic call graphs? I saw a reference to one for Visual Basic 6 but I'd like one for .NET.\nIf I had to build a visualizer myself should I bother with the .NET profiling API or should I do something with Mono.Cecil? I started writing a ...
I want to store a list of the following tuples in a compressed format and I was wondering which algorithm gives me smallest compressed size fastest de/compression tradeoff optimum ("knee" of the tradeoff curve) My data looks like this: (<int>, <int>, <double>), (<int>, <int>, <double>), ... (<int>, <int>, <double>)...
Given the nature of your data and the specific characteristics you've outlined, there are several compression strategies you might consider. Each has its strengths and weaknesses depending on your priorities (smallest size, speed, trade-off, etc.). Here’s a breakdown of some options: ### 1. **Data Encoding Techniques*...
46,153
[ { "from": "human", "value": "I want to store a list of the following tuples in a compressed format and I was wondering which algorithm gives me\n\nsmallest compressed size\nfastest de/compression\ntradeoff optimum (\"knee\" of the tradeoff curve)\n\nMy data looks like this:\n(<int>, <int>, <double>), \n(<in...
I'm trying to learn CSS. I've taken great pains to get everything right. My pages all validate and they look correct on Firefox and mostly correct on Chrome. However IE is all over the place. In relation to Firefox, the following is wrong in IE (in order of importance): the main body box is pushed below where the left...
When developing web pages, it's not uncommon to run into inconsistencies across different browsers, especially Internet Explorer (IE), which has historically handled CSS differently from more modern browsers like Firefox and Chrome. Here are some steps you can take to troubleshoot and fix the issues you're facing: ###...
43,945
[ { "from": "human", "value": "I'm trying to learn CSS. I've taken great pains to get everything right. My pages all validate and they look correct on Firefox and mostly correct on Chrome. However IE is all over the place. In relation to Firefox, the following is wrong in IE (in order of importance):\n\nthe m...
I'm writing a simple program to browse the local network and pass on filenames to mplayer using "system". However, sometimes filenames contain spaces or quotes. Obviously I could write my own function to escape those, but I'm not sure exactly what characters do or do not need escaping. Is there a function available in ...
In a typical Linux environment, there isn't a standard library function in the C runtime (CRT) specifically for escaping command-line arguments. However, you can handle spaces and special characters in command-line arguments by following certain conventions. ### Common Escaping Conventions When passing filenames to c...
43,541
[ { "from": "human", "value": "I'm writing a simple program to browse the local network and pass on filenames to mplayer using \"system\". However, sometimes filenames contain spaces or quotes.\nObviously I could write my own function to escape those, but I'm not sure exactly what characters do or do not need...
Even though I am an experienced programmer and engineer, I find that I always run into tedious problems when dealing with networks. Rarely do installations of routers etc work out of the box, and you find yourself trying to learn all kinds of acronyms like WPA, UPnP, etc, and have a hard time trying to map these with t...
You raise a valid point, and many share your frustration with networking-related UIs and the complexity that comes with them. There are several factors that contribute to why networking interfaces can be particularly poor and challenging to navigate: 1. **Historical Complexity**: Networking technologies have evolved o...
45,431
[ { "from": "human", "value": "Even though I am an experienced programmer and engineer, I find that I always run into tedious problems when dealing with networks. Rarely do installations of routers etc work out of the box, and you find yourself trying to learn all kinds of acronyms like WPA, UPnP, etc, and ha...
how do i define a named_scope to return all the records that were created within the last 7 days, and then how do i use that named scope in a controller?
In Ruby on Rails, a `named_scope` was a way to define reusable query scopes. However, since Rails 3, `named_scope` has been replaced by the `scope` method. Below is how you can define a scope to return all records created within the last 7 days and how to use that scope in a controller. ### Step 1: Define the Scope in...
46,814
[ { "from": "human", "value": "how do i define a named_scope to return all the records that were created within the last 7 days, and then how do i use that named scope in a controller?\n" }, { "from": "gpt", "value": "In Ruby on Rails, a `named_scope` was a way to define reusable query scopes. How...
I need to stop the execution Is there any procedures for using terminate and suspend activity
In the context of programming or managing processes, the terms "terminate" and "suspend" refer to different methods of controlling the execution of a program or task. Here’s a brief overview of each and how they can be applied: ### 1. Terminate **Terminate** means to completely stop the execution of a process or progr...
44,296
[ { "from": "human", "value": "I need to stop the execution Is there any procedures for using terminate and suspend activity\n" }, { "from": "gpt", "value": "In the context of programming or managing processes, the terms \"terminate\" and \"suspend\" refer to different methods of controlling the e...
I'm wondering why styling an element within a specific class, like this: .reddish H1 { color: red } is shown as an example of correct syntax in the CSS1 specification under Contextual selectors: Cascading Style Sheets, level 1 but it's not shown as an example in the CSS2 spec: Cascading Style Sheets, Level 2 At least ...
The syntax for selecting elements within a specific class in CSS has not changed from CSS1 to CSS2. In CSS1, the syntax you provided: ```css .reddish H1 { color: red; } ``` is indeed valid and correctly uses a contextual selector. It selects all `<h1>` elements that are descendants of elements with the class "reddish...
49,083
[ { "from": "human", "value": "I'm wondering why styling an element within a specific class, like this:\n.reddish H1 { color: red }\n\nis shown as an example of correct syntax in the CSS1 specification under Contextual selectors:\nCascading Style Sheets, level 1\nbut it's not shown as an example in the CSS2 s...
Where can you get information on the ASP.NET State Service e.g. how it works, performance, behaviour characteristics etc. Have looked on internet but cant find in depth information or an article dedicated to the subject. Thanks
Finding detailed information about the ASP.NET State Service can be a bit challenging, as it is often buried within broader discussions about ASP.NET state management. Here are some reliable sources and topics to explore that cover how the ASP.NET State Service works, its performance characteristics, and other relevant...
46,952
[ { "from": "human", "value": "Where can you get information on the ASP.NET State Service e.g. how it works, performance, behaviour characteristics etc.\nHave looked on internet but cant find in depth information or an article dedicated to the subject.\nThanks\n" }, { "from": "gpt", "value": "Find...
How to insert from one table to another and on duplicate key append string to new row? If i got table with values: a b c and want insert tablevith value: a i want append string like 'x' so i will get table with values: a b c xa
To insert values from one table into another and append a string if a duplicate key exists, you can use SQL's `INSERT ... ON DUPLICATE KEY UPDATE` syntax. Here's a general approach assuming you have two tables: `source_table` and `target_table`. ### Table Structure For the sake of this example, let's assume the tabl...
45,329
[ { "from": "human", "value": "How to insert from one table to another and on duplicate key append\nstring to new row?\nIf i got table with values:\na\nb\nc \nand want insert tablevith value:\na\ni want append string like 'x' so i will get table with values:\na\nb\nc\nxa\n" }, { "from": "gpt", "va...
I need to start a program based on existence of some file (1.htm) on the same machine using scheduler. I don't want to write any extra code. is it possibele by using that is already on windows for e.g listener etc. 1.html sometimes exist and doesnt' exist sometimes. So strictly I need to run (calc.exe) only when 1.htm...
Windows does not come with a built-in listener program that automatically reacts to file existence or changes in real-time without additional coding. However, you can achieve your goal using the Task Scheduler along with a simple batch file that checks for the existence of the file and launches `calc.exe` if the file i...
45,223
[ { "from": "human", "value": "I need to start a program based on existence of some file (1.htm) on the same machine using scheduler. I don't want to write any extra code. is it possibele by using that is already on windows for e.g listener etc. 1.html sometimes exist and doesnt' exist sometimes. So strictly...
I need to validate the user input of a JSpinner, and if invalid, I need to undo (rollback) the value change. What is the best way to do it?
To validate user input in a `JSpinner` and roll back the value change if the input is invalid, you can follow these steps: 1. **Attach a Change Listener**: Add a `ChangeListener` to the `JSpinner` to detect when the value changes. 2. **Store Previous Value**: Keep track of the previous value of the spinner before any...
44,298
[ { "from": "human", "value": "I need to validate the user input of a JSpinner, and if invalid, I need to undo (rollback) the value change. What is the best way to do it?\n" }, { "from": "gpt", "value": "To validate user input in a `JSpinner` and roll back the value change if the input is invalid,...
In Git, how could I search for a file or directory by path across a number of branches? I've written something in a branch, but I don't remember which one. Now I need to find it. Clarification: I'm looking for a file which I created on one of my branches. I'd like to find it by path, and not by its contents, as I do...
To search for a file or directory by path across multiple branches in Git, you can use a combination of Git commands. Here’s a general approach to achieve that: ### Using `git ls-tree` 1. **List branches**: First, list all your branches to make sure you know what you're working with. ```bash git branch -a ``...
45,984
[ { "from": "human", "value": "In Git, how could I search for a file or directory by path across a number of branches?\nI've written something in a branch, but I don't remember which one. Now I need to find it.\nClarification: I'm looking for a file which I created on one of my branches. I'd like to find i...
I have a simple program print barcodes. The label format is in a preloaded form. The value the barcode is passed by a parameter as follow. ^XA ^XFR:FORM.ZPL ^FN999^FDH654321+Y0001+OABC+^FS ^PQ2,0,1,N And it print two barcodes H654321+Y0001+OABC+ H654321+Y0001+OABC+ What I want is the middle part as a serial number, a...
In ZPL (Zebra Programming Language), to achieve the incrementing serial number in the barcode, you need to use the `^SN` command for serial number incrementing properly in conjunction with your other commands. The `^SN` command sets the start value, increment, and current value. Then, you can use it in conjunction wi...
47,230
[ { "from": "human", "value": "I have a simple program print barcodes. The label format is in a preloaded form.\nThe value the barcode is passed by a parameter as follow.\n^XA\n^XFR:FORM.ZPL\n^FN999^FDH654321+Y0001+OABC+^FS\n^PQ2,0,1,N\n\nAnd it print two barcodes\nH654321+Y0001+OABC+\nH654321+Y0001+OABC+\n\n...
I'm a happy user of DevExpress components, though currently I'm still on a linux web host. In another thread I've spoken about my plans to move to a Windows environment so that I can use DevExpress's ASP.Net components. For some time now DevExpress's stand has been that their components is not likely to work on Mono, ...
Using DevExpress ASP.NET components under Mono can be a bit of a mixed bag. While some developers have reported success with ASP.NET applications running on Mono, the compatibility can vary significantly depending on the specific controls you are using and the features they rely on. Here are some points to consider ba...
48,261
[ { "from": "human", "value": "I'm a happy user of DevExpress components, though currently I'm still on a linux web host. \nIn another thread I've spoken about my plans to move to a Windows environment so that I can use DevExpress's ASP.Net components. For some time now DevExpress's stand has been that their ...
I was trying to use the slime-connect function to get access to a remote server with sbcl. I followed all the steps from the slime.mov movie from Marco Baringer, but I got stuck when creating the ssh connection for slime. This is after already starting the swank server on the remote machine. I did it like this: ssh -L ...
The issue you are encountering seems to be related to the SSH tunneling setup for SLIME and the Swank server on the remote machine. Here are some steps and considerations to troubleshoot and resolve the problem: 1. **Verify Swank Server is Running**: Make sure that the Swank server is running on the remote machine and...
46,154
[ { "from": "human", "value": "I was trying to use the slime-connect function to get access to a remote server with sbcl. I followed all the steps from the slime.mov movie from Marco Baringer, but I got stuck when creating the ssh connection for slime. This is after already starting the swank server on the re...
I've got a test class in a module that extends another test class in one of its dependency modules. How can I import the dependency's test code into the test scope of the dependent module? To illiterate, I've got two modules, "module-one" being a dependency of "module-two". SubTestCase is a subclass of TestCase. modul...
To address the issue of importing test code from `module-one` into `module-two` during testing, you typically want to ensure that the tests in `module-one` are accessible to `module-two`. However, test code is usually not included in the dependencies of another module, since dependency management tools generally distin...
44,475
[ { "from": "human", "value": "I've got a test class in a module that extends another test class in one of its dependency modules. How can I import the dependency's test code into the test scope of the dependent module?\nTo illiterate, I've got two modules, \"module-one\" being a dependency of \"module-two\"....
I want to be able to compare Dates and Times in Rails without always having to call the to_time or to_date method. So I wrote the following code: class Date def ==(other) if other.kind_of?(Time) self.to_time == other else super(other) end end end I know there's an easy way to write this so ...
In Ruby, you can override comparison operators by defining specific methods for them. For the `Date` class, you can redefine several comparison methods to allow for easy comparisons between `Date` objects and `Time` objects. Here are the methods you need to implement: - `==` - `!=` - `<` - `>` - `<=` - `>=` - `<=>` H...
45,872
[ { "from": "human", "value": "I want to be able to compare Dates and Times in Rails without always having to call the to_time or to_date method. So I wrote the following code:\nclass Date\n def ==(other)\n if other.kind_of?(Time)\n self.to_time == other\n else\n super(other)\n end\n end\...
Im using asynchronous threading in my application WITH httpClient. I make a call using the Future Api like so mStrResults = (String) rssFuture.get(); this call attempts to retrieve an html string returned from my Callable httpClient call() method. What i want to do however is ensure that the get method does not wait...
When you're working with `Future` in Java, the `get()` method can potentially block indefinitely until the result is available or an exception occurs. If you want to avoid waiting too long for the result of your `Callable`, you should use the overloaded version of `get()` that accepts a timeout parameter. Here's an ex...
48,130
[ { "from": "human", "value": "Im using asynchronous threading in my application WITH httpClient. I make a call using the Future Api like so \nmStrResults = (String) rssFuture.get();\n\nthis call attempts to retrieve an html string returned from my Callable httpClient call() method.\nWhat i want to do howeve...
What's the most natural way to model a group of objects that form a set? For example, you might have a bunch of user objects who are all subscribers to a mailing list. Obviously you could model this as an array, but then you have to order the elements and whoever is using your interface might be confused as to why you'...
In modern programming languages, the concept of modeling a group of objects as a set can be accomplished using various data structures that abstract away the order and duplication concerns typically associated with arrays or lists. The appropriate choice often depends on the specific language and its available data str...
45,357
[ { "from": "human", "value": "What's the most natural way to model a group of objects that form a set? For example, you might have a bunch of user objects who are all subscribers to a mailing list.\nObviously you could model this as an array, but then you have to order the elements and whoever is using your ...
What's the easiest way to play a sound file (.wav) in Python? By easiest I mean both most platform independent and requiring the least dependencies. pygame is certainly an option, but it seems overkill for just sound.
If you're looking for a simple and lightweight way to play a `.wav` sound file in Python without heavy dependencies, you can use the built-in `wave` and `pyaudio` libraries. While `pyaudio` is an external library, it is relatively lightweight and widely used for audio playback. Here’s a basic example of how to do it: ...
46,265
[ { "from": "human", "value": "What's the easiest way to play a sound file (.wav) in Python? By easiest I mean both most platform independent and requiring the least dependencies. pygame is certainly an option, but it seems overkill for just sound.\n" }, { "from": "gpt", "value": "If you're lookin...
I'm using SSRS 2005 to produce a report, and one of the columns in my report is a simple mean calculation. I don't want to divide by zero, so for the textbox value I have put: =Switch(Fields!Count.Value=0,0,Fields!Count.Value>0,Fields!Sum.Value/Fields!Count.Value) This still evaluates the second expression. And so do...
In SSRS (SQL Server Reporting Services) 2005, when dealing with potential division by zero in your report expressions, it's essential to ensure that the denominator is checked properly before performing the division. However, you are facing issues where the second expression is being evaluated even when the first condi...
49,382
[ { "from": "human", "value": "I'm using SSRS 2005 to produce a report, and one of the columns in my report is a simple mean calculation. I don't want to divide by zero, so for the textbox value I have put: \n=Switch(Fields!Count.Value=0,0,Fields!Count.Value>0,Fields!Sum.Value/Fields!Count.Value)\nThis still...
When I set a component to visible=false the component hides, but how do I get it to take no space (get the container it belongs to to resize??) <mx:HBox width="100%" height="100%"> ... </mx:HBox> <mx:HBox width="100%" id="boxAddComment" visible="false" > <mx:TextArea id="txtComment"/> <mx:Button label="Spara"...
In ActionScript and Flex, setting a component's `visible` property to `false` hides it but does not cause the layout to change. To make the container resize and occupy the space that the hidden component was using, you can use the `includeInLayout` property in conjunction with the `visible` property. When you set `vis...
48,868
[ { "from": "human", "value": "When I set a component to visible=false the component hides, but how do I get it to take no space (get the container it belongs to to resize??)\n\n<mx:HBox width=\"100%\" height=\"100%\">\n...\n</mx:HBox>\n\n<mx:HBox width=\"100%\" id=\"boxAddComment\" visible=\"false\" >\n <...
W3c validator didn't ding me on this, but I was curious if anyone else had an opinion on placing html comments outside of the html tags? ... </body> </html> <!-- byee --> I have an application and am outputting some data and want it to be the absolute last thing that is done, which unfortunately means I've already at...
In HTML, comments can be placed almost anywhere, including outside of the `<html>` tags, and this is valid syntax. The W3C validator is likely not flagging your code because it's technically correct according to the HTML specification. However, there are a few considerations to keep in mind when placing comments like ...
45,807
[ { "from": "human", "value": "W3c validator didn't ding me on this, but I was curious if anyone else had an opinion on placing html comments outside of the html tags?\n\n...\n</body>\n</html>\n<!-- byee -->\n\nI have an application and am outputting some data and want it to be the absolute last thing that is...
SQL Server 2005 Express Edition SP2 supports scripting of objects into separate files. By default, the filenames include the name of the object's owner, the name of the SQL object followed by the object type. For example, dbo.Employee.Table.sql or dbo.GSP_EmployeeUpdate.StoredProcedure.sql. Though this naming convent...
In SQL Server Management Studio (SSMS) and SQL Server 2005 Express Edition SP2, the default naming convention for scripted objects can be limiting for organizational purposes. Unfortunately, SQL Server's built-in scripting functionality does not provide direct options for changing the naming convention of the generated...
45,932
[ { "from": "human", "value": "SQL Server 2005 Express Edition SP2 supports scripting of objects into separate files. By default, the filenames include the name of the object's owner, the name of the SQL object followed by the object type. For example, dbo.Employee.Table.sql or dbo.GSP_EmployeeUpdate.StoredP...
Found some old code, circa VS 2003. Now I have just VS 2008 (SP1) installed. When I try opening the *.sln file, it tries converting the projects. The report notifies me it was done successfully, but the solution is empty, marked with "project file was unloaded". VS 2008 doesn't even include opening a *.vcproj file. Doe...
Converting a Visual Studio 2003 solution (with `.sln` and `.vcproj` files) to work with Visual Studio 2008 can be a bit tricky, especially since Visual Studio 2008 does not support `.vcproj` files directly. However, you can follow these steps to convert your project files manually: ### 1. Create a New Solution in VS 2...
44,766
[ { "from": "human", "value": "Found some old code, circa VS 2003. Now I have just VS 2008 (SP1) installed. When I try opening the *.sln file, it tries converting the projects. The report notifies me it was done successfully, but the solution is empty, marked with \"project file was unloaded\".\nVS 2008 doesn...
does anyone know about a open source expert system? actually, I'm rather interested in calling its inferential engine from C#.
Yes, there are several open-source expert systems that you can consider, and some of them provide the capability to interact with C#. Here are a few options: 1. **CLIPS**: The C Language Integrated Production System (CLIPS) is an open-source software tool for building expert systems. It has a robust inference engine a...
47,255
[ { "from": "human", "value": "does anyone know about a open source expert system? actually, I'm rather interested in calling its inferential engine from C#.\n" }, { "from": "gpt", "value": "Yes, there are several open-source expert systems that you can consider, and some of them provide the capab...
In a bash script I execute a command on a remote machine through ssh. If user breaks the script by pressing Ctrl+C it only stops the script - not even ssh client. Moreover even if I kill ssh client the remote command is still running... How can make bash to kill local ssh client and remote command invocation on Crtl+c?...
To ensure that both the local SSH session and the remote command are terminated when you press Ctrl+C, you can use the `trap` command in your script. This allows you to catch the SIGINT signal (which is sent when you press Ctrl+C) and execute a cleanup function to kill the remote command. Here’s how you can modify you...
38,855
[ { "from": "human", "value": "In a bash script I execute a command on a remote machine through ssh. If user breaks the script by pressing Ctrl+C it only stops the script - not even ssh client. Moreover even if I kill ssh client the remote command is still running...\nHow can make bash to kill local ssh clien...
How does URL replacement on the google SERPs "sponsored links" work? Some of the results have a function rwt attached to the onmousedown event, but the sponsored links don't have any event handlers as far as I can make out. How does it achieve the behaviour of replacing the href, and still send you to the long /aclk?sa...
Understanding how Google's search engine results pages (SERPs) work, especially for sponsored links, involves a mix of JavaScript and tracking mechanisms that are designed to enhance user experience while also maintaining analytics for advertisers. Here’s a basic overview of how these mechanisms might function: ### 1....
44,274
[ { "from": "human", "value": "How does URL replacement on the google SERPs \"sponsored links\" work?\nSome of the results have a function rwt attached to the onmousedown event, but the sponsored links don't have any event handlers as far as I can make out.\nHow does it achieve the behaviour of replacing the ...
A project I'm working on supposed to authenticate users agains AD. I've never worked with AD before, neither did I work in organizations that use AD, so here's my stupid question: in case if AD involved, who manages roles, groups and users for application? Is it my responsibility to provide an UI for site admin to assi...
When developing an application that integrates with Active Directory (AD) for user authentication and authorization, it's essential to understand the roles and responsibilities related to user management. Here are some best practices and considerations for your scenario: ### Responsibilities 1. **Role and Group Manag...
45,070
[ { "from": "human", "value": "A project I'm working on supposed to authenticate users agains AD. I've never worked with AD before, neither did I work in organizations that use AD, so here's my stupid question: in case if AD involved, who manages roles, groups and users for application? Is it my responsibilit...
I was curiious to know what type of structures you use for your project references? Where I work the developers have a shared folder called AssemblyCache (\\MACHINENAME\AssemblyCache) which is mapped to an R:\ via GPO in Windows 2008 AD (tied to the Developers AD group). Our shared components have post-build events tha...
Your approach to managing assembly references using a centralized shared folder (AssemblyCache) is a well-thought-out solution, especially for larger projects where multiple developers are working on the same codebase. This method helps maintain consistency and avoids issues with versioning, as developers will always r...
44,218
[ { "from": "human", "value": "I was curiious to know what type of structures you use for your project references?\nWhere I work the developers have a shared folder called AssemblyCache (\\\\MACHINENAME\\AssemblyCache) which is mapped to an R:\\ via GPO in Windows 2008 AD (tied to the Developers AD group).\nO...
I'm perplexed. At CodeRage today, Marco Cantu said that CharInSet was slow and I should try a Case statement instead. I did so in my parser and then checked with AQTime what the speedup was. I found the Case statement to be much slower. 4,894,539 executions of: while not CharInSet (P^, [' ', #10,#13, #0]) do inc(P); ...
It sounds like you've conducted an interesting performance analysis of `CharInSet` versus a `case` statement in Delphi. The differences you're observing in performance are quite insightful and can be attributed to several factors: 1. **Function Call Overhead**: As you noted, `CharInSet` is a function call which incurs...
46,846
[ { "from": "human", "value": "I'm perplexed. At CodeRage today, Marco Cantu said that CharInSet was slow and I should try a Case statement instead. I did so in my parser and then checked with AQTime what the speedup was. I found the Case statement to be much slower.\n4,894,539 executions of:\n\nwhile not Cha...
A have a design question. I have wrote a couple of c# applications. Most of these apps have their own sql or access database, but then they also share a common database, but they are entirely different apps which have their own responsibilities in their own business domains. Some people I spoke with believe the followi...
The question of whether to allow sharing between applications or to maintain strict silos is a complex one and often depends on various factors, including architecture, business requirements, and long-term maintainability. Here are some considerations for both approaches: ### When to Share: 1. **Common Data Needs:** ...
42,999
[ { "from": "human", "value": "A have a design question. I have wrote a couple of c# applications. Most of these apps have their own sql or access database, but then they also share a common database, but they are entirely different apps which have their own responsibilities in their own business domains.\nSo...
I have the name of a function in JavaScript as a string. How do I convert that into a function pointer so I can call it later? Depending on the circumstances, I may need to pass various arguments into the method too. Some of the functions may take the form of namespace.namespace.function(args[...]).
In JavaScript, you can convert a function name stored as a string into a callable function reference using various methods, depending on the structure of your namespaces. Here's how you can achieve that: ### 1. If the Function is in the Global Scope If the function you want to call is defined in the global scope, you ...
44,391
[ { "from": "human", "value": "I have the name of a function in JavaScript as a string. How do I convert that into a function pointer so I can call it later?\nDepending on the circumstances, I may need to pass various arguments into the method too.\nSome of the functions may take the form of namespace.namespa...
So we've been told that one source of TM Enq contention can be unindexed FK's. My question is which one. I have an INSERT INTO Table_B that is recording TM Enq Wait. It contains a PK that is the parent to other tables and it has columns that are FK constrained to other PKs. So which FKs need indexed: that table's colum...
In the context of database operations, especially when discussing Transaction Management (TM) Enqueue contention, it is essential to understand the implications of foreign key (FK) constraints and their indexing. ### Understanding Foreign Key Contention: 1. **Unindexed Foreign Keys**: If you have an unindexed foreign...
44,932
[ { "from": "human", "value": "So we've been told that one source of TM Enq contention can be unindexed FK's. My question is which one.\nI have an INSERT INTO Table_B that is recording TM Enq Wait.\nIt contains a PK that is the parent to other tables and it has columns that are FK constrained to other PKs.\nS...
Is there a tool that can generate sequence diagrams from running .NET code?
Yes, there are several tools available that can help generate sequence diagrams from running .NET code. Here are some popular options: 1. **Visual Studio with Architecture Tools**: Visual Studio Enterprise edition includes built-in features to visualize code structures, including sequence diagrams. You can use it to g...
49,380
[ { "from": "human", "value": "Is there a tool that can generate sequence diagrams from running .NET code?\n" }, { "from": "gpt", "value": "Yes, there are several tools available that can help generate sequence diagrams from running .NET code. Here are some popular options:\n\n1. **Visual Studio w...
I was wondering if anyone knew of a macro or keyboard shortcut or anything really that would automate Attaching to a Process within visual studio?
Automating the "Attach to Process" feature in Visual Studio can be done with a combination of Visual Studio features and potentially some scripting. Here are a couple of methods to streamline the process: ### Method 1: Using Keyboard Shortcuts Visual Studio has built-in keyboard shortcuts that can help you attach to ...
47,994
[ { "from": "human", "value": "I was wondering if anyone knew of a macro or keyboard shortcut or anything really that would automate Attaching to a Process within visual studio?\n" }, { "from": "gpt", "value": "Automating the \"Attach to Process\" feature in Visual Studio can be done with a combin...
I'm working on a blog application in Django. Naturally, I have models set up such that there are Posts and Comments, and a particular Post may have many Comments; thus, Post is a ForeignKey in the Comments model. Given a Post object, is there an easy way (ideally, through a method call) to find out how many Comments be...
Yes, Django provides a straightforward way to get the count of related objects using the `related_name` attribute or by directly accessing the related manager that Django creates for you. Given that you have a `Post` model and a `Comment` model where `Comment` has a ForeignKey pointing to `Post`, you can easily get th...
43,518
[ { "from": "human", "value": "I'm working on a blog application in Django. Naturally, I have models set up such that there are Posts and Comments, and a particular Post may have many Comments; thus, Post is a ForeignKey in the Comments model.\nGiven a Post object, is there an easy way (ideally, through a met...
When designing a lookup table (enum) in SqlServer 2005, if you know the number of entries will never get very high, should you use tinyint instead of int? I'm most concerned about performance, particularly efficiency of indexes. Let's say you have these representative tables: Person ------ PersonId int (PK) PersonTyp...
When considering the use of `tinyint` versus `int` for your foreign key fields in SQL Server 2005 (or any version of SQL Server), you’re already on the right track by evaluating the implications of your design choice. Here are several factors to consider beyond just data size and coding hassle: ### 1. Storage and Inde...
43,276
[ { "from": "human", "value": "When designing a lookup table (enum) in SqlServer 2005, if you know the number of entries will never get very high, should you use tinyint instead of int? I'm most concerned about performance, particularly efficiency of indexes.\nLet's say you have these representative tables:\...
I need to write a desktop application that can run on Mac (Windows and Linux soon) that can get data from MySQL and allow users to transfer files from their desktop to the server. I know I can write a desktop app in AIR, how would Fireworks play into this? Can AIR connect to MySQL? Can one FTP files with AIR? On a seco...
Hi Jason, Here's a breakdown addressing your questions about using Adobe AIR for creating a desktop application that interacts with MySQL and provides file transfer capabilities. ### 1. Adobe AIR and MySQL Connection Adobe AIR can connect to a MySQL database, but it does not have built-in support for direct database ...
45,198
[ { "from": "human", "value": "I need to write a desktop application that can run on Mac (Windows and Linux soon) that can get data from MySQL and allow users to transfer files from their desktop to the server.\nI know I can write a desktop app in AIR, how would Fireworks play into this?\nCan AIR connect to M...
I've got a cool piece of code taken from a VC++ project which gets complete information of the hard disk drive WITHOUT using WMI (since WMI has got its own problems). I ask those of you who are comfortable with API functions to try to convert this VB6 code into VB.NET (or C#) and help A LOT of people who are in great n...
Certainly! Below is the translation of the provided VB6 code into VB.NET. This implementation maintains the same logic and flow, while adapting it to the .NET framework. ```vb.net Imports System.Runtime.InteropServices Public Class HDDInfo Private Const DFP_RECEIVE_DRIVE_DATA As UInteger = &H7C088 Private Con...
29,855
[ { "from": "human", "value": "I've got a cool piece of code taken from a VC++ project which gets complete information of the hard disk drive WITHOUT using WMI (since WMI has got its own problems).\nI ask those of you who are comfortable with API functions to try to convert this VB6 code into VB.NET (or C#) a...
For example if I put "C:\docs" in address bar of Firefox, it shows all files in the directory. Is it possible to customize this page with CSS? Apache 2.2 allows us to do it using IndexStyleSheet directive, so I wondered if Firefox can do it.
Firefox does not provide a built-in feature to customize the display of local file directories with CSS, unlike Apache which allows customization using the `IndexStyleSheet` directive for directory listings. When you enter a local file path (like `C:\docs`) in the Firefox address bar, the browser displays a simple fil...
48,496
[ { "from": "human", "value": "For example if I put \"C:\\docs\" in address bar of Firefox, it shows all files in the directory. Is it possible to customize this page with CSS?\nApache 2.2 allows us to do it using IndexStyleSheet directive, so I wondered if Firefox can do it.\n" }, { "from": "gpt", ...
I am wondering if I need to lock some code created in the application scope. If I create an object say userDAO.cfc in application scope so its available to all pages. Then if I have a method in that object say getUserInfo(userID) that would be called in different parts of the applications, do I need to lock this meth...
In ColdFusion (CFML), when you have an object, such as `userDAO.cfc`, that is stored in the application scope, it's important to consider whether concurrent access to its methods could lead to race conditions or data integrity issues. ### When You Need to Lock 1. **Shared State**: If the `getUserInfo(userID)` method ...
46,273
[ { "from": "human", "value": "I am wondering if I need to lock some code created in the application scope. If I create an object say userDAO.cfc in application scope so its available to all pages. Then if I have a method in that object say getUserInfo(userID) that would be called in different parts of the ...
Is it a best practice to use stored procedure for every single SQL call in .NET applications? Is it encouraged for performance reasons and to reduce surface area for SQL injection attacks (in web applications)?
Using stored procedures for every single SQL call in .NET applications is not universally considered best practice. The decision to use stored procedures or dynamic SQL should be based on the specific context, requirements, and architecture of your application. Here are some factors to consider: ### Advantages of Stor...
47,175
[ { "from": "human", "value": "Is it a best practice to use stored procedure for every single SQL call in .NET applications?\nIs it encouraged for performance reasons and to reduce surface area for SQL injection attacks (in web applications)?\n" }, { "from": "gpt", "value": "Using stored procedure...
I was wondering what I could do to improve the performance of Excel automation, as it can be quite slow if you have a lot going on in the worksheet... Here's a few I found myself: ExcelApp.ScreenUpdating = false -- turn off the redrawing of the screen ExcelApp.Calculation = Excel.XlCalculation.xlCalculationManual -- t...
Improving the performance of Excel automation using Interop can significantly reduce execution time and enhance user experience, especially when dealing with large datasets or complex operations. Besides the strategies you've already mentioned, here are additional suggestions and best practices that can help optimize y...
46,105
[ { "from": "human", "value": "I was wondering what I could do to improve the performance of Excel automation, as it can be quite slow if you have a lot going on in the worksheet...\nHere's a few I found myself:\n\nExcelApp.ScreenUpdating = false -- turn off the redrawing of the screen\nExcelApp.Calculation =...
I was wondering if it's possible to calculate the average of some numbers if I have this: int currentCount = 12; float currentScore = 6.1123 (this is a range of 1 <-> 10). Now, if I receive another score (let's say 4.5), can I recalculate the average so it would be something like: int currentCount now equals 13 floa...
Yes, you can recalculate the average score without needing to remember the entire list of scores, as long as you maintain a count of the scores. The average can be updated using the previous average and the new score. Here's how to do it: 1. **Understand the current average:** The `currentScore` you have is the total...
46,602
[ { "from": "human", "value": "I was wondering if it's possible to calculate the average of some numbers if I have this:\nint currentCount = 12;\nfloat currentScore = 6.1123 (this is a range of 1 <-> 10).\n\nNow, if I receive another score (let's say 4.5), can I recalculate the average so it would be someth...
I am doing a join on two tables. One is a user's table and the other a list of premium users. I need to have the premium members show up first in my query. However, just because they are in the premium user table doesn't mean they are still a premium member - there is an IsActive field that also needs to be checked. So...
To achieve the desired ordering of your query results, you need to adjust the `ORDER BY` clause to prioritize active premium users first, followed by regular users and inactive premium users. You can do this by adding additional criteria to the `ORDER BY` clause. Here's an updated version of your SQL query: ```sql SE...
48,065
[ { "from": "human", "value": "I am doing a join on two tables. One is a user's table and the other a list of premium users. I need to have the premium members show up first in my query. However, just because they are in the premium user table doesn't mean they are still a premium member - there is an IsActiv...
I'm building a fairly simple PHP script that will need to send some emails with attachments. I've found these 2 libraries to do this. Does either one have significant advantages over the other? Or should I just pick one at random and be done with it?
When it comes to sending emails with attachments in PHP, the two most commonly used libraries are PHPMailer and SwiftMailer. Both libraries are robust and well-documented, but they have some differences that might make one more suitable for your needs than the other. Here are some considerations to help you choose betw...
48,035
[ { "from": "human", "value": "I'm building a fairly simple PHP script that will need to send some emails with attachments. I've found these 2 libraries to do this. \nDoes either one have significant advantages over the other? Or should I just pick one at random and be done with it?\n" }, { "from": "g...
If i have a parameterized SQL statement like this: SELECT * FROM table WHERE my_field = :field_value Does anyone know if PDO will recognize this(see below) as the same SQL statement and use the cache instead of assuming it's a completely different SQL statement: SELECT * FROM table WHERE my_field = :new_field_value ...
When using PDO in PHP with parameterized SQL statements, the SQL statement itself is what the caching mechanism will look at to determine if it can reuse a cached query plan. In the examples you provided: 1. `SELECT * FROM table WHERE my_field = :field_value` 2. `SELECT * FROM table WHERE my_field = :new_field_value` ...
49,086
[ { "from": "human", "value": "If i have a parameterized SQL statement like this: \nSELECT * FROM table WHERE my_field = :field_value\n\nDoes anyone know if PDO will recognize this(see below) as the same SQL statement and use the cache instead of assuming it's a completely different SQL statement:\nSELECT * F...
Does anyone know of a good sample (inline in reply, or web tutorial) for extracting data from a VCF file using C#/.NET? Does anyone use VCF files anymore? Is this even worth doing for a contact management system?
Yes, VCF (Virtual Contact File) is still used today, especially for transferring contact information between different applications and devices. While the popularity of VCF has diminished somewhat with the rise of cloud-based contact management solutions, it is still relevant in scenarios where users need to share cont...
45,052
[ { "from": "human", "value": "Does anyone know of a good sample (inline in reply, or web tutorial) for extracting data from a VCF file using C#/.NET?\nDoes anyone use VCF files anymore? Is this even worth doing for a contact management system?\n" }, { "from": "gpt", "value": "Yes, VCF (Virtual C...
So, i'm running emacs over a crappy ssh connection and I have it set up to use cscope. I can not use X because of this...hence I'm running emacs inside putty. However, when I search for something with cscope and it opens up the other buffer, I can not follow the links where cscope tells me which file and line number th...
When using Emacs with cscope over an SSH connection, you might encounter issues with following links in the cscope results. The reason for the "buffer is read-only" message is that cscope results are typically shown in a read-only buffer, and Emacs is treating your attempt to follow the link as an attempt to edit that ...
44,965
[ { "from": "human", "value": "So, i'm running emacs over a crappy ssh connection and I have it set up to use cscope. I can not use X because of this...hence I'm running emacs inside putty. However, when I search for something with cscope and it opens up the other buffer, I can not\nfollow the links where csc...
Edit: I don't know what this user originally wanted, and hopefully they'll edit their question to let us know, but otherwise, let's use this question to answer (or give links to) the following common console window issues: How do you capture the output of a console application in your program (for instance, running a ...
Here's an edited version of your content, structured for clarity and ease of understanding: --- ### Common Console Window Issues and Solutions This discussion aims to address some frequently encountered issues when working with console applications. Below are answers and resources related to common concerns: #### 1...
43,095
[ { "from": "human", "value": "Edit:\nI don't know what this user originally wanted, and hopefully they'll edit their question to let us know, but otherwise, let's use this question to answer (or give links to) the following common console window issues:\n\nHow do you capture the output of a console applicati...
I am using a WCF service and a net.tcp endpoint with serviceAuthentication's principal PermissionMode set to UseWindowsGroups. Currently in the implementation of the service i am using the PrincipalPermission attribute to set the role requirements for each method. [PrincipalPermission(SecurityAction.Demand, Ro...
Yes, you can configure role-based access control in a WCF service using Windows authentication in your `app.config` file. However, the `PrincipalPermission` attribute itself does not support configuration in the `app.config`. Instead, you will need to handle role-based authorization manually within your service methods...
43,947
[ { "from": "human", "value": "I am using a WCF service and a net.tcp endpoint with serviceAuthentication's principal PermissionMode set to UseWindowsGroups.\nCurrently in the implementation of the service i am using the PrincipalPermission attribute to set the role requirements for each method. \n [Pr...
I'm in a situation where I have the class "progress" - trouble is that I'm interested in incorporating some open source that also has the class "progress". I remember very vaguely some reference to an app that's able to inspect the various files in a development for a given class name ... and either return it ... or ch...
Yes, it sounds like you're looking for tools or methods to help you manage class names in your codebase, especially when dealing with conflicts like the one you've described with the "progress" class. Here are a few approaches and tools that can help you inspect, find, and possibly change or rename class names in your ...
47,262
[ { "from": "human", "value": "I'm in a situation where I have the class \"progress\" - trouble is that I'm interested in incorporating some open source that also has the class \"progress\". I remember very vaguely some reference to an app that's able to inspect the various files in a development for a given ...
I'd like to build a CMS site based on Asp.Net Mvc and I want to choose my starting point. I have seen that there is a lot of interest in the new Microsoft Oxite project also if it seems to be pretty early to adopt it in a production project. I've also looked at S#arp Architecture but it does not properly compare to Oxi...
Choosing the right starting point for your CMS site based on ASP.NET MVC is crucial, and both S#arp Architecture and Oxite have their own strengths and weaknesses. Here's a deeper look at the two options you've mentioned, along with some recommendations. ### S#arp Architecture **Pros:** 1. **Simplicity and Clean Arch...
44,198
[ { "from": "human", "value": "I'd like to build a CMS site based on Asp.Net Mvc and I want to choose my starting point.\nI have seen that there is a lot of interest in the new Microsoft Oxite project also if it seems to be pretty early to adopt it in a production project.\nI've also looked at S#arp Architect...
I have an inherited QTreeWidget (called PackList) class and its parent is a KXmlGuiWindow. How can I access to the parent's slots? I've tried getParent()->mySlot() from the QTreeWidget class but I've got error: no matching function for call to 'PackList::mySlot()' Does anybody know the correct way? Thanks
In Qt, if you have a class that inherits from `QTreeWidget`, and you want to access a slot (or any public method) from its parent class (which in this case is `KXmlGuiWindow`), you should ensure that you're correctly casting the parent object to the appropriate type. Assuming `mySlot()` is a public slot or public meth...
46,467
[ { "from": "human", "value": "I have an inherited QTreeWidget (called PackList) class and its parent is a KXmlGuiWindow. \nHow can I access to the parent's slots? \nI've tried getParent()->mySlot() from the QTreeWidget class but I've got\nerror: no matching function for call to 'PackList::mySlot()'\n\nDoes a...
Why are the lists list1Instance and p in the Main method of the below code pointing to the same collection? class Person { public string FirstName = string.Empty; public string LastName = string.Empty; public Person(string firstName, string lastName) { this.FirstName = firstNam...
In the provided code, the `list1Instance` and `p` are both pointing to the same collection in the sense that they are referencing the same `Person` objects. However, they are not referencing the same list. Here’s a breakdown of what is happening: 1. **List Creation**: When you create an instance of `List1`, the constr...
44,169
[ { "from": "human", "value": "Why are the lists list1Instance and p in the Main method of the below code pointing to the same collection? \nclass Person\n {\n public string FirstName = string.Empty;\n public string LastName = string.Empty;\n\n public Person(string firstName, string la...
You are given a heap of code in your favorite language which combines to form a rather complicated application. It runs rather slowly, and your boss has asked you to optimize it. What are the steps you follow to most efficiently optimize the code? What strategies have you found to be unsuccessful when optimizing code?...
Optimizing code can be a nuanced process, and a structured approach is critical to effectively improve performance without introducing new bugs. Here are the steps I typically follow for optimization: ### Steps to Optimize Code 1. **Identify Bottlenecks**: - Use profiling tools to determine which parts of the code...
42,321
[ { "from": "human", "value": "You are given a heap of code in your favorite language which combines to form a rather complicated application. It runs rather slowly, and your boss has asked you to optimize it. What are the steps you follow to most efficiently optimize the code? \nWhat strategies have you foun...
Is it true that the smallest amount of memory that I can allocate in managed code is a byte? Do I understand correctly that a Boolean variable takes up much more than a bit of memory? Is there a way for me to allocate memory, in .net, in chunks smaller than a byte?
In managed code, particularly within the .NET framework, memory allocation is generally done in units of bytes. Here are the clarifications regarding your questions: 1. **Smallest Allocatable Unit**: Yes, the smallest unit of memory you can allocate in .NET is a byte. When you allocate memory for variables, even for v...
46,895
[ { "from": "human", "value": "Is it true that the smallest amount of memory that I can allocate in managed code is a byte? \nDo I understand correctly that a Boolean variable takes up much more than a bit of memory? \nIs there a way for me to allocate memory, in .net, in chunks smaller than a byte?\n" }, ...
I need to cut out and save/use part of a string in C#. I figure the best way to do this is by using Regex. My string looks like this: "changed from 1 to 10". I need a way to cut out the two numbers and use them elsewhere. What's a good way to do this?
You can definitely use Regular Expressions (Regex) in C# to extract the numbers from the given string. Below is a simple example of how you can do this: ```csharp using System; using System.Text.RegularExpressions; class Program { static void Main() { string input = "changed from 1 to 10"; str...
45,874
[ { "from": "human", "value": "I need to cut out and save/use part of a string in C#. I figure the best way to do this is by using Regex. My string looks like this:\n\"changed from 1 to 10\". \nI need a way to cut out the two numbers and use them elsewhere. What's a good way to do this?\n" }, { "from"...
I am a PHP developer who is kind of in a pickle. I'm trying to locate and/or build an API capable of speaking to Hotmail, Yahoo and GMAIL in order to retrieve contact lists (with the user's consent, of course). The one I'm having the most trouble finding is a Hotmail API. Where would I start to look as far as finding e...
You're right to consider user consent when accessing contacts from services like Hotmail, Yahoo, and Gmail. Each of these services has its own API for retrieving contacts, and you are correct that Hotmail (now Outlook.com) has been a bit tricky. Here’s how you can approach this: ### 1. **Microsoft (Hotmail/Outlook) AP...
40,589
[ { "from": "human", "value": "I am a PHP developer who is kind of in a pickle. I'm trying to locate and/or build an API capable of speaking to Hotmail, Yahoo and GMAIL in order to retrieve contact lists (with the user's consent, of course). The one I'm having the most trouble finding is a Hotmail API.\nWhere...
I'm trying to open a folder in explorer with a file selected. The following code produces a file not found exception: System.Diagnostics.Process.Start( "explorer.exe /select," + listView1.SelectedItems[0].SubItems[1].Text + "\\" + listView1.SelectedItems[0].Text); How can I get this command to execute i...
It looks like you are trying to launch Windows Explorer with a specific file selected using the `Process.Start` method in C#. The issue arises from how you're passing the arguments to `Process.Start`. You need to separate the executable (`explorer.exe`) and its arguments. Here's how you can do it correctly: 1. Specif...
44,789
[ { "from": "human", "value": "I'm trying to open a folder in explorer with a file selected.\nThe following code produces a file not found exception: \nSystem.Diagnostics.Process.Start(\n \"explorer.exe /select,\" \n + listView1.SelectedItems[0].SubItems[1].Text + \"\\\\\" \n + listView1.SelectedItem...
Background In a C# command-line app I'm writing, several of the parameters have "yes" and "no" as the possible values. I am storing their input using the Enum type shown below. enum YesNo { Yes, No } Which is fine - the code works. No problem there. NOTE: Yes, I could store these as bool (that's how it used...
It's great to see you reflecting on the input you've received and considering the nuances of using enums versus bools in your application. When it comes to naming your enum, clarity and expressiveness are key, especially since you want to make sure the user’s choice is immediately understandable. Here are some alterna...
48,210
[ { "from": "human", "value": "Background\nIn a C# command-line app I'm writing, several of the parameters have \"yes\" and \"no\" as the possible values.\nI am storing their input using the Enum type shown below.\nenum YesNo\n{\n Yes,\n No\n}\n\nWhich is fine - the code works. No problem there. \nNOT...
I want another developer to run a Perl script I have written. The script uses many CPAN modules that have to be installed before the script can be run. Is it possible to make the script (or the perl binary) to dump a list of all the missing modules? Perl prints out the missing modules’ names when I attempt to run the s...
It's great to hear that you've found a solution using the `%INC` hash! For anyone else who might have a similar requirement, let's expand on your approach and provide a more complete guide for gathering and listing all the required CPAN modules for a Perl script. ### How to List Required CPAN Modules for a Perl Script...
43,722
[ { "from": "human", "value": "I want another developer to run a Perl script I have written. The script uses many CPAN modules that have to be installed before the script can be run. Is it possible to make the script (or the perl binary) to dump a list of all the missing modules? Perl prints out the missing m...
Is it possible to develop plugins for Microsoft Office Communicator? If so, where does one start -- is there an SDK?
Yes, it is possible to develop plugins for Microsoft Office Communicator, which was part of the Microsoft Office suite and later evolved into Skype for Business. Microsoft provided an SDK (Software Development Kit) specifically for this purpose. ### Steps to Get Started: 1. **SDK Availability**: You will need to ...
48,818
[ { "from": "human", "value": "Is it possible to develop plugins for Microsoft Office Communicator? If so, where does one start -- is there an SDK?\n" }, { "from": "gpt", "value": "Yes, it is possible to develop plugins for Microsoft Office Communicator, which was part of the Microsoft Office sui...
I'm trying to run an update query that updates one table based on rows it finds in another table where a specific value exists anywhere in one of the remote table's column values. The query I'm using is: update c set LastStep = @StepNumber, LastDate = pv.Created from @Conversions c inner join P...
The performance issue you're experiencing with your update query can be attributed to a few different factors, particularly the way you're joining the tables and the condition you're using in the `WHERE` clause. Here are some suggestions for optimizing your query: 1. **Check for Indexes**: Ensure that your `PageViews`...
45,451
[ { "from": "human", "value": "I'm trying to run an update query that updates one table based on rows it finds in another table where a specific value exists anywhere in one of the remote table's column values. The query I'm using is:\nupdate \n c\nset\n LastStep = @StepNumber,\n LastDate = pv.Create...
I am trying to test the likelihood that a particular clustering of data has occurred by chance. A robust way to do this is Monte Carlo simulation, in which the associations between data and groups are randomly reassigned a large number of times (e.g. 10,000), and a metric of clustering is used to compare the actual da...
The problem of sampling without replacement can indeed be solved efficiently using well-established methods. To achieve this while maintaining the sizes of your groups, you can follow a straightforward approach that involves shuffling your data indices and then assigning the shuffled values to your groups based on thei...
44,092
[ { "from": "human", "value": "I am trying to test the likelihood that a particular clustering of data has occurred by chance. A robust way to do this is Monte Carlo simulation, in which the associations between data and groups are randomly reassigned a large number of times (e.g. 10,000), and a metric of cl...
I would like to write a program that will identify a machine( for licensing purposes), I tought about getting the following information and to compile an xml file with this data: MAC address. CPU data (serial, manufacture, etc) MotherBoard Identification. (serial, manufacture, etc) can someone refer me to a lib that ...
To gather system information like MAC address, CPU data, and motherboard identification in a C++ program, there are several libraries and APIs you can use, depending on the operating system you're targeting. ### For Windows 1. **Windows Management Instrumentation (WMI)**: - WMI provides a standardized way to acces...
41,157
[ { "from": "human", "value": "I would like to write a program that will identify a machine( for licensing purposes), I tought about getting the following information and to compile an xml file with this data:\n\nMAC address.\nCPU data (serial, manufacture, etc)\nMotherBoard Identification. (serial, manufactu...
In a file called index.asp, which is set up in IIS as a default document for the directory, I'm trying to determine via .asp VBScript if the page was called as the default document versus directly by name, i.e. I'm trying to distinguish between these two cases server-side: http://someurl/ http://someurl/index.asp I kno...
To differentiate between a request for a default document (like `http://someurl/`) and a direct request to the document itself (`http://someurl/index.asp`) in ASP using VBScript, you can utilize the `HTTP_REFERER` server variable and check the `SCRIPT_NAME` to see if it matches the default document's name. Here’s a po...
47,738
[ { "from": "human", "value": "In a file called index.asp, which is set up in IIS as a default document for the directory, I'm trying to determine via .asp VBScript if the page was called as the default document versus directly by name, i.e. I'm trying to distinguish between these two cases server-side:\nhttp...
I have a C# program which uses a SQL Server database.I am already using it in a country that uses . as decimal separator. Now I want to use it in another country that uses , as decimal separator. in C# is there some application level setting that I can change or write some code so that I can use the same database and ...
To handle different decimal separators in your C# program when using a SQL Server database, you can approach the problem from multiple angles. However, you do **not** need to change your entire code base, but there are some important points to consider. ### Key Points to Consider 1. **Culture-Specific Formatting**: ...
42,340
[ { "from": "human", "value": "I have a C# program which uses a SQL Server database.I am already using it in a country that uses . as decimal separator.\nNow I want to use it in another country that uses , as decimal separator.\nin C# is there some application level setting that I can change or write some co...
I'm trying to generate synthetic Javascript events in an Internet Explorer extension, and I'm having trouble getting the fromElement property to stick. Here's an excerpt of my code: MsHtml.IHTMLDocument4 doc4 = ... // the document object Object o = null; MsHtml.IHTMLEventObj2 eObj = (MsHtml.IHTMLEventObj2)doc4.Cr...
When working with synthetic events in an Internet Explorer extension, particularly with the `fromElement` property of the `IHTMLEventObj2` interface, it's essential to ensure that you're correctly setting the property and that the `from` object is a valid reference to an `IHTMLElement`. Here's a checklist of things to...
44,805
[ { "from": "human", "value": "I'm trying to generate synthetic Javascript events in an Internet Explorer extension, and I'm having trouble getting the fromElement property to stick. Here's an excerpt of my code:\nMsHtml.IHTMLDocument4 doc4 = ... // the document object\nObject o = null;\nMsHtml.IHTMLEventObj...
I am looking to get a list of the column names returned from a Model. Anyone know how this would be done, any help would be greatly appreciated. Example Code: var project = db.Projects.Single(p => p.ProjectID.Equals(Id)); This code would return the Projects object, how would I get a list of all the column names in thi...
To retrieve a list of the column names from a model (like your `Projects` object) in C#, you can use reflection. Reflection allows you to inspect the metadata of types at runtime, which includes properties and their names. Here’s how you can get the column names from your `Projects` model: ### Example Code ```csharp...
48,309
[ { "from": "human", "value": "I am looking to get a list of the column names returned from a Model. Anyone know how this would be done, any help would be greatly appreciated.\nExample Code:\nvar project = db.Projects.Single(p => p.ProjectID.Equals(Id));\n\nThis code would return the Projects object, how woul...
It seems to be often said that Task Manager does not provide an accurate indication of how much memory is in use by a process. If this is indeed the case, what's the easiest way to find these things out? I'd like to know: Total Memory in use (whether in RAM or paged or whatever) Total RAM in use (running in a situatio...
When analyzing memory usage of a process in Windows (or any operating system), understanding the distinctions between various memory metrics is crucial. Task Manager might not give you all the information you need, so here are methods to gather detailed memory statistics: ### 1. **Total Memory in Use (Virtual Memory)*...
44,495
[ { "from": "human", "value": "It seems to be often said that Task Manager does not provide an accurate indication of how much memory is in use by a process.\nIf this is indeed the case, what's the easiest way to find these things out?\nI'd like to know:\n\nTotal Memory in use (whether in RAM or paged or what...