instruction
stringlengths
14
27.6k
completion
stringlengths
3
38.3k
__original_row_idx
int64
0
50k
conversations
listlengths
2
2
I have a sparse array in Jscript, with non-null elements occuring at both negative and positive indices. When I try to use a for in loop, it doesn't traverse the array from the lowest (negative) index to the highest positive index. Instead it returns the array in the order that I added the elements. Enumeration doesn't...
In JavaScript, when you use an array with non-numeric properties (i.e., negative indices), these properties are treated as object keys rather than true array indices. This means that standard array enumeration methods won't work as you expect, because arrays in JavaScript are essentially objects that maintain the order...
12,136
[ { "from": "human", "value": "I have a sparse array in Jscript, with non-null elements occuring at both negative and positive indices. When I try to use a for in loop, it doesn't traverse the array from the lowest (negative) index to the highest positive index. Instead it returns the array in the order that ...
I have converted one of my VS2006 projects into VS2008 and when trying to build the project in VS2008 I get the above error. What is .sbr file ? and how can I fix the compile error? Any help is hugely appreciated.
A `.sbr` file is a source browser file created by Microsoft Visual Studio. It contains information that helps the Visual Studio IDE provide features like code navigation, member listing, and other code exploration features. When you encounter an error related to `.sbr` files after converting a project from Visual Studi...
10,716
[ { "from": "human", "value": "I have converted one of my VS2006 projects into VS2008 and when trying to build the project in VS2008 I get the above error. What is .sbr file ? and how can I fix the compile error? Any help is hugely appreciated.\n" }, { "from": "gpt", "value": "A `.sbr` file is a s...
I have a small problem with interfaces. Here it is in Pseudo code : type Interface1 = interface end; Interface2 = interface end; TParentClass = class(TInterfacedObject, Interface1) private fChild : Interface2; public procedure AddChild(aChild : Interface2); end; TChildClass = class(TInterfa...
The issue you're experiencing with reference counting in your implementation arises from the way you're handling the parent-child relationship between `TParentClass` and `TChildClass`. Specifically, the child holds a reference to the parent, and since `TParentClass` holds a reference to the child, you create a circular...
15,119
[ { "from": "human", "value": "I have a small problem with interfaces. Here it is in Pseudo code :\ntype\n Interface1 = interface\n end;\n\n Interface2 = interface\n end;\n\n TParentClass = class(TInterfacedObject, Interface1)\n private\n fChild : Interface2;\n public\n procedure AddChild(aChild ...
I have been hired to help write an application that manages certain information for the end user. It is intended to manage a few megabytes of information, but also manage scanned images in full resolution. Should this project use a database, and why or why not?
Deciding whether to use a database for your application that manages both text information and full-resolution scanned images depends on several factors. Here are some considerations to help you make an informed decision: ### When to Use a Database 1. **Structured Data Management**: If your application requires struc...
12,401
[ { "from": "human", "value": "I have been hired to help write an application that manages certain information for the end user. It is intended to manage a few megabytes of information, but also manage scanned images in full resolution. Should this project use a database, and why or why not?\n" }, { ...
SslStream is supposed to negotiate the cipher type, key length, hash algorithm, etc. with its peer SSL stack. When using it in my code, I find that the negotiation always defaults to RC4 & MD5. I would like to use 3DES or AES for some added security. Looking around the web I find only a few references to this problem a...
The issue you are encountering, where `SslStream` is defaulting to RC4 and MD5 instead of more secure options like AES or 3DES, is generally related to the configuration of your system, .NET framework, and the TLS/SSL protocols you are using. Here are several steps you can take to enforce stronger encryption algorithms...
10,879
[ { "from": "human", "value": "SslStream is supposed to negotiate the cipher type, key length, hash algorithm, etc. with its peer SSL stack. When using it in my code, I find that the negotiation always defaults to RC4 & MD5. I would like to use 3DES or AES for some added security.\nLooking around the web I fi...
Is there any library available to query Btrieve databases without buying something from Pervasive? I'm looking to code in C# or Python.
Yes, there are several options available for querying Btrieve databases without having to purchase a product from Pervasive (now part of Actian). Here are some alternatives you can consider: ### C# 1. **Btrieve .NET Driver**: While the official Pervasive drivers are commercial, you can find open-source alternatives t...
11,297
[ { "from": "human", "value": "Is there any library available to query Btrieve databases without buying something from Pervasive? I'm looking to code in C# or Python.\n" }, { "from": "gpt", "value": "Yes, there are several options available for querying Btrieve databases without having to purchase...
I'm not asking this question because of the merits of garbage collection first of all. My main reason for asking this is that I do know that Bjarne Stroustrup has said that C++ will have a garbage collector at some point in time. With that said, why hasn't it been added? There are already some garbage collectors for ...
The incorporation of a garbage collector (GC) into C++ has been a topic of discussion for years, and while Bjarne Stroustrup has acknowledged the possibility of such a feature, there are several reasons why it hasn't been formally added to the C++ standard. Here are some key points to consider: 1. **Language Philosoph...
12,967
[ { "from": "human", "value": "I'm not asking this question because of the merits of garbage collection first of all. My main reason for asking this is that I do know that Bjarne Stroustrup has said that C++ will have a garbage collector at some point in time.\nWith that said, why hasn't it been added? Ther...
A query that is used to loop through 17 millions records to remove duplicates has been running now for about 16 hours and I wanted to know if the query is stopped right now if it will finalize the delete statements or if it has been deleting while running this query? Indeed, if I do stop it, does it finalize the delet...
There are several key points to address regarding your query and its execution: 1. **Transaction Behavior on Delete**: - In SQL Server, when you execute a DELETE statement, it operates within a transaction. If you stop the query execution, SQL Server rolls back the transaction, meaning no changes are finalized. Th...
13,672
[ { "from": "human", "value": "A query that is used to loop through 17 millions records to remove duplicates has been running now for about 16 hours and I wanted to know if the query is stopped right now if it will finalize the delete statements or if it has been deleting while running this query? Indeed, if...
I would like to format a price in JavaScript. I'd like a function which takes a float as an argument and returns a string formatted like this: "$ 2,500.00" How can I do this?
You can create a JavaScript function that formats a floating-point number into a string representation of currency. You can use the `toLocaleString` method for this purpose, which handles the formatting of numbers based on locale settings. Here's a function that does that: ```javascript function formatPrice(amount) {...
16,049
[ { "from": "human", "value": "I would like to format a price in JavaScript. I'd like a function which takes a float as an argument and returns a string formatted like this:\n\"$ 2,500.00\"\n\nHow can I do this?\n" }, { "from": "gpt", "value": "You can create a JavaScript function that formats a f...
I am seeing strange behaviour with the flash.media.Sound class in Flex 3. var sound:Sound = new Sound(); try{ sound.load(new URLRequest("directory/file.mp3")) } catch(e:IOError){ ... } However this isn't helping. I'm getting a stream error, and it actually sees to be in the Sound constructor. Error #2044: Unhandled ...
In ActionScript 3 (which is what Flex 3 is based on), the approach to error handling with events is different from typical synchronous code execution. The `try-catch` block does not catch asynchronous errors that occur after a method like `load` is called. The `Sound.load` method starts loading the audio file asynchron...
12,450
[ { "from": "human", "value": "I am seeing strange behaviour with the flash.media.Sound class in Flex 3.\nvar sound:Sound = new Sound();\ntry{\nsound.load(new URLRequest(\"directory/file.mp3\"))\n} catch(e:IOError){\n ...\n}\n\nHowever this isn't helping. I'm getting a stream error, and it actually sees to be...
Let's say I have committed some bad changes to Subversion repository. Then I commit good changes, that I want to keep. What would be easiest way to roll back those bad changes in Eclipse, and keep the good changes? Assuming that files relating to bad changes are not same as those relating to the good changes. How thing...
To roll back bad changes in a Subversion (SVN) repository while keeping your good changes, you have several approaches depending on whether the good changes were made to the same files as the bad changes. Below, I will outline a method using both Eclipse plugins (Subclipse or Subversive) and command-line SVN commands f...
9,430
[ { "from": "human", "value": "Let's say I have committed some bad changes to Subversion repository. Then I commit good changes, that I want to keep.\nWhat would be easiest way to roll back those bad changes in Eclipse, and keep the good changes? Assuming that files relating to bad changes are not same as tho...
I'm familiar with SQL Server Indexed Views (or Oracle Materialized Views), we use them in our OLAP applications. They have the really cool feature of being able to usurp an execution plan and remap it to the indexed view w/out having to change existing code. IE. Let's say I had a SPROC that was a really expensive join....
Using indexed views in an OLTP (Online Transaction Processing) environment can be a bit of a double-edged sword, and that is likely why you may not have seen widespread adoption of this technique. While there are potential performance benefits, there are also several considerations and trade-offs that can make indexed ...
7,385
[ { "from": "human", "value": "I'm familiar with SQL Server Indexed Views (or Oracle Materialized Views), we use them in our OLAP applications. They have the really cool feature of being able to usurp an execution plan and remap it to the indexed view w/out having to change existing code.\nIE. Let's say I had...
I am creating an SQL view for a file that strips out the spaces in a particular field. My question is if there is a why to set a key on that new view so a person can still CHAIN the file. We are on V5R3.
In IBM i (formerly known as AS/400), SQL views are essentially virtual tables that can present data from one or more tables in a particular format or structure. When you create an SQL view that modifies the data (like stripping spaces from a particular field), it's important to understand that views do not have physica...
12,787
[ { "from": "human", "value": "I am creating an SQL view for a file that strips out the spaces in a particular field. My question is if there is a why to set a key on that new view so a person can still CHAIN the file. We are on V5R3.\n" }, { "from": "gpt", "value": "In IBM i (formerly known as AS...
I'm updating some old AWStats config files to filter out some specific IP ranges. Here's the pertinent section of the config file: # Do not include access from clients that match following criteria. # If your log file contains IP addresses in host field, you must enter here # matching IP addresses criteria. # If DNS lo...
In AWStats, the `SkipHosts` configuration allows you to specify hosts (IP addresses or hostnames) that should be excluded from the statistics. When it comes to using regular expressions in AWStats, it can be a bit tricky since it doesn't support ranges in the same way that some regex engines might. To filter out IP ad...
13,643
[ { "from": "human", "value": "I'm updating some old AWStats config files to filter out some specific IP ranges. Here's the pertinent section of the config file:\n# Do not include access from clients that match following criteria.\n# If your log file contains IP addresses in host field, you must enter here\n#...
Im searching a Template Lib or Template Engine for generating HTML (XML) that runs under Jython (Jython 2.5 Alpha is ok).
If you are looking for template libraries or engines that can work with Jython, specifically for generating HTML or XML, here are a few options you can consider: 1. **Jinja2**: Although primarily designed for Python, Jinja2 can work with Jython. It’s a powerful template engine that is easy to use and supports features...
13,273
[ { "from": "human", "value": "Im searching a Template Lib or Template Engine for generating HTML (XML) that runs under Jython (Jython 2.5 Alpha is ok).\n" }, { "from": "gpt", "value": "If you are looking for template libraries or engines that can work with Jython, specifically for generating HTML...
What is the best way to configure iPlanet/Sun ONE be the HTTP/HTTPS front end to a JBoss/Tomcat application? Are there any performance considerations? How would this compare with the native integration between Apache httpd and Tomcat?
Configuring iPlanet/Sun ONE as a front-end for JBoss/Tomcat can be accomplished using a combination of proxying and load balancing techniques. Here are some steps and considerations for setting it up, along with performance aspects and a comparison to Apache HTTP Server (httpd). ### Configuration Steps 1. **Install a...
12,748
[ { "from": "human", "value": "What is the best way to configure iPlanet/Sun ONE be the HTTP/HTTPS front end to a JBoss/Tomcat application?\nAre there any performance considerations?\nHow would this compare with the native integration between Apache httpd and Tomcat?\n" }, { "from": "gpt", "value"...
In an Oracle cluster (more than one machine co-operating to serve one database) will the "sysdate" function always return a consistent answer? Even if the servers' Operating System clock reports inconsistent values?
In an Oracle cluster environment, the `SYSDATE` function returns the current date and time from the server on which the session is running. This means that if your Oracle database is running on multiple nodes (servers), each server might have its own operating system clock, which can lead to inconsistent values for `SY...
16,128
[ { "from": "human", "value": "In an Oracle cluster (more than one machine co-operating to serve one database) will the \"sysdate\" function always return a consistent answer? Even if the servers' Operating System clock reports inconsistent values?\n" }, { "from": "gpt", "value": "In an Oracle clu...
I'm planning to propose to my (very small) company that we buy a computer to run continous integration on. If they say yes, the task of actually buying the machine will probably fall on me, so my question is: What do I look for in a computer that will be used for continuous integration for a very small (3 people) php t...
When selecting a computer for continuous integration (CI) for a small PHP team, there are several key factors to consider. The goal is to ensure that the machine can efficiently handle your CI tasks without unnecessary overhead. Here’s a breakdown of the components and other considerations you should keep in mind: ###...
12,907
[ { "from": "human", "value": "I'm planning to propose to my (very small) company that we buy a computer to run continous integration on. If they say yes, the task of actually buying the machine will probably fall on me, so my question is:\nWhat do I look for in a computer that will be used for continuous int...
I can't get my GridView to enable a user to sort a column of data when I'm using a custom SqlDataSource. I have a GridView in which the code in the ASP reference to it in the HTML is minimal: <asp:GridView id="grid" runat="server" AutoGenerateColumns="False" AllowSorting="True"> </asp:GridView> In the code-behind I at...
To enable sorting in your `GridView` when using a custom `SqlDataSource`, you need to ensure that the `SqlDataSource` allows sorting and that you handle the sorting event appropriately. Here are a few adjustments and recommendations for your code: ### 1. Set `SortCommand` for `SqlDataSource` You need to enable sortin...
11,839
[ { "from": "human", "value": "I can't get my GridView to enable a user to sort a column of data when I'm using a custom SqlDataSource.\nI have a GridView in which the code in the ASP reference to it in the HTML is minimal:\n<asp:GridView id=\"grid\" runat=\"server\" AutoGenerateColumns=\"False\" AllowSorting...
Using NHibernate from C# and only HQL (not SQL) in a way that is compatible with MS SQL Server 2005/2008 (and preferably Oracle). Is there a way to write the order by clause so that nulls will sort at the end of the query results while the non-null results will be sorted in ascending order? Based on the answer to the q...
Yes, your approach is correct. When using HQL (Hibernate Query Language) with NHibernate, you can control the order of nulls in your query results by using a `CASE` statement. This method is compatible with both SQL Server and Oracle databases. Here's the HQL you suggested, formatted for better clarity: ```hql selec...
15,179
[ { "from": "human", "value": "Using NHibernate from C# and only HQL (not SQL) in a way that is compatible with MS SQL Server 2005/2008 (and preferably Oracle).\nIs there a way to write the order by clause so that nulls will sort at the end of the query results while the non-null results will be sorted in asc...
It's possible to create digrams in SQL Server 2000 that can be useful to show the relationships between tables. The problem we run into is that when somebody refreshes our development database, the diagrams get lost. We can load tables, stored procedures, views, etc. with SQL scripts, but we have to create the diagra...
In SQL Server 2000, database diagrams are not stored in a straightforward way that makes them easy to script out or export. They are stored in the `sysdiagrams` table, but unfortunately, this table doesn't allow for exporting directly to a script like you would with tables, stored procedures, or views. However, you ca...
14,574
[ { "from": "human", "value": "It's possible to create digrams in SQL Server 2000 that can be useful to show the relationships between tables. The problem we run into is that when somebody refreshes our development database, the diagrams get lost. We can load tables, stored procedures, views, etc. with SQL ...
I am writing a program in dot net that will execute scripts and command line programs using the framework 2.0's Process object. I want to be able to access the screen buffers of the process in my program. I've investigated this and it appears that I need to access console stdout and stderr buffers. Anyone know how this...
To read the console output of a process in .NET, you will indeed have to use interop with the Windows API because the .NET framework doesn’t provide built-in support for reading the console screen buffers of other processes. Below are the steps you can take to achieve this using C#: 1. **Import necessary namespaces**:...
9,238
[ { "from": "human", "value": "I am writing a program in dot net that will execute scripts and command line programs using the framework 2.0's Process object. I want to be able to access the screen buffers of the process in my program. I've investigated this and it appears that I need to access console stdout...
I am looking for details of the VTable structure, order and contents, and the location of the vtable pointers within objects. Ideally, this will cover single inheritance, multiple inheritance, and virtual inheritance. References to external documentation would also be appreciated Documentation of GCC 4.0x class layout ...
The VTable, or Virtual Table, is an important concept in C++ for implementing polymorphism, particularly with classes that use virtual functions. It helps the compiler manage dynamic method dispatch when dealing with inheritance hierarchies. ### VTable Structure 1. **What is a VTable?** - A VTable is an array of p...
10,778
[ { "from": "human", "value": "I am looking for details of the VTable structure, order and contents, and the location of the vtable pointers within objects.\nIdeally, this will cover single inheritance, multiple inheritance, and virtual inheritance.\nReferences to external documentation would also be apprecia...
Some things are easier to implement just by hand (code), but some are easier through WF. It looks like WF can be used to create (almost) any kind of algorithm. So (theoretically) I can do all my logic in WF, but it's probably a bad idea to do it for all projects. In what situations is it a good idea to use WF and when ...
Windows Workflow Foundation (WF) is a framework for building workflow-enabled applications on the .NET platform. It provides a way to define workflows that can include various activities and conditions, allowing for complex task automation, orchestration, and business process management. However, deciding whether to us...
8,890
[ { "from": "human", "value": "Some things are easier to implement just by hand (code), but some are easier through WF. It looks like WF can be used to create (almost) any kind of algorithm. So (theoretically) I can do all my logic in WF, but it's probably a bad idea to do it for all projects.\nIn what situat...
How can I get a full call stack for a c++ application developed with Visual Studio 2005? I would like to have a full call stack including the code in the system libraries. Do I have to change some settings in Visual Studio, or do I have to install additional software?
To obtain a full call stack for a C++ application developed in Visual Studio 2005, including code from system libraries, you will need to adjust some settings in the Visual Studio IDE and possibly install additional debugging symbols. Here’s a step-by-step guide to help you achieve this: ### Step 1: Configure Debuggin...
9,263
[ { "from": "human", "value": "How can I get a full call stack for a c++ application developed with Visual Studio 2005? I would like to have a full call stack including the code in the system libraries.\nDo I have to change some settings in Visual Studio, or do I have to install additional software?\n" }, ...
(I've asked the same question of the jmeter-user mailing list, but I wanted to try here as well - so at the least I can update this with the answer once I find it). I'm having trouble using JMeter to test a Tomcat webapp using a self-signed SSL cert. JMeter throws a SocketException with message Unconnected sockets not ...
It sounds like you're dealing with a couple of potential issues while trying to configure JMeter to work with a self-signed SSL certificate. The "Unconnected sockets not implemented" error typically indicates that there's a problem with establishing a connection, which can be related to SSL settings, the keystore confi...
11,093
[ { "from": "human", "value": "(I've asked the same question of the jmeter-user mailing list, but I wanted to try here as well - so at the least I can update this with the answer once I find it).\nI'm having trouble using JMeter to test a Tomcat webapp using a self-signed SSL cert. JMeter throws a SocketExcep...
After I develop my add-in for Microsoft Office ( and in the process messed up all my menu bars and tool bars) using Visual Studio For Office, is there anyway to restore the MS Office to default? For the record, Clean Solution alone is not enough!
If you have made changes to your Microsoft Office menus and toolbars while developing an add-in and want to restore the default settings, there are several methods you can try: ### Method 1: Reset Toolbars and Menus via Office Application 1. **Open the Office Application** (e.g., Word, Excel). 2. **Go to Options**: ...
12,797
[ { "from": "human", "value": "After I develop my add-in for Microsoft Office ( and in the process messed up all my menu bars and tool bars) using Visual Studio For Office, is there anyway to restore the MS Office to default?\nFor the record, Clean Solution alone is not enough!\n" }, { "from": "gpt", ...
I would like to call my unmanaged C++ libraries from my C# code. What are the potential pitfalls and precautions that need to be taken? Thank you for your time.
Calling unmanaged C++ libraries from C# can be quite powerful but also comes with several potential pitfalls and challenges. Here are some key points to consider: ### 1. **Interoperability Mechanisms** - **P/Invoke (Platform Invocation Services):** This is the most common way to call unmanaged code from C#. You'll ...
10,317
[ { "from": "human", "value": "I would like to call my unmanaged C++ libraries from my C# code. What are the potential pitfalls and precautions that need to be taken? Thank you for your time.\n" }, { "from": "gpt", "value": "Calling unmanaged C++ libraries from C# can be quite powerful but also co...
NOTE: I am not set on using VI, it is just the first thing that came to mind that might be able to do what I need. Feel free to suggest any other program. I have a form with nearly 100 fields that I would like to auto-fill with PHP. I know how to do the autofill, but I would like to avoid manually adding the needed tex...
You can automate the process of adding the PHP code to your input fields using a text editor that supports regular expressions. Since you mentioned VI (Vim), I’ll provide you with a solution for that, but the same concept can be applied using other text editors like Sublime Text, VSCode, or even command-line tools like...
14,482
[ { "from": "human", "value": "NOTE: I am not set on using VI, it is just the first thing that came to mind that might be able to do what I need. Feel free to suggest any other program.\nI have a form with nearly 100 fields that I would like to auto-fill with PHP. I know how to do the autofill, but I would li...
I just stumbled upon MainSoft's Grasshopper, which claims to cross-compile .Net ILM to Java bytecode. It seems to use the Mono implementation of the .Net libraries. All of the samples refer to web apps, but my requirement would be to cross-compile a .Net API (class library) to a Java API so that Java clients can use th...
Using MainSoft's Grasshopper to cross-compile a .NET API to Java bytecode is an intriguing approach, but there are several considerations and potential challenges to keep in mind. Here are some key points to consider: ### Compatibility 1. **API Compatibility**: Ensure that the .NET classes, methods, and libraries you ...
14,008
[ { "from": "human", "value": "I just stumbled upon MainSoft's Grasshopper, which claims to cross-compile .Net ILM to Java bytecode. It seems to use the Mono implementation of the .Net libraries. All of the samples refer to web apps, but my requirement would be to cross-compile a .Net API (class library) to a...
I am designing a class that stores (caches) a set of data. I want to lookup a value, if the class contains the value then use it and modify a property of the class. I am concerned about the design of the public interface. Here is how the class is going to be used: ClassItem *pClassItem = myClass.Lookup(value); if (p...
Your concern about exposing the internal details of `ClassItem` while maintaining an efficient interface for your class is valid. To balance the need for both efficiency and clean design, you could use a combination of design principles and patterns. Here are a few suggestions: ### 1. Use a Wrapper Class for Modificat...
11,371
[ { "from": "human", "value": "I am designing a class that stores (caches) a set of data. I want to lookup a value, if the class contains the value then use it and modify a property of the class. I am concerned about the design of the public interface.\nHere is how the class is going to be used:\n\nClassIte...
Needs to be secure and able to handle thousands of users.
To create a secure system that can handle thousands of users effectively, you'll need to consider several key components and best practices. Here’s a structured approach to achieve this: ### 1. **Infrastructure** - **Cloud Providers:** Use reputable cloud service providers (like AWS, Azure, or Google Cloud) that ...
10,493
[ { "from": "human", "value": "Needs to be secure and able to handle thousands of users.\n" }, { "from": "gpt", "value": "To create a secure system that can handle thousands of users effectively, you'll need to consider several key components and best practices. Here’s a structured approach to ach...
We're using Crystal 11 through their webserver. When we run a report, it does the Sql query and displays the first page of the report in the Crystal web reportviewer. When you hit the next page button, it reruns the Sql query and displays the next page. How do we get the requerying of the data to stop? We also have mul...
To prevent the Crystal Reports web viewer from re-querying the database each time you navigate to the next page of the report, you can implement a couple of strategies to manage the caching of data effectively. Here's how you can approach this: ### 1. Utilize the Report's Cache Options Crystal Reports has built-in ca...
12,756
[ { "from": "human", "value": "We're using Crystal 11 through their webserver. When we run a report, it does the Sql query and displays the first page of the report in the Crystal web reportviewer.\nWhen you hit the next page button, it reruns the Sql query and displays the next page.\nHow do we get the reque...
I want the 2 columns to touch ie. remove the margins, how can I do this? My code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE>testing</TITLE> <!-- css --> <link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.5.2/build/reset-fonts-grids/reset-fonts-gri...
To make the two columns touch without any margins or padding in your layout, you'll need to adjust the CSS for the `.yui-b` class or add new styles to eliminate any default margins or padding that might be causing separation between the columns. Here's a modified version of your code where I added some CSS to ensure t...
15,051
[ { "from": "human", "value": "I want the 2 columns to touch ie. remove the margins, how can I do this?\nMy code:\n <!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">\n<HTML>\n <HEAD>\n <TITLE>testing</TITLE>\n <!-- css --> \n<link rel=\"stylesheet\" type=\"text/css\" href=\"http://yui.yaho...
At present it seems that VS2008 still isn't supported either in the 5.1.5 release or in the STLPort CVS repository. If someone has already done this work then it would be useful to share, if possible :) Likewise it would be useful to know about the changes required for a VS2005 or 2008 x64 build.
To get STLPort working with Visual Studio 2008 (VS2008) or to enable x64 builds, you may need to apply some specific patches and settings. Here are some general steps and tips that you might find useful: ### Steps to Enable STLPort in VS2008 1. **Download STLPort**: Make sure to download the latest version of STLPort...
14,800
[ { "from": "human", "value": "At present it seems that VS2008 still isn't supported either in the 5.1.5 release or in the STLPort CVS repository. If someone has already done this work then it would be useful to share, if possible :)\nLikewise it would be useful to know about the changes required for a VS2005...
is it possible to extend vim functionality via custom extension (preferably, written in Python)? What I need ideally is custom command when in command mode. E.g. ESC :do_this :do_that
Yes, it is indeed possible to extend Vim's functionality using custom extensions, and you can write these extensions in Python. Vim has a built-in interface for scripting with Python, and you can create custom commands that you can call in command mode. Here's how you can do that: ### 1. Setting Up Vim for Python Fir...
12,123
[ { "from": "human", "value": "is it possible to extend vim functionality via custom extension (preferably, written in Python)?\nWhat I need ideally is custom command when in command mode. E.g.\nESC\n:do_this\n:do_that\n" }, { "from": "gpt", "value": "Yes, it is indeed possible to extend Vim's fun...
I want to copy a live production database into my local development database. Is there a way to do this without locking the production database? I'm currently using: mysqldump -u root --password=xxx -h xxx my_db1 | mysql -u root --password=xxx -h localhost my_db1 But it's locking each table as it runs.
Copying a live production database into a local development environment without locking the production database can be achieved by using different options and techniques with `mysqldump`. The default behavior of `mysqldump` locks tables, but you can use certain options to avoid this. 1. **Using the `--single-transacti...
6,930
[ { "from": "human", "value": "I want to copy a live production database into my local development database. Is there a way to do this without locking the production database?\nI'm currently using:\nmysqldump -u root --password=xxx -h xxx my_db1 | mysql -u root --password=xxx -h localhost my_db1\n\nBut it's ...
In a text file, there is a string "I don't like this". However, when I read it into a string, it becomes "I don\xe2\x80\x98t like this". I understand that \u2018 is the unicode representation of "'". I use f1 = open (file1, "r") text = f1.read() command to do the reading. Now, is it possible to read the string in suc...
The issue you're encountering is related to the encoding used when reading the text file. The text "I don't like this" has been saved using a different encoding that represents the apostrophe as a unicode character (in this case, the curly quote `‘`). When you read the file, you need to specify the correct encoding so ...
14,594
[ { "from": "human", "value": "In a text file, there is a string \"I don't like this\".\nHowever, when I read it into a string, it becomes \"I don\\xe2\\x80\\x98t like this\". I understand that \\u2018 is the unicode representation of \"'\". I use \nf1 = open (file1, \"r\")\ntext = f1.read()\n\ncommand to do ...
I am trying to write a macro that would "click" a command button that is in another workbook. Is that possible? Without changing any of the code within that other workbook?
Yes, it is possible to trigger a button click programmatically using VBA in another workbook without modifying the code in that workbook. However, the implementation depends on the structure of the command button (ActiveX or Form Control) and the context of your code. Here are two common approaches: ### 1. If the Comm...
13,281
[ { "from": "human", "value": "I am trying to write a macro that would \"click\" a command button that is in another workbook. Is that possible? Without changing any of the code within that other workbook?\n" }, { "from": "gpt", "value": "Yes, it is possible to trigger a button click programmatica...
I am developing a .NET WinForms application which relies on user.config to store various useful settings such as intranet web service URLs. We would like to make it possible to import custom initial settings as part of the installation. The use case for this is if a company has 100 machines they want to install the s...
You're correct that using `user.config` directly for initial settings during installation can be a challenge because `user.config` is specific to each user profile and generated after the first run of the application. However, there are several approaches you can take to facilitate the deployment of initial settings wi...
7,180
[ { "from": "human", "value": "I am developing a .NET WinForms application which relies on user.config to store various useful settings such as intranet web service URLs. We would like to make it possible to import custom initial settings as part of the installation. The use case for this is if a company ha...
If you have Mathematica code in foo.m, Mathematica can be invoked with -noprompt and with -initfile foo.m (or -run "<<foo.m") and the command line arguments are available in $CommandLine (with extra junk in there) but is there a way to just have some mathematica code like #!/usr/bin/env MathKernel x = 2+2; Print[x]; Pr...
You can indeed use Mathematica as a scripting language by creating a script that starts with a shebang (`#!`) line that points to the `MathKernel` executable. Here’s how you can create a basic Mathematica script that behaves like a standard executable script: 1. **Create the Script File**: Create a file named, for exa...
15,590
[ { "from": "human", "value": "If you have Mathematica code in foo.m, Mathematica can be invoked with -noprompt\nand with -initfile foo.m\n(or -run \"<<foo.m\")\nand the command line arguments are available in $CommandLine (with extra junk in there) but is there a way to just have some mathematica code like\n...
Does a hash shrink in Perl as you delete elements. More specifically I had a perl program that I inherited that would parse a huge file ( 1 GB ) and load up a hash of hashes. it would do that same for another file and then do a comparison of different elements. The memory consumption was huge during this process and e...
In Perl, when you delete elements from a hash (or a hash of hashes), the memory used by the hash does not immediately shrink or return to the system. This is because Perl manages memory internally using a memory allocator that does not necessarily free up memory for reuse by the operating system when you delete items. ...
14,080
[ { "from": "human", "value": "Does a hash shrink in Perl as you delete elements. \nMore specifically I had a perl program that I inherited that would parse a huge file ( 1 GB ) and load up a hash of hashes. it would do that same for another file and then do a comparison of different elements. The memory cons...
I'm creating a login page. I want to create ASP.NET TextBox controls that have "Username" and "Password" as their Text, but as soon as they receive focus, these words should disappear and whatever the user types should appear, just like normal textbox. If the user leaves it blank and tabs to the next textbox, then thes...
To achieve the behavior you're looking for with ASP.NET TextBox controls, you can utilize the `Text` property for placeholder functionality, along with some JavaScript to manage the focus and blur events. Here's a simple way to implement a login page with the desired behavior using ASP.NET Web Forms and JavaScript: #...
11,141
[ { "from": "human", "value": "I'm creating a login page. I want to create ASP.NET TextBox controls that have \"Username\" and \"Password\" as their Text, but as soon as they receive focus, these words should disappear and whatever the user types should appear, just like normal textbox. If the user leaves it ...
Am looking for C# open source NMEA parser.
There are several open-source libraries available for parsing NMEA sentences in C#. Here are a few options you can consider: 1. **NmeaParser**: - GitHub: [NmeaParser](https://github.com/jessehouwing/NmeaParser) - Description: This is a simple NMEA 0183 parser for .NET. It can be used to parse standard NMEA sente...
14,988
[ { "from": "human", "value": "Am looking for C# open source NMEA parser. \n" }, { "from": "gpt", "value": "There are several open-source libraries available for parsing NMEA sentences in C#. Here are a few options you can consider:\n\n1. **NmeaParser**:\n - GitHub: [NmeaParser](https://github....
We have a database that we are using to store test results for an embedded device. There's a table with columns for different types of failures (details not relevant), along with a primary key 'keynum' and a 'NUM_FAILURES' column that lists the number of failures. We store passes and failures, so a pass has a '0' in ...
To achieve the goal of keeping the last 1000 results and the last 50 failures, you can create an `INSERT` trigger in SQLite that checks the count of the entries after a new record is inserted and then deletes the appropriate older entries to maintain your constraints. Here's a sample implementation for the trigger: `...
13,257
[ { "from": "human", "value": "We have a database that we are using to store test results for an embedded device. There's a table with columns for different types of failures (details not relevant), along with a primary key 'keynum' and a 'NUM_FAILURES' column that lists the number of failures. We store pas...
Before, I have found the "Cost" in the execution plan to be a good indicator of relative execution time. Why is this case different? Am I a fool for thinking the execution plan has relevance? What specifically can I try to improve v_test performance? Thank you. Using Oracle 10g I have a simple query view defined below ...
It sounds like you're experiencing significant performance issues with your new view `v_test` compared to the old view `v_bo_secured_detail`. While execution plans and costs are useful indicators, they don't always tell the complete story when it comes to performance, especially in complex queries or on large data sets...
10,503
[ { "from": "human", "value": "Before, I have found the \"Cost\" in the execution plan to be a good indicator of relative execution time. Why is this case different? Am I a fool for thinking the execution plan has relevance? What specifically can I try to improve v_test performance?\nThank you.\nUsing Oracle ...
I have recently begun working on a project to establish how best to leverage the processing power available in modern graphics cards for general programming. It seems that the field general purpose GPU programming (GPGPU) has a large bias towards scientific applications with a lot of heavy math as this fits well with t...
Your inquiry into leveraging GPU processing power for general programming applications beyond traditional scientific computing is quite fascinating. While GPGPU has indeed been dominated by numerical and simulation tasks, there are many other categories of work where GPU acceleration could yield performance gains, albe...
12,725
[ { "from": "human", "value": "I have recently begun working on a project to establish how best to leverage the processing power available in modern graphics cards for general programming. It seems that the field general purpose GPU programming (GPGPU) has a large bias towards scientific applications with a l...
See also: How can I see which Git branches are tracking which remote / upstream branch? How can I find out which remote branch a local branch is tracking? Do I need to parse git config output, or is there a command that would do this for me?
You can easily find out which remote branch a local branch is tracking using the `git branch` command with the `-vv` option. This command will list all local branches along with their tracking information, including the remote branch they are associated with. Here's how you can do it: 1. Open your terminal. 2. Naviga...
14,920
[ { "from": "human", "value": "\nSee also: \nHow can I see which Git branches are tracking which remote / upstream branch?\n\nHow can I find out which remote branch a local branch is tracking?\nDo I need to parse git config output, or is there a command that would do this for me?\n" }, { "from": "gpt"...
I have a custom category ("disciplines") in my method plugin which I want to use to contain existing disciplines (from the Scrum plugin and EPF OpenUP library) as well as a few of my own (some are new, and others extend the OpenUP ones). I can add them simply, order them as desired, and view them in the Browsing Perspe...
It sounds like you're experiencing an issue with the visibility of your custom category ("disciplines") after publishing your method plugin. Here are some steps to troubleshoot the problem: 1. **Check Plugin Configuration**: Ensure that your method plugin is correctly configured. Verify that your custom category and t...
12,036
[ { "from": "human", "value": "I have a custom category (\"disciplines\") in my method plugin which I want to use to contain existing disciplines (from the Scrum plugin and EPF OpenUP library) as well as a few of my own (some are new, and others extend the OpenUP ones). I can add them simply, order them as de...
I need to be able to load the entire contents of a text file and load it into a variable for further processing. How can I do that? Here's what I did thanks to Roman Odaisky's answer. SetLocal EnableDelayedExpansion set content= for /F "delims=" %%i in (test.txt) do set content=!content! %%i echo %content% EndLocal...
It looks like you're attempting to read the contents of a text file into a variable using a batch script. Your approach is almost correct, but there's a minor issue with the way you're echoing the variable at the end. When you use `echo %content%` outside of the `SetLocal/EndLocal`, it won't display the updated value o...
15,016
[ { "from": "human", "value": "I need to be able to load the entire contents of a text file and load it into a variable for further processing. \nHow can I do that?\n\nHere's what I did thanks to Roman Odaisky's answer.\nSetLocal EnableDelayedExpansion\nset content=\nfor /F \"delims=\" %%i in (test.txt) do s...
I am trying to scrape an html table and save its data in a database. What strategies/solutions have you found to be helpful in approaching this program. I'm most comfortable with Java and PHP but really a solution in any language would be helpful. EDIT: For more detail, the UTA (Salt Lake's Bus system) provides bus sch...
Scraping HTML tables and saving the data into a database can be approached in several steps. Below, I’ll outline a general strategy you can follow, and then provide a simple example in both Java and PHP. ### General Strategy 1. **Identify the Data**: Look at the HTML structure of the page and identify the tables cont...
8,225
[ { "from": "human", "value": "I am trying to scrape an html table and save its data in a database. What strategies/solutions have you found to be helpful in approaching this program.\nI'm most comfortable with Java and PHP but really a solution in any language would be helpful.\nEDIT: For more detail, the UT...
CSS width value = display width of inside? or CSS width value = display width of inside + CSS margin-left + CSS margin-right?
The `width` property in CSS specifically defines the width of the content area of an element. It does **not** include the margins, borders, or padding by default. In other words, when you set a width on an element, it refers to the width of the content itself and does not account for: - CSS `margin-left` - CSS `marg...
16,485
[ { "from": "human", "value": "CSS width value = display width of inside?\nor\nCSS width value = display width of inside + CSS margin-left + CSS margin-right?\n" }, { "from": "gpt", "value": "The `width` property in CSS specifically defines the width of the content area of an element. It does **no...
Here is my situation: Table one contains a set of data that uses an id for an unique identifier. This table has a one to many relationship with about 6 other tables such that. Given Table 1 with Id of 001: Table 2 might have 3 rows with foreign key: 001 Table 3 might have 12 rows with foreign key: 001 Table 4 might ha...
You can certainly optimize your approach using SQL to avoid executing multiple queries in a loop. Instead of fetching data from each table in separate queries, you can use SQL joins to get the data in a single query. This way, you can get all the relevant rows in one go, which will significantly improve performance. H...
13,163
[ { "from": "human", "value": "Here is my situation:\nTable one contains a set of data that uses an id for an unique identifier. This table has a one to many relationship with about 6 other tables such that.\nGiven Table 1 with Id of 001:\nTable 2 might have 3 rows with foreign key: 001\nTable 3 might have 1...
im trying to locate the position of the minimum value in a vector, using STL find algorithm (and the min_element algorithm), but instead of returning the postion, its just giving me the value. E.g, if the minimum value is it, is position will be returned as 8 etc. What am I doing wrong here? int value = *min_element(v2...
The issue you're encountering arises from the way you're using the `std::find` algorithm. In your code, `std::find` returns an iterator to the first occurrence of the value, and when you dereference it with `*`, it gives you the value itself rather than the position (or index) in the vector. To get the index of the mi...
16,141
[ { "from": "human", "value": "im trying to locate the position of the minimum value in a vector, using STL find algorithm (and the min_element algorithm), but instead of returning the postion, its just giving me the value. E.g, if the minimum value is it, is position will be returned as 8 etc. What am I doin...
While trying to use Shrinksafe custom_rhino.jar to build Dojo I get MalformedInputException. The problem occurs when build reaches custom widgets/templates which contain french letters stored in UTF-8. The AIX machine has LANG=en_US which should be correct, judging by other documented problems regarding MalformedInputE...
The `MalformedInputException` indicates that there is an issue with character encoding, particularly with the handling of UTF-8 encoded characters. This can be frustrating, especially on an IBM AIX system using IBM's JRE. Here are several approaches you can take to try to resolve the issue: ### 1. Set the Correct Enco...
9,581
[ { "from": "human", "value": "While trying to use Shrinksafe custom_rhino.jar to build Dojo I get MalformedInputException. The problem occurs when build reaches custom widgets/templates which contain french letters stored in UTF-8. The AIX machine has LANG=en_US which should be correct, judging by other docu...
I'm planning to write a web service aka api for my application which was developed with .Net and SQLServer. .Net provides a simple way to create webservices by creating asmx files. But i need to know how best it can be designed or what are the best practices in creating a web service in .net or some pointers to good ar...
Creating a web service in .NET, particularly using ASMX (which is a part of the .NET Framework up to version 4.0), can be a good starting point for understanding web services. However, since .NET 2.0 is quite old, consider whether you might want to use a newer framework, like ASP.NET Web API or ASP.NET Core, if you're ...
13,139
[ { "from": "human", "value": "I'm planning to write a web service aka api for my application which was developed with .Net and SQLServer. .Net provides a simple way to create webservices by creating asmx files. But i need to know how best it can be designed or what are the best practices in creating a web se...
In a typical enterprise scenario with in-house development, you might have dev, staging, and production environments. You might use SVN to contain ongoing development work in a trunk, with patches being stored in branches, and your released code going into appropriately named tags. Migrating binaries from one environ...
Managing code and content changes in a SharePoint environment requires careful planning and coordination, especially when moving changes through development, staging, and production environments. Here are some best practices and strategies based on my experience in managing enterprise SharePoint environments: ### 1. *...
10,080
[ { "from": "human", "value": "In a typical enterprise scenario with in-house development, you might have dev, staging, and production environments. You might use SVN to contain ongoing development work in a trunk, with patches being stored in branches, and your released code going into appropriately named t...
If I have a Range object--for example, let's say it refers to cell A1 on a worksheet called Book1. So I know that calling Address() will get me a simple local reference: $A$1. I know it can also be called as Address(External:=True) to get a reference including the workbook name and worksheet name: [Book1]Sheet1!$A$1...
In Excel VBA, you can obtain the address of a Range object that includes the sheet name but excludes the workbook name by using the `Worksheet` property of the Range object in conjunction with the `Address` method. You can construct the desired address by combining the worksheet name with the address returned by the `...
15,842
[ { "from": "human", "value": "If I have a Range object--for example, let's say it refers to cell A1 on a worksheet called Book1. So I know that calling Address() will get me a simple local reference: $A$1. I know it can also be called as Address(External:=True) to get a reference including the workbook na...
I am trying to write a formula in ActionScript 3 that will give me var "z" (please see image below) in degrees, which I will then convert to radians. I will already know the value of vars "x" and "y". Using trigonometry, how can I calculate the length of the hypotenuse and therefore the variable angle of var z? A solu...
To calculate the angle \( z \) in degrees based on the values of \( x \) and \( y \) using trigonometry in ActionScript 3, you can use the `Math.atan2(y, x)` function. This function computes the angle in radians between the positive x-axis and the point given by the coordinates (x, y). After calculating the angle in ra...
14,939
[ { "from": "human", "value": "I am trying to write a formula in ActionScript 3 that will give me var \"z\" (please see image below) in degrees, which I will then convert to radians.\nI will already know the value of vars \"x\" and \"y\". Using trigonometry, how can I calculate the length of the hypotenuse an...
I have to create a dialog based application, instead of old CFormView type of design. But CDialog produces fixed-size dialogs. How can I create dialog based applications with resizable dialogs?
Creating a resizable dialog in an MFC (Microsoft Foundation Class) application can be achieved by utilizing the `CDialogEx` class combined with some additional handling to enable resizing. Here’s a step-by-step guide on how to create a resizable dialog-based application: ### Step 1: Create a Dialog Resource 1. Open y...
11,357
[ { "from": "human", "value": "I have to create a dialog based application, instead of old CFormView type of design. But CDialog produces fixed-size dialogs. How can I create dialog based applications with resizable dialogs?\n" }, { "from": "gpt", "value": "Creating a resizable dialog in an MFC (M...
If so why? I know setting this on will result in more number of automatically committed revisions. Is it good to have more auto commits?
The decision to allow more automatically committed revisions, often referred to as "auto commits," can depend on the context of the project or system you are working with. Here are some pros and cons to consider: ### Pros of Auto Commits: 1. **Simplicity**: Auto commits can simplify the development workflow, as change...
14,544
[ { "from": "human", "value": "If so why? I know setting this on will result in more number of automatically committed revisions. Is it good to have more auto commits?\n" }, { "from": "gpt", "value": "The decision to allow more automatically committed revisions, often referred to as \"auto commits...
I'm using a device that's got GPRS media to connect to a PC running stunnel. On TCPIP connections, the number of sessions is limitless. However, when it comes to SSL connections, it could only go as far as 1062 successful sessions. I've tried it like 3 times but makes no difference. I've checked the OpenSSL codes and...
The limitation you're encountering with SSL connections being capped at 1062 sessions could be due to several factors, both at the application level (stunnel/OpenSSL) and possibly at the system or network level. Here are some points to consider: 1. **File Descriptor Limit**: Operating systems often have a limit on the...
13,490
[ { "from": "human", "value": "I'm using a device that's got GPRS media to connect to a PC running stunnel. On TCPIP connections, the number of sessions is limitless. However, when it comes to SSL connections, it could only go as far as 1062 successful sessions. I've tried it like 3 times but makes no diffe...
I have heard the 'shard' technique mentioned several times with regard to solving scaling problems for large websites. What is this 'shard' technique and why is it so good?
The "shard" technique, often referred to as "sharding," is a database architecture pattern used to scale large applications by partitioning data across multiple database instances or servers. The idea is to divide a large dataset into smaller, more manageable pieces, known as "shards," which can be distributed across m...
12,547
[ { "from": "human", "value": "I have heard the 'shard' technique mentioned several times with regard to solving scaling problems for large websites. What is this 'shard' technique and why is it so good?\n" }, { "from": "gpt", "value": "The \"shard\" technique, often referred to as \"sharding,\" i...
I`d like to be able to read the content of office documents (for a custom crawler). The office version that need to be readable are from 2000 to 2007. I mainly want to be crawling words, excel and powerpoint documents. I don`t want to retrieve the formatting, only the text in it. The crawler is based on lucene.NET if...
To read the content of Office documents (specifically Word, Excel, and PowerPoint) from versions 2000 to 2007, you can use libraries that support the file formats used in those versions. Since you're working in C#, there are several libraries you might consider. Here are some options: ### 1. **NPOI** NPOI is a .NET li...
8,892
[ { "from": "human", "value": "I`d like to be able to read the content of office documents (for a custom crawler). \nThe office version that need to be readable are from 2000 to 2007. I mainly want to be crawling words, excel and powerpoint documents.\nI don`t want to retrieve the formatting, only the text in...
Should I push keypresses to vehicles when they're pressed, or should vehicles pull keys pressed from the engine? I have a vehicle object, which has location, velocity and accelleration members (among other things) and an update method, during which it updates its location based on its velocity, and its vevlocity based ...
Your question addresses important design considerations in game architecture, particularly around how different components of the game interact with each other. There are pros and cons to both the "push" and "pull" approaches, as well as to how you structure interactions between objects. Here’s a breakdown of your opti...
11,708
[ { "from": "human", "value": "Should I push keypresses to vehicles when they're pressed, or should vehicles pull keys pressed from the engine?\nI have a vehicle object, which has location, velocity and accelleration members (among other things) and an update method, during which it updates its location based...
LAMP is a well-known acronym for the software/technology bundle/stack representing Linux, Apache, MySQL, PHP. There are a few passing references on the Web that use the acronym WISC to speak of the other (supposedly Microsoft-centric) software/technology bundle/stack in contrast to LAMP. There is, however, no Wikipedia...
Your decomposition of the WISC acronym as: - **W** = Windows - **I** = Internet Information Services (IIS) - **S** = SQL Server - **C** = C# is indeed a reasonable interpretation for a Microsoft-centric software stack, particularly in the context of web development and applications. However, it's worth noting that w...
16,958
[ { "from": "human", "value": "LAMP is a well-known acronym for the software/technology bundle/stack representing Linux, Apache, MySQL, PHP. There are a few passing references on the Web that use the acronym WISC to speak of the other (supposedly Microsoft-centric) software/technology bundle/stack in contrast...
Folks, I'm working on a little piece of rich client software that I'd like to distribute for free. That is, I'd still like to make money on it, but I'd like the revenue to come from advertising. Do you know of an advertising platform that works well for client apps? I'd like the ads to be completely unobtrusive (like ...
There are several advertising platforms and options you might consider for distributing your rich client software while maintaining a good user experience. Here are a few suggestions that align with your goals: 1. **Google AdMob**: Although primarily for mobile applications, AdMob can be integrated into desktop applic...
12,218
[ { "from": "human", "value": "Folks, \nI'm working on a little piece of rich client software that I'd like to distribute for free. That is, I'd still like to make money on it, but I'd like the revenue to come from advertising.\nDo you know of an advertising platform that works well for client apps? I'd like ...
I'm writing a quick Rails app and was wondering how I can validate the success an exec'd command. The two commands I'm running are and SVN update, and a cp from one directory to another.
In a Ruby on Rails application, you can execute shell commands and validate their success using the backticks or the `%x{}` syntax. For capturing the success status, you can use the `$?` variable which holds the status of the last executed command. Here's how you can validate the success of an `svn update` command and...
14,745
[ { "from": "human", "value": "I'm writing a quick Rails app and was wondering how I can validate the success an exec'd command. The two commands I'm running are and SVN update, and a cp from one directory to another.\n" }, { "from": "gpt", "value": "In a Ruby on Rails application, you can execut...
I would like to make 2 TB or so available via NFS and CIFS. I am looking for a 2 (or more) server solution for high availability and the ability to load balance across the servers if possible. Any suggestions for clustering or high availability solutions? This is business use, planning on growing to 5-10 TB over next f...
Given your requirements for high availability, load balancing, and minimal downtime, it seems that you need a robust solution that can efficiently handle NFS and CIFS sharing while ensuring data integrity and availability. Below are some suggestions for architectures and technologies that may suit your needs: ### 1. *...
11,279
[ { "from": "human", "value": "I would like to make 2 TB or so available via NFS and CIFS. I am looking for a 2 (or more) server solution for high availability and the ability to load balance across the servers if possible. Any suggestions for clustering or high availability solutions?\nThis is business use, ...
I would like to write my own OS, and would like to temporarily jump over the complicated task of writing the kernel and come back to it later by using the Linux kernel in the mean time. However, I would like to provide the OS as closed source for now. What license is the Linux kernel under and is it possible to use i...
The Linux kernel is licensed under the GNU General Public License (GPL), specifically GPL version 2. This license requires that any derivative work of the kernel itself also be released under the same GPL license if it is distributed. However, you are asking about using the Linux kernel as part of a closed-source ope...
14,938
[ { "from": "human", "value": "I would like to write my own OS, and would like to temporarily jump over the complicated task of writing the kernel and come back to it later by using the Linux kernel in the mean time. However, I would like to provide the OS as closed source for now. What license is the Linux...
I've just solved another *I-though-I-was-using-this-version-of-a-library-but-apparently-my-app-server-has-already-loaded-an-older-version-of-this-library-*issue (sigh). Does anybody know a good way to verify (or monitor) whether your application has access to all the appropriate jar-files, or loaded class-versions? Tha...
It sounds like you're dealing with a common issue in Java applications related to class loading and library version conflicts. Here are a few strategies to help you monitor and verify that your application is using the correct versions of libraries: ### 1. **Classloader Logging**: As you've mentioned, enabling classlo...
13,473
[ { "from": "human", "value": "I've just solved another *I-though-I-was-using-this-version-of-a-library-but-apparently-my-app-server-has-already-loaded-an-older-version-of-this-library-*issue (sigh).\nDoes anybody know a good way to verify (or monitor) whether your application has access to all the appropriat...
I have a file which is an XML representation of some data that is taken from a Web service and cached locally within a Web Application. The idea being is that this data is very static, but just might change. So I have set it up to cache to a file, and stuck a monitor against it to check if it has been deleted. Once del...
It sounds like you're on the right track with using a locking mechanism to prevent multiple threads from reading and writing to the file at the same time. However, there are several key points to consider to ensure that your approach works correctly in a multi-threaded environment, especially within the context of an A...
6,491
[ { "from": "human", "value": "I have a file which is an XML representation of some data that is taken from a Web service and cached locally within a Web Application. The idea being is that this data is very static, but just might change. So I have set it up to cache to a file, and stuck a monitor against it ...
I have written an application which has a modal form. How can I ensure that this form does not lose the focus even when an other application is started?
To ensure that a modal form in your application remains focused and does not lose focus to another application, you can use a combination of various techniques depending on the environment and programming language you're using. Here are some approaches you could consider: ### 1. **Using Win32 API (C#, C++, etc.)** If...
11,698
[ { "from": "human", "value": "I have written an application which has a modal form. How can I ensure that this form does not lose the focus even when an other application is started?\n" }, { "from": "gpt", "value": "To ensure that a modal form in your application remains focused and does not lose...
I'm look for a GIS/Mapping tool that will give me easy SERVER-SIDE access to route information (specifically, trip time and distance) in an ASP.NET web application. From what I can tell, Google and Yahoo maps do everything client-side in javascript, but neither provide services to retrieve just the route information. I...
When looking for GIS/mapping tools that can provide server-side access to route information (trip time and distance) for an ASP.NET web application, there are several options to consider. Below are some popular services, both free and paid, along with insights into their APIs, performance, and usability. ### 1. **Goog...
11,097
[ { "from": "human", "value": "I'm look for a GIS/Mapping tool that will give me easy SERVER-SIDE access to route information (specifically, trip time and distance) in an ASP.NET web application.\nFrom what I can tell, Google and Yahoo maps do everything client-side in javascript, but neither provide services...
I would like to know what of the many XSLT engines out there works well with Perl. I will use Apache (2.0) and Perl, and I want to obtain PDFs and XHTMLs. I'm new to this kind of projects so any comment or suggestion will be welcome. Thanks. Doing a simple search on Google I found a lot and I suppose that there are to...
When working with XSLT in a Perl environment, there are several XSLT engines you might consider. Here are a few options along with some insights: 1. **XML::LibXSLT**: - This is a Perl module that provides bindings to the LibXSLT library, which is a fast and standards-compliant XSLT processor. - It's suitable for...
12,922
[ { "from": "human", "value": "I would like to know what of the many XSLT engines out there works well with Perl.\nI will use Apache (2.0) and Perl, and I want to obtain PDFs and XHTMLs.\nI'm new to this kind of projects so any comment or suggestion will be welcome.\nThanks.\n\nDoing a simple search on Google...
If I have an *.as file that is my custom component, a SWC class that contains the custom components skins and a css file that tells the custom class how it should look (references the SWC skin file), how do I set up a library project (using flexbuilder 3) to generate a single SWC file that will contain everything?
To create a single SWC file in Adobe Flex Builder 3 that contains your custom component (.as file), its skins (in the SWC file), and the CSS styles, you need to follow these steps: 1. **Create a Library Project**: - Open Flex Builder 3 and create a new Library Project. You can do this by selecting `File -> New -> F...
11,881
[ { "from": "human", "value": "If I have an *.as file that is my custom component, a SWC class that contains the custom components skins and a css file that tells the custom class how it should look (references the SWC skin file), how do I set up a library project (using flexbuilder 3) to generate a single SW...
The purpose of using a Javascript proxy for the Web Service using a service reference with Script Manager is to avoid a page load. If the information being retrieved is potentially sensitive, is there a way to secure this web service call other than using SSL?
Yes, there are several methods to enhance the security of your web service calls beyond using SSL (Secure Sockets Layer). Here are some strategies you can implement to secure your web service interactions: 1. **Authentication**: - **Token-Based Authentication**: Use mechanisms such as OAuth or JWT (JSON Web Tokens)...
10,585
[ { "from": "human", "value": "The purpose of using a Javascript proxy for the Web Service using a service reference with Script Manager is to avoid a page load. If the information being retrieved is potentially sensitive, is there a way to secure this web service call other than using SSL? \n" }, { "...
How do I create a unique constraint on an existing table in SQL Server 2005? I am looking for both the TSQL and how to do it in the Database Diagram.
To create a unique constraint on an existing table in SQL Server 2005, you can use both T-SQL commands and the graphical interface provided in the Database Diagram tool. Here's how to do both: ### T-SQL Method You can use the `ALTER TABLE` statement along with the `ADD CONSTRAINT` clause to create a unique constraint...
11,915
[ { "from": "human", "value": "How do I create a unique constraint on an existing table in SQL Server 2005?\nI am looking for both the TSQL and how to do it in the Database Diagram.\n" }, { "from": "gpt", "value": "To create a unique constraint on an existing table in SQL Server 2005, you can use ...
The company I work for are currently undergoing a site wide renovation and I'm involved in the 'consultation' on what the R&D work spaces are going to be like. There is no scope for individual private offices - so lets not start on that topic. One big requirement is that the office layout can be flexible (i.e. team ar...
Your questions touch on important aspects of workspace design and how it impacts employee experience and productivity. Here’s a breakdown of your questions: ### 1. Is it really important to have a corner? Having a corner desk can provide a sense of personal space and privacy, which many people appreciate. Here are so...
13,620
[ { "from": "human", "value": "The company I work for are currently undergoing a site wide renovation and I'm involved in the 'consultation' on what the R&D work spaces are going to be like.\nThere is no scope for individual private offices - so lets not start on that topic. \nOne big requirement is that the ...
What are some scenarios where MultiView would be a good choice? The MultiView control along with its View controls simply seem to extend the notion of Panels. Both Panels and MultiViews seem prone to abuse. If your UI concerns and biz logic concerns are properly separated, why lump views together in a single ASPX?
The MultiView control in ASP.NET provides a way to manage multiple views within a single page, effectively allowing you to switch between different user interfaces (UI) without requiring a postback or additional page loads. While it's true that both the MultiView and Panels can be prone to misuse if not carefully manag...
14,073
[ { "from": "human", "value": "What are some scenarios where MultiView would be a good choice? The MultiView control along with its View controls simply seem to extend the notion of Panels.\nBoth Panels and MultiViews seem prone to abuse. If your UI concerns and biz logic concerns are properly separated, wh...
I want a recommendation on an ISP which has Subversion installed so I can get a repository started. So far I found out discount.asp doesn't have that on their servers and will not support it. So I'm looking for a recommendation
If you're looking for an Internet Service Provider (ISP) that supports Subversion (SVN) and allows you to host a repository, here are a few options you might consider: 1. **DreamHost**: - DreamHost offers a range of web hosting services, including shared hosting, VPS, and dedicated servers. They have SVN support, a...
16,098
[ { "from": "human", "value": "I want a recommendation on an ISP which has Subversion installed so I can get a repository started. So far I found out discount.asp doesn't have that on their servers and will not support it. So I'm looking for a recommendation\n" }, { "from": "gpt", "value": "If y...
Despite the documentation, NetworkStream.Write does not appear to wait until the data has been sent. Instead, it waits until the data has been copied to a buffer and then returns. That buffer is transmitted in the background. This is the code I have at the moment. Whether I use ns.Write or ns.BeginWrite doesn't matter ...
To determine when the data has actually been sent and handle your requirements correctly, you will have to adopt a different approach. Here are some strategies you can use: ### 1. Use `NetworkStream.Flush` While the `NetworkStream.Write` method does indeed copy data to a send buffer, you can call `Flush()` to ensure ...
6,358
[ { "from": "human", "value": "Despite the documentation, NetworkStream.Write does not appear to wait until the data has been sent. Instead, it waits until the data has been copied to a buffer and then returns. That buffer is transmitted in the background.\nThis is the code I have at the moment. Whether I use...
Is it possible to install/register another local server instance in any SqlServer version, besides the default local instance, where only one SqlServer version is installed?
Yes, it is possible to install multiple instances of SQL Server on the same machine, including different versions. Each instance can be configured to run independently, and each can be a default or named instance. Here's how you can achieve this: ### Installing Multiple Instances of SQL Server 1. **SQL Server Edition...
12,609
[ { "from": "human", "value": "Is it possible to install/register another local server instance in any SqlServer version, besides the default local instance, where only one SqlServer version is installed? \n" }, { "from": "gpt", "value": "Yes, it is possible to install multiple instances of SQL Se...
I have one third party Popup to display message. It has two properties OffsetX and OffsetY. To set its position in browser. Now i am invoking this Popup on Button Click event. I need this popup just next to my Button and for that i have to set above mentioned OffsetX and OffsetY properties of Popup. I tried following c...
It looks like you're trying to position a popup relative to a button on your webpage using properties `OffsetX` and `OffsetY`, but you're facing issues retrieving the button's position. The `Style.Item` method may not provide the actual position of the button in the viewport because it's typically used for CSS styling ...
14,754
[ { "from": "human", "value": "I have one third party Popup to display message. It has two properties OffsetX and OffsetY. To set its position in browser.\nNow i am invoking this Popup on Button Click event. I need this popup just next to my Button and for that i have to set above mentioned OffsetX and Offset...
How do I truncate a java String so that I know it will fit in a given number of bytes storage once it is UTF-8 encoded?
To truncate a Java `String` such that it fits within a specified number of bytes when UTF-8 encoded, you can use the following approach: 1. Encode the `String` to UTF-8 bytes. 2. Check the byte length. 3. If the byte length exceeds the specified limit, truncate the string, ensuring that you don't cut off any multibyte...
13,984
[ { "from": "human", "value": "How do I truncate a java String so that I know it will fit in a given number of bytes storage once it is UTF-8 encoded?\n" }, { "from": "gpt", "value": "To truncate a Java `String` such that it fits within a specified number of bytes when UTF-8 encoded, you can use t...
After updating or creating a record I use url helper to redirect to the part on the page where the record happened to be located: if record.save .... redirect_to records_url, :anchor => "record_" + record_id.to_s end the resulting url will be something like http://localhost:3000/records#record_343242 I want to hi...
Yes, you can capture the anchor in the URL using JavaScript (jQuery or Prototype) and then use it to highlight the specific record on the page. Here's a basic approach using jQuery: 1. **Add an ID or Class for the Record**: Ensure each record on your page has a corresponding HTML element with an ID that matches the an...
12,509
[ { "from": "human", "value": "After updating or creating a record I use url helper to redirect to the part on the page where the record happened to be located:\nif record.save\n ....\n redirect_to records_url, :anchor => \"record_\" + record_id.to_s\nend\n\nthe resulting url will be something like \nhttp:/...
At my day job we have load balanced web servers which talk to load balanced app servers via web services (and lately WCF). At any given time, we have 4-6 different teams that have the ability to add new web sites or services or consume existing services. We probably have about 20-30 different web applications and corre...
Hi Matt, It sounds like you’re in a challenging situation with a complex landscape of web services and applications. Mapping out the inter-relationships and dependencies among these services is crucial for gaining control over your architecture. Here are a few options you might consider for analyzing your environment:...
12,053
[ { "from": "human", "value": "At my day job we have load balanced web servers which talk to load balanced app servers via web services (and lately WCF). At any given time, we have 4-6 different teams that have the ability to add new web sites or services or consume existing services. We probably have about 2...
I'm looking for a list of win32 API in some "database"/XML format. I'd need it to easily create a "conversion layer" between win32 API and the higher level language I'm using (harbour/xharbour). Since this runs Pcode, it is necessary to transform parameters to C standard... Instead of doing manual code write, I'd lik...
Creating an automated conversion layer between the Win32 API and a high-level language like Harbour/xHarbour can be a significant task, but you can indeed streamline it by using a structured database or XML representation of the API. Below, I’ll outline how to set up an XML format for the Win32 API function definitions...
10,152
[ { "from": "human", "value": "I'm looking for a list of win32 API in some \"database\"/XML format. \nI'd need it to easily create a \"conversion layer\" between win32 API and the higher level language I'm using (harbour/xharbour). Since this runs Pcode, it is necessary to transform parameters to C standard....
I am trying to use the JQuery UI datepicker (latest stable version 1.5.2) on an IE6 website. But I am having the usual problems with combo boxes (selects) on IE6 where they float above other controls. I have tried adding the bgIframe plugin after declaring the datepicker with no luck. My guess is that the .ui-datepicke...
To resolve the issue of the jQuery UI Datepicker's dropdown appearing above other controls in IE6, you can indeed modify the Datepicker code to ensure that the `bgIframe` plugin is applied correctly when the datepicker is opened. Since the datepicker initializes the `.ui-datepicker-div` element when it is shown, you ...
13,925
[ { "from": "human", "value": "I am trying to use the JQuery UI datepicker (latest stable version 1.5.2) on an IE6 website. But I am having the usual problems with combo boxes (selects) on IE6 where they float above other controls. I have tried adding the bgIframe plugin after declaring the datepicker with no...
With the introduction of .NET 3.5 and the IQueryable<T> interface, new patterns will emerge. While I have seen a number of implementations of the Specification pattern, I have not seen many other patterns using this technology. Rob Conery's Storefront application is another concrete example using IQueryable<T> which ma...
The introduction of the `IQueryable<T>` interface in .NET 3.5 has significantly influenced how developers design their applications, particularly in the context of data access and querying. This capability allows for building dynamic queries that can be executed against different data sources, which has led to several ...
9,532
[ { "from": "human", "value": "With the introduction of .NET 3.5 and the IQueryable<T> interface, new patterns will emerge. While I have seen a number of implementations of the Specification pattern, I have not seen many other patterns using this technology. Rob Conery's Storefront application is another conc...
How do you implement an efficient and thread safe reference counting system on X86 CPUs in the C++ programming language? I always run into the problem that the critical operations not atomic, and the available X86 Interlock operations are not sufficient for implementing the ref counting system. The following article c...
Implementing an efficient and thread-safe reference counting system in C++ on x86 CPUs can be achieved using atomic operations provided by the C++ standard library. The C++11 standard and onwards introduced atomic types in `<atomic>`, which provide a good basis for building a reference counting system without requiring...
9,803
[ { "from": "human", "value": "How do you implement an efficient and thread safe reference counting system on X86 CPUs in the C++ programming language? \nI always run into the problem that the critical operations not atomic, and the available X86 Interlock operations are not sufficient for implementing the re...
Like the title says: Can reflection give you the name of the currently executing method. I'm inclined to guess not, because of the Heisenberg problem. How do you call a method that will tell you the current method without changing what the current method is? But I'm hoping someone can prove me wrong there. Update: ...
Your understanding is correct: in C#, you can indeed use reflection to get the name of the currently executing method, and `MethodBase.GetCurrentMethod()` is the way to do this. Let’s break down your inquiries: ### Part 1: Getting the Current Method Name You can use the `MethodBase.GetCurrentMethod()` method within t...
11,529
[ { "from": "human", "value": "Like the title says: Can reflection give you the name of the currently executing method.\nI'm inclined to guess not, because of the Heisenberg problem. How do you call a method that will tell you the current method without changing what the current method is? But I'm hoping so...
How do I replace the HEAD of a CVS repository with a branch?
Replacing the HEAD of a CVS repository with a branch involves a few steps, as CVS does not have a direct command for this operation. You'll be effectively merging or switching the HEAD to point to the latest revision of the branch you want to promote. Here’s a general process to accomplish this: ### Steps to Replace H...
14,685
[ { "from": "human", "value": "How do I replace the HEAD of a CVS repository with a branch?\n" }, { "from": "gpt", "value": "Replacing the HEAD of a CVS repository with a branch involves a few steps, as CVS does not have a direct command for this operation. You'll be effectively merging or switchi...
this kind of follows on from another question of mine. Basically, once I have the code to access the file (will review the answers there in a minute) what would be the best way to test it? I am thinking of creating a method which just spawns lots of BackgroundWorker's or something and tells them all load/save the file,...
Testing file access in a multithreaded context can be challenging, but you can approach it systematically. Here are some suggestions on how to structure your testing: ### 1. **Define Your Test Scenarios:** - **Single Thread:** Test basic functionality with a single thread to establish a baseline. - **Multiple Th...
7,115
[ { "from": "human", "value": "this kind of follows on from another question of mine.\nBasically, once I have the code to access the file (will review the answers there in a minute) what would be the best way to test it?\nI am thinking of creating a method which just spawns lots of BackgroundWorker's or somet...
I have seen a few mentions of this idiom (including on SO): // Deliberately empty subscriber public event EventHandler AskQuestion = delegate {}; The upside is clear - it avoids the need to check for null before raising the event. However, I am keen to understand if there are any downsides. For example, is it somethi...
Using a deliberately empty subscriber for events, as you've shown in your example, is a technique that some developers use in C# to avoid null reference exceptions when raising events. This approach has both pros and cons, and it's important to consider them when deciding whether to use it in your code. ### Pros 1. *...
14,538
[ { "from": "human", "value": "I have seen a few mentions of this idiom (including on SO):\n// Deliberately empty subscriber\npublic event EventHandler AskQuestion = delegate {};\n\nThe upside is clear - it avoids the need to check for null before raising the event.\nHowever, I am keen to understand if there ...
this code always returns 0 in PHP 5.2.5 for microseconds: <?php $dt = new DateTime(); echo $dt->format("Y-m-d\TH:i:s.u") . "\n"; ?> Output: [root@www1 ~]$ php date_test.php 2008-10-03T20:31:26.000000 [root@www1 ~]$ php date_test.php 2008-10-03T20:31:27.000000 [root@www1 ~]$ php date_test.php 2008-10-03T20:31:27.000000...
The issue you're encountering is due to the version of PHP you are using. PHP 5.2.5 does not support the microsecond format (`u`) in the `DateTime::format()` method, which is why it always outputs `000000` for the microseconds part of the date. The `u` format character for microseconds was introduced in PHP 5.3.0. Sin...
16,948
[ { "from": "human", "value": "this code always returns 0 in PHP 5.2.5 for microseconds:\n<?php\n$dt = new DateTime();\necho $dt->format(\"Y-m-d\\TH:i:s.u\") . \"\\n\";\n?>\n\nOutput:\n[root@www1 ~]$ php date_test.php\n2008-10-03T20:31:26.000000\n[root@www1 ~]$ php date_test.php\n2008-10-03T20:31:27.000000\n[...
I'd like to check if a Class object represents a subclass of other class for example Class class1 = Class.forName("Class1"); Class class2 = Class.forName("Class2"); if(class1.isSubClassOf(class2)) // fake methos isSubClassOf { // do sth } How can I implement this isSubClassOf method ?
In Java, you can check if one class is a subclass of another using the `isAssignableFrom` method provided by the `Class` class. The `isAssignableFrom` method checks if instances of the class represented by the specified `Class` object can be assigned to the class represented by the current `Class` object. This allows y...
12,826
[ { "from": "human", "value": "I'd like to check if a Class object represents a subclass of other class \nfor example\nClass class1 = Class.forName(\"Class1\");\nClass class2 = Class.forName(\"Class2\");\n\n if(class1.isSubClassOf(class2)) // fake methos isSubClassOf\n{\n // do sth\n}\n\nHow can I implement ...
After diving into the www, I don't have a clue about the support of vectorial grahics/image by reporting services. It seems to be impossible. We are using Reporting Services with a PDF rendering and we are forced to use raw bitmap into reports. That leads to huge sized reports. We know that dealing with vectorial graph...
As of my last knowledge update in October 2023, SQL Server Reporting Services (SSRS) does have some limitations regarding vector graphics support, particularly when it comes to rendering formats such as PDF. Here are a few points to consider regarding your situation: ### Current Support for Vector Graphics in SSRS 1....
13,011
[ { "from": "human", "value": "After diving into the www, I don't have a clue about the support of vectorial grahics/image by reporting services. It seems to be impossible. We are using Reporting Services with a PDF rendering and we are forced to use raw bitmap into reports. That leads to huge sized reports. ...
When logging in C#, how can I learn the name of the method that called the current method? I know all about System.Reflection.MethodBase.GetCurrentMethod(), but I want to go one step beneath this in the stack trace. I've considered parsing the stack trace, but I am hoping to find a cleaner more explicit way, something ...
In C#, if you want to get the name of the method that called the current method, you can use the `StackTrace` class from the `System.Diagnostics` namespace. This allows you to retrieve the stack frame information, which can give you details about the method that invoked the current method. Here's how you can do it: 1...
15,312
[ { "from": "human", "value": "When logging in C#, how can I learn the name of the method that called the current method? I know all about System.Reflection.MethodBase.GetCurrentMethod(), but I want to go one step beneath this in the stack trace. I've considered parsing the stack trace, but I am hoping to fin...
I'm trying to generate customized xml files from a template xml file in python. Conceptually, I want to read in the template xml, remove some elements, change some text attributes, and write the new xml out to a file. I wanted it to work something like this: conf_base = ConvertXmlToDict('config-template.xml') conf_ba...
To generate customized XML files in Python by modifying a template XML file, you can indeed use the `xml.etree.ElementTree` module. Here’s a structured approach to read, modify, and write XML files using Python: 1. **Read the template XML file**. 2. **Remove elements or modify attributes** as needed. 3. **Write the mo...
10,679
[ { "from": "human", "value": "I'm trying to generate customized xml files from a template xml file in python. \nConceptually, I want to read in the template xml, remove some elements, change some text attributes, and write the new xml out to a file. I wanted it to work something like this:\nconf_base = Conv...