instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
I have a few internal .net web application here that require users to "log out" of them. I know this may seem moot on an Intranet application, but nonetheless it is there.
We are using Windows authentication for our Intranet apps, so we tie in to our Active Directory with Basic Authentication and the credentials get st... | When dealing with Windows authentication in web applications, especially in an intranet environment, it's important to note that the authentication behavior is largely controlled by the browser. As you've pointed out, `document.execCommand("ClearAuthenticationCache", "false")` works in Internet Explorer, but other mode... | 4,229 | [
{
"from": "human",
"value": "I have a few internal .net web application here that require users to \"log out\" of them. I know this may seem moot on an Intranet application, but nonetheless it is there.\nWe are using Windows authentication for our Intranet apps, so we tie in to our Active Directory with Bas... |
I'm trying to implement a data compression idea I've had, and since I'm imagining running it against a large corpus of test data, I had thought to code it in C (I mostly have experience in scripting languages like Ruby and Tcl.)
Looking through the O'Reilly 'cow' books on C, I realize that I can't simply index the bit... | You're correct in understanding that the standard `char` or `int` types in C do not allow for direct indexing of individual bits. However, you can perform bitwise operations on these types to manipulate individual bits effectively.
### Approaches to Bit Manipulation in C
1. **Using Bit Masks**: The most common appro... | 1,897 | [
{
"from": "human",
"value": "I'm trying to implement a data compression idea I've had, and since I'm imagining running it against a large corpus of test data, I had thought to code it in C (I mostly have experience in scripting languages like Ruby and Tcl.) \nLooking through the O'Reilly 'cow' books on C, I... |
I have inherited an old crusty PHP application, and I'd like to refactor it into something a little nicer to deal with, but in a gradual manner. In perl's CPAN, there is a series of classes around Class::DBI that allow you to use database rows as the basis for objects in your code, with the library generating accessor ... | Refactoring an old PHP application can be challenging, but there are tools and libraries available that can help you adopt a more object-oriented approach without requiring you to fully embrace a framework. Here are some suggestions for implementing an object-relational mapping (ORM) pattern similar to Perl's Class::DB... | 2,105 | [
{
"from": "human",
"value": "I have inherited an old crusty PHP application, and I'd like to refactor it into something a little nicer to deal with, but in a gradual manner. In perl's CPAN, there is a series of classes around Class::DBI that allow you to use database rows as the basis for objects in your co... |
I erroneously delete all the rows from a MS SQL 2000 table that is used in merge replication (the table is on the publisher). I then compounded the issue by using a DTS operation to retrieve the rows from a backup database and repopulate the table.
This has created the following issue:
The delete operation marked the r... | To resolve the issue of the deleted rows not being properly tracked in the merge replication system, and to avoid complications with the `MSmerge_tombstone` table, you have a few options. Since you're dealing with SQL Server 2000 and replication, certain actions may be limited, but here are some steps you can take to a... | 3,528 | [
{
"from": "human",
"value": "I erroneously delete all the rows from a MS SQL 2000 table that is used in merge replication (the table is on the publisher). I then compounded the issue by using a DTS operation to retrieve the rows from a backup database and repopulate the table.\nThis has created the followin... |
I'm trying to parse an INI file using C++. Any tips on what is the best way to achieve this? Should I use the Windows API tools for INI file processing (with which I am totally unfamiliar), an open-source solution or attempt to parse it manually?
| Parsing INI files in C++ can be done in several ways, depending on your requirements, familiarity with the tools, and the complexity of your INI files. Here are some options to consider:
### 1. Windows API
If you are developing a Windows application, you can use the Windows API functions such as `GetPrivateProfileStri... | 2,360 | [
{
"from": "human",
"value": "I'm trying to parse an INI file using C++. Any tips on what is the best way to achieve this? Should I use the Windows API tools for INI file processing (with which I am totally unfamiliar), an open-source solution or attempt to parse it manually?\n"
},
{
"from": "gpt",
... |
Here's a perfect example of the problem: Classifier gem breaks Rails.
** Original question: **
One thing that concerns me as a security professional is that Ruby doesn't have a parallel of Java's package-privacy. That is, this isn't valid Ruby:
public module Foo
public module Bar
# factory method for new Bar imp... | Your concerns regarding the lack of package privacy in Ruby and the potential risks of monkey-patching are valid, especially from a security perspective. Ruby's dynamic nature allows for a high degree of flexibility, which can indeed be a double-edged sword.
Here are some points to consider regarding your concerns:
#... | 2,327 | [
{
"from": "human",
"value": "Here's a perfect example of the problem: Classifier gem breaks Rails.\n** Original question: **\nOne thing that concerns me as a security professional is that Ruby doesn't have a parallel of Java's package-privacy. That is, this isn't valid Ruby:\npublic module Foo\n public mo... |
I find from reading perldoc perlvar, about a thousand lines in is help for %ENV. Is there a way to find that from the command line directly?
On my Windows machine, I've tried the following
perldoc ENV
perldoc %ENV
perldoc %%ENV
perldoc -r ENV (returns info about Use Env)
perldoc -r %ENV
perldoc -r %%%ENV
perldoc -r %%%... | You can use `perldoc` combined with `grep` to search for specific terms in the documentation directly from the command line. Since you've mentioned that you want to find information about `%ENV` specifically, you can do the following:
### Using `perldoc` with `grep`
1. **Dumping the documentation and piping to grep:*... | 4,236 | [
{
"from": "human",
"value": "I find from reading perldoc perlvar, about a thousand lines in is help for %ENV. Is there a way to find that from the command line directly?\nOn my Windows machine, I've tried the following\nperldoc ENV\nperldoc %ENV\nperldoc %%ENV\nperldoc -r ENV (returns info about Use Env)\np... |
I'm using the new ASP.Net ListView control to list database items that will be grouped together in sections based on one of their columns like so:
region1
store1
store2
store3
region2
store4
region3
store5
store6
Is this possible to do with the ListView's GroupItemTemplate? Every example I have... | Yes, it is definitely possible to use the ListView control in ASP.NET to group items based on a specific column, and the `GroupItemTemplate` is indeed the right approach for this. However, the example you referred to may have used a static number of items simply for the sake of demonstration. In your case, you want to ... | 2,446 | [
{
"from": "human",
"value": "I'm using the new ASP.Net ListView control to list database items that will be grouped together in sections based on one of their columns like so:\nregion1\n store1\n store2\n store3\nregion2\n store4\nregion3\n store5\n store6\n\nIs this possible to do with th... |
I'm trying to create a custom workflow action with an output parameter for error handling. Working from various examples, I can't get Parameter Direction="Out" to work. Everything seems right, but when I try to assign the output to the "error" variable in SharePoint Designer, it places asterisks around it and flags it... | It looks like you're trying to create a custom workflow action in SharePoint that includes an output parameter for error handling. However, you’re experiencing an issue where the output parameter appears as an error in SharePoint Designer. This often occurs due to a couple of common reasons. Below are some troubleshoot... | 547 | [
{
"from": "human",
"value": "I'm trying to create a custom workflow action with an output parameter for error handling. Working from various examples, I can't get Parameter Direction=\"Out\" to work. Everything seems right, but when I try to assign the output to the \"error\" variable in SharePoint Designe... |
How can I programatically cause a control's tooltip to show in a Winforms app without needing the mouse to hover over the control? (P/Invoke is ok if necessary).
| In a WinForms application, the typical way to show a tooltip is to have the mouse hover over the control, but you can programmatically show a tooltip by simulating a mouse hover using P/Invoke.
Here's a step-by-step guide on how to achieve this:
1. **Add a ToolTip Component**: First, ensure you have a `ToolTip` compo... | 2,515 | [
{
"from": "human",
"value": "How can I programatically cause a control's tooltip to show in a Winforms app without needing the mouse to hover over the control? (P/Invoke is ok if necessary). \n"
},
{
"from": "gpt",
"value": "In a WinForms application, the typical way to show a tooltip is to hav... |
There are a few ways to get class-like behavior in javascript, the most common seem to be prototype based like this:
function Vector(x, y, x) {
this.x = x;
this.y = y;
this.z = z;
return this;
}
Vector.prototype.length = function () { return Math.sqrt(this.x * this.x ... ); }
and closure based approac... | In JavaScript, both prototype-based and closure-based approaches have their own use cases, benefits, and drawbacks. Let’s go through the characteristics of each method, and then touch on other common ways to create class-like behavior in JavaScript, including ES6 classes.
### Prototype-based Approach
This is the trad... | 921 | [
{
"from": "human",
"value": "There are a few ways to get class-like behavior in javascript, the most common seem to be prototype based like this:\nfunction Vector(x, y, x) {\n this.x = x;\n this.y = y;\n this.z = z;\n return this;\n}\n\nVector.prototype.length = function () { return Math.sqrt(th... |
How do you disable autocomplete in the major browsers for a specific input (or form field)?
| Disabling autocomplete for specific input fields in web forms can be important for user privacy, security, or simply to ensure users enter data as intended. Here’s how you can do this in major browsers:
### HTML Attributes
The most common way to disable autocomplete is by using the `autocomplete` attribute in the HTM... | 2,371 | [
{
"from": "human",
"value": "How do you disable autocomplete in the major browsers for a specific input (or form field)?\n"
},
{
"from": "gpt",
"value": "Disabling autocomplete for specific input fields in web forms can be important for user privacy, security, or simply to ensure users enter dat... |
I want to know what are the options to do some scripting jobs in windows platform.
I need functionality like file manipulations, registry editing etc. Can files be edited using scripting tools?
What other functionality does windows scripting tools offer?
Can everything that can be done using the Windows GUI be done usi... | Certainly! In a Windows environment, there are several scripting options available that allow you to perform tasks such as file manipulation, registry editing, and other system operations. Below are some popular scripting options along with their capabilities:
### 1. **PowerShell**
- **Description**: A powerful scr... | 1,197 | [
{
"from": "human",
"value": "I want to know what are the options to do some scripting jobs in windows platform.\nI need functionality like file manipulations, registry editing etc. Can files be edited using scripting tools?\nWhat other functionality does windows scripting tools offer?\nCan everything that c... |
I know I can do most of this by hacking Trac and using Git hooks, but I was wondering if someone has / knows of something ready.
Commenting on (and closing) tickets from commit messages would be nice, specially if the diff appears inline with the comment/closing remark.
sha1 hashes should be auto-linked to gitweb/cigt/... | If you're looking for a more integrated solution for working with Trac and Git, there are a few options you might consider. While you could implement custom hooks and scripts, there are existing tools and plugins that might fit your needs better. Here are some alternatives:
1. **Trac-Git Plugin**: Although you mention... | 3,036 | [
{
"from": "human",
"value": "I know I can do most of this by hacking Trac and using Git hooks, but I was wondering if someone has / knows of something ready.\nCommenting on (and closing) tickets from commit messages would be nice, specially if the diff appears inline with the comment/closing remark.\nsha1 h... |
Do you often see in API documentation (as in 'javadoc of public functions' for example) the description of "value limits" as well as the classic documentation ?
Note: I am not talking about comments within the code
By "value limits", I mean:
does a parameter can support a null value (or an empty String, or...) ?
does ... | You've raised a very important point regarding API documentation. Clear and comprehensive documentation is essential for developers to effectively and safely use libraries and APIs. Here’s a breakdown of the considerations regarding "value limits" in API documentation:
### Importance of Value Limits in API Documentati... | 3,153 | [
{
"from": "human",
"value": "Do you often see in API documentation (as in 'javadoc of public functions' for example) the description of \"value limits\" as well as the classic documentation ?\nNote: I am not talking about comments within the code\nBy \"value limits\", I mean:\n\ndoes a parameter can support... |
Is there a clean way to redirect all attempts to going to an HTTP:// version of a site to its HTTPS:// equivalent?
| Yes, there are several clean ways to redirect HTTP requests to HTTPS. The method you choose depends on your server type. Here are some common methods:
### 1. **Using .htaccess (for Apache servers)**
If you are using an Apache server, you can add the following code to your `.htaccess` file in the root directory of you... | 1,433 | [
{
"from": "human",
"value": "Is there a clean way to redirect all attempts to going to an HTTP:// version of a site to its HTTPS:// equivalent?\n"
},
{
"from": "gpt",
"value": "Yes, there are several clean ways to redirect HTTP requests to HTTPS. The method you choose depends on your server type... |
are there any performance limitations using IBM's asynchbeans?
my apps jvm core dumps are showing numerous occurences of orphaned threads. Im currently using native jdk unmanaged threads. Is it worth changing over to managed threads?
| When considering performance limitations of IBM's AsyncBeans and their impact on your application, here are a few key points to consider:
### 1. **Thread Management**:
- **Native JVM Threads**: If you're using native unmanaged threads, you're responsible for their lifecycle and management. If threads are orphaned (... | 2,048 | [
{
"from": "human",
"value": "are there any performance limitations using IBM's asynchbeans? \nmy apps jvm core dumps are showing numerous occurences of orphaned threads. Im currently using native jdk unmanaged threads. Is it worth changing over to managed threads?\n"
},
{
"from": "gpt",
"value":... |
I've just started learning Lisp and I can't figure out how to compile and link lisp code to an executable.
I'm using clisp and clisp -c produces two files:
.fas
.lib
What do I do next to get an executable?
| Using CLISP, the process of creating an executable from your Lisp code is a bit different compared to other languages like C or C++. CLISP does not compile to native code directly like some other Lisp implementations, but it allows you to compile Lisp code into object files that can be loaded during runtime.
To create... | 3,641 | [
{
"from": "human",
"value": "I've just started learning Lisp and I can't figure out how to compile and link lisp code to an executable.\nI'm using clisp and clisp -c produces two files:\n\n.fas\n.lib\n\nWhat do I do next to get an executable?\n"
},
{
"from": "gpt",
"value": "Using CLISP, the pro... |
Store everything in GMT?
Store everything the way it was entered with an embedded offset?
Do the math everytime you render?
Display relative Times "1 minutes ago"?
| When handling time data in applications, you have a few strategies to consider, each with its pros and cons. Here's a breakdown of the options you've mentioned:
### 1. Store Everything in GMT (UTC)
- **Pros:**
- Consistency: Storing all timestamps in GMT/UTC eliminates the confusion of time zones.
- Simplicity: Ea... | 3,177 | [
{
"from": "human",
"value": "Store everything in GMT?\nStore everything the way it was entered with an embedded offset?\nDo the math everytime you render?\nDisplay relative Times \"1 minutes ago\"?\n"
},
{
"from": "gpt",
"value": "When handling time data in applications, you have a few strategie... |
I have an Asp.NET application (VS2008, Framework 2.0). When I try to set a property on one of the user controls like
myUserControl.SomeProperty = someValue;
I get a NullReferenceException. When I debug, I found out that myUserControl is null. How is it possible that a user control handle is null? How do I fix this or ... | A `NullReferenceException` indicating that `myUserControl` is null suggests that the user control has not been properly instantiated or is not being loaded as expected. In ASP.NET Web Forms, there are a few common scenarios that might lead to this situation. Here’s a checklist of things to consider and steps to trouble... | 652 | [
{
"from": "human",
"value": "I have an Asp.NET application (VS2008, Framework 2.0). When I try to set a property on one of the user controls like\nmyUserControl.SomeProperty = someValue;\n\nI get a NullReferenceException. When I debug, I found out that myUserControl is null. How is it possible that a user c... |
I have read about partial methods in the latest C# language specification, so I understand the principles, but I'm wondering how people are actually using them. Is there a particular design pattern that benefits from partial methods?
| Partial methods in C# are a feature that allows you to define methods in a partial class that can be optionally implemented in another part of that class. This can help in scenarios where you want to extend or customize functionality without altering the original code. Here are some common use cases and design patterns... | 1,706 | [
{
"from": "human",
"value": "I have read about partial methods in the latest C# language specification, so I understand the principles, but I'm wondering how people are actually using them. Is there a particular design pattern that benefits from partial methods?\n"
},
{
"from": "gpt",
"value": ... |
I have three tables tag, page, pagetag
With the data below
page
ID NAME
1 page 1
2 page 2
3 page 3
4 page 4
tag
ID NAME
1 tag 1
2 tag 2
3 tag 3
4 tag 4
pagetag
ID PAGEID TAGID
1 2 1
2 2 3
3 3 4
4 1 1
5 1 2
6... | Yes, you can achieve the desired output using SQL with a `GROUP BY` clause and the `GROUP_CONCAT` function in MySQL. Here’s how you can structure your query:
```sql
SELECT
p.ID,
p.NAME,
GROUP_CONCAT(t.NAME ORDER BY t.NAME SEPARATOR ', ') AS TAGS
FROM
page p
LEFT JOIN
pagetag pt ON p.ID = pt.PA... | 3,293 | [
{
"from": "human",
"value": "I have three tables tag, page, pagetag\nWith the data below\npage\nID NAME\n1 page 1\n2 page 2\n3 page 3\n4 page 4\n\ntag\nID NAME\n1 tag 1\n2 tag 2\n3 tag 3\n4 tag 4\n\npagetag\nID PAGEID TAGID\n1 2 1\n2 ... |
ASP.NET 2.0 provides the ClientScript.RegisterClientScriptBlock() method for registering JavaScript in an ASP.NET Page.
The issue I'm having is passing the script when it's located in another directory. Specifically, the following syntax does not work:
ClientScript.RegisterClientScriptBlock(this.GetType(), "scriptName... | In ASP.NET, the `ClientScript.RegisterClientScriptBlock()` method is primarily used to register inline JavaScript code directly into the page, rather than to register an external JavaScript file. When you try to pass a URL to an external script file as a parameter, it does not work as expected because it expects a stri... | 4,345 | [
{
"from": "human",
"value": "ASP.NET 2.0 provides the ClientScript.RegisterClientScriptBlock() method for registering JavaScript in an ASP.NET Page.\nThe issue I'm having is passing the script when it's located in another directory. Specifically, the following syntax does not work:\nClientScript.RegisterCl... |
I'm working on a project where I'm coding in C in a UNIX environment. I've been using the lint tool to check my source code. Lint has been around a long time (since 1979), can anyone suggest a more recent code analysis tool I could use ? Preferably a tool that is free.
| There are several modern static code analysis tools available that can be used in a UNIX environment for C programming. Here are a few free options you can consider:
1. **Cppcheck**:
- Cppcheck is a static analysis tool for C/C++ code. It's designed to detect various kinds of bugs, including memory leaks, null poin... | 2,521 | [
{
"from": "human",
"value": "I'm working on a project where I'm coding in C in a UNIX environment. I've been using the lint tool to check my source code. Lint has been around a long time (since 1979), can anyone suggest a more recent code analysis tool I could use ? Preferably a tool that is free.\n"
},
... |
I am doing some research on Unicode for a white-paper I am writing. Does anyone remember the first version of MS Office on the Windows platform that was fully Unicode compliant? Not having much luck Googling this answer out of the net.
| The first version of Microsoft Office on the Windows platform that was fully Unicode compliant was Microsoft Office 2000. This version introduced better support for Unicode across its applications, including Word, Excel, and PowerPoint, allowing users to create and manipulate documents in a variety of languages and scr... | 7,037 | [
{
"from": "human",
"value": "I am doing some research on Unicode for a white-paper I am writing. Does anyone remember the first version of MS Office on the Windows platform that was fully Unicode compliant? Not having much luck Googling this answer out of the net.\n"
},
{
"from": "gpt",
"value":... |
By default tomcat will create a session cookie for the current domain.
If you are on www.example.com, your cookie will be created for www.example.com (will only work on www.example.com). Whereas for example.com it will be created for .example.com (desired behaviour, will work on any subdomain of example.com as well as ... | To address the issue of session cookies in Apache Tomcat and ensure that the `JSESSIONID` cookie is set correctly for both `example.com` and its subdomains (like `www.example.com`), you can configure the session cookie settings in Tomcat’s `context.xml` or `web.xml` files.
### Solution Steps:
1. **Modify the `context... | 2,889 | [
{
"from": "human",
"value": "By default tomcat will create a session cookie for the current domain.\nIf you are on www.example.com, your cookie will be created for www.example.com (will only work on www.example.com). Whereas for example.com it will be created for .example.com (desired behaviour, will work o... |
In Eclipse, I can switch through open editors using control-page up/down. This works great, except for editors like XML or JavaScript, where there are Design and Source tabs. For those editors, it just toggles between the different tabs. Is there any way to get Eclipse to ignore them? I know about alt-F6 for "Next Edit... | In Eclipse, managing open editors and navigating through them efficiently is important, especially when dealing with editors that have multiple tabs like XML or JavaScript. Unfortunately, by default, `Ctrl+Page Up` and `Ctrl+Page Down` will indeed switch between the tabs within those editors instead of moving to the ne... | 3,230 | [
{
"from": "human",
"value": "In Eclipse, I can switch through open editors using control-page up/down. This works great, except for editors like XML or JavaScript, where there are Design and Source tabs. For those editors, it just toggles between the different tabs. Is there any way to get Eclipse to ignore... |
I'm using the RxTx library over usbserial on a Linux distro. The RxTx lib seems to behave quite differently (in a bad way) than how it works over serial.
One of my biggest problems is that the RxTx SerialPortEvent.OUTPUT_BUFFER_EMPTY does not work on linux over usb serial.
How do I know when I should write to the strea... | Using the RxTx library with USB serial devices can indeed have some differences compared to traditional serial communications, particularly when it comes to handling events and ensuring data integrity during concurrent read/write operations. Here are some insights into your concerns:
### OUTPUT_BUFFER_EMPTY Event
1. *... | 4,467 | [
{
"from": "human",
"value": "I'm using the RxTx library over usbserial on a Linux distro. The RxTx lib seems to behave quite differently (in a bad way) than how it works over serial.\nOne of my biggest problems is that the RxTx SerialPortEvent.OUTPUT_BUFFER_EMPTY does not work on linux over usb serial.\nHow... |
We were having a problem with our build server not checking out modifications from source control despite recognizing that there had been changes.
It was traced to the control folder (not sure what it's real name is), the existing working builds were using _svn. Clearing the working folder forced a new complete checkou... | It sounds like you've encountered an issue with your build server's Subversion (SVN) working copies and the control folder's naming conventions. Let me clarify a few points and provide some recommendations:
### Understanding the Control Folder Names
1. **`.svn` vs `_svn`**:
- The `.svn` directory is the standard d... | 3,505 | [
{
"from": "human",
"value": "We were having a problem with our build server not checking out modifications from source control despite recognizing that there had been changes.\nIt was traced to the control folder (not sure what it's real name is), the existing working builds were using _svn. Clearing the wo... |
This is a somewhat low-level question. In x86 assembly there are two SSE instructions:
MOVDQA xmmi, m128
and
MOVNTDQA xmmi, m128
The IA-32 Software Developer's Manual says that the NT in MOVNTDQA stands for Non-Temporal, and that otherwise it's the same as MOVDQA.
My question is, what does Non-Temporal mean?
| In the context of x86 assembly and the instruction set, "Non-Temporal" refers to how data is handled in relation to caching and memory access patterns.
### MOVDQA vs. MOVNTDQA
- **MOVDQA (Move Aligned Double Quadword)**: This instruction is used to move 128 bits of data between registers and memory. It is designed fo... | 4,851 | [
{
"from": "human",
"value": "This is a somewhat low-level question. In x86 assembly there are two SSE instructions: \n\nMOVDQA xmmi, m128\n\nand \n\nMOVNTDQA xmmi, m128\n\nThe IA-32 Software Developer's Manual says that the NT in MOVNTDQA stands for Non-Temporal, and that otherwise it's the same as MOVDQA... |
I recently encountered a problem where a value was null if accessed with Request.Form but fine if retrieved with Request.Params. What are the differences between these methods that could cause this?
| The difference you are encountering between `Request.Form` and `Request.Params` relates to how each collection retrieves data from different sources of an HTTP request.
### `Request.Form`
- This collection is specifically for form data sent through POST requests. It retrieves key-value pairs from the body of the HTTP ... | 3,541 | [
{
"from": "human",
"value": "I recently encountered a problem where a value was null if accessed with Request.Form but fine if retrieved with Request.Params. What are the differences between these methods that could cause this?\n"
},
{
"from": "gpt",
"value": "The difference you are encounterin... |
This question and answer shows how to send a file as a byte array through an XML web service. How much overhead is generated by using this method for file transfer? I assume the data looks something like this:
<?xml version="1.0" encoding="UTF-8" ?>
<bytes>
<byte>16</byte>
<byte>28</byte>
<byte>127</byte>
... | When sending a file as a byte array through an XML web service, several factors contribute to the overhead and size of the transferred data. Let’s break down the components involved:
### XML Structure and Byte Representation
1. **XML Format**: The XML representation you provided uses `<byte>` elements to represent ea... | 2,934 | [
{
"from": "human",
"value": "This question and answer shows how to send a file as a byte array through an XML web service. How much overhead is generated by using this method for file transfer? I assume the data looks something like this:\n<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<bytes>\n <byte>16<... |
If you've used Oracle, you've probably gotten the helpful message "ORA-00942: Table or view does not exist". Is there a legitimate technical reason the message doesn't include the name of the missing object?
Arguments about this being due to security sound like they were crafted by the TSA. If I'm an attacker, I'd kno... | The error message "ORA-00942: Table or view does not exist" in Oracle Database indeed does not include the name of the missing object, which has led to frustration among developers and users alike. Your thoughts on the matter touch on several common perspectives.
### Potential Reasons for Not Including the Object Nam... | 3,510 | [
{
"from": "human",
"value": "If you've used Oracle, you've probably gotten the helpful message \"ORA-00942: Table or view does not exist\". Is there a legitimate technical reason the message doesn't include the name of the missing object? \nArguments about this being due to security sound like they were cra... |
My GPS logger occassionally leaves "unfinished" lines at the end of the log files. I think they're only at the end, but I want to check all lines just in case.
A sample complete sentence looks like:
$GPRMC,005727.000,A,3751.9418,S,14502.2569,E,0.00,339.17,210808,,,A*76
The line should start with a $ sign, and end wi... | You can simplify your command to achieve the desired filtering and also ignore blank lines. The following command will do that:
```bash
grep -nvE '^\$.*\*[0-9A-F]{2}' *.log | grep -vE 'ADVER|ADPMB|^$'
```
### Explanation:
- `grep -nvE '^\$.*\*[0-9A-F]{2}' *.log`: This searches all `.log` files and outputs the lines t... | 3,475 | [
{
"from": "human",
"value": "My GPS logger occassionally leaves \"unfinished\" lines at the end of the log files. I think they're only at the end, but I want to check all lines just in case. \nA sample complete sentence looks like:\n$GPRMC,005727.000,A,3751.9418,S,14502.2569,E,0.00,339.17,210808,,,A*76\n\n... |
How do I convert a DateTime structure to its equivalent RFC 3339 formatted string representation and/or parse this string representation back to a DateTime structure? The RFC-3339 date-time format is used in a number of specifications such as the Atom Syndication Format.
| To convert a `DateTime` structure to its equivalent RFC 3339 formatted string representation and parse that string back to a `DateTime` structure, you can follow the examples provided below.
### Converting `DateTime` to RFC 3339 String
RFC 3339 specifies a date-time format that looks like this: `YYYY-MM-DDTHH:MM:SSZ... | 2,883 | [
{
"from": "human",
"value": "How do I convert a DateTime structure to its equivalent RFC 3339 formatted string representation and/or parse this string representation back to a DateTime structure? The RFC-3339 date-time format is used in a number of specifications such as the Atom Syndication Format.\n"
},... |
Certainly there's the difference in general syntax, but what other critical distinctions exist? There are some differences, right?
| Yes, there are several critical distinctions that can exist between different programming languages beyond just general syntax. Here are some important factors to consider:
1. **Type System**:
- **Static vs. Dynamic Typing**: Some languages require you to declare variable types at compile time (static typing, e.g.,... | 2,654 | [
{
"from": "human",
"value": "Certainly there's the difference in general syntax, but what other critical distinctions exist? There are some differences, right?\n"
},
{
"from": "gpt",
"value": "Yes, there are several critical distinctions that can exist between different programming languages be... |
Today, I ran into this weird problem with a user using Mac OS X. This user always had a failed upload. The form uses a regular "input type=file". The user could upload using any browser except Firefox 3 on his Mac. Only this particular user was seeing this error.
Obviously, the problem is only with this one particular ... | When dealing with a user-specific issue related to file uploads in Firefox 3 on Mac OS X, there are several potential factors to consider. Here’s a checklist of troubleshooting steps and solutions to help identify and resolve the problem:
### 1. **Check Firefox Settings**
- **Clear Cache and Cookies**: Ask the user... | 1,949 | [
{
"from": "human",
"value": "Today, I ran into this weird problem with a user using Mac OS X. This user always had a failed upload. The form uses a regular \"input type=file\". The user could upload using any browser except Firefox 3 on his Mac. Only this particular user was seeing this error.\nObviously, t... |
We're working on an application that displays information through a Direct3D visualisation. A late client request is the ability to view this application via some Remote Desktop solution.
Has anyone done anything similar? What options are available / unavailable? I'm thinking RDC, VNC, Citrix...
Any advice?
| When developing an application that utilizes Direct3D for visualization and needs to be accessed via remote desktop solutions, there are several considerations and options to keep in mind. Remote access to 3D applications can be challenging due to the way graphics rendering is handled and the bandwidth required. Here’s... | 2,548 | [
{
"from": "human",
"value": "We're working on an application that displays information through a Direct3D visualisation. A late client request is the ability to view this application via some Remote Desktop solution.\nHas anyone done anything similar? What options are available / unavailable? I'm thinking R... |
When creating a criteria in NHibernate I can use
Restriction.In() or
Restriction.InG()
What is the difference between them?
| In NHibernate, both `Restriction.In()` and `Restriction.InG()` methods are used to create a restriction that checks if a particular field's value is contained within a specified collection of values. However, there is a key difference between the two:
1. **`Restriction.In()`**:
- This method is typically used for s... | 4,489 | [
{
"from": "human",
"value": "When creating a criteria in NHibernate I can use\nRestriction.In() or\nRestriction.InG()\nWhat is the difference between them?\n"
},
{
"from": "gpt",
"value": "In NHibernate, both `Restriction.In()` and `Restriction.InG()` methods are used to create a restriction tha... |
The manual page for XML::Parser::Style::Objects is horrible. A simple hello world style program would really be helpful.
I really wanted to do something like this: (not real code of course)
use XML::Parser;
my $p = XML::Parser->new(Style => 'Objects', Pkg => 'MyNode');
my $tree = $p->parsefile('foo.xml');
$tree->doSom... | Certainly! The XML::Parser module in Perl, with the Objects style, allows you to parse XML documents into object-oriented representations. Below is a simple "Hello World" example that shows how to implement a custom node structure where you can call methods on nodes.
### Example XML File (`foo.xml`)
First, let's defi... | 2,300 | [
{
"from": "human",
"value": "The manual page for XML::Parser::Style::Objects is horrible. A simple hello world style program would really be helpful.\nI really wanted to do something like this: (not real code of course)\nuse XML::Parser;\nmy $p = XML::Parser->new(Style => 'Objects', Pkg => 'MyNode');\nmy $... |
We're doing an "Amazing Race" kind of event, and thought it would be cool to have CDs that could only play once... like a "this message will self destruct in 5 seconds..."
Any thoughts on how to do this? I was thinking it could be a compiled HTML website that would write a cookie and only play once. I don't want to ... | That sounds like a fun and creative event! If you're looking for a simple way to create a "self-destructing" audio message for your Amazing Race event, here are a few ideas that you can implement using a compiled HTML website:
### HTML with JavaScript and Cookies
You can create a simple HTML file that plays an audio f... | 1,966 | [
{
"from": "human",
"value": "We're doing an \"Amazing Race\" kind of event, and thought it would be cool to have CDs that could only play once... like a \"this message will self destruct in 5 seconds...\" \nAny thoughts on how to do this? I was thinking it could be a compiled HTML website that would write ... |
Hessian is a custom binary serialization protocol, (which is open-source - I think), that forms the basis for a binary cross platform remoting framework. I'd like to know if anyone here has used it, and if so, what sort of performance can we expect from a solution that bridges a Java app on one side with a C# app on th... | Hessian is indeed a binary serialization protocol that is designed to facilitate communication between different programming languages. It was originally created by Caucho Technology and is an open-source solution. Hessian is particularly well-suited for RPC (Remote Procedure Call) systems, and it aims to provide effic... | 2,112 | [
{
"from": "human",
"value": "Hessian is a custom binary serialization protocol, (which is open-source - I think), that forms the basis for a binary cross platform remoting framework. I'd like to know if anyone here has used it, and if so, what sort of performance can we expect from a solution that bridges a... |
I normally run VS 2008 at home and LINQ is built in. At work we are still using VS 2005 and I have the opportunity to start a new project that I would like to use LINQ to SQL.
After doing some searching all I could come up with was the MAY 2006 CTP of LINQ would have to be installed for LINQ to work in VS 2005.
Does s... | LINQ (Language Integrated Query) was introduced in .NET 3.5, which requires Visual Studio 2008 to fully utilize it. If you're using Visual Studio 2005, you won't have native support for LINQ to SQL out of the box, and unfortunately, there isn't a straightforward way to enable LINQ in VS 2005 without using the CTP (Comm... | 4,049 | [
{
"from": "human",
"value": "I normally run VS 2008 at home and LINQ is built in. At work we are still using VS 2005 and I have the opportunity to start a new project that I would like to use LINQ to SQL.\nAfter doing some searching all I could come up with was the MAY 2006 CTP of LINQ would have to be ins... |
How can I determine the IP of my router/gateway in Java? I can get my IP easily enough. I can get my internet IP using a service on a website. But how can I determine my gateway's IP?
This is somewhat easy in .NET if you know your way around. But how do you do it in Java?
| In Java, you can determine the IP address of your router or gateway by using the `NetworkInterface` and `InetAddress` classes available in the `java.net` package. The gateway is typically found in the network configuration of your machine. Below is a simple method to find the gateway IP address:
1. Use `NetworkInterfa... | 3,057 | [
{
"from": "human",
"value": "How can I determine the IP of my router/gateway in Java? I can get my IP easily enough. I can get my internet IP using a service on a website. But how can I determine my gateway's IP?\nThis is somewhat easy in .NET if you know your way around. But how do you do it in Java?\n"
... |
What is the best way to transcode audio and video to show on the web?
I need to do it programmatically. I'd like to do something like YouTube or Google Video where users can upload whatever format they want, and I encode it to flv, mp3, and/or mp4. I could do it on our server, but I would rather use an EC2 instance... | Transcoding audio and video for web playback programmatically can be accomplished using a combination of tools and services. Below is a high-level overview of how you might set up a system to transcode media files uploaded by users:
### 1. Choose Transcoding Tools
**FFmpeg** is one of the most popular and powerful to... | 1,857 | [
{
"from": "human",
"value": "What is the best way to transcode audio and video to show on the web? \nI need to do it programmatically. I'd like to do something like YouTube or Google Video where users can upload whatever format they want, and I encode it to flv, mp3, and/or mp4. I could do it on our serv... |
MS CRM Dynamics 4.0 incorporates the MS WF engine. The built in designer allows the creation of sequential workflows whos activities have native access to CRM entities.
Is it possible to:
Create a state machine workflow
outside of CRM (i.e. in visual studio) and import it into CRM?
Have this workflow access the CRM
... | Creating a state machine workflow in Microsoft Dynamics CRM 4.0 using Windows Workflow Foundation (WF) and importing it into CRM is not directly supported out of the box. However, it is technically feasible to create workflows in Visual Studio, but with some caveats. Here are the answers to your questions:
1. **Create... | 3,765 | [
{
"from": "human",
"value": "MS CRM Dynamics 4.0 incorporates the MS WF engine. The built in designer allows the creation of sequential workflows whos activities have native access to CRM entities.\nIs it possible to:\n\nCreate a state machine workflow\noutside of CRM (i.e. in visual studio) and import it ... |
We have been working with CVS for years, and frequently find it useful to "sticky" a single file here and there.
Is there any way to do this in subversion, specifically from TortoiseSVN?
| In Subversion (SVN), the concept of "sticky" files that you might be used to in CVS (which refers to keeping a particular version of a file) doesn't exist in the same way, but you can achieve a similar effect using a couple of different approaches.
While using TortoiseSVN, you can manually revert or update a specific ... | 4,237 | [
{
"from": "human",
"value": "We have been working with CVS for years, and frequently find it useful to \"sticky\" a single file here and there.\nIs there any way to do this in subversion, specifically from TortoiseSVN?\n"
},
{
"from": "gpt",
"value": "In Subversion (SVN), the concept of \"sticky... |
Is it possible to have a fixture change between test methods? If so, how can I do this?
My syntax for this problem :
In the cakephp framework i am building tests for a behavior that is configured by adding fields to the table. This is intended to work in the same way that adding the "created"
and "modified" fields w... | Yes, it is possible to change fixtures between test methods in CakePHP, which will allow you to dynamically adjust the database schema or the data setup for each test. Here are a couple of approaches that you can take to achieve this.
### 1. Override the `setUp` Method
You can customize the `setUp` method in your tes... | 3,681 | [
{
"from": "human",
"value": "Is it possible to have a fixture change between test methods? If so, how can I do this? \nMy syntax for this problem : \nIn the cakephp framework i am building tests for a behavior that is configured by adding fields to the table. This is intended to work in the same way that ad... |
I'd like to know the standard way to benchmark a SQL Sever Query, preferably I'd like to know about the tools that come with SQL Server rather than 3rd Party tools.
| Benchmarking a SQL Server query involves measuring its performance to understand how efficiently it runs and to identify areas for improvement. SQL Server provides several built-in tools and techniques for benchmarking queries without needing third-party solutions. Here are some standard methods and tools you can use:
... | 2,287 | [
{
"from": "human",
"value": "I'd like to know the standard way to benchmark a SQL Sever Query, preferably I'd like to know about the tools that come with SQL Server rather than 3rd Party tools.\n"
},
{
"from": "gpt",
"value": "Benchmarking a SQL Server query involves measuring its performance to... |
I’m looking at rewriting a portion of our application in C# (currently legacy VB6 code). The module I am starting with is responsible for importing data from a variety of systems into our database. About 5-6 times a year, a new client asks us to write a new import for the system that they use. Presently, this requires... | Designing a flexible, plug-in-based architecture for your import system can greatly improve maintainability and ease of adding new import functionalities. Here’s an approach you can take, leveraging interfaces, dependency injection, and potentially a configuration-based approach to achieve this goal.
### Step 1: Defin... | 1,296 | [
{
"from": "human",
"value": "I’m looking at rewriting a portion of our application in C# (currently legacy VB6 code). The module I am starting with is responsible for importing data from a variety of systems into our database. About 5-6 times a year, a new client asks us to write a new import for the syste... |
I'm using an XmlSerializer to deserialize a particular type in mscorelib.dll
XmlSerializer ser = new XmlSerializer( typeof( [.Net type in System] ) );
return ([.Net type in System]) ser.Deserialize( new StringReader( xmlValue ) );
This throws a caught FileNotFoundException when the assembly is loaded:
"Could not load... | The issue you're encountering with the `FileNotFoundException` related to `mscorlib.XmlSerializers` is indeed a known quirk of the .NET framework when using `XmlSerializer` for the first time with certain types. When you serialize or deserialize an object, the .NET framework may generate a temporary assembly (`mscorlib... | 3,558 | [
{
"from": "human",
"value": "I'm using an XmlSerializer to deserialize a particular type in mscorelib.dll\nXmlSerializer ser = new XmlSerializer( typeof( [.Net type in System] ) );\nreturn ([.Net type in System]) ser.Deserialize( new StringReader( xmlValue ) );\n\nThis throws a caught FileNotFoundException ... |
What do I lose by adopting test driven design?
List only negatives; do not list benefits written in a negative form.
| 1. Increased initial development time and effort due to writing tests first.
2. Potentially steep learning curve for team members unfamiliar with test-driven design principles.
3. Higher complexity in managing tests, especially if not properly organized.
4. Possible overemphasis on unit tests at the expense of other im... | 6,420 | [
{
"from": "human",
"value": "What do I lose by adopting test driven design?\nList only negatives; do not list benefits written in a negative form.\n"
},
{
"from": "gpt",
"value": "1. Increased initial development time and effort due to writing tests first.\n2. Potentially steep learning curve fo... |
Can't get to my site. Apache gives the following error message:
[Fri Sep 05 08:47:42 2008] [error] (OS 10060)A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. : proxy: HTTP: attempt ... | The error message you're seeing indicates that Apache is trying to connect to a backend server at the IP address `10.10.10.1` on port `80`, but it is unable to establish a connection. This can happen for several reasons. Here are some steps you can take to troubleshoot and resolve the issue:
1. **Check Backend Server ... | 3,626 | [
{
"from": "human",
"value": "Can't get to my site. Apache gives the following error message: \n\n[Fri Sep 05 08:47:42 2008] [error] (OS 10060)A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has ... |
What are the ways that you use to model and retrieve hierarchical info in a database?
| Modeling and retrieving hierarchical information in a database can be approached in several ways, depending on the specific requirements of the application, the nature of the data, and the database system being used. Here are some common methods:
### 1. **Adjacency List Model**
- **Structure**: Each node has a referen... | 4 | [
{
"from": "human",
"value": "What are the ways that you use to model and retrieve hierarchical info in a database? \n"
},
{
"from": "gpt",
"value": "Modeling and retrieving hierarchical information in a database can be approached in several ways, depending on the specific requirements of the app... |
I need to be able to create basic MS Project items (tasks, projects, resources, etc.) programmatically from my app to my Project Server 2003 install, and haven't found any good examples. Can anyone point me to some good references or have some sample code of connecting to the server and creating these items?
| To programmatically interact with Microsoft Project Server 2003, you will typically use the Project Server's web services, particularly the Project Server Interface (PSI). Below are steps and sample code snippets that can help you get started with creating basic items like tasks, projects, and resources.
### Step 1: S... | 1,469 | [
{
"from": "human",
"value": "I need to be able to create basic MS Project items (tasks, projects, resources, etc.) programmatically from my app to my Project Server 2003 install, and haven't found any good examples. Can anyone point me to some good references or have some sample code of connecting to the se... |
Perhaps the biggest risk in pushing new functionality to live lies with the database modifications required by the new code. In Rails, I believe they have 'migrations', in which you can programmatically make changes to your development host, and then make the same changes live along with the code that uses the revised ... | Yes, in the PHP ecosystem, there are several tools and libraries that can help you manage database migrations and make the process of deploying changes less risky. Here are some popular tools and approaches:
### 1. **Laravel Migrations**
If you're using the Laravel framework, it comes with a built-in migration system ... | 2,676 | [
{
"from": "human",
"value": "Perhaps the biggest risk in pushing new functionality to live lies with the database modifications required by the new code. In Rails, I believe they have 'migrations', in which you can programmatically make changes to your development host, and then make the same changes live a... |
We are developing an application that involves a substantial amount of XML transformations. We do not have any proper input test data per se, only DTD or XSD files. We'd like to generate our test data ourselves from these files. Is there an easy/free way to do that?
Edit
There are apparently no free tools for this, and... | Generating test XML data from DTD or XSD files can indeed be challenging if you're looking for free tools, but there are some options available that can help you achieve this without incurring costs. Here are a few approaches you can consider:
1. **XML Schema to XML Generation Tools**:
- **Trang**: This is an open-... | 3,799 | [
{
"from": "human",
"value": "We are developing an application that involves a substantial amount of XML transformations. We do not have any proper input test data per se, only DTD or XSD files. We'd like to generate our test data ourselves from these files. Is there an easy/free way to do that?\nEdit\nThere... |
We've been having some issues with a SharePoint instance in a test
environment. Thankfully this is not production ;) The problems started
when the disk with the SQL Server databases and search index ran out
of space. Following this, the search service would not run and search
settings in the SSP were not accessible. Re... | It sounds like you’re dealing with a complex issue involving SharePoint and SQL Server after attempting to recover from a storage problem. Let’s break down the issues and possible solutions.
### 1. Audit Failure for 'DOMAIN\SPMOSSSvc'
The failure audit message indicates that the service account used by SharePoint doe... | 1,367 | [
{
"from": "human",
"value": "We've been having some issues with a SharePoint instance in a test\nenvironment. Thankfully this is not production ;) The problems started\nwhen the disk with the SQL Server databases and search index ran out\nof space. Following this, the search service would not run and search... |
Both the jQuery and Prototpye JavaScript libraries refuse to allow me to use a variable to select an list item element by index number although they accept a hard coded number.
For example, in Prototype this works:
$$('li')[5].addClassName('active');
But this will not work no matter how I try to cast the variable as ... | It sounds like you're experiencing an issue with the way the `currentPage` variable is being interpreted when selecting the list item elements in jQuery and Prototype. If the index works when hard-coded but not when using a variable, it's possible that there may be an issue with the value of `currentPage` at the time y... | 3,608 | [
{
"from": "human",
"value": "Both the jQuery and Prototpye JavaScript libraries refuse to allow me to use a variable to select an list item element by index number although they accept a hard coded number. \nFor example, in Prototype this works:\n$$('li')[5].addClassName('active');\n\nBut this will not work... |
One of the sites I maintain relies heavily on the use of ViewState (it isn't my code). However, on certain pages where the ViewState is extra-bloated, Safari throws a "Validation of viewstate MAC failed" error.
This appears to only happen in Safari. Firefox, IE and Opera all load successfully in the same scenario.
| The "Validation of viewstate MAC failed" error typically indicates an issue with the ViewState in ASP.NET applications. This error can occur for several reasons, and when it is specific to Safari, it is often linked to the way that the browser handles cookies and the ViewState itself. Here are some steps you can take t... | 3,597 | [
{
"from": "human",
"value": "One of the sites I maintain relies heavily on the use of ViewState (it isn't my code). However, on certain pages where the ViewState is extra-bloated, Safari throws a \"Validation of viewstate MAC failed\" error.\nThis appears to only happen in Safari. Firefox, IE and Opera all ... |
I hope this question does not come off as broad as it may seem at first. I am designing a software application that I would like to be both cross-platform and modular. I am still in the planning phase and can pick practically any language and toolset.
This makes things harder, not easier, because there are seemingly so... | It sounds like you're embarking on an exciting project with a focus on modularity and cross-platform compatibility. There are indeed numerous ways to approach the development of such a software application. Here are some considerations and recommendations based on your criteria:
### Language and Framework Options
1. ... | 446 | [
{
"from": "human",
"value": "I hope this question does not come off as broad as it may seem at first. I am designing a software application that I would like to be both cross-platform and modular. I am still in the planning phase and can pick practically any language and toolset.\nThis makes things harder, ... |
My requirements:
Support .NET Compact Framework 2.0 and Windows Mobile 6.0 devices.
Only need to unzip the contents to a directory on a storage card. Creation of zip files is not required.
Must be able to use in corporate/commercial software.
Can be open source, but not have GPL or other viral license.
I've seen the ... | If you are looking for alternatives to Xceed Zip for the .NET Compact Framework that meet your requirements, here are some options to consider:
1. **DotNetZip**:
- **License**: The DotNetZip library is under the Microsoft Public License (MS-PL), which is a permissive license that allows use in commercial software w... | 2,876 | [
{
"from": "human",
"value": "My requirements:\n\nSupport .NET Compact Framework 2.0 and Windows Mobile 6.0 devices.\nOnly need to unzip the contents to a directory on a storage card. Creation of zip files is not required.\nMust be able to use in corporate/commercial software.\nCan be open source, but not ha... |
I've encountered the following problem pattern frequently over the years:
I'm writing complex code for a package comprised of a standalone application and also a library version of the core that people can use from inside other apps.
Both our own app and presumably ones that users create with the core library are like... | This is a common challenge in software design, especially in applications that span multiple modes of operation (interactive vs. batch), environments (desktop vs. server), and platforms (Windows, Linux, macOS). It involves designing an error logging mechanism that balances usability, flexibility, and platform compatibi... | 608 | [
{
"from": "human",
"value": "I've encountered the following problem pattern frequently over the years:\n\nI'm writing complex code for a package comprised of a standalone application and also a library version of the core that people can use from inside other apps.\nBoth our own app and presumably ones that... |
I use dnsmasq to resolve DNS queries on my home network. Unfortunately, if a domain name is not known, it will append my own domain name to the request which means that I always end up viewing my own site in a browser.
For example, if I enter http://dlksfhoiahdsfiuhsdf.com in a browser, I end up viewing my own site wit... | The behavior you're experiencing is due to how `dnsmasq` is configured to handle DNS queries that don't match existing records. By default, `dnsmasq` can append the local domain name to unresolved queries. If you want to prevent this behavior, there are a few configuration options you can modify.
### Steps to Fix the ... | 4,290 | [
{
"from": "human",
"value": "I use dnsmasq to resolve DNS queries on my home network. Unfortunately, if a domain name is not known, it will append my own domain name to the request which means that I always end up viewing my own site in a browser.\nFor example, if I enter http://dlksfhoiahdsfiuhsdf.com in a... |
I have Perl script and need to determine the full path and filename of the script during execution. I discovered that depending on how you call the script $0 varies and sometimes contains the fullpath+filename and sometimes just filename. Because the working directory can vary as well I can't think of a way to reliably... | You're right that `$0` can vary depending on how a Perl script is invoked. However, you can reliably determine the full path and filename of the script using a combination of Perl's built-in functions. Here's a method to get the full path of the executing script regardless of how it's invoked:
```perl
use strict;
use ... | 4,518 | [
{
"from": "human",
"value": "I have Perl script and need to determine the full path and filename of the script during execution. I discovered that depending on how you call the script $0 varies and sometimes contains the fullpath+filename and sometimes just filename. Because the working directory can vary a... |
I've seen news of John Resig's fast new selector engine named Sizzle pop up in quite a few places, but I don't know what a selector engine is, nor have any of the articles given an explanation of what it is. I know Resig is the creator of jQuery, and that Sizzle is something in Javascript, but beyond that I don't know... | A **selector engine** is a part of a library or framework that is responsible for selecting elements from the Document Object Model (DOM) based on specified criteria. In web development, developers often need to manipulate or interact with HTML elements, and a selector engine simplifies this process by providing a way ... | 4,727 | [
{
"from": "human",
"value": "I've seen news of John Resig's fast new selector engine named Sizzle pop up in quite a few places, but I don't know what a selector engine is, nor have any of the articles given an explanation of what it is. I know Resig is the creator of jQuery, and that Sizzle is something in... |
Given a (source) patch file, what's the easiest way to apply this patch on the source files under Windows?
A GUI tool where I can visually compare the unchanged-changed source lines would be great.
| Applying a patch file in Windows can be done using several methods, including command-line tools and graphical user interface (GUI) applications. If you're looking for a GUI tool that allows you to visually compare the unchanged and changed lines, here are a few options:
### 1. **WinMerge**
- **Description**: WinMerge... | 1,223 | [
{
"from": "human",
"value": "Given a (source) patch file, what's the easiest way to apply this patch on the source files under Windows?\nA GUI tool where I can visually compare the unchanged-changed source lines would be great.\n"
},
{
"from": "gpt",
"value": "Applying a patch file in Windows ca... |
An instance of class A instantiates a couple of other objects, say for example from class B:
$foo = new B();
I would like to access A's public class variables from methods within B.
Unless I'm missing something, the only way to do this is to pass the current object to the instances of B:
$foo = new B($this);
Is this... | Passing the instance of class A to class B (e.g., `$foo = new B($this);`) is a common approach to allow class B to access class A's public variables and methods. However, whether it's the best practice depends on several factors, including how you design your classes and the relationships between them.
Here are a few ... | 3,466 | [
{
"from": "human",
"value": "An instance of class A instantiates a couple of other objects, say for example from class B:\n$foo = new B();\n\nI would like to access A's public class variables from methods within B.\nUnless I'm missing something, the only way to do this is to pass the current object to the ... |
I'm almost certain I know the answer to this question, but I'm hoping there's something I've overlooked.
Certain applications seem to have the Vista Aero look and feel to their caption bars and buttons even when running on Windows XP. (Google Chrome and Windows Live Photo Gallery come to mind as examples.) I know tha... | You're correct in your assessment that many applications achieve a custom look and feel, including the Aero-like visuals on Windows XP, by implementing a custom-drawn window. This involves creating a borderless form and managing the window's aesthetics and behavior through your own rendering code.
However, there are a... | 3,747 | [
{
"from": "human",
"value": "I'm almost certain I know the answer to this question, but I'm hoping there's something I've overlooked.\nCertain applications seem to have the Vista Aero look and feel to their caption bars and buttons even when running on Windows XP. (Google Chrome and Windows Live Photo Gall... |
Would it be possible to print Hello twice using single condition?
if "condition"
printf ("Hello");
else
printf("World");
| Yes, it is possible to print "Hello" twice using a single condition. You can achieve this by placing the `printf("Hello");` statement inside a block (curly braces) so that it executes twice before falling into the `else` block. Here is an example in C:
```c
if (condition) {
printf("Hello");
printf("Hello");
} ... | 6,623 | [
{
"from": "human",
"value": "Would it be possible to print Hello twice using single condition?\nif \"condition\"\n printf (\"Hello\");\nelse\n printf(\"World\");\n\n"
},
{
"from": "gpt",
"value": "Yes, it is possible to print \"Hello\" twice using a single condition. You can achieve this by p... |
I'm tired of being in the middle of typing something, having a pop-up with a question appear, and hitting enter before reading it... (it also happens with some windows that are not pop-ups)
Do you know if there's some setting I could touch for this not to happen?
| It sounds like you may be dealing with interruptions from dialog boxes or pop-ups that appear while you are typing. Depending on your operating system and the specific applications you're using, there are a few general strategies you can use to minimize these interruptions:
### For Windows:
1. **Change Notification S... | 3,543 | [
{
"from": "human",
"value": "I'm tired of being in the middle of typing something, having a pop-up with a question appear, and hitting enter before reading it... (it also happens with some windows that are not pop-ups)\nDo you know if there's some setting I could touch for this not to happen?\n"
},
{
... |
MonoDevelop 1.0 doesn't appear to have a code-formatter like Eclipse does for Java. Is there a preferred shell script (or MonoDevelop add-in?) that you've found to work well?
| MonoDevelop 1.0 indeed does not come with a built-in code formatter like Eclipse. However, there are a couple of approaches you can take to format your C# code.
### Option 1: Using `clang-format`
Although `clang-format` is primarily known for C and C++ code, it has support for C# as well. You can set it up and integr... | 4,679 | [
{
"from": "human",
"value": "MonoDevelop 1.0 doesn't appear to have a code-formatter like Eclipse does for Java. Is there a preferred shell script (or MonoDevelop add-in?) that you've found to work well?\n"
},
{
"from": "gpt",
"value": "MonoDevelop 1.0 indeed does not come with a built-in code ... |
I need to convert a named instance of SQL server 2005, to a default instance.
Is there a way to do this without a reinstall?
The problem is, 2 out of 6 of the developers, installed with a named instance. So its becoming a pain changing connection strings for the other 4 of us. I am looking for the path of least resist... | Unfortunately, there is no straightforward way to convert a named instance of SQL Server to a default instance without reinstalling SQL Server. The architecture of SQL Server requires distinct setup processes for named and default instances. Here are some possible options and considerations for managing the situation:
... | 2,630 | [
{
"from": "human",
"value": "I need to convert a named instance of SQL server 2005, to a default instance.\nIs there a way to do this without a reinstall?\n\nThe problem is, 2 out of 6 of the developers, installed with a named instance. So its becoming a pain changing connection strings for the other 4 of u... |
I'm currently working on an application with a frontend written in Adobe Flex 3. I'm aware of FlexUnit but what I'd really like is a unit test runner for Ant/NAnt and a runner that integrates with the Flex Builder IDE (AKA Eclipse). Does one exist?
Also, are there any other resources on how to do Flex development "the... | For unit testing with Adobe Flex, especially with FlexUnit, there are a few tools and approaches you can consider:
### Unit Test Runner for Ant/NAnt:
- **FlexUnit** itself does not come with a built-in runner for Ant or NAnt out of the box, but you can set up a custom Ant target that runs your FlexUnit tests. You can ... | 2,133 | [
{
"from": "human",
"value": "I'm currently working on an application with a frontend written in Adobe Flex 3. I'm aware of FlexUnit but what I'd really like is a unit test runner for Ant/NAnt and a runner that integrates with the Flex Builder IDE (AKA Eclipse). Does one exist? \nAlso, are there any other re... |
We've been using Flex for about 6 months here at work, and I found that my first batches of FlexUnit tests involving custom components would tend to follow this sort of pattern:
import mx.core.Application;
import mx.events.FlexEvent;
import flexunit.framework.TestCase;
public class CustomComponentTest extends TestCase... | You've identified a common challenge in testing UI components in Flex and similar frameworks: dealing with the asynchronous nature of component lifecycle events. It's great that you've been able to adapt your tests to make them simpler and easier to follow. Here are a few thoughts and approaches that might help you ref... | 3,921 | [
{
"from": "human",
"value": "We've been using Flex for about 6 months here at work, and I found that my first batches of FlexUnit tests involving custom components would tend to follow this sort of pattern:\nimport mx.core.Application;\nimport mx.events.FlexEvent;\nimport flexunit.framework.TestCase;\n\npub... |
I'd like to utilize an ICE Faces fileInput control to fill in the file path & file name for the input to an input field on a web page based on file that the user selects. How can I capture these properties without actually performing any file transfer operations?
| To capture the file path and file name from a user's file selection in an ICEfaces `fileInput` component without performing any file transfer operations, you can utilize JavaScript to handle the file selection event. The `fileInput` component itself won't expose the file path for security reasons, but you can get the f... | 1,354 | [
{
"from": "human",
"value": "I'd like to utilize an ICE Faces fileInput control to fill in the file path & file name for the input to an input field on a web page based on file that the user selects. How can I capture these properties without actually performing any file transfer operations?\n"
},
{
... |
How do I have two effects in jQuery run in sequence, not simultaneously? Take this piece of code for example:
$("#show-projects").click(function() {
$(".page:visible").fadeOut("normal");
$("#projects").fadeIn("normal");
});
The fadeOut and the fadeIn run simultaneously, how do I make them run one after the oth... | To ensure that two effects in jQuery run in sequence (i.e., one after the other), you can use the callback function that is passed to the `fadeOut()` method. This callback function will be executed after the `fadeOut()` animation completes, allowing you to trigger the `fadeIn()` animation afterwards.
Here's how you ca... | 5,948 | [
{
"from": "human",
"value": "How do I have two effects in jQuery run in sequence, not simultaneously? Take this piece of code for example:\n$(\"#show-projects\").click(function() {\n $(\".page:visible\").fadeOut(\"normal\");\n $(\"#projects\").fadeIn(\"normal\");\n});\n\nThe fadeOut and the fadeIn run... |
I have a SQL script that inserts data (via INSERT statements currently numbering in the thousands) One of the columns contains a unique identifier (though not an IDENTITY type, just a plain ol' int) that's actually unique across a few different tables.
I'd like to add a scalar function to my script that gets the next ... | Your understanding of SQL Server functions and their limitations is correct. Scalar functions in SQL Server cannot modify state or access global variables, and they cannot perform inserts or updates to tables. This restricts their use for generating unique identifiers in the way you're aiming for.
Given that you are r... | 1,695 | [
{
"from": "human",
"value": "I have a SQL script that inserts data (via INSERT statements currently numbering in the thousands) One of the columns contains a unique identifier (though not an IDENTITY type, just a plain ol' int) that's actually unique across a few different tables. \nI'd like to add a scalar... |
What are attributes in .NET, what are they good for, and how do I create my own attributes?
| ### What are Attributes in .NET?
In .NET, **attributes** are a powerful way to add metadata to your code. An attribute is a special class that derives from the `System.Attribute` base class. Attributes can be applied to various program elements such as classes, methods, properties, parameters, assemblies, and more.
#... | 2,604 | [
{
"from": "human",
"value": "What are attributes in .NET, what are they good for, and how do I create my own attributes?\n"
},
{
"from": "gpt",
"value": "### What are Attributes in .NET?\n\nIn .NET, **attributes** are a powerful way to add metadata to your code. An attribute is a special class t... |
I'm seeing strange errors when my C++ code has min() or max() calls. I'm using Visual C++ compilers.
| When working with `min()` and `max()` in C++, you may encounter issues, especially when using Visual C++ compilers. Here are some common reasons and solutions for the strange errors related to these functions:
### 1. Macro Conflicts
One common issue arises from macro definitions that conflict with the function names.... | 1,690 | [
{
"from": "human",
"value": "I'm seeing strange errors when my C++ code has min() or max() calls. I'm using Visual C++ compilers.\n"
},
{
"from": "gpt",
"value": "When working with `min()` and `max()` in C++, you may encounter issues, especially when using Visual C++ compilers. Here are some com... |
I did a lot of PHP programming in the last years and one thing that keeps annoying me is the weak support for Unicode and multibyte strings (to be sure, natively there is none). For example, "htmlentities" seems to be a much used function in the PHP world and I found it to be absolutely annoying when you've put an effo... | You're right in noting that PHP's handling of multibyte strings and Unicode has been a source of frustration for many developers. To answer your questions and clarify your concerns:
1. **Named Entities vs. UTF-8**: In modern web development, especially when using UTF-8 encoding consistently across your application (da... | 3,755 | [
{
"from": "human",
"value": "I did a lot of PHP programming in the last years and one thing that keeps annoying me is the weak support for Unicode and multibyte strings (to be sure, natively there is none). For example, \"htmlentities\" seems to be a much used function in the PHP world and I found it to be ... |
What is a magic number?
Why do many programmers advise that they be avoided?
| A **magic number** in programming refers to a numeric constant that appears in code without any explanation or context. These numbers are typically used directly in calculations, conditions, or data structures, making their purpose unclear to anyone reading the code.
### Reasons to Avoid Magic Numbers:
1. **Lack of C... | 3,818 | [
{
"from": "human",
"value": "What is a magic number?\nWhy do many programmers advise that they be avoided?\n"
},
{
"from": "gpt",
"value": "A **magic number** in programming refers to a numeric constant that appears in code without any explanation or context. These numbers are typically used dir... |
Simple ASP.NET application.
I have two drop-down controls. On the first-drop down I have a JavaScript onChange event. The JavaScript enables the second drop-down and removes a value from it (the value selected in the first drop-down). If they click the blank first value of the drop-down, then the second drop-down will ... | In your scenario, the challenge you're facing is related to the timing of when the page is rendered and when your JavaScript runs. When the page is loaded after a postback, the first dropdown's selected value is set, but the JavaScript you registered to run at startup may not correctly account for that.
To solve this... | 1,191 | [
{
"from": "human",
"value": "Simple ASP.NET application.\nI have two drop-down controls. On the first-drop down I have a JavaScript onChange event. The JavaScript enables the second drop-down and removes a value from it (the value selected in the first drop-down). If they click the blank first value of the ... |
... say for CentOS?
| It seems like your question is incomplete. Could you please provide more context or specify what you would like to know about CentOS? Are you looking for installation instructions, configuration tips, package management, or something else? | 7,433 | [
{
"from": "human",
"value": "... say for CentOS?\n"
},
{
"from": "gpt",
"value": "It seems like your question is incomplete. Could you please provide more context or specify what you would like to know about CentOS? Are you looking for installation instructions, configuration tips, package manag... |
Where can I get some decent looking free ASP.Net or CSS themes?
| There are several resources where you can find free ASP.NET or CSS themes that you can use for your projects. Here are some popular options:
### Free ASP.NET Themes:
1. **Bootstrap Templates**:
- **[BootstrapMade](https://bootstrapmade.com/)**: Offers a collection of free Bootstrap templates that can be easily int... | 3,102 | [
{
"from": "human",
"value": "Where can I get some decent looking free ASP.Net or CSS themes?\n"
},
{
"from": "gpt",
"value": "There are several resources where you can find free ASP.NET or CSS themes that you can use for your projects. Here are some popular options:\n\n### Free ASP.NET Themes:\n... |
I'm running a long process stored procedure.
I'm wondering if in case of a timeout or any case of disconnection with the database after initiating the call to the stored procedure. Is it still working and implementing the changes on the server?
| When you execute a stored procedure in a database, the behavior in the case of a timeout or disconnection depends on several factors, including the database system you're using (such as SQL Server, MySQL, PostgreSQL, etc.), the type of transaction management in place, and how the client application handles the connecti... | 3,757 | [
{
"from": "human",
"value": "I'm running a long process stored procedure.\nI'm wondering if in case of a timeout or any case of disconnection with the database after initiating the call to the stored procedure. Is it still working and implementing the changes on the server?\n... |
I've generated some JSON and I'm trying to pull it into an object in JavaScript. I keep getting errors. Here's what I have:
var data = '{"count" : 1, "stack" : "sometext\n\n"}';
var dataObj = eval('('+data+')');
This gives me an error:
unterminated string literal
With JSON.parse(data), I see similar error messages: ... | The issue you're experiencing is related to how newline characters are treated in JSON strings. In JSON, newline characters need to be escaped properly to avoid breaking the string.
In your JSON string, the `\n` character is interpreted as the start of a newline, which is causing the errors you're seeing. When you def... | 1,141 | [
{
"from": "human",
"value": "I've generated some JSON and I'm trying to pull it into an object in JavaScript. I keep getting errors. Here's what I have:\nvar data = '{\"count\" : 1, \"stack\" : \"sometext\\n\\n\"}';\nvar dataObj = eval('('+data+')');\n\nThis gives me an error: \nunterminated string literal\... |
I need to detect when a session has expired in my Visuial Basic web application. This is what I'm using...
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If CurrentSession.IsNew AndAlso (Not Page.Request.Headers("Cookie") Is Nothing) AndAlso (Page.Request.Headers("Coo... | To handle session expiration consistently across different browsers, including Firefox, you need to account for how browsers manage cookies and sessions. The method you're using checks for the presence of a new session, but sometimes Firefox may handle cookies differently, leading to potential false negatives when chec... | 3,703 | [
{
"from": "human",
"value": "I need to detect when a session has expired in my Visuial Basic web application. This is what I'm using...\nProtected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load\n\n If CurrentSession.IsNew AndAlso (Not Page.Request.Headers(\"Cookie\") ... |
I tried to follow a couple of googled up tutorials on setting up mod_python, but failed every time. Do you have a good, step-by step, rock-solid howto?
My dev box is OS X, production - Centos.
| Setting up mod_python can be a bit challenging, but I'll guide you through the process step-by-step for both macOS (your development environment) and CentOS (your production environment). Note that mod_python is considered deprecated; consider using alternative solutions like mod_wsgi or Flask for new projects. However... | 1,980 | [
{
"from": "human",
"value": "I tried to follow a couple of googled up tutorials on setting up mod_python, but failed every time. Do you have a good, step-by step, rock-solid howto?\nMy dev box is OS X, production - Centos.\n"
},
{
"from": "gpt",
"value": "Setting up mod_python can be a bit chall... |
All front-end developers know the pain of coding for Firefox, then viewing our then mangled pages in IE6.
IE6 is still widely used (it is, however disappearing slowly but surely... in a year and a half from the writing of this, it will be irrelevant as usage will be less than 1%)
We usually used IE conditional comment... | When it comes to debugging and developing for IE6, the options are indeed limited compared to modern browsers. However, there are still a few tools and techniques you can use to make your life easier:
1. **IETester**: This is a popular tool that allows you to test your web applications in multiple versions of Internet... | 4,452 | [
{
"from": "human",
"value": "All front-end developers know the pain of coding for Firefox, then viewing our then mangled pages in IE6. \nIE6 is still widely used (it is, however disappearing slowly but surely... in a year and a half from the writing of this, it will be irrelevant as usage will be less than ... |
I would like to be able to predict what will be in the resulting binary when I call Write in Ada to serialize a record. Do you know where I can look this up?
I have some legacy Ada software that produces a binary file by Write-ing a record, and I need to debug a C++ program that is supposed to write a compatible binary... | To understand how Ada serializes a record when using the `Write` operation, it's important to consider the following key points:
1. **Record Layout**: The layout of a record in memory is influenced by its components, including their data types, alignment requirements, and any padding that might be added by the Ada com... | 4,332 | [
{
"from": "human",
"value": "I would like to be able to predict what will be in the resulting binary when I call Write in Ada to serialize a record. Do you know where I can look this up?\nI have some legacy Ada software that produces a binary file by Write-ing a record, and I need to debug a C++ program tha... |
How do you run an external program and pass it command line parameters using C? If you have to use operating system API, include a solution for Windows, Mac, and Linux.
| To run an external program and pass command line parameters in C, you can use different APIs depending on the operating system. Here's how to do it for Windows, macOS, and Linux.
### Windows
On Windows, you can use the `CreateProcess` function to start an external program with command line arguments. Here is an examp... | 3,948 | [
{
"from": "human",
"value": "How do you run an external program and pass it command line parameters using C? If you have to use operating system API, include a solution for Windows, Mac, and Linux.\n"
},
{
"from": "gpt",
"value": "To run an external program and pass command line parameters in C,... |
Currently I know of only two ways to cache data (I use PHP but I assume that the same will apply to most languages).
Save the cache to a file
Save the cache to a large DB field
Are there any other (perhaps better) ways of caching or is it really just this simple?
| Caching is a critical aspect of optimizing application performance, and there are indeed several strategies beyond simply saving cache to a file or using a large database field. Here are some other common caching mechanisms that you can consider:
### 1. **In-Memory Caching:**
- **Memcached:** A high-performance, di... | 4,340 | [
{
"from": "human",
"value": "Currently I know of only two ways to cache data (I use PHP but I assume that the same will apply to most languages).\n\nSave the cache to a file\nSave the cache to a large DB field\n\nAre there any other (perhaps better) ways of caching or is it really just this simple?\n"
},
... |
Rather than rewriting the entire contents of an xml file when a single element is updated, is there a better alternative to updating the file?
| Yes, there are several alternatives to rewriting an entire XML file when only a single element is updated. Here are a few approaches:
1. **Use an XML Database**: Instead of storing your XML in a file, you can use an XML database such as BaseX, eXist-db, or MarkLogic. These databases are designed to handle XML document... | 3,535 | [
{
"from": "human",
"value": "Rather than rewriting the entire contents of an xml file when a single element is updated, is there a better alternative to updating the file?\n"
},
{
"from": "gpt",
"value": "Yes, there are several alternatives to rewriting an entire XML file when only a single elem... |
I would like to be able to loop through all of the defined parameters on my reports and build a display string of the parameter name and value. I'd then display the results on the report so the user knows which parameters were used for that specific execution. The only problem is that I cannot loop through the Parame... | In SQL Server Reporting Services (SSRS) 2005, the Parameters collection does not directly support iteration using standard looping methods as you mentioned. However, you can access the parameters using a different approach.
### Using Report Code to Display Parameter Names and Values
You can use the `Parameters` colle... | 3,972 | [
{
"from": "human",
"value": "I would like to be able to loop through all of the defined parameters on my reports and build a display string of the parameter name and value. I'd then display the results on the report so the user knows which parameters were used for that specific execution. The only problem... |
I am currently learning OLAP & MDX after many years of relational database development.
Any tips on getting started in MDX? What are the best books and resources to learn MDX?
| Getting started with MDX (Multidimensional Expressions) can be a rewarding endeavor, especially after your experience with relational databases. Here are some tips and resources to help you along your journey:
### Tips for Learning MDX
1. **Understand the Basics of OLAP**: Before diving into MDX, ensure you have a so... | 2,925 | [
{
"from": "human",
"value": "I am currently learning OLAP & MDX after many years of relational database development. \nAny tips on getting started in MDX? What are the best books and resources to learn MDX?\n"
},
{
"from": "gpt",
"value": "Getting started with MDX (Multidimensional Expressions)... |
Currently we have a hybrid ASP/PHP setup connecting to a SQL Server 2005 database. But all the query work is done on the client side, I'd like to move some of this to PHP.
What driver and/or connection string is needed to connect to Sql Svr and what is the syntax to use in PHP?
Update: OK so I was definitely trying t... | To connect to a SQL Server 2005 database from PHP, you can use the Microsoft Drivers for PHP for SQL Server. There are a couple of options available, including the `sqlsrv` and `pdo_sqlsrv` extensions.
### Installation of Drivers
To avoid dealing with DLL files manually, the easiest way to set this up is through a pa... | 1,636 | [
{
"from": "human",
"value": "Currently we have a hybrid ASP/PHP setup connecting to a SQL Server 2005 database. But all the query work is done on the client side, I'd like to move some of this to PHP. \nWhat driver and/or connection string is needed to connect to Sql Svr and what is the syntax to use in PHP... |
If you have round robin enabled in Vxworks and your task gets preempted by a higher priority task, what happens to the remaining time slice?
| In VxWorks, when round-robin scheduling is enabled for tasks of the same priority level, each task is allocated a time slice during which it can execute. If a task that is currently running gets preempted by a higher-priority task, the following happens to its remaining time slice:
1. **Preemption**: The lower-priorit... | 5,292 | [
{
"from": "human",
"value": "If you have round robin enabled in Vxworks and your task gets preempted by a higher priority task, what happens to the remaining time slice?\n"
},
{
"from": "gpt",
"value": "In VxWorks, when round-robin scheduling is enabled for tasks of the same priority level, each... |
I've got a Palm OS/Garnet 68K application that uses a third-party static library built with CodeWarrior. Can I rebuilt the application using PRC-Tools, the port of GCC for the Palm OS platform and still link with the third-party library?
| Rebuilding a Palm OS/Garnet 68K application using PRC-Tools while linking it with a third-party static library built with CodeWarrior can be quite challenging due to differences in how the two compilers generate object files and handle certain features. Here are some considerations:
1. **Binary Compatibility**: CodeWa... | 3,858 | [
{
"from": "human",
"value": "I've got a Palm OS/Garnet 68K application that uses a third-party static library built with CodeWarrior. Can I rebuilt the application using PRC-Tools, the port of GCC for the Palm OS platform and still link with the third-party library?\n"
},
{
"from": "gpt",
"valu... |
My question concerns c# and how to access Static members ... Well I don't really know how to explain it (which kind of is bad for a question isn't it?) I will just give you some sample code:
Class test<T>{
int method1(Obj Parameter1){
//in here I want to do something which I would explain as
T.Tr... | To achieve the behavior you're describing in C# (using generics to call a static method on a type), you can utilize interfaces or reflection since static methods cannot be invoked directly through a generic type parameter. Here's a more elegant approach to handle your situation without using try-catch for the `TryParse... | 1,673 | [
{
"from": "human",
"value": "My question concerns c# and how to access Static members ... Well I don't really know how to explain it (which kind of is bad for a question isn't it?) I will just give you some sample code:\nClass test<T>{\n int method1(Obj Parameter1){\n //in here I want to do some... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.