instruction
stringlengths
14
27.6k
completion
stringlengths
3
38.3k
__original_row_idx
int64
0
50k
conversations
listlengths
2
2
As best-behaved as I try to be about keeping my unit tests disconnected from the database, etc. etc, it still seems inevitable that my day will be interrupted by small regular enforced breaks while I wait for my machine to do something boring. I personally find swordfighting makes me lose my train of thought. I'm ofte...
It's great that you're thinking about making the most of those waiting times during builds and tests! Here are some suggestions that balance productivity and fun while keeping you in the right frame of mind: ### 1. **Micro-Learning Games** - **Duolingo or Memrise**: Instead of a full-fledged course, use the apps to...
34,421
[ { "from": "human", "value": "As best-behaved as I try to be about keeping my unit tests disconnected from the database, etc. etc, it still seems inevitable that my day will be interrupted by small regular enforced breaks while I wait for my machine to do something boring.\n\nI personally find swordfighting ...
I have a base page, BasePage, that raises an event that displays messages to the user. Works great on all pages derived from BasePage. I want to do the same thing from user controls, but they don't inherit from BasePage. What I want is a central place that I can call from anywhere and in that code it will raise an e...
To achieve your goal of having a central method for displaying messages from anywhere in your application, including user controls that don't inherit from `BasePage`, you can utilize a few different approaches. Here are a couple of recommended methods: ### 1. **Create a Static Helper Class** You can create a static h...
35,460
[ { "from": "human", "value": "I have a base page, BasePage, that raises an event that displays messages to the user. Works great on all pages derived from BasePage. I want to do the same thing from user controls, but they don't inherit from BasePage. \nWhat I want is a central place that I can call from an...
can anybody show me how to build a string using checkbox. what would be the best way to do this. for example i have 4 checkbox's each with its own value (valueA, valueB, valueC, valueD) the thing is i want to display each result in different lines. result if B & C is selected : valueB valueC and how would i display ...
To build a string from checkboxes in a web application, you can use HTML and JavaScript (or jQuery) to capture the selected values. Below is a simple implementation that captures the values of selected checkboxes and displays them line by line in a designated area. Also, I'll describe how to save this data into a datab...
28,621
[ { "from": "human", "value": "can anybody show me how to build a string using checkbox. what would be the best way to do this.\nfor example i have 4 checkbox's each with its own value (valueA, valueB, valueC, valueD)\nthe thing is i want to display each result in different lines.\nresult if B & C is selected...
When using urllib2 (and maybe urllib) on windows python seems to magically pick up the authenticated proxy setting applied to InternetExplorer. However, it doesn't seem to check and process the Advance setting "Exceptions" list. Is there a way I can get it to process the exceptions list? Or, ignore the IE proxy setti...
You're correct that when using `urllib2` (or `urllib` in Python 3), Python will automatically pick up the proxy settings from Internet Explorer on Windows. However, as you've discovered, it does not honor the "Exceptions" list defined in the advanced settings of Internet Explorer. If you want to ignore the system prox...
31,699
[ { "from": "human", "value": "When using urllib2 (and maybe urllib) on windows python seems to magically pick up the authenticated proxy setting applied to InternetExplorer. However, it doesn't seem to check and process the Advance setting \"Exceptions\" list.\nIs there a way I can get it to process the exc...
We have an installation of MOSS 2007 that is using MS SQL 2000 as the backend database. The web front end for MOSS is on one server and the database on a separate server. We would like to move the database to a MS SQL 2005 server. Is there a recommended approach for doing this? Does anyone know of any resources tha...
Migrating from SQL Server 2000 to SQL Server 2005 for a SharePoint 2007 (MOSS) installation involves several steps and careful planning. Below are the recommended approaches, tips, and resources that will help you through the migration process. ### Recommended Approach for Migration: 1. **Pre-Migration Planning:** ...
30,783
[ { "from": "human", "value": "We have an installation of MOSS 2007 that is using MS SQL 2000 as the backend database. The web front end for MOSS is on one server and the database on a separate server. We would like to move the database to a MS SQL 2005 server. Is there a recommended approach for doing thi...
When I serialize; public class SpeedDial { public string Value { get; set; } public string TextTR { get; set; } public string TextEN { get; set; } public string IconId { get; set; } } It results: <SpeedDial> <Value>110</Value> <TextTR>Yangın</TextTR> <TextEN>Fire</TextEN> <IconId>39</Ic...
To achieve the desired XML serialization format in C#, you'll need to use attributes to customize the output of the serialized XML. The `XmlElement` and `XmlRoot` attributes are particularly useful for this purpose. Here's how you can modify the `SpeedDial` class to achieve your desired XML structure: ```csharp usin...
34,506
[ { "from": "human", "value": "When I serialize;\npublic class SpeedDial\n{\n public string Value { get; set; }\n public string TextTR { get; set; }\n public string TextEN { get; set; }\n public string IconId { get; set; }\n}\n\nIt results:\n<SpeedDial>\n <Value>110</Value>\n <TextTR>Yangın<...
What are the pros and cons of LINQ (Language-Integrated Query)? What are the best and worst cases in which to use LINQ? How have you benefitted or not benefitted from using LINQ? Which data sources benefit the least and the most from LINQ?
### Pros and Cons of LINQ (Language-Integrated Query) #### Pros: 1. **Conciseness**: LINQ allows for writing more concise and readable code compared to traditional query methods. This can improve maintainability. 2. **Strongly Typed**: Since LINQ is integrated into the language, it benefits from compile-time type chec...
32,141
[ { "from": "human", "value": "\nWhat are the pros and cons of LINQ (Language-Integrated Query)?\nWhat are the best and worst cases in which to use LINQ?\nHow have you benefitted or not benefitted from using LINQ?\nWhich data sources benefit the least and the most from LINQ?\n\n" }, { "from": "gpt", ...
I have written a CSS sprite auto-generator which takes selected images out of the HTML page and converts them to CSS sprites, but right now it does not attempt to lay them out optimally but rather just stacks them, which wastes a lot of space. What would be the best algorithm for determining the optimal layout? To sta...
To address the problem of optimally laying out rectangles into a single larger rectangle, which minimizes the area, you can employ various algorithms. The problem is a well-known one in computer science, often referred to as the "rectangle packing problem." Here are some strategies and algorithms that can help you in i...
34,657
[ { "from": "human", "value": "I have written a CSS sprite auto-generator which takes selected images out of the HTML page and converts them to CSS sprites, but right now it does not attempt to lay them out optimally but rather just stacks them, which wastes a lot of space. What would be the best algorithm f...
I can see people asking all the time whether multiple inheritance should be included into the next version of C# or Java. C++ folks, who are fortunate enough to have this ability, say that this is like giving someone a rope to eventually hang themselves. What’s the matter with multiple inheritance? Are there any concr...
Multiple inheritance refers to a feature in object-oriented programming languages where a class can inherit characteristics and behaviors (methods and properties) from more than one parent class. While it offers some advantages, such as increased code reuse and flexibility, it can also lead to a range of complexities a...
31,857
[ { "from": "human", "value": "I can see people asking all the time whether multiple inheritance should be included into the next version of C# or Java. C++ folks, who are fortunate enough to have this ability, say that this is like giving someone a rope to eventually hang themselves. \nWhat’s the matter with...
This is a little convoluted, but lets try: I'm integrating LUA scripting into my game engine, and I've done this in the past on win32 in an elegant way. On win32 all I did was to mark all of the functions I wanted to expose to LUA as export functions. Then, to integrate them into LUA, I'd parse the PE header of the exe...
Integrating Lua scripting into your game engine on iOS (which is based on Unix) can indeed be a little tricky, especially when compared to Windows. You’re on the right track with using `dlopen` and `dlsym`, but there are a few nuances and limitations to consider on iOS. ### Steps to Expose Functions to Lua on iOS 1. ...
34,939
[ { "from": "human", "value": "This is a little convoluted, but lets try:\nI'm integrating LUA scripting into my game engine, and I've done this in the past on win32 in an elegant way. On win32 all I did was to mark all of the functions I wanted to expose to LUA as export functions. Then, to integrate them in...
I have a site directory for html (dreamweaver CSS3) with lots of subdirectories that contain HTML files for a number of drop down menus. They work fine where they are, but they all have menus that are JavaScript and could be kept in a separate file. So, I want to use Include. I don't want to have to FTP my files to Hos...
It looks like you are on the right track with setting up XAMPP to run your local web server. However, there are a couple of things you should check to ensure everything is set up correctly: ### 1. **Correct Directory Structure** Make sure your directory structure within the `htdocs` folder is correct. The path you sho...
35,953
[ { "from": "human", "value": "I have a site directory for html (dreamweaver CSS3) with lots of subdirectories that contain HTML files for a number of drop down menus. They work fine where they are, but they all have menus that are JavaScript and could be kept in a separate file. So, I want to use Include. I ...
I'm looking at the MVC account controller, and it seems to be from ASP.NET webforms. Is there any good background information on how to use it? Can you map it to a user database table or is it better to roll your own user management? How do you make use of it in MVC to restrict what pages a logged in user can view? Do...
The ASP.NET Membership system was a part of the ASP.NET Web Forms framework and provided a way to manage user accounts, including authentication, authorization, and profile management. With the advent of ASP.NET MVC, Microsoft introduced a more modern approach with the ASP.NET Identity system, which provides a more fle...
35,495
[ { "from": "human", "value": "I'm looking at the MVC account controller, and it seems to be from ASP.NET webforms. Is there any good background information on how to use it?\nCan you map it to a user database table or is it better to roll your own user management?\nHow do you make use of it in MVC to restric...
I need to style a table to have rounded corners. I'm just looking at how best to go about it: Normally when I style a div to have rounded corners, I use 2 divs with empty comments at the top and bottom, and apply sizing & background image CSS to them. The table, however, has internal borders, so I'd have to carefully ...
Yes, your understanding is clear, and you've identified some common challenges with styling tables, especially with rounded corners and internal borders. Using background images and overlays can be a viable approach, but there are generally easier and more flexible methods using CSS. Here are some options you can cons...
35,461
[ { "from": "human", "value": "I need to style a table to have rounded corners.\nI'm just looking at how best to go about it:\nNormally when I style a div to have rounded corners, I use 2 divs with empty comments at the top and bottom, and apply sizing & background image CSS to them.\nThe table, however, has...
Here is a snippet of the code : HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(request.RawUrl); WebRequest.DefaultWebProxy = null;//Ensure that we will not loop by going again in the proxy HttpWebResponse response = (HttpWebResponse)webRequest.GetResponse(); string charSet = response.CharacterSet; Encodi...
It looks like you're experiencing an issue with character encoding when fetching the HTML content from a URL. The problem you're encountering with special characters like "é" not displaying correctly usually stems from improper encoding handling. The code you provided attempts to read the response stream using the cha...
24,080
[ { "from": "human", "value": "Here is a snippet of the code :\nHttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(request.RawUrl);\nWebRequest.DefaultWebProxy = null;//Ensure that we will not loop by going again in the proxy\nHttpWebResponse response = (HttpWebResponse)webRequest.GetResponse();\ns...
We need a web content accelerator for static images to sit in front of our Apache web front end servers Our previous hosting partner used Tux with great success and I like the fact it's part of Red Hat Linux which we're using, but its last update was in 2006 and there seems little chance of future development. Our ISP ...
Hi Ian, It sounds like you're making great progress in finding the right solution for your web content acceleration needs. Let's break down your options: Tux, Squid, and Varnish, focusing on compatibility, reliability, future support, and performance in high-traffic environments. ### Tux - **Compatibility**: Tux is a...
34,319
[ { "from": "human", "value": "We need a web content accelerator for static images to sit in front of our Apache web front end servers\nOur previous hosting partner used Tux with great success and I like the fact it's part of Red Hat Linux which we're using, but its last update was in 2006 and there seems lit...
We're working on a project that requires the ripping of audio tracks from CDs to MP3s (ideally also retrieving the track information from CDDB or similar). More background information: Various music labels send us CDs of music which we then deliver to people via an online delivery system. We're looking at automating th...
To create a simple desktop application for ripping audio tracks from CDs to MP3s and retrieving track information, you'll need to consider several components: audio ripping, metadata retrieval, and the user interface for your staff. Below is a structured approach to help you get started: ### 1. **Technology Stack** Ch...
31,051
[ { "from": "human", "value": "We're working on a project that requires the ripping of audio tracks from CDs to MP3s (ideally also retrieving the track information from CDDB or similar).\nMore background information: Various music labels send us CDs of music which we then deliver to people via an online deliv...
We need to write unit tests for a wxWidgets application using Google Test Framework. The problem is that wxWidgets uses the macro IMPLEMENT_APP(MyApp) to initialize and enter the application main loop. This macro creates several functions including int main(). The google test framework also uses macro definitions for e...
To unit test a wxWidgets application without entering the main event loop, you'll want to create a test environment that initializes the wxWidgets framework and your application without running it. This means setting up the necessary components of your `MyApp` class and ensuring that your application state is properly ...
32,332
[ { "from": "human", "value": "We need to write unit tests for a wxWidgets application using Google Test Framework.\nThe problem is that wxWidgets uses the macro IMPLEMENT_APP(MyApp) to initialize and enter the application main loop. This macro creates several functions including int main(). The google test f...
Has anyone developed a PHP based Client for a WCF Service? I'm in the process of completing a WCF Service for my work. Only I don't expect the client to be running on the .Net Stack. I expect PHP (LAMP) will be the norm. Are there some obvious pitfalls to avoid? I'm not running with any security (BasicHTTPBinding)
Yes, it's possible to develop a PHP client to consume a WCF (Windows Communication Foundation) service. While WCF services are typically used with .NET clients, PHP can still interact with them through standard protocols such as HTTP and SOAP. Here are some steps and tips to help you successfully build your PHP client,...
30,790
[ { "from": "human", "value": "Has anyone developed a PHP based Client for a WCF Service? I'm in the process of completing a WCF Service for my work. Only I don't expect the client to be running on the .Net Stack. I expect PHP (LAMP) will be the norm. \nAre there some obvious pitfalls to avoid?\nI'm not ru...
How can I correctly serve WSDL of a WCF webservice located in a private LAN from behind a reverse proxy listening on public IP? I have an Apache webserver configured in reverse proxy mode which listens for requests on a public IP address and serves them from the internal IIS host. WCF webservice generates WSDL using th...
To serve a WCF service behind a reverse proxy and ensure that the WSDL contains the correct public address instead of the internal address, you can use a few configuration options in your WCF application's `web.config`. ### Option 1: Use the `baseAddress` and `serviceEndpoints` You can set the `baseAddress` for your...
33,261
[ { "from": "human", "value": "How can I correctly serve WSDL of a WCF webservice located in a private LAN from behind a reverse proxy listening on public IP?\nI have an Apache webserver configured in reverse proxy mode which listens for requests on a public IP address and serves them from the internal IIS ho...
I am working on a Visual Studio 2008 project that is already added to TFS server. I am not sure which settings and policies have been configured for the TFS (this is done by a separate dept, not developers) Every time I make an edit to a code file , the file is checked out automatically (without explicitly checking out...
In Visual Studio 2008, the automatic checkout behavior that you are experiencing is typically influenced by the TFS settings, and sometimes by the way Visual Studio is configured to work with source control. To address your concern, you can look into the following aspects: ### 1. Check Source Control Settings in Visua...
30,826
[ { "from": "human", "value": "I am working on a Visual Studio 2008 project that is already added to TFS server.\nI am not sure which settings and policies have been configured for the TFS (this is done by a separate dept, not developers)\nEvery time I make an edit to a code file , the file is checked out aut...
I have inherited a django+fastcgi application which needs to be modified to perform a lengthy computation (up to half an hour or more). What I want to do is run the computation in the background and return a "your job has been started" -type response. While the process is running, further hits to the url should return ...
To implement a long-running background task in a Django application, the typical approach is to use a task queue. This not only helps in managing long-running tasks but also provides a clean way to handle their execution, including task monitoring, retries, and result retrieval. The most common libraries for this purpo...
29,497
[ { "from": "human", "value": "I have inherited a django+fastcgi application which needs to be modified to perform a lengthy computation (up to half an hour or more). What I want to do is run the computation in the background and return a \"your job has been started\" -type response. While the process is runn...
I'm having a hard time determining what characters must be escaped when using Perl's qr{} construct I'm attempting to create a multi-line precompiled regex for text that contains a myriad of normally escaped characters (#*.>:[]) and also contains another precompiled regex. Additionally I need to match as strictly as po...
In Perl's regex, certain characters have special meanings and need to be escaped if you want to match them literally. For your regex, you are dealing with a few special characters, such as `#`, `*`, `.`, `:`, `>`, `[` and `]`. Let's go through what you need to escape and how to construct your regex properly. ### Speci...
35,372
[ { "from": "human", "value": "I'm having a hard time determining what characters must be escaped when using Perl's qr{} construct\nI'm attempting to create a multi-line precompiled regex for text that contains a myriad of normally escaped characters (#*.>:[]) and also contains another precompiled regex. Addi...
What are some key UI design tips that every developer should know? While there are a number of UI resources for developers (for example, Joel Spolsky's User Interface Design for Programmers), I'm interested in more of a bullet list that can be communicated in 1 to 2 pages. I'm interested in more tactical, day-to-day UI...
Here’s a concise bullet list of key UI design tips that every developer should keep in mind for day-to-day work. These tips focus on tactical elements that can enhance user experience and make interfaces more intuitive. ### General Principles 1. **Consistency is Key**: Maintain consistent design patterns (buttons, col...
33,346
[ { "from": "human", "value": "What are some key UI design tips that every developer should know?\nWhile there are a number of UI resources for developers (for example, Joel Spolsky's User Interface Design for Programmers), I'm interested in more of a bullet list that can be communicated in 1 to 2 pages.\nI'm...
Where can I find comprehensive documentation for MOQ? I'm just starting with mocking and am having difficulty getting my head around it. I've read through all the links at http://code.google.com/p/moq/wiki/QuickStart but can't seem to find a tutorial or gentle introduction. I have also looked briefly at Rhino Mocks but...
To work with Moq for testing whether an event was raised, particularly for events that are part of the `INotifyPropertyChanged` interface, follow these steps. I'll guide you through mocking and checking if the `PropertyChanged` event has been triggered. 1. **Create a Mock of Your Class**: You can create a mock of your...
32,756
[ { "from": "human", "value": "Where can I find comprehensive documentation for MOQ? I'm just starting with mocking and am having difficulty getting my head around it. I've read through all the links at http://code.google.com/p/moq/wiki/QuickStart but can't seem to find a tutorial or gentle introduction.\nI h...
I have just started to look at .NET 3.5 so please forgive me if this type of question have been asked before. I am struggling with a decent usage for extension methods, in that I have just downloaded suteki shop an MVC ecommerce offering. In this project there is a pretty standard Repository pattern that extends IRepos...
Your question touches on some fundamental aspects of design patterns and the use of extension methods in C#. Let’s break down your concerns and look at both the benefits and potential pitfalls of using extension methods with repositories. ### Understanding Extension Methods Extension methods are a powerful feature in...
35,370
[ { "from": "human", "value": "I have just started to look at .NET 3.5 so please forgive me if this type of question have been asked before. I am struggling with a decent usage for extension methods, in that I have just downloaded suteki shop an MVC ecommerce offering. In this project there is a pretty standa...
My company has a requirement that all production sites pass an AppScan security scan. Sometimes, when we scan a SharePoint installation, the software detects a blind SQL injection vulnerability. I'm pretty sure this is a false positive--AppScan is probably interpreting some other activity in the HTTP response as succes...
It's good to be thorough in ensuring that your SharePoint installations are secure, and you're right to question the validity of the SQL injection vulnerability detected by AppScan. ### SharePoint and SQL Injection 1. **Use of Stored Procedures**: - Both MOSS (Microsoft Office SharePoint Server) 2007 and WSS (Win...
36,050
[ { "from": "human", "value": "My company has a requirement that all production sites pass an AppScan security scan. Sometimes, when we scan a SharePoint installation, the software detects a blind SQL injection vulnerability. I'm pretty sure this is a false positive--AppScan is probably interpreting some othe...
We have some methods that call File.Copy, File.Delete, File.Exists, etc. How can we test these methods without actually hitting the file system? I consider myself a unit testing n00b, so any advice is appreciated.
To test methods that interact with the file system without actually hitting the file system, you can use a technique called "mocking." Mocking allows you to create simulated objects that mimic the behavior of real objects in a controlled way. In the case of file operations, you can mock the file system interactions so ...
33,027
[ { "from": "human", "value": "We have some methods that call File.Copy, File.Delete, File.Exists, etc. How can we test these methods without actually hitting the file system?\nI consider myself a unit testing n00b, so any advice is appreciated.\n" }, { "from": "gpt", "value": "To test methods th...
I have an app built against MVC Preview 3 (referencing local copies of the MVC assemblies) that I'm trying to modify/test on a machine with the ASP.NET MVC beta installed. I am not interesting in updating this app to run against MVC beta yet - I just need to make a few small changes. It's failing with MissingMethodExc...
To resolve your issue with loading the correct version of the ASP.NET MVC assembly, you have a couple of options: ### Option 1: Load Preview 3 Assembly Using Shadow Copying One of the easiest ways to avoid conflicts with the GAC is to create an isolated environment where your application can run without interference ...
32,837
[ { "from": "human", "value": "I have an app built against MVC Preview 3 (referencing local copies of the MVC assemblies) that I'm trying to modify/test on a machine with the ASP.NET MVC beta installed. I am not interesting in updating this app to run against MVC beta yet - I just need to make a few small ch...
I have the following legacy code: public class MyLegacyClass { private static final String jndiName = "java:comp/env/jdbc/LegacyDataSource" public static SomeLegacyClass doSomeLegacyStuff(SomeOtherLegacyClass legacyObj) { // do stuff using jndiName } } This class is working in a J2EE-Container....
To test your `MyLegacyClass` outside of a J2EE container, you can refactor the code to make it more testable by allowing a way to inject a mock or a real data source during testing. Since you're allowed to refactor and don't want to introduce additional runtime frameworks, a good strategy would be to apply the Dependen...
33,781
[ { "from": "human", "value": "I have the following legacy code:\npublic class MyLegacyClass\n{\n private static final String jndiName = \"java:comp/env/jdbc/LegacyDataSource\"\n\n public static SomeLegacyClass doSomeLegacyStuff(SomeOtherLegacyClass legacyObj)\n {\n // do stuff using jndiName\n...
Recently I had to move one of my web applications to a new hosting provider. The mail and web service is still held on the old hosting site however, when I try to send an email from the new server,I get an error; "The server rejected one or more recipient addresses. The server response was: 450 <email_address>: Recipi...
To implement POP before SMTP in C#, you'll need to connect to the POP3 server first to authenticate using valid credentials, and then you can send an email via the SMTP server. Here's a simplified example of how to do this using the `MailKit` library, which provides easy-to-use classes for both POP3 and SMTP operations...
34,297
[ { "from": "human", "value": "Recently I had to move one of my web applications to a new hosting provider. The mail and web service is still held on the old hosting site however, when I try to send an email from the new server,I get an error; \n\"The server rejected one or more recipient addresses. The serve...
Is keeping JMS connections / sessions / consumer always open a bad practice? Code draft example: // app startup code ConnectionFactory cf = (ConnectionFactory)jndiContext.lookup(CF_JNDI_NAME); Connection connection = cf.createConnection(user,pass); Session session = connection.createSession(true,Session.TRANSACTIONAL)...
Keeping JMS (Java Message Service) connections, sessions, and consumers open for a prolonged period can lead to several issues, such as resource leaks, potential bottlenecks, and problems with connection health and management. However, whether or not it's a bad practice depends on the application's specific use case, t...
29,392
[ { "from": "human", "value": "Is keeping JMS connections / sessions / consumer always open a bad practice?\nCode draft example:\n// app startup code\n\nConnectionFactory cf = (ConnectionFactory)jndiContext.lookup(CF_JNDI_NAME);\nConnection connection = cf.createConnection(user,pass);\nSession session = conne...
What are the pro/cons of doing web development on your local machine rather than on a centralized development server? For those that do dev on your local machine, how do you keep an updated db architecture for local development when multiple developers are involved? In particular, I'm currently experimenting with XAMPP...
Web development can be approached in various ways, and choosing between local development on your machine versus using a centralized development server has its own set of pros and cons. Here’s a breakdown of these factors: ### Pros of Local Development: 1. **Speed and Performance**: Local development is generally fast...
33,686
[ { "from": "human", "value": "What are the pro/cons of doing web development on your local machine rather than on a centralized development server? For those that do dev on your local machine, how do you keep an updated db architecture for local development when multiple developers are involved?\nIn particul...
I would be interested to learn about large scale development in Python and especially in how do you maintain a large code base? When you make incompatibility changes to the signature of a method, how do you find all the places where that method is being called. In C++/Java the compiler will find it for you, how do you...
Transitioning from statically typed languages like C++ and Java to a dynamically typed language like Python can be challenging, especially when dealing with large-scale projects. However, Python has several features and best practices that can help you effectively manage a large code base. Below, I’ll address your spec...
29,441
[ { "from": "human", "value": "I would be interested to learn about large scale development in Python and especially in how do you maintain a large code base?\n\nWhen you make incompatibility changes to the signature of a method, how do you find all the places where that method is being called. In C++/Java th...
I am writing an application which blocks on input from two istreams. Reading from either istream is a synchronous (blocking) call, so, I decided to create two Boost::threads to do the reading. Either one of these threads can get to the "end" (based on some input received), and once the "end" is reached, both input stre...
Handling multiple blocking `istream` reads in separate threads can be tricky, especially when you want to terminate one thread based on the status of the other. Here are a few strategies you can employ to achieve your goal while ensuring proper cleanup: ### 1. Use a Shared Flag with `std::atomic` One simple approach ...
32,495
[ { "from": "human", "value": "I am writing an application which blocks on input from two istreams.\nReading from either istream is a synchronous (blocking) call, so, I decided to create two Boost::threads to do the reading.\nEither one of these threads can get to the \"end\" (based on some input received), a...
I have a JSF application that consists of two JSPs: login.jsp & main.jsp. I have the following faces-config.xml: <lifecycle> <phase-listener>package.programs.scorecard.beans.EventBean</phase-listener> </lifecycle> <managed-bean> <managed-bean-name>FormBean</managed-bean-name> <managed-bean-class>package.programs....
It sounds like you've gone through quite a journey diagnosing the issue with your JSF application, and it's great that you've identified the problem with the third-party component. Your solution to switch to a standard `h:selectOneMenu` shows a solid approach to resolving the issue. ### JSF Lifecycle Overview For cl...
34,154
[ { "from": "human", "value": "I have a JSF application that consists of two JSPs: login.jsp & main.jsp.\nI have the following faces-config.xml:\n<lifecycle>\n <phase-listener>package.programs.scorecard.beans.EventBean</phase-listener>\n</lifecycle>\n<managed-bean>\n <managed-bean-name>FormBean</managed-bea...
Subject says it all but he background: I want to trigger some TortoiseSVN action from a batch file? I suspect that I can do this by calling the right exe with the right args but I'd rather find a way to solve the more general problem of doing an arbitrary action. Edit: The reason that I don't just use svn directly is t...
TortoiseSVN is designed primarily as a GUI client for Subversion, and while it provides extensive right-click options in Windows Explorer, it does not offer a built-in command-line interface like the standard `svn` client does. However, you can still trigger TortoiseSVN actions from a batch file using the TortoiseSVN c...
34,920
[ { "from": "human", "value": "Subject says it all but he background:\nI want to trigger some TortoiseSVN action from a batch file? I suspect that I can do this by calling the right exe with the right args but I'd rather find a way to solve the more general problem of doing an arbitrary action.\nEdit: The rea...
I am wondering if there are any well-known algorithms that I should be aware of for spacing objects visually. For instance, a LINQ to SQL diagram has many tables but automatically spaces them for readability. Is this pretty much a "place randomly and move if too close/overlap" type algorithm or is there more to this? ...
When it comes to automatically spacing and arranging objects in a visual representation, such as a diagram with tables, there are several algorithms and techniques that are commonly used. While the "place randomly and move if too close/overlap" method can work for simple scenarios, it often leads to suboptimal layouts ...
34,510
[ { "from": "human", "value": "I am wondering if there are any well-known algorithms that I should be aware of for spacing objects visually.\nFor instance, a LINQ to SQL diagram has many tables but automatically spaces them for readability. Is this pretty much a \"place randomly and move if too close/overlap...
I seem to be in the minority, but to be honest I am not comfortable with linq and don't see any benefits in my personal development (not to say there are no benefits, just a personal opinion based on my situation). I build web applications (.net, .net mvc) and I love having part of my data layer in stored procedures. ...
Your discomfort with LINQ (Language Integrated Query) is shared by some developers, and there are several valid reasons why some may choose to avoid it or stick with alternatives like stored procedures. Here are a few reasons some developers prefer not to use LINQ, along with considerations related to your context of b...
35,072
[ { "from": "human", "value": "I seem to be in the minority, but to be honest I am not comfortable with linq and don't see any benefits in my personal development (not to say there are no benefits, just a personal opinion based on my situation).\nI build web applications (.net, .net mvc) and I love having par...
I am having a .cs file, i need to execute that file.. I don't have experience in C#.. Please help.. Do we have to install any software to run it.. Currently i am using windows XP.. Please help me...
To run a C# (.cs) file on a Windows XP machine, you'll need to set up the .NET Framework and a way to compile and execute your C# code. Here's a step-by-step guide: ### Step 1: Install the .NET Framework 1. **Check .NET Framework**: Windows XP usually comes with .NET Framework 1.1, but most C# projects require newer ...
32,594
[ { "from": "human", "value": "I am having a .cs file, i need to execute that file.. \nI don't have experience in C#.. Please help.. Do we have to install any software to run it.. \nCurrently i am using windows XP.. \nPlease help me... \n" }, { "from": "gpt", "value": "To run a C# (.cs) file on a ...
What's the most pythonic way to scp a file in Python? The only route I'm aware of is os.system('scp "%s" "%s:%s"' % (localfile, remotehost, remotefile) ) which is a hack, and which doesn't work outside Linux-like systems, and which needs help from the Pexpect module to avoid password prompts unless you already have ...
For SCP file transfers in Python, you can indeed use the `paramiko` library along with `scp`. While `paramiko` alone doesn’t support SCP directly, the `scp` module (which is based on `paramiko`) can be used to achieve what you need. Here’s how you can implement SCP using the `paramiko` and `scp` libraries. You’ll fir...
34,138
[ { "from": "human", "value": "What's the most pythonic way to scp a file in Python? The only route I'm aware of is \nos.system('scp \"%s\" \"%s:%s\"' % (localfile, remotehost, remotefile) )\n\nwhich is a hack, and which doesn't work outside Linux-like systems, and which needs help from the Pexpect module to...
Is there a way using JSF to group two or more columns under a single parent column in JSF? I have a dataTableEx with hx:columnEx columns inside of it. What I want is something like this: [MAIN HEADER FOR COL1+2 ][Header for Col 3+4] [ COL1 Header][COL2 Header][COL3 ][COL 4 ] Data Data ...
In JSF, specifically when using the `h:dataTable` component, you can create a parent header that spans multiple columns by utilizing the `rowspan` and `colspan` attributes within your table header (`h:column`). Here's a simple way to achieve the desired layout you described. Here's an example of how you can implement ...
35,106
[ { "from": "human", "value": "Is there a way using JSF to group two or more columns under a single parent column in JSF? I have a dataTableEx with hx:columnEx columns inside of it. What I want is something like this:\n [MAIN HEADER FOR COL1+2 ][Header for Col 3+4]\n\n [ COL1 Header][COL2 Header][COL3 ][...
I have developed in C++ many years ago, but these days I am primarily a Java software engineer. Given I own an iPhone, am ready to spring for a MacBook next month, and am generally interested in getting started with Mac OS developmentmt (using Objective C), I thought I would just put this question out there: What Next...
It sounds like you're embarking on an exciting journey into Mac OS development! Below, I'll break down your questions and provide suggestions on resources, expectations, and differences you might encounter as you transition from Java to Objective-C development. ### Recommended Books: 1. **Programming in Objective-C 2....
21,694
[ { "from": "human", "value": "I have developed in C++ many years ago, but these days I am primarily a Java software engineer. Given I own an iPhone, am ready to spring for a MacBook next month, and am generally interested in getting started with Mac OS developmentmt (using Objective C), I thought I would ju...
I'm going to rebuild my Linux box [yet] again. I have to create a few user groups, user accounts and install my standard packages. Until now I've just used the GUI tools. I was wondering if anyone has any recommendations on writing a script to create users, groups and install standard packages after I do a minimal i...
Creating a script that can automate the setup of user accounts, groups, and standard packages on both Fedora and Ubuntu is a great idea. Below is an example shell script that you can customize according to your needs. The script includes sections for creating user groups, creating user accounts, and installing packages...
35,289
[ { "from": "human", "value": "I'm going to rebuild my Linux box [yet] again. I have to create a few user groups, user accounts and install my standard packages. Until now I've just used the GUI tools. I was wondering if anyone has any recommendations on writing a script to create users, groups and install...
When using a Silverlight-enabled WCF service, where is the best place to instantiate the service and to call the CloseAsync() method? Should you say, instantiate an instance each time you need to make a call to the service, or is it better to just instantiate an instance as a variable of the UserControl that will be ma...
When working with a Silverlight-enabled WCF service, managing the service client instances properly is essential for optimal performance and resource management. Here are some best practices regarding instantiating the service and calling `CloseAsync()`: ### Instantiation of the Service Client 1. **Singleton Pattern ...
33,874
[ { "from": "human", "value": "When using a Silverlight-enabled WCF service, where is the best place to instantiate the service and to call the CloseAsync() method?\nShould you say, instantiate an instance each time you need to make a call to the service, or is it better to just instantiate an instance as a v...
I have a collection of custom entity objects one property of which is an ArrayList of byte arrays. The custom entity is serializable and the collection property is marked with the following attributes: [XmlArray("Images"), XmlArrayItem("Image",typeof(byte[]))] So I serialize a collection of these custom entities and pa...
Based on the information you provided, it seems like you're encountering an issue with the deserialization of your `myCustomEntity` objects, specifically with the child collection. The fact that the `byte[]` array is being serialized correctly but the child collection is empty after deserialization suggests a potential...
35,128
[ { "from": "human", "value": "I have a collection of custom entity objects one property of which is an ArrayList of byte arrays.\nThe custom entity is serializable and the collection property is marked with the following attributes: [XmlArray(\"Images\"), XmlArrayItem(\"Image\",typeof(byte[]))]\nSo I seriali...
i need write the code that runs when DllRegisterServer is called. i.e. when someone calls: regsvr32 myActiveX.ocx i'm trying to find the definitive list of required registry entries (rather than just what i can cobble together by spellunking through the registry). So far my expeditions have found: HKEY_CLASSES_ROOT ...
When implementing `DllRegisterServer` for an ActiveX control, the registry entries you are creating define the properties of your control. Let's break down your questions and provide some details on the entries and their meanings. ### 1. Control Folder The presence of the `Control` folder in the CLSID key indicates th...
32,304
[ { "from": "human", "value": "i need write the code that runs when DllRegisterServer is called. i.e. when someone calls:\nregsvr32 myActiveX.ocx\n\ni'm trying to find the definitive list of required registry entries (rather than just what i can cobble together by spellunking through the registry).\nSo far my...
I'm looking for Ruby's Active record for PHP. Something that is so simple that I just define my fields, extend the base ORM class, and I get ACID operations for free. I should get default getters and setters without writing any code, but overriding a default getter or setter is as easy as declaring get$fieldName or set...
If you're looking for a simple, Ruby on Rails-like ORM experience for PHP that allows you to define your fields and get ACID operations without a lot of boilerplate, consider using **Eloquent**, which is part of the Laravel framework, or **RedBeanPHP**. ### Eloquent (Laravel ORM) **Why Eloquent?** 1. **Active Record ...
34,028
[ { "from": "human", "value": "I'm looking for Ruby's Active record for PHP. Something that is so simple that I just define my fields, extend the base ORM class, and I get ACID operations for free. I should get default getters and setters without writing any code, but overriding a default getter or setter is ...
I had a nifty small tool written to convert spreadsheets to plain text. Since it was my private hacker tool, it relied on OpenOffice 2.x to read the files. But when I installed OpenOffice 3 and tried to get it get it to run, I failed miserably, because I'm either missing some JAR files or half the classes have been rep...
When transitioning from OpenOffice 2.x to OpenOffice 3.x, there were significant changes in the API and the way components are packaged, which can lead to issues like the one you're experiencing. Here are some steps and pointers that might help you resolve the missing classes and make your tool compatible with OpenOffi...
35,809
[ { "from": "human", "value": "I had a nifty small tool written to convert spreadsheets to plain text.\nSince it was my private hacker tool, it relied on OpenOffice 2.x to read the files.\nBut when I installed OpenOffice 3 and tried to get it get it to run, I failed miserably, because I'm either missing some ...
When running an integration test (Web Service talking to JDBC, in this case) how do you force the database to throw an error so that the resulting soap fault can be inspected? I'm using Spring's Transactional Test Framework, so would be unreasonable to just issue a DROP TABLE whatever; to break it? :D
To simulate a database error during an integration test in a controlled manner, especially when using Spring's Transactional Test Framework, you can use the following approaches instead of running destructive commands like `DROP TABLE`. ### 1. Use Invalid Data One common way to force an error is to insert invalid dat...
31,442
[ { "from": "human", "value": "When running an integration test (Web Service talking to JDBC, in this case) how do you force the database to throw an error so that the resulting soap fault can be inspected?\nI'm using Spring's Transactional Test Framework, so would be unreasonable to just issue a DROP TABLE w...
I have one aspx page with some controls. Also i have one DIV which is dynamically populated from AJAX call. This AJAX call return couple of controls, for example HtmlInputText1 and HtmlInputText2. When page is submitted, I can get values from this controls through Request.Form. If possible access to the attributes of ...
When you dynamically generate controls on a web page using AJAX, those controls do not automatically exist in the server-side code-behind until you explicitly recreate them on postback. This means that attributes of controls created via AJAX, like `HtmlInputText1.Height`, cannot be directly accessed in the code-behind ...
33,991
[ { "from": "human", "value": "I have one aspx page with some controls. \nAlso i have one DIV which is dynamically populated from AJAX call.\nThis AJAX call return couple of controls, for example HtmlInputText1 and HtmlInputText2.\nWhen page is submitted, I can get values from this controls through Request.Fo...
I work in a Windows environment and would prefer to deploy code to IIS. At the same time I would like to code in Python. Having read that IIS can run fastCGI application, I went to the IIS site where it describes in detail how to get PHP up and running but not much about anything else. Does anyone have experience getti...
Yes, you can definitely run Python applications on IIS using FastCGI, which is more efficient than traditional CGI. Here’s a step-by-step guide to help you set up a Python framework (like Flask or Django) to work with IIS. ### Step 1: Install Python 1. **Download and Install Python**: If you haven’t done so already, ...
14,428
[ { "from": "human", "value": "I work in a Windows environment and would prefer to deploy code to IIS. At the same time I would like to code in Python.\nHaving read that IIS can run fastCGI application, I went to the IIS site where it describes in detail how to get PHP up and running but not much about anythi...
What is the most efficient way to create a constant (never changes at runtime) mapping of strings to ints? I've tried using a const Dictionary, but that didn't work out. I could implement a immutable wrapper with appropriate semantics, but that still doesn't seem totally right. For those who have asked, I'm implemen...
If you're looking for a way to create a constant mapping of strings to integers in C#, and you want to do this efficiently without using a mutable dictionary, there are a couple of good approaches you can consider: ### 1. Using a `readonly` Dictionary Although a `const` dictionary is not possible, you can create a `r...
32,986
[ { "from": "human", "value": "What is the most efficient way to create a constant (never changes at runtime) mapping of strings to ints? \nI've tried using a const Dictionary, but that didn't work out. \nI could implement a immutable wrapper with appropriate semantics, but that still doesn't seem totally rig...
I'm looking at setting up a small company that hosts flash-based websites for artist portfolios. The customer control panel would be django-powered, and would provide the interface for uploading their images, managing galleries, selling prints, etc. Seeing as the majority of traffic to the hosted sites would end up at...
Setting up a small company to host flash-based artist portfolios using Django, lighttpd or nginx, and Apache is an interesting idea, but there are several factors and potential pitfalls you should consider: ### 1. **Flash Deprecation:** - Flash is now considered obsolete, and most modern browsers have removed suppo...
31,036
[ { "from": "human", "value": "I'm looking at setting up a small company that hosts flash-based websites for artist portfolios. The customer control panel would be django-powered, and would provide the interface for uploading their images, managing galleries, selling prints, etc.\nSeeing as the majority of t...
I have a problem whereby I want to display a view differently (a different master page), depending on where it came from, but don't know where to start... I have several routes which catch various different types of urls that contain different structures. In the code snippet below, I have a product route, and then I ha...
Yes, it is indeed possible to implement this functionality where you can display a view with a different master page depending on the route or source of the request. Here's how you can achieve this in an ASP.NET MVC application. ### Step 1: Set Up Your Routes You already have your routes defined in `RouteConfig.cs`. ...
35,610
[ { "from": "human", "value": "I have a problem whereby I want to display a view differently (a different master page), depending on where it came from, but don't know where to start...\nI have several routes which catch various different types of urls that contain different structures.\nIn the code snippet b...
I am building authentication into a client-server application, and some of the feedback I've received is that I should leave the hash calculation to the server (it was initially implemented to have the client receive the hash, calculate a hash from the client's entered password, and compare them). That seems to make s...
When it comes to designing a secure authentication mechanism for a client-server application that needs to support offline access, there are several key considerations and options to evaluate. Balancing security, user experience, and offline functionality is essential. ### Options for Offline Authentication 1. **Loca...
33,281
[ { "from": "human", "value": "I am building authentication into a client-server application, and some of the feedback I've received is that I should leave the hash calculation to the server (it was initially implemented to have the client receive the hash, calculate a hash from the client's entered password,...
I need to model a system where by there will be a team who will consist of users who perform roles in the team and have skills assigned to them. i.e. a team A 5 members, one performs the team leader role, all perform the reply to email role, but some have an extra skill to answer the phone I'm trying to determine how I...
To model a system that defines teams, users, roles, and skills, you can utilize an entity-relationship (ER) model. This type of model is effective for representing the relationships between different entities in your system. Here's a breakdown of how you can structure this model: ### Entities and Relationships 1. **U...
26,282
[ { "from": "human", "value": "I need to model a system where by there will be a team who will consist of users who perform roles in the team and have skills assigned to them.\ni.e. a team A 5 members, one performs the team leader role, all perform the reply to\nemail role, but some have an extra skill to ans...
How can I test Controller.ViewData.ModelState? I would prefer to do it without any mock framework.
Testing `Controller.ViewData.ModelState` in ASP.NET MVC can be achieved without using any mocking frameworks by directly creating instances of your controller and using real objects. Below, I'll walk you through a simple example of how to do this. ### Example: Testing Controller.ViewData.ModelState Assuming you have ...
33,757
[ { "from": "human", "value": "How can I test Controller.ViewData.ModelState? I would prefer to do it without any mock framework. \n" }, { "from": "gpt", "value": "Testing `Controller.ViewData.ModelState` in ASP.NET MVC can be achieved without using any mocking frameworks by directly creating ins...
Is there any reason why I should pick JSON over XML, or vice-versa if both are available? Tips for optimizing performance when dealing with data feeds are also appreciated!
Both JSON (JavaScript Object Notation) and XML (eXtensible Markup Language) are widely used formats for data interchange, but they have distinct characteristics and advantages depending on the use case. Here are some key points to consider when choosing between JSON and XML: ### Reasons to Choose JSON: 1. **Simplicit...
33,217
[ { "from": "human", "value": "Is there any reason why I should pick JSON over XML, or vice-versa if both are available? Tips for optimizing performance when dealing with data feeds are also appreciated!\n" }, { "from": "gpt", "value": "Both JSON (JavaScript Object Notation) and XML (eXtensible Ma...
I have a C# web application that needs to deploy a file to the client computer's hard drive. (A javascript file for Adobe Acrobat) If the client is using a mac, I have an applescript that will search their applications directory for acrobat and then deploy the JS file in the correct location. The problem is that I am c...
Yes, you can create an AppleScript dynamically on your Windows C# server, inserting the user's language-specific messages into the script, and then send it to the client. Below is a step-by-step guide on how you can achieve this. ### Step 1: Create the AppleScript Dynamically in C# You can create a method to generate...
32,774
[ { "from": "human", "value": "I have a C# web application that needs to deploy a file to the client computer's hard drive. (A javascript file for Adobe Acrobat)\nIf the client is using a mac, I have an applescript that will search their applications directory for acrobat and then deploy the JS file in the co...
I have a project where there are multiple applications that have some common configuration values. I would like to have a shared .config file that is available to all of the applications using the .Net configuration object model. Each application would also have its own app.config file How can this best be done. I'd ra...
Using a shared configuration file across multiple .NET applications while maintaining their individual `app.config` files is a common requirement. The approach you mentioned, using the `OpenExeConfiguration(string exePath)` method, can work well for accessing a specified configuration file. However, there are other str...
35,318
[ { "from": "human", "value": "I have a project where there are multiple applications that have some common configuration values. I would like to have a shared .config file that is available to all of the applications using the .Net configuration object model. Each application would also have its own app.conf...
I need to pack all my js, but need to edit it going into source control. is there a nice easy plugin for ccnet, or nant, that will allow me to pack my js, and store them in the same files on the way out to production. Not really looking for file combining, just minifying each file.
To achieve minification of your JavaScript files while retaining the original files for source control, you can use a combination of tools such as `Nant`, `CCNet` (CruiseControl.NET), and a minification tool like `UglifyJS` or `Terser`. Here's a simple approach to set this up: ### Using Nant with UglifyJS 1. **Instal...
33,997
[ { "from": "human", "value": "I need to pack all my js, but need to edit it going into source control.\nis there a nice easy plugin for ccnet, or nant, that will allow me to pack my js, and store them in the same files on the way out to production.\nNot really looking for file combining, just minifying each ...
I recently have been moving a bunch of MP3s from various locations into a repository. I had been constructing the new file names using the ID3 tags (thanks, TagLib-Sharp!), and I noticed that I was getting a System.NotSupportedException: "The given path's format is not supported." This was generated by either File.C...
Your approach to sanitizing file paths is sound, but it can indeed be simplified and made more efficient. Instead of creating a list of bad characters and using multiple loops to replace them, you could use a single pass to replace invalid characters in the path. Additionally, we can leverage `StringBuilder` for better...
36,041
[ { "from": "human", "value": "I recently have been moving a bunch of MP3s from various locations into a repository. I had been constructing the new file names using the ID3 tags (thanks, TagLib-Sharp!), and I noticed that I was getting a System.NotSupportedException: \n\n\"The given path's format is not supp...
Say I have an array of strings in a php array called $foo with a few hundred entries, and I have a MySQL table 'people' that has a field named 'name' with a few thousand entries. What is an efficient way to find out which strings in $foo aren't a 'name' in an entry in 'people' without submitting a query for every stri...
To efficiently check which strings in your PHP array `$foo` are not present in the MySQL `people` table, you can utilize a single SQL query instead of making a separate query for each string. This can be done by using the `NOT IN` clause or a `LEFT JOIN`. Here’s a step-by-step approach: ### Step 1: Prepare the Data Fi...
34,948
[ { "from": "human", "value": "Say I have an array of strings in a php array called $foo with a few hundred entries, and I have a MySQL table 'people' that has a field named 'name' with a few thousand entries. What is an efficient way to find out which strings in $foo aren't a 'name' in an entry in 'people' ...
I am exporting a report from MS Access(2003) to Excel (97-2003) output. One of the columns has a character string that is numeric for some rows e.g. "05-0880". When I open the output file in MS Excel the corresponding cell is set to the number -372424. I assume this is caused by Excel being "clever" and deciding that ...
The behavior you are experiencing is indeed a common issue when exporting data from Access to Excel, as Excel tries to interpret certain strings as dates or numbers. Unfortunately, the export process can sometimes cause undesired conversions like the one you're seeing. ### Workarounds to Prevent Excel from Converting ...
35,206
[ { "from": "human", "value": "I am exporting a report from MS Access(2003) to Excel (97-2003) output.\nOne of the columns has a character string that is numeric for some rows e.g. \"05-0880\". \nWhen I open the output file in MS Excel the corresponding cell is set to the number -372424.\nI assume this is cau...
This project is the probable first step in migrating a large CMS from Classic ASP to .Net. I'd like to use LINQ for querying the DB. Does anyone have any ideas for strategies to make this happen? I understand this is a vague question at this point, but I'm gathering information. Thanks, KevDog
Migrating a large CMS from Classic ASP to .NET is a significant undertaking, but it can be approached systematically to minimize risks and ensure a smooth transition. Here are some strategies and considerations to help you make this happen: ### 1. Assess the Current System - **Audit Your Existing Code**: Review your C...
30,380
[ { "from": "human", "value": "This project is the probable first step in migrating a large CMS from Classic ASP to .Net. I'd like to use LINQ for querying the DB.\nDoes anyone have any ideas for strategies to make this happen? I understand this is a vague question at this point, but I'm gathering information...
I'm writing a WCF service and want to expose some custom configuration elements (e.g. Custom ConfigurationSection and ConnectionStringSettings) so that I can modify the service's configuration. One of my custom configuration elements inherits from System.Configuration.ConfigurationElementCollection. When I try to star...
When you are trying to expose a custom configuration section that inherits from `System.Configuration.ConfigurationElementCollection` in a WCF service, you run into serialization issues because WCF requires types to be serializable with the `DataContract` and `DataMember` attributes for proper communication. Since `Co...
34,112
[ { "from": "human", "value": "I'm writing a WCF service and want to expose some custom configuration elements (e.g. Custom ConfigurationSection and ConnectionStringSettings) so that I can modify the service's configuration. \nOne of my custom configuration elements inherits from System.Configuration.Configur...
We have Core2 machines (Dell T5400) with XP64. We observe that when running 32-bit processes, the performance of memcpy is on the order of 1.2GByte/s; however memcpy in a 64-bit process achieves about 2.2GByte/s (or 2.4GByte/s with the Intel compiler CRT's memcpy). While the initial reaction might be to just explain t...
The performance difference you are observing between 32-bit and 64-bit processes in terms of memory copy (memcpy) performance can be attributed to several factors, including architecture differences and how the operating system handles memory operations. 1. **WOW64 Overhead**: When running 32-bit applications on a 64-...
29,210
[ { "from": "human", "value": "We have Core2 machines (Dell T5400) with XP64.\nWe observe that when running 32-bit processes,\nthe performance of memcpy is on the order of\n1.2GByte/s; however memcpy in a 64-bit process\nachieves about 2.2GByte/s (or 2.4GByte/s\nwith the Intel compiler CRT's memcpy). While t...
We have a major VB6 trading application which uses MS Access (Don't ask!) It is always blasting trades into an MS Access database. The rest of the infrastructure here has moved on considerably and I want to read this Access database periodically and copy any new trades into a SQL server database. The SQL and C# needed ...
To read from an MS Access database without locking it (and thus allowing concurrent access from the VB6 trading application), you'll want to ensure that your connection string and the way you open your connection support shared access. In .NET, using OLE DB is the most common way to connect to an MS Access database. ...
34,826
[ { "from": "human", "value": "We have a major VB6 trading application which uses MS Access (Don't ask!) It is always blasting trades into an MS Access database.\nThe rest of the infrastructure here has moved on considerably and I want to read this Access database periodically and copy any new trades into a S...
I have a undirected graph with about 100 nodes and about 200 edges. One node is labelled 'start', one is 'end', and there's about a dozen labelled 'mustpass'. I need to find the shortest path through this graph that starts at 'start', ends at 'end', and passes through all of the 'mustpass' nodes (in any order). ( http...
To find the shortest path through your graph that starts at the 'start' node, ends at the 'end' node, and visits all the 'mustpass' nodes, you're effectively looking to solve a variation of the Traveling Salesman Problem (TSP) with specific constraints. Here’s a step-by-step approach to solving the problem: ### Step ...
33,469
[ { "from": "human", "value": "I have a undirected graph with about 100 nodes and about 200 edges. One node is labelled 'start', one is 'end', and there's about a dozen labelled 'mustpass'.\nI need to find the shortest path through this graph that starts at 'start', ends at 'end', and passes through all of t...
My teams evolution of TDD includes what appear to be departures from traditional oop. Moving away from classes that are self sufficient We still encapsulate data where appropriate. But in order to mock any helper classes, we usually create some way to externally set them via constructor or mutator. We don't use priva...
Your team's approach to Test-Driven Development (TDD) and object-oriented programming (OOP) certainly reflects a shift in mindset that prioritizes testability and flexibility over traditional encapsulation practices. Here are some thoughts on the aspects you've raised: ### Moving Away from Self-Sufficient Classes - **...
35,056
[ { "from": "human", "value": "My teams evolution of TDD includes what appear to be departures from traditional oop.\n\nMoving away from classes that are self sufficient \nWe still encapsulate data where appropriate. But in order to mock any helper classes, we usually create some way to externally set them vi...
Is there a better way I can fill out a spread sheet on a web server (using asp.net) than using interop? EDIT: I wasn't very clear as to what I require: I have a template that I must use that is provided by our customer. In the template are some macros that are password protected that I do not have access to so I cannot...
When dealing with Excel files on a web server using ASP.NET, especially when you are required to use a specific template and can't modify the macros, it's important to find an approach that doesn't rely on Microsoft Office Interop due to performance and stability concerns. Here are some alternatives you might consider:...
32,526
[ { "from": "human", "value": "Is there a better way I can fill out a spread sheet on a web server (using asp.net) than using interop?\nEDIT: I wasn't very clear as to what I require:\nI have a template that I must use that is provided by our customer. In the template are some macros that are password protect...
What are the advantages of rendering a control like this: <% Html.RenderPartial("MyControl") %> or <%=Html.TextBox("txtName", Model.Name) %> over the web Forms style: <uc1:MyControl ID=MyControl runat=server /> I understand that performance can be one reason because no object needs to be created but having the possib...
You're right in recognizing that ASP.NET MVC and Web Forms have different approaches to rendering controls and managing state. Here are some of the advantages of the MVC-style rendering approach (`Html.RenderPartial`, `Html.TextBox`, etc.) over the Web Forms approach (`<uc1:MyControl ...>`): ### Advantages of MVC Rend...
34,696
[ { "from": "human", "value": "What are the advantages of rendering a control like this:\n<% Html.RenderPartial(\"MyControl\") %> or\n<%=Html.TextBox(\"txtName\", Model.Name) %>\n\nover the web Forms style:\n<uc1:MyControl ID=MyControl runat=server />\n\nI understand that performance can be one reason because...
I want to create an Ant buildfile, that includes some files as a sort of plugin. So if I want to activate a feature in a project - say pmd-checking - I copy a pmd.xml in a directory and the build.xml get on the start the idea, that pmd.xml exists and imports it, so that new targets can be available to the build. But th...
To achieve your goal of conditionally including additional targets in an Ant build file based on the existence of certain files (like `pmd.xml`), you can utilize the `property` task along with the `import` task, but with a clever approach since `import` can only be used at the top level. Here's a strategy to dynamica...
33,148
[ { "from": "human", "value": "I want to create an Ant buildfile, that includes some files as a sort of plugin.\nSo if I want to activate a feature in a project - say pmd-checking - I copy a pmd.xml in a directory and the build.xml get on the start the idea, that pmd.xml exists and imports it, so that new tar...
Recently I have been studying recursion; how to write it, analyze it, etc. I have thought for a while that recurrence and recursion were the same thing, but some problems on recent homework assignments and quizzes have me thinking there are slight differences, that 'recurrence' is the way to describe a recursive progra...
Let's break down your questions regarding recurrences, recursion, and how to derive them for programs, as well as understand the Master Theorem. ### Recursion vs. Recurrence 1. **Recursion** refers to the process of a function calling itself directly or indirectly to solve a problem. 2. **Recurrence** is an equation ...
28,685
[ { "from": "human", "value": "Recently I have been studying recursion; how to write it, analyze it, etc. I have thought for a while that recurrence and recursion were the same thing, but some problems on recent homework assignments and quizzes have me thinking there are slight differences, that 'recurrence' ...
We have the TAncestor class which has a virtual method GetFile. We will have some TDescendant = class(TAncestor) which may override GetFile. We want to insure that in such a case those overriden methods do not call inherited in their implementation. But if they don't implement GetFile and just use the one from TAncesto...
Enforcing that derived classes do not call `inherited` from an overridden method while still allowing them to use the default implementation if they don't override the method is a challenging design requirement. Here are a couple of approaches you could consider: ### 1. Use a Flag in the Base Class You can introduce ...
35,248
[ { "from": "human", "value": "We have the TAncestor class which has a virtual method GetFile.\nWe will have some TDescendant = class(TAncestor) which may override GetFile.\nWe want to insure that in such a case those overriden methods do not call inherited in their implementation.\nBut if they don't implemen...
Let's say you have a dynamic language (similar to common scripting languages) and want to write a compiler for it. Is it good idea to reserve some bits of a machine word for something like type tags? Especially for microcontrollers and similar devices, is it a good idea? I can think of some advantages like reduced stor...
Reserving bits of a machine word for type tags in a dynamic language, especially on microcontrollers and similar devices, is an interesting design decision that comes with both advantages and trade-offs. Here are some considerations to help you evaluate this approach: ### Advantages: 1. **Reduced Storage for Type Inf...
33,139
[ { "from": "human", "value": "Let's say you have a dynamic language (similar to common scripting languages) and want to write a compiler for it. Is it good idea to reserve some bits of a machine word for something like type tags? Especially for microcontrollers and similar devices, is it a good idea?\nI can ...
I want to change a flash object enclosed within with jQuery after an onClick event. The code I wrote, essentially: $(enclosing div).html(''); $(enclosing div).html(<object>My New Object</object>); works in Firefox but not in IE. I would appreciate pointers or suggestions on doing this. Thanks.
To change a Flash object using jQuery in a way that works across different browsers, including Internet Explorer, you need to ensure that you properly handle the object replacement and follow the correct HTML structure for the `<object>` tag. Here are some suggestions to accomplish this: ### 1. Use jQuery’s `.replaceW...
32,099
[ { "from": "human", "value": "I want to change a flash object enclosed within with jQuery after an onClick event. The code I wrote, essentially:\n$(enclosing div).html('');\n$(enclosing div).html(<object>My New Object</object>);\n\nworks in Firefox but not in IE. I would appreciate pointers or suggestions o...
My InstallShield installer doesn't appear to register several of its COM DLLs correctly, even though I have refreshed the COM information for them in the installer. If I manually run regsvr32 after installation, everything is fine. I notice that after installation, I have InprocServer32 values in the registry for my c...
It sounds like you're dealing with a classic issue of COM registration and InstallShield's handling of COM components. Here's a breakdown of the issues and potential solutions: ### Understanding Darwin Descriptors Darwin descriptors are a form of encoded path used in Windows to register COM components. They can somet...
31,605
[ { "from": "human", "value": "My InstallShield installer doesn't appear to register several of its COM DLLs correctly, even though I have refreshed the COM information for them in the installer. If I manually run regsvr32 after installation, everything is fine.\nI notice that after installation, I have Inpr...
I have a asp.net page where i query a list of url and the groups in the urls. In the code behind i loop through each group and create a group header and then list all of the links. something like this: Group 1 Link 1 Link 2 Link 3 Group 2 Link 1 Link 2 Link 3 Now that i have a lot of links, this create one lon...
To improve the layout of your ASP.NET page and avoid a long list that requires excessive scrolling, you can utilize a multi-column layout or incorporate a tabbed interface to categorize the links. Below are a few suggestions along with example code snippets to help you achieve a more organized and visually appealing pr...
23,285
[ { "from": "human", "value": "I have a asp.net page where i query a list of url and the groups in the urls. In the code behind i loop through each group and create a group header and then list all of the links. \nsomething like this:\nGroup 1\n Link 1\n Link 2\n Link 3\nGroup 2\n Link 1\n Link 2\n Link 3\n...
This loop is slower than I would expect, and I'm not sure where yet. See anything? I'm reading an Accces DB, using client-side cursors. When I have 127,000 rows with 20 columns, this loop takes about 10 seconds. The 20 columns are string, int, and date types. All the types get converted to ANSI strings before th...
There are a few areas in your loop that can be optimized, which may help reduce the total execution time. Here are some suggestions: ### 1. **Buffer Management for `ostringstream`:** Using `ostringstream` can incur overhead due to dynamic memory allocations as the buffer grows. You can reserve an initial size to mitig...
33,431
[ { "from": "human", "value": "This loop is slower than I would expect, and I'm not sure where yet. See anything?\nI'm reading an Accces DB, using client-side cursors. When I have 127,000 rows with 20 columns, this loop takes about 10 seconds. The 20 columns are string, int, and date types. All the typ...
I have an OLE COM object that trying to write a wrapper for, I have decided to start to use TDD to write the code for it as I believe that it will give me a better sense of direction with what I'm try to write. The COM object has a interface like this: Interface Mapinfo Sub [Do](ByVal cmd As String) Function E...
Using Test-Driven Development (TDD) for creating a wrapper around an OLE COM object is a great approach, especially for creating a clean interface that can be tested independently of the actual COM object's behavior. The primary problem you're facing is the overhead of starting and interacting with the COM application ...
32,784
[ { "from": "human", "value": "I have an OLE COM object that trying to write a wrapper for, I have decided to start to use TDD to write the code for it as I believe that it will give me a better sense of direction with what I'm try to write. The COM object has a interface like this:\nInterface Mapinfo\n S...
Has anybody used the ATK Framework? It is claimed to be geared toward developing apps for business use. Manipulating data, knowledge bases, etc... This is what I primarily develop (on the side-for my own use). The site hasn't given me a great overview of why it may be better than other frameworks. What are your th...
The ATK Framework (Advanced Toolkit for Knowledge) is indeed aimed at building business applications and offers a structured approach to developing web applications, particularly those that involve data manipulation and management. Here are some points to consider based on its features, usability, and how it compares t...
35,967
[ { "from": "human", "value": "Has anybody used the ATK Framework? It is claimed to be geared toward developing apps for business use. Manipulating data, knowledge bases, etc... This is what I primarily develop (on the side-for my own use). The site hasn't given me a great overview of why it may be bette...
I am trying to make a view slide from top to bottom. This is not a big deal, I used CABasicAnimation for this. The problem is when I want to remove the view. I use this animation. CABasicAnimation *animation; animation = [CABasicAnimation animationWithKeyPath:@"position"]; [animation setDelegate:self]; animation.toValu...
The issue you're facing is due to the fact that when you add the `CABasicAnimation` to the layer, it animates the layer's properties but does not actually change the layer's final position. After the animation completes, the layer remains in its original position unless you update its properties accordingly. To resolve...
35,822
[ { "from": "human", "value": "I am trying to make a view slide from top to bottom. This is not a big deal, I used CABasicAnimation for this. The problem is when I want to remove the view. I use this animation.\nCABasicAnimation *animation;\nanimation = [CABasicAnimation animationWithKeyPath:@\"position\"];\n...
Is this seen as an in efficient prime number generator. It seems to me that this is pretty efficient. Is it the use of the stream that makes the program run slower? I am trying to submit this to SPOJ and it tells me that my time limit exceeded... #include <iostream> #include <sstream> using namespace std; int main()...
The approach you've taken to generate prime numbers in the given range has a couple of inefficiencies that might lead to a "Time Limit Exceeded" (TLE) error on competitive programming platforms like SPOJ. Let's go through your implementation and identify where optimizations can be made. ### Issues with the current imp...
34,576
[ { "from": "human", "value": "Is this seen as an in efficient prime number generator. It seems to me that this is pretty efficient. Is it the use of the stream that makes the program run slower?\nI am trying to submit this to SPOJ and it tells me that my time limit exceeded... \n#include <iostream>\n#include...
I have an input type="image". This acts like the cell notes in Microsoft Excel. If someone enters a number into the text box that this input-image is paired with, I setup an event handler for the input-image. Then when the user clicks the image, they get a little popup to add some notes to the data. My problem is that ...
To achieve your goal of disabling the event handler for the input type="image" when the user enters zero into the associated text box, you'll need to modify the event handler conditionally based on the value of the text box. Here's an example of how you could implement this behavior in jQuery: 1. Set up the initial e...
34,442
[ { "from": "human", "value": "I have an input type=\"image\". This acts like the cell notes in Microsoft Excel. If someone enters a number into the text box that this input-image is paired with, I setup an event handler for the input-image. Then when the user clicks the image, they get a little popup to add ...
How do you do your Hibernate session management in a Java Desktop Swing application? Do you use a single session? Multiple sessions? Here are a few references on the subject: http://www.hibernate.org/333.html http://blog.schauderhaft.de/2008/09/28/hibernate-sessions-in-two-tier-rich-client-applications/ http://in.rel...
In a Java Desktop Swing application, Hibernate session management is a critical aspect that impacts performance, data consistency, and user experience. The approach to session management often depends on the specific requirements of the application, such as its size, complexity, and the nature of the data being handled...
34,835
[ { "from": "human", "value": "How do you do your Hibernate session management in a Java Desktop Swing application? Do you use a single session? Multiple sessions?\nHere are a few references on the subject:\n\nhttp://www.hibernate.org/333.html\nhttp://blog.schauderhaft.de/2008/09/28/hibernate-sessions-in-two-...
I always hear that programmers try to pick the right tool for the job. I've never programmed in Java, so I was wondering What are its benefits? Why is it so popular? What should I use it for? I just program recreationally. Is there anything about it that makes it particularly fun??
Java is a highly popular programming language that has been around since the mid-1990s. Its continued use and relevance in the tech industry can be attributed to several key benefits and characteristics: ### Benefits of Java 1. **Platform Independence**: Java is designed to be platform-independent at both the source ...
32,798
[ { "from": "human", "value": "I always hear that programmers try to pick the right tool for the job. I've never programmed in Java, so I was wondering What are its benefits? Why is it so popular? What should I use it for?\nI just program recreationally. Is there anything about it that makes it particular...
There's a requirement that we will need to support querying a local SQL Server database for new data when the database is updated. Since these are external SQL Server databases, we may not be able to use SQL Server Notification Services nor can we make any changes to the database. My basic idea is to watch for data...
Monitoring database activity at the file system level for changes in a SQL Server database can be quite complex, especially if you do not have direct access to modify the database or use built-in SQL Server features like Notification Services or Service Broker. However, I can provide some insights on how you might appr...
33,591
[ { "from": "human", "value": "There's a requirement that we will need to support querying a local SQL Server database for new data when the database is updated. Since these are external SQL Server databases, we may not be able to use SQL Server Notification Services nor can we make any changes to the databa...
I'm looking for an OSX (or Linux?) application that can recieve data from a webcam/video-input and let you do some image processing on the pixels in something similar to c or python or perl, not that bothered about the processing language. I was considering throwing one together but figured I'd try and find one that ex...
There are several applications and libraries available for macOS and Linux that allow you to capture video input from a webcam and perform image processing. Here are some options you might consider: ### 1. **OpenCV** - **Language**: C++, Python, Java, etc. - **Description**: OpenCV (Open Source Computer Vision Library...
34,083
[ { "from": "human", "value": "I'm looking for an OSX (or Linux?) application that can recieve data from a webcam/video-input and let you do some image processing on the pixels in something similar to c or python or perl, not that bothered about the processing language.\nI was considering throwing one togethe...
What is the best way to pass data between a C server to a Java applet? Currently it's done by using a buffer and copying bytes to it using memcpy, but if the object ever changes I have to hunt down every instance of where it's being sent to the applet and have it changed. Is there a better way to pass object to java? H...
Passing data between a C server and a Java applet can be tricky, especially given the challenges with maintaining compatibility when data structures change. Since your current approach involves using a buffer and `memcpy`, here are some alternatives that might provide better maintainability, efficiency, and ease of use...
33,809
[ { "from": "human", "value": "What is the best way to pass data between a C server to a Java applet? Currently it's done by using a buffer and copying bytes to it using memcpy, but if the object ever changes I have to hunt down every instance of where it's being sent to the applet and have it changed.\nIs th...
I have a list of items that I am displaying in a floated list, with each item in the list at a fixed width so that there's two per row. What is the best practice to prevent this horrible thing from happening: alt text http://x01.co.uk/floated_items.gif Possibilites: Trim to a specified number of characters before disp...
It sounds like you're dealing with a layout issue caused by floated elements and varying content lengths. Here are a few best practices and solutions to consider: ### 1. Use Flexbox Instead of using floats, consider using CSS Flexbox for your layout. Flexbox handles varying content sizes better and allows for more con...
29,150
[ { "from": "human", "value": "I have a list of items that I am displaying in a floated list, with each item in the list at a fixed width so that there's two per row. What is the best practice to prevent this horrible thing from happening:\nalt text http://x01.co.uk/floated_items.gif\nPossibilites:\n\nTrim to...
How do I load MS Word document (.doc and .docx) to memory (variable) without doing this?: wordApp.Documents.Open I don't want to open MS Word, I just want that text inside. You gave me answer for DOCX, but what about DOC? I want free and high performance solution - not to open 12.000 instances of Word to process all ...
If you're looking to read the content of `.doc` and `.docx` files into memory without opening Microsoft Word, you can use libraries that are specifically designed for this purpose. Here are a couple of free and open-source options that you can use in Python or other languages: ### For Python 1. **python-docx**: - ...
31,306
[ { "from": "human", "value": "How do I load MS Word document (.doc and .docx) to memory (variable) without doing this?:\nwordApp.Documents.Open \nI don't want to open MS Word, I just want that text inside. \nYou gave me answer for DOCX, but what about DOC? I want free and high performance solution - not to o...
I typically run a script each night that updates my code from SVN, then builds it. The last few days I have a long debug run I'd like to start at night so it can go through the hour or two it takes to hit the error before I come in the next morning. The way I've done this so far is to VPN in later in the evening to sta...
You can automate running a macro in Visual Studio using a couple of approaches. Here are two possible methods for you to execute a macro in an active instance of Visual Studio or launch a new instance that runs a macro: ### Method 1: Using Visual Studio's DTE (Development Tools Environment) You can create a Visual St...
34,517
[ { "from": "human", "value": "I typically run a script each night that updates my code from SVN, then builds it. The last few days I have a long debug run I'd like to start at night so it can go through the hour or two it takes to hit the error before I come in the next morning. The way I've done this so far...
Currently I'm tasked with doing the daily build. We have an ASP.NET 2005 website with a SQL Server 2005 backend. Our current source control is Visual Source Safe 2005. At this point, I use the brute-force method of daily builds. Get Latest version of source code Get Latest version of Database release script Backup o...
Automating your daily builds can save you time and reduce the potential for human error. Here are the steps you can take to develop a fully fleshed-out plan for automating your daily builds for your ASP.NET 2005 website with a SQL Server 2005 backend: ### 1. **Define the Objectives** - Reduce manual effort in the b...
34,817
[ { "from": "human", "value": "Currently I'm tasked with doing the daily build. We have an ASP.NET 2005 website with a SQL Server 2005 backend. Our current source control is Visual Source Safe 2005.\nAt this point, I use the brute-force method of daily builds.\n\nGet Latest version of source code\nGet Lates...
I am developing a map control in WPF with C#. I am using a canvas control e.g. 400 x 200 which is assigned a map area of e.g. 2,000m x 1,000m. The scale of the map would be: canvas_size_in_meters / real_size_in_meters. I want to find the canvas_size_in_meters. The canvas.ActualWidth gives the Width in DIU's (Device In...
To measure the size of a WPF control in inches accurately, regardless of the screen resolution and DPI settings, you can follow these steps: 1. **Use the VisualTreeHelper to Get the Actual Size**: You can get the actual size of the control in pixels using `ActualWidth` and `ActualHeight` properties. 2. **Obtain the D...
34,495
[ { "from": "human", "value": "I am developing a map control in WPF with C#. I am using a canvas control e.g. 400 x 200 which is assigned a map area of e.g. 2,000m x 1,000m.\nThe scale of the map would be: canvas_size_in_meters / real_size_in_meters.\nI want to find the canvas_size_in_meters.\nThe canvas.Act...
There are some good examples on how to calculate word frequencies in C#, but none of them are comprehensive and I really need one in VB.NET. My current approach is limited to one word per frequency count. What is the best way to change this so that I can get a completely accurate word frequency listing? wordFreq = New ...
To create a comprehensive word frequency counter in VB.NET, you can follow a structured approach that considers punctuation, case insensitivity, and handles multiple word counts accurately. Below is a sample implementation that builds on your existing code and improves it for better clarity and functionality. This ex...
29,999
[ { "from": "human", "value": "There are some good examples on how to calculate word frequencies in C#, but none of them are comprehensive and I really need one in VB.NET.\nMy current approach is limited to one word per frequency count. What is the best way to change this so that I can get a completely accura...
We are team of few Delphi developers who have been using VSS since years (I know it's a pity), but we don't use any of the advanced features of VCS, so it was working fine in many cases (but some times it was driving me crazy :( ). The good thing that we have with VSS that we use third-party plug-ins to integrate VSS ...
Migrating from Visual SourceSafe (VSS) can be a significant step for improving your version control workflow, especially as your projects grow larger. Here are some version control systems (VCS) that should meet your requirements, offering good integration with Delphi (D2007) and user-friendly interfaces: ### 1. **Git...
34,342
[ { "from": "human", "value": "We are team of few Delphi developers who have been using VSS since years (I know it's a pity), but we don't use any of the advanced features of VCS, so it was working fine in many cases (but some times it was driving me crazy :( ).\nThe good thing that we have with VSS that we ...
I am developing an application for PocketPC. When the application starts the custom function SetScreenOrientation(270) is called which rotates the screen. When the application closes the function SetScreenOrientation(0) is called which restores the screen orientation. This way the screen orientation isn't restored if t...
To properly manage screen orientation in your PocketPC application based on its lifecycle (start, minimize, maximize, and close), you'll want to use the relevant events available in your application framework. Here’s a general approach you can take using common event handlers: 1. **On Application Start**: Call `SetSc...
34,440
[ { "from": "human", "value": "I am developing an application for PocketPC. When the application starts the custom function SetScreenOrientation(270) is called which rotates the screen. When the application closes the function SetScreenOrientation(0) is called which restores the screen orientation.\nThis way ...
I have a nullable date in my database. I am connecting to it with a LinqDataSource, and binding with a FormView. It allows you to place dates fine, but if you remove the date I need it to insert the null value to the db. It is instead throwing an exception. <asp:TextBox ID="TxtStartDate" runat="server" ...
When you're working with nullable types in ASP.NET and trying to bind them using LINQ to SQL or Entity Framework, it's important to ensure that your code can handle null values appropriately. The issue you are facing is likely due to the fact that when you clear the `TextBox`, it is still passing an empty string to the...
34,619
[ { "from": "human", "value": "I have a nullable date in my database. I am connecting to it with a LinqDataSource, and binding with a FormView. It allows you to place dates fine, but if you remove the date I need it to insert the null value to the db. It is instead throwing an exception.\n<asp:TextBox ID=\"Tx...
I've been using the Java Pet Store and .Net Pet Store examples for years when comparing Java EE and .Net performance in an eBusiness type setting. Is there a better way to compare the performance of Java EE and .Net for this type of application? Update: As some have pointed out below, the implementation, framework ve...
Comparing the performance of Java EE and .NET for eBusiness applications can indeed be complex, and using mature examples like the Java Pet Store and .NET Pet Store is a common practice. However, to create a more comprehensive and valid comparison, consider the following approaches: ### 1. **Benchmarking Framework** ...
34,512
[ { "from": "human", "value": "I've been using the Java Pet Store and .Net Pet Store examples for years when comparing Java EE and .Net performance in an eBusiness type setting. \n Is there a better way to compare the performance of Java EE and .Net for this type of application?\nUpdate:\nAs some have pointed...