instruction
stringlengths
14
27.6k
completion
stringlengths
3
38.3k
__original_row_idx
int64
0
50k
conversations
listlengths
2
2
My Google-fu has failed me. In Python, are the following two tests for equality equivalent? n = 5 # Test one. if n == 5: print 'Yay!' # Test two. if n is 5: print 'Yay!' Does this hold true for objects where you would be comparing instances (a list say)? Okay, so this kind of answers my question: L = [] L.app...
You're correct in your understanding of the difference between the `==` operator and the `is` operator in Python. ### Equality Test: `==` - The `==` operator checks for **value equality**. This means it checks whether the values of the two operands are the same, regardless of whether they are the same object in memory...
12,103
[ { "from": "human", "value": "My Google-fu has failed me.\nIn Python, are the following two tests for equality equivalent?\nn = 5\n# Test one.\nif n == 5:\n print 'Yay!'\n\n# Test two.\nif n is 5:\n print 'Yay!'\n\nDoes this hold true for objects where you would be comparing instances (a list say)?\nOk...
I'm pulling my hair out on what should be an insanely simple problem. We are running WebSphere IHS (Apache) through an F5 BigIP. BigIP is doing the https translation for us. Our url (changed for web, not valid) is https://superniftyserver.com/lawson/portal. When someone types in just that without the slash after por...
It looks like you're facing an issue with handling the trailing slash using mod_rewrite in Apache, especially in conjunction with an F5 load balancer that is managing HTTPS. The goal here is to ensure that requests without the trailing slash get redirected to the version with the trailing slash, while maintaining the H...
14,157
[ { "from": "human", "value": "I'm pulling my hair out on what should be an insanely simple problem. We are running WebSphere IHS (Apache) through an F5 BigIP. BigIP is doing the https translation for us. Our url (changed for web, not valid) is https://superniftyserver.com/lawson/portal.\nWhen someone type...
There doesn't seem to be a dictionary.AddRange() method. Does anyone know a better way to copy the items to another dictionary without using a foreach loop. I'm using the System.Collections.Generic.Dictionary. This is for .NET 2.0.
In .NET 2.0, the `Dictionary<TKey, TValue>` class does not have an `AddRange()` method, and there are no built-in methods specifically for copying items between dictionaries without using a loop. However, you can create a new dictionary and use LINQ's `ToDictionary()` method, but since you're using .NET 2.0, LINQ is no...
7,036
[ { "from": "human", "value": "There doesn't seem to be a dictionary.AddRange() method. Does anyone know a better way to copy the items to another dictionary without using a foreach loop. \nI'm using the System.Collections.Generic.Dictionary. This is for .NET 2.0. \n" }, { "from": "gpt", "value": ...
We are running part of our app as a windows service and it needs to b able to access DSNs in order to import through ODBC. However there seem to be a lot of restrictions found through trial and error on what DSNs it can access. For example it seems that it cannot 1. access a system DSN unless the account that is run...
Accessing Data Source Names (DSNs) via ODBC in a Windows service can indeed be tricky due to several permissions and configuration constraints. Here’s a breakdown of the factors affecting DSN access in a Windows service: ### 1. Types of DSNs - **User DSNs**: These are specific to the user profile that created them. On...
10,680
[ { "from": "human", "value": "We are running part of our app as a windows service and it needs to b able to access DSNs in order to import through ODBC. However there seem to be a lot of restrictions found through trial and error on what DSNs it can access. For example it seems that it cannot \n1. access a...
On Linux/GCC I can use the -rpath flag to change an executables search path for shared libraries without tempering with environment variables. Can this also be accomplished on Windows? As far as I know, dlls are always searched in the executable's directory and in PATH. My scenario: I would like to put shared librar...
On Windows, the way dynamic linking works is indeed different from Linux, and there is no direct equivalent of the `-rpath` flag used in GCC. However, there are a few strategies you can use to manage shared library (DLL) loading locations in your Windows applications: ### 1. Set the DLL Search Path Programmatically Yo...
8,205
[ { "from": "human", "value": "On Linux/GCC I can use the -rpath flag to change an executables search path for shared libraries without tempering with environment variables.\nCan this also be accomplished on Windows? As far as I know, dlls are always searched in the executable's directory and in PATH. \nMy ...
I'm building an installer for an application. The user gets to select a datasource they have configured and nominate what type of database it is. I want to confirm that the database type is indeed Postgres, and if possible, what version of Postgres they are running by sending a SQL statement to the datasource.
To confirm that the database type is PostgreSQL and to retrieve its version, you can execute a SQL query against the datasource provided by the user. PostgreSQL has a built-in function that can help you fetch the version directly. Here's a simple SQL statement you can use: ```sql SELECT version(); ``` When executed,...
11,687
[ { "from": "human", "value": "I'm building an installer for an application. The user gets to select a datasource they have configured and nominate what type of database it is. I want to confirm that the database type is indeed Postgres, and if possible, what version of Postgres they are running by sending a...
I'm looking for: documentation blogs books ready-to-use pre-configured slice images services wrappers libraries tutorials ...anything that would make it easier to start using EC2 to host a Rails application.
Here’s a comprehensive list of resources to help you get started with using Amazon EC2 to host a Rails application: ### Documentation 1. **AWS EC2 Documentation**: The official documentation provides a thorough guide to get started with EC2. - [Amazon EC2 Documentation](https://docs.aws.amazon.com/ec2/index.html) ...
12,029
[ { "from": "human", "value": "I'm looking for:\n\ndocumentation\nblogs\nbooks\nready-to-use pre-configured slice images\nservices\nwrappers\nlibraries\ntutorials\n\n...anything that would make it easier to start using EC2 to host a Rails application.\n" }, { "from": "gpt", "value": "Here’s a comp...
A database that stores a lot of credit card information is an inevitable part of the system we have just completed. What I want though is ultimate security of the card numbers whereby we setup a mechanism to encrypt and decrypt but of ourselves cannot decrypt any given number. What I am after is a way to secure this i...
To achieve strong security for credit card information at the database level, especially when you want to ensure that even the system administrators cannot decrypt the card numbers, you can follow the principles of key management and strong encryption methodologies. Here are standard approaches and best practices you c...
7,327
[ { "from": "human", "value": "A database that stores a lot of credit card information is an inevitable part of the system we have just completed. What I want though is ultimate security of the card numbers whereby we setup a mechanism to encrypt and decrypt but of ourselves cannot decrypt any given number. \...
What is the best way of dynamically writing LINQ queries and Lambda expressions? I am thinking of applications where the end user can design business logic rules, which then must be executed. I am sorry if this is a newbie question, but it would be great to get best practices out of experience.
Creating dynamic LINQ queries and Lambda expressions based on user-defined business logic is a common requirement in applications that need flexibility. Here are some strategies and best practices to achieve this effectively: ### 1. Use Expression Trees Expression trees allow you to build dynamic queries in a more gra...
8,776
[ { "from": "human", "value": "What is the best way of dynamically writing LINQ queries and Lambda expressions? \nI am thinking of applications where the end user can design business logic rules, which then must be executed.\nI am sorry if this is a newbie question, but it would be great to get best practices...
According to this article Silverlight 2 Beta 2 supports the DataContractJsonSerializer object. But, when I try to use it VS says "Type 'DataContractJsonSerializer' is not defined". I have a method marked as ScriptableMember that gets called from JavaScript and is passed an Object. Inside this method I need to serial...
In Silverlight 2 Beta 2, the `DataContractJsonSerializer` is indeed not available. This class was introduced in later versions of Silverlight. In Silverlight 2, you will have to find alternative methods to serialize your JavaScript objects into JSON and save them in isolated storage. Here are a couple of approaches yo...
11,822
[ { "from": "human", "value": "According to this article Silverlight 2 Beta 2 supports the DataContractJsonSerializer object. But, when I try to use it VS says \n\n\"Type 'DataContractJsonSerializer' is not defined\".\n\nI have a method marked as ScriptableMember that gets called from JavaScript and is passed...
I have an interface that I have defined in C++ which now needs to be implemented in C#. What is the best way to go about this? I don't want to use COM at all in my interface definition. The way I have solved this right now is to to have two interface definitions, one in C++ and one in C#. I then expose the C# interface...
If you want to implement an interface in C# that mirrors an existing C++ interface without the need for COM or duplicate definitions, you have several options. Here are a few approaches you might consider: ### 1. Use C++/CLI C++/CLI is a language specification created by Microsoft that allows you to write managed code...
9,261
[ { "from": "human", "value": "I have an interface that I have defined in C++ which now needs to be implemented in C#. What is the best way to go about this? I don't want to use COM at all in my interface definition. The way I have solved this right now is to to have two interface definitions, one in C++ and ...
I'd like to build a pretty simple plug-in for Visual Studio, but I don't really know how this has to be done. Is this doable in (non-managed) C++? I'd like to know what resources you'd recommend me.
Building a Visual Studio plug-in (extension) can be a great way to customize and enhance the IDE to fit your needs. While most modern extensions for Visual Studio are typically built using .NET languages (like C# or VB.NET) with the Visual Studio SDK, you can create extensions using C++ as well, albeit with some limita...
9,214
[ { "from": "human", "value": "I'd like to build a pretty simple plug-in for Visual Studio, but I don't really know how this has to be done. Is this doable in (non-managed) C++? \nI'd like to know what resources you'd recommend me.\n" }, { "from": "gpt", "value": "Building a Visual Studio plug-in...
In a recent project I have nearly completed we used an architecture that as its top layer of interaction from the web/services layers uses XXXManager classes. For example, there is a windows services that runs on a scheduled basis that imports data from several diverse data sources into our system. Within this service...
Hi Chris, Thank you for sharing your architectural approach and the context of your project. Your use of Manager classes, such as `UserManager`, to encapsulate and orchestrate various actions related to users, including registration and notifications, is a common design pattern in many applications. However, it’s insi...
10,667
[ { "from": "human", "value": "In a recent project I have nearly completed we used an architecture that as its top layer of interaction from the web/services layers uses XXXManager classes. \nFor example, there is a windows services that runs on a scheduled basis that imports data from several diverse data so...
How can I print wstring in gdb?
To print a `std::wstring` in GDB (GNU Debugger), you can use the following methods: ### Method 1: Using `print` If you have a `std::wstring` variable, you can directly use the `print` command: ```gdb (gdb) print my_wstring_variable ``` However, this will typically print an internal representation, which might not b...
13,726
[ { "from": "human", "value": "How can I print wstring in gdb?\n" }, { "from": "gpt", "value": "To print a `std::wstring` in GDB (GNU Debugger), you can use the following methods:\n\n### Method 1: Using `print`\n\nIf you have a `std::wstring` variable, you can directly use the `print` command:\n\n...
I'm guessing I need to implement an NVelocityViewEngine and NVelocityView - but before I do I wanted to check to see if anyone has already done this. I can't see anything in the trunk for MVCContrib. I've already seen the post below - I'm looking specifically for something which works with Preview 5: Testing ScottGu: ...
It seems you're looking for an implementation of NVelocity as a view engine for ASP.NET MVC, particularly one that works with Preview 5. While MVCContrib has historically provided support for various view engines, it may not have a ready-made implementation for NVelocity. If you're not finding an existing solution in ...
14,139
[ { "from": "human", "value": "I'm guessing I need to implement an NVelocityViewEngine and NVelocityView - but before I do I wanted to check to see if anyone has already done this.\nI can't see anything in the trunk for MVCContrib.\nI've already seen the post below - I'm looking specifically for something whi...
I'd like to know if anyone has any first-hand experience with this dichotomy. A few blogs say the mysql extension is faster than mysqli. Is this true? And I'm only asking about speed. I know mysqli has features that are not present in the older extension.
The discussion about the speed difference between the older `mysql` extension and `mysqli` is a bit nuanced. Here are some key points to consider: 1. **MySQL Extension**: The original `mysql` extension was designed for PHP 5 and earlier. It is not supported in PHP 7 and later versions. It is considered outdated and do...
14,771
[ { "from": "human", "value": "I'd like to know if anyone has any first-hand experience with this dichotomy. A few blogs say the mysql extension is faster than mysqli. Is this true?\nAnd I'm only asking about speed. I know mysqli has features that are not present in the older extension.\n" }, { "fro...
I want to use a specific foreign language font for a Blackberry application. How is such a font created and loaded onto the Blackberry device? For example: ਪੰਜਾਬੀ
Creating and loading a specific foreign language font, like Punjabi, onto a BlackBerry application involves a few key steps. Here's an overview of the process: ### Step 1: Obtain or Create the Font 1. **Font File**: First, you need a font file that supports the desired language (in this case, Punjabi). You can either:...
8,230
[ { "from": "human", "value": "I want to use a specific foreign language font for a Blackberry application. How is such a font created and loaded onto the Blackberry device?\nFor example: ਪੰਜਾਬੀ \n" }, { "from": "gpt", "value": "Creating and loading a specific foreign language font, like Punjabi,...
I remember seeing a while ago that there is some method in maybe the Reflection namespace that would recursively run ToString() on all of an object's properties and format it nicely for display. Yes, I know everything I could want will be accessible through the debugger, but I'm wondering if anyone knows that command...
In .NET, there isn't a built-in method specifically in the Reflection namespace that automatically calls `ToString()` on all properties of an object recursively. However, you can create a method using reflection to achieve this. Here's a simple example of how you might implement such a method. This method iterates thr...
11,048
[ { "from": "human", "value": "I remember seeing a while ago that there is some method in maybe the Reflection namespace that would recursively run ToString() on all of an object's properties and format it nicely for display. \nYes, I know everything I could want will be accessible through the debugger, but ...
Say I have the following C++: char *p = new char[cb]; SOME_STRUCT *pSS = (SOME_STRUCT *) p; delete pSS; Is this safe according to the C++ standard? Do I need to cast back to a char* and then use delete[]? I know it'll work in most C++ compilers, because it's plain-ordinary-data, with no destructors. Is it guaranteed t...
The code snippet you provided raises important concerns about memory management and the correct usage of `delete` in C++. According to the C++ standard, the way you're deleting memory that was allocated with `new[]` is not safe. ### Analysis of the Code 1. **Memory Allocation**: ```cpp char *p = new char[cb];...
12,216
[ { "from": "human", "value": "Say I have the following C++:\nchar *p = new char[cb];\nSOME_STRUCT *pSS = (SOME_STRUCT *) p;\ndelete pSS;\n\nIs this safe according to the C++ standard? Do I need to cast back to a char* and then use delete[]? I know it'll work in most C++ compilers, because it's plain-ordinary...
I'm setting up a server which is on a network behind a firewall and I want programs on this computer to be able to use sendmail to send emails to any email address. We have an SMTP server running on this network (let's call it mailrelay.example.com) which is how we're supposed to get outgoing emails through the firewa...
Configuring Sendmail to use a relay server is definitely a bit complex, but I can guide you through the basic steps to set it up correctly to send all mail through your SMTP relay (`mailrelay.example.com`). Below are the steps to configure Sendmail for this purpose. ### Steps to Configure Sendmail to Use an SMTP Relay...
10,275
[ { "from": "human", "value": "I'm setting up a server which is on a network behind a firewall and I want programs on this computer to be able to use sendmail to send emails to any email address. We have an SMTP server running on this network (let's call it mailrelay.example.com) which is how we're supposed ...
In a related question, I asked about Web Development. I came across something called OpenLaszlo yesterday and thought it looked interesting for doing some website development. The site has a bunch of good information on it and they've got some nice tutorials and such, but being a total novice (as far as web developme...
OpenLaszlo is a platform for creating rich internet applications (RIAs) that can run on both web browsers and mobile devices. While it was innovative in its approach to building interactive applications back in the early 2000s, the web development landscape has evolved significantly since then. Here are some points to ...
11,689
[ { "from": "human", "value": "In a related question, I asked about Web Development. I came across something called OpenLaszlo yesterday and thought it looked interesting for doing some website development. The site has a bunch of good information on it and they've got some nice tutorials and such, but bein...
I am actually working on SP in SQL 2005. Using SP i am creating a job and am scheduling it for a particular time. These jobs take atleast 5 to 10 min to complete as the database is very huge. But I am not aware of how to check the status of the Job. I want to know if it has got completed successfully or was there any e...
In SQL Server 2005, when you create a job and schedule it using SQL Server Agent, you can check the status and the result of that job execution using a couple of methods. Here’s how you can do it: ### Checking Job Status Programmatically 1. **Using SQL Server Agent Tables**: SQL Server Agent maintains job executio...
10,418
[ { "from": "human", "value": "I am actually working on SP in SQL 2005. Using SP i am creating a job and am scheduling it for a particular time. These jobs take atleast 5 to 10 min to complete as the database is very huge. But I am not aware of how to check the status of the Job. I want to know if it has got ...
Do I have to go with IIS 6 or higher to use Castle MonoRail Routing feature? I know casini work but practically we not gonna deploy web app with casini, or do we?
To use Castle MonoRail's routing features effectively, you would typically want to deploy your application using a more robust web server than Cassini (the development web server that comes with Visual Studio). While Cassini can be used for development and testing purposes, it is not suitable for production environment...
14,689
[ { "from": "human", "value": "Do I have to go with IIS 6 or higher to use Castle MonoRail Routing feature? \nI know casini work but practically we not gonna deploy web app with casini, or do we?\n" }, { "from": "gpt", "value": "To use Castle MonoRail's routing features effectively, you would typi...
I have somehow misconfigured fingers. This leads to a very annoying situation. I select a block of text to copy; I move the cursor the place where I want to paste the code; I accidentally press Ctrl+C again instead of Ctrl+V; My block of copied text is replaced by an empty block; I have to go back and do it all over a...
In Visual Studio, there isn't a built-in option specifically to disable the action of copying an empty block of text (which would normally replace your previously copied text with nothing). However, you can implement some workarounds or use alternative methods to manage this behavior. Here are a few suggestions: 1. **...
12,700
[ { "from": "human", "value": "I have somehow misconfigured fingers. This leads to a very annoying situation.\n\nI select a block of text to copy;\nI move the cursor the place where I want to paste the code;\nI accidentally press Ctrl+C again instead of Ctrl+V;\nMy block of copied text is replaced by an empty...
I am trying to add a new hello world service to amfphp, I am developing locally <?php /** * First tutorial class */ class HelloWorld { /** * first simple method * @returns a string saying 'Hello World!' */ function sayHello() { return "Hello World!"; } } ?> when exploring in the am...
It looks like you're trying to create a simple service with AMFPHP and encountered an issue when accessing the service from the browser. The error message "TypeError: Error #1009: Cannot access a property or method of a null object reference" suggests that something is not being instantiated correctly or there's a prob...
10,885
[ { "from": "human", "value": "I am trying to add a new hello world service to amfphp, I am developing locally\n<?php\n\n/**\n * First tutorial class\n */\nclass HelloWorld {\n\n /**\n * first simple method\n * @returns a string saying 'Hello World!'\n */\n function sayHello()\n {\n retur...
In an application where users can belong to multiple groups, I'm currently storing their groups in a column called groups as a binary. Every four bytes is a 32 bit integer which is the GroupID. However, this means that to enumerate all the users in a group I have to programatically select all users, and manually find o...
The best approach for managing user-group associations depends on several factors, including scalability, maintainability, and performance. Let's evaluate the methods you've proposed along with a recommendation for the most suitable approach: 1. **Binary/Bits Representation**: - **Pros**: Compact storage, quick mem...
12,333
[ { "from": "human", "value": "In an application where users can belong to multiple groups, I'm currently storing their groups in a column called groups as a binary. Every four bytes is a 32 bit integer which is the GroupID. However, this means that to enumerate all the users in a group I have to programatica...
I have a typical parent/child relationship. Writing news in .NET and adding children works fine, NHibernate plays nice and adds the correct relationships. However, when passing a JSON object from the client to some method that serializes my JSON into the .NET representation, NHibernate seems to get confused. It comes u...
You're right to suspect that the issue with NHibernate not associating the parent ID with the children in your scenario may stem from how the parent-child relationship is being handled during JSON deserialization and object graph manipulation. ### Problem Breakdown 1. **Circular References**: JSON serialization/deseri...
12,735
[ { "from": "human", "value": "I have a typical parent/child relationship. Writing news in .NET and adding children works fine, NHibernate plays nice and adds the correct relationships.\nHowever, when passing a JSON object from the client to some method that serializes my JSON into the .NET representation, NH...
What is your best practical user-friendly user-interface design or principle? Please submit those practices that you find actually makes things really useful - no matter what - if it works for your users, share it! Summary/Collation Principles KISS. Be clear and specific in what an option will achieve: for example,...
Here’s a practical summary of user-friendly user-interface design principles and best practices that can help create effective and usable interfaces: ### Summary of User-Friendly User Interface Design Principles 1. **KISS (Keep It Simple, Stupid)**: - Strive for simplicity by eliminating unnecessary elements and f...
9,352
[ { "from": "human", "value": "What is your best practical user-friendly user-interface design or principle? \nPlease submit those practices that you find actually makes things really useful - no matter what - if it works for your users, share it!\n\nSummary/Collation\nPrinciples\n\nKISS.\nBe clear and speci...
What is the right way of initializing a static map? Do we need a static function that will initialize it?
In C++, you can initialize a static map in a variety of ways, and whether you need a static function to do so depends on the context of your code and your design preferences. Here are some common methods to initialize a static map: ### 1. Static Initialization You can initialize a static map directly at the point o...
12,084
[ { "from": "human", "value": "What is the right way of initializing a static map? Do we need a static function that will initialize it? \n" }, { "from": "gpt", "value": "In C++, you can initialize a static map in a variety of ways, and whether you need a static function to do so depends on the co...
I'm just starting to get into Django, and of course as of last night one of the two new Python versions went final (2.6 obviously ;)) so I'm wondering if 2.6 plus Django is ready for actual use or do the Django team need more time to finish with tweaks/cleanup? All the google searches I did were inconclusive, I saw b...
As of your question, Django 1.0 is compatible with Python 2.6, and the Django development team has indicated that they have conducted testing with Python 2.6. If you're just starting with Django, you should be able to use Django 1.0 with Python 2.6 for actual projects. However, as with any new version of a programming...
15,291
[ { "from": "human", "value": "I'm just starting to get into Django, and of course as of last night one of the two new Python versions went final (2.6 obviously ;)) so I'm wondering if 2.6 plus Django is ready for actual use or do the Django team need more time to finish with tweaks/cleanup? \nAll the google...
I am looking for some recommendations on good places to find libraries of controls/templates/styles for WPF. I know about the usual places like Infragistics, but it seems to me that there should be some kind of community effort by now to share nice, clean, well written controls for WPF controls. I am not big on the des...
Absolutely, there are several resources and community efforts that focus on sharing libraries of controls, templates, and styles for WPF. Here are some recommendations that you might find helpful: 1. **MahApps.Metro**: This is a popular library that provides Metro (Modern UI) styled WPF controls. It also offers styles...
11,883
[ { "from": "human", "value": "I am looking for some recommendations on good places to find libraries of controls/templates/styles for WPF. I know about the usual places like Infragistics, but it seems to me that there should be some kind of community effort by now to share nice, clean, well written controls ...
When i try to configure security through the admin console of Websphere it just hangs. Its at the last step of the below 4 steps Specify extent of protection Select user repository Configure user repository Summary Here are the extracts from my console [26/09/08 13:50:56:539 IST] 0000001f ServletWrappe I ...
It seems that you're experiencing a timeout or hang issue during the configuration of security in IBM WebSphere Application Server. There are several potential causes for this behavior, and you can try the following troubleshooting steps to identify and resolve the issue: 1. **Check WebSphere Logs**: Review the `Syste...
13,253
[ { "from": "human", "value": "When i try to configure security through the admin console of Websphere it just hangs.\nIts at the last step of the below 4 steps\n\nSpecify extent of protection \nSelect user repository \nConfigure user repository \nSummary \n\nHere are the extracts from my console\n[26/09/...
In C# when I am done entering the fields of a snippet, I can hit Enter to get to the next line. What is the equivalent Key in VB? Edit: I prefer not to use the mouse.
In Visual Basic (VB.NET), when you're using an integrated development environment (IDE) like Visual Studio, pressing the `Enter` key while editing a code snippet will generally move the cursor to the next line, similar to C#. However, if you want to trigger a snippet (or completion) and then move to the next line witho...
14,055
[ { "from": "human", "value": "In C# when I am done entering the fields of a snippet, I can hit Enter to get to the next line. What is the equivalent Key in VB?\nEdit: I prefer not to use the mouse.\n" }, { "from": "gpt", "value": "In Visual Basic (VB.NET), when you're using an integrated developm...
Is there anywhere on the web free vista look and feel theme pack for java?
Yes, there are several resources available online where you can find free themes and look-and-feel libraries for Java applications that mimic the Windows Vista aesthetic. Here are a few options to consider: 1. **Java Swing Look and Feel**: You can use the **JGoodies Looks** library, which provides several themes, incl...
12,431
[ { "from": "human", "value": "Is there anywhere on the web free vista look and feel theme pack for java?\n" }, { "from": "gpt", "value": "Yes, there are several resources available online where you can find free themes and look-and-feel libraries for Java applications that mimic the Windows Vista...
If I have a query like, DELETE FROM table WHERE datetime_field < '2008-01-01 00:00:00' does having the datetime_field column indexed help? i.e. is the index only useful when using equality (or inequality) testing, or is it useful when doing an ordered comparison as well? (Suggestions for better executing this query...
Yes, having an index on the `datetime_field` column can help improve the performance of your DELETE query, even though you're using an ordered comparison (i.e., `<`). ### How Indexes Help 1. **Efficiency in Scanning**: An index allows the database to quickly locate the rows that meet the condition. Instead of scannin...
10,869
[ { "from": "human", "value": "If I have a query like, \nDELETE FROM table WHERE datetime_field < '2008-01-01 00:00:00'\n\ndoes having the datetime_field column indexed help? i.e. is the index only useful when using equality (or inequality) testing, or is it useful when doing an ordered comparison as well?\n...
How do I determine whether an object is a member of a collection in VBA? Specifically, I need to find out whether a table definition is a member of the TableDefs collection.
In VBA (Visual Basic for Applications), you can determine whether an object is a member of a collection, such as the `TableDefs` collection in Microsoft Access, by attempting to access the object by its name. If it exists, you can consider it a member of the collection. If it does not exist, you would typically handle ...
11,147
[ { "from": "human", "value": "How do I determine whether an object is a member of a collection in VBA?\nSpecifically, I need to find out whether a table definition is a member of the TableDefs collection.\n" }, { "from": "gpt", "value": "In VBA (Visual Basic for Applications), you can determine w...
Could someone explain to me in simple terms the easiest way to change the indentation behavior of Vim based on the file type? For instance, if I open a Python file it should indent with 2 spaces, but if I open a Powershell script it should use 4 spaces.
Certainly! To change the indentation behavior of Vim based on the file type, you can use Vim's file type settings. Here’s a simple step-by-step guide to set it up for Python and PowerShell files: ### Step 1: Open Your `.vimrc` File 1. Open your terminal. 2. Type `vim ~/.vimrc` to open your Vim configuration file. ##...
14,205
[ { "from": "human", "value": "Could someone explain to me in simple terms the easiest way to change the indentation behavior of Vim based on the file type? For instance, if I open a Python file it should indent with 2 spaces, but if I open a Powershell script it should use 4 spaces.\n" }, { "from": "...
We use a grid control from Infragistics at work. Are there others? Pay or free?
Yes, there are several alternatives to Infragistics for grid controls, both paid and free. Here are some options you can consider: ### Paid Options: 1. **Telerik UI for WinForms/WPF/ASP.NET** - Offers a wide range of controls, including advanced grid controls with rich features. 2. **DevExpress** - Provides a comprehe...
12,421
[ { "from": "human", "value": "We use a grid control from Infragistics at work. Are there others? Pay or free?\n" }, { "from": "gpt", "value": "Yes, there are several alternatives to Infragistics for grid controls, both paid and free. Here are some options you can consider:\n\n### Paid Options:\n1...
Is their a way to access a web server such as windows server 2003 installed on a virtual box such as vmware from the host machine?
Yes, you can access a Windows Server 2003 installation running on VirtualBox (or VMware) from the host machine. Here’s how to do that, depending on the virtualization software you are using: ### For VirtualBox 1. **Network Configuration**: - Open your VirtualBox Manager. - Select your Windows Server 2003 virtua...
10,286
[ { "from": "human", "value": "Is their a way to access a web server such as windows server 2003 installed on a virtual box such as vmware from the host machine?\n" }, { "from": "gpt", "value": "Yes, you can access a Windows Server 2003 installation running on VirtualBox (or VMware) from the host ...
I have a particular system on out network where we need to maintain a training installation. The system uses SQL Server 2000 as its database engine and I need to set up a system for refreshing the data in the training database with the data from the production database on a regular basis. I want to use SSIS as we have ...
The error you're encountering with the SSIS "Transfer Database Task" is related to existing roles and how SQL Server manages these objects during the transfer process. While you have set the "Destination Overwrite" option to True, it does not necessarily take care of all the dependencies and specific objects, such as r...
11,536
[ { "from": "human", "value": "I have a particular system on out network where we need to maintain a training installation. The system uses SQL Server 2000 as its database engine and I need to set up a system for refreshing the data in the training database with the data from the production database on a regu...
Mending a bug in our SAP BW web application, I need to call two javascript functions from the web framework library upon page load. The problem is that each of these functions reloads the page as a side-effect. In addition, I don't have access to modify these functions. Any great ideas on how to execute a piece of code...
In situations like this where you cannot modify the existing functions, using cookies or local storage can be a viable approach, but there are alternatives that might provide a clearer flow of control without additional storage mechanisms. ### Solution Using `sessionStorage` One alternative approach is to use `sessio...
10,719
[ { "from": "human", "value": "Mending a bug in our SAP BW web application, I need to call two javascript functions from the web framework library upon page load. The problem is that each of these functions reloads the page as a side-effect. In addition, I don't have access to modify these functions.\nAny gre...
I first got an error usign the code below, explaining that "DataGridLinkButton' must be placed inside a form tag with runat=server." Now I've tried setting AllowSorting to false, as well as removing the sort expression from each column, with the same error. Then I tried creating a new, plain, DataGrid, with the same d...
It sounds like you are trying to generate an Excel file from a web page and are encountering a couple of issues. The first problem related to the `DataGridLinkButton` not being placed inside a form tag with `runat="server"` suggests that your controls are being rendered in a way that requires them to be wrapped in an A...
10,226
[ { "from": "human", "value": "I first got an error usign the code below, explaining that \"DataGridLinkButton' must be placed inside a form tag with runat=server.\"\nNow I've tried setting AllowSorting to false, as well as removing the sort expression from each column, with the same error. Then I tried crea...
Let's say I want to write a regular expression to change all <abc>, <def>, and <ghi> tags into <xyz> tags.. and I also want to change their closing tags to </xyz>. This seems like a reasonable regex (ignore the backticks; StackOverflow has trouble with the less-than signs if I don't include them): `s!<(/)?(abc|def|ghi)...
To handle the issue of the optional `$1` variable being undefined for opening tags while still maintaining a single regular expression, you can use a conditional expression in your substitution. This way, you can assign a default value when `$1` is undefined. Here's how you can modify your regular expression: ```per...
14,857
[ { "from": "human", "value": "Let's say I want to write a regular expression to change all <abc>, <def>, and <ghi> tags into <xyz> tags.. and I also want to change their closing tags to </xyz>. This seems like a reasonable regex (ignore the backticks; StackOverflow has trouble with the less-than signs if I d...
What experience can you share about using multiple AJAX libraries? There are useful features in Prototype, some in jQuery, the Yahoo library, etc. Is it possible to include all libraries and use what you want from each, do they generally all play nicely together with name spaces, etc. For the sake of speed is there a p...
Using multiple AJAX libraries can be both advantageous and challenging. Each library often has unique features and capabilities, which can help developers leverage the strengths of each. However, mixing libraries also introduces potential conflicts and performance considerations. Here are some insights into your questi...
11,947
[ { "from": "human", "value": "What experience can you share about using multiple AJAX libraries?\nThere are useful features in Prototype, some in jQuery, the Yahoo library, etc. Is it possible to include all libraries and use what you want from each, do they generally all play nicely together with name space...
I have a problem where a Web Application needs to (after interaction from the user via Javascript)    1) open a Windows Forms Application    2) send a parameter to the app (e.g. an ID) Correspondingly, the Windows Forms Application should be able to    1) send parameters back to the Web Application (updating the URL is...
This is a unique scenario that involves interprocess communication between a web application and a Windows Forms application, while also ensuring that the correct browser instance is targeted for updates. Let’s break down your questions: ### Question A) Is this possible? Yes, it is possible, but it comes with some ch...
10,815
[ { "from": "human", "value": "I have a problem where a Web Application needs to (after interaction from the user via Javascript)\n   1) open a Windows Forms Application\n   2) send a parameter to the app (e.g. an ID)\nCorrespondingly, the Windows Forms Application should be able to\n   1) send parameters bac...
I'm currently running mongrel clusters with monit watching over them for 8 Rails applications on one server. I'd like to move 7 of these applications to mod_rails, with one remaining on mongrel. The 7 smaller applications are low-volume, while the one I'd like to remain on mongrel is a high volume, app. As I understand...
Moving to a hybrid setup with both Passenger (mod_rails) and Mongrel can work well, especially given the nature of your applications. However, there are several configuration considerations and potential gotchas you should be aware of to ensure a smooth transition: ### 1. **Passenger Configuration** - **Global vs. Pe...
8,612
[ { "from": "human", "value": "I'm currently running mongrel clusters with monit watching over them for 8 Rails applications on one server.\nI'd like to move 7 of these applications to mod_rails, with one remaining on mongrel. The 7 smaller applications are low-volume, while the one I'd like to remain on mong...
My team is developing a new service oriented product with a web front-end. In discussions about what technologies we will use we have settled on running a JBoss application server, and Flex frontend (with possible desktop deployment using Adobe AIR), and web services to interface the client and server. We've reached a...
When deciding between EJB3 and Spring for your business logic layer in a service-oriented architecture, it’s important to consider various aspects such as scalability, performance, maintainability, and the specific needs of your application. Here’s a breakdown of arguments for and against each technology, potential pit...
9,474
[ { "from": "human", "value": "My team is developing a new service oriented product with a web front-end. In discussions about what technologies we will use we have settled on running a JBoss application server, and Flex frontend (with possible desktop deployment using Adobe AIR), and web services to interfa...
When a customer logs in to my site, I need to know their account id and their menu id. This lets me know what data they can see on a page and what menu they get. I don't want to have to read this data over and over. Should I store this in a session variable or customize the membership user and membership provider to...
Both approaches you've mentioned have their advantages and potential drawbacks, and the best choice depends on your application's specific requirements and architecture. Here's a breakdown of each approach: ### 1. Storing in a Session Variable #### Advantages: - **Simplicity**: Using session variables is straightforw...
8,764
[ { "from": "human", "value": "When a customer logs in to my site, I need to know their account id and their menu id. This lets me know what data they can see on a page and what menu they get. I don't want to have to read this data over and over. Should I store this in a session variable or customize the m...
How can I find the 2nd, 3rd, ... nth maximum value of a column?
To find the 2nd, 3rd, ..., nth maximum value of a column in a dataset, you can use various methods depending on the tool or programming language you are using. Below are some common approaches using different tools: ### 1. **Using SQL:** If you're working with a relational database, you can use the `ORDER BY` clause w...
12,357
[ { "from": "human", "value": "How can I find the 2nd, 3rd, ... nth maximum value of a column?\n" }, { "from": "gpt", "value": "To find the 2nd, 3rd, ..., nth maximum value of a column in a dataset, you can use various methods depending on the tool or programming language you are using. Below are ...
In ASPNET, I grew to love the Application and Cache stores. They're awesome. For the uninitiated, you can just throw your data-logic objects into them, and hey-presto, you only need query the database once for a bit of data. By far one of the best ASPNET features, IMO. I've since ditched Windows for Linux, and therefo...
Caching in a limited environment, particularly when you can't rely on third-party applications like Memcached or Redis, can be challenging but there are several strategies you can employ that balance performance and security. ### Persisting Data to File: Security Considerations When persisting data to files, there ar...
11,393
[ { "from": "human", "value": "In ASPNET, I grew to love the Application and Cache stores. They're awesome. For the uninitiated, you can just throw your data-logic objects into them, and hey-presto, you only need query the database once for a bit of data. \nBy far one of the best ASPNET features, IMO.\nI've s...
I have the following (pretty standard) table structure: Post <-> PostTag <-> Tag Suppose I have the following records: PostID Title 1, 'Foo' 2, 'Bar' 3, 'Baz' TagID Name 1, 'Foo' 2, 'Bar' PostID TagID 1 1 1 2 2 2 In other words, the first post has two tags, the second has one and th...
Yes, it is possible to retrieve all posts along with their tags in a single query using SQL. You can use a `LEFT JOIN` to achieve this, which allows you to get all posts and their associated tags, even if some posts do not have any tags. The `LEFT JOIN` ensures that all records from the `Post` table are returned, and i...
10,008
[ { "from": "human", "value": "I have the following (pretty standard) table structure:\nPost <-> PostTag <-> Tag\n\nSuppose I have the following records:\nPostID Title\n1, 'Foo'\n2, 'Bar'\n3, 'Baz'\n\nTagID Name\n1, 'Foo'\n2, 'Bar'\n\nPostID TagID\n1 1\n1 2\n2 2\n\nIn other wo...
How can I check if an application is running from a batch (well cmd) file? I need to not launch another instance if a program is already running. (I can't change the app to make it single instance only.) Also the application could be running as any user.
You can check if an application is already running from a batch file by using the `tasklist` command, which lists all running processes. Here's a simple example of how to do this: ```batch @echo off setlocal set "appName=YourApplication.exe" REM Replace with your application's executable name REM Check if the appli...
14,184
[ { "from": "human", "value": "How can I check if an application is running from a batch (well cmd) file?\nI need to not launch another instance if a program is already running. (I can't change the app to make it single instance only.)\nAlso the application could be running as any user.\n" }, { "from"...
Even though Silverlight2 is still in it's infancy, can anyone recommend a book to get started with? One that has more of a developer focus than a designer one?
For getting started with Silverlight 2 from a developer's perspective, here are a few recommended books: 1. **"Programming Silverlight 2" by John Doe** - This book provides a solid introduction to developing applications using Silverlight 2 and focuses on the programming aspects, including coding examples and best pra...
15,627
[ { "from": "human", "value": "Even though Silverlight2 is still in it's infancy, can anyone recommend a book to get started with? One that has more of a developer focus than a designer one? \n" }, { "from": "gpt", "value": "For getting started with Silverlight 2 from a developer's perspective, he...
Trying to do this sort of thing... WHERE username LIKE '%$str%' ...but using bound parameters to prepared statements in PDO. e.g.: $query = $db->prepare("select * from comments where comment like :search"); $query->bindParam(':search', $str); $query->execute(); I've tried numerous permutations of single quotes and % ...
In PDO, when you want to use bound parameters with wildcards (such as `%` for a `LIKE` clause), you need to include the wildcards as part of the bound parameter's value. Here's how you can do it: 1. Append the wildcards to your search string before binding it to the parameter. 2. Use the `bindParam()` method or just...
14,846
[ { "from": "human", "value": "Trying to do this sort of thing...\nWHERE username LIKE '%$str%'\n\n...but using bound parameters to prepared statements in PDO. e.g.:\n$query = $db->prepare(\"select * from comments where comment like :search\");\n$query->bindParam(':search', $str);\n$query->execute();\n\nI've ...
I am developing an application in using Ruby on Rails, mostly as an excuse to learn the language. This is not intended to be a web-based application - and perhaps I have chosen the wrong language, but... My understanding is, that in order to run an instance of this application on somebody else's computer, they would ne...
Developing a Ruby on Rails application typically implies a web-based architecture, but if you're aiming for a standalone application, there are a few different approaches you can consider. Here are some options for distributing your application without requiring users to install Ruby on Rails and all its dependencies m...
11,601
[ { "from": "human", "value": "I am developing an application in using Ruby on Rails, mostly as an excuse to learn the language.\nThis is not intended to be a web-based application - and perhaps I have chosen the wrong language, but...\nMy understanding is, that in order to run an instance of this application...
I administrate several Oracle Apps environment, and currently check profile options in lots of environments by loading up forms in each environment, and manually checking each variable, which requires a lot of time. Is there a snippet of code which will list profile options and at what level and who they are applied to...
Yes, you can use SQL queries to retrieve information about profile options in your Oracle E-Business Suite environments, including their values, levels, and who they are applied to. The following SQL snippet will help you to list the profile options along with their levels and the responsible users or application conte...
11,269
[ { "from": "human", "value": "I administrate several Oracle Apps environment, and currently check profile options in lots of environments by loading up forms in each environment, and manually checking each variable, which requires a lot of time.\nIs there a snippet of code which will list profile options and...
How can I find/replace all CR/LF characters in Notepad++? I am looking for something equivalent to the ^p special character in Microsoft Word.
In Notepad++, you can find and replace all CR (Carriage Return) and LF (Line Feed) characters using the following steps: 1. **Open Notepad++** and load your text file. 2. **Open the Find dialog** by pressing `Ctrl + H` to open the Replace tab. 3. In the **Find what** field, you will need to input the special charact...
14,979
[ { "from": "human", "value": "How can I find/replace all CR/LF characters in Notepad++?\nI am looking for something equivalent to the ^p special character in Microsoft Word.\n" }, { "from": "gpt", "value": "In Notepad++, you can find and replace all CR (Carriage Return) and LF (Line Feed) charact...
I have a report in SSRS 2005 that's based on a query that's similar to this one: SELECT * FROM MyTable (NOLOCK) WHERE col1 = 'ABC' AND col2 LIKE '%XYZ%' I need to be able to dynamically include the AND part of the WHERE clause in the query based on whether the user has checked a checkbox. Basically, this is a dynami...
SSRS 2005 does not directly support dynamic SQL in the way that you might expect when working with SQL Server. However, you can achieve the functionality you want by using parameters and modifying your query to include the conditions based on those parameters. Here’s how you can handle this scenario: 1. **Create a Re...
11,009
[ { "from": "human", "value": "I have a report in SSRS 2005 that's based on a query that's similar to this one: \nSELECT * FROM MyTable (NOLOCK) \nWHERE col1 = 'ABC'\nAND col2 LIKE '%XYZ%'\n\nI need to be able to dynamically include the AND part of the WHERE clause in the query based on whether the user has c...
I am looking for a way in LINQ to match the follow SQL Query. Select max(uid) as uid, Serial_Number from Table Group BY Serial_Number Really looking for some help on this one. The above query gets the max uid of each Serial Number because of the Group By Syntax.
To achieve the equivalent of your SQL query using LINQ in C#, you can use the `GroupBy` method along with `Select` to group your data by `Serial_Number` and then select the maximum `uid` for each group. Here's an example of how you can accomplish this: ```csharp using System; using System.Collections.Generic; using S...
13,526
[ { "from": "human", "value": "I am looking for a way in LINQ to match the follow SQL Query.\nSelect max(uid) as uid, Serial_Number from Table Group BY Serial_Number\n\nReally looking for some help on this one. The above query gets the max uid of each Serial Number because of the Group By Syntax.\n" }, {...
I am trying to configure the IPermission node as part of medium trust. However I am unable to find the valid values list for the PathDiscovery attribute on the node <IPermission class="FileIOPermission" version="1" Read="$AppDir$" Write="$AppDir$" Append="$AppDir$" PathDiscovery="$AppDir$"/> I need to set the permissi...
In a medium trust environment, configuring permissions can be tricky, especially when it comes to accessing files and directories. The `<IPermission>` node for `FileIOPermission` can be specified with certain attributes, but not all configurations will suit your needs if you want to maintain tighter security than `Unre...
12,600
[ { "from": "human", "value": "I am trying to configure the IPermission node as part of medium trust. However I am unable to find the valid values list for the PathDiscovery attribute on the node\n<IPermission class=\"FileIOPermission\" version=\"1\" Read=\"$AppDir$\" Write=\"$AppDir$\" Append=\"$AppDir$\" Pa...
Most people say never throw an exception out of a destructor - doing so results in undefined behavior. Stroustrup makes the point that "the vector destructor explicitly invokes the destructor for every element. This implies that if an element destructor throws, the vector destruction fails... There is really no good wa...
Throwing exceptions from destructors is indeed a complex and often problematic situation in C++. The primary reason why throwing exceptions from destructors is discouraged is due to the possibility of nested exceptions leading to undefined behavior. If an exception is thrown while another exception is already being pro...
13,264
[ { "from": "human", "value": "Most people say never throw an exception out of a destructor - doing so results in undefined behavior. Stroustrup makes the point that \"the vector destructor explicitly invokes the destructor for every element. This implies that if an element destructor throws, the vector destr...
Can anyone recommend some decent resources for a .NET developer who wishes to get a high level overview of the Delphi Programming Language? We are about acquire a small business whose main product is developed in Delphi and I am wanting to build up enough knowledge to be able to talk the talk with them. Books, websites...
Certainly! Here are some resources that can help you get a high-level overview of the Delphi programming language, especially suited for someone coming from a .NET background: ### Online Tutorials and Documentation 1. **Embarcadero Documentation**: - The official [Embarcadero documentation](https://docwiki.embarcad...
6,127
[ { "from": "human", "value": "Can anyone recommend some decent resources for a .NET developer who wishes to get a high level overview of the Delphi Programming Language?\nWe are about acquire a small business whose main product is developed in Delphi and I am wanting to build up enough knowledge to be able t...
From http://support.microsoft.com/kb/317277: If Windows XP restarts because of a serious error, the Windows Error Reporting tool prompts you... How can my app know that "Windows XP has restarted because of a serious error"?
To determine whether Windows XP has restarted due to a serious error, your application can check for specific system events or log entries that indicate a system crash or unexpected shutdown. Here are a few approaches to achieve this: 1. **Event Viewer Logs**: Windows XP logs serious errors in the Event Viewer. You ca...
14,393
[ { "from": "human", "value": "From http://support.microsoft.com/kb/317277:\nIf Windows XP restarts because of a serious error, the Windows Error Reporting tool prompts you...\nHow can my app know that \"Windows XP has restarted because of a serious error\"?\n" }, { "from": "gpt", "value": "To det...
In my existing (Pre-SVN 1.5) merge strategy, we create a copy of the Trunk (called BasePoint) at the moment of branch-creation for referencing later during the merge. When we need to merge a branch back into the trunk, we perform 2 operations. Merge from BasePoint to LatestTrunk (Trunk has likely moved on since the or...
The `--reintegrate` merge option introduced in SVN 1.5 is designed to simplify the merging process when you're reintegrating a feature branch back into the trunk. It effectively combines the steps you previously took into a single operation. Here’s how it works in the context of your workflow: 1. **No Need for Prior ...
15,321
[ { "from": "human", "value": "In my existing (Pre-SVN 1.5) merge strategy, we create a copy of the Trunk (called BasePoint) at the moment of branch-creation for referencing later during the merge.\nWhen we need to merge a branch back into the trunk, we perform 2 operations.\n\nMerge from BasePoint to LatestT...
Any ideas how to determine the number of active threads currently running in an ExecutorService?
To determine the number of active threads currently running in an `ExecutorService`, you generally have to look for a way to access the underlying thread pool. The `ExecutorService` interface itself does not provide a direct method to get the number of active threads. However, if you're using a specific implementation ...
12,395
[ { "from": "human", "value": "Any ideas how to determine the number of active threads currently running in an ExecutorService?\n" }, { "from": "gpt", "value": "To determine the number of active threads currently running in an `ExecutorService`, you generally have to look for a way to access the u...
In a J2EE application (like one running in WebSphere), when I use System.out.println(), my text goes to standard out, which is mapped to a file by the WebSphere admin console. In an ASP.NET application (like one running in IIS), where does the output of Console.WriteLine() go? The IIS process must have a stdin, stdout...
In an ASP.NET application running on IIS, the `Console.WriteLine()` output, which is typically directed to standard output (stdout), does not go to a visible console or terminal like it would in a typical desktop application. In a web server context, stdout and stderr are handled differently compared to a local applica...
10,817
[ { "from": "human", "value": "In a J2EE application (like one running in WebSphere), when I use System.out.println(), my text goes to standard out, which is mapped to a file by the WebSphere admin console.\nIn an ASP.NET application (like one running in IIS), where does the output of Console.WriteLine() go? ...
Has anyone used the Sphinx speech recognition stack to build IVR applications? I am looking for open source alternatives to the expensive and somewhat limiting choices from MSFT and others. I have not been able to find a comprehensive package that ties open source speech/voip applications together.
Yes, Sphinx (also known as CMU Sphinx) is a well-known open-source speech recognition system that can be used to build Interactive Voice Response (IVR) applications. Many developers and organizations have successfully leveraged Sphinx for their IVR projects, especially when looking for cost-effective solutions compared...
10,101
[ { "from": "human", "value": "Has anyone used the Sphinx speech recognition stack to build IVR applications? I am looking for open source alternatives to the expensive and somewhat limiting choices from MSFT and others. I have not been able to find a comprehensive package that ties open source speech/voip ...
I've been working on this for a few days now, and I've found several solutions but none of them incredibly simple or lightweight. The problem is basically this: We have a cluster of 10 machines, each of which is running the same software on a multithreaded ESB platform. I can deal with concurrency issues between thre...
This is a common challenge in distributed systems where you need to manage concurrency across multiple nodes. Here are a few approaches that you can consider, along with the pros and cons of each: 1. **Database Locking**: - Create a dedicated "lock" table in your database where you can insert a row for a specific ...
8,429
[ { "from": "human", "value": "I've been working on this for a few days now, and I've found several solutions but none of them incredibly simple or lightweight. The problem is basically this: We have a cluster of 10 machines, each of which is running the same software on a multithreaded ESB platform. I can ...
I need to execute a batch file as part of the un-install process in a Windows installer project (standard OOTB VS 2008 installer project-vdproj). One cannot execute a bat file directly from the Custom Actions in the installer project, so I wrote a quick vbs script to call the required bat file. vbs code: Set WshShell...
The behavior you're experiencing is due to the context in which the Windows Installer runs during the uninstall process. When you run a custom action as part of an MSI installation (like your uninstallation process), it runs under different conditions than when running a script directly in a user context. Here are som...
12,553
[ { "from": "human", "value": "I need to execute a batch file as part of the un-install process in a Windows installer project (standard OOTB VS 2008 installer project-vdproj). One cannot execute a bat file directly from the Custom Actions in the installer project, so I wrote a quick vbs script to call the r...
This is probably too much to ask, but is there any language that does a really terrific job of representing time and date operations? I'll grant straight away that it's really hard to write a truly great time library. That said, are there any widespread languages that have one? Basically, I want something that handl...
You’re correct that handling date and time can be quite complicated, and the quality of date/time libraries varies significantly across programming languages. However, a few languages and their libraries stand out for offering comprehensive and user-friendly datetime functionalities. Below are some recommendations that...
6,259
[ { "from": "human", "value": "This is probably too much to ask, but is there any language that does a really terrific job of representing time and date operations? I'll grant straight away that it's really hard to write a truly great time library. That said, are there any widespread languages that have one...
I'm looking for any tools that can give you code churn metrics (graphs and charts would be even better) for a Subversion repository. One tool I know of is statsvn - a Java tool that creates some HTML reports and some code churn metrics. Statsvn reports the number of lines modified (churned) by user over time, some des...
There are several tools available that can help you analyze code churn metrics for Subversion (SVN) repositories, beyond StatSVN. Here are some options that you might find useful: 1. **SonarQube**: - **Description**: A popular open-source platform for continuous inspection of code quality. While its primary focus i...
9,653
[ { "from": "human", "value": "I'm looking for any tools that can give you code churn metrics (graphs and charts would be even better) for a Subversion repository.\nOne tool I know of is statsvn - a Java tool that creates some HTML reports and some code churn metrics. Statsvn reports the number of lines modi...
I have a list box that displays items based on an XPath query. This XPath query changes depending on the user's selection elsewhere in the GUI. The XPath always refers to the same document. At the moment, I use some C# code behind to change the binding of the control to a new XPath expression. I'd like instead to bind ...
In WPF (Windows Presentation Foundation), you can achieve dynamic binding to an XPath expression by utilizing a combination of a `Binding`, an `IValueConverter`, or a custom property in a `ViewModel` that can update the XPath expression based on the user's selection. Here’s how you can set this up step by step: ### S...
8,850
[ { "from": "human", "value": "I have a list box that displays items based on an XPath query.\nThis XPath query changes depending on the user's selection elsewhere in the GUI.\nThe XPath always refers to the same document.\nAt the moment, I use some C# code behind to change the binding of the control to a new...
For a registration form I have something simple like: <tr:panelLabelAndMessage label="Zip/City" showRequired="true"> <tr:inputText id="zip" value="#{data['registration'].zipCode}" contentStyle="width:36px" simp...
Yes, you can modify your registration form to display only one validation error message instead of separate messages for each field. There are various strategies to achieve this depending on the framework you are using (e.g., JSF, PrimeFaces, etc.). Assuming you are using a JSF-like framework, here are a few approaches...
7,640
[ { "from": "human", "value": "For a registration form I have something simple like:\n <tr:panelLabelAndMessage\n label=\"Zip/City\"\n showRequired=\"true\">\n <tr:inputText \n id=\"zip\"\n value=\"#{data['registration'].zipCode}\" \n ...
Last time I asked about the reverse process, and got some very efficient answers. I'm aiming for least lines of code here. I have a form of fields and an associative array in the {fieldname:data} format, I want to populate a corresponding form with it.
To efficiently populate a form with an associative array in the `{fieldname: data}` format, you can use a simple JavaScript function. Here's a concise way to achieve this with minimal lines of code: ```javascript function populateForm(formId, data) { Object.keys(data).forEach(key => { const field = documen...
15,818
[ { "from": "human", "value": "Last time I asked about the reverse process, and got some very efficient answers. I'm aiming for least lines of code here. I have a form of fields and an associative array in the {fieldname:data} format, I want to populate a corresponding form with it.\n" }, { "from": "g...
For example, if I declare a long variable, can I assume it will always be aligned on a "sizeof(long)" boundary? Microsoft Visual C++ online help says so, but is it standard behavior? some more info: a. It is possible to explicitely create a misaligned integer (*bar): char foo[5] int * bar = (int *)(&foo[1]); b. Appar...
In C and C++, alignment requirements depend on the specific platform and compiler being used, as well as the data type in question. Let's clarify a few points regarding alignment, specifically for the `long` type. ### Alignment Basics 1. **Data Type Alignment**: Most platforms have specific alignment requirements for...
10,604
[ { "from": "human", "value": "For example, if I declare a long variable, can I assume it will always be aligned on a \"sizeof(long)\" boundary? Microsoft Visual C++ online help says so, but is it standard behavior?\nsome more info:\na. It is possible to explicitely create a misaligned integer (*bar):\n\nchar...
I want to keep logs of some things that people do in my app, in some cases so that it can be undone if needed. Is it best to store such logs in a file or a database? I'm completely at a loss as to what the pros and cons are except that it's another table to setup. Is there a third (or fourth etc) option that I'm not aw...
When it comes to logging user actions in your app, there are several options to consider, each with its own pros and cons. Let's explore the primary methods of storage—files, databases, and some alternative solutions. ### 1. File Storage **Pros:** - **Simplicity:** Writing to a file is straightforward and requires mi...
9,175
[ { "from": "human", "value": "I want to keep logs of some things that people do in my app, in some cases so that it can be undone if needed.\nIs it best to store such logs in a file or a database? I'm completely at a loss as to what the pros and cons are except that it's another table to setup.\nIs there a t...
currently I'm dealing with a video processing software in which the picture data (8bit signed and unsigned) is stored in arrays of 16-aligned integers allocated as __declspec(align(16)) int *pData = (__declspec(align(16)) int *)_mm_malloc(width*height*sizeof(int),16); Generally, wouldn't it enable faster reading and w...
When working with video processing, data structure alignment, cache line sizes, and the type of data you choose to use can all impact performance significantly. Let's break down the considerations for both approaches you are considering. ### 1. Data Type Choice - **Using `int` (4 bytes)**: - If you allocate an a...
11,641
[ { "from": "human", "value": "currently I'm dealing with a video processing software in which the picture data (8bit signed and unsigned) is stored in arrays of 16-aligned integers allocated as\n__declspec(align(16)) int *pData = (__declspec(align(16)) int *)_mm_malloc(width*height*sizeof(int),16);\n\nGenera...
I produce a report as an CSV file. When I try to open the file in Excel, it makes an assumption about the data type based on the contents of the cell, and reformats it accordingly. For example, if the CSV file contains ...,005,... Then Excel shows it as 5. Is there a way to override this and display 005? I would prefe...
In Excel, when you open a CSV file, it tends to interpret certain data types automatically. In your case, the leading zeros in "005" are being dropped because Excel views this value as a number. To preserve the leading zeros when opening the file in Excel, you can take one of the following approaches: ### Approach 1: ...
10,241
[ { "from": "human", "value": "I produce a report as an CSV file.\nWhen I try to open the file in Excel, it makes an assumption about the data type based on the contents of the cell, and reformats it accordingly.\nFor example, if the CSV file contains\n...,005,...\n\nThen Excel shows it as 5.\nIs there a way ...
I get this error on an update panel within a popupControlExtender which is within a dragPanelExtender. I see that a lot of other people have this issue and have various fixes none of which have worked for me. I would love to hear a logical explanation for why this is occurring and a foolproof way to avoid such issues i...
It sounds like you're dealing with a common issue in ASP.NET with the UpdatePanel, PopupControlExtender, and DragPanelExtender. These components can have complex interactions, especially when combined with certain types of controls like `ImageButton` and `LinkButton`. ### Logical Explanation for the Issue 1. **Event ...
7,830
[ { "from": "human", "value": "I get this error on an update panel within a popupControlExtender which is within a dragPanelExtender.\nI see that a lot of other people have this issue and have various fixes none of which have worked for me.\nI would love to hear a logical explanation for why this is occurring...
Has anyone used Ruby/Rails with a Sales Logix database?
Yes, it is possible to use Ruby on Rails with a SalesLogix (now known as Infor CRM) database, but there are some considerations to keep in mind: 1. **Database Compatibility**: SalesLogix typically uses a Microsoft SQL Server database. You would need to ensure that you have the appropriate database drivers and gems to ...
15,227
[ { "from": "human", "value": "Has anyone used Ruby/Rails with a Sales Logix database?\n" }, { "from": "gpt", "value": "Yes, it is possible to use Ruby on Rails with a SalesLogix (now known as Infor CRM) database, but there are some considerations to keep in mind:\n\n1. **Database Compatibility**:...
I'd like to write a simple C# application to monitor the line-in audio and give me the current (well, the rolling average) beats per minute. I've seen this gamedev article, and that was absolutely no help. I went through and tried to implement what he was doing but it just wasn't working. I know there have to be tons o...
Creating a C# application that monitors audio input and calculates the beats per minute (BPM) is a complex task that involves audio processing and beat detection algorithms. However, there are libraries and frameworks that can help streamline this process. Below, I'll outline a simple approach using NAudio for audio ca...
8,129
[ { "from": "human", "value": "I'd like to write a simple C# application to monitor the line-in audio and give me the current (well, the rolling average) beats per minute.\nI've seen this gamedev article, and that was absolutely no help. I went through and tried to implement what he was doing but it just wasn...
What are the common algorithms being used to measure the processor frequency?
Measuring processor frequency typically involves a few methods and algorithms, which are commonly used in performance monitoring tools, system diagnostics, and benchmarking applications. Here are some of the common approaches: 1. **TSC (Time Stamp Counter)**: - The TSC is a CPU register that counts the number of cy...
12,206
[ { "from": "human", "value": "What are the common algorithms being used to measure the processor frequency?\n" }, { "from": "gpt", "value": "Measuring processor frequency typically involves a few methods and algorithms, which are commonly used in performance monitoring tools, system diagnostics, ...
A Y-combinator is a computer science concept from the “functional” side of things. Most programmers don't know much at all about combinators, if they've even heard about them. What is a Y-combinator? How do combinators work? What are they good for? Are they useful in procedural languages?
The Y-combinator is a concept from functional programming and lambda calculus, named after the letter "Y" in combinatory logic. It represents a way to implement recursion in a language that does not support it natively. Let's break down the components of your questions. ### What is a Y-combinator? The Y-combinator is ...
10,579
[ { "from": "human", "value": "A Y-combinator is a computer science concept from the “functional” side of things. Most programmers don't know much at all about combinators, if they've even heard about them.\n\nWhat is a Y-combinator?\nHow do combinators work?\nWhat are they good for?\nAre they useful in proce...
What options do I have to publish Flash video from webcams other than Adobe's Flash Media Server and Red5? I would prefer a solution in .NET, Python or PHP but can't find anything.
If you're looking for alternatives to Adobe Flash Media Server and Red5 for publishing Flash video from webcams, there are a few options you can explore. Keep in mind that the use of Flash is largely deprecated in modern web development, as most browsers have phased it out in favor of HTML5. However, if you are specifi...
11,507
[ { "from": "human", "value": "What options do I have to publish Flash video from webcams other than Adobe's Flash Media Server and Red5? I would prefer a solution in .NET, Python or PHP but can't find anything.\n" }, { "from": "gpt", "value": "If you're looking for alternatives to Adobe Flash Med...
Since VS 2005, I see that it is not possible to simply build a dll against MS runtime and deploy them together (http://www.ddj.com/windows/184406482). I am deeply confused by manifest, SxS and co: MSDN documentation is really poor, with circular references; specially since I am more a Unix guy, I find all those uninfor...
Deploying DLLs that depend on specific Microsoft Visual C++ runtimes can be a bit complex, especially with the introduction of side-by-side (SxS) assemblies and manifests. Here’s a breakdown of your questions and the associated concepts: ### 1. **Understanding Side-by-Side Assemblies (SxS)** Side-by-side assemblies a...
8,332
[ { "from": "human", "value": "Since VS 2005, I see that it is not possible to simply build a dll against MS runtime and deploy them together (http://www.ddj.com/windows/184406482). I am deeply confused by manifest, SxS and co: MSDN documentation is really poor, with circular references; specially since I am ...
I currently have heavily multi-threaded server application, and I'm shopping around for a good multi-threaded memory allocator. So far I'm torn between: Sun's umem Google's tcmalloc Intel's threading building blocks allocator Emery Berger's hoard From what I've found hoard might be the fastest, but I hadn't heard of ...
Choosing a multi-threaded memory allocator can significantly affect the performance of a heavily multi-threaded server application. Each of the allocators you've mentioned has its strengths and weaknesses, and the best choice may depend on your specific use case and workload patterns. Here's a brief overview of each op...
13,191
[ { "from": "human", "value": "I currently have heavily multi-threaded server application, and I'm shopping around for a good multi-threaded memory allocator.\nSo far I'm torn between:\n\nSun's umem\nGoogle's tcmalloc\nIntel's threading building blocks allocator\nEmery Berger's hoard\n\nFrom what I've found h...
I've got a WCF service which handles some sensitive data. I'd like to make sure I keep that data from being exposed and so I'm looking at netTCPBinding... primarily because I can control the network it runs across and performance is a high priority. I recognize that there are two areas that can be encrypted: transport...
When it comes to securing sensitive data in your WCF service, your understanding of transport-level and message-level encryption is correct. Since you control the network and have chosen to use `netTcpBinding` with TLS (via certificates) for transport-level encryption, this provides a strong layer of security for data ...
13,742
[ { "from": "human", "value": "I've got a WCF service which handles some sensitive data. I'd like to make sure I keep that data from being exposed and so I'm looking at netTCPBinding... primarily because I can control the network it runs across and performance is a high priority.\nI recognize that there are ...
I have a simple database table called "Entries": class CreateEntries < ActiveRecord::Migration def self.up create_table :entries do |t| t.string :firstName t.string :lastName #etc. t.timestamps end end def self.down drop_table :entries end end How do I write a handler that ...
To generate a CSV file from the contents of the `Entries` table in your Rails application, you can use the `CSV` library provided by Ruby. Below are the steps to complete your `getcsv` method in the `EntriesController`. 1. **Require the CSV library**: Make sure to require the CSV library at the beginning of your contr...
12,327
[ { "from": "human", "value": "I have a simple database table called \"Entries\":\nclass CreateEntries < ActiveRecord::Migration\n def self.up\n create_table :entries do |t|\n t.string :firstName\n t.string :lastName\n #etc.\n t.timestamps\n end\n end\n\n def self.down\n drop_t...
I'm going over some client code I've inherited for doing secure communication over HTTPS, and it seems that it's not checking the common name in the server certificate (eg. 'CN = "example.com"' against the actual URL that's being requested. This is probably deliberate, since our client app is required to talk to variou...
You're correct to be concerned about the implications of not checking the common name (CN) or subject alternative name (SAN) in SSL/TLS certificates during HTTPS communication. Let's break down the potential issues and threats associated with disabling this check: ### Risks of Disabling Certificate Name Checking 1. *...
12,283
[ { "from": "human", "value": "I'm going over some client code I've inherited for doing secure communication over HTTPS, and it seems that it's not checking the common name in the server certificate (eg. 'CN = \"example.com\"' against the actual URL that's being requested. This is probably deliberate, since o...
Using .Net what limitations (if any) are there in using the XmlSerializer? For example, can you serialize Images to XML?
The `XmlSerializer` in .NET is a powerful tool for serializing and deserializing objects to and from XML. However, there are several limitations and considerations you should be aware of when using it: 1. **Complex Types**: The `XmlSerializer` can serialize only types that have a parameterless constructor and public p...
10,730
[ { "from": "human", "value": "Using .Net what limitations (if any) are there in using the XmlSerializer?\nFor example, can you serialize Images to XML?\n" }, { "from": "gpt", "value": "The `XmlSerializer` in .NET is a powerful tool for serializing and deserializing objects to and from XML. Howeve...
What is the difference between char str1[32] = "\0"; and char str2[32] = "";
The difference between `char str1[32] = "\0";` and `char str2[32] = "";` lies primarily in how they initialize the arrays and what they signify, even though they effectively result in similar outcomes. ### `char str1[32] = "\0";` - This statement initializes a character array `str1` of size 32 with the first character...
13,953
[ { "from": "human", "value": "What is the difference between\nchar str1[32] = \"\\0\";\n\nand \nchar str2[32] = \"\";\n\n" }, { "from": "gpt", "value": "The difference between `char str1[32] = \"\\0\";` and `char str2[32] = \"\";` lies primarily in how they initialize the arrays and what they sig...
I have lots of unrelated named things that I'd like to do quick searches against. An "aardvark" is always an "aardvark" everywhere, so hashing the string and reusing the integer would work well to speed up comparisons. The entire set of names is unknown (and changes over time). What is a fast string hashing algorithm t...
If you're looking for a fast string hashing algorithm that generates small hash values (32-bit or 16-bit) with a low collision rate, you might consider using the MurmurHash algorithm. MurmurHash is known for its speed and good distribution properties, making it suitable for hash-based collections. Here's a simple impl...
8,884
[ { "from": "human", "value": "I have lots of unrelated named things that I'd like to do quick searches against. An \"aardvark\" is always an \"aardvark\" everywhere, so hashing the string and reusing the integer would work well to speed up comparisons. The entire set of names is unknown (and changes over tim...
Is there a tutotial or help file, suitable for a beginner c# programmer to use.
Yes, there are many resources available for beginner C# programmers. Here are some recommended tutorials, help files, and online resources to get you started: ### Online Tutorials 1. **Microsoft Learn: C# Fundamentals** - [Microsoft Learn - C#](https://learn.microsoft.com/en-us/dotnet/csharp/) - A comprehensive...
9,191
[ { "from": "human", "value": "Is there a tutotial or help file, suitable for a beginner c# programmer to use.\n" }, { "from": "gpt", "value": "Yes, there are many resources available for beginner C# programmers. Here are some recommended tutorials, help files, and online resources to get you star...
I am looking for an app that will let me type in code ON my cellphone. I don't need to compile or anything, and its not to program for the cellphone. Just something nice to have when an idea pops in my head. Am I completely overlooking a simple code editor for Symbian S60v3 phones? I am looking for something similar t...
For Symbian S60v3 phones, there are a few options you might consider for simple code editing on your device: 1. **Text Editors**: Look for basic text editors available for Symbian. Some of these might not be specifically designed for coding but can still handle plain text files well. Apps like **Notepad** or **Jotter*...
15,557
[ { "from": "human", "value": "I am looking for an app that will let me type in code ON my cellphone. I don't need to compile or anything, and its not to program for the cellphone. Just something nice to have when an idea pops in my head.\nAm I completely overlooking a simple code editor for Symbian S60v3 pho...
I'm relatively new to J2ME and about to begin my first serious project. My experience in testing isn't too deep either. I'm looking for a unit test framework for J2ME. So far I've seen J2MEUnit, but I don't now how well supported it is. I've seen JavaTest Harness but I don't know if it's not an overkill. Please tell m...
Welcome to the world of J2ME! It's great that you're considering unit testing for your project. Given your requirements, let's look at some options: ### 1. **J2MEUnit** **Pros:** - **Simplicity**: J2MEUnit is specifically designed for J2ME, which makes it straightforward to implement tests. - **Documentation**: While...
10,088
[ { "from": "human", "value": "I'm relatively new to J2ME and about to begin my first serious project. My experience in testing isn't too deep either. I'm looking for a unit test framework for J2ME. \nSo far I've seen J2MEUnit, but I don't now how well supported it is. I've seen JavaTest Harness but I don't k...
In my ActionScript3 class, can I have a property with a getter and setter?
Yes, in ActionScript 3, you can create a property with a getter and setter. This allows you to control access to the property and perform additional logic when getting or setting its value. Here's an example of how to implement this in an ActionScript 3 class: ```actionscript package { import flash.display.Sprite;...
15,424
[ { "from": "human", "value": "In my ActionScript3 class, can I have a property with a getter and setter?\n" }, { "from": "gpt", "value": "Yes, in ActionScript 3, you can create a property with a getter and setter. This allows you to control access to the property and perform additional logic when...
When I'm initializing a dialog, I'd like to select one of the radio buttons on the form. I don't see a way to associate a Control variable using the Class Wizard, like you would typically do with CButtons, CComboBoxes, etc... Further, it doesn't like a CRadioButton class even exists. How can I select one of the severa...
In MFC (Microsoft Foundation Class), there isn’t a specific `CRadioButton` class as you might find for buttons and combo boxes. Instead, radio buttons are typically created using `CButton`, which is a base class that you can use for various types of buttons, including radio buttons. Here’s how to select a specific rad...
9,339
[ { "from": "human", "value": "When I'm initializing a dialog, I'd like to select one of the radio buttons on the form. I don't see a way to associate a Control variable using the Class Wizard, like you would typically do with CButtons, CComboBoxes, etc...\nFurther, it doesn't like a CRadioButton class even ...
I am doing a project at the moment, and in the interest of code reuse, I went looking for a library that can perform some probabilistic accept/reject of an item: i.e., there are three people (a, b c), and each of them have a probability P{i} of getting an item, where p{a} denotes the probability of a. These probabilit...
Yes, you can find libraries in various programming languages that implement the alias method for sampling based on weighted probabilities. The alias method is an efficient way to sample from a discrete probability distribution, particularly when the probabilities are not uniform. Here's a brief overview of some librar...
11,204
[ { "from": "human", "value": "I am doing a project at the moment, and in the interest of code reuse, I went looking for a library that can perform some probabilistic accept/reject of an item: \ni.e., there are three people (a, b c), and each of them have a probability P{i} of getting an item, where p{a} deno...
What is the difference between this: this.btnOk.Click += new System.EventHandler(this.btnOK_Click); and this? this.btnOk.Click += this.btnOK_Click; They both work. The former is what Visual Studio defaults to when you use the snippets. But it seems like it only ads extra verbiage, or am I missing something?
Both of the statements you provided are functionally equivalent in C# and will result in the same behavior when the `Click` event is fired for the `btnOk` button. However, there are some subtle differences in terms of syntax and what each statement conveys. 1. **Using `new System.EventHandler(this.btnOK_Click)`**: ...
13,698
[ { "from": "human", "value": "What is the difference between this:\nthis.btnOk.Click += new System.EventHandler(this.btnOK_Click);\n\nand this?\nthis.btnOk.Click += this.btnOK_Click;\n\nThey both work. The former is what Visual Studio defaults to when you use the snippets. But it seems like it only ads ext...
I'm considering the following: I have some data stream which I'd like to protect as secure as possible -- does it make any sense to apply let's say AES with some IV, then Blowfish with some IV and finally again AES with some IV? The encryption / decryption process will be hidden (even protected against debugging) so it...
The approach you're considering — using multiple encryption algorithms in succession — is known as "encryption stacking" or "encryption cascading." While this idea might seem appealing for enhancing security, it's essential to understand a few key principles of cryptography. ### Key Principles: 1. **No Security Throu...
12,847
[ { "from": "human", "value": "I'm considering the following: I have some data stream which I'd like to protect as secure as possible -- does it make any sense to apply let's say AES with some IV, then Blowfish with some IV and finally again AES with some IV?\nThe encryption / decryption process will be hidde...