instruction
stringlengths
14
27.6k
completion
stringlengths
3
38.3k
__original_row_idx
int64
0
50k
conversations
listlengths
2
2
I'm migrating to Nhibernate 2.0 GA but have some trouble with setting cache expirations in memcached provider. I see in the NHibernate.Caches.MemCache sources that there is a property for expiration and a default value for 300 seconds. There are also properties for cache regions but the config section handler does not...
In NHibernate, when you're using the Memcached provider, cache expiration settings are typically defined at the cache region level, which allows for granular control over how long items are cached. In the case of the NHibernate.Caches.MemCache provider, you're correct that there is a default expiration time that can be...
43,265
[ { "from": "human", "value": "I'm migrating to Nhibernate 2.0 GA but have some trouble with setting cache expirations in memcached provider.\nI see in the NHibernate.Caches.MemCache sources that there is a property for expiration and a default value for 300 seconds. \nThere are also properties for cache regi...
I have a simple Linq to SQL query that is pulling data with a where clause by a string. The result query doesn't put quotes around the string. Example string name = "John"; var query = from n in db.Names where n.Name == name select n; the result is .... WHERE ([t0].[Name] = John) .... Network is a varchar(10) and TN...
The behavior you're observing, where the query sometimes results in a string without quotes in the generated SQL, is likely related to the specifics of how LINQ to SQL translates your query into SQL. Here are a few insights and suggestions to help clarify and potentially resolve the issue: 1. **Data Type Consistency**...
43,308
[ { "from": "human", "value": "I have a simple Linq to SQL query that is pulling data with a where clause by a string. The result query doesn't put quotes around the string.\nExample\n\nstring name = \"John\";\nvar query = from n in db.Names where n.Name == name select n;\n\nthe result is\n.... WHERE ([t0].[...
Our solution has a lot of todo comments, but unfortunately it seems the only way to sort them is by file. Sorting by project would give me a much better overview of what I'm actually responsible for. Just wondering if there's any way to do this or any add-ins that provide better functionality.
Managing TODO comments effectively is crucial for maintaining clarity in your projects. While built-in capabilities for sorting TODO comments can vary by IDE or code editor, there are several strategies and tools you can use to get a better overview of your TODOs by project. ### 1. Use an IDE with Enhanced TODO Manage...
42,881
[ { "from": "human", "value": "Our solution has a lot of todo comments, but unfortunately it seems the only way to sort them is by file. Sorting by project would give me a much better overview of what I'm actually responsible for. Just wondering if there's any way to do this or any add-ins that provide better...
I'd like to use visitor IP addresses into a company name. This will be used for displaying something like "Hello visitor from Apple Inc." . Note I am looking for the company name, not the domain name. Extra points for determining the originating country. The app is written in Ruby on Rails, but examples in other langua...
To obtain the company name from an IP address in your Ruby on Rails application, you can use a geolocation and IP-to-company mapping service. Below is a step-by-step guide, including examples: ### Step 1: Choose an IP Geolocation API There are several APIs you can use to retrieve the organization name from an IP addr...
41,676
[ { "from": "human", "value": "I'd like to use visitor IP addresses into a company name. This will be used for displaying something like \"Hello visitor from Apple Inc.\" . Note I am looking for the company name, not the domain name. Extra points for determining the originating country. The app is written in ...
I use remote desktop quite a bit and I've noticed that on one of my machines when another user is already logged in it prompts them to allow me to log in, even for users with less privileges; however, with another computer, there is no prompt, it just proceeds with the remote logoff even for users with the same privile...
The behavior you're describing regarding Remote Desktop connections on your Windows XP Professional SP3 machines is likely influenced by the group policy settings or local security settings on each computer. Here are a few things you can check and adjust to control how Remote Desktop handles user logins: ### 1. **Remo...
43,358
[ { "from": "human", "value": "I use remote desktop quite a bit and I've noticed that on one of my machines when another user is already logged in it prompts them to allow me to log in, even for users with less privileges; however, with another computer, there is no prompt, it just proceeds with the remote lo...
I want to provide some RSS feed(s) for my site. Is it worth providing Atom feeds? or is Atom the more common feed? Is there a winner? BTW, this relates to programming because I'm required to program the feed which we will provide (or use some open source code, etc). Update So far it looks like peeps are saying Atom sho...
When it comes to providing feed options for your site, both RSS and Atom have their own advantages and limitations, and the choice between them can depend on several factors. ### Overview of RSS and Atom 1. **RSS**: The most widely used version of RSS is 2.0, which has gained significant adoption. RSS is simple and st...
44,330
[ { "from": "human", "value": "I want to provide some RSS feed(s) for my site. Is it worth providing Atom feeds? or is Atom the more common feed? Is there a winner?\nBTW, this relates to programming because I'm required to program the feed which we will provide (or use some open source code, etc).\nUpdate\nSo...
I would like to have alternate behavior during a print stylesheet on a web page. Something along the lines of: If this page is being printed, don't bother calling SWFObject to summon an .swf into existence. Just leave the HTML that the Flash will replace. I've tried things like setting a known element to a kn...
Detecting which stylesheet is currently in effect (screen vs. print) can be tricky, but you can achieve the desired behavior using JavaScript in combination with media queries. ### Approach 1. **Use Media Queries**: You can use CSS media queries to define styles specifically for print. This way, you can hide or show ...
41,838
[ { "from": "human", "value": "I would like to have alternate behavior during a print stylesheet on a web page. Something along the lines of:\n\nIf this page is being printed, don't\n bother calling SWFObject to summon an\n .swf into existence. Just leave the\n HTML that the Flash will replace.\n\nI've t...
I'm trying to wire-up LinqToSql to be my data access layer and running into a few issues, probably due to my lack of experience with LinqToSql. I have two tables, one called Project and one called Employee. The Project has fields for OpenedBy and ClosedBy which are foreign key references to the Employee table, which h...
Certainly! To achieve your goal of retrieving the `EmployeeName` for `OpenedBy` and `ClosedBy` in a LINQ to SQL context, you can set up your data model with navigation properties. This allows you to easily access related data when querying your `Project` table. Here's how you can set up your data classes and perform t...
38,957
[ { "from": "human", "value": "I'm trying to wire-up LinqToSql to be my data access layer and running into a few issues, probably due to my lack of experience with LinqToSql.\nI have two tables, one called Project and one called Employee. The Project has fields for OpenedBy and ClosedBy which are foreign key...
Basically I have a small template that looks like: <xsl:template name="templt"> <xsl:param name="filter" /> <xsl:variable name="numOrders" select="count(ORDERS/ORDER[$filter])" /> </xsl:template> And I'm trying to call it using <xsl:call-template name="templt"> <xsl:with-param name="filter" select="PRICE &...
In XSLT, expressions used in `<xsl:with-param>` are evaluated at the time of the call, which is why you are encountering the issue. In your case, you want to pass a dynamic filter expression to the template, but XSLT doesn't support passing expressions like that directly as parameters. Instead, you can modify your tem...
43,122
[ { "from": "human", "value": "Basically I have a small template that looks like:\n<xsl:template name=\"templt\">\n <xsl:param name=\"filter\" />\n <xsl:variable name=\"numOrders\" select=\"count(ORDERS/ORDER[$filter])\" />\n</xsl:template>\n\nAnd I'm trying to call it using\n<xsl:call-template name=\"t...
I'm using .NET 3.5, trying to recursively delete a directory using: Directory.Delete(myPath, true); My understanding is that this should throw if files are in use or there is a permissions problem, but otherwise it should delete the directory and all of its contents. However, I occasionally get this: System.IO.IOExcep...
The `System.IO.IOException: The directory is not empty` error message you're encountering when attempting to delete a directory recursively using `Directory.Delete(myPath, true);` in .NET 3.5 is somewhat misleading, especially since you've set the `recursive` parameter to `true`. Here are a few reasons why you might en...
41,933
[ { "from": "human", "value": "I'm using .NET 3.5, trying to recursively delete a directory using:\nDirectory.Delete(myPath, true);\n\nMy understanding is that this should throw if files are in use or there is a permissions problem, but otherwise it should delete the directory and all of its contents.\nHoweve...
I have designed one web page in asp.net. In that i have used the css file and excel generation button. While i am cliking the button for populating the data from database to excel. It is showing the problem in uploading the css file like that .What will i do the for removing the that error. For opening the excel sheet ...
The code snippet you provided for generating an Excel file in ASP.NET appears to be functionally correct in terms of setting the response type and header for file download. However, if you are experiencing issues with CSS not loading properly when generating or downloading the Excel file, it is likely related to how th...
42,789
[ { "from": "human", "value": "I have designed one web page in asp.net. In that i have used the css file and excel generation button. While i am cliking the button for populating the data from database to excel. It is showing the problem in uploading the css file like that .What will i do the for removing the...
Javascript client side application. Trying to eliminate memory leaks leads to ugly (to say the least) code. I am trying to clean up in window.unload instead on messing up all the code trying to avoid them. We use mostly element.onevent=function(){..}; pattern, that results in closure (mostly wanted) and memory leak. We...
Memory leaks in JavaScript, especially in client-side applications, can be challenging, particularly when using event listeners and closures. Relying on the `window.unload` event for cleanup is a valid approach, but it's important to note that the `unload` event is deprecated in modern browsers and can be unreliable fo...
43,623
[ { "from": "human", "value": "Javascript client side application.\nTrying to eliminate memory leaks leads to ugly (to say the least) code.\nI am trying to clean up in window.unload instead on messing up all the code trying to avoid them.\nWe use mostly element.onevent=function(){..}; pattern, that results in...
I've implemeneted customised single select combo box as a cell element in dojo grid. Can someone tell me how to implement multi select conbo box?
To implement a multi-select combo box as a cell element in a Dojo grid, you would generally need to customize the grid's cell editor to accommodate multiple selections. Here's a basic outline of how you might achieve this: ### Step 1: Create a Multi-Select Combo Box You can use a Dojo `dijit/form/MultiSelect` widget ...
42,354
[ { "from": "human", "value": "I've implemeneted customised single select combo box as a cell element in dojo grid. Can someone tell me how to implement multi select conbo box?\n" }, { "from": "gpt", "value": "To implement a multi-select combo box as a cell element in a Dojo grid, you would genera...
At work, I running Vista Business on a lavishly new PC, which runs great excepting two issues. In order of annoyance, but not importance: When I reboot the machine, the Windows Splash is presented asking me to Press Ctrl + ALT + DELETE so I can logon. It takes three to five minutes and seceral key presses for me to ...
It sounds like you're dealing with two separate but frustrating issues. Let’s address each of them one by one. ### 1. Slow Logon on Windows Vista Business The long delay at the logon screen can be caused by several factors. Here are a few potential solutions to troubleshoot and improve the logon time: - **Check Start...
43,841
[ { "from": "human", "value": "At work, I running Vista Business on a lavishly new PC, which runs great excepting two issues. In order of annoyance, but not importance:\n\nWhen I reboot the machine, the Windows Splash is presented asking me to Press Ctrl + ALT + DELETE so I can logon. It takes three to five...
I want to write Html format, but I can not even get a simple MSDN example of it to work. http://msdn.microsoft.com/en-us/library/tbfb3z56.aspx Does this console app, a clipboard round tripper, work for anyone? using System; using System.Windows; //Need to add a PresentationCore or System.Windows.Forms reference class...
It looks like you're attempting to create a console application in C# that interacts with the clipboard, specifically trying to copy HTML content. However, the provided example code has a few points that may lead to issues, especially if you're running it in a console application context. Here's how you can get it to w...
42,868
[ { "from": "human", "value": "I want to write Html format, but I can not even get a simple MSDN example of it to work.\nhttp://msdn.microsoft.com/en-us/library/tbfb3z56.aspx\nDoes this console app, a clipboard round tripper, work for anyone?\n\nusing System;\nusing System.Windows; //Need to add a Presentatio...
Joel often talks about using MS Excel for lightweight project management, but I'm curious about actual implementations of this idea. I've seen some templates that seem to clone MS Project via macros, which would be overkill for a lightweight project. Anyone have any useful templates?
Absolutely, using MS Excel for lightweight project management can be an effective approach for small teams or simple projects. While there are some advanced templates that aim to mimic MS Project, many lightweight solutions focus on clarity and ease of use. Here are a few useful implementations and templates you might ...
43,317
[ { "from": "human", "value": "Joel often talks about using MS Excel for lightweight project management, but I'm curious about actual implementations of this idea. I've seen some templates that seem to clone MS Project via macros, which would be overkill for a lightweight project. Anyone have any useful templ...
Is it possible to emulate a device sleeping and waking using the Microsoft-supplied device emulators?
Yes, it is possible to emulate device sleep and wake functionality using the Microsoft-supplied device emulators, such as those provided in the Windows Device Portal for Windows IoT or the Visual Studio Device Emulator for mobile apps. To emulate a device sleeping and waking: 1. **Device Emulator**: If you are using ...
44,931
[ { "from": "human", "value": "Is it possible to emulate a device sleeping and waking using the Microsoft-supplied device emulators?\n" }, { "from": "gpt", "value": "Yes, it is possible to emulate device sleep and wake functionality using the Microsoft-supplied device emulators, such as those prov...
I'm trying to finish a little module from a reporting app using external dlls. I'm putting the files into the bin folder but when I deploy the app with ClickOnce, and the install finishes, I see that all external dlls are missing. For example, the Microsoft.SqlServer.Types version 10.0.0.0 is missing. Is there a way to...
When deploying a ClickOnce application, external assemblies that are required by your application must be included in the ClickOnce deployment package. ClickOnce does not automatically install assemblies in the Global Assembly Cache (GAC) by default. However, there are a few methods to ensure that the required assembli...
41,984
[ { "from": "human", "value": "I'm trying to finish a little module from a reporting app using external dlls. I'm putting the files into the bin folder but when I deploy the app with ClickOnce, and the install finishes, I see that all external dlls are missing. For example, the Microsoft.SqlServer.Types versi...
This is mostly a theoretical question I'm just very curious about. (I'm not trying to do this by coding it myself or anything, I'm not reinventing wheels.) My question is how the uppercase/lowercase table of equivalence works for Unicode. For example, if I had to do this in ASCII, I'd take a character, and if it falls ...
Your questions touch on several interesting aspects of Unicode processing, especially with regard to case folding and accent sensitivity. Here’s a detailed explanation of how these concepts generally work, along with how operating systems and databases handle them. ### 1. Unicode Case Folding In Unicode, the concept ...
43,485
[ { "from": "human", "value": "This is mostly a theoretical question I'm just very curious about. (I'm not trying to do this by coding it myself or anything, I'm not reinventing wheels.)\nMy question is how the uppercase/lowercase table of equivalence works for Unicode.\nFor example, if I had to do this in AS...
A colleague is looking to generate UML class diagrams from heaps of Python source code. He's primarily interested in the inheritance relationships, and mildly interested in compositional relationships, and doesn't care much about class attributes that are just Python primitives. The source code is pretty straightforwa...
For generating UML class diagrams from Python source code with a focus on inheritance and compositional relationships, there are several tools you can recommend. Given the context of the code being relatively straightforward and not heavily using advanced Python features, these tools should be effective: 1. **Pyrevers...
42,960
[ { "from": "human", "value": "A colleague is looking to generate UML class diagrams from heaps of Python source code. \nHe's primarily interested in the inheritance relationships, and mildly interested in compositional relationships, and doesn't care much about class attributes that are just Python primitive...
Does string immutability work by statement, or by strings within a statement? For example, I understand that the following code will allocate two strings on the heap. string s = "hello "; s += "world!"; "hello" will remain on the heap until garbage collected; and s now references "hello world!" on the heap. However, ...
In C#, string literals are interned, which means that if you create a string literal that is identical to one that already exists, it will reference the existing one instead of creating a new instance. However, the behavior can differ when you combine string literals and variables. For the line: ```csharp string s = ...
45,882
[ { "from": "human", "value": "Does string immutability work by statement, or by strings within a statement? \nFor example, I understand that the following code will allocate two strings on the heap.\nstring s = \"hello \";\ns += \"world!\";\n\n\"hello\" will remain on the heap until garbage collected; and s ...
I am considering Smarty as my web app templating solution, and I am now concerned with its performance against plain PHP. The Smarty site says it should be the same, however, I was not able to find anyone doing real benchmarking to prove the statement right or wrong. Did anyone do some benchmarking of Smarty vs plain ...
When it comes to comparing the performance of Smarty versus plain PHP, there are a few points to consider. While Smarty is a powerful templating engine that offers features such as caching, template inheritance, and separation of logic from presentation, it may introduce some overhead compared to raw PHP due to the add...
45,214
[ { "from": "human", "value": "I am considering Smarty as my web app templating solution, and I am now concerned with its performance against plain PHP. \nThe Smarty site says it should be the same, however, I was not able to find anyone doing real benchmarking to prove the statement right or wrong.\nDid anyo...
I want to model a heart shape in 3D with as little code needed as possible and without using external model files. In 2D, I can use some Bézier curves to draw a heart shape, and I could extrude this to get a simple 3D heart shape, but this doesn't look like the shape I want. The bottom of the heart should be a peak, th...
Certainly! You can create a heart shape in 3D using parametric equations that define the heart's surface. One of the simplest ways to achieve this is using a parametric representation of a heart shape. The following equations can be used to define a heart shape in 3D. You can use a programming environment like Python ...
38,357
[ { "from": "human", "value": "I want to model a heart shape in 3D with as little code needed as possible and without using external model files.\nIn 2D, I can use some Bézier curves to draw a heart shape, and I could extrude this to get a simple 3D heart shape, but this doesn't look like the shape I want. Th...
I really don't know how to describe it, but if you understood it and had experience on that field, may be you can help me with something 'Open Source' and 'Ready-made'. I want to create something like a box 'or widget', where you can change its content by hitting some buttons on the top of the box. (Hey the box is on a...
It sounds like you're looking to create an interactive widget that updates its content based on user input, using JavaScript and AJAX. This is a common requirement in web development, and while there are many frameworks and libraries that can help, sometimes a custom solution can be more effective, especially if you ha...
39,116
[ { "from": "human", "value": "I really don't know how to describe it, but if you understood it and had experience on that field, may be you can help me with something 'Open Source' and 'Ready-made'.\nI want to create something like a box 'or widget', where you can change its content by hitting some buttons o...
I am developping in C#. I need to capture a password written inside a Text Box, but would like to not show the password that is being typed, showing instead **** or any other character to hide the password. How can I do that? I'm sure it's by modifying an attribute, but can't find which one.
In C#, when working with WinForms or WPF applications, you can easily hide the characters being typed into a TextBox by setting the appropriate properties. ### WinForms If you are using a WinForms application, you can set the `UseSystemPasswordChar` property of the `TextBox` to `true` or set the `PasswordChar` propert...
44,531
[ { "from": "human", "value": "I am developping in C#.\nI need to capture a password written inside a Text Box, but would like to not show the password that is being typed, showing instead **** or any other character to hide the password.\nHow can I do that? I'm sure it's by modifying an attribute, but can't ...
I have a stored procedure that returns values from a temp table. In my DBML, it displays (None) for the return type. What is the trick to get it to recognize the columns from my temp table? CREATE PROCEDURE [dbo].[GetCategoryPriceRanges] @CategoryId int AS BEGIN DECLARE @MinPrice money, @MaxPrice money SELECT ...
The issue you're encountering with your stored procedure returning `(None)` in the DBML (Database Markup Language) designer is due to the way the DBML interacts with stored procedures and temporary tables. When you create a stored procedure that uses a temporary table, the DBML tool may not recognize the schema of the ...
41,167
[ { "from": "human", "value": "I have a stored procedure that returns values from a temp table. In my DBML, it displays (None) for the return type. What is the trick to get it to recognize the columns from my temp table?\nCREATE PROCEDURE [dbo].[GetCategoryPriceRanges] \n@CategoryId int \nAS\nBEGIN\n\nDECLA...
I've been wondering this for some time. As the title say, which is faster, the actual function or simply raising to the half power? UPDATE This is not a matter of premature optimization. This is simply a question of how the underlying code actually works. What is the theory of how Python code works? I sent Guido van Ro...
When comparing the speed and efficiency of the three methods you've mentioned for calculating the square root in Python—`math.sqrt()`, `x ** 0.5`, and `pow(x, 0.5)`—it’s helpful to understand how each one operates. 1. **`math.sqrt(x)`**: This function is specifically designed to compute the square root of a number. It...
42,220
[ { "from": "human", "value": "I've been wondering this for some time. As the title say, which is faster, the actual function or simply raising to the half power?\nUPDATE\nThis is not a matter of premature optimization. This is simply a question of how the underlying code actually works. What is the theory of...
Something has gone wrong in subversion and now I am facing svnadmin: Invalid diff stream: [tgt] insn 0 starts beyond the target view position if I try to make dump from repository. We have another question about it here Subversion Repository Error, but the solutions there are not good enough for me because the corrup...
Dealing with a corrupted Subversion repository can indeed be challenging, especially when the corruption is deep in the history. Here are some thoughts on your proposed solutions, along with additional options: ### Solution 1: Dump Healthy Portion and Manually Commit Important Directories Creating a dump from the heal...
40,346
[ { "from": "human", "value": "Something has gone wrong in subversion and now I am facing \nsvnadmin: Invalid diff stream: [tgt] insn 0 starts beyond the target view position\n\nif I try to make dump from repository. We have another question about it here Subversion Repository Error, but the solutions there a...
Like: Windows Key + E Opens a new Explorer Window And: Windows Key + R Displays the Run command How can I use the Windows Key in a KeyDown event of my Application?
In a Windows Forms or WPF application, capturing the Windows Key directly in a KeyDown event can be tricky. The Windows Key is often intercepted by the operating system, which means that your application might not receive the key event at all. However, if you need to respond to combinations that include the Windows Ke...
43,966
[ { "from": "human", "value": "Like:\n Windows Key + E \nOpens a new Explorer Window\n\nAnd:\n Windows Key + R \nDisplays the Run command\n\nHow can I use the Windows Key in a KeyDown event of my Application?\n" }, { "from": "gpt", "value": "In a Windows Forms or WPF application, capturing the Win...
I'm trying to learn about trees by implementing one from scratch. In this case I'd like to do it in C# Java or C++. (without using built in methods) So each node will store a character and there will be a maximum of 26 nodes per node. What data structure would I use to contain the pointers to each of the nodes? Basica...
Implementing a radix tree (also known as a prefix tree or trie) from scratch is a great way to learn about tree structures. In a radix tree, each node can represent a single character, and typically, each node can have multiple child nodes, which is often represented using an array or a collection of pointers to the ch...
41,490
[ { "from": "human", "value": "I'm trying to learn about trees by implementing one from scratch. \nIn this case I'd like to do it in C# Java or C++. (without using built in methods)\nSo each node will store a character and there will be a maximum of 26 nodes per node.\nWhat data structure would I use to conta...
I've been told that the java class TreeMap uses an implementation of a RB tree. If this is the case, how does one do an inorder, preorder and postorder tree-walk on a TreeMap? Or is this not possible?
Yes, you are correct that `TreeMap` in Java is implemented using a Red-Black Tree (RB tree), which is a type of self-balancing binary search tree. While `TreeMap` itself does not provide direct methods for tree traversal (like inorder, preorder, or postorder), you can still achieve this by using the underlying structur...
40,488
[ { "from": "human", "value": "I've been told that the java class TreeMap uses an implementation of a RB tree. If this is the case, how does one do an inorder, preorder and postorder tree-walk on a TreeMap?\nOr is this not possible?\n" }, { "from": "gpt", "value": "Yes, you are correct that `TreeM...
I need to create an object which exposes an IDictionary<K,V> interface, but I don't want to fill in the entire interface implemntation. It would be nice to have the equivalent of Java's AbstractDictionary, which leaves you very little to impelment a complete dictionary (HashMap, in Java): If you don't need to iterate ...
In C#, you can create an abstract class that provides a partial implementation of the `IDictionary<TKey, TValue>` interface. This class will implement the most commonly used methods and properties while allowing you to override only the methods necessary for your specific dictionary implementation. Here’s an example o...
40,986
[ { "from": "human", "value": "I need to create an object which exposes an IDictionary<K,V> interface, but I don't want to fill in the entire interface implemntation.\nIt would be nice to have the equivalent of Java's AbstractDictionary, which leaves you very little to impelment a complete dictionary (HashMap...
I have defined a new dialog and its controls in an already existing resource file. I have also created a new file which will handle the events being generated from this dialog. But I am not sure how to connect these two. Is the statement enum { IDD=IDD_NEW_DIALOG }; all that is required to connect the two? Or should ...
The statement `enum { IDD = IDD_NEW_DIALOG };` is a part of the dialog class definition in MFC (Microsoft Foundation Classes) that indicates which dialog resource ID should be associated with the class. However, this statement alone is not sufficient to fully connect the dialog resource with the event handling code. ...
44,010
[ { "from": "human", "value": "I have defined a new dialog and its controls in an already existing resource file. I have also created a new file which will handle the events being generated from this dialog. But I am not sure how to connect these two. \nIs the statement enum { IDD=IDD_NEW_DIALOG }; all that i...
In answering this question (https://stackoverflow.com/questions/352317/c-coding-question#352327), it got me wondering... Is there any danger in regarding a static class as being equivalent to a non-static class instatiation that implements the singleton pattern?
When discussing the differences between a static class and a singleton pattern in object-oriented programming, there are some important considerations to keep in mind. Here’s a breakdown of the key differences and the potential dangers of treating a static class as equivalent to a singleton class: ### Static Class vs....
42,919
[ { "from": "human", "value": "In answering this question (https://stackoverflow.com/questions/352317/c-coding-question#352327), it got me wondering...\nIs there any danger in regarding a static class as being equivalent to a non-static class instatiation that implements the singleton pattern?\n" }, { ...
Tomcat documentation says: The locations for Context Descriptors are; $CATALINA_HOME/conf/[enginename]/[hostname]/context.xml $CATALINA_HOME/webapps/[webappname]/META-INF/context.xml On my server, I have at least 3 files floating around: 1 ...tomcat/conf/context.xml 2 ...tomcat/Catalina/localhost/myapp.xml 3 ...tomcat...
In Apache Tomcat, the context descriptor files are used to define configuration settings for individual web applications. The order of precedence for these context descriptor files is as follows: 1. **Application-specific context file in META-INF**: - `$CATALINA_HOME/webapps/[webappname]/META-INF/context.xml` -...
45,925
[ { "from": "human", "value": "Tomcat documentation says: \nThe locations for Context Descriptors are;\n$CATALINA_HOME/conf/[enginename]/[hostname]/context.xml\n$CATALINA_HOME/webapps/[webappname]/META-INF/context.xml\nOn my server, I have at least 3 files floating around:\n1 ...tomcat/conf/context.xml\n2 ......
First of all, sorry for my poor english. I would try to explain my problem. I am using psexec within a script to restart a cluster as follows: script1 in node1: perform a lot of tasks (shutdown services, check status, etc..) in the node1 and after completing all task launch with psexec the script2 in node2 (psexec-d ...
No problem! I'll do my best to help you with your issue regarding PsExec and the access denied error when trying to run `script3` on `node1` from `node2`. ### Here are a few steps and considerations that might help you troubleshoot the issue: 1. **Permissions**: Ensure that the user account you are using has the nece...
43,887
[ { "from": "human", "value": "First of all, sorry for my poor english. I would try to explain my problem. \nI am using psexec within a script to restart a cluster as follows: \nscript1 in node1: perform a lot of tasks (shutdown services, check status, etc..) in the node1 and after completing all task launch ...
I am trying to programmatically create an SSIS package containing a simple data flow from table A to table B in the same database. I am using the example given here. The package gets created and saved to a dtsx file, but when I open it in visual studio I see that the source and destination tables have not been selected...
When programmatically creating SSIS packages, especially when you're working with Data Flow Tasks, using the right properties and understanding the component parameters is crucial. Let's break down your questions and provide some additional guidance. ### 1. Using a Single OLE DB Connection You can indeed use a single...
43,345
[ { "from": "human", "value": "I am trying to programmatically create an SSIS package containing a simple data flow from table A to table B in the same database. I am using the example given here.\nThe package gets created and saved to a dtsx file, but when I open it in visual studio I see that the source and...
I'm trying to make a calculator that will take inputs from users and estimate for them how much money they'll save if they use various different VoIP services. I've set it up like this: <form method="get" action="voip_calculator.php"> How much is your monthly phone bill? <input name="monthlybill" type="text" val...
It sounds like you're trying to create a simple VoIP savings calculator in PHP but you're having trouble getting the user input and processing the calculations correctly. Let’s break down the steps to get your `voip_calculator.php` script working as you intend. ### Step 1: Update Your HTML Form First, the way you're ...
40,614
[ { "from": "human", "value": "I'm trying to make a calculator that will take inputs from users and estimate for them how much money they'll save if they use various different VoIP services.\nI've set it up like this:\n<form method=\"get\" action=\"voip_calculator.php\">\n How much is your monthly phone bill...
I'm generating a coupon based on dynamic input and a cropped image, and I'm displaying the coupon using ntml and css right now, the problem is, printing this has become an issue because of how backgrounds disappear when printing and other problems, so I think the best solution would be to be able to generate an image b...
Generating a static image from HTML content on an ASP.NET 3.5 C# website is a common requirement, especially when needing a reliable print layout. Since you're currently manipulating the DOM using jQuery, I understand that the solution should integrate well with your existing setup. Here are a few methods you can consi...
43,620
[ { "from": "human", "value": "I'm generating a coupon based on dynamic input and a cropped image, and I'm displaying the coupon using ntml and css right now, the problem is, printing this has become an issue because of how backgrounds disappear when printing and other problems, so I think the best solution w...
I am currently using a dotted border for certain UI stuff such as instructions, notes, error boxes, etc. But recently I changed to a solid border, due to a requirement, but I just find it kind of strange. It seems that by making it solid it puts too much emphasis on page elements which are just informational. What are ...
Your observation about the impact of a solid border versus a dotted border in UI design is valid. The choice of border style can significantly influence how users perceive the importance and hierarchy of information on a page. Here are a few thoughts on the matter: ### 1. **Visual Hierarchy**: - **Dotted Borders**:...
44,160
[ { "from": "human", "value": "I am currently using a dotted border for certain UI stuff such as instructions, notes, error boxes, etc.\nBut recently I changed to a solid border, due to a requirement, but I just find it kind of strange.\nIt seems that by making it solid it puts too much emphasis on page eleme...
I would like to display the differences between versions of the same content. Initially I rolled out my own WebControl, however the differencing algorithm I came up with was slightly naive. Does anyone know of any .Net code or a WebControl out there on the Internets that might be of use? The implementation that stackov...
If you're looking to implement a more robust differencing algorithm for displaying differences between versions of the same content in a .NET web application, there are several libraries and approaches you can consider. Below are some options that might help you: 1. **DiffPlex**: This is a popular .NET library specifi...
43,905
[ { "from": "human", "value": "I would like to display the differences between versions of the same content. Initially I rolled out my own WebControl, however the differencing algorithm I came up with was slightly naive.\nDoes anyone know of any .Net code or a WebControl out there on the Internets that might ...
I need to add Workflows to an existing solution, which already contains a class library and a web site. If I add the workflows to the class library, where they fit logically, I have no designer support. If I create them in a separate project, I tend to have circular dependencies because my domain objects run the work...
To effectively integrate workflows into your existing solution while avoiding circular dependencies, you can adopt a modular architecture approach. Here are some strategies to consider: ### 1. Use a Workflow Definition Library Create a separate project that specifically houses your workflows. This project can contain:...
44,366
[ { "from": "human", "value": "I need to add Workflows to an existing solution, which already contains a class library and a web site. If I add the workflows to the class library, where they fit logically, I have no designer support. If I create them in a separate project, I tend to have circular dependenci...
I've just set up mod python with apache and I'm trying to get a simple script to work, but what happens is it publishes all my html as plain text when I load the page. I figured this is a problem with mod_python.publisher, The handler I set it too. I searched through the source of it and found the line where it differ...
It sounds like you're facing an issue with the Apache configuration for mod_python where your HTML content is being served as plain text instead of being rendered as HTML. Let's go through some troubleshooting steps to help resolve this issue. 1. **Check the Response Headers**: First, check the response headers in you...
44,547
[ { "from": "human", "value": "I've just set up mod python with apache and I'm trying to get a simple script to work, but what happens is it publishes all my html as plain text when I load the page. I figured this is a problem with mod_python.publisher, The handler I set it too. I searched through the source...
I'm working with JInternalFrame's under Mac OS X Java 5 and when maximizing a JInternalFrame within a JDesktopPane the window doesn't fully maximize, but the property to allow maximizing is definitely set to true. This is the result I'm getting when maximized: Seeing as though the image previews didn't work. I've got ...
When working with `JInternalFrame` in a `JDesktopPane` under Java, especially on Mac OS X with Java 5, there are a few things to keep in mind regarding maximizing the internal frame. Here are several suggestions you can try to resolve the issue of the `JInternalFrame` not fully maximizing: 1. **Ensure Proper Layout**...
41,972
[ { "from": "human", "value": "I'm working with JInternalFrame's under Mac OS X Java 5 and when maximizing a JInternalFrame within a JDesktopPane the window doesn't fully maximize, but the property to allow maximizing is definitely set to true. This is the result I'm getting when maximized:\nSeeing as though...
Just say I have a file: "HelloWorld.pm" in multiple subdirectories within a Git repository. I would like to issue a command to find the full paths of all the files matching "HelloWorld.pm": For example: /path/to/repository/HelloWorld.pm /path/to/repository/but/much/deeper/down/HelloWorld.pm /path/to/repository/please/d...
You can use the `git ls-files` command to efficiently find all instances of a specific file (like `HelloWorld.pm`) within your Git repository. This command lists all the files that are tracked by Git in the current repository, and you can use it in combination with `grep` to filter for the specific filename you're look...
47,711
[ { "from": "human", "value": "Just say I have a file: \"HelloWorld.pm\" in multiple subdirectories within a Git repository.\nI would like to issue a command to find the full paths of all the files matching \"HelloWorld.pm\":\nFor example:\n/path/to/repository/HelloWorld.pm\n/path/to/repository/but/much/deepe...
When a pointer goes out of scope, its memory is freed, so why are destructors created in c++?
In C++, when a pointer goes out of scope, the pointer itself (the variable that holds the memory address) is destroyed, but the memory that it points to is not automatically freed. This is a common misconception. Let's clarify this and discuss the role of destructors: 1. **Pointers and Memory Management**: When you al...
45,294
[ { "from": "human", "value": "When a pointer goes out of scope, its memory is freed, so why are destructors created in c++?\n" }, { "from": "gpt", "value": "In C++, when a pointer goes out of scope, the pointer itself (the variable that holds the memory address) is destroyed, but the memory that ...
What is the best practice for creating re-usable control templates. For example. I want to start with the standard checkbox and modify its template for re-use accross multiple future projects. I understand how to modify the template in Blend, but it always wants to save the template to App.xaml of the current project...
Creating a reusable control library that includes custom templates and controls is a common scenario in XAML-based applications, especially when using WPF (Windows Presentation Foundation). Here are best practices for achieving this: ### 1. Create a Class Library for Your Control Library 1. **Create a New Project**: ...
41,058
[ { "from": "human", "value": "What is the best practice for creating re-usable control templates. \nFor example. I want to start with the standard checkbox and modify its template for re-use accross multiple future projects.\nI understand how to modify the template in Blend, but it always wants to save the ...
I am having trouble getting my ASP.NET application to start an application. For example when I type: http://my.domain.com/virtualdir or http://my.domain.com/virtualdir/default.aspx My application will start but I cannot get ASP.NET to start when I type http://my.domain.com. I have tried to set the default document ...
It sounds like you're encountering an issue where your ASP.NET application does not start properly when accessing the root URL (`http://my.domain.com`) but works correctly when accessing the specific virtual directory or default page directly. Here are some troubleshooting steps and suggestions to help you resolve the...
42,671
[ { "from": "human", "value": "I am having trouble getting my ASP.NET application to start an application. For example when I type:\n http://my.domain.com/virtualdir or \nhttp://my.domain.com/virtualdir/default.aspx \nMy application will start but I cannot get ASP.NET to start when I type http://my.domain.com...
I have a little Perl script (On Windows) that checks some files for me as an aid to my day-to-day business. At the moment it prints out something like... 0% 25% 50% 75% Complete But I can remember scripts I've used in the past that didn't print progress on a line-by-line basis, but which updated the output on the disp...
In Perl, you can achieve the effect of overwriting the previous line of output in the terminal by using carriage return (`\r`). This allows you to print a percentage complete on the same line, giving the appearance of a dynamic progress display. Here’s a simple example of how you could implement this in your Perl scri...
46,121
[ { "from": "human", "value": "I have a little Perl script (On Windows) that checks some files for me as an aid to my day-to-day business. At the moment it prints out something like...\n0%\n25%\n50%\n75%\nComplete\n\nBut I can remember scripts I've used in the past that didn't print progress on a line-by-line...
I have a file that has one entry per line. Each line has the following format: "group:permissions:users" Permissions and users could have more than one value separated by comas like this: "grp1:create,delete:yo,el,ella" I want is to return the following: yo el ella This is what I have so far: cat file | grep grp...
You can achieve your goal by modifying your command slightly to handle the output in a way that separates each user into its own line. Instead of using `cut` twice, you can pipe the output to `tr`, which translates or deletes characters. Here’s how you can do that: ```bash cat file | grep grp1 -w | cut -f3 -d: | tr ',...
48,653
[ { "from": "human", "value": "I have a file that has one entry per line. Each line has the following format:\n \"group:permissions:users\" \n\nPermissions and users could have more than one value separated by comas like this:\n \"grp1:create,delete:yo,el,ella\" \n\nI want is to return the following:\nyo\nel\...
Is there a way to create a function/sub signature that accepts an arbitrary typed generic in vb.net.
Yes, in VB.NET, you can create a function or method that accepts an arbitrary typed generic parameter using generics. You can define a generic method by using a type parameter that can be specified when the method is called. Here's a simple example that demonstrates how to create a generic function that accepts an ar...
44,499
[ { "from": "human", "value": "Is there a way to create a function/sub signature that accepts an arbitrary typed generic in vb.net.\n" }, { "from": "gpt", "value": "Yes, in VB.NET, you can create a function or method that accepts an arbitrary typed generic parameter using generics. You can define ...
Are C-style macro names subject to the same naming rules as identifiers? After a compiler upgrade, it is now emitting this warning for a legacy application: warning #3649-D: white space is required between the macro name "CHAR_" and its replacement text #define CHAR_& 38 This line of code is defining...
Yes, you are correct that C-style macro names must follow the same rules as identifiers, which means they must begin with a letter (A-Z, a-z) or an underscore (_), and can be followed by letters, digits (0-9), or underscores. In your case, the macro name `CHAR_&` is invalid because it contains the `&` character, which...
47,065
[ { "from": "human", "value": "Are C-style macro names subject to the same naming rules as identifiers? After a compiler upgrade, it is now emitting this warning for a legacy application:\nwarning #3649-D: white space is required between the macro name \"CHAR_\" and its replacement text\n #define CH...
i get a Keyword not supported: '192.168.1.1;initial catalog'. error when trying to do this Dim cn As New SqlConnection(str) where str is the connection string starts with '192.168.1.1;initial catalog' ... I have not specified the provider in the connection string
The error you're encountering, "Keyword not supported: '192.168.1.1;initial catalog'", suggests that the connection string you're using is not correctly formatted or is missing some required keywords. A typical connection string for a SQL Server database includes the `Data Source`, `Initial Catalog`, and other optiona...
44,293
[ { "from": "human", "value": "i get a Keyword not supported: '192.168.1.1;initial catalog'. error when trying to do this \nDim cn As New SqlConnection(str) \nwhere str is the connection string starts with '192.168.1.1;initial catalog' ...\nI have not specified the provider in the connection string\n" }, ...
I'm trying to use the EntLib 3.1 within .net code for a dll which is registered for COM interop. Where do I put the config file? Alternatively, is there a way to specify within the dll code where it should get the entlib config from? Since my dll will be called from COM I don't always know what exe will be calling it....
When working with a COM interop DLL that uses the Enterprise Library (EntLib) for logging or any other functionality, the configuration files can sometimes lead to confusion, especially when the DLL is being invoked from different applications that may not have the same configuration setup. ### Where to Place the Conf...
44,071
[ { "from": "human", "value": "I'm trying to use the EntLib 3.1 within .net code for a dll which is registered for COM interop. Where do I put the config file? \nAlternatively, is there a way to specify within the dll code where it should get the entlib config from? Since my dll will be called from COM I don'...
"Assembly [AssemblyName] must have a shared name to be installed globally" I am getting this error message when I try to deploy some component DLLs for my application to the Global Assembly Cache. What is a shared name and how do i make sure my DLLs have one?
The error message you are encountering indicates that the DLL you are trying to install into the Global Assembly Cache (GAC) is missing a shared name. In .NET, a "shared name" is essentially a strong name that uniquely identifies an assembly and enables it to be stored in the GAC. ### What is a Strong Name? A strong ...
44,194
[ { "from": "human", "value": "\"Assembly [AssemblyName] must have a shared name to be installed globally\"\nI am getting this error message when I try to deploy some component DLLs for my application to the Global Assembly Cache.\nWhat is a shared name and how do i make sure my DLLs have one?\n" }, { ...
I've been slowly working my way through the list of Project Euler problems, and I've come to one that I know how to solve, but it seems like I can't (given the way my solution was written). I am using Common Lisp to do this with and my script has been running for over 24 hours (well over their one minute goal). For the...
The solution you've provided seems to have inefficiencies, especially in how you're calculating factors and using lists. Here are some suggestions to improve the performance of your Common Lisp solution: ### 1. Optimize Factor Calculation The `factors` function is calculating factors in an inefficient manner. Instead ...
40,228
[ { "from": "human", "value": "I've been slowly working my way through the list of Project Euler problems, and I've come to one that I know how to solve, but it seems like I can't (given the way my solution was written).\nI am using Common Lisp to do this with and my script has been running for over 24 hours ...
I've heard a lot of people touting success using Linux based proxies to handle routing for high availability of web applications, but what are others doing with web services? I have a bank of WCF services that need to be moved to a high availability (failover) model, meaning that if a particular server hosting the WCF ...
To achieve high availability (HA) for your WCF services in a Windows environment, there are several strategies and technologies you can consider without relying on Linux-based solutions. Here are some options you might explore: ### 1. **Windows Load Balancing** - **Network Load Balancing (NLB)**: Windows Server pro...
40,883
[ { "from": "human", "value": "I've heard a lot of people touting success using Linux based proxies to handle routing for high availability of web applications, but what are others doing with web services? I have a bank of WCF services that need to be moved to a high availability (failover) model, meaning tha...
I went to http://www.json.org/js.html and downloaded the json2.js, thinking i'd be fine, afterall that site is on the top in a google search for 'json javascript' - also they have this really cool url :) So i've been working a bit with it and it seemed fine, but now i start running into trouble with it - it simply won'...
It sounds like you are encountering issues with string escaping when using JSON in JavaScript and JSON .NET serializer. Let's clarify how to handle JSON in JavaScript and what might be going wrong with the escaping of characters. ### Understanding JSON String Escaping 1. **JSON Format**: According to the JSON specifi...
41,900
[ { "from": "human", "value": "I went to http://www.json.org/js.html and downloaded the json2.js, thinking i'd be fine, afterall that site is on the top in a google search for 'json javascript' - also they have this really cool url :)\nSo i've been working a bit with it and it seemed fine, but now i start run...
I wish we have "Usable" pattern in C#, when code block of using construct would be passed to a function as delegate: class Usable : IUsable { public void Use(Action action) // implements IUsable { // acquire resources action(); // release resources } } and in user code: using (new Usable()) { // ...
The idea of introducing a "Usable" pattern in C# as you described brings an interesting perspective on resource management and syntactic sugar for handling resource cleanup, but it also raises some potential issues and considerations from a language design standpoint. ### Feasibility and Usefulness 1. **Controlled Ex...
43,554
[ { "from": "human", "value": "I wish we have \"Usable\" pattern in C#, when code block of using construct would be passed to a function as delegate:\nclass Usable : IUsable\n{\n public void Use(Action action) // implements IUsable\n {\n // acquire resources\n action();\n // release resources\n ...
If you check my earlier questions you may have noticed I just don't get the SelectList and Html.DropDown(). I find it intrigueing that I seem to be the only one in this. So maybe I should try to change my mindset or maybe there are things I don't know that will clear this all up. I really love the whole MVC framework, ...
It's completely understandable to feel confused about certain aspects of using `SelectList` and `Html.DropDownList()` in ASP.NET MVC, especially since they can be nuanced and depend heavily on how data is structured in your application. Let's break down your concerns one by one, which will hopefully clarify some of you...
41,697
[ { "from": "human", "value": "If you check my earlier questions you may have noticed I just don't get the SelectList and Html.DropDown(). I find it intrigueing that I seem to be the only one in this. So maybe I should try to change my mindset or maybe there are things I don't know that will clear this all up...
I have an asp:DropDownList on a page that, due to the 1024x768 development standard can truncate some of the text values in the dropdown (not enough of them, apparently, to redesign the layout ), so I need to display a tooltip of the selected value when a dropdown item is being selected (i.e. when the dropdown is shown...
Yes, it's possible to achieve the behavior you're looking for with a combination of ASP.NET and JavaScript (or jQuery). While the default behavior of `asp:DropDownList` doesn't include tooltips based on text truncation, you can implement this with some custom code. ### Approach 1. **Detect Text Overflow**: You'll nee...
42,974
[ { "from": "human", "value": "I have an asp:DropDownList on a page that, due to the 1024x768 development standard can truncate some of the text values in the dropdown (not enough of them, apparently, to redesign the layout ), so I need to display a tooltip of the selected value when a dropdown item is being ...
I have a deceptively simple scenario, and I want a simple solution, but it's not obvious which is "most correct" or "most Java". Let's say I have a small authenticate(Client client) method in some class. The authentication could fail for a number of reasons, and I want to return a simple boolean for control flow, but a...
Your scenario presents a common design challenge in Java and other object-oriented languages. You've thoughtfully considered the trade-offs of each approach, and it seems you've arrived at a solution that strikes a balance between simplicity and extensibility by creating an `AuthenticationResult` class. Here are a few...
44,955
[ { "from": "human", "value": "I have a deceptively simple scenario, and I want a simple solution, but it's not obvious which is \"most correct\" or \"most Java\".\nLet's say I have a small authenticate(Client client) method in some class. The authentication could fail for a number of reasons, and I want to r...
is there any way of making sure that, one user is logged in only once? I would like to avoid two different persons logging into the system with the same login/password. I guess I could do it myself by checking in the django_session table before logging in the user, but I rather prefer using the framework, if there is a...
In Django, you can implement a mechanism to ensure that a user is logged in only once by customizing the authentication and session handling. While Django doesn't provide this functionality out-of-the-box, you can achieve it with a few steps. Here’s a general approach to restrict users to a single session: ### Step 1...
39,034
[ { "from": "human", "value": "is there any way of making sure that, one user is logged in only once?\nI would like to avoid two different persons logging into the system with the same login/password.\nI guess I could do it myself by checking in the django_session table before logging in the user, but I rathe...
I've been trying to see if I can accomplish some requirements with a document based database, in this case CouchDB. Two generic requirements: CRUD of entities with some fields which have unique index on it ecommerce web app like eBay (better description here). And I'm begining to think that a Document-based data...
Your considerations about using a document-based database like CouchDB for an e-commerce web application are valid, and it’s important to understand how document databases operate to assess their suitability for your specific requirements. ### Advantages of Document Databases: 1. **Flexibility in Data Model**: Docume...
42,773
[ { "from": "human", "value": "I've been trying to see if I can accomplish some requirements with a document based database, in this case CouchDB. Two generic requirements: \n\nCRUD of entities with some fields which have unique index on it \necommerce web app like eBay (better description here).\n\nAnd I'...
Can you tell me if there anybody has implemented a custom validator for checking that one of two (or N) input fields are filled? "Insert phone number or email address" I'm using ASP.NET (Ajax) 3.5, the ajaxToolkit:ValidatorCalloutExtender (and jQuery if it's necessary).
Yes, you can create a custom validator in ASP.NET to ensure that at least one of two or more input fields is filled. In your case, you'd want to verify that either a phone number or an email address is provided. Here’s a step-by-step guide to implement a custom validator for your scenario: ### Step 1: Create a Custom...
42,580
[ { "from": "human", "value": "Can you tell me if there anybody has implemented a custom validator for checking that one of two (or N) input fields are filled?\n \"Insert phone number or email address\"\n\nI'm using ASP.NET (Ajax) 3.5, the ajaxToolkit:ValidatorCalloutExtender (and jQuery if it's necessary)....
I am trying to design a location lookup in which the user can specify a location to any desired level of accuracy. eg. one of Country, State, City, Borough etc, I have a used a common location table, which will then be used in a lookup with the table name selected dynamically, but was wondering if there is a feasible a...
Designing a location lookup that can handle hierarchical structures for different levels of accuracy (like Country, State, City, etc.) can indeed be a bit challenging. However, there are a few strategies you can consider. The hierarchical table approach is one of the most effective, but let’s delve deeper into that and...
41,242
[ { "from": "human", "value": "I am trying to design a location lookup in which the user can specify a location to any desired level of accuracy. eg. one of Country, State, City, Borough etc,\nI have a used a common location table, which will then be used in a lookup with the table name selected dynamically, ...
A listbox is passed, the data placed in an array, the array is sort and then the data is placed back in the listbox. The part that does work is putting the data back in the listbox. Its like the listbox is being passed by value instead of by ref. Here's the sub that does the sort and the line of code that calls the so...
The problem you're facing is related to how the `ListBox` in MSForms works and the way you're handling array indices. Let's break down the issues and correct them step by step. ### Issues: 1. **Indexing**: When using `ReDim TempArray(LB.ListCount)`, the array's size will be `LB.ListCount + 1`, which creates an extra e...
42,164
[ { "from": "human", "value": "A listbox is passed, the data placed in an array, the array is sort and then the data is placed back in the listbox. The part that does work is putting the data back in the listbox. Its like the listbox is being passed by value instead of by ref.\nHere's the sub that does the s...
I have created an application that writes some data to the root folder of the directory in which it was installed (in Program Files). But under Windows Vista, the program is unable to write to the directory because the UAC restricts administrative privileges. I need to be able to do the following Write a file in the f...
To ensure your application always runs with administrative privileges on Windows, you can modify the application's manifest file. This will allow Windows to request elevated privileges whenever your application is started. Below are the steps to modify your application to require administrative privileges: ### 1. Modi...
42,843
[ { "from": "human", "value": "I have created an application that writes some data to the root folder of the directory in which it was installed (in Program Files). But under Windows Vista, the program is unable to write to the directory because the UAC restricts administrative privileges.\nI need to be able ...
Is there a c++ equivalent of Java's try { ... } catch (Throwable t) { ... } I am trying to debug Java/jni code that calls native windows functions and the virtual machine keeps crashing. The native code appears fine in unit testing and only seems to crash when called through jni. A generic exception catching...
In C++, there isn't a direct equivalent to Java's `Throwable` mechanism for catching all exceptions, primarily because C++ exceptions are not designed to cover the same range of errors as Java's. However, you can use a combination of standard C++ exception handling and platform-specific error handling to achieve simila...
41,707
[ { "from": "human", "value": "Is there a c++ equivalent of Java's\ntry {\n ...\n}\ncatch (Throwable t) {\n ...\n}\n\nI am trying to debug Java/jni code that calls native windows functions and the virtual machine keeps crashing. The native code appears fine in unit testing and only seems to crash when ...
I wrote a simple add-in for Visual Studio 2008 that opens a dockable window pane. You can download the source and a binary installer by clicking here. The nature of the add-in means that it is ideally going to stay docked next to where you edit your source. But sometimes, on some installs, it won't stay docked. You ru...
It seems you are encountering an issue with your Visual Studio 2008 add-in where the dockable window pane does not consistently save its docking state across sessions. This is a common problem when dealing with dockable tool windows in Visual Studio extensions, and there are a few things you can try to ensure that the ...
42,081
[ { "from": "human", "value": "I wrote a simple add-in for Visual Studio 2008 that opens a dockable window pane. \nYou can download the source and a binary installer by clicking here.\nThe nature of the add-in means that it is ideally going to stay docked next to where you edit your source. But sometimes, on ...
Is it possble to have something like this in ASP.NET MVC... [Authorize] [AcceptVerbs(HttpVerbs.Get)] public string AddData(string Issues, string LabelGUID) { return "Authorized"; } [AcceptVerbs(HttpVerbs.Get)] public string AddData() { return "Not Authorized"; } So if the user is not logged in, it defaults to...
Yes, you can achieve a similar functionality in ASP.NET MVC, but the implementation approach would be slightly different from the one you’ve described. In ASP.NET MVC, you cannot have two actions with the same name in the same controller, even if they have different attributes (like `[Authorize]`). Instead, you can use...
43,909
[ { "from": "human", "value": "Is it possble to have something like this in ASP.NET MVC...\n[Authorize]\n[AcceptVerbs(HttpVerbs.Get)]\npublic string AddData(string Issues, string LabelGUID)\n{\n return \"Authorized\";\n}\n\n[AcceptVerbs(HttpVerbs.Get)]\npublic string AddData()\n{\n return \"Not Authoriz...
I have a do-while loop that's supposed to do three things, go through a text file line by line, the text file contains pathnames and filenames (C:\Folder\file1.txt). If the line contains a certain string, it then copies a file to that location, renames it to what it is named in the text file, and then replaces a string...
It looks like there are several issues with your code that need to be addressed for it to compile and function correctly. Let’s go through the problems step by step: 1. **Do-While Syntax**: In VB, the `Do While` loop should be properly structured, and it looks fine in your case. However, it is typically better to use ...
43,786
[ { "from": "human", "value": "I have a do-while loop that's supposed to do three things, go through a text file line by line, the text file contains pathnames and filenames (C:\\Folder\\file1.txt).\nIf the line contains a certain string, it then copies a file to that location, renames it to what it is named ...
I have a frameset with it's cols attribute set to "50%,50%" at the moment. I have a toggleView method which is called after a click on an element. What I aim to do is to change frameset from displaying cols to rows, again divided 50/50. I have attempted to perform a removeAttribute("cols") on the frameset, while this d...
It looks like you're trying to switch a `<frameset>` from a columns layout to a rows layout using JavaScript. While removing the `cols` attribute and adding the `rows` attribute should ideally work, many browsers may not handle dynamic changes to framesets very well because framesets are meant to be static after the in...
40,837
[ { "from": "human", "value": "I have a frameset with it's cols attribute set to \"50%,50%\" at the moment. I have a toggleView method which is called after a click on an element.\nWhat I aim to do is to change frameset from displaying cols to rows, again divided 50/50.\nI have attempted to perform a removeAt...
I have this SQL query: SELECT * FROM IMAGES WHERE IMAGENAME in ('IMG1', 'IMG2', 'IMG3', 'IMG4', 'IMG5', 'IMG6') ORDER BY CASE IMAGENAME WHEN 'IMG1' THEN 1 WHEN 'IMG2' THEN 2 WHEN 'IMG3' THEN 3 WHEN 'IMG4' THEN 4 WHEN 'IMG5' THEN 5 WHEN 'IMG6' THEN 6 ELSE 7 END I cannot guarantee that the list of IMAGENAM...
To optimize the SQL query you provided, we need to focus on both the selection of rows and how the sorting is performed. Here are some suggestions to potentially reduce the sorting overhead: ### 1. **Use a Derived Table or CTE for Ordering** Instead of directly applying the `ORDER BY` clause with a `CASE` statement, y...
41,777
[ { "from": "human", "value": "I have this SQL query:\nSELECT * FROM IMAGES WHERE\nIMAGENAME in ('IMG1', 'IMG2', 'IMG3', 'IMG4', 'IMG5', 'IMG6')\nORDER BY CASE IMAGENAME\n WHEN 'IMG1' THEN 1\n WHEN 'IMG2' THEN 2\n WHEN 'IMG3' THEN 3\n WHEN 'IMG4' THEN 4\n WHEN 'IMG5' THEN 5\n WHEN 'IMG6' THEN 6\n ELSE ...
It seems to me that the key USP of Flash/Silverlight is the ability to provide access (albeit indirectly) to the graphics subsystem of the client, enabling video, smooth transitions and "fancy" visual effects. This sounds like a good idea, and a natural evolution/extension of HTML. But surely it would be better if some...
Your observations about Flash and Silverlight highlight important aspects of web development and the evolution of technology. Both of these platforms provided a means to deliver rich multimedia content and advanced graphics that were challenging to achieve with standard HTML and CSS at the time of their prominence. How...
44,958
[ { "from": "human", "value": "It seems to me that the key USP of Flash/Silverlight is the ability to provide access (albeit indirectly) to the graphics subsystem of the client, enabling video, smooth transitions and \"fancy\" visual effects.\nThis sounds like a good idea, and a natural evolution/extension of...
The problem is fairly simple, but is best illustrated visually. Note that all screen shots are from the Visual Studio 2005 design surface. I've noticed no difference when I actually run the application. Here is my user control (let's call this UC-1): The buttons on the control are set to anchor to Bottom + Right. He...
This clipping issue you're experiencing with your user controls (UC-1 and UC-2) when placed in the parent user control (UC-A) could be attributed to several potential causes. Here are some suggestions to troubleshoot and potentially resolve the problem: 1. **Check User Control Height**: Ensure that the height of UC-1 ...
44,665
[ { "from": "human", "value": "The problem is fairly simple, but is best illustrated visually. Note that all screen shots are from the Visual Studio 2005 design surface. I've noticed no difference when I actually run the application.\nHere is my user control (let's call this UC-1):\n\nThe buttons on the con...
I'm working on a webservice + AJAX interface, and I'm worried about authentication. This moment I'm passing username and password to the webservice as arguments, but I fear that this approach is highly insecure. I was told that ssl could solve my problem, but I want more alternatives. My webservice is written in php an...
You're right to be concerned about the security of passing sensitive information like usernames and passwords over a web service. While SSL (or HTTPS) does encrypt data in transit, there are additional strategies you can implement to enhance the security of your web service and AJAX interface. Here are several approach...
38,786
[ { "from": "human", "value": "I'm working on a webservice + AJAX interface, and I'm worried about authentication. This moment I'm passing username and password to the webservice as arguments, but I fear that this approach is highly insecure. I was told that ssl could solve my problem, but I want more alterna...
I want to have a website navigation menu, where whenever someone clicks on it, a treeview with checkboxes appears, where they can select nodes in the tree. Is this possible with YUI Treeview (http://developer.yahoo.com/yui/treeview/ ) or will I have to make it myself?
Yes, it is possible to create a treeview with checkboxes using YUI's TreeView component. YUI provides built-in functionality to create tree structures, and you can enhance this functionality to include checkboxes for selecting nodes. To achieve this, you will need to follow these steps: 1. **Include YUI Library**: Ma...
39,350
[ { "from": "human", "value": "I want to have a website navigation menu, where whenever someone clicks on it, a treeview with checkboxes appears, where they can select nodes in the tree.\nIs this possible with YUI Treeview (http://developer.yahoo.com/yui/treeview/ ) or will I have to make it myself?\n" }, ...
I'm looking for some resources regarding the virtual machines of the future (Like jvm or clr) What are they going to look like? Will they provide a concurrent runtime, more powerful metaprogramming models? I'm looking for articles, research projects, or pure speculation, anything that is going to be an interesting read...
The future of virtual machines (VMs) like the Java Virtual Machine (JVM) and the Common Language Runtime (CLR) is a fascinating topic, especially as programming paradigms evolve and the demand for concurrent execution and powerful metaprogramming increases. Here are some resources, insights, and directions you might fi...
42,589
[ { "from": "human", "value": "I'm looking for some resources regarding the virtual machines of the future (Like jvm or clr)\nWhat are they going to look like? Will they provide a concurrent runtime, more powerful metaprogramming models?\nI'm looking for articles, research projects, or pure speculation, anyth...
I have a Windows application (VS2005/C#) which comes in two versions, Enterprise and Pro. In the Pro version, some of the features and menus are disabled. Currently, I'm doing this by commenting out the disabling code to create the Enterprise version, then I copy each executable file to another location. Obviously this...
Yes, you can achieve this in Visual Studio by using Conditional Compilation Symbols. This allows you to specify sections of code that should be included or excluded based on defined symbols. Here's how to set it up in Visual Studio 2005 (and newer versions): ### Step 1: Define the Conditional Compilation Symbols 1....
41,718
[ { "from": "human", "value": "I have a Windows application (VS2005/C#) which comes in two versions, Enterprise and Pro. In the Pro version, some of the features and menus are disabled. Currently, I'm doing this by commenting out the disabling code to create the Enterprise version, then I copy each executable...
I have a site that connects using cURL (latest version) to a secure gateway for payment. The problem is cURL always returns 0 length content. I get headers only. And only when I set cURL to return headers. I have the following flags in place. curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY); curl_setopt($ch, CURLOPT_SS...
The issue you are experiencing, where the server responds with a `Content-Length: 0` and `HTTP/1.1 200 OK`, suggests that while the request is successful, the server is not returning any actual content in the response body. This could be due to several reasons. Here are some steps you can take to troubleshoot and poten...
42,381
[ { "from": "human", "value": "I have a site that connects using cURL (latest version) to a secure gateway for payment.\nThe problem is cURL always returns 0 length content. I get headers only. And only when I set cURL to return headers. I have the following flags in place.\ncurl_setopt($ch, CURLOPT_HTTPAUTH,...
I've created a .Net library at work that is used by all of our developers. The security part of it uses Microsoft AzMan for the security backend. In order to create a security (AzMan) ClientContext I have to pass it a token value (as a uint). This is all fine an dandy until I needed to make a COM wrapper for our common...
To obtain the token value for a user in your legacy ASP pages and pass it to your .NET library using Microsoft AzMan, you can follow these steps: 1. **Obtain the User Token in ASP**: You can utilize the `WScript.Network` COM object to retrieve the user credentials of the currently logged-in user. However, you will nee...
41,601
[ { "from": "human", "value": "I've created a .Net library at work that is used by all of our developers. The security part of it uses Microsoft AzMan for the security backend. In order to create a security (AzMan) ClientContext I have to pass it a token value (as a uint). This is all fine an dandy until I ne...
I recently did the Chris Coyier tutorial from the css-tricks.com weblog #38: Basics & Tips on Designing for the iPhone. Needless to say I got very excited and suggested to a guy that I do some code monkey work for that we could now offer iPhone websites to his clients. He said cool, but what about other mobile devices?...
Designing websites for mobile devices is increasingly important as more users access the internet from smartphones and other handheld devices. While the iPhone was a significant catalyst for mobile web design, several other platforms have gained popularity, each with its own considerations. Here’s a breakdown of key po...
44,216
[ { "from": "human", "value": "I recently did the Chris Coyier tutorial from the css-tricks.com weblog #38: Basics & Tips on Designing for the iPhone. Needless to say I got very excited and suggested to a guy that I do some code monkey work for that we could now offer iPhone websites to his clients. He said c...
I have a Java based web-application and a new requirement to allow Users to place variables into text fields that are replaced when a document or other output is produced. How have others gone about this? I was thinking of having a pre-defined set of variables such as : @BOOKING_NUMBER@ @INVOICE_NUMBER@ Then when a us...
Your approach of using predefined variables with placeholders in the text is a good strategy for allowing users to customize content in a manageable way. Here’s a breakdown of how you can implement this: ### Step 1: Define Your Variables Define a set of placeholders that users can use within their text. You’ve alread...
42,841
[ { "from": "human", "value": "I have a Java based web-application and a new requirement to allow Users to place variables into text fields that are replaced when a document or other output is produced. How have others gone about this?\nI was thinking of having a pre-defined set of variables such as :\n@BOOKI...
i have problem i want to select name_magazine from magazine and i already import all library needed and Query q = EntityManger.createQuery ("SELECT name_magazine FROM Magazine"); List results = (List) q.getResultList (); For(Sting s : result) System.out.println(s); but when i run this code it's error. can someone h...
It looks like you are encountering a couple of issues in your Java code for querying a JPA Entity. Let’s break down the problems and their possible solutions. ### 1. Query Syntax The error `Error compiling the query [Select m.Name from magazine m]` indicates that there is a problem with your JPQL (Java Persistence Que...
44,297
[ { "from": "human", "value": "i have problem i want to \nselect name_magazine from magazine\nand i already import all library needed\nand \n\nQuery q = EntityManger.createQuery (\"SELECT name_magazine FROM Magazine\");\nList results = (List) q.getResultList ();\nFor(Sting s : result)\nSystem.out.println(s);\...
I have some code that I am putting in the code-behind of a master page. This master page is my main layout and the purpose of the code is to check whether the user is logged in and take the appropriate action depending on whether they are or not. I would be interested in hearing alternate methods on how to approach thi...
In ASP.NET MVC, you can determine the current controller and action being executed using the `RouteData` property available in the `Controller` class. Since you are working with a master page (which is usually tied more closely to Web Forms), accessing this information requires a bit of adaptation. Here’s how you can ...
43,537
[ { "from": "human", "value": "I have some code that I am putting in the code-behind of a master page. This master page is my main layout and the purpose of the code is to check whether the user is logged in and take the appropriate action depending on whether they are or not. I would be interested in hearing...
I've got a sproc and some C# calling it. My problem is that both the (N)VARCHAR values only have the first character returned. Everything else is fine. Why would only the 1st character be returned? So Content = (string)cmd.Parameters["@SmsContent"].Value, ToNumber = (string) cmd.Parameters["@ToNumber"].Value, both onl...
The issue you are encountering, where only the first character of the `NVARCHAR` and `VARCHAR` values is being returned, likely stems from the way you are declaring your parameters in the stored procedure. In your stored procedure, you've declared `@SmsContent` and `@ToNumber` as output parameters without specifying t...
41,378
[ { "from": "human", "value": "I've got a sproc and some C# calling it. My problem is that both the (N)VARCHAR values only have the first character returned. Everything else is fine. Why would only the 1st character be returned?\nSo\nContent = (string)cmd.Parameters[\"@SmsContent\"].Value,\nToNumber = (string...
I've download an image from the Internet and converted to a String (This is not changeable) Dim Request As System.Net.WebRequest = _ System.Net.WebRequest.Create( _ "http://www.google.com/images/nav_logo.png") Dim WebResponse As System.Net.HttpWebResponse = _ DirectCast(Request.GetResponse(), System.Net.HttpWebR...
It looks like you're trying to convert the downloaded image, which you've read as a string, back into an image object. However, the issue arises because you're treating the image data as text, which is not appropriate. When you read image data as a string, you potentially alter the binary data, making it unusable for i...
44,155
[ { "from": "human", "value": "I've download an image from the Internet and converted to a String (This is not changeable)\nDim Request As System.Net.WebRequest = _\n System.Net.WebRequest.Create( _\n \"http://www.google.com/images/nav_logo.png\")\n\nDim WebResponse As System.Net.HttpWebResponse = _\n Dire...
I am running on Castle's trunk, and trying to unit-test a controller-action where validation of my DTO is set up. The controller inherits from SmartDispatcherController. The action and DTO look like: [AccessibleThrough(Verb.Post)] public void Register([DataBind(KeyReg, Validate = true)] UserRegisterDto dto) { Ca...
It sounds like you're encountering an issue with the validation of your DTO in your unit test for the `Register` action of your controller. The problem seems to be that the validation isn't being applied to your `UserRegisterDto` as you expect, resulting in the action thinking that there are no validation errors even t...
42,730
[ { "from": "human", "value": "I am running on Castle's trunk, and trying to unit-test a controller-action where validation of my DTO is set up. The controller inherits from SmartDispatcherController. The action and DTO look like:\n\n[AccessibleThrough(Verb.Post)]\npublic void Register([DataBind(KeyReg, Val...
Notice these two RedHat Linux system configuration settings: $ getconf GNU_LIBC_VERSION glibc 2.3.4 $ getconf GNU_LIBPTHREAD_VERSION NPTL 2.3.4 I see they correspond to some of the TLS libraries: /lib/tls/libc-2.3.4.so /lib/tls/libm-2.3.4.so /lib/tls/libpthread-2.3.4.so /lib/tls/librt-2.3.4.so I'd like to link again...
Let's address your questions one by one: 1. **Existence of TLS Libraries Across GNU/Linux Distributions:** The `/lib/tls/` directory is part of a specific implementation of the GNU C Library (glibc) that supports Thread-Local Storage (TLS). While glibc is commonly used across most GNU/Linux distributions, not all d...
43,242
[ { "from": "human", "value": "Notice these two RedHat Linux system configuration settings:\n$ getconf GNU_LIBC_VERSION\nglibc 2.3.4\n\n$ getconf GNU_LIBPTHREAD_VERSION\nNPTL 2.3.4\n\nI see they correspond to some of the TLS libraries:\n/lib/tls/libc-2.3.4.so\n/lib/tls/libm-2.3.4.so\n/lib/tls/libpthread-2.3.4...
We have a number of very old data entry forms that were made in Access that link to our SQL Server database. Each form may have any number of sub-forms. We'd like to move away from using these access frontends but don't have the time to create a new app or web app to replace every form that we've got. Is there another ...
Transitioning from Access forms to another platform while maintaining a quick turnaround can be challenging, but there are several approaches you can consider that allow for visual design and easy connection to SQL Server. Here are some potential options: ### 1. **Microsoft PowerApps** - **Description**: Microsoft Pow...
36,273
[ { "from": "human", "value": "We have a number of very old data entry forms that were made in Access that link to our SQL Server database. Each form may have any number of sub-forms.\nWe'd like to move away from using these access frontends but don't have the time to create a new app or web app to replace ev...
I'm working on a project that currently has zero users but we would like to scale up to potentially hundreds. Currently we are running on a MySQL database with AMFPHP interacting with Flex. We used Flex because of its robust graphic features (important to this project) and because the initial developer (not me) alrea...
Hi Dave, It's great to hear about your project, and I can definitely help address your questions regarding Flex and other potential development platforms. ### Is Flex a good tool for a project like this? Flex can be a suitable tool for projects that require rich graphical interfaces, as it provides powerful componen...
43,867
[ { "from": "human", "value": "I'm working on a project that currently has zero users but we would like to scale up to potentially hundreds. Currently we are running on a MySQL database with AMFPHP interacting with Flex. We used Flex because of its robust graphic features (important to this project) and bec...
Well basically I have this script that takes a long time to execute and occasionally times out and leaves semi-complete data floating around my database. (Yes I know in a perfect world I would fix THAT instead of implementing commits and rollbacks but I am forced to not do that) Here is my basic code (dumbed down for s...
To manage transactions in your PDO-based script, you can utilize the `beginTransaction`, `commit`, and `rollBack` methods provided by PDO. The idea is to start a transaction before entering the loop and then either commit the transaction if everything is successful or roll it back if there is an issue. Here's how you ...
44,332
[ { "from": "human", "value": "Well basically I have this script that takes a long time to execute and occasionally times out and leaves semi-complete data floating around my database. (Yes I know in a perfect world I would fix THAT instead of implementing commits and rollbacks but I am forced to not do that)...
I am very curious as to how people write their own obfuscator. How hard would it be to simply do the following: rename all public methods with GUID type names. Where would I start? How would I go about reading the .net dll assemby, pulling the public methods out and renaming them?
Creating an obfuscator that renames public methods in a .NET assembly with GUID-type names can be an interesting project. Here's a high-level overview of how you can approach this task, along with some specifics to guide you in the right direction. ### Step 1: Understand .NET Assemblies Before you dive into the imple...
41,639
[ { "from": "human", "value": "I am very curious as to how people write their own obfuscator.\nHow hard would it be to simply do the following:\n\nrename all public methods with GUID type names.\n\nWhere would I start? How would I go about reading the .net dll assemby, pulling the public methods out and rena...
I have a windows form application that uses a Shared class to house all of the common objects for the application. The settings class has a collection of objects that do things periodically, and then there's something of interest, they need to alert the main form and have it update. I'm currently doing this through Eve...
It sounds like you've encountered a fairly common issue in Windows Forms development involving threading and event handling. You're correct in identifying that the challenges stem from how Windows Forms handles UI updates, especially when dealing with multiple instances or background threads. Here’s a summary of your ...
43,222
[ { "from": "human", "value": "I have a windows form application that uses a Shared class to house all of the common objects for the application. The settings class has a collection of objects that do things periodically, and then there's something of interest, they need to alert the main form and have it upd...
I have a property defined in my HBM file like this: <property name="OwnerId" column="OwnerID" type="System.Int32" not-null="false" /> It is defined as a nullable field in the database also. If a record in the DB has the OwnerID column set to an integer, this object is correctly loaded by NHibernate. But if the recor...
The issues you are encountering with NHibernate when dealing with nullable fields, particularly the `OwnerId` property mapped to the `OwnerID` column, may stem from several potential causes. Here are a few things to consider: 1. **Column Name and Case Sensitivity**: In many database systems, including SQL Server, colu...
42,769
[ { "from": "human", "value": "I have a property defined in my HBM file like this:\n<property name=\"OwnerId\" column=\"OwnerID\" type=\"System.Int32\" not-null=\"false\" />\n\nIt is defined as a nullable field in the database also. If a record in the DB has the OwnerID column set to an integer, this object ...
I have a small dataset with a few datatables. I load the datatables from various DBs and have a config file that I read to determine the primary keys I want to enforce on the given datatables. If the config doesn't contain a proper (non unique) primary key, how can I catch this event when applying the primary key to ...
When you try to set the `PrimaryKey` property of a `DataTable` to an array of `DataColumn` objects that are not unique, it will not throw an exception. Instead, it silently allows the operation, and the primary key constraint may not function as intended, leading to potential issues later when you rely on that constrai...
44,236
[ { "from": "human", "value": "I have a small dataset with a few datatables. I load the datatables from various DBs and have a config file that I read to determine the primary keys I want to enforce on the given datatables. If the config doesn't contain a proper (non unique) primary key, how can I catch thi...
I am wondering how to use NUnit correctly. First, I created a separate test project that uses my main project as reference. But in that case, I am not able to test private methods. My guess was that I need to include my test code into my main code?! - That doesn't seem to be the correct way to do it. (I dislike the ide...
Testing private methods in NUnit (or any unit testing framework) can be a bit tricky, as private methods are not accessible from outside the class they belong to. However, there are several approaches to effectively test private methods without needing to expose them as public or internal, which can compromise the enca...
31,980
[ { "from": "human", "value": "I am wondering how to use NUnit correctly. First, I created a separate test project that uses my main project as reference. But in that case, I am not able to test private methods. My guess was that I need to include my test code into my main code?! - That doesn't seem to be the...
Duplicate of: Use javascript to inject script references as needed? Javascript doesn't have any directive to "include" or "import" another js file. This means that if script1.js uses functions/objects defined in script2.js, then every html page that includes script1.js must include script2.js before it. This shouldn't ...
Yes, you're correct that JavaScript does not have a built-in directive to include or import other JS files in the same way some other languages do, but there are strategies and practices to manage dependencies between scripts effectively. Here are some recommended strategies to address the issues you mentioned: ### 1....
42,142
[ { "from": "human", "value": "Duplicate of: Use javascript to inject script references as needed?\nJavascript doesn't have any directive to \"include\" or \"import\" another js file.\nThis means that if script1.js uses functions/objects defined in script2.js, then every html page that includes script1.js mus...
[hannel,192.168.0.46:40014] 15:08:03,642 - ERROR - org.jgroups.protocols.UDP - failed sending message to null (61 bytes) java.lang.Exception: dest=/225.1.2.46:30446 (64 bytes) at org.jgroups.protocols.UDP._send(UDP.java:333) at org.jgroups.protocols.UDP.sendToAllMembers(UDP.java:283) at org.jgroups.protocol...
The error message you provided indicates that there was an issue with sending a multicast message using JGroups over UDP. Here are a few points to consider regarding this error and whether you should be concerned about it: 1. **Context of the Error**: The error occurred during a multicast send operation, which is typi...
46,171
[ { "from": "human", "value": "[hannel,192.168.0.46:40014] 15:08:03,642 - ERROR - org.jgroups.protocols.UDP - failed sending message to null (61 bytes)\njava.lang.Exception: dest=/225.1.2.46:30446 (64 bytes)\n at org.jgroups.protocols.UDP._send(UDP.java:333)\n at org.jgroups.protocols.UDP.sendToAllMembe...