instruction
stringlengths
14
27.6k
completion
stringlengths
3
38.3k
__original_row_idx
int64
0
50k
conversations
listlengths
2
2
I have a 2 variable 100x100 data table in excel. I need to have a function that returns all the possible sets of variables that yield a given target value. What I am looking at is some kind of a reursive 2 dimensional lookup function. Can someone point me in the right direction?
To find all possible sets of variables in a 2D table that yield a given target value, you can create a recursive function in Excel using Visual Basic for Applications (VBA). Below is a step-by-step guide on how to achieve this. ### Step 1: Set Up Your Data 1. Ensure your 2D data table is organized in Excel. For instan...
40,945
[ { "from": "human", "value": "I have a 2 variable 100x100 data table in excel.\nI need to have a function that returns all the possible sets of variables that yield a given target value.\nWhat I am looking at is some kind of a reursive 2 dimensional lookup function. Can someone point me in the right directio...
This is my code: type HoraAtendimento = (String, Int, Int) htmlHAtendimento :: [HoraAtendimento] -> Html htmlHAtendimento [] = toHtml "" htmlHAtendimento ((da,hia,hfa):[]) = toHtml da +++ "feira " +++ show hia +++ "h - " +++ show hfa +++ "h" htm...
Yes, you can certainly use the `map` function to eliminate the explicit recursion in your `htmlHAtendimento` function. The idea is to map over your list of `HoraAtendimento` tuples, formatting each entry as you desire, and then combine the results into a single `Html` value. Here's how you can modify your code: ```ha...
48,060
[ { "from": "human", "value": "This is my code:\ntype HoraAtendimento = (String, Int, Int)\n\nhtmlHAtendimento :: [HoraAtendimento] -> Html\nhtmlHAtendimento [] = toHtml \"\"\nhtmlHAtendimento ((da,hia,hfa):[]) = toHtml da +++ \"feira \"\n +++\n ...
How to convert Unicode string into a utf-8 or utf-16 string? My VS2005 project is using Unicode char set, while sqlite in cpp provide int sqlite3_open( const char *filename, /* Database filename (UTF-8) */ sqlite3 **ppDb /* OUT: SQLite db handle */ ); int sqlite3_open16( const void *filename, /* Dat...
To convert a Unicode string (using `wchar_t`, `CString`, or `std::wstring`) into UTF-8 or UTF-16 in a Visual Studio 2005 project, you can use the following methods. ### 1. **Converting `std::wstring` to UTF-8** You can achieve this conversion manually using the Windows API, specifically `WideCharToMultiByte`: ```cpp...
43,214
[ { "from": "human", "value": "How to convert Unicode string into a utf-8 or utf-16 string?\nMy VS2005 project is using Unicode char set, while sqlite in cpp provide \nint sqlite3_open(\n const char *filename, /* Database filename (UTF-8) */\n sqlite3 **ppDb /* OUT: SQLite db handle */\n);\nint s...
I am looking to perform a polynomial least squares regression and am looking for a C# library to do the calculations for me. I pass in the data points and the degree of polynomal (2nd order, 3rd order, etc) and it returns either the C0, C1, C2 etc. constant values or the calculated values "predictions". Note: I am us...
For performing polynomial least squares regression in C#, there are several libraries you can use that can help you with the calculations. Here are a few popular ones that can meet your needs: ### 1. **Math.NET Numerics** Math.NET Numerics is a powerful numerical library that supports a wide range of mathematical oper...
43,589
[ { "from": "human", "value": "I am looking to perform a polynomial least squares regression and am looking for a C# library to do the calculations for me. \nI pass in the data points and the degree of polynomal (2nd order, 3rd order, etc) and it returns either the C0, C1, C2 etc. constant values or the calc...
Is there a medium-sized Clojure sample application that could be used as a "best-practices" example, and a good way to see what such an application would look like in terms of code and code organization? A web application would be particularly interesting to me, but most important is that the program do something commo...
Yes, there are several Clojure sample applications that showcase best practices and code organization, particularly in the context of web development. Below are a few recommendations that fit your criteria: ### 1. **ClojureScript and Reagent Blog Example** - **GitHub Repository**: [reagent-blog](https://github.com/ada...
41,543
[ { "from": "human", "value": "Is there a medium-sized Clojure sample application that could be used as a \"best-practices\" example, and a good way to see what such an application would look like in terms of code and code organization?\nA web application would be particularly interesting to me, but most impo...
Is it possible to register a COM interface independent of assembly version? Right now I get a registry key like MyIfaceName, Version=1.0.3259.17799, Culture=neutral, PublicKeyToken=1234567890abcdef But since the assembly has auto-versioning (1.0.*.*), every day I do a new build the COM-iface needs to be re-registered....
Yes, it is possible to register a COM interface independent of the assembly version, but it requires some specific configuration and understanding of COM's versioning and registration mechanism. Here’s how you can do it and the consequences of doing so: ### Registering a COM Interface Without Versioning 1. **Use a Fi...
44,696
[ { "from": "human", "value": "Is it possible to register a COM interface independent of assembly version?\nRight now I get a registry key like\nMyIfaceName, Version=1.0.3259.17799, Culture=neutral, PublicKeyToken=1234567890abcdef\n\nBut since the assembly has auto-versioning (1.0.*.*), every day I do a new b...
I'm trying to get the name of the executable of a window that is outside my C# 2.0 application. My app currently gets a window handle (hWnd) using the GetForegroundWindow() call from "user32.dll". From the digging that I've been able to do, I think I want to use the GetModuleFileNameEx() function (from PSAPI) to obtain...
Your approach to retrieving the executable name of a window from its handle in C# is mostly correct. Let's break it down and address the concerns you mentioned: ### Steps to Get the Executable Name from a Window Handle 1. **Get the Process ID**: Use `GetWindowThreadProcessId` to get the process ID associated with the ...
43,404
[ { "from": "human", "value": "I'm trying to get the name of the executable of a window that is outside my C# 2.0 application. My app currently gets a window handle (hWnd) using the GetForegroundWindow() call from \"user32.dll\".\nFrom the digging that I've been able to do, I think I want to use the GetModule...
It seems like when you have a WinForms .NET application, and a ComboBox (set to the "DropDown" style), and that ComboBox has multiple items in it that are identical, weird things happen. Specifically, the index of the selected item can change without firing the SelectedIndexChanged event. Of course, this causes mass c...
This issue you're encountering with the ComboBox in a WinForms application is indeed a quirk of the control when it contains duplicate entries. When you interact with the ComboBox in DropDown style, selecting an item and then clicking the drop-down arrow without selecting anything can lead to unexpected behavior, like ...
43,259
[ { "from": "human", "value": "It seems like when you have a WinForms .NET application, and a ComboBox (set to the \"DropDown\" style), and that ComboBox has multiple items in it that are identical, weird things happen. Specifically, the index of the selected item can change without firing the SelectedIndexCh...
Consider a template class like: template<typename ReturnType, ReturnType Fn()> class Proxy { void run() { ReturnType ret = Fn(); // ... do something ... } }; // and a functions int fn1() { return 5; } float fn2() { return 5; } This can be instantiated by using: Proxy<int, &fn1> p1; But ex...
In C++03, you do not have access to some of the modern features that allow for easy deduction of types from function pointers, such as `decltype` or template type deduction directly from function pointers. However, you can achieve similar functionality by using function traits, which can help you extract the return typ...
45,531
[ { "from": "human", "value": "Consider a template class like:\ntemplate<typename ReturnType, ReturnType Fn()>\nclass Proxy\n{\n void run()\n {\n ReturnType ret = Fn();\n // ... do something ...\n }\n};\n\n// and a functions\nint fn1() { return 5; }\nfloat fn2() { return 5; }\n\nThis ca...
I want to install PEAR on PHP 5, so I can use Spreadsheet_Excel_Writer. I don`t know how to install it on my ISP nor my personal MacBook. Thoughts for both?
To install PEAR (PHP Extension and Application Repository) and the `Spreadsheet_Excel_Writer` package on both your ISP and personal MacBook, follow the steps below: ### For Your MacBook 1. **Install PEAR**: First, you need to make sure that you have PEAR installed on your Mac. Most modern PHP installations come w...
41,610
[ { "from": "human", "value": "I want to install PEAR on PHP 5, so I can use Spreadsheet_Excel_Writer.\nI don`t know how to install it on my ISP nor my personal MacBook.\nThoughts for both?\n" }, { "from": "gpt", "value": "To install PEAR (PHP Extension and Application Repository) and the `Spreads...
So, I have a WindowsFormsHost control in my WPF app (hosting a Dundas Chart) and I want to put a ContextMenu on it. I can successfully attach a ContextMenu to any normal WPF control, but it's not working for the WindowsFormsHost. I suspect this is becuase it's "special" in some way and the appropriate mouse messages ar...
Attaching a `ContextMenu` to a `WindowsFormsHost` in WPF can be tricky due to how input events are processed between WPF and WinForms. The `WindowsFormsHost` doesn't natively support WPF's `ContextMenu`, so you’ll need to handle mouse events to show the context menu manually. Here's a step-by-step guide to achieving t...
43,694
[ { "from": "human", "value": "So, I have a WindowsFormsHost control in my WPF app (hosting a Dundas Chart) and I want to put a ContextMenu on it.\nI can successfully attach a ContextMenu to any normal WPF control, but it's not working for the WindowsFormsHost. I suspect this is becuase it's \"special\" in so...
I'm writing a WPF app whereby usercontrols are being dynamically created programmatically in response to an event. The main window canvas has a grid, and i'm adding new columndefs and rowdefs, which contain the new user controls. I need these user controls to keep track of where the mouse is, so that they can respond ...
To maintain mouse tracking across multiple UserControls (UCs) in a WPF application, you can utilize the parent window to capture mouse events. By handling the mouse events at the parent window level, you can update each UserControl about the current mouse position. Here’s a step-by-step approach to achieve that: 1. *...
41,312
[ { "from": "human", "value": "I'm writing a WPF app whereby usercontrols are being dynamically created programmatically in response to an event. The main window canvas has a grid, and i'm adding new columndefs and rowdefs, which contain the new user controls.\nI need these user controls to keep track of whe...
Is Lucene.Net suitable as the search engine for frequently changing content? Or more specificically, can anybody give a subjective opinion on how quickly lucene.net indexes can be updated. Any other approaches to searching frequently changing content would be great. We’re developing a forum. Forum posts will be freque...
Lucene.Net can be a suitable choice for searching frequently changing content, but there are several factors to consider regarding how quickly indexes can be updated and how to manage that in a real-world application, particularly for a forum with a large number of posts. ### Indexing Performance 1. **Real-time Indexi...
42,727
[ { "from": "human", "value": "Is Lucene.Net suitable as the search engine for frequently changing content? \nOr more specificically, can anybody give a subjective opinion on how quickly lucene.net indexes can be updated. Any other approaches to searching frequently changing content would be great.\nWe’re dev...
I am trying to hide the button based on the user's role using the following code: <asp:Button ID="btndisplayrole" Text="Admin Button" Visible='<%= WebApplication1.SiteHelper.IsUserInRole("Admin") %>' runat="server" OnClick="DisplayRoleClick" /> But when I run the above code I get the following error message: Cannot...
The error you're encountering stems from the fact that ASP.NET does not allow you to use inline expressions like `<%= %>` in the properties of server controls, such as the `Visible` property of a button. To conditionally show or hide the button based on the user's role, you should set the `Visible` property in the cod...
47,428
[ { "from": "human", "value": "I am trying to hide the button based on the user's role using the following code: \n <asp:Button ID=\"btndisplayrole\" Text=\"Admin Button\" Visible='<%= WebApplication1.SiteHelper.IsUserInRole(\"Admin\") %>' runat=\"server\" OnClick=\"DisplayRoleClick\" />\n\nBut when I run the...
I'm trying to determine if any changes were made to a particular entity object. Essentially, I want to know if SubmitChanges() will actually change anything. I would prefer to be able to determine this after SubmitChanges() has been called, but it doesn't really matter. Anyone know how I would do this?
In many object-relational mapping (ORM) frameworks, including Entity Framework, there are methods and properties that you can use to determine if there are any changes made to the entity objects before or after calling `SubmitChanges()` or its equivalent. Here’s how you can typically achieve this in Entity Framework: ...
44,425
[ { "from": "human", "value": "I'm trying to determine if any changes were made to a particular entity object. Essentially, I want to know if SubmitChanges() will actually change anything. I would prefer to be able to determine this after SubmitChanges() has been called, but it doesn't really matter.\nAnyone ...
I would like to place a link from my application's narrow profile box to it's application tab on the same profile. I have combed through the FBML documentation to no avail. I have posted this question on the Facebook dev forums. I have experimented with pasting the URL of the tab into the profile box link without succ...
If you want to link directly from your application’s profile box to its tab on the same Facebook profile, you can use a specific URL format. Here are a few steps you can follow to achieve this: 1. **Tab URL Format**: The link to your application's tab usually follows this format: ``` https://www.facebook.com/YOU...
45,422
[ { "from": "human", "value": "I would like to place a link from my application's narrow profile box to it's application tab on the same profile. \nI have combed through the FBML documentation to no avail. I have posted this question on the Facebook dev forums. I have experimented with pasting the URL of the ...
I have a problem. One of the datatable colums value is a string value '001200' for example. When the Excel document creats the value became '1200'. How can I keep a data format as is? I'm working with ASP.NET 1.1. The part of the code is: private void lnkExport_Click( object sender, System.EventArgs e ) { Response.Cl...
When you export data to Excel and you have a string that represents a number with leading zeros (like '001200'), Excel can interpret this as a numeric value and will strip the leading zeros, displaying it as '1200'. To preserve the leading zeros, you can take the following approaches: ### Approach 1: Prepend with a Si...
44,563
[ { "from": "human", "value": "I have a problem. One of the datatable colums value is a string value '001200' for example. When the Excel document creats the value became '1200'. How can I keep a data format as is? I'm working with ASP.NET 1.1.\nThe part of the code is:\nprivate void lnkExport_Click( object s...
Skunk Works Project: A project carried out by one part of a company without the knowledge of the remainder of the company. Looking for stories about any skunk works projects you've worked on or initiated: Was it successful? Were you found out? Were you punished or rewarded? How did you fund it? How did you staff i...
While I can't share personal experiences or stories of skunk works projects, I can provide a hypothetical scenario based on common themes associated with such projects: ### Hypothetical Skunk Works Project: "Project Phoenix" **Overview:** "Project Phoenix" was initiated within a technology company aiming to create a ...
46,546
[ { "from": "human", "value": "Skunk Works Project: A project carried out by one part of a company without the knowledge of the remainder of the company.\nLooking for stories about any skunk works projects you've worked on or initiated:\n\nWas it successful? \nWere you found out? \nWere you punished or reward...
I've created an instance of a SamlAssertion, and added the the authorization statement and attribute statments to it, and now I want to print out the XML so I can do an HTTP post, but not all of the assertion is being outputed. What am I missing (I'm sure it's something bone-headed)? Here is the code I'm using: // Add...
It looks like you're running into an issue where not all parts of your SAML Assertion are being serialized correctly. Here are some steps and things to check that might help you resolve the issue: 1. **Ensure All Statements Are Added**: You mentioned adding both the authentication and attribute statements, but it's wo...
43,351
[ { "from": "human", "value": "I've created an instance of a SamlAssertion, and added the the authorization statement and attribute statments to it, and now I want to print out the XML so I can do an HTTP post, but not all of the assertion is being outputed. What am I missing (I'm sure it's something bone-he...
How do you call a URL from ActionScript 2 without opening a new window ? I've tried "getUrl" and various methods of "LoadVars".
In ActionScript 2, if you want to call a URL (such as sending data to a server) without opening a new window, you can use the `LoadVars` class. This class is specifically designed for handling URL requests and can be used to send and receive data from a server in the background without affecting the user's current page...
44,833
[ { "from": "human", "value": "How do you call a URL from ActionScript 2 without opening a new window ? I've tried \"getUrl\" and various methods of \"LoadVars\".\n" }, { "from": "gpt", "value": "In ActionScript 2, if you want to call a URL (such as sending data to a server) without opening a new ...
I'm having a very peculiar problem in my Python FastCGI code - sys.stdout has a file descriptor of '-1', so I can't write to it. I'm checking this at the first line of my program, so I know it's not any of my code changing it. I've tried sys.stdout = os.fdopen(1, 'w'), but anything written there won't get to my browser...
The problem you are experiencing with `sys.stdout` having a file descriptor of `-1` in your FastCGI application on IIS is indeed peculiar and can be quite frustrating. This issue is likely related to how the FastCGI extension for IIS manages standard input and output streams. Here's a few suggestions to help you troub...
43,716
[ { "from": "human", "value": "I'm having a very peculiar problem in my Python FastCGI code - sys.stdout has a file descriptor of '-1', so I can't write to it.\nI'm checking this at the first line of my program, so I know it's not any of my code changing it.\nI've tried sys.stdout = os.fdopen(1, 'w'), but any...
I can't seem to find a nice clean example of using AES 128 bit encryption. Does anyone have some sample code?
Certainly! Below, I'll provide a simple example of using AES (Advanced Encryption Standard) with 128-bit encryption in Python using the `Cryptography` library. You'll need to install the library if you haven't already. You can do this with pip: ```bash pip install cryptography ``` Here's a sample code demonstrating h...
40,700
[ { "from": "human", "value": "I can't seem to find a nice clean example of using AES 128 bit encryption.\nDoes anyone have some sample code?\n" }, { "from": "gpt", "value": "Certainly! Below, I'll provide a simple example of using AES (Advanced Encryption Standard) with 128-bit encryption in Pyth...
I have looked at the SQL Server 2008 feature comparison matrix and it lists the express/web and workgroup editions as having the SSIS runtime. Does this mean it is possible to develop SSIS packages using the developer edition, and then deploy and run them on a server running one of the lowly SQL Server editions such as...
Yes, you are correct. In SQL Server 2008, the SSIS (SQL Server Integration Services) runtime is included in the SQL Server Express edition, which allows you to execute SSIS packages. However, it's important to note a few key points regarding development and deployment: 1. **Development**: You can create and develop SS...
46,038
[ { "from": "human", "value": "I have looked at the SQL Server 2008 feature comparison matrix and it lists the express/web and workgroup editions as having the SSIS runtime. Does this mean it is possible to develop SSIS packages using the developer edition, and then deploy and run them on a server running one...
I mean something like "hg serve", with HTTP push support. This is probably not supported out of the box due GAE's read-only file system. If you know of any attempts to do it or analysis of what it would take, please share.
Using Mercurial (hg) on Google App Engine (GAE) can indeed present challenges, especially because GAE has a read-only file system in its standard environment. This makes it difficult to implement features that require writing to the filesystem, such as a server that supports HTTP push. To implement something akin to `...
44,598
[ { "from": "human", "value": "I mean something like \"hg serve\", with HTTP push support.\nThis is probably not supported out of the box due GAE's read-only file system. If you know of any attempts to do it or analysis of what it would take, please share.\n" }, { "from": "gpt", "value": "Using Me...
I'm looking for a good plugin for doing web front end work in Eclipse. I don't want something that completely takes over eclipse, or something that has masses of dependencies that need to be updated all the time, or something that is geared towards a particular server-side platform, or something that costs a heap. Is t...
If you're looking for a lightweight and unobtrusive web front-end development plugin for Eclipse, here are a few alternatives you might consider: 1. **Eclipse Web Developer Tools**: - The Eclipse IDE itself comes with a set of web development tools that include HTML, CSS, and JavaScript editors. These are generally...
47,717
[ { "from": "human", "value": "I'm looking for a good plugin for doing web front end work in Eclipse. I don't want something that completely takes over eclipse, or something that has masses of dependencies that need to be updated all the time, or something that is geared towards a particular server-side platf...
The following code works for me: var webProxy = WebProxy.GetDefaultProxy(); webProxy.UseDefaultCredentials = true; WebRequest.DefaultWebProxy = webProxy; Unfortunately, WebProxy.GetDefaultProxy() is deprecated. What else should I be doing? (using app.config to set the defaultProxy settings is not allowed in my deploy...
Since `WebProxy.GetDefaultProxy()` is deprecated, you can manually create an instance of `WebProxy` and configure it to use the system's default proxy settings. Here's an example of how you can retrieve and use the system's default proxy settings without using the deprecated method: ```csharp using System; using Sys...
46,448
[ { "from": "human", "value": "The following code works for me:\nvar webProxy = WebProxy.GetDefaultProxy();\nwebProxy.UseDefaultCredentials = true;\nWebRequest.DefaultWebProxy = webProxy;\n\nUnfortunately, WebProxy.GetDefaultProxy() is deprecated. What else should I be doing?\n(using app.config to set the de...
I have stumbled across something truly puzzling regarding System.getProperty("os.name"). According to a Java bug on the matter and the Java 5 release notes (search for "os.name"), there was a bug in Java with early "longhorn" versions of Vista that should have been fixed in v5 release 10. However on my Vista SP1 box - ...
The issue you're encountering with `System.getProperty("os.name")` returning "Windows XP" instead of "Windows Vista" is not uncommon, especially on certain versions of Java running on Windows Vista. This behavior can result from how Java interacts with the Windows operating system, particularly regarding how it retriev...
45,482
[ { "from": "human", "value": "I have stumbled across something truly puzzling regarding System.getProperty(\"os.name\"). According to a Java bug on the matter and the Java 5 release notes (search for \"os.name\"), there was a bug in Java with early \"longhorn\" versions of Vista that should have been fixed i...
I can set data in JTable constructor, and then user can change this data when program is running manually(typing from keyboard). But what method should I use in case I want to change data in some column? To change column header I use TableColumn method setHeaderValue. What should I use to set value in JTable cell?
To change the value of a specific cell in a `JTable`, you will typically use the `setValueAt(Object aValue, int row, int column)` method of the `TableModel` associated with the `JTable`. Here’s how you can do it: 1. First, get the table model from your `JTable` instance. 2. Then, call `setValueAt` with the new value, ...
44,501
[ { "from": "human", "value": "I can set data in JTable constructor, and then user can change this data when program is running manually(typing from keyboard).\nBut what method should I use in case I want to change data in some column? To change column header I use TableColumn method setHeaderValue. What shou...
How to design a dropdown list that can have multiple selections using checkboxes. Can we do it using html/css or it requires javascript? For a visual clarity you can have a look at the image I have attached.image link
Creating a dropdown list that allows multiple selections using checkboxes can be accomplished using HTML and CSS, but you will need JavaScript to manage the interactions (like opening/closing the dropdown and handling the selections). Below is a simple example of how to achieve this. ### HTML ```html <!DOCTYPE html> <...
42,690
[ { "from": "human", "value": "How to design a dropdown list that can have multiple selections using checkboxes. Can we do it using html/css or it requires javascript? For a visual clarity you can have a look at the image I have attached.image link\n" }, { "from": "gpt", "value": "Creating a dropd...
I'm building a web application that guides my users through the configuration and installation of an application. It builds a set of configuration files dynamically, then sends them in an archive (.ZIP file) along with an installer for the application. The web page is generated from a linux shell script (sorry), and ...
To implement the functionality you're describing in your bash script, you can utilize HTTP headers to manage file downloads directly from the script. This way, you can initiate the download automatically once the user has completed the required information. Here's a basic outline of how your script could look: ```ba...
44,810
[ { "from": "human", "value": "I'm building a web application that guides my users through the configuration and installation of an application. It builds a set of configuration files dynamically, then sends them in an archive (.ZIP file) along with an installer for the application. The web page is generate...
How do I setup a class that represents an interface? Is this just an abstract base class?
Yes, in Python, when you want to define an interface, you can indeed use an abstract base class (ABC). An abstract base class can define methods that must be created within any subclass derived from it. This is useful for setting up a common interface that other classes will adhere to, ensuring that those classes imple...
45,347
[ { "from": "human", "value": "How do I setup a class that represents an interface? Is this just an abstract base class?\n" }, { "from": "gpt", "value": "Yes, in Python, when you want to define an interface, you can indeed use an abstract base class (ABC). An abstract base class can define method...
I need to create a status dialog for a Windows Mobile application (C# 2.0) that needs to be updated, so MessageBox is out. I tried to just create a new Form class, change the size and call ShowDialog, but it always comes up full screen (minus the title bar of course). The only way I could figure out how to display it...
To create a status dialog that resembles a message box and is resizable in a Windows Mobile application, you can customize a `Form` by adjusting its properties and using a `Panel` to create the desired layout. Here’s how you can achieve this: 1. **Create a Custom Form**: You will create a custom form that acts like a ...
43,001
[ { "from": "human", "value": "I need to create a status dialog for a Windows Mobile application (C# 2.0) that needs to be updated, so MessageBox is out. I tried to just create a new Form class, change the size and call ShowDialog, but it always comes up full screen (minus the title bar of course). The only...
I had this question earlier and it was concluded it was a bug in 5.2.5. Well, it's still broken in 5.2.6, at least for me: Please let me know if it is broken or works for you: $obj = new stdClass(); $obj->{"foo"} = "bar"; $obj->{"0"} = "zero"; $arr = (array)$obj; //foo -- bar //0 -- {error: undefined index} foreac...
The issue you're experiencing is related to how PHP handles string keys in an array when you're casting an object to an array. When casting an object to an array, PHP treats properties with numeric string keys (like `"0"`) differently than those with non-numeric string keys (like `"foo"`). In your case, the issue ari...
48,649
[ { "from": "human", "value": "I had this question earlier and it was concluded it was a bug in 5.2.5. Well, it's still broken in 5.2.6, at least for me:\nPlease let me know if it is broken or works for you:\n$obj = new stdClass();\n$obj->{\"foo\"} = \"bar\";\n$obj->{\"0\"} = \"zero\";\n$arr = (array)$obj;\n...
Which would be quicker. 1) Looping a datareader and creating a custom rows and columns based populated datatable 2) Or creating a dataAdapter object and just (.Fill)ing a datatable. Does the performance of a datareader still hold true upon dynamic creation of a datatable?
When comparing the performance of using a `DataReader` versus a `DataAdapter` for populating a `DataTable`, there are several factors to consider: 1. **DataReader**: - A `DataReader` provides a fast, forward-only way to read data from a database. It is typically more efficient for read operations because it streams...
45,336
[ { "from": "human", "value": "Which would be quicker.\n1) Looping a datareader and creating a custom rows and columns based populated datatable\n2) Or creating a dataAdapter object and just (.Fill)ing a datatable.\nDoes the performance of a datareader still hold true upon dynamic creation of a datatable? \n"...
I've got a collection of records to process, and the processing can be parallelized, so I've created an ExecutorService (via Executors#newCachedThreadPool()). The processing of an individual record is, itself, composed of parallelizable steps, so I'd like to use another ExecutorService. Is there an easy way to make thi...
Using multiple `ExecutorService` instances that share the same underlying thread pool can be a bit tricky and is generally not recommended due to potential complications and inefficiencies. Here's a breakdown of your options and considerations: ### Sharing an `ExecutorService` 1. **Sharing Thread Pool**: You can c...
45,137
[ { "from": "human", "value": "I've got a collection of records to process, and the processing can be parallelized, so I've created an ExecutorService (via Executors#newCachedThreadPool()). The processing of an individual record is, itself, composed of parallelizable steps, so I'd like to use another Executor...
I've used NUnit for years and I wanted to try XUnit. So I installed XUnit and ran the executable that allowed you to run XUnit via TD.net. I can't seem to run more than one test at a time. With NUnit + TD.net, I could click on the filename in the solution and run all the tests in the file. I can't seem to do that w...
Running multiple tests in xUnit using TestDriven.Net (TD.net) should indeed be possible, similar to how you've been doing it with NUnit. However, there can be some differences in behavior and configuration between the two frameworks. Here are some steps and considerations to help you troubleshoot the issue: 1. **Ensur...
45,287
[ { "from": "human", "value": "I've used NUnit for years and I wanted to try XUnit. So I installed XUnit and ran the executable that allowed you to run XUnit via TD.net. \nI can't seem to run more than one test at a time. With NUnit + TD.net, I could click on the filename in the solution and run all the tes...
If I have an inner class, like this: public class Test { public class Inner { // code ... } public static void main(String[] args) { // code ... } } When I compile it, I expect it should generate two files: Test.class Test$Inner.class So why do I sometimes see classfiles like ...
The presence of class files named `SomeClass$1.class`, `SomeClass$2.class`, etc., indicates that you are dealing with anonymous inner classes in your code. In Java, when you create an anonymous inner class, the Java compiler generates a class file for that anonymous class. The naming convention for these classes invo...
47,028
[ { "from": "human", "value": "If I have an inner class, like this:\npublic class Test\n{\n public class Inner\n {\n // code ...\n }\n\n public static void main(String[] args)\n {\n // code ...\n }\n}\n\nWhen I compile it, I expect it should generate two files:\nTest.class\nTes...
CodeIgniter allows access to POSTed data via: $this->input->post('input_name'); where 'input_name' is the name of a form field. This works well for a static form where each input name in known ahead of time. In my case, I am loading a collection of key/value pairs from the database. The form contains a text input for ...
Yes, you can retrieve an array of posted data in CodeIgniter using the `$this->input->post()` method. To get all posted data as an associative array, you can simply call the method without specifying a parameter. Here's how you can do it: ```php $post_data = $this->input->post(); ``` This will give you an associati...
45,721
[ { "from": "human", "value": "CodeIgniter allows access to POSTed data via:\n$this->input->post('input_name');\n\nwhere 'input_name' is the name of a form field. This works well for a static form where each input name in known ahead of time.\nIn my case, I am loading a collection of key/value pairs from the ...
I am experimenting SDL Events and I came into a problem. For some reason, I am unable to press the "X" or close bottom on the top right of the window application. Now I am currently unsure if that is related to the SDL coding, or it's a problem of window browser. Does anyone know if it's either a SDL problem or a Windo...
If you're having trouble with the "X" or close button on the top right of your SDL window not working, it's most likely related to how your SDL event loop is handling events. Specifically, you need to ensure that your event handling code is set up to properly respond to the SDL_QUIT event, which is generated when the w...
43,858
[ { "from": "human", "value": "I am experimenting SDL Events and I came into a problem. For some reason, I am unable to press the \"X\" or close bottom on the top right of the window application. Now I am currently unsure if that is related to the SDL coding, or it's a problem of window browser.\nDoes anyone ...
I thought 2048 security violation error were mean to happen when trying to access other domains. I got: "Security sandbox violation: http://127.0.0.1/site_media/main.swf cannot load data from 127.0.0.1:80", isn it the same domain? what is the solution ? on doing var loader:MultipartLoader = new MultipartLoader("http:...
The error you’re encountering is related to Flash’s security sandbox restrictions. Flash Player has a security model in place to protect users from malicious content, and it restricts access to data based on the domain and protocol. In your case, you're accessing a Flash file (`main.swf`) over `http://127.0.0.1` and t...
45,577
[ { "from": "human", "value": "I thought 2048 security violation error were mean to happen when trying to access other domains. \nI got:\n\"Security sandbox violation: http://127.0.0.1/site_media/main.swf cannot load data from 127.0.0.1:80\", isn it the same domain? what is the solution ?\non doing\nvar load...
I'm thinking of asking my students to use git for pair programming. Because student work has to be secret, a public repo is out of the question. Instead, each student will have a private repo they maintain themselves, and they will need to exchange patches using git-format-patch. I've read the man page but I'm a lit...
Certainly! To facilitate your students exchanging patches between private Git repositories using `git-format-patch` and `git-am`, let's walk through a simple example involving two students, Alice and Bob. ### Setup 1. **Alice and Bob create their own private repositories.** ```bash # Alice's setup mkdir alice-repo c...
42,809
[ { "from": "human", "value": "I'm thinking of asking my students to use git for pair programming. Because student work has to be secret, a public repo is out of the question. Instead, each student will have a private repo they maintain themselves, and they will need to exchange patches using git-format-pat...
How do I send mail via PHP with attachment of HTML file? -> Content of HTML file (code) is in string in DB. Is there some easy way or free script to do this? I don't want to store the file localy, I need to read it out of DB and send it straightaway as attachment (not included in body).
Yes, you can send an email with an HTML file as an attachment directly from a string stored in your database using PHP's `mail()` function or using the PHPMailer library, which is a more robust solution. Below is a guide on how to do this using PHPMailer, as it's more versatile and easier to manage attachments. ### St...
38,348
[ { "from": "human", "value": "How do I send mail via PHP with attachment of HTML file? -> Content of HTML file (code) is in string in DB. Is there some easy way or free script to do this? I don't want to store the file localy, I need to read it out of DB and send it straightaway as attachment (not included i...
I have a silverlight control which has a reference to a silverlight enabled wcf service. When I add a reference to the service in my silverlight control, it adds the following to my clientconfig file: <configuration> <system.serviceModel> <bindings> <basicHttpBinding> <binding na...
In Silverlight applications, when you want to use a relative URL for the endpoint address in the client configuration, you can make use of a special syntax that enables you to specify the address relative to the root of the host web application. In your case, you can use the base address of the service by defining th...
46,532
[ { "from": "human", "value": "I have a silverlight control which has a reference to a silverlight enabled wcf service.\nWhen I add a reference to the service in my silverlight control, it adds the following to my clientconfig file:\n<configuration>\n <system.serviceModel>\n <bindings>\n ...
web2py to is a Python framework but shares the "convention over configuration" design that Ruby on Rails has. On the plus side it packages a lot more functionality with its s standard distribution and we claim it is faster and easier to use. Has any Rails user tried it? What is your impression? No rants please. Just t...
While I can't speak for individual Rails users, I can summarize some common technical comparisons and impressions that developers may have when transitioning from Ruby on Rails (RoR) to web2py. ### Ease of Use - **Setup and Configuration**: Web2py is designed to be easy to set up and use. Unlike Rails, which can requi...
42,529
[ { "from": "human", "value": "web2py to is a Python framework but shares the \"convention over configuration\" design that Ruby on Rails has. On the plus side it packages a lot more functionality with its s standard distribution and we claim it is faster and easier to use.\nHas any Rails user tried it? What...
I am trying to add a "title" element but am getting a NO_MODIFICATION_ALLOWED_ERR error... private static void saveDoc(String f) throws Exception { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); Document doc = db.parse(f); // create DO...
The `NO_MODIFICATION_ALLOWED_ERR` indicates that you are trying to modify a node in the DOM that is immutable. In your case, it seems that you are trying to append a new child element to the `map` node, but the `nextNode` may not be mutable. Here are a few things you should check and consider: 1. **Node Type**: Ensur...
42,748
[ { "from": "human", "value": "I am trying to add a \"title\" element but am getting a NO_MODIFICATION_ALLOWED_ERR error...\nprivate static void saveDoc(String f) throws Exception {\n\n DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();\n DocumentBuilder db = dbf.newDocumentBuilder();\n ...
I have often heard this term being used, but I have never really understood it. What does it mean, and can anyone give some examples/point me to some links? EDIT: Thanks to everyone for the replies. Can you also tell me how the canonical representation is useful in equals() performance, as stated in Effective Java?
The term "canonical representation" refers to a standardized way of expressing an object or a value that allows for consistent interpretation and comparison. In the context of programming, especially in Java, it often pertains to ensuring that an object has a unique representation that can be easily compared with other...
41,030
[ { "from": "human", "value": "I have often heard this term being used, but I have never really understood it.\nWhat does it mean, and can anyone give some examples/point me to some links?\nEDIT: Thanks to everyone for the replies. Can you also tell me how the canonical representation is useful in equals() pe...
Is it possible to do page forwarding in Grails? I searched but no luck. If possible, how do I pass parameters in the forwarding method? If not, how would I do it using redirection? I've found something like this for redirection so far:
In Grails, you can achieve page forwarding and redirection, but it's important to understand the difference between the two. **Page Forwarding**: This refers to the process of transferring control from one action to another within the same server request. In a web application context, this does not change the URL in ...
40,745
[ { "from": "human", "value": "Is it possible to do page forwarding in Grails? I searched but no luck. If possible, how do I pass parameters in the forwarding method? If not, how would I do it using redirection? I've found something like this for redirection so far:\n" }, { "from": "gpt", "value":...
I have a team of junior developers and they want to have better understanding and usages of generics. Anyone recommend good tutorial or articles samples that are good places to start.
Certainly! Generics can be a bit challenging to understand at first, but they offer a lot of power and flexibility in programming. Here are some recommended tutorials, articles, and resources that can help your team of junior developers get a solid understanding of generics: ### Online Tutorials 1. **Codecademy - Intr...
43,805
[ { "from": "human", "value": "I have a team of junior developers and they want to have better understanding and usages of generics. Anyone recommend good tutorial or articles samples that are good places to start.\n" }, { "from": "gpt", "value": "Certainly! Generics can be a bit challenging to u...
I am using a dropdown to populate a textbox. But if preferred value is not present in dropdown then user directaly enter value in that textbox. If user selects value from dropdown first and then he don't want that value and he types another text in that textbox then at this time the dropdown should be set to index 0 a...
To achieve the functionality you described, you can use JavaScript to handle the events for both the dropdown (select element) and the textbox (input element). The idea is to listen for changes in the textbox and reset the dropdown selection if the user starts typing a different value. Here's an example implementation...
46,926
[ { "from": "human", "value": "I am using a dropdown to populate a textbox. But if preferred value is not present in dropdown then user directaly enter value in that textbox. \nIf user selects value from dropdown first and then he don't want that value and he types another text in that textbox then at this ti...
I'm writing a small app for my friend's business, and thought I'd take the opportunity to brush up on some Agile Project Management training I did at the start of the year. I (and I think, my current organisation!) have always struggled with gathering requirements in the form of User Stories, which take the form: As a ...
It's a common struggle to fully embrace the User Story format while also trying to ensure that the requirements feel natural and relevant. The "so that" clause is an important part of the User Story because it helps clarify the motivation and value behind the feature. It serves as a reminder that development should be ...
45,962
[ { "from": "human", "value": "I'm writing a small app for my friend's business, and thought I'd take the opportunity to brush up on some Agile Project Management training I did at the start of the year.\nI (and I think, my current organisation!) have always struggled with gathering requirements in the form o...
IntToStr() function returns string which is Unicode now. I want to convert to AnsiString. Can I use AnsiString(IntToStr(I)) safely?
Yes, you can use `AnsiString(IntToStr(I))` to convert the result of `IntToStr(I)`, which is a Unicode string, to an `AnsiString`. However, it's essential to be aware of a few considerations: 1. **Character Encoding**: The conversion from Unicode to Ansi will involve encoding. Ensure that the characters you are convert...
46,815
[ { "from": "human", "value": "IntToStr() function returns string which is Unicode now. I want to convert to AnsiString.\nCan I use AnsiString(IntToStr(I)) safely?\n" }, { "from": "gpt", "value": "Yes, you can use `AnsiString(IntToStr(I))` to convert the result of `IntToStr(I)`, which is a Unicode...
I have just started playing with the ASP.Net MVC framework, and today I created a simple UserControl that uses some CSS. Since the CSS was declared in a separate file and included in the View that called the UserControl, and not in the UserControl itself, Visual Studio could not find any of the CSS classes used in the ...
When it comes to handling CSS in ASP.NET MVC UserControls (often referred to as partial views in MVC), there are a few best practices you can consider. Each approach has its own pros and cons, and the best solution may depend on your specific application requirements and design preferences. Here’s a breakdown of the op...
42,177
[ { "from": "human", "value": "I have just started playing with the ASP.Net MVC framework, and today I created a simple UserControl that uses some CSS. Since the CSS was declared in a separate file and included in the View that called the UserControl, and not in the UserControl itself, Visual Studio could not...
I've skinned this cat a few different ways over the last 6 years.. hardcoded strings, static classes with consts, and resource files. What approach do you use, and why? Bonus points for integrating with client-side error messages!
When it comes to managing strings in an application, especially for internationalization and localization, the approach you choose can significantly affect maintainability, readability, and scalability. Here are several strategies, along with their pros and cons, and a recommendation on how to integrate with client-sid...
35,316
[ { "from": "human", "value": "I've skinned this cat a few different ways over the last 6 years.. hardcoded strings, static classes with consts, and resource files. What approach do you use, and why? Bonus points for integrating with client-side error messages!\n" }, { "from": "gpt", "value": "Wh...
How would I go about having a CMake buildsystem, which scans for source files now using AUX_SOURCE_DIRECTORY, scan for header files too in the same directory, preferably using a similar command? I didn't find an easy way to do this in the documentation yet, so I now have a crappy bash script to post-process my (CodeBlo...
CMake does not provide a built-in command like `AUX_SOURCE_DIRECTORY` to automatically gather header files in the same way it does for source files. However, you can use the `file(GLOB ...)` command to collect both source and header files in a directory. Here’s how you can do this: 1. Use `file(GLOB ...)` to gather bo...
42,233
[ { "from": "human", "value": "How would I go about having a CMake buildsystem, which scans for source files now using AUX_SOURCE_DIRECTORY, scan for header files too in the same directory, preferably using a similar command?\nI didn't find an easy way to do this in the documentation yet, so I now have a crap...
Do you have a default type that you prefer to use in your dealings with the results of LINQ queries? By default LINQ will return an IEnumerable<> or maybe an IOrderedEnumerable<>. We have found that a List<> is generally more useful to us, so have adopted a habit of ToList()ing our queries most of the time, and certain...
Your approach of using `List<T>` for LINQ queries and function arguments is a common practice among developers, especially when there's a need for a more versatile collection type that provides various list-specific functionalities (like indexing, adding, removing items, etc.). Let's break down some considerations rega...
44,084
[ { "from": "human", "value": "Do you have a default type that you prefer to use in your dealings with the results of LINQ queries?\nBy default LINQ will return an IEnumerable<> or maybe an IOrderedEnumerable<>. We have found that a List<> is generally more useful to us, so have adopted a habit of ToList()ing...
I have a web app protected by ASP.NET Forms Authentication. The site uses jQuery's $.ajax() functionality to call a web service in the same app. Browsing to the web service .asmx does cause forms authentication to kick in and I once authenticated and make a $.ajax() call to the server I also see the ASP.NET session co...
Yes, when you have your web application protected by ASP.NET Forms Authentication and you are making AJAX calls to a web service (like an .asmx service) within the same application, the Forms Authentication mechanism will indeed protect those web services as well. Here’s a more detailed breakdown of how it works: ### ...
43,946
[ { "from": "human", "value": "I have a web app protected by ASP.NET Forms Authentication. The site uses jQuery's $.ajax() functionality to call a web service in the same app. \nBrowsing to the web service .asmx does cause forms authentication to kick in and I once authenticated and make a $.ajax() call to th...
Please enumerate the procedure in which a visual basic program can access a database using data control and Active x data object (ADO)?
Accessing a database using Visual Basic (VB) with Data Control and ActiveX Data Objects (ADO) involves a series of steps. Below, I'll enumerate the key steps required for this process: ### Step 1: Set Up Your Environment 1. **Install Visual Basic:** Ensure that you have Visual Basic installed on your system. 2. **Inst...
40,544
[ { "from": "human", "value": "Please enumerate the procedure in which a visual basic program can access a database using data control and Active x data object (ADO)?\n" }, { "from": "gpt", "value": "Accessing a database using Visual Basic (VB) with Data Control and ActiveX Data Objects (ADO) invo...
This is a fairly basic question, which for some reason, a proper solution escapes me at the moment. I am dealing with a 3rd-party SDK which declares the following structure: struct VstEvents { VstInt32 numEvents; ///< number of Events in array VstIntPtr reserved; ///< zero (Reserved for future use) VstEv...
You're correct that the `events` array in the `VstEvents` structure is defined with a fixed size of 2, which means it can only hold pointers to 2 `VstEvent` objects directly. If you need to handle more events than that, you will indeed need to allocate your own dynamic array and set up the `VstEvents` structure to use ...
43,872
[ { "from": "human", "value": "This is a fairly basic question, which for some reason, a proper solution escapes me at the moment. I am dealing with a 3rd-party SDK which declares the following structure:\nstruct VstEvents\n{\n VstInt32 numEvents; ///< number of Events in array\n VstIntPtr reserved; ...
I'm trying to add a Web Reference to a VS2008 .Net 3.5 Console Application but the option's not there. The options to "Add Reference" and "Add Service Reference" are there.
In Visual Studio 2008 and .NET Framework 3.5, the "Add Web Reference" option is slightly different from the "Add Service Reference" option, which is commonly used for WCF services. Web References are typically associated with ASMX (legacy SOAP) web services. If you're not seeing the "Add Web Reference" option, here's h...
45,722
[ { "from": "human", "value": "I'm trying to add a Web Reference to a VS2008 .Net 3.5 Console Application but the option's not there. The options to \"Add Reference\" and \"Add Service Reference\" are there.\n" }, { "from": "gpt", "value": "In Visual Studio 2008 and .NET Framework 3.5, the \"Add W...
Is it necessary to use "Nothing" keyword to initialize a DataSet in VB.NET?
In VB.NET, it is not strictly necessary to use the `Nothing` keyword to initialize a `DataSet`. When you declare a `DataSet` variable, it starts off with a default value of `Nothing` (which means it is uninitialized). However, you usually need to create an instance of a `DataSet` for it to be usable in your code. Here...
49,200
[ { "from": "human", "value": "Is it necessary to use \"Nothing\" keyword to initialize a DataSet in VB.NET?\n" }, { "from": "gpt", "value": "In VB.NET, it is not strictly necessary to use the `Nothing` keyword to initialize a `DataSet`. When you declare a `DataSet` variable, it starts off with a ...
Has anybody implemented a feature where if the user has not touched the screen for a certain time period, you take a certain action? I'm trying to figure out the best way to do that. There's this somewhat-related method in UIApplication: [UIApplication sharedApplication].idleTimerDisabled; It'd be nice if you instead ...
Implementing an idle timeout feature in an iOS application is definitely possible, but the platform doesn't provide a built-in way to directly track idle time like you described. However, you can achieve this functionality using a combination of user interaction event listeners and a timer. Here's a step-by-step guide ...
40,698
[ { "from": "human", "value": "Has anybody implemented a feature where if the user has not touched the screen for a certain time period, you take a certain action? I'm trying to figure out the best way to do that.\nThere's this somewhat-related method in UIApplication:\n[UIApplication sharedApplication].idleT...
On this page (http://www.bonniesphere.com/blog/elsewhere/) the "li" items have an image instead of a bullet. But the image is centered vertically, and in multi-line entries it doesn't look good. Can anyone tell me if there is something in the CSS that should be changed? Here's the relative code: .entry ul {list-style-t...
To address the issue of the image being vertically centered in the list items and not looking good for multi-line entries, you can adjust the CSS to ensure that the image aligns better with the text. Here are a few options to consider: ### Option 1: Adjust the `background-position` You can modify the `background-posit...
46,901
[ { "from": "human", "value": "On this page (http://www.bonniesphere.com/blog/elsewhere/) the \"li\" items have an image instead of a bullet. But the image is centered vertically, and in multi-line entries it doesn't look good. Can anyone tell me if there is something in the CSS that should be changed?\nHere'...
In .NET is there a function that tests if a string is syntactically a correct path? I specifically don't want it to test if the path actually exists. my current take on this is a regex: ([a-zA-Z]:|\\)?\\?([^/\\:*?"<>|]+[/\\])*[^/\\:*?"<>|]* matches: c:\ bbbb \\bob/john\ ..\..\ rejects: xy: c:\\bob
In .NET, there isn't a built-in function that strictly validates the syntax of a path based on the rules you provided (e.g., a regex). However, you can use a combination of regular expressions, the `Path` class from `System.IO`, and your own logic to achieve your goal. Your regex pattern is a good starting point, but ...
45,021
[ { "from": "human", "value": "In .NET is there a function that tests if a string is syntactically a correct path? I specifically don't want it to test if the path actually exists.\nmy current take on this is a regex:\n([a-zA-Z]:|\\\\)?\\\\?([^/\\\\:*?\"<>|]+[/\\\\])*[^/\\\\:*?\"<>|]*\n\nmatches:\nc:\\\nbbbb\...
The "core" .NET languages are integrated into VS2008 - C#, VB.NET, and C++. I'm not sure about current support for J# and JScript. But there are a number of other .NET languages out there - A#, Boo, Oxygene, F#, IronLisp/IronScheme, IronPython, IronRuby, Nemerle, Phalanger, P#, PowerShell, and more. Of these, I have on...
Visual Studio (VS) has traditionally been focused on the "core" .NET languages such as C#, VB.NET, and C++. However, there is a rich ecosystem of other .NET languages that can target the .NET runtime. Here are some points to consider regarding the support and integration of these languages within Visual Studio: 1. **L...
45,115
[ { "from": "human", "value": "The \"core\" .NET languages are integrated into VS2008 - C#, VB.NET, and C++. I'm not sure about current support for J# and JScript.\nBut there are a number of other .NET languages out there - A#, Boo, Oxygene, F#, IronLisp/IronScheme, IronPython, IronRuby, Nemerle, Phalanger, P...
I've notice an issue - it feels like a bug but I suspect a 'feature' - in SSMS in SQL Server 2008. I have various tabs open, for example an alter table script in one table and a SProc that queries that table in another tab, and when I execute my Alter Table script the changes are not reflected in Intellisense in the ot...
What you're experiencing is a known limitation of SQL Server Management Studio (SSMS), particularly in the version you mentioned (SQL Server 2008). Here's an explanation of what's happening: ### Explanation: 1. **IntelliSense Cache**: SSMS uses a caching mechanism to store the schema information for IntelliSense. When...
46,414
[ { "from": "human", "value": "I've notice an issue - it feels like a bug but I suspect a 'feature' - in SSMS in SQL Server 2008.\nI have various tabs open, for example an alter table script in one table and a SProc that queries that table in another tab, and when I execute my Alter Table script the changes a...
I have Visual Studio 2008 Professional and I am having issues with expanding and collapsing method code blocks in ASP.Net Generic Handler pages (.ashx) I would have thought you could do the same thing like in the code behind of .aspx web pages. I have this same issue on other boxes even with VS 2008 Standard and VS 200...
Visual Studio 2008 and earlier versions sometimes have limitations when it comes to code folding (expanding and collapsing code blocks) in certain file types. Here are a few suggestions to help you with the issue of expanding and collapsing code blocks in ASP.NET Generic Handler pages (`.ashx`): 1. **Check File Type A...
44,193
[ { "from": "human", "value": "I have Visual Studio 2008 Professional and I am having issues with expanding and collapsing method code blocks in ASP.Net Generic Handler pages (.ashx)\nI would have thought you could do the same thing like in the code behind of .aspx web pages.\nI have this same issue on other ...
Is there a C# port of the optparse (command line option parser) module from Python available under some OSI-approved license?
Yes, there are several C# libraries that provide similar functionality to Python's `optparse` module for command line option parsing. One popular option is the **CommandLineParser** library. It is well-maintained and widely used in the C# community for parsing command line arguments. ### CommandLineParser - **GitHub ...
47,068
[ { "from": "human", "value": "Is there a C# port of the optparse (command line option parser) module from Python available under some OSI-approved license?\n" }, { "from": "gpt", "value": "Yes, there are several C# libraries that provide similar functionality to Python's `optparse` module for com...
How can I center an image horizontally and aligned to the bottom of the container at the same time? I have been able to center the image horizontally by its self. I have also been able to align the bottom of the container by its self. But I have not been able to do both at the same time. Here is what I have: .image_b...
To center the image horizontally while also aligning it to the bottom of the container, you can use a combination of CSS properties. Since the image size is not known beforehand, you can set the left property to 50% and then use the transform property to move it back by half of its own width. Here is how you can modif...
45,781
[ { "from": "human", "value": "How can I center an image horizontally and aligned to the bottom of the container at the same time? \nI have been able to center the image horizontally by its self. I have also been able to align the bottom of the container by its self. But I have not been able to do both at the...
I've coded some smaller projects using Silverlight 2.0, which is fairly impressive. Does Silverlight 2.0 have what it takes to be a game development platform for the web? (Are the framerates high enough, will there be 3D engines developed, and many more questions) Yes or no, with detail if desired, and why.
Silverlight 2.0, while innovative for its time, is generally not considered a viable game development platform for the web, especially in comparison to modern technologies available today. Here are some detailed reasons why: ### Limitations of Silverlight 2.0 for Game Development 1. **Performance**: Silverlight 2.0 w...
45,399
[ { "from": "human", "value": "I've coded some smaller projects using Silverlight 2.0, which is fairly impressive.\nDoes Silverlight 2.0 have what it takes to be a game development platform for the web?\n\n(Are the framerates high enough, will there be 3D engines developed, and many more questions)\nYes or no...
On the PHP website, the only real checking they suggest is using is_uploaded_file() or move_uploaded_file(), here. Of course you usually don't want user's uploading any type of file, for a variety of reasons. Because of this, I have often used some "strict" mime type checking. Of course this is very flawed because ofte...
When it comes to securely handling file uploads in PHP, especially when you want to restrict the types of files users can upload, you can implement a combination of strategies. Below are several methods you can consider to validate various file types such as PDFs, Word documents, Excel files, and plain text files, alon...
37,216
[ { "from": "human", "value": "On the PHP website, the only real checking they suggest is using is_uploaded_file() or move_uploaded_file(), here. Of course you usually don't want user's uploading any type of file, for a variety of reasons.\nBecause of this, I have often used some \"strict\" mime type checking...
I'm working on a small project in VB.Net where I get a input from a textbox, and need to verify that this is an e-email address. I found this expression "^[_a-z0-9-]+(.[_a-z0-9-]+)@[a-z0-9-]+(.[a-z0-9-]+)(.[a-z]{2,4})$", but i cant find any way to test if it passes. I want some code like: if not txtEmail.text = regex...
To validate an email address in VB.Net using a regular expression (regex), you can use the `System.Text.RegularExpressions` namespace. Below is an example of how you can implement this in your project. First, ensure you import the namespace at the top of your code file: ```vb.net Imports System.Text.RegularExpression...
47,153
[ { "from": "human", "value": "I'm working on a small project in VB.Net where I get a input from a textbox, and need to verify that this is an e-email address.\nI found this expression \"^[_a-z0-9-]+(.[_a-z0-9-]+)@[a-z0-9-]+(.[a-z0-9-]+)(.[a-z]{2,4})$\", but i cant find any way to test if it passes.\nI want s...
What is better as far as performance goes?
To provide a meaningful answer, I need more context about what you're comparing. Are you asking about performance in terms of: 1. **Hardware:** Such as CPUs, GPUs, or other components? 2. **Software:** Such as different applications or operating systems? 3. **Vehicles:** Such as cars or motorcycles? 4. **Sports:** Suc...
49,058
[ { "from": "human", "value": "What is better as far as performance goes?\n" }, { "from": "gpt", "value": "To provide a meaningful answer, I need more context about what you're comparing. Are you asking about performance in terms of:\n\n1. **Hardware:** Such as CPUs, GPUs, or other components?\n2....
I want to add a calendar control to a page that already includes Prototype and Scriptaculous. Not happy with any of the Prototype ones I could find, I'm considring using the YUI Calendar widget. I this likely to cause any problems?
Using the YUI Calendar widget alongside Prototype and Scriptaculous should generally work without significant issues, but there are a few considerations to keep in mind: 1. **Namespace Conflicts**: Both Prototype and YUI might have overlapping functionalities or variable names, which could lead to conflicts. To minimi...
48,708
[ { "from": "human", "value": "I want to add a calendar control to a page that already includes Prototype and Scriptaculous. Not happy with any of the Prototype ones I could find, I'm considring using the YUI Calendar widget. \nI this likely to cause any problems?\n" }, { "from": "gpt", "value": "...
Recently saw someone commending another user on their use of sizeof var instead of sizeof(type). I always thought that was just a style choice. Is there any significant difference? As an example, the lines with f and ff were considered better than the lines with g and gg: typedef struct _foo {} foo; foo *f = malloc(...
The discussion around using `sizeof var` vs. `sizeof(type)` is indeed more than just a matter of style—it often relates to type safety, maintainability, and readability of the code. ### Differences Explained 1. **Type Safety and Flexibility**: - Using `sizeof var` makes the code less error-prone and more maintaina...
46,567
[ { "from": "human", "value": "Recently saw someone commending another user on their use of sizeof var instead of sizeof(type). I always thought that was just a style choice. Is there any significant difference? As an example, the lines with f and ff were considered better than the lines with g and gg:\n type...
thnx for all your replays .. i tried your options and i want to ask if that was right and is are the 2 threads working in paralel or not.. and here is my code : // in the Form.Load() Timer1.Enabled = true; Timer1.Start(); if (InvokeRequired) { Invoke(new GetFromServ...
From your code, it appears that you are trying to call two methods (`GetFromServer` and `GetFromPC`) within the `Form.Load()` event handler, but the way you are doing it may not achieve parallel execution as you intend. ### Explanation of Your Code 1. **InvokeRequired Check**: - You are checking if `InvokeRequir...
43,112
[ { "from": "human", "value": "thnx for all your replays ..\ni tried your options and i want to ask if that was right and is are the 2 threads working in paralel or not..\nand here is my code :\n// in the Form.Load()\n Timer1.Enabled = true;\n Timer1.Start();\n\n if (InvokeRequir...
I have a database (NexusDB (supposedly SQL-92 compliant)) which contains and Item table, a Category table, and a many-to-many ItemCategory table, which is just a pair of keys. As you might expect, Items are assigned to multiple categories. I am wanting to all the end user to select all items which are ItemID | Categ...
To accomplish your requirement of selecting `ItemID`s that are assigned to certain categories while excluding those that belong to others, you can utilize the `GROUP BY` and `HAVING` clauses in your SQL query. Here's a SQL query that matches your description: ```sql SELECT ItemID FROM ItemCategory WHERE CategoryID I...
45,243
[ { "from": "human", "value": "I have a database (NexusDB (supposedly SQL-92 compliant)) which contains and Item table, a Category table, and a many-to-many ItemCategory table, which is just a pair of keys. As you might expect, Items are assigned to multiple categories. \nI am wanting to all the end user to ...
I need a hasEvents() method like var someBool = hasEvents($("#myelement")); that returns true if there are some bound events to any of the element's event handlers.
To create a `hasEvents()` function that checks if there are any bound event handlers for a given jQuery element, you can utilize jQuery's internal event data. The jQuery `data` method allows you to access event information, but it isn't straightforward since jQuery's internal data structure isn't meant for public use. ...
46,820
[ { "from": "human", "value": "I need a hasEvents() method like\nvar someBool = hasEvents($(\"#myelement\"));\n\nthat returns true if there are some bound events to any of the element's event handlers.\n" }, { "from": "gpt", "value": "To create a `hasEvents()` function that checks if there are any...
How do you use a DetailsView control in Asp.NET? How do you change the labels to something other than the database field name? How do you hide some of the fields from the user? (which you need to query for because they are the identity fields - row-id, which you dont want the user to see)?
In ASP.NET, the `DetailsView` control is a data-bound control that displays the values of a single record in a table. Here’s how to use the `DetailsView` control, change field labels, and hide specific fields: ### 1. Using a DetailsView Control To use a `DetailsView` control, follow these steps: **a. Add the Details...
43,530
[ { "from": "human", "value": "How do you use a DetailsView control in Asp.NET?\n\nHow do you change the labels to something other than the database field name?\nHow do you hide some of the fields from the user? (which you need to query for because they are the identity fields - row-id, which you dont want th...
I am training in web developement and am learning about JSP & Servlets. I have some knowledge of HttpSession - I have used it in some of my sample projects. In browsers I have seen the option to "delete cookies". If I delete the cookies it deletes the HttpSession also. Are cookies and session the same? What are the dif...
Cookies and sessions are both mechanisms for storing data that can be used to manage user state and data across multiple requests in web applications. However, they are not the same and have distinct characteristics and use cases. Here’s a breakdown of the differences between cookies and sessions: ### 1. Definition - ...
44,128
[ { "from": "human", "value": "I am training in web developement and am learning about JSP & Servlets. I have some knowledge of HttpSession - I have used it in some of my sample projects.\nIn browsers I have seen the option to \"delete cookies\". If I delete the cookies it deletes the HttpSession also.\nAre c...
Everyone is familiar with this functionality. If you open up the the outlook address book and start typing a name, the list below the searchbox instantly filters to only contain items that match your query. .NET Reflector has a similar feature when you're browsing types ... you start typing, and regardless of how lar...
The instant filtering feature you described in applications like Outlook and .NET Reflector typically relies on efficient data structures, algorithms, and event-driven programming to ensure a smooth user experience. Below are some of the key concepts and methods that contribute to this functionality, along with a focus...
42,562
[ { "from": "human", "value": "Everyone is familiar with this functionality. If you open up the the outlook address book and start typing a name, the list below the searchbox instantly filters to only contain items that match your query. .NET Reflector has a similar feature when you're browsing types ... yo...
Is it possible to overload the null-coalescing operator for a class in C#? Say for example I want to return a default value if an instance is null and return the instance if it's not. The code would look like something like this: return instance ?? new MyClass("Default"); But what if I would like to use the nul...
In C#, the null-coalescing operator (`??`) cannot be overloaded, as it is a predefined operator in the language. However, you can achieve similar functionality by defining your own mechanism to handle instances of your class and their properties. To implement behavior similar to what you're asking for, you can create ...
45,017
[ { "from": "human", "value": "Is it possible to overload the null-coalescing operator for a class in C#? \nSay for example I want to return a default value if an instance is null and return the instance if it's not. The code would look like something like this:\n return instance ?? new MyClass(\"Default\"...
There must be an easy way to do this, but somehow I can wrap my head around it. The best way I can describe what I want is a lambda function for a class. I have a library that expects as an argument an uninstantiated version of a class to work with. It then instantiates the class itself to work on. The problem is that ...
You can achieve your goal by using a factory function or a lambda function to create instances of your `Multiply` class dynamically. This will allow you to pass an uninstantiated version of the `Multiply` class to the `Library` without changing the `Library` class itself. Here's how you can do it: ```python class Doub...
44,751
[ { "from": "human", "value": "There must be an easy way to do this, but somehow I can wrap my head around it. The best way I can describe what I want is a lambda function for a class. I have a library that expects as an argument an uninstantiated version of a class to work with. It then instantiates the clas...
Say I have a table called "xml" that stores XML files in a single column "data". How would I write a MySQL query that run an XPath and return only rows matching that XPath?
To query XML data stored in a MySQL database and filter rows based on an XPath expression, you can use the `ExtractValue()` function, which allows you to extract a specific value from an XML document stored in a column. However, please note that this method is generally only applicable to MySQL versions that support XM...
46,783
[ { "from": "human", "value": "Say I have a table called \"xml\" that stores XML files in a single column \"data\". How would I write a MySQL query that run an XPath and return only rows matching that XPath?\n" }, { "from": "gpt", "value": "To query XML data stored in a MySQL database and filter r...
I'm having the hardest time trying to get this to work, hoping one of you has done this before. I have a C# console app that is running a child process which inherits its console. I want a ctrl-c caught by the outer app to be passed along to the inner app so that it can have a chance to shut down nicely. I have some ve...
Handling Ctrl+C signals and forwarding them to a child process in C# can be tricky, especially when dealing with console applications. Here are some steps and considerations to help you achieve this: ### 1. **Using GenerateConsoleCtrlEvent Properly** The `GenerateConsoleCtrlEvent` function can be used to send a contr...
42,934
[ { "from": "human", "value": "I'm having the hardest time trying to get this to work, hoping one of you has done this before.\nI have a C# console app that is running a child process which inherits its console. I want a ctrl-c caught by the outer app to be passed along to the inner app so that it can have a ...
I've written an experimental function evaluator that allows me to bind simple functions together such that when the variables change, all functions that rely on those variables (and the functions that rely on those functions, etc.) are updated simultaneously. The way I do this is instead of evaluating the function imme...
To detect circular references in your function evaluator, you can implement a mechanism that checks for cycles in the dependencies of the variables and functions being defined. This can be achieved by utilizing a graph representation of the dependencies, where each variable or function represents a node, and a directed...
44,660
[ { "from": "human", "value": "I've written an experimental function evaluator that allows me to bind simple functions together such that when the variables change, all functions that rely on those variables (and the functions that rely on those functions, etc.) are updated simultaneously. The way I do this i...
I've been attempting to hook a Rails application up to ActiveDirectory. I'll be synchronizing data about users between AD and a database, currently MySQL (but may turn into SQL Server or PostgreSQL). I've checked out activedirectory-ruby, and it looks really buggy (for a 1.0 release!?). It wraps Net::LDAP, so I tried u...
Integrating a Rails application with Active Directory can be a bit challenging, especially when you're looking for an ORM-like abstraction over LDAP. Here are a few tools and approaches you can consider to achieve this: ### 1. **LDAP Gems** While `activedirectory-ruby` has its drawbacks, you might still want to explo...
43,592
[ { "from": "human", "value": "I've been attempting to hook a Rails application up to ActiveDirectory. I'll be synchronizing data about users between AD and a database, currently MySQL (but may turn into SQL Server or PostgreSQL).\nI've checked out activedirectory-ruby, and it looks really buggy (for a 1.0 re...
I'm looking for a regular expression that will match all strings EXCEPT those that contain a certain string within. Can someone help me construct it? For example, looking for all strings that do not have a, b, and c in them in that order. So abasfaf3 would match, whereas asasdfbasc would not
You can use a negative lookahead assertion in your regular expression to match strings that do not contain a specific sequence. In your case, you want to match strings that do not contain the sequence "abc" in that specific order. Here's a regular expression that accomplishes that: ```regex ^(?!.*abc).* ``` ### Expl...
46,941
[ { "from": "human", "value": "I'm looking for a regular expression that will match all strings EXCEPT those that contain a certain string within. Can someone help me construct it?\nFor example, looking for all strings that do not have a, b, and c in them in that order.\nSo \nabasfaf3 would match, whereas \n...
Here are the specs that I'm trying to implement in a nutshell: 1) Some Alerts have to be sent on certain events in the application. 2) These Alerts have Users subscribe to them. 3) And the Users have set their own Notification preferences (e.g. Email and/or SMS). I have not been able to find an open source solution in ...
JMX (Java Management Extensions) is primarily focused on managing and monitoring resources in the Java environment, such as applications, system resources, and services. It provides a way to collect metrics and manage resources rather than implementing a notification and alert system for user preferences and subscripti...
46,643
[ { "from": "human", "value": "Here are the specs that I'm trying to implement in a nutshell:\n1) Some Alerts have to be sent on certain events in the application.\n2) These Alerts have Users subscribe to them.\n3) And the Users have set their own Notification preferences (e.g. Email and/or SMS).\nI have not ...
How do I check if the mouse pointer is in/on another div/id/a? ^a href="#" onmouseover="showmenu('top_3_menu_1_1')">Option One</a> function showmenu(elmnt) { document.getElementById(elmnt).style.visibility="visible"; } function hidemenu(elmnt) { if mouse pointer is not in location A or B do something }
To check if the mouse pointer is not in the specified locations (for example, a specific `div` or `a` element) when using JavaScript, you can utilize event listeners for mouse events. Specifically, you can listen for the `mouseover` and `mouseout` events to determine whether the mouse is over the elements you care abou...
41,935
[ { "from": "human", "value": "How do I check if the mouse pointer is in/on another div/id/a?\n^a href=\"#\" onmouseover=\"showmenu('top_3_menu_1_1')\">Option One</a> \n\nfunction showmenu(elmnt)\n{\ndocument.getElementById(elmnt).style.visibility=\"visible\";\n}\n\nfunction hidemenu(elmnt)\n{\nif mouse poin...
Lets say you need to attach some JavaScript functionality to an ASP.NET User Control of which there might be multiple instances on any given page. Because JavaScript has shared global state, what techniques can you use to keep the client state and behavior for each instance of a control separate?
When dealing with multiple instances of an ASP.NET User Control on a single page, it's crucial to ensure that the JavaScript functionality associated with each instance remains isolated to prevent any conflicts and preserve state. Here are several techniques to achieve this: 1. **Use Closures**: Encapsulate your Ja...
39,467
[ { "from": "human", "value": "Lets say you need to attach some JavaScript functionality to an ASP.NET User Control of which there might be multiple instances on any given page. Because JavaScript has shared global state, what techniques can you use to keep the client state and behavior for each instance of ...
I need to watch when certain processes are started or stopped on a Windows machine. I'm currently tapped into the WMI system and querying it every 5 seconds, but this causes a CPU spike every 5 seconds because WMI is WMI. Is there a better way of doing this? I could just make a list of running processes and attach an E...
Yes, there is a more efficient way to monitor the start and stop of processes on a Windows machine without causing CPU spikes like you might experience with repeated WMI queries. Instead of polling WMI every few seconds, you can utilize the `ManagementEventWatcher` class from the `System.Management` namespace, which al...
42,017
[ { "from": "human", "value": "I need to watch when certain processes are started or stopped on a Windows machine. I'm currently tapped into the WMI system and querying it every 5 seconds, but this causes a CPU spike every 5 seconds because WMI is WMI. Is there a better way of doing this? I could just make a ...
I have a stored procedure on SQL Server 2005 doing a Serializable Transaction. Inside this transaction, it selects a table with rowlock. At the end of the procedure, after rollback/commit, it sets the transaction isolation level to Read Commited. This procedure is running, different processes have concurrent access con...
The error message you are encountering indicates that the SQL Server database engine is running into a lock resource issue, likely due to contention or resource exhaustion. This can occur in environments with high levels of concurrency or heavy transactional workloads. Here are several strategies you can consider to al...
40,489
[ { "from": "human", "value": "I have a stored procedure on SQL Server 2005 doing a Serializable Transaction. Inside this transaction, it selects a table with rowlock. At the end of the procedure, after rollback/commit, it sets the transaction isolation level to Read Commited.\nThis procedure is running, diff...
I was mapping a relation using something like the following <map name="Foo" cascade="all-delete-orphan" lazy="false"> <key column="FooId"/> <index column="FooType" type="Domain.Enum.FooType, Domain"/> <element column ="FooStatus" type="Domain.Enum.FooStatus, Domain"/> </map> The class is like this namespace Dom...
Yes, you can achieve this using Fluent NHibernate, and you can also mix Fluent NHibernate with XML if needed. Here’s how to map your relation using Fluent NHibernate: ### Mapping Using Fluent NHibernate To replicate the XML mapping provided, you can use the following Fluent NHibernate mapping for your class. Assume y...
42,254
[ { "from": "human", "value": "I was mapping a relation using something like the following \n<map name=\"Foo\" cascade=\"all-delete-orphan\" lazy=\"false\">\n <key column=\"FooId\"/>\n <index column=\"FooType\" type=\"Domain.Enum.FooType, Domain\"/>\n <element column =\"FooStatus\" type=\"Domain.Enum.FooSt...
I want to add all the files in the current directory to git: git add . error: open(".mysql_history"): Permission denied fatal: unable to index file .mysql_history That's fine. That file happens to be in this directory and owned by root. I want to add all other files. Is there a way to do that without having to manual...
To add all files in the current directory to Git while skipping files that you do not have permission to access (like `.mysql_history` in your case), you can use the following command: ```bash git add --all -- :!*.mysql_history ``` However, the above command will specifically exclude the `.mysql_history` file. If you...
45,538
[ { "from": "human", "value": "I want to add all the files in the current directory to git:\ngit add .\nerror: open(\".mysql_history\"): Permission denied\nfatal: unable to index file .mysql_history\n\nThat's fine. That file happens to be in this directory and owned by root. I want to add all other files. Is...
I currently have a source control folder in TFS with all of my source code. Is it possible to create a new team project and use the existing source control folder? I have the option to create a new source control folder, create a new branch or not to create one at all. But is there a way of using an existing folder? [E...
In TFS (Team Foundation Server), when you delete a team project, the associated source control folder can remain in the TFS repository. However, TFS does not allow you to directly reattach an existing source control folder to a new team project once the original project has been deleted. Each team project is designed t...
45,369
[ { "from": "human", "value": "I currently have a source control folder in TFS with all of my source code.\nIs it possible to create a new team project and use the existing source control folder?\nI have the option to create a new source control folder, create a new branch or not to create one at all. But is ...
Suppose I have a variable of type Int = 08, how can I convert this to String keeping the leading zero? For instance: v :: Int v = 08 show v Output: 8 I want the output to be "08". Is this possible?
In Haskell, when you define an `Int` with a value of `08`, it will actually give you a compilation error because `08` is not a valid integer literal (the number can't start with a zero unless it's `0`). Instead, you should define it as `8`. However, if you want to keep the leading zero in the string representation, you...
48,252
[ { "from": "human", "value": "Suppose I have a variable of type Int = 08, how can I convert this to String keeping the leading zero?\nFor instance:\nv :: Int\nv = 08\n\nshow v\n\nOutput: 8\nI want the output to be \"08\".\nIs this possible?\n" }, { "from": "gpt", "value": "In Haskell, when you de...
I am curious to know where the "Don't Fragment" [DF] Bit of the IP Flags is used. As fragmentation is invisible to higher layers and they don't care too. I am also looking for an example. Thanks a lot in advance.
The "Don't Fragment" (DF) bit is part of the IP header flags in the Internet Protocol. It is particularly important in controlling how packets are transmitted across networks, especially when dealing with Path MTU (Maximum Transmission Unit) Discovery. ### Purpose of the DF Bit When the DF bit is set to 1 (meaning "D...
46,058
[ { "from": "human", "value": "I am curious to know where the \"Don't Fragment\" [DF] Bit of the IP Flags is used. As fragmentation is invisible to higher layers and they don't care too.\nI am also looking for an example. \nThanks a lot in advance.\n" }, { "from": "gpt", "value": "The \"Don't Frag...
How can I add a scrollbar to the wrappanel control in WPF. Some of my controls are cutting off width wise due to the no scrollbar.
In WPF, if you want to add a scrollbar to a `WrapPanel` control, you typically need to place the `WrapPanel` inside a `ScrollViewer`. The `ScrollViewer` allows for scrolling if the content exceeds its dimensions. Here's a simple example of how to do this: ```xml <Window x:Class="YourNamespace.MainWindow" xmlns...
44,434
[ { "from": "human", "value": "How can I add a scrollbar to the wrappanel control in WPF. Some of my controls are cutting off width wise due to the no scrollbar. \n" }, { "from": "gpt", "value": "In WPF, if you want to add a scrollbar to a `WrapPanel` control, you typically need to place the `Wrap...
This question deals with concurrency issues, for suggestions on how to display a busy icon see this question: Javascript - loading/busy indicator or transparent div over page on event click When a user initiates an AJAX request on a page it's useful to show some kind of "working" or busy icon or progress indicator. If ...
To manage a busy indicator that reflects the state of multiple asynchronous processes, you can indeed maintain a counter or a stack to track ongoing processes. Here's a more structured approach that enhances your original idea, allowing for better control over the busy indicator. ### Step-by-Step Solution 1. **Mainta...
42,526
[ { "from": "human", "value": "This question deals with concurrency issues, for suggestions on how to display a busy icon see this question: Javascript - loading/busy indicator or transparent div over page on event click\nWhen a user initiates an AJAX request on a page it's useful to show some kind of \"worki...
What would be the best choice of build system for a more than one million line multi platform project, which produces drivers, libraries, command line tools, GUIs, and OS install packages for all the mainstream OSes, using both the GNU and Microsoft toolchains? Our source code is mainly C, with Python, C# and GNU makef...
Given the complexities and requirements of your multi-platform project, here are several build systems and tools that could potentially meet your needs: ### 1. **CMake** CMake is a popular choice for multi-platform builds, especially for C and C++ projects. Here are some of its advantages: - **Cross-Platform Support**...
43,709
[ { "from": "human", "value": "What would be the best choice of build system for a more than one million line multi platform project, which produces drivers, libraries, command line tools, GUIs, and OS install packages for all the mainstream OSes, using both the GNU and Microsoft toolchains?\nOur source code ...