instruction
stringlengths
14
27.6k
completion
stringlengths
3
38.3k
__original_row_idx
int64
0
50k
conversations
listlengths
2
2
I'm looking for ideas and opinions here, not a "real answer", I guess... Back in the old VB6 days, there was this property called "Tag" in all controls, that was a useful way to store custom information related to a control. Every single control had it, and all was bliss... Now, in .Net (at least for WebForms), it's no...
The absence of the "Tag" property in ASP.NET Web Forms can indeed be a limitation when compared to VB6, where it provided a quick and dirty way to store custom information directly within controls. However, there are several workarounds and approaches you can take to achieve similar functionality without subclassing al...
16,283
[ { "from": "human", "value": "I'm looking for ideas and opinions here, not a \"real answer\", I guess...\nBack in the old VB6 days, there was this property called \"Tag\" in all controls, that was a useful way to store custom information related to a control. Every single control had it, and all was bliss......
I want to draw DirectX content so that it appears to be floating over top of the desktop and any other applications that are running. I also need to be able to make the directx content semi-transparent, so other things show through. Is there a way of doing this? I am using Managed DX with C#.
Drawing DirectX content that appears to float over the desktop and other applications typically involves creating a borderless, layered window that supports transparency. In the context of Managed DirectX with C#, you can achieve this by using Windows Forms or WPF for the windowing system and rendering your DirectX gra...
16,095
[ { "from": "human", "value": "I want to draw DirectX content so that it appears to be floating over top of the desktop and any other applications that are running. I also need to be able to make the directx content semi-transparent, so other things show through. Is there a way of doing this?\nI am using Mana...
So, I was looking over my standard cache utility when preparing to unit test a controller and thought, hey, is accessing the HttpRuntime.Cache directly considered harmful in MVC? I wrap the cache in a proxy class that implements a cache-like interface (tho much simpler) so that I can mock it during tests. But I'm wond...
Accessing `HttpRuntime.Cache` directly in an ASP.NET MVC application is often considered a less than ideal practice for several reasons: 1. **Tight Coupling**: Direct access to `HttpRuntime.Cache` tightly couples your code to a specific caching implementation. This makes it hard to change caching strategies later on o...
18,477
[ { "from": "human", "value": "So, I was looking over my standard cache utility when preparing to unit test a controller and thought, hey, is accessing the HttpRuntime.Cache directly considered harmful in MVC?\nI wrap the cache in a proxy class that implements a cache-like interface (tho much simpler) so that...
I want to build a bot that asks someone a few simple questions and branches based on the answer. I realize parsing meaning from the human responses will be challenging, but how do you setup the program to deal with the "state" of the conversation? It will be a one-to-one conversation between a human and the bot.
Building a bot that can manage a conversation and branch based on user responses involves maintaining the "state" of the conversation. The state includes information about what questions have been asked, what answers have been given, and what the next steps should be based on those answers. Here’s a basic framework for...
14,359
[ { "from": "human", "value": "I want to build a bot that asks someone a few simple questions and branches based on the answer. I realize parsing meaning from the human responses will be challenging, but how do you setup the program to deal with the \"state\" of the conversation?\nIt will be a one-to-one con...
What is the best approach to define additional data for typedef enums in C? Example: typedef enum { kVizsla = 0, kTerrier = 3, kYellowLab = 10 } DogType; Now I would like to define names for each, for example kVizsla should be "vizsla". I currently use a function that returns a string using a large switch block....
To associate additional data with `typedef` enums in C, such as string names for each enumerator, you have several approaches. Using a switch statement is one option, but there are more efficient and maintainable ways to achieve this. Here are a few methods: ### 1. Using an Array of Strings One effective way is to cr...
9,309
[ { "from": "human", "value": "What is the best approach to define additional data for typedef enums in C?\nExample:\ntypedef enum {\n kVizsla = 0,\n kTerrier = 3,\n kYellowLab = 10\n} DogType;\n\nNow I would like to define names for each, for example kVizsla should be \"vizsla\".\nI currently use a functi...
I am relatively new to web services and am wondering what the standard "best approach" is. Basically, the way things work is I need to have a task running the background constantly. The the web service will connect to the daemon and return with an appropriate response. Currently, the communication is over unix domain ...
Using Unix domain sockets for communication between a web service and a background task (or daemon) can be a valid approach, especially in a Linux environment. However, whether it's the "right" way depends on your specific requirements, scalability needs, and the architecture of your application. Here are some consider...
16,727
[ { "from": "human", "value": "I am relatively new to web services and am wondering what the standard \"best approach\" is. Basically, the way things work is I need to have a task running the background constantly. \nThe the web service will connect to the daemon and return with an appropriate response. Curre...
I would like to compress a folder and all its sub-folders/files, and email the zip file as an attachment. What would be the best way to achieve this with Python?
You can use Python's built-in `zipfile` module to compress a folder and its contents, and then you can use the `smtplib` and `email` libraries to send the compressed file as an email attachment. Below is a step-by-step guide and sample code to achieve this. ### Step 1: Compress the Folder You can create a ZIP file fr...
16,678
[ { "from": "human", "value": "I would like to compress a folder and all its sub-folders/files, and email the zip file as an attachment. What would be the best way to achieve this with Python? \n" }, { "from": "gpt", "value": "You can use Python's built-in `zipfile` module to compress a folder and...
Suppose that a group wants to encrypt some information, then share the encryption key among the group members in a way that requires the consensus of the group to decrypt the information. I'm interested in a variety of scenarios where the breadth of consensus ranges from unanimity to an absolute majority. A useful tech...
The requirement for group consensus in key sharing and decryption can be effectively managed using cryptographic techniques known as *secret sharing schemes*. These schemes allow a group to share a secret (like a symmetric key) among members in such a way that a certain number of members must come together to reconstru...
14,575
[ { "from": "human", "value": "Suppose that a group wants to encrypt some information, then share the encryption key among the group members in a way that requires the consensus of the group to decrypt the information. I'm interested in a variety of scenarios where the breadth of consensus ranges from unanimi...
I've been using Lisp on and off for a while but I'm starting to get more serious about doing some "real" work in Lisp. I'm a huge Vim fan and was wondering how I can be most productive using Vim as my editor for Lisp development. Plugins, work flow suggestions, etc. are all welcome. Please don't say "use emacs" as I've...
Great to hear that you're diving deeper into Lisp! Vim can definitely be set up for effective Lisp development. Below are some tips on plugins, configurations, and workflows that can enhance your experience with Lisp in Vim. ### Essential Plugins 1. **vim-slime**: This plugin allows you to send code snippets from Vim...
14,107
[ { "from": "human", "value": "I've been using Lisp on and off for a while but I'm starting to get more serious about doing some \"real\" work in Lisp. I'm a huge Vim fan and was wondering how I can be most productive using Vim as my editor for Lisp development. Plugins, work flow suggestions, etc. are all we...
The following code has a simple binding which binds the Text of the TextBlock named MyTextBlock to TextBox's Text and ToolTip property using the exact same Binding notation: <StackPanel> <TextBlock x:Name="MyTextBlock">Foo Bar</TextBlock> <TextBox Text="{Binding ElementName=MyTextBlock, Path=Text, StringForm...
The issue you're encountering with the `ToolTip` not displaying the formatted string is due to the way the `ToolTip` property handles data binding. The `ToolTip` property expects a `ToolTip` object, and when you bind to it, it doesn't automatically process the `StringFormat` in the same way as it does for other propert...
19,307
[ { "from": "human", "value": "The following code has a simple binding which binds the Text of the TextBlock named MyTextBlock to TextBox's Text and ToolTip property using the exact same Binding notation:\n<StackPanel>\n <TextBlock x:Name=\"MyTextBlock\">Foo Bar</TextBlock>\n <TextBox Text=\"{Binding...
I keep getting this error when trying to re-order items in my ReorderList control. "Reorder failed, see details below. Can't access data source. It does not a DataSource and does not implement IList." I'm setting the datasource to a DataTable right now, and am currently trying to use an ArrayList datasource instead, b...
The error you are encountering with the ReorderList control generally occurs when the control is not able to access its underlying data source properly, which could be due to a few different reasons. Below are some steps and considerations to help troubleshoot and resolve this issue: ### Common Causes and Solutions 1...
18,865
[ { "from": "human", "value": "I keep getting this error when trying to re-order items in my ReorderList control.\n\"Reorder failed, see details below.\nCan't access data source. It does not a DataSource and does not implement IList.\"\nI'm setting the datasource to a DataTable right now, and am currently tr...
I'm trying to write a parser to get the data out of a typical html table day/time schedule (like this). I'd like to give this parser a page and a table class/id, and have it return a list of events, along with days & times they occur. It should take into account rowspans and colspans, so for the linked example, it wo...
Creating an HTML table parser to extract event schedules while handling rowspan and colspan can be a bit complex. However, it's definitely doable! Below is a structured approach you can take using Ruby and the Nokogiri gem, which is excellent for parsing HTML. I'll walk you through the key steps to achieve this. ### S...
12,968
[ { "from": "human", "value": "I'm trying to write a parser to get the data out of a typical html table day/time schedule (like this). \nI'd like to give this parser a page and a table class/id, and have it return a list of events, along with days & times they occur. It should take into account rowspans and ...
I'm trying to combine a list of functions like so. I have this: Func<int, bool>[] criteria = new Func<int, bool>[3]; criteria[0] = i => i % 2 == 0; criteria[1] = i => i % 3 == 0; criteria[2] = i => i % 5 == 0; And I want this: Func<int, bool>[] predicates = new Func<int, bool>[3]; predicates[0] = i => i % 2 == 0; pred...
Your code is almost there, but there are some issues in the way you're constructing the expressions, particularly with the `Expression.Invoke` and how you're referencing the criteria functions. The primary issue is that you're using `results[i].Parameters.Cast<Expression>()`, which will not work as intended. Here's a ...
19,755
[ { "from": "human", "value": "I'm trying to combine a list of functions like so.\nI have this:\nFunc<int, bool>[] criteria = new Func<int, bool>[3];\ncriteria[0] = i => i % 2 == 0;\ncriteria[1] = i => i % 3 == 0;\ncriteria[2] = i => i % 5 == 0;\n\nAnd I want this:\nFunc<int, bool>[] predicates = new Func<int...
I'm looking for advanced strategies for dealing with User Object Handle limits when building heavy-weight windows interfaces. Please explain how you overcame or bypassed this issue using SWT or direct Windows GUI APIs. The only thing I am not interested in is strategies to optimize widget usage as I have done this ex...
Dealing with User Object Handle limits in a heavy-weight Windows interface, particularly when using SWT (Standard Widget Toolkit), requires a combination of proactive design choices and strategic workarounds. Given your existing strategies, here are some advanced approaches you might consider: ### 1. Virtualization of...
15,735
[ { "from": "human", "value": "I'm looking for advanced strategies for dealing with User Object Handle limits when building heavy-weight windows interfaces. Please explain how you overcame or bypassed this issue using SWT or direct Windows GUI APIs. The only thing I am not interested in is strategies to opt...
I've been led to believe that for single variable assignment in T-SQL, set is the best way to go about things, for two reasons: it's the ANSI standard for variable assignment it's actually faster than doing a SELECT (for a single variable) So... SELECT @thingy = 'turnip shaped' becomes SET @thingy = 'turnip shaped'...
The choice between using `SET` and `SELECT` for single variable assignments in T-SQL has been a topic of debate among SQL developers. Here’s a breakdown of the performance and practical aspects: ### Performance 1. **SET vs. SELECT**: - When using `SET` to assign a value to a variable, you're doing it in a straightf...
16,814
[ { "from": "human", "value": "I've been led to believe that for single variable assignment in T-SQL, set is the best way to go about things, for two reasons:\n\nit's the ANSI standard for variable assignment\nit's actually faster than doing a SELECT (for a single variable)\n\nSo...\nSELECT @thingy = 'turnip ...
I am getting the following stack trace in my log file and was wanting to suppress just this error from displaying in the log: ERROR 08-09-26 14:48:45.141 http-80-215 org.apache.struts2.dispatcher.VelocityResult: Unable to render Velocity Template, '/jsondata.vm' ClientAbortException: java.net.SocketExceptio...
To suppress the `ClientAbortException` from logging while still allowing other logs to be recorded, you can use a custom logging configuration. Here’s how you can approach this depending on the logging framework you are using (e.g., Log4j, Logback, etc.). ### Using Log4j 1. **Update `log4j.xml` or `log4j.properties`:...
17,472
[ { "from": "human", "value": "I am getting the following stack trace in my log file and was wanting to suppress just this error from displaying in the log:\n\nERROR 08-09-26 14:48:45.141\n http-80-215\n org.apache.struts2.dispatcher.VelocityResult:\n Unable to render Velocity Template,\n '/jsondata.vm' C...
I'm looking to have two versions of BOOST compiled into a project at the same time. Ideally they should be usable along these lines: boost_1_36_0::boost::shared_ptr<SomeClass> someClass = new SomeClass(); boost_1_35_0::boost::regex expression("[0-9]", boost_1_35_0::boost::regex_constants::basic);
To use two different versions of the Boost library in the same project, you need to ensure that both versions are properly isolated from each other to avoid naming collisions and linkage issues. Here’s a general approach you can follow to achieve this: ### Steps to Compile Two Boost Versions 1. **Download and Build B...
12,046
[ { "from": "human", "value": "I'm looking to have two versions of BOOST compiled into a project at the same time. Ideally they should be usable along these lines:\nboost_1_36_0::boost::shared_ptr<SomeClass> someClass = new SomeClass();\nboost_1_35_0::boost::regex expression(\"[0-9]\", boost_1_35_0::boost::r...
When developing Java applications, I often override Object methods (usually equals and hashCode). I would like some way to systematically check that I'm adhering to the contract for Object methods for every one of my classes. For example, I want tests that assert that for equal objects, the hash code is also equal. ...
To systematically check the contract for `equals` and `hashCode` in your Java applications, you can create a JUnit test suite that utilizes reflection to analyze all classes in a given package or the entire classpath. Here's how you can achieve this: ### Step 1: Create a Base Test Class Create an abstract base class ...
17,173
[ { "from": "human", "value": "When developing Java applications, I often override Object methods (usually equals and hashCode). I would like some way to systematically check that I'm adhering to the contract for Object methods for every one of my classes. For example, I want tests that assert that for equa...
I am writing a very specialized app in C# that floats as a mostly transparent window over the entire desktop. I want to be able to create and pass mouse events to applications behind mine, and have them appear to operate "normally", responding to those events. It would also be preferable if the window manager could res...
Creating a transparent overlay window in C# that can generate mouse events for applications behind it is a challenging task. As you pointed out, using `mouse_event` may not work as expected because your application is on top of others and the generated mouse events will not pass through it. The best approach for your...
15,017
[ { "from": "human", "value": "I am writing a very specialized app in C# that floats as a mostly transparent window over the entire desktop. I want to be able to create and pass mouse events to applications behind mine, and have them appear to operate \"normally\", responding to those events. It would also be...
I was currently developing a desktop application in C# using mono and testing in SuSE and Windows. The concept doesn't matter much, but it is a "web lint" program that will scan a web site and return possible issues with security and/or cross browser compatibility. However, I want to be able to offer binaries for mult...
If you're looking for cross-platform capabilities beyond what Mono provides, you might want to consider transitioning to .NET Core (now known as .NET 5 and later versions). .NET Core is a more modern, unified framework that supports development for Windows, macOS, and Linux. Here's an overview of your options and consi...
19,663
[ { "from": "human", "value": "I was currently developing a desktop application in C# using mono and testing in SuSE and Windows. The concept doesn't matter much, but it is a \"web lint\" program that will scan a web site and return possible issues with security and/or cross browser compatibility. However, I...
I have a header file like this: #ifndef __GEN_NOTE_MARKERS_TO_DEVELOPERS_HPP__ #define __GEN_NOTE_MARKERS_TO_DEVELOPERS_HPP__ #ifdef _DEBUG // macros for turning a number into a string #define STRING2(x) #x #define STRING(x) STRING2(x) #ifdef TRIAGE_MESG_AS_WARNING #define TRIAGE_TODO_TAG(d...
To have messages show up in the Messages pane of the Error List in Visual Studio (instead of the Warnings pane), you need to format them correctly to ensure that they are treated as informational messages rather than warnings. In Visual Studio, you can achieve this with the appropriate use of `#pragma message` directiv...
20,545
[ { "from": "human", "value": "I have a header file like this:\n#ifndef __GEN_NOTE_MARKERS_TO_DEVELOPERS_HPP__\n#define __GEN_NOTE_MARKERS_TO_DEVELOPERS_HPP__\n\n #ifdef _DEBUG\n\n // macros for turning a number into a string\n #define STRING2(x) #x\n #define STRING(x) STRING2(x)\n\n #ifdef TRI...
I'm currently writing a simple .sh script to parse an Exim log file for strings matching " o' ". Currently, when viewing output.txt, all that is there is a 0 printed on every line(606 lines). I'm guessing my logic is wrong, as awk does not throw any errors. Here is my code(updated for concatenation and counter issues)....
It looks like you're on the right track, but your script has a few potential issues that might be causing it to produce only a series of zeros. Let's take a closer look at your `awk` script and suggest some modifications: 1. **Field Indexing**: Ensure that you're correctly identifying the fields in your log entries. T...
18,028
[ { "from": "human", "value": "I'm currently writing a simple .sh script to parse an Exim log file for strings matching \" o' \". Currently, when viewing output.txt, all that is there is a 0 printed on every line(606 lines). I'm guessing my logic is wrong, as awk does not throw any errors.\nHere is my code(up...
Suppose you have a program which reads from a socket. How do you keep the download rate below a certain given threshold?
To control the download rate from a socket and keep it below a certain threshold, you can implement a rate-limiting mechanism in your program. Here are several approaches to achieve this: ### 1. Use a Time-based Throttle You can read data in chunks from the socket and insert sleep intervals to ensure that the data tr...
15,619
[ { "from": "human", "value": "Suppose you have a program which reads from a socket. How do you keep the download rate below a certain given threshold?\n" }, { "from": "gpt", "value": "To control the download rate from a socket and keep it below a certain threshold, you can implement a rate-limiti...
Trying to create a user account in a test. But getting a Object reference is not set to an instanve of an object error when running it. Here's my MemberShip provider class, it's in a class library MyCompany.MyApp.Domain.dll: using System; using System.Collections.Generic; using System.Web.Security; namespace MyCompany...
The "Object reference is not set to an instance of an object" error suggests that you are trying to call a method on an object that hasn't been properly initialized. In your case, the `MyMembershipProvider` is being instantiated directly with `new MyMembershipProvider()`, which doesn't trigger the `Initialize` method t...
21,593
[ { "from": "human", "value": "Trying to create a user account in a test. But getting a Object reference is not set to an instanve of an object error when running it.\nHere's my MemberShip provider class, it's in a class library MyCompany.MyApp.Domain.dll:\nusing System;\nusing System.Collections.Generic;\nus...
I am making my switch from coding in C++ to C#. I need to replace my C++ error logging/reporting macro system with something similar in C#. In my C++ source I can write LOGERR("Some error"); or LOGERR("Error with inputs %s and %d", stringvar, intvar); The macro & supporting library code then passes the (possibly varar...
Welcome to C#! Transitioning from C++ to C# can be a significant shift, especially when it comes to error logging and reporting. In C#, you have several options for logging, and it's good to hear that you found `System.Diagnostics.Trace` and log4net useful for your needs. For quick error logging in C#, you can create ...
13,496
[ { "from": "human", "value": "I am making my switch from coding in C++ to C#. I need to replace my C++ error logging/reporting macro system with something similar in C#.\nIn my C++ source I can write\nLOGERR(\"Some error\");\nor\nLOGERR(\"Error with inputs %s and %d\", stringvar, intvar);\nThe macro & suppo...
I've inherited this really weird codebase where they've built an external web service over a bunch of internal web services just to add authentication/authorization using WS-Security, WS-Encryption, et al. Less than a month into this engagement, I'm already feeling the pain of coupling volatile components through rigid...
You've stumbled into a common scenario where design decisions may have led to an unnecessarily complex and tightly coupled system. Let's unpack your questions. ### 1. Would you ever build a web service just to provide a cross-cutting concern over a bunch of services? While it's not uncommon to implement a facade or a...
21,893
[ { "from": "human", "value": "I've inherited this really weird codebase where they've built an external web service over a bunch of internal web services just to add authentication/authorization using WS-Security, WS-Encryption, et al. Less than a month into this engagement, I'm already feeling the pain of c...
I am working on a web application with many images, using ASP.NET MVC. I want to be able to cache the images in memory to improve the performance, but I would like to hear what is the best way to do this. 1) The images are accessible from URL, like http://www.site.com/album/1.jpg. How are the images stored in memory? ...
Caching images in memory can significantly improve the performance of your web application, especially when dealing with many images. Here’s a structured approach to caching images in memory using ASP.NET MVC: ### Step 1: Caching Images 1. **Use Memory Cache**: You can use the `MemoryCache` class from `System.Runtime...
18,479
[ { "from": "human", "value": "I am working on a web application with many images, using ASP.NET MVC. I want to be able to cache the images in memory to improve the performance, but I would like to hear what is the best way to do this. \n1) The images are accessible from URL, like http://www.site.com/album/1....
I'm at a point in my freelance career where I've developed several web applications for small to medium sized businesses that support things such as project management, booking/reservations, and email management. I like the work but find that eventually my applications get to a point where the overhear for maintenance ...
It's great to hear that you've made progress in your freelance career and are working on web applications! Managing technical debt and ensuring maintainability is crucial for long-term success, especially as projects grow and evolve. Here are some techniques and strategies you can consider to build maintainable applica...
18,133
[ { "from": "human", "value": "I'm at a point in my freelance career where I've developed several web applications for small to medium sized businesses that support things such as project management, booking/reservations, and email management.\nI like the work but find that eventually my applications get to a...
I'm trying to enter a little bit of HTML into an ASP.NET Dynamic Data MultilineText_Edit control, just a couple of <br> tags to have line breaks when I output the value of the column on a web page. However, when I try to click the "Update" link on the Dynamic Data edit page, nothing happens. I don't even get an erro...
The behavior you're experiencing when trying to use HTML tags, such as `<br>`, in an ASP.NET Dynamic Data MultilineText_Edit control is due to input validation mechanisms that protect against potential security risks like Cross-Site Scripting (XSS). By default, ASP.NET Dynamic Data is designed to sanitize inputs to ens...
18,537
[ { "from": "human", "value": "I'm trying to enter a little bit of HTML into an ASP.NET Dynamic Data MultilineText_Edit control, just a couple of <br> tags to have line breaks when I output the value of the column on a web page. \nHowever, when I try to click the \"Update\" link on the Dynamic Data edit page...
Our company is considering upgrading our SQL server. At this point, would it be better to upgrade to 2005 or 2008? Here are some of my considerations: Features Licensing costs Learning curve Bear in mind our staff has already been using SQL server 2000 for many years.
When considering an upgrade from SQL Server 2000, opting for SQL Server 2005 or 2008 has implications across features, licensing costs, and the learning curve for your staff. Here are some key factors to help you decide: ### Features **SQL Server 2005:** - Introduced significant enhancements over SQL Server 2000, inc...
17,003
[ { "from": "human", "value": "Our company is considering upgrading our SQL server. \nAt this point, would it be better to upgrade to 2005 or 2008?\nHere are some of my considerations:\n\nFeatures\nLicensing costs\nLearning curve\n\nBear in mind our staff has already been using SQL server 2000 for many years....
Given an aggregation of class instances which refer to each other in a complex, circular, fashion: is it possible that the garbage collector may not be able to free these objects? I vaguely recall this being an issue in the JVM in the past, but I thought this was resolved years ago. yet, some investigation in jhat has...
You're correct that modern garbage collectors, including those used in the JVM, are designed to handle circular references. In a typical scenario, if two or more objects reference each other but are no longer reachable from the root set (i.e., there are no references from active threads, static fields, etc.), the garba...
20,995
[ { "from": "human", "value": "Given an aggregation of class instances which refer to each other in a complex, circular, fashion: is it possible that the garbage collector may not be able to free these objects?\nI vaguely recall this being an issue in the JVM in the past, but I thought this was resolved years...
Greetings! I have a WebService that contains a WebMethod that does some work and returns a boolean value. The work that it does may or may not take some time, so I'd like to call it asynchronously. [WebService(Namespace = "http://tempuri.com/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [System.Com...
To achieve asynchronous calls to the `DoWork()` method on each server and report success or failure as the results are returned, you'll need to leverage asynchronous programming techniques and update the UI dynamically as each call completes. Below is a step-by-step approach to implement this, using the `Task` and `asy...
17,705
[ { "from": "human", "value": "Greetings!\nI have a WebService that contains a WebMethod that does some work and returns a boolean value. The work that it does may or may not take some time, so I'd like to call it asynchronously.\n[WebService(Namespace = \"http://tempuri.com/\")]\n[WebServiceBinding(Conforms...
I have found that my HTML is, to be honest, very clunky. Small, simple pages are OK. But there comes a point when between indenting and the kinds of tags I have, it's impossible to keep lines short. Is there a W3C (or otherwise "official" or well accepted) formatting guide for clean, maintainable HTML? If not, what sug...
While there isn't a singular "official" formatting guide from the W3C specifically for HTML, there are many widely accepted best practices and style guides that can help you create clean, maintainable HTML. Here are some general guidelines and suggestions: ### 1. **Use Consistent Indentation** - Use spaces or tabs ...
17,165
[ { "from": "human", "value": "I have found that my HTML is, to be honest, very clunky. Small, simple pages are OK. But there comes a point when between indenting and the kinds of tags I have, it's impossible to keep lines short. Is there a W3C (or otherwise \"official\" or well accepted) formatting guide for...
I'm trying to run an ASP.NET 2.0 application on an XP machine. As far as I know, everything is configured correctly. However, I receive the following message: Server Application Unavailable And two events appear in the Application event log each time: aspnet_wp.exe (PID: 3352) stopped unexpectedly. Failed to exec...
It looks like you've already gone through a comprehensive troubleshooting process for the "Server Application Unavailable" issue. The fact that you were able to identify the permissions issue with the assembly binding log viewer using Process Monitor is excellent detective work! To summarize what you learned, the issu...
20,884
[ { "from": "human", "value": "I'm trying to run an ASP.NET 2.0 application on an XP machine. As far as I know, everything is configured correctly. However, I receive the following message:\n\nServer Application Unavailable\n\nAnd two events appear in the Application event log each time:\n\naspnet_wp.exe (PI...
I need to get UTF-8 working in my Java webapp (servlets + JSP, no framework used) to support äöå etc. for regular Finnish text and Cyrillic alphabets like ЦжФ for special cases. My setup is the following: Development environment: Windows XP Production environment: Debian Database used: MySQL 5.x Users mainly use Fire...
To ensure that your Java web application (servlets and JSP) correctly handles UTF-8 encoding for Finnish characters (like ä, ö, å) and Cyrillic alphabets, you need to follow several steps throughout your application stack. Here’s a comprehensive guide to setting it up correctly: ### 1. Database Configuration Make sur...
14,546
[ { "from": "human", "value": "I need to get UTF-8 working in my Java webapp (servlets + JSP, no framework used) to support äöå etc. for regular Finnish text and Cyrillic alphabets like ЦжФ for special cases.\nMy setup is the following:\n\nDevelopment environment: Windows XP\nProduction environment: Debian\n\...
If given the choice, which path would you take? ASP.NET Webforms + ASP.NET AJAX or ASP.NET MVC + JavaScript Framework of your Choice Are there any limitations that ASP.NET Webforms / ASP.NET AJAX has vis-a-vis MVC?
Choosing between ASP.NET Web Forms with ASP.NET AJAX and ASP.NET MVC with a JavaScript framework often depends on the specific needs of the project, team expertise, and long-term maintenance considerations. Here’s a breakdown of both options along with their limitations: ### ASP.NET Web Forms + ASP.NET AJAX #### Pros...
13,937
[ { "from": "human", "value": "If given the choice, which path would you take?\n\nASP.NET Webforms + ASP.NET AJAX\n\nor\n\nASP.NET MVC + JavaScript Framework of your Choice\n\nAre there any limitations that ASP.NET Webforms / ASP.NET AJAX has vis-a-vis MVC? \n" }, { "from": "gpt", "value": "Choosi...
I read an interesting DailyWTF post today, "Out of All The Possible Answers..." and it interested me enough to dig up the original forum post where it was submitted. This got me thinking how I would solve this interesting problem - the original question is posed on Project Euler as: 2520 is the smallest number that c...
Certainly! Let's go through how to compute the Least Common Multiple (LCM) for a list of numbers, step by step, using Python. The LCM of two or more integers is the smallest number that is evenly divisible by all of them. ### Understanding LCM and GCD The LCM can be calculated using the Greatest Common Divisor (GCD)....
18,534
[ { "from": "human", "value": "I read an interesting DailyWTF post today, \"Out of All The Possible Answers...\" and it interested me enough to dig up the original forum post where it was submitted. This got me thinking how I would solve this interesting problem - the original question is posed on Project Eul...
My company is considering offering a lightweight mobile web site for data entry in the field (we already have a thick-client mobile application). One hard requirement is that we must be able to capture a signature. Is there any prior art for capturing a signature, specifically inside a web page running inside a mobile...
Capturing signatures in a mobile web application is indeed a challenge due to the diversity of devices and browsers. However, there are several established methods that are widely used across different platforms. Here are some options that focus on in-browser solutions for capturing signatures on touchscreen devices: ...
18,173
[ { "from": "human", "value": "My company is considering offering a lightweight mobile web site for data entry in the field (we already have a thick-client mobile application). One hard requirement is that we must be able to capture a signature.\nIs there any prior art for capturing a signature, specifically...
I'm working through previous years ACM Programming Competition problems trying to get better at solving Graph problems. The one I'm working on now is I'm given an arbitrary number of undirected graph nodes, their neighbors and the distances for the edges connecting the nodes. What I NEED is the distance between the ...
Your approach of running Dijkstra's algorithm from every node to find the longest path in an undirected weighted graph is indeed correct but computationally expensive. For a graph with \( V \) nodes, running Dijkstra's algorithm \( V \) times results in a time complexity of \( O(V^2 \log V) \) (or \( O(V^2) \) if using...
17,998
[ { "from": "human", "value": "I'm working through previous years ACM Programming Competition problems trying to get better at solving Graph problems. \nThe one I'm working on now is I'm given an arbitrary number of undirected graph nodes, their neighbors and the distances for the edges connecting the nodes....
Stateless beans in Java do not keep their state between two calls from the client. So in a nutshell we might consider them as objects with business methods. Each method takes parameters and return results. When the method is invoked some local variables are being created in execution stack. When the method returns the ...
You raise an interesting point about the similarities between stateless beans and method calls on a single instance in a multithreaded environment. However, the design and management of stateless session beans (or stateless beans in general) in a Java EE (Jakarta EE) context are based on several considerations that jus...
19,958
[ { "from": "human", "value": "Stateless beans in Java do not keep their state between two calls from the client. So in a nutshell we might consider them as objects with business methods. Each method takes parameters and return results. When the method is invoked some local variables are being created in exec...
How to export pictures in Microsoft Word to TIFF file using Visual Studio Tools for Office? I can obtain a reference to the pictures as InlineShape object collection, the hard part now is how to save them as TIFF images.
Exporting pictures from a Microsoft Word document as TIFF files using Visual Studio Tools for Office (VSTO) involves several steps. You'll need to access the InlineShapes collection in your Word document, convert each shape to a format that can be saved, and then use appropriate methods to save the images as TIFF files...
18,184
[ { "from": "human", "value": "How to export pictures in Microsoft Word to TIFF file using Visual Studio Tools for Office? I can obtain a reference to the pictures as InlineShape object collection, the hard part now is how to save them as TIFF images.\n" }, { "from": "gpt", "value": "Exporting pic...
I seem to only be able to write to the Apache error log via stderr. Anyone know of a more structured logging architecture that I could use from my python web project, like commons?
If you're looking for a more structured logging architecture in your Python web project, you have several options to consider beyond just logging to Apache's error log via stderr. Here are a few approaches you can take to implement structured logging: ### 1. Use Python's built-in `logging` module Python's built-in `l...
20,142
[ { "from": "human", "value": "I seem to only be able to write to the Apache error log via stderr. Anyone know of a more structured logging architecture that I could use from my python web project, like commons?\n" }, { "from": "gpt", "value": "If you're looking for a more structured logging arch...
I have a ListBox which displays items of variable height. I want to show as many items as will fit in the available space, without showing a vertical scrollbar. Other than surgery on the ListBox item template, is there a way to only show the number of items which will fit without scrolling?
To display as many items as will fit in a ListBox without showing a vertical scrollbar, you can take a couple of approaches without modifying the ListBox item template directly. Here are some methods you can consider: ### 1. **Dynamic Item Sizing with a ViewModel** You can bind the `ItemsSource` of the ListBox to a co...
17,680
[ { "from": "human", "value": "I have a ListBox which displays items of variable height. I want to show as many items as will fit in the available space, without showing a vertical scrollbar. Other than surgery on the ListBox item template, is there a way to only show the number of items which will fit withou...
The kind of simulation game that I have in mind is the kind where you have things to build in various locations and workers/transporters that connect such locations. Something more like the Settlers series. Let's assume I don't want any graphics at the moment, that I think I can manage. So my doubts are the following: ...
Designing a simulation game like the Settlers series involves a balance between modularity, performance, and maintainability. Let's break down your questions systematically. ### 1. Class vs. Thread Management for Entities **Option 1: Every entity is a class with its own thread** - **Pros:** Each entity can run indepe...
17,421
[ { "from": "human", "value": "The kind of simulation game that I have in mind is the kind where you have things to build in various locations and workers/transporters that connect such locations.\nSomething more like the Settlers series.\nLet's assume I don't want any graphics at the moment, that I think I c...
I have several wpf pages with update/delete/add buttons. I want to display to the user messages like "successful delete", etc. How can I best implement this so the message is defined in a single place (similar to an asp.net master page) and I can update this message from anywhere?
To implement a centralized messaging system in a WPF application, you can create a notification service or a singleton that handles the messages and a user interface element (like a MessageBox, a status bar, or a dedicated message display area) to show those messages. Here’s how you can accomplish this step-by-step: #...
18,232
[ { "from": "human", "value": "I have several wpf pages with update/delete/add buttons. I want to display to the user messages like \"successful delete\", etc. How can I best implement this so the message is defined in a single place (similar to an asp.net master page) and I can update this message from any...
Linux supports sending an arbitrary Posix-Signal such as SIGINT or SIGTERM to a process using the kill-Command. While SIGINT and SIGTERM are just boring old ways to end a process in a friendly or not-so-friendly kind of way, SIGQUIT is meant to trigger a core dump. This can be used to trigger a running Java VM to prin...
In Windows, the concept of signals is not as rich or well-defined as in Unix-like systems, where signals like SIGQUIT, SIGTERM, and others are available. Windows has its own mechanism for inter-process communication and process management, but it does not have a direct equivalent to Unix signals for arbitrary signaling...
17,463
[ { "from": "human", "value": "Linux supports sending an arbitrary Posix-Signal such as SIGINT or SIGTERM to a process using the kill-Command. While SIGINT and SIGTERM are just boring old ways to end a process in a friendly or not-so-friendly kind of way, SIGQUIT is meant to trigger a core dump. This can be ...
I'm trying to install the .Net framework version 2.0 on embedded Windows XP SP2 (aka XPE). I'm using the XPE specific version of the installer from Microsoft: http://www.microsoft.com/downloads/details.aspx?familyid=c4837dad-5719-4b63-8752-cb0a65802329&displaylang=en When the installation starts it fails with the follo...
Installing .NET Framework 2.0 on Windows XP Embedded (XPe) can be tricky due to the embedded nature of the OS and the specific components it contains. The error message "Cannot connect to the database - please check the database" typically indicates an issue with the installer being unable to access or configure its in...
20,046
[ { "from": "human", "value": "I'm trying to install the .Net framework version 2.0 on embedded Windows XP SP2 (aka XPE).\nI'm using the XPE specific version of the installer from Microsoft:\nhttp://www.microsoft.com/downloads/details.aspx?familyid=c4837dad-5719-4b63-8752-cb0a65802329&displaylang=en\nWhen the...
I personally like the exclusive or, ^, operator when it makes sense in the context of boolean checks because of its conciseness. I much prefer to write if (boolean1 ^ boolean2) { //do it } than if((boolean1 && !boolean2) || (boolean2 && !boolean1)) { //do it } but I often get confused looks from other experience...
Using the `^` (exclusive or) operator in Java is indeed a matter of preference and context, but there are some best practices and considerations to keep in mind. ### Advantages of Using `^` for Boolean Logic 1. **Conciseness**: As you pointed out, using `^` can make the code more concise. It reduces the verbosity of e...
20,104
[ { "from": "human", "value": "I personally like the exclusive or, ^, operator when it makes sense in the context of boolean checks because of its conciseness. I much prefer to write\nif (boolean1 ^ boolean2)\n{\n //do it\n}\n\nthan\nif((boolean1 && !boolean2) || (boolean2 && !boolean1))\n{\n //do it\n}\n\...
How do I pick a random element from a set? I'm particularly interested in picking a random element from a HashSet or a LinkedHashSet, in Java.
To pick a random element from a `HashSet` or a `LinkedHashSet` in Java, you can follow these steps: 1. Convert the set to an array or a list. 2. Generate a random index based on the size of the array or list. 3. Retrieve the element at that random index. Here's a code example demonstrating how to do this: ### Exampl...
20,508
[ { "from": "human", "value": "How do I pick a random element from a set?\nI'm particularly interested in picking a random element from a\nHashSet or a LinkedHashSet, in Java.\n" }, { "from": "gpt", "value": "To pick a random element from a `HashSet` or a `LinkedHashSet` in Java, you can follow th...
Got a class that serializes into xml with XMLEncoder nicely with all the variables there. Except for the one that holds java.util.Locale. What could be the trick?
When using `XMLEncoder` in Java to serialize an object to XML, one common issue is that `XMLEncoder` does not have built-in support for certain complex types, including `java.util.Locale`. This means that when `XMLEncoder` encounters a `Locale` object, it may not know how to serialize it, resulting in the locale variab...
19,953
[ { "from": "human", "value": "Got a class that serializes into xml with XMLEncoder nicely with all the variables there. Except for the one that holds java.util.Locale. What could be the trick?\n" }, { "from": "gpt", "value": "When using `XMLEncoder` in Java to serialize an object to XML, one comm...
Can the iPhone SDK take advantage of the iPhone's proximity sensors? If so, why hasn't anyone taken advantage of them? I could picture a few decent uses. For example, in a racing game, you could put your finger on the proximity sensor to go instead of taking up screen real-estate with your thumb. Of course though, if t...
Yes, the iPhone SDK does provide access to the iPhone's proximity sensors, but the functionality is somewhat limited. The primary role of the proximity sensor in iPhones is to detect when the device is close to your face, primarily to turn off the display during phone calls to prevent accidental touches. This means it ...
20,715
[ { "from": "human", "value": "Can the iPhone SDK take advantage of the iPhone's proximity sensors? If so, why hasn't anyone taken advantage of them? I could picture a few decent uses.\nFor example, in a racing game, you could put your finger on the proximity sensor to go instead of taking up screen real-esta...
Is SQL case sensitive? I've used MySQL and SQL Server which both seem to be case insensitive. Is this always the case? Does the standard define case-sensitivity?
SQL's case sensitivity can vary based on several factors, including the database management system (DBMS) you are using, the specific settings of that DBMS, and the context in which the SQL is written. Here's a breakdown of how case sensitivity works in different contexts: ### 1. Database Management Systems (DBMS): -...
19,318
[ { "from": "human", "value": "Is SQL case sensitive? I've used MySQL and SQL Server which both seem to be case insensitive. Is this always the case? Does the standard define case-sensitivity?\n" }, { "from": "gpt", "value": "SQL's case sensitivity can vary based on several factors, including t...
I've got a web site sending someone a confirmation email. Now in the email I would like to have a link the user has to click to confirm he received the mail. I'd like to include the user's password (or some random code) into the confirmation address, so the user does not need to enter it by hand again, but if I do this...
It's great that you're considering user security when implementing email confirmations. Here are some recommendations for how to safely implement confirmation links without exposing sensitive information like passwords: ### 1. **Avoid Sending Passwords in Links** Never include passwords or sensitive information in lin...
20,746
[ { "from": "human", "value": "I've got a web site sending someone a confirmation email.\nNow in the email I would like to have a link the user has to click to confirm he received the mail.\nI'd like to include the user's password (or some random code) into the confirmation address, so the user does not need ...
We recently had a security audit and it exposed several weaknesses in the systems that are in place here. One of the tasks that resulted from it is that we need to update our partner credentials system make it more secure. The "old" way of doing things was to generate a (bad) password, give it to the partner with an...
To enhance the security of your partner credentials system, you can adopt a more robust approach to both password generation and transmission. Below are recommendations for improving both aspects of your current setup: ### 1. Secure Password Generation Since the current passwords are hardcoded and meant to be difficu...
14,326
[ { "from": "human", "value": "We recently had a security audit and it exposed several weaknesses in the systems that are in place here. One of the tasks that resulted from it is that we need to update our partner credentials system make it more secure. \nThe \"old\" way of doing things was to generate a (b...
I have the following interface which I'm trying to make COM-visible. When I try to generate the type-library it doesn't like the fact that my implementation class derives from a generic-class. Is it possible to use a generic class as a COM implementation class? (I know I could write a non-generic wrapper and export t...
In COM, generic classes are not directly supported. When you attempt to create a COM-visible class that derives from a generic base class, the type library exporter can run into issues, as you've experienced. To ensure your class can be exposed to COM without running into these issues, you need to follow the guideline...
18,339
[ { "from": "human", "value": "I have the following interface which I'm trying to make COM-visible. When I try to generate the type-library it doesn't like the fact that my implementation class derives from a generic-class. \nIs it possible to use a generic class as a COM implementation class?\n(I know I cou...
I have a client/server system that performs communication using XML transferred using HTTP requests and responses with the client using Perl's LWP and the server running Perl's CGI.pm through Apache. In addition the stream is encrypted using SSL with certificates for both the server and all clients. This system works ...
Using `mod_deflate` for input decompression in a scenario where you're sending large amounts of data can indeed be challenging, especially when dealing with the `Content-Length` header. ### Problem Recap 1. **Compression**: You want to compress data on the client side and let `mod_deflate` decompress it on the server ...
15,763
[ { "from": "human", "value": "I have a client/server system that performs communication using XML transferred using HTTP requests and responses with the client using Perl's LWP and the server running Perl's CGI.pm through Apache. In addition the stream is encrypted using SSL with certificates for both the s...
How do I manipulate images at the pixel level in C#? I need to be able to read/modify each bitmap pixel RGB values separately. A code sample would be appreciated.
To manipulate images at the pixel level in C#, you can use the `System.Drawing` namespace, which provides classes for working with images. Below is a simple example that demonstrates how to read and modify the RGB values of each pixel in a bitmap image. This example shows how to load a bitmap image, modify its pixels...
17,512
[ { "from": "human", "value": "How do I manipulate images at the pixel level in C#?\nI need to be able to read/modify each bitmap pixel RGB values separately. \nA code sample would be appreciated.\n" }, { "from": "gpt", "value": "To manipulate images at the pixel level in C#, you can use the `Syst...
I'm looking to build an reusable control or custom helper for my MVC project. I'm sure there is a best practice for this. Any help is appreciated.
Certainly! Creating a reusable control or custom helper in an ASP.NET MVC project can significantly improve maintainability and reduce code duplication. Below are best practices and steps you can follow to build your reusable component. ### 1. Identify the Need Determine what functionality you want your reusable contr...
14,478
[ { "from": "human", "value": "I'm looking to build an reusable control or custom helper for my MVC project. I'm sure there is a best practice for this. Any help is appreciated.\n" }, { "from": "gpt", "value": "Certainly! Creating a reusable control or custom helper in an ASP.NET MVC project can s...
I have a batch file that uses this idiom (many times) to read a registry value into an environment variable: FOR /F "tokens=2* delims= " %%A IN ('REG QUERY "HKLM\SOFTWARE\Path\To\Key" /v ValueName') DO SET MyVariable=%%B (There's a tab character after delims=) This works fine on thousands of customer's computers. But...
The issue you're encountering likely stems from how the command shell on Windows Server 2003 is interpreting and executing the command in the `FOR /F` loop. Here are a few reasons why this could happen: 1. **Command Execution Context**: The command executed within the `FOR /F` loop might be running in a different cont...
16,483
[ { "from": "human", "value": "I have a batch file that uses this idiom (many times) to read a registry value into an environment variable:\nFOR /F \"tokens=2* delims= \" %%A IN ('REG QUERY \"HKLM\\SOFTWARE\\Path\\To\\Key\" /v ValueName') DO SET MyVariable=%%B\n\n(There's a tab character after delims=)\nThis...
I'm coming from C# background and in Visual Studio. The namespace is shown by default but not in Visual Basic. Is there an option to enable namespace to be shown in Visual Studio 2008?
In Visual Basic (VB.NET), the namespace declaration is not always displayed in the code editor by default, especially if you're working with a module or class where the namespace is implied from the project's structure. However, you can manually add the namespace declaration to your code if you want it to be explicitly...
22,424
[ { "from": "human", "value": "I'm coming from C# background and in Visual Studio. The namespace is shown by default but not in Visual Basic. Is there an option to enable namespace to be shown in Visual Studio 2008?\n" }, { "from": "gpt", "value": "In Visual Basic (VB.NET), the namespace declarati...
I have a QTreeView class with a context menu installed as follows: m_ui.tree->setContextMenuPolicy(Qt::CustomContextMenu); connect(m_ui.tree, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(ShowTreeContextMenu(const QPoint&))); ... void ShowTreeContextMenu(const QPoint& point) { m_treeContextMe...
This behavior occurs because the context menu interferes with the mouse events in the `QTreeView`. When you right-click to bring up the context menu, the `QTreeView` loses focus, and therefore it doesn't respond to mouse clicks as you would expect. As a result, clicking on the new item does not select it, which can lea...
16,712
[ { "from": "human", "value": "I have a QTreeView class with a context menu installed as follows:\nm_ui.tree->setContextMenuPolicy(Qt::CustomContextMenu);\nconnect(m_ui.tree, SIGNAL(customContextMenuRequested(const QPoint&)),\n this, SLOT(ShowTreeContextMenu(const QPoint&)));\n...\nvoid ShowTreeContext...
How do I generate a random number between 0 and n?
To generate a random number between 0 and \( n \) (inclusive), you can use different methods depending on the programming language you're working with. Here are examples in some common languages: ### Python ```python import random n = 10 # Replace with your desired maximum value random_number = random.randint(0, n) ...
21,375
[ { "from": "human", "value": "How do I generate a random number between 0 and n?\n" }, { "from": "gpt", "value": "To generate a random number between 0 and \\( n \\) (inclusive), you can use different methods depending on the programming language you're working with. Here are examples in some com...
Or are they two distinct applications that are not related?
To provide a clear answer, I would need to know the specific applications you are referring to. Could you please specify which two applications you are asking about?
24,891
[ { "from": "human", "value": "Or are they two distinct applications that are not related?\n" }, { "from": "gpt", "value": "To provide a clear answer, I would need to know the specific applications you are referring to. Could you please specify which two applications you are asking about?" } ]
Could you guys recommend me a good db modeling tool? Mainly for SQL Server... thanks!
Certainly! Here are some popular database modeling tools that are well-suited for SQL Server: 1. **Microsoft SQL Server Management Studio (SSMS)**: - While SSMS is primarily a management tool, it has basic database diagramming capabilities that allow you to visualize your database schema. 2. **Visual Studio with S...
19,950
[ { "from": "human", "value": "Could you guys recommend me a good db modeling tool? Mainly for SQL Server...\nthanks!\n" }, { "from": "gpt", "value": "Certainly! Here are some popular database modeling tools that are well-suited for SQL Server:\n\n1. **Microsoft SQL Server Management Studio (SSMS)...
I have a table on SQL2000 with a numeric column and I need the select to return a 01, 02, 03... It currently returns 1,2,3,...10,11... Thanks.
To format your numeric column in SQL Server 2000 so that it returns values as two-digit strings (e.g., `01`, `02`, `03`, etc.), you can use the `RIGHT` and `CONVERT` functions to ensure the numbers are represented as two characters, padding with zeros as necessary. Here’s how you can achieve this: ```sql SELECT RIGHT...
23,477
[ { "from": "human", "value": "I have a table on SQL2000 with a numeric column and I need the select to return a 01, 02, 03...\nIt currently returns 1,2,3,...10,11...\nThanks.\n" }, { "from": "gpt", "value": "To format your numeric column in SQL Server 2000 so that it returns values as two-digit s...
Is there a way to start an instance of eclipse, passing it some sort of parameter telling it to use a specific workspace? The problem I'm trying to solve is that I have a workspace for work projects and one for personal projects. I'd like to be able to tie these to workspaces to separate shortcuts that I could launch i...
Yes, you can start an instance of Eclipse with a specific workspace by using command-line parameters. This allows you to create shortcuts that point to different workspaces for your work and personal projects. ### Steps to Start Eclipse with a Specific Workspace: 1. **Locate Your Eclipse Installation:** - Find the...
21,917
[ { "from": "human", "value": "Is there a way to start an instance of eclipse, passing it some sort of parameter telling it to use a specific workspace?\nThe problem I'm trying to solve is that I have a workspace for work projects and one for personal projects. I'd like to be able to tie these to workspaces t...
From Wikipedia, the free encyclopedia: Closure (computer science) In computer science, a closure is a function that is evaluated in an environment containing one or more bound variables. When called, the function can access these variables. The explicit use of closures is associated with functional program...
Certainly! In JavaScript, closures are a fundamental concept that allows functions to access variables from their containing (or parent) scope even after that scope has finished executing. This can be particularly useful for creating private variables, callbacks, or functions that maintain state. Here’s a simple examp...
20,511
[ { "from": "human", "value": "From Wikipedia, the free encyclopedia: Closure (computer science)\n\nIn computer science, a closure is a\n function that is evaluated in an\n environment containing one or more\n bound variables. When called, the\n function can access these variables.\n The explicit use of ...
I have a VB6 dll that is trying to create a COM object using the following line of code: Set CreateObj = CreateObject("OPSValuer.OPSValue") However this fails with the error "Object variable or With block variable not set". I can see OPSValuer.OPSValue in dcomcnfg and it appears to be registered fine. Does anyone have...
The error "Object variable or With block variable not set" generally indicates that the `CreateObject` call is failing, and as a result, `CreateObj` is being set to `Nothing`. Here are several steps to troubleshoot and possibly resolve the issue: 1. **Check Registration**: - Ensure that the COM object `OPSValuer.O...
19,243
[ { "from": "human", "value": "I have a VB6 dll that is trying to create a COM object using the following line of code:\nSet CreateObj = CreateObject(\"OPSValuer.OPSValue\")\n\nHowever this fails with the error \"Object variable or With block variable not set\".\nI can see OPSValuer.OPSValue in dcomcnfg and i...
It's the first great virtue of programmers. All of us have, at one time or another automated a task with a bit of throw-away code. Sometimes it takes a couple seconds tapping out a one-liner, sometimes we spend an exorbitant amount of time automating away a two-second task and then never use it again. What tiny hack ha...
One tiny hack that I find very useful is a command that allows you to quickly navigate to a directory in the terminal based on a partial match of its name. You can create a shell function that enables this functionality. Here's an example of how you can set it up in your `.bashrc` or `.zshrc` file: ```bash # Add this...
21,664
[ { "from": "human", "value": "It's the first great virtue of programmers. All of us have, at one time or another automated a task with a bit of throw-away code. Sometimes it takes a couple seconds tapping out a one-liner, sometimes we spend an exorbitant amount of time automating away a two-second task and t...
I want to use regular expressions (Perl compatible) to be able to find a pattern surrounded by two other patterns, but not include the strings matching the surrounding patterns in the match. For example, I want to be able to find occurrences of strings like: Foo Bar Baz But only have the match include the middle part...
You can achieve this using a combination of positive lookbehind and positive lookahead assertions in your regular expression. In your case, to find the string "Bar" that is surrounded by "Foo" and "Baz", you would use the following Perl-compatible regular expression: ```regex (?<=Foo\s)(.*?)(?=\sBaz) ``` Here's wha...
22,798
[ { "from": "human", "value": "I want to use regular expressions (Perl compatible) to be able to find a pattern surrounded by two other patterns, but not include the strings matching the surrounding patterns in the match.\nFor example, I want to be able to find occurrences of strings like:\n\nFoo Bar Baz\n\nB...
I'd like to know which libraries are used by executables on my system. More specifically, I'd like to rank which libraries are used the most, along with the binaries that use them. How can I do this?
To find out which libraries are used by executables on your system and rank them by usage, you can follow these steps. The exact commands may vary slightly depending on your operating system, so I will provide a general approach for both Linux and Windows. ### For Linux: 1. **List Executables**: You can use the `find...
18,310
[ { "from": "human", "value": "I'd like to know which libraries are used by executables on my system. More specifically, I'd like to rank which libraries are used the most, along with the binaries that use them. How can I do this?\n" }, { "from": "gpt", "value": "To find out which libraries are us...
What is the longest string that can be created in .NET? The docs for the String class are silent on this question as far as I can see, so an authoritative answer might require some knowledge of internals. Would the maximum change on a 64-bit system? [This is asked more for curiosity than for practical use - I don't int...
In .NET, the maximum size of a `String` is influenced by several factors, including the architecture of the system (32-bit vs. 64-bit), the available memory, and the .NET runtime implementation. ### General Limits: 1. **String Length**: The maximum length of a `String` in .NET is limited by the maximum value of an `in...
12,485
[ { "from": "human", "value": "What is the longest string that can be created in .NET? The docs for the String class are silent on this question as far as I can see, so an authoritative answer might require some knowledge of internals. Would the maximum change on a 64-bit system?\n[This is asked more for curi...
In the following one to many CREATE TABLE source(id int, name varchar(10), PRIMARY KEY(id)); CREATE TABLE params(id int, source int, value int); where params.source is a foreign key to source.id INSERT INTO source values(1, 'yes'); INSERT INTO source values(2, 'no'); INSERT INTO params VALUES(1,1,1); INSERT INTO para...
To find all the sources that have all of the values from the specified list (in your case, [1, 2, 3]), you can use a SQL query that groups the parameters by their source and filters those groups by the count of the values matching your list. Here is an example of how to write this query: ```sql SELECT s.id, s.name FR...
21,916
[ { "from": "human", "value": "In the following one to many\nCREATE TABLE source(id int, name varchar(10), PRIMARY KEY(id));\nCREATE TABLE params(id int, source int, value int);\n\nwhere params.source is a foreign key to source.id\nINSERT INTO source values(1, 'yes');\nINSERT INTO source values(2, 'no');\n\nI...
I have an application installed on my computer. How do I find out if it was compiled in DEBUG mode or not? I've tried to use .NET Reflector, but it does not show anything specific. Here is what I see: // Assembly APPLICATION_NAME, Version 8.0.0.15072 Location: C:\APPLICATION_FOLDER\APPLICATION_NAME.exe Name: APPLICATIO...
To determine whether a .NET application was compiled in DEBUG mode, you can look for certain indicators in the assembly metadata or use specific tools to inspect the binary. Here are some methods you can try: 1. **Check the Assembly Metadata**: - Use tools like **ILSpy**, **dotPeek**, or even **Visual Studio** its...
18,456
[ { "from": "human", "value": "I have an application installed on my computer. How do I find out if it was compiled in DEBUG mode or not?\nI've tried to use .NET Reflector, but it does not show anything specific. Here is what I see:\n// Assembly APPLICATION_NAME, Version 8.0.0.15072\nLocation: C:\\APPLICATION...
I've been trying this a few different ways, but I'm reaching the conclusion that it can't be done. It's a language feature I've enjoyed from other languages in the past. Is it just something I should just write off?
It sounds like you're trying to achieve a specific language feature that isn't available in the language you're currently working with. Depending on what the feature is, it might be worth considering a few alternatives: 1. **Look for Workarounds:** Sometimes, while a feature may not be directly supported, there may be...
21,831
[ { "from": "human", "value": "I've been trying this a few different ways, but I'm reaching the conclusion that it can't be done. It's a language feature I've enjoyed from other languages in the past. Is it just something I should just write off?\n" }, { "from": "gpt", "value": "It sounds like you...
When using an aggregate control in some reports you would prefer to see a blank field instead of 0. There does not appear to be a way to do this automatically. Does anyone have a way that this can be done. Note, you want to maintain the '0' value for the field in cases when you export, but you want to show a blank w...
To achieve displaying a blank field instead of a `0` in your reports while keeping the `0` value intact for exports, you can use conditional formatting or expressions in your reporting tool. Here's a general approach you can use, depending on the specific reporting tool you are utilizing (e.g., Microsoft SSRS, Crystal ...
19,909
[ { "from": "human", "value": "When using an aggregate control in some reports you would prefer to see a blank field instead of 0. There does not appear to be a way to do this automatically. Does anyone have a way that this can be done. Note, you want to maintain the '0' value for the field in cases when y...
How do you compare two instances of structs for equality in standard C?
In standard C, there is no built-in operator to directly compare two instances of structs for equality. However, you can achieve this by writing a custom function that compares each corresponding member of the structs. Here’s a simple example to illustrate how to compare two structs for equality. Let's assume we have ...
20,920
[ { "from": "human", "value": "How do you compare two instances of structs for equality in standard C?\n" }, { "from": "gpt", "value": "In standard C, there is no built-in operator to directly compare two instances of structs for equality. However, you can achieve this by writing a custom function...
Our git server will be local, but we want an server where our local repo is also kept online but only used in a push to fashion. How can one do that?
To set up a Git server that maintains a local repository while also having an online backup (or mirror) of your repository that is only updated via pushes, you can follow these steps: ### Step 1: Set Up Your Local Git Repository 1. **Create a Local Repository**: If you haven't already, create a local Git repository...
12,381
[ { "from": "human", "value": "Our git server will be local, but we want an server where our local repo is also kept online but only used in a push to fashion.\nHow can one do that?\n" }, { "from": "gpt", "value": "To set up a Git server that maintains a local repository while also having an onlin...
In mysql, how do I get the primary key used for an insert operation, when it is autoincrementing. Basically, i want the new autoincremented value to be returned when the statement completes. Thanks!
In MySQL, when you perform an `INSERT` operation on a table with an auto-increment primary key, you can retrieve the last inserted ID using the `LAST_INSERT_ID()` function. This function returns the last automatically generated `AUTO_INCREMENT` value that was inserted into a table. Here's an example of how to do this:...
18,569
[ { "from": "human", "value": "In mysql, how do I get the primary key used for an insert operation, when it is autoincrementing.\nBasically, i want the new autoincremented value to be returned when the statement completes.\nThanks!\n" }, { "from": "gpt", "value": "In MySQL, when you perform an `IN...
What is the best way to handle large numeric inputs in C++ (for example 10^100)? For algorithms I usually switch over to ruby and I sometimes use strings. Any other good methods?
Handling large numeric inputs in C++ can be a challenge, especially when the numbers exceed the range of built-in data types like `int`, `long`, or even `long long`. For numbers as large as \(10^{100}\), you have a few options: ### 1. **Using `std::string` to Represent Big Numbers** This is a common approach, where yo...
18,306
[ { "from": "human", "value": "What is the best way to handle large numeric inputs in C++ (for example 10^100)? \nFor algorithms I usually switch over to ruby and I sometimes use strings.\nAny other good methods?\n" }, { "from": "gpt", "value": "Handling large numeric inputs in C++ can be a challe...
This is a for a Silverlight project that isn't anchored to an .aspx file, so right clicking, etc. is a bit out of the question. Any ideas? Edit: Add an .html file, then click it. Really dumb. Last time I ask a question at three in the morning.
It sounds like you're working on a Silverlight project that isn't set up in a traditional web application format, which can make some tasks a bit trickier. Since you're not using an .aspx file, but want to add an HTML file to run your Silverlight application, here's a simple way to do it: 1. **Create an HTML File**: ...
20,913
[ { "from": "human", "value": "This is a for a Silverlight project that isn't anchored to an .aspx file, so right clicking, etc. is a bit out of the question. Any ideas?\nEdit: \nAdd an .html file, then click it. Really dumb. Last time I ask a question at three in the morning.\n" }, { "from": "gpt", ...
Is there a more efficient way to convert an HTMLCollection to an Array, other than iterating through the contents of said collection and manually pushing each item into an array?
Yes, there are more efficient and concise ways to convert an `HTMLCollection` to an array without having to iterate and manually push each item. Here are a few methods you can use: ### 1. Using `Array.from()` `Array.from()` is a built-in method in JavaScript that can convert array-like objects (such as `HTMLCollectio...
21,703
[ { "from": "human", "value": "Is there a more efficient way to convert an HTMLCollection to an Array, other than iterating through the contents of said collection and manually pushing each item into an array?\n" }, { "from": "gpt", "value": "Yes, there are more efficient and concise ways to conve...
I have a series of datetime objects and would like to calculate the average delta between them. For example, if the input was (2008-10-01 12:15:00, 2008-10-01 12:25:00, 2008-10-01 12:35:00), then the average delta would be exactly 00:10:00, or 10 minutes. Any suggestions on how to calculate this using Python?
Certainly! You can calculate the average delta between a series of `datetime` objects in Python using the `datetime` module. The basic steps are to compute the differences (deltas) between consecutive datetime objects and then calculate the average of those deltas. Here's how you can do it: ```python from datetime im...
21,555
[ { "from": "human", "value": "I have a series of datetime objects and would like to calculate the average delta between them.\nFor example, if the input was (2008-10-01 12:15:00, 2008-10-01 12:25:00, 2008-10-01 12:35:00), then the average delta would be exactly 00:10:00, or 10 minutes.\nAny suggestions on ho...
Well, this is my first post here and really enjoying the site. I have a very basic (ugly as sin) site I have started and for some reason, I can not get the CSS Sticky footer to work for FireFox. IE works but FF shows it halfway up the page. The URL is http://dev.aipoker.co.uk I know I should be developing in FF and bu...
I’d be happy to help you with your sticky footer issue in Firefox! Sticky footers can sometimes be tricky due to differences in how browsers handle CSS. To assist you, I'll provide a basic example of how to implement a sticky footer that works consistently across all browsers, including Firefox. Here’s a simple struct...
18,302
[ { "from": "human", "value": "Well, this is my first post here and really enjoying the site.\nI have a very basic (ugly as sin) site I have started and for some reason, I can not get the CSS Sticky footer to work for FireFox. IE works but FF shows it halfway up the page.\nThe URL is http://dev.aipoker.co.uk...
I'm wondering whether anyone here has ever used a skip list. It looks to have roughly the same advantages as a balanced binary tree but is simpler to implement. If you have, did you write your own, or use a pre-written library (and if so, what was its name)?
Yes, skip lists are a fascinating data structure that provides efficient probabilistic performance for search, insertion, and deletion operations, much like balanced binary trees. They are indeed simpler to implement in certain aspects compared to self-balancing trees like AVL trees or Red-Black trees. Many people who...
23,804
[ { "from": "human", "value": "I'm wondering whether anyone here has ever used a skip list. It looks to have roughly the same advantages as a balanced binary tree but is simpler to implement. If you have, did you write your own, or use a pre-written library (and if so, what was its name)?\n" }, { "fro...
What are the patterns you use to determine the frequent queries? How do you select the optimization factors? What are the types of changes one can make?
To determine frequent queries and optimize query performance, various patterns and techniques can be employed. Here’s a structured overview of how these elements are approached: ### 1. Patterns for Determining Frequent Queries - **Log Analysis**: Examine database query logs to identify which queries are executed most...
19,594
[ { "from": "human", "value": "\nWhat are the patterns you use to determine the frequent queries? \nHow do you select the optimization factors?\nWhat are the types of changes one can make?\n\n" }, { "from": "gpt", "value": "To determine frequent queries and optimize query performance, various p...
I typically use URL rewriting to pass content IDs to my website, so this Foo.1.aspx rewrites to Foo.aspx?id=1 For a specific application I need to pass in multiple IDs to a single page, so I've rewritten things to accept this: Foo.1,2,3,4,5.aspx This works fine in Cassini (the built-in ad hoc web server for Visu...
The issue you're experiencing with using commas in your URL rewrites on IIS is likely related to how IIS interprets the URL and handles request filtering. By default, IIS has restrictions on certain characters in URLs, and commas can be problematic because they may be treated differently by various components of IIS (s...
22,548
[ { "from": "human", "value": "I typically use URL rewriting to pass content IDs to my website, so this\n Foo.1.aspx \n\nrewrites to\n Foo.aspx?id=1\n\nFor a specific application I need to pass in multiple IDs to a single page, so I've rewritten things to accept this:\n Foo.1,2,3,4,5.aspx\n\nThis works fine i...
Why can't I pass the table name to a prepared PDO statement? $stmt = $dbh->prepare('SELECT * FROM :table WHERE 1'); if ($stmt->execute(array(':table' => 'users'))) { var_dump($stmt->fetchAll()); } Is there another safe way to insert a table name into a SQL query? With safe, I mean that I don't want to do $sql = "S...
In PDO, you cannot bind table names or column names as parameters in a prepared statement. Prepared statements are primarily designed to safely bind values (like user inputs), which helps to protect against SQL injection. However, SQL syntax itself (like table names, column names, etc.) cannot be parameterized in this ...
21,479
[ { "from": "human", "value": "Why can't I pass the table name to a prepared PDO statement?\n$stmt = $dbh->prepare('SELECT * FROM :table WHERE 1');\nif ($stmt->execute(array(':table' => 'users'))) {\n var_dump($stmt->fetchAll());\n}\n\nIs there another safe way to insert a table name into a SQL query? With...
I would like something that I can use as follows var msg = new NonStaticMessageBox(); if(msg.Show("MyMessage", "MyCaption", MessageBoxButtons.OkCancel) == DialogResult.Ok) {....} But specifically non-static (I need to pass a reference to it around) does anyone know if/where such an object exists?
If you need a non-static message box in C#, you can create a custom class that wraps around the standard `MessageBox` functionality. Below is an example implementation that allows you to create an instance of a message box class, and it can be passed around as a reference. ### Example Implementation ```csharp using S...
20,928
[ { "from": "human", "value": "I would like something that I can use as follows\nvar msg = new NonStaticMessageBox();\nif(msg.Show(\"MyMessage\", \"MyCaption\", MessageBoxButtons.OkCancel) == DialogResult.Ok)\n {....}\n\nBut specifically non-static (I need to pass a reference to it around) does anyone know if...
Lately I've been taking a look at Haxe, to build an application to be deployed to Apache running PHP. Well, while it looks like it might suit my needs (deploying to PHP, but not using an awful language), I haven't found anything to make the actual application development easier than building a traditional non-MVC PHP a...
If you're looking to use Haxe to build an application that deploys to PHP while still taking advantage of MVC patterns and modern development practices, there are a few frameworks and libraries that you might find beneficial: 1. **HaxePunk**: While primarily a game development framework, HaxePunk can also be adapted f...
18,195
[ { "from": "human", "value": "Lately I've been taking a look at Haxe, to build an application to be deployed to Apache running PHP. Well, while it looks like it might suit my needs (deploying to PHP, but not using an awful language), I haven't found anything to make the actual application development easier ...
Are there any tools for just browsing SQL Server? I ask because sometimes SSMS is a little heavy weight when I just want to look through the database and find one record, and SQLCMD doesn't really seem like a good choice when browsing through a lot of different records or a lot of large records.
Yes, there are several lightweight tools you can use to browse SQL Server databases without the overhead of SQL Server Management Studio (SSMS). Here are a few options: 1. **Azure Data Studio**: - Azure Data Studio is a cross-platform database tool that is lightweight compared to SSMS. It has an intuitive user inte...
21,217
[ { "from": "human", "value": "Are there any tools for just browsing SQL Server? I ask because sometimes SSMS is a little heavy weight when I just want to look through the database and find one record, and SQLCMD doesn't really seem like a good choice when browsing through a lot of different records or a lot...
Do you suggest Mapstraction (library) as a layer to access Google maps? Is it an actively maintained project? Do I stand to again/ lose anything by using this library apart from the primary reason that its provider independent?
Mapstraction is a JavaScript library designed to provide a layer of abstraction over various mapping APIs, including Google Maps, OpenStreetMap, and others. Here are some points to consider when deciding whether to use Mapstraction: ### Pros: 1. **Provider Independence**: As you mentioned, one of the primary benefits ...
20,911
[ { "from": "human", "value": "Do you suggest Mapstraction (library) as a layer to access Google maps? \nIs it an actively maintained project? Do I stand to again/ lose anything by using this library apart from the primary reason that its provider independent?\n" }, { "from": "gpt", "value": "Ma...
Why are 'out' parameters in .NET a bad idea? I was recently asked this, but I had no real answer besides it's simply unnecessarily complicating an application. What other reasons are there?
Using `out` parameters in .NET has been a topic of debate among developers. While there are valid use cases for `out` parameters, there are several reasons why they are often viewed as a bad practice. Here are some key arguments against using `out` parameters: 1. **Increased Complexity**: Methods with `out` parameters...
15,092
[ { "from": "human", "value": "Why are 'out' parameters in .NET a bad idea?\nI was recently asked this, but I had no real answer besides it's simply unnecessarily complicating an application. What other reasons are there?\n" }, { "from": "gpt", "value": "Using `out` parameters in .NET has been a t...
I'm doing a little app that I want to distribute in different platforms, at least the 3 major ones. Is it possible to use only Windows has the host OS to compile the binaries for Linux, Mac OS X and other supported platforms without resorting to virtual machines? Or should I ask around in some community to help me comp...
Compiling binaries for multiple platforms from a single host OS can be challenging, but there are some strategies you can consider. Here's a breakdown of your options for compiling applications for different platforms: ### 1. **Cross-Compiling** You can set up a cross-compilation environment on Windows to build binari...
20,084
[ { "from": "human", "value": "I'm doing a little app that I want to distribute in different platforms, at least the 3 major ones.\nIs it possible to use only Windows has the host OS to compile the binaries for Linux, Mac OS X and other supported platforms without resorting to virtual machines?\nOr should I a...
What is the best way to format a decimal if I only want decimal displayed if it is not an integer. Eg: decimal amount = 1000M decimal vat = 12.50M When formatted I want: Amount: 1000 (not 1000.0000) Vat: 12.5 (not 12.50)
To format a decimal so that it only shows the decimal point when necessary (i.e., when it is not an integer), you can use conditional formatting or custom formatting depending on your programming environment. If you are using C# for example, you can achieve this using the `ToString()` method with a custom format. Here...
21,644
[ { "from": "human", "value": "What is the best way to format a decimal if I only want decimal displayed if it is not an integer.\nEg:\ndecimal amount = 1000M\ndecimal vat = 12.50M\n\nWhen formatted I want:\nAmount: 1000 (not 1000.0000)\nVat: 12.5 (not 12.50)\n\n" }, { "from": "gpt", "value": "To ...
Is there a way to generate random number on Windows by reading from a file or pseudo file or character special file, the way that can be done on Linux by reading from /dev/random? Not asking about various crypto API, but whether there is in Windows something akin to the Linux way.
In Windows, there isn't a direct equivalent to `/dev/random` or `/dev/urandom` as found in Linux. However, there are a few alternatives you can consider to generate random numbers by reading from special files or using similar mechanisms: 1. **Cryptography API (CAPI) / Cryptography API: Next Generation (CNG)**: While ...
21,531
[ { "from": "human", "value": "Is there a way to generate random number on Windows by reading from a file or pseudo file or character special file, the way that can be done on Linux by reading from /dev/random? Not asking about various crypto API, but whether there is in Windows something akin to the Linux wa...
Given the following canvas: <Canvas> <Canvas.LayoutTransform> <ScaleTransform ScaleX="1" ScaleY="1" CenterX=".5" CenterY=".5" /> </Canvas.LayoutTransform> <Button x:Name="scaleButton" Content="Scale Me" Canvas.Top="10" Canvas.Left="10" /> <Button x:Name="dontScaleButton" Content="DON'T Scale Me"...
Yes, it is possible to scale one button while leaving the other button unaffected by the scaling changes in the WPF (Windows Presentation Foundation) framework. However, the approach is a bit different from applying the `ScaleTransform` directly to the `Canvas`. Instead of applying the `ScaleTransform` to the `Canvas`...
20,999
[ { "from": "human", "value": "Given the following canvas:\n<Canvas>\n <Canvas.LayoutTransform>\n <ScaleTransform ScaleX=\"1\" ScaleY=\"1\" CenterX=\".5\" CenterY=\".5\" />\n </Canvas.LayoutTransform>\n <Button x:Name=\"scaleButton\" Content=\"Scale Me\" Canvas.Top=\"10\" Canvas.Left=\"10\" />...
What are the best JVM settings you have found for running Eclipse?
The best JVM settings for running Eclipse can vary based on your specific hardware, operating system, and the size of the projects you're working on. However, here are some general recommendations that can help improve Eclipse's performance: ### 1. **Memory Settings** Adjust the memory allocation settings in the `ecli...
18,387
[ { "from": "human", "value": "What are the best JVM settings you have found for running Eclipse?\n" }, { "from": "gpt", "value": "The best JVM settings for running Eclipse can vary based on your specific hardware, operating system, and the size of the projects you're working on. However, here are...
So, I can create an input button with an image using <INPUT type="image" src="/images/Btn.PNG" value=""> But, I can't get the same behavior using CSS. For instance, I've tried <INPUT type="image" class="myButton" value=""> where "myButton" is defined in the CSS file as .myButton { background:url(/images/Btn.PNG) ...
To achieve the effect of using a CSS-styled button with an image, along with hover effects, you cannot directly use the `<input type="image">` element in the way you are trying to with CSS styling. Instead, you can use a regular button or a `<div>` styled to look like a button. Here’s how you can do it using a `<button...
20,242
[ { "from": "human", "value": "So, I can create an input button with an image using\n<INPUT type=\"image\" src=\"/images/Btn.PNG\" value=\"\">\n\nBut, I can't get the same behavior using CSS. For instance, I've tried\n<INPUT type=\"image\" class=\"myButton\" value=\"\">\n\nwhere \"myButton\" is defined in the...
I have a VB.net control that has an event: Public Event PassNames(ByVal names() as String) When the event triggered in VB6, I get the following error: "Function or interface marked as restriced, or the function uses an Automation type not supported in Visual Basic" Here is the event in VB6: Private Sub IteropControl1...
In VB6, handling arrays passed from a .NET control (like a UserControl) can be tricky due to how VB6 and .NET handle arrays and types differently. The error you're encountering typically occurs because VB6 does not directly support certain .NET types, such as arrays that are passed directly as parameters in events. ##...
21,265
[ { "from": "human", "value": "I have a VB.net control that has an event: \nPublic Event PassNames(ByVal names() as String)\n\nWhen the event triggered in VB6, I get the following error:\n\"Function or interface marked as restriced, or the function uses an Automation type not supported in Visual Basic\"\nHere...