instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
Why does my D2009 exe produce emails with attachments named ATTnnnnn.DAT when the same source code compiled in D2007 produces emails with attachments correctly named with the original file name?
I am using the respective Indy libraries that come with D2007 and D2009. Not having the original file name on the attachmen... | The issue you're experiencing with attachments being named `ATTnnnnn.DAT` when sending emails with Delphi 2009, as opposed to the correct original file names in Delphi 2007, likely arises from differences in how the Indy library versions used in these Delphi versions handle email attachments.
### Potential Causes and ... | 7,951 | [
{
"from": "human",
"value": "Why does my D2009 exe produce emails with attachments named ATTnnnnn.DAT when the same source code compiled in D2007 produces emails with attachments correctly named with the original file name? \nI am using the respective Indy libraries that come with D2007 and D2009. Not havi... |
When I enter this query:
sqlite> DELETE FROM mails WHERE (id = 71);
SQLite returns this error:
SQL error: database is locked
How do I unlock the database so this query will work?
| The "database is locked" error in SQLite typically indicates that another database connection is holding a lock on the database, preventing your current operation from being executed. Here are a few steps you can take to resolve this issue:
1. **Check for Long-running Transactions**: If another connection is holding a... | 15,435 | [
{
"from": "human",
"value": "When I enter this query:\nsqlite> DELETE FROM mails WHERE (id = 71);\nSQLite returns this error:\nSQL error: database is locked\n\nHow do I unlock the database so this query will work?\n"
},
{
"from": "gpt",
"value": "The \"database is locked\" error in SQLite typica... |
We are writing a search application that saves the search criteria to session state and executes the search inside of an asp.net updatepanel. Sometimes when we execute multiple searches successively the 2nd or 3rd search will sometimes return results from the first set of search criteria.
Example: our first search w... | The issue you're encountering with your ASP.NET application seems to be related to the way session state is being handled, particularly in the context of asynchronous requests via the UpdatePanel. When dealing with AJAX calls in ASP.NET, it's crucial to ensure that the session state is being accessed and modified prope... | 10,930 | [
{
"from": "human",
"value": "We are writing a search application that saves the search criteria to session state and executes the search inside of an asp.net updatepanel. Sometimes when we execute multiple searches successively the 2nd or 3rd search will sometimes return results from the first set of searc... |
What is the best way to resolve a conflict when doing a git svn rebase, and the git branch you are on becomes "(no-branch)"?
| When using `git svn rebase` and encountering conflicts, the situation can lead you to a detached HEAD state, commonly displayed as `(no-branch)`. Here's how to resolve conflicts in this state effectively:
### Steps to Resolve Conflicts
1. **Identify the Conflict**: When you run `git svn rebase`, Git will stop at conf... | 12,625 | [
{
"from": "human",
"value": "What is the best way to resolve a conflict when doing a git svn rebase, and the git branch you are on becomes \"(no-branch)\"?\n"
},
{
"from": "gpt",
"value": "When using `git svn rebase` and encountering conflicts, the situation can lead you to a detached HEAD state... |
What is the easiest way to call a web service from Excel (I am using version 2002)? Please, no third party tools or libraries. This has to be easy with some VBA that I can paste there, use it, and ever touch.
| Calling a web service from Excel using VBA (Visual Basic for Applications) can be accomplished using the built-in `XMLHTTP` or `WinHttp` objects, which are part of Windows' built-in capabilities. Below is a straightforward method to make a GET request to a web service.
Here’s a simple example of how you can call a web... | 12,181 | [
{
"from": "human",
"value": "What is the easiest way to call a web service from Excel (I am using version 2002)? Please, no third party tools or libraries. This has to be easy with some VBA that I can paste there, use it, and ever touch.\n"
},
{
"from": "gpt",
"value": "Calling a web service f... |
In SQL SERVER Is it possible to store data with carriage return in a table and then retrieve it back again with carriage return.
Eg:
insert into table values ('test1
test2
test3
test4');
When I retrieve it, I get the message in a line
test1 test2 test3 test4
The carriage return is treated as a single character... | Yes, in SQL Server, you can store strings with carriage returns (newline characters) in a table, and when you retrieve them, you can maintain the formatting. However, how the data is displayed depends on the application you are using to render the text.
### Inserting Data with Carriage Returns
When you insert data th... | 14,148 | [
{
"from": "human",
"value": "In SQL SERVER Is it possible to store data with carriage return in a table and then retrieve it back again with carriage return.\nEg:\ninsert into table values ('test1 \n\ntest2\n\ntest3\n\ntest4');\n\nWhen I retrieve it, I get the message in a line \ntest1 test2 test3 test4\... |
I am a C++/C# developer and never spent time working on web pages. I would like to put text (randomly and diagonally perhaps) in large letters across the background of some pages. I want to be able to read the foreground text and also be able to read the "watermark". I understand that is probably more of a function ... | Creating a watermark effect using HTML and CSS is indeed quite straightforward, especially for someone with a programming background. Below are the steps to achieve a diagonal watermark text across the background of a webpage while ensuring that the foreground text remains readable.
### Step 1: Create the HTML Structu... | 9,533 | [
{
"from": "human",
"value": "I am a C++/C# developer and never spent time working on web pages. I would like to put text (randomly and diagonally perhaps) in large letters across the background of some pages. I want to be able to read the foreground text and also be able to read the \"watermark\". I unde... |
I'm trying to write a regex that will parse out the directory and filename of a fully qualified path using matching groups.
so...
/var/log/xyz/10032008.log
would recognize group 1 to be "/var/log/xyz" and group 2 to be "10032008.log"
Seems simple but I can't get the matching groups to work for the life of me.
NOTE: A... | To parse out the directory and filename from a fully qualified path like `/var/log/xyz/10032008.log`, you can use the following regular expression:
```regex
^(.*\/)([^\/]+)$
```
### Explanation:
- `^` asserts the start of the string.
- `(.*\/)` captures everything up to the last `/` (the directory part) in Group 1:
... | 15,443 | [
{
"from": "human",
"value": "I'm trying to write a regex that will parse out the directory and filename of a fully qualified path using matching groups.\nso...\n/var/log/xyz/10032008.log\n\nwould recognize group 1 to be \"/var/log/xyz\" and group 2 to be \"10032008.log\"\nSeems simple but I can't get the ma... |
Is it possible to detect a valid regular expression with another regular expression? If so please give example code below.
| Detecting a valid regular expression using another regular expression is generally not feasible because the problem of determining whether a given string is a valid regex is not regular. This stems from the fact that regular expressions can express a variety of complex patterns, and validating them requires more comput... | 15,607 | [
{
"from": "human",
"value": "Is it possible to detect a valid regular expression with another regular expression? If so please give example code below.\n"
},
{
"from": "gpt",
"value": "Detecting a valid regular expression using another regular expression is generally not feasible because the pr... |
In Lua, using the = operator without an l-value seems to be equivalent to a print(r-value), here are a few examples run in the Lua standalone interpreter:
> = a
nil
> a = 8
> = a
8
> = 'hello'
hello
> = print
function: 003657C8
And so on...
My question is : where can I find a detailed description of this use for the =... | The behavior you're observing in the Lua standalone interpreter is a feature specific to the interactive prompt (also known as the REPL - Read-Eval-Print Loop). In this environment, using the `=` operator without an l-value behaves like a request to evaluate the expression on the right and print its result.
This feat... | 11,439 | [
{
"from": "human",
"value": "In Lua, using the = operator without an l-value seems to be equivalent to a print(r-value), here are a few examples run in the Lua standalone interpreter:\n> = a\nnil\n> a = 8\n> = a\n8\n> = 'hello'\nhello\n> = print\nfunction: 003657C8\n\nAnd so on...\nMy question is : where ca... |
Windows Forms allows you to develop Components, non-visual elements that can have a designer. Built-in components include the BackgroundWorker, Timer, and a lot of ADO .NET objects. It's a nice way to provide easy configuration of a complicated object, and it it enables designer-assisted data binding.
I've been looki... | You’re correct that WPF (Windows Presentation Foundation) has a different architecture and approach compared to Windows Forms when it comes to creating reusable components. While Windows Forms has a more explicit model for components with a set of built-in components, WPF encourages a different paradigm that revolves a... | 13,527 | [
{
"from": "human",
"value": "Windows Forms allows you to develop Components, non-visual elements that can have a designer. Built-in components include the BackgroundWorker, Timer, and a lot of ADO .NET objects. It's a nice way to provide easy configuration of a complicated object, and it it enables design... |
I'm looking for the most ideal data structure (for performance and ease of use) from which values can be retrieved by string key or index. Dictionary doesn't work because you can't really retrieve by index. Any ideas?
| If you need a data structure that allows for both retrieval by string key and by index, you might consider using a combination of a dictionary and a list (or an array). Here’s how you can implement this:
### 1. Use a List and a Dictionary
- **List**: To maintain the order of insertion and allow retrieval by index.
- ... | 10,992 | [
{
"from": "human",
"value": "I'm looking for the most ideal data structure (for performance and ease of use) from which values can be retrieved by string key or index. Dictionary doesn't work because you can't really retrieve by index. Any ideas?\n"
},
{
"from": "gpt",
"value": "If you need a ... |
A battery powered (2 x AA) Arduino LilyPad should switch a BlueSmirf v2.11 Bluetooth modem to/from command mode (see source code below). The BlueSmirf has been set to 9600 baud.
If the PC connects via Bluetooth (see source code below), the Arduino program runs fine at the beginning (sending multiple "ping\n"). After so... | The issue you're facing with your Arduino LilyPad and BlueSmirf Bluetooth modem sending unexpected commands (like `$$$` and `---\n`) instead of switching to command mode after some time might stem from how the BlueSmirf manages its command mode, along with potential timing and serial communication problems. Let's take ... | 10,494 | [
{
"from": "human",
"value": "A battery powered (2 x AA) Arduino LilyPad should switch a BlueSmirf v2.11 Bluetooth modem to/from command mode (see source code below). The BlueSmirf has been set to 9600 baud.\nIf the PC connects via Bluetooth (see source code below), the Arduino program runs fine at the begin... |
Recently I've been experimenting with TDD while developing a GUI application in Python. I find it very reassuring to have tests that verify the functionality of my code, but it's been tricky to follow some of the recommened practices of TDD. Namely, writing tests first has been hard. And I'm finding it difficult to mak... | Your observations and experiences with Test-Driven Development (TDD) and the challenges you're facing are quite common, especially when developing GUI applications where external dependencies and state play a significant role. Here are some insights regarding your situation and the specific test you provided:
### Asse... | 8,217 | [
{
"from": "human",
"value": "Recently I've been experimenting with TDD while developing a GUI application in Python. I find it very reassuring to have tests that verify the functionality of my code, but it's been tricky to follow some of the recommened practices of TDD. Namely, writing tests first has been ... |
I'm a newbie in C# bu I'm experienced Delphi developer.
In Delphi I can use same code for MenuItem and ToolButton using TAction.OnExecute event and I can disable/enable MenuItem and ToolButton together using TAction.OnUpdate event.
Is there a similar way to do this in C# without using external libraries? Or more - How ... | In C#, especially when using Windows Forms or WPF, there isn't a direct equivalent to Delphi's `TAction` and its `OnUpdate` event. However, you can achieve similar functionality by using events and a pattern of centralized state management for enabling/disabling controls.
Here’s how you can set it up in a typical Wind... | 10,762 | [
{
"from": "human",
"value": "I'm a newbie in C# bu I'm experienced Delphi developer.\nIn Delphi I can use same code for MenuItem and ToolButton using TAction.OnExecute event and I can disable/enable MenuItem and ToolButton together using TAction.OnUpdate event.\nIs there a similar way to do this in C# witho... |
I have a Visual Studio Setup Project that I use to install a fairly simple WinForms application. At the end of the install I have a custom user interface page that shows a single check box which asks the user if they want to run the application. I've seen other installers do this quite often. But I cannot find a way to... | In a Visual Studio Setup Project, running an application after the installation completes (but not as part of the installation process) can be achieved using a couple of workarounds, as the native Setup Project does not directly support launching an application after installation based on user interaction on a custom U... | 12,995 | [
{
"from": "human",
"value": "I have a Visual Studio Setup Project that I use to install a fairly simple WinForms application. At the end of the install I have a custom user interface page that shows a single check box which asks the user if they want to run the application. I've seen other installers do thi... |
My ClickOnce application uses a third party tool that requires the Visual C++ 2005 redistributable. The third party tool will not work if only the VC++ 2008 redistributable is installed. However, in Visual Studio 2008, the ClickOnce prerequisites do not allow a version to be specified for the VC++ redistributable; it w... | In ClickOnce deployments, specifying a specific version of the Visual C++ Redistributable can be challenging, especially when you need an earlier version like the Visual C++ 2005 Redistributable instead of the 2008 version. Since ClickOnce does not natively support selecting different versions of VC++ redistributables,... | 11,131 | [
{
"from": "human",
"value": "My ClickOnce application uses a third party tool that requires the Visual C++ 2005 redistributable. The third party tool will not work if only the VC++ 2008 redistributable is installed. However, in Visual Studio 2008, the ClickOnce prerequisites do not allow a version to be spe... |
I have a given certificate installed on my server. That certificate has valid dates, and seems perfectly valid in the Windows certificates MMC snap-in.
However, when I try to read the certificate, in order to use it in an HttpRequest, I can't find it. Here is the code used:
X509Store store = new X509Store(StoreName... | The situation you're encountering, where a certificate appears valid in the Windows certificates MMC snap-in but returns as "invalid" when using the `Find` method with the `true` flag, can be puzzling. Here are some potential reasons for this behavior and steps you can take to investigate further:
1. **Certificate Cha... | 11,348 | [
{
"from": "human",
"value": "I have a given certificate installed on my server. That certificate has valid dates, and seems perfectly valid in the Windows certificates MMC snap-in.\nHowever, when I try to read the certificate, in order to use it in an HttpRequest, I can't find it. Here is the code used:\n ... |
This is written in PHP, but it's really language agnostic.
try
{
try
{
$issue = new DM_Issue($core->db->escape_string($_GET['issue']));
}
catch(DM_Exception $e)
{
throw new Error_Page($tpl, ERR_NOT_FOUND, $e->getMessage());
}
}
catch(Error_Page $e)
{
die($e);
}
Is nested try... | Using nested `try-catch` blocks is not inherently bad practice, but it can lead to code that feels cumbersome or difficult to read if overused. Your approach does handle errors gracefully by allowing specific exceptions to trigger specific responses, which is a good practice. However, there are ways to improve the read... | 8,326 | [
{
"from": "human",
"value": "This is written in PHP, but it's really language agnostic.\ntry\n{\n try\n {\n $issue = new DM_Issue($core->db->escape_string($_GET['issue']));\n }\n catch(DM_Exception $e)\n {\n throw new Error_Page($tpl, ERR_NOT_FOUND, $e->getMessage());\n }\n}\... |
Edit: Let me completely rephrase this, because I'm not sure there's an XML way like I was originally describing.
Yet another edit: This needs to be a repeatable process, and it has to be able to be set up in a way that it can be called in C# code.
In database A, I have a set of tables, related by PKs and FKs. A paren... | To accomplish the task of copying rows from one database (Database A) to another (Database B) while maintaining the relationships and generating new primary keys (PKs) and foreign keys (FKs), a combination of C# and ADO.NET would be a practical approach. This method does not depend on SSIS and allows for a good degree ... | 7,845 | [
{
"from": "human",
"value": "Edit: Let me completely rephrase this, because I'm not sure there's an XML way like I was originally describing.\nYet another edit: This needs to be a repeatable process, and it has to be able to be set up in a way that it can be called in C# code.\nIn database A, I have a set ... |
Suppose you have a fairly large (~2.2 MLOC), fairly old (started more than 10 years ago) Windows desktop application in C/C++. About 10% of modules are external and don't have sources, only debug symbols.
How would you go about reducing application's memory footprint in half? At least, what would you do to find out whe... | Reducing the memory footprint of a large Windows desktop application in C/C++ requires a systematic approach to identify memory usage patterns and potential optimizations. Here’s a step-by-step guide on how to go about this process:
### 1. Profiling Memory Usage
#### a. Memory Profiling Tools:
Use memory profiling to... | 12,164 | [
{
"from": "human",
"value": "Suppose you have a fairly large (~2.2 MLOC), fairly old (started more than 10 years ago) Windows desktop application in C/C++. About 10% of modules are external and don't have sources, only debug symbols.\nHow would you go about reducing application's memory footprint in half? A... |
Getting sporadic errors from users of a CMS; Ajax requests sometimes result in a "501 Method not implemented" response from the server. Not all the time; usually works.
Application has been stable for months. Users seem to be getting it with Firefox 3. I've seen a couple references via Google to such problems being re... | The "501 Method Not Implemented" error typically indicates that the server does not support the functionality required to fulfill the request. There are a few potential reasons why you might see sporadic occurrences of this error, particularly in the context of AJAX requests and specific user environments. Here are som... | 13,468 | [
{
"from": "human",
"value": "Getting sporadic errors from users of a CMS; Ajax requests sometimes result in a \"501 Method not implemented\" response from the server. Not all the time; usually works. \nApplication has been stable for months. Users seem to be getting it with Firefox 3. I've seen a couple ref... |
I've got a situation where I have a DLL I'm creating that uses another third party DLL, but I would prefer to be able to build the third party DLL into my DLL instead of having to keep them both together if possible.
This with is C# and .NET 3.5.
The way I would like to do this is by storing the third party DLL as an e... | Embedding a third-party DLL as a resource in your assembly and extracting it at runtime is a feasible approach, but there are a few critical points to keep in mind to ensure it works correctly. Here’s a basic outline of how to properly embed and load a third-party DLL from your own assembly:
### Step 1: Embed the DLL ... | 9,845 | [
{
"from": "human",
"value": "I've got a situation where I have a DLL I'm creating that uses another third party DLL, but I would prefer to be able to build the third party DLL into my DLL instead of having to keep them both together if possible.\nThis with is C# and .NET 3.5.\nThe way I would like to do thi... |
I have a few models that need to have custom find conditions placed on them. For example, if I have a Contact model, every time Contact.find is called, I want to restrict the contacts returned that only belong to the Account in use.
I found this via Google (which I've customized a little):
def self.find(*args)
with_... | To avoid code duplication and make your approach DRY (Don't Repeat Yourself), you can use a module to encapsulate the logic for scoping the `find` method. This way, you can include this module in any model that needs this custom behavior.
Here's how you can achieve this:
### Step 1: Create a Module for the Scoping L... | 12,197 | [
{
"from": "human",
"value": "I have a few models that need to have custom find conditions placed on them. For example, if I have a Contact model, every time Contact.find is called, I want to restrict the contacts returned that only belong to the Account in use.\nI found this via Google (which I've customiz... |
Is there a good Eclipse plugin for recording and playing back macros?
I've tried this one, but it didn't do me any good- it seemed like it wasn't ready for prime time.
I know about editor templates, but I'm looking for something that I can use to record my keystrokes and then apply multiple times against a wad of text.... | Eclipse does not come with built-in macro recording functionality as seen in some other IDEs or editors. However, there are a few options you could consider for achieving similar results:
1. **Eclipse Macros Plugin**: While you mentioned you’ve tried a macro plugin that didn’t work for you, there are other macro plugi... | 14,325 | [
{
"from": "human",
"value": "Is there a good Eclipse plugin for recording and playing back macros?\nI've tried this one, but it didn't do me any good- it seemed like it wasn't ready for prime time.\nI know about editor templates, but I'm looking for something that I can use to record my keystrokes and then ... |
I'm planning to create a data structure optimized to hold assembly code. That way I can be totally responsible for the optimization algorithms that will be working on this structure. If I can compile while running. It will be kind of dynamic execution. Is this possible? Have any one seen something like this?
Should I u... | Creating a data structure optimized to hold assembly code and enabling dynamic execution is indeed possible. Here’s a breakdown of how you might approach this, along with answers to your specific questions.
### Data Structure
Your idea of using a struct to represent assembly instructions is a reasonable starting poin... | 9,056 | [
{
"from": "human",
"value": "I'm planning to create a data structure optimized to hold assembly code. That way I can be totally responsible for the optimization algorithms that will be working on this structure. If I can compile while running. It will be kind of dynamic execution. Is this possible? Have any... |
I attended a job fair yesterday and a developer asked me how I would rank my proficiency in C. I then realized that this is incredibly arbitrary and almost impossible to nail down, so my question is what knowledge makes you an expert in programming C?
Edit: or what would the breakdown be? what makes you good, decent, ... | Ranking proficiency in C programming can indeed be subjective, but it's a good idea to break it down into specific skills and experiences that contribute to different levels of expertise. Here’s a more detailed breakdown of skills and knowledge that can help you assess your proficiency in C, ranging from beginner to ex... | 8,497 | [
{
"from": "human",
"value": "I attended a job fair yesterday and a developer asked me how I would rank my proficiency in C. I then realized that this is incredibly arbitrary and almost impossible to nail down, so my question is what knowledge makes you an expert in programming C?\nEdit: or what would the b... |
I'm duty-bound by policy to use CVS in this certain project, so even though I'd really to switch to something else, like Git, I cannot.
So, my real question goes like this: We have a convention that we create a new branch in CVS every time we make a release (we also tag, but that is besides the point). We call these ve... | Using feature branches in CVS is definitely feasible, but it comes with its own set of challenges and trade-offs, especially compared to using a more modern version control system like Git. Here are some points to consider when deciding whether to implement feature branches in CVS or to code directly in the HEAD branch... | 12,111 | [
{
"from": "human",
"value": "I'm duty-bound by policy to use CVS in this certain project, so even though I'd really to switch to something else, like Git, I cannot.\nSo, my real question goes like this: We have a convention that we create a new branch in CVS every time we make a release (we also tag, but th... |
What's the best tool that you use to monitor Web Service, SOAP, WCF, etc. traffic that's coming and going on the wire? I have seen some tools that made with Java but they seem to be a little crappy. What I want is a tool that sits in the middle as a proxy and does port redirection (which should have configurable listen... | There are several tools that can act as a proxy for monitoring web service traffic, including SOAP and WCF, on Windows. Here are some of the most popular options:
1. **Fiddler**: Fiddler is a free web debugging proxy that can capture HTTP and HTTPS traffic between your computer and the internet. It can inspect traffic... | 12,773 | [
{
"from": "human",
"value": "What's the best tool that you use to monitor Web Service, SOAP, WCF, etc. traffic that's coming and going on the wire? I have seen some tools that made with Java but they seem to be a little crappy. What I want is a tool that sits in the middle as a proxy and does port redirecti... |
For PHP, what is the default time after which an HTTP request is deemed to have timed out?
I'm using the PECL HTTP extension to make HTTP requests. I can set a timeout limit when making a request, however I'd like to know what the default is if nothing is explicitly specified.
I've hunted through the PHP manual to no ... | The default timeout for HTTP requests in the PECL HTTP extension does not seem to be explicitly documented in the PHP manual or the official PECL documentation. However, the behavior of timeouts can depend on the underlying cURL settings since the PECL HTTP extension builds on top of cURL.
As of the time when I was tr... | 14,555 | [
{
"from": "human",
"value": "For PHP, what is the default time after which an HTTP request is deemed to have timed out? \nI'm using the PECL HTTP extension to make HTTP requests. I can set a timeout limit when making a request, however I'd like to know what the default is if nothing is explicitly specified.... |
In Firefox I can get the stack trace of an exception by using exception.stack.
Is there a way to get that in other browsers, too?
Edit: I actually want to save the stack trace automatically (if possible) and not debug it at the time (i.e. I know how to get the stack trace in a debugger).
| Yes, you can obtain a stack trace of an exception in most modern browsers, not just Firefox. The `Error` object in JavaScript provides a straightforward way to capture a stack trace. Here’s how you can do it programmatically:
### Capturing Stack Trace
To capture the stack trace of an exception and save it, you can cr... | 15,075 | [
{
"from": "human",
"value": "In Firefox I can get the stack trace of an exception by using exception.stack.\nIs there a way to get that in other browsers, too?\nEdit: I actually want to save the stack trace automatically (if possible) and not debug it at the time (i.e. I know how to get the stack trace in a... |
I have a class that defines the names of various constants, e.g.
class Constants {
public static final String ATTR_CURRENT_USER = "current.user";
}
I would like to use these constants within a JSP without using Scriptlet code such as:
<%@ page import="com.example.Constants" %>
<%= Constants.ATTR_CURRENT_USER %>
T... | In JSP, using scriptlets is generally discouraged because it mixes Java code with HTML, making it harder to maintain. Instead, you can use custom tags or JSP Expression Language (EL) to achieve similar functionality in a cleaner way.
### 1. Using a Custom Tag Library
If you're looking for a way to access your constan... | 10,234 | [
{
"from": "human",
"value": "I have a class that defines the names of various constants, e.g.\nclass Constants {\n public static final String ATTR_CURRENT_USER = \"current.user\";\n}\n\nI would like to use these constants within a JSP without using Scriptlet code such as:\n<%@ page import=\"com.example.C... |
In MSVC, DebugBreak() or __debugbreak cause a debugger to break. On x86 it is equivalent to writing "_asm int 3", on x64 it is something different. When compiling with gcc (or any other standard compiler) I want to do a break into debugger, too. Is there a platform independent function or intrinsic? I saw the XCode que... | To implement a platform-independent debug break in your code, you can use compiler-specific built-ins or standard libraries that handle such breaks. Here’s how you can achieve this for both GCC and MSVC while also keeping in mind other compilers.
### Using Compiler Specific Intrinsics
1. **For MSVC**: You can use `__... | 15,027 | [
{
"from": "human",
"value": "In MSVC, DebugBreak() or __debugbreak cause a debugger to break. On x86 it is equivalent to writing \"_asm int 3\", on x64 it is something different. When compiling with gcc (or any other standard compiler) I want to do a break into debugger, too. Is there a platform independent... |
Which are the events of an ASP .Net server control and how does their order relate to the containing page's events?
The concrete problem is that I am looking for an event inside the server control that fires before the Page_Load event of the containing page.
| In ASP.NET, server controls have a specific life cycle with a sequence of events that occur during the page processing. Understanding the order of these events is crucial for effectively managing data and behaviors within your server control, especially when you need to ensure that certain actions occur before the `Pag... | 11,017 | [
{
"from": "human",
"value": "Which are the events of an ASP .Net server control and how does their order relate to the containing page's events?\nThe concrete problem is that I am looking for an event inside the server control that fires before the Page_Load event of the containing page.\n"
},
{
"fr... |
I want to use the macports version of python instead of the one that comes with Leopard.
| To use the MacPorts version of Python instead of the default version that comes with Mac OS X Leopard (10.5), follow these steps:
### Step 1: Install MacPorts
1. **Download and install MacPorts** from the official website: [MacPorts Installation](https://www.macports.org/install.php).
- Make sure to download the co... | 12,671 | [
{
"from": "human",
"value": "I want to use the macports version of python instead of the one that comes with Leopard.\n"
},
{
"from": "gpt",
"value": "To use the MacPorts version of Python instead of the default version that comes with Mac OS X Leopard (10.5), follow these steps:\n\n### Step 1: ... |
How can I get LWP to verify that the certificate of the server I'm connecting to is signed by a trusted authority and issued to the correct host? As far as I can tell, it doesn't even check that the certificate claims to be for the hostname I'm connecting to. That seems like a major security hole (especially with the... | It sounds like you're navigating some of the complexities involved in ensuring secure connections with LWP (Library for WWW in Perl), particularly with regard to SSL/TLS certificate verification. To ensure that the certificate presented by the server is trusted and that the hostname matches, you should use a combinatio... | 13,581 | [
{
"from": "human",
"value": "How can I get LWP to verify that the certificate of the server I'm connecting to is signed by a trusted authority and issued to the correct host? As far as I can tell, it doesn't even check that the certificate claims to be for the hostname I'm connecting to. That seems like a... |
I'm having an unusual problem with an IE document with contentEditable set to true. Calling select() on a range that is positioned at the end of a text node that immediately precedes a block element causes the selection to be shifted to the right one character and appear where it shouldn't. I've submitted a bug to Mi... | The issue you're experiencing with Internet Explorer (IE) and `contentEditable` is a known quirk, particularly with the way selections behave near block elements. The shift in selection when restoring it is likely caused by how IE handles ranges and selection in editable content, especially at boundaries between text n... | 13,323 | [
{
"from": "human",
"value": "I'm having an unusual problem with an IE document with contentEditable set to true. Calling select() on a range that is positioned at the end of a text node that immediately precedes a block element causes the selection to be shifted to the right one character and appear where ... |
I have a class that I wish to expose as a remote service using pythons SimpleXMLRPCServer. The server startup looks like this:
server = SimpleXMLRPCServer((serverSettings.LISTEN_IP,serverSettings.LISTEN_PORT))
service = Service()
server.register_instance(service)
server.serve_forever()
I then have a ServiceRemote cl... | It's great to hear that you've made progress on your implementation! To summarize and clarify your situation for future reference:
1. **XML-RPC and Variable Arguments**: The `xmlrpc.client` (formerly `xmlrpclib` in Python 2) module doesn't directly support passing keyword arguments as part of remote calls. This is bec... | 12,489 | [
{
"from": "human",
"value": "I have a class that I wish to expose as a remote service using pythons SimpleXMLRPCServer. The server startup looks like this:\nserver = SimpleXMLRPCServer((serverSettings.LISTEN_IP,serverSettings.LISTEN_PORT))\n\nservice = Service()\n\nserver.register_instance(service)\nserver.... |
Is there a way to add assembly attributes to a Managed C++ assembly? In a typical C# project, there is usually a line of code in the AssemblyInfo.cs file like the following one:
[assembly: AssemblyTitle("Some Assembly")]
I have a private assembly attribute that I want to add (not one of the version attributes that coul... | In Managed C++, you can indeed add assembly attributes similarly to how you would in a C# project, but the syntax is slightly different since Managed C++ uses a different form for defining attributes.
In Managed C++, you would typically use the `#pragma managed` directive to define managed code, and you can use `Assem... | 14,155 | [
{
"from": "human",
"value": "Is there a way to add assembly attributes to a Managed C++ assembly? In a typical C# project, there is usually a line of code in the AssemblyInfo.cs file like the following one:\n[assembly: AssemblyTitle(\"Some Assembly\")]\nI have a private assembly attribute that I want to add... |
Tools like 'ps' and 'top' report various kinds of memory usages, such as the VM size and the Resident Set Size. However, none of those are the "real" memory usage:
Program code is shared between multiple instances of the same program.
Shared library program code is shared between all processes that use that library.
S... | Both FreeBSD and macOS (formerly OS X) provide tools and ways to analyze memory usage, but they may not have a direct equivalent to the Linux `/proc/<pid>/smaps` file that provides detailed per-process memory usage information, including the concept of Private Dirty RSS. However, both operating systems offer their own ... | 11,066 | [
{
"from": "human",
"value": "Tools like 'ps' and 'top' report various kinds of memory usages, such as the VM size and the Resident Set Size. However, none of those are the \"real\" memory usage:\n\nProgram code is shared between multiple instances of the same program.\nShared library program code is shared ... |
Given the email address: "Jim" <jim@example.com>
If I try to pass this to MailAddress I get the exception:
The specified string is not in the form required for an e-mail address.
How do I parse this address into a display name (Jim) and email address (jim@example.com) in C#?
EDIT: I'm looking for C# code to parse it... | To parse an email address string like `"Jim" <jim@example.com>` into a display name and email address in C#, you can use regular expressions. Here’s a simple example to achieve that:
```csharp
using System;
using System.Text.RegularExpressions;
class Program
{
static void Main()
{
string input = "\"Ji... | 14,821 | [
{
"from": "human",
"value": "Given the email address: \"Jim\" <jim@example.com>\nIf I try to pass this to MailAddress I get the exception:\n\nThe specified string is not in the form required for an e-mail address.\n\nHow do I parse this address into a display name (Jim) and email address (jim@example.com) i... |
Is it possible to call a COM API from Java (specifically the HP/Mercury Quality Center OTA API)? If so, what's the best way?
Is something like JACOB appropriate?
Code fragments would be helpful for the basics :-)
| Yes, it is possible to call a COM API from Java, including the HP/Mercury Quality Center OTA API. One of the popular ways to achieve this is by using JACOB (Java COM Bridge), which provides a way for Java applications to interact with COM automation objects.
### Steps to Use JACOB
1. **Download JACOB**:
- Go to t... | 11,354 | [
{
"from": "human",
"value": "Is it possible to call a COM API from Java (specifically the HP/Mercury Quality Center OTA API)? If so, what's the best way?\nIs something like JACOB appropriate?\nCode fragments would be helpful for the basics :-)\n"
},
{
"from": "gpt",
"value": "Yes, it is possible... |
Is the D language a credible alternative to Java and C++? What will it take to become a credible alternative? Should I bother learning it? Does it deserve evangelizing?
The main reason I ask is that with the new C++ standard (c++0x) almost here, it's clear to me that the language has gone well past the point of no retu... | The D programming language is indeed an interesting alternative to Java and C++, and it comes with several features that appeal to developers looking for modern language constructs while maintaining performance characteristics similar to C and C++. Here are some points to consider about D as a credible alternative:
##... | 12,644 | [
{
"from": "human",
"value": "Is the D language a credible alternative to Java and C++? What will it take to become a credible alternative? Should I bother learning it? Does it deserve evangelizing?\nThe main reason I ask is that with the new C++ standard (c++0x) almost here, it's clear to me that the langua... |
I am looking for a PHP blog engine which needs to be easy to redesign (CSS, HTML). It also needs to be free and have simple user interface so that the client doesn't struggle to add posts. Any suggestions?
| There are several free PHP blog engines that meet your criteria for being easy to redesign and user-friendly for clients. Here are a few recommendations:
1. **WordPress**:
- **Overview**: WordPress is the most popular blogging platform, and it is highly customizable with a vast ecosystem of themes and plugins.
-... | 9,346 | [
{
"from": "human",
"value": "I am looking for a PHP blog engine which needs to be easy to redesign (CSS, HTML). It also needs to be free and have simple user interface so that the client doesn't struggle to add posts. Any suggestions?\n"
},
{
"from": "gpt",
"value": "There are several free PHP b... |
Under what circumstances will the Win32 API function OleGetClipboard() fail and return CLIPBRD_E_CANT_OPEN?
More background: I am assisting with a Firefox bug fix. Details here:
bug 444800 - cannot retrieve image data from clipboard in lossless format
In the automated test that I helped write, we see that OleGetClipb... | The `OleGetClipboard()` function can return the `CLIPBRD_E_CANT_OPEN` error code under several specific conditions, primarily related to issues accessing the clipboard or problems with the underlying clipboard data. Here are some common circumstances that can cause this error:
1. **Clipboard Accessibility Issues**: Th... | 14,147 | [
{
"from": "human",
"value": "Under what circumstances will the Win32 API function OleGetClipboard() fail and return CLIPBRD_E_CANT_OPEN?\nMore background: I am assisting with a Firefox bug fix. Details here:\nbug 444800 - cannot retrieve image data from clipboard in lossless format\nIn the automated test ... |
Is there a way to use constants in JavaScript?
If not, what's the common practice for specifying variables that are used as constants?
| Yes, JavaScript provides a way to define constants using the `const` keyword. When you declare a variable with `const`, its value cannot be reassigned later in the code. However, it's important to note that while the variable itself cannot be reassigned, if the constant refers to an object or array, the contents of tha... | 13,634 | [
{
"from": "human",
"value": "Is there a way to use constants in JavaScript?\nIf not, what's the common practice for specifying variables that are used as constants?\n"
},
{
"from": "gpt",
"value": "Yes, JavaScript provides a way to define constants using the `const` keyword. When you declare a v... |
We have a set of nightly builds that build of full suite of software using Embedded Visual C++ batch files. There is probably a total of 30 builds that are done. Every night at least one or two builds fail with something like the following error:
c:\lc\trunk\server\can\svcangettracedrivelength.cpp(11) : fatal error ... | The error message you're encountering suggests that the build process is having trouble accessing or creating precompiled header (PCH) files due to permission issues. This can be a common issue in environments where multiple builds occur simultaneously or where file locks may not be released properly. Here are several ... | 12,245 | [
{
"from": "human",
"value": "We have a set of nightly builds that build of full suite of software using Embedded Visual C++ batch files. There is probably a total of 30 builds that are done. Every night at least one or two builds fail with something like the following error:\n\nc:\\lc\\trunk\\server\\can\... |
I recently installed vim-enhanced , but I can't find any article/tutorial related to it.All I could find is a page that briefly describes it's new features , along with several RPM's to download .
What exactly does it have to offer to scripting languages that regular vi/vim can't ?
Thanks
| `vim-enhanced` is a package that provides a more feature-rich version of Vim compared to the basic version often included in minimal installations. While the standard `vi` or even basic `vim` (sometimes referred to as `vim-tiny` in certain distributions) comes with limited functionality, `vim-enhanced` includes a broad... | 14,195 | [
{
"from": "human",
"value": "I recently installed vim-enhanced , but I can't find any article/tutorial related to it.All I could find is a page that briefly describes it's new features , along with several RPM's to download . \nWhat exactly does it have to offer to scripting languages that regular vi/vim ca... |
I'd like to know if it's possible to capture the text when a user right-click's on an Outlook message, and then add items to the right-click menu depending on the type of text.
This is an example of what I'd like to do. If there's a message (mail item) with the following content: "Hello, please call me at 555-8474 re... | Adding custom items to the right-click context menu in Outlook 2003 using VBA is quite limited, especially when dealing with dynamic content like the specific text the user right-clicks on. However, you can extend the right-click menu and add custom commands, although this approach will be more static than dynamic.
He... | 10,561 | [
{
"from": "human",
"value": "I'd like to know if it's possible to capture the text when a user right-click's on an Outlook message, and then add items to the right-click menu depending on the type of text.\nThis is an example of what I'd like to do. If there's a message (mail item) with the following conte... |
How have you tweaked the MATLAB environment to better suit your needs? One tweak per answer.
| One useful tweak in the MATLAB environment is customizing the MATLAB Editor by setting up custom keyboard shortcuts. This can significantly improve productivity by allowing quicker access to frequently used functions and commands. You can define shortcuts for actions like running a script, commenting/uncommenting lines... | 17,471 | [
{
"from": "human",
"value": "How have you tweaked the MATLAB environment to better suit your needs? One tweak per answer.\n"
},
{
"from": "gpt",
"value": "One useful tweak in the MATLAB environment is customizing the MATLAB Editor by setting up custom keyboard shortcuts. This can significantly ... |
If I don't know the length of a text entry (e.g. a blog post, description or other long text), what's the best way to store it in MYSQL?
| When you're dealing with long text entries in MySQL and you do not know the length in advance, the best approach is to use the `TEXT` or `LONGTEXT` data types. Here’s a brief overview of the options:
1. **TEXT**:
- Stores up to 65,535 bytes (approximately 64 KB).
- Suitable for medium-length text entries, such a... | 13,027 | [
{
"from": "human",
"value": "If I don't know the length of a text entry (e.g. a blog post, description or other long text), what's the best way to store it in MYSQL?\n"
},
{
"from": "gpt",
"value": "When you're dealing with long text entries in MySQL and you do not know the length in advance, th... |
We have recently moved back to InstallShield 2008 from rolling our own install. So, I am still trying to get up the learning curve on it.
We are using Firebird and a usb driver, that we couldn't find good msi install solutions. So, we have a cmd line to install firebird silently and the usb driver mostly silently.
We ... | In InstallShield, when working with event handlers, it’s crucial to determine the context (install vs uninstall) to prevent unintended actions, such as re-launching an installer during an uninstall. The `DefaultFeatureInstalled` event is triggered during both install and uninstall scenarios, which is why you're experie... | 14,289 | [
{
"from": "human",
"value": "We have recently moved back to InstallShield 2008 from rolling our own install. So, I am still trying to get up the learning curve on it. \nWe are using Firebird and a usb driver, that we couldn't find good msi install solutions. So, we have a cmd line to install firebird silent... |
At the moment, I am doing a number of searches which include "html" in them, for example "html rearrange". Unfortunately, I get a lot of hits from sites that include "rearrange" on a .html page but have no mention of html in the page itself.
Is there a way to prevent search terms from matching urls?
| Yes, you can modify your search queries to reduce the number of results where the search terms match the URL rather than the content of the page. Here are a few strategies you can use:
1. **Use Quotation Marks**: Enclose your search terms in quotation marks to force the search engine to look for the exact phrase. For ... | 14,244 | [
{
"from": "human",
"value": "At the moment, I am doing a number of searches which include \"html\" in them, for example \"html rearrange\". Unfortunately, I get a lot of hits from sites that include \"rearrange\" on a .html page but have no mention of html in the page itself.\nIs there a way to prevent sea... |
We have a number of web-apps running on IIS 6 in a cluster of machines. One of those machines is also a state server for the cluster. We do not use sticky IP's.
When we need to take down the state server machine this requires the entire cluster to be offline for a few minutes while it's switched from one machine to ano... | Switching a state server from one machine to another with zero downtime can be challenging, especially in a web application cluster like yours running on IIS 6. Here are some strategies you can consider to achieve this:
### 1. Use a Distributed Cache or State Management Solution
Instead of relying on a single state se... | 13,623 | [
{
"from": "human",
"value": "We have a number of web-apps running on IIS 6 in a cluster of machines. One of those machines is also a state server for the cluster. We do not use sticky IP's.\nWhen we need to take down the state server machine this requires the entire cluster to be offline for a few minutes w... |
The official J2ME implementation of Hessian seems to have serious limitations : complex objects are not supported. This limitation is not mentioned anywhere on the online documentation, but if you google "hessian j2me" you will find posts about this problem. No solutions found with google though.
Does anyone have a so... | The limitations of the official J2ME implementation of Hessian can indeed be a challenge, especially when dealing with complex objects. Unfortunately, J2ME is a constrained environment, and some libraries may not have the full capabilities found in their more modern counterparts.
If you're looking for an alternative s... | 12,657 | [
{
"from": "human",
"value": "The official J2ME implementation of Hessian seems to have serious limitations : complex objects are not supported. This limitation is not mentioned anywhere on the online documentation, but if you google \"hessian j2me\" you will find posts about this problem. No solutions found... |
Is there any good reason to use C strings in C++ nowadays? My textbook uses them in examples at some points, and I really feel like it would be easier just to use a std::string.
| In modern C++ programming, using `std::string` is generally preferred over C-style strings (i.e., null-terminated character arrays) for a variety of reasons. However, there are some contexts where C strings may still be relevant. Here's a breakdown of the advantages and disadvantages of both, as well as when you might ... | 10,729 | [
{
"from": "human",
"value": "Is there any good reason to use C strings in C++ nowadays? My textbook uses them in examples at some points, and I really feel like it would be easier just to use a std::string.\n"
},
{
"from": "gpt",
"value": "In modern C++ programming, using `std::string` is gener... |
I've got an angry boss that will beat me down if I waste another day on this :-P Many karma points to the ajax guru who can solve my dilemma.
But more detail: I want to have an AccordionPane that grabs a bunch of links from an XML source and populate itself from said source.
| Sure! Let's tackle this step by step. We will use AJAX to fetch XML data, parse it, and then populate an AccordionPane with that data. I'll assume you're working with jQuery, as it's a common choice for AJAX calls and manipulating the DOM.
### Steps to Create an AccordionPane from XML:
1. **Set Up the HTML Structure... | 10,929 | [
{
"from": "human",
"value": "I've got an angry boss that will beat me down if I waste another day on this :-P Many karma points to the ajax guru who can solve my dilemma.\nBut more detail: I want to have an AccordionPane that grabs a bunch of links from an XML source and populate itself from said source.\n... |
On my rails app I have a list of items (like a task list) and for each item there is a couple of check box to set parameters.
When I submit the form, the checked box are stored as zero and the unchecked as null on DB.
the question is: Is there a way to configure it? To store the data on a more traditional 0 or 1, beca... | Yes, you can certainly configure your Rails application to store boolean values in a more traditional way (using `1` for `true` and `0` for `false`) in your database instead of using `null` and `0`. You can achieve this in a few ways:
### 1. Database Migration
First, make sure that your database schema for the checkb... | 10,370 | [
{
"from": "human",
"value": "On my rails app I have a list of items (like a task list) and for each item there is a couple of check box to set parameters.\nWhen I submit the form, the checked box are stored as zero and the unchecked as null on DB. \nthe question is: Is there a way to configure it? To store ... |
Does Apple's Xcode development environment provide any tools for memory leak detection?
I am especially interested in tools that apply to the iPhone SDK. Currently my favourite platform for hobby programming projects
Documentations/tutorials for said tools would be very helpful.
| Yes, Apple's Xcode development environment includes several tools for detecting memory leaks, which are essential for developing apps on the iPhone SDK. Here are the primary tools and features you can use within Xcode to detect and diagnose memory leaks:
### 1. **Xcode Instruments (Leaks Instrument)**
Instruments is a... | 12,236 | [
{
"from": "human",
"value": "Does Apple's Xcode development environment provide any tools for memory leak detection?\nI am especially interested in tools that apply to the iPhone SDK. Currently my favourite platform for hobby programming projects\nDocumentations/tutorials for said tools would be very helpfu... |
Continuing from my previous question, is there a comprehensive document that lists all available differences between debug and release modes in a C# application, and particularly in a web application?
What differences are there?
| In C#, the differences between Debug and Release modes can significantly impact the behavior and performance of your application. While there may not be a single comprehensive document that encapsulates all of the differences, I can summarize the key distinctions that typically apply, particularly in the context of a w... | 9,643 | [
{
"from": "human",
"value": "Continuing from my previous question, is there a comprehensive document that lists all available differences between debug and release modes in a C# application, and particularly in a web application?\nWhat differences are there?\n"
},
{
"from": "gpt",
"value": "In C... |
I'm having a problem writing Norwegian characters into an XML file using C#. I have a string variable containing some Norwegian text (with letters like æøå).
I'm writing the XML using an XmlTextWriter, writing the contents to a MemoryStream like this:
MemoryStream stream = new MemoryStream();
XmlTextWriter xmlTextWrit... | The issue you're experiencing stems from a mismatch in the character encoding when you write your Norwegian text. Specifically, you're using `ISO-8859-1`, which cannot represent all Norwegian characters (like `æ`, `ø`, `å`). Instead, you should use `UTF-8`, which can represent all Unicode characters, including the Norw... | 12,088 | [
{
"from": "human",
"value": "I'm having a problem writing Norwegian characters into an XML file using C#. I have a string variable containing some Norwegian text (with letters like æøå). \nI'm writing the XML using an XmlTextWriter, writing the contents to a MemoryStream like this:\nMemoryStream stream = ne... |
I encountered the following ddl in a pl/sql script this morning:
create index genuser.idx$$_0bdd0011
...
My initial thought was that the index name was generated by a tool...but I'm also not a pl/sql superstar so I could very well be incorrect. Does the double dollar sign have any special significance in this statement... | In Oracle databases, the presence of a double dollar sign (`$$`) in an identifier, such as an index name, often indicates that the name was automatically generated by Oracle or a specific tool.
In this context, the double dollar sign does not have a special meaning in the way that it might in some programming languag... | 15,949 | [
{
"from": "human",
"value": "I encountered the following ddl in a pl/sql script this morning:\ncreate index genuser.idx$$_0bdd0011\n...\nMy initial thought was that the index name was generated by a tool...but I'm also not a pl/sql superstar so I could very well be incorrect. Does the double dollar sign hav... |
How do you convert between hexadecimal numbers and decimal numbers in C#?
| In C#, you can convert between hexadecimal numbers and decimal numbers using built-in methods provided by the `Convert` class and by parsing strings. Here's how you can do both conversions:
### Converting Hexadecimal to Decimal
To convert a hexadecimal string to a decimal integer, you can use the `Convert.ToInt32` me... | 13,135 | [
{
"from": "human",
"value": "How do you convert between hexadecimal numbers and decimal numbers in C#?\n"
},
{
"from": "gpt",
"value": "In C#, you can convert between hexadecimal numbers and decimal numbers using built-in methods provided by the `Convert` class and by parsing strings. Here's how... |
I have a MemoryStream with the contents of a Font File (.ttf) and I would like to be able to create a FontFamily WPF object from that stream WITHOUT writing the contents of the stream to disk. I know this is possible with a System.Drawing.FontFamily but I cannot find out how to do it with System.Windows.Media.FontFamil... | In WPF, you can create a `FontFamily` object from a TrueType font (TTF) file that you have in a `MemoryStream`, but the process involves a bit of trickery since the `FontFamily` class does not natively support loading from a stream directly.
You can achieve this by utilizing the `PrivateFontCollection` from `System.D... | 11,953 | [
{
"from": "human",
"value": "I have a MemoryStream with the contents of a Font File (.ttf) and I would like to be able to create a FontFamily WPF object from that stream WITHOUT writing the contents of the stream to disk. I know this is possible with a System.Drawing.FontFamily but I cannot find out how to ... |
Looking for a good rss/feed reader for windows or if there are any good cross platforms one i would be really amazed, or good web services (dont like the google one).
I want something simplistic and minimalistic.
| Here are some RSS/feed readers for Windows, as well as cross-platform options and web services that are simple and minimalistic:
### Windows RSS/Feed Readers
1. **FeedDemon**: A classic RSS reader for Windows that combines a clean interface with powerful features, such as keyword monitoring and article organization.
... | 13,557 | [
{
"from": "human",
"value": "Looking for a good rss/feed reader for windows or if there are any good cross platforms one i would be really amazed, or good web services (dont like the google one).\nI want something simplistic and minimalistic.\n"
},
{
"from": "gpt",
"value": "Here are some RSS/fe... |
I've had a new found interest in building a small, efficient web server in C and have had some trouble parsing POST methods from the HTTP Header. Would anyone have any advice as to how to handle retrieving the name/value pairs from the "posted" data?
POST /test HTTP/1.1
Host: test-domain.com:7017
User-Agent: Mozilla/5.... | Parsing the POST data from an HTTP request in C can indeed be a bit tricky, especially if you want a flexible solution that works under varying circumstances. Below is a step-by-step approach for parsing the POST data from an HTTP request, along with some example code snippets to help you get started.
### Steps for Pa... | 9,237 | [
{
"from": "human",
"value": "I've had a new found interest in building a small, efficient web server in C and have had some trouble parsing POST methods from the HTTP Header. Would anyone have any advice as to how to handle retrieving the name/value pairs from the \"posted\" data?\nPOST /test HTTP/1.1\nHost... |
Is it possible to use an ASP.NET web.sitemap with a jQuery Superfish menu?
If not, are there any standards based browser agnostic plugins available that work with the web.sitemap file?
| Yes, it is possible to use an ASP.NET `web.sitemap` file with a jQuery Superfish menu, though it requires some additional work since Superfish does not natively understand the `web.sitemap` format.
### Steps to Implement a Superfish Menu with `web.sitemap`
1. **Generate the Menu Structure:**
You will first need t... | 8,382 | [
{
"from": "human",
"value": "Is it possible to use an ASP.NET web.sitemap with a jQuery Superfish menu? \nIf not, are there any standards based browser agnostic plugins available that work with the web.sitemap file?\n"
},
{
"from": "gpt",
"value": "Yes, it is possible to use an ASP.NET `web.sit... |
I have video durations stored in HH:MM:SS format. I'd like to display it as HH hours, MM minutes, SS seconds. It shouldn't display hours if it's less than 1.
What would be the best approach?
| To convert video durations stored in HH:MM:SS format to a more readable format (HH hours, MM minutes, SS seconds) while omitting hours if they're less than 1, you can use a programming approach. Here's a simple implementation in Python, but the logic can be adapted to any programming language.
### Python Code Example
... | 11,577 | [
{
"from": "human",
"value": "I have video durations stored in HH:MM:SS format. I'd like to display it as HH hours, MM minutes, SS seconds. It shouldn't display hours if it's less than 1.\nWhat would be the best approach?\n"
},
{
"from": "gpt",
"value": "To convert video durations stored in HH:MM... |
In a shellscript, I'd like to set the IP of my box, run a command, then move to the next IP. The IPs are an entire C block.
The question is how do I set the IP of the box without editing a file? What command sets the IP on Slackware?
Thanks
| On Slackware, you can set the IP address of your network interface using the `ifconfig` command or the `ip` command, depending on what is available in your environment. If you want to set the IP address without editing any configuration files, you can use either of the following commands.
### Using `ifconfig`:
Assumi... | 12,473 | [
{
"from": "human",
"value": "In a shellscript, I'd like to set the IP of my box, run a command, then move to the next IP. The IPs are an entire C block.\nThe question is how do I set the IP of the box without editing a file? What command sets the IP on Slackware?\nThanks\n"
},
{
"from": "gpt",
"... |
I'm making a study on refactoring limitations on improving existing software architecture and I would be interested to hear your experiences where you have found refactoring to be not enough or still too immature to accomplish your goals.
| Refactoring can be a powerful tool for improving software architecture, but there are several limitations and challenges that can make it insufficient for certain situations. Here are some key experiences and observations regarding those limitations:
1. **Legacy Code Complexity**: Refactoring often falls short when de... | 11,489 | [
{
"from": "human",
"value": "I'm making a study on refactoring limitations on improving existing software architecture and I would be interested to hear your experiences where you have found refactoring to be not enough or still too immature to accomplish your goals.\n"
},
{
"from": "gpt",
"valu... |
Rehsarper 4.0 - Renaming a class does not rename the file…
I probably set something on accident in the options, but I can't find it. Any ideas?
| In ReSharper, if renaming a class does not automatically rename the corresponding file, you may need to check a few settings. Here are steps to ensure that the renaming functionality is working as intended:
1. **Check ReSharper Options:**
- Go to `ReSharper` in the top menu.
- Select `Options`.
- In the optio... | 14,358 | [
{
"from": "human",
"value": "Rehsarper 4.0 - Renaming a class does not rename the file…\nI probably set something on accident in the options, but I can't find it. Any ideas?\n"
},
{
"from": "gpt",
"value": "In ReSharper, if renaming a class does not automatically rename the corresponding file, y... |
In Java, web apps are bundled in to WARs. By default, many servlet containers will use the WAR name as the context name for the application.
Thus myapp.war gets deployed to http://example.com/myapp.
The problem is that the webapp considers its "root" to be, well, "root", or simply "/", whereas HTML would consider the r... | Managing context paths in Java web applications can be tricky, but there are several strategies and best practices that developers can adopt to make handling URLs easier and more maintainable. Here are some techniques that can help mitigate the context path issue:
### 1. Use a Base URL Variable
You can define a base U... | 10,218 | [
{
"from": "human",
"value": "In Java, web apps are bundled in to WARs. By default, many servlet containers will use the WAR name as the context name for the application.\nThus myapp.war gets deployed to http://example.com/myapp.\nThe problem is that the webapp considers its \"root\" to be, well, \"root\", o... |
I'm using Castle Windsor for dependency injection in my test project. I'm trying to create an instance one of my 'Repository' classes. "It works fine on my machine", but when I run a nightly build in TFS, my tests are not able to load said classes.
private static readonly WindsorContainer _container = new WindsorContai... | Based on the information you provided, it sounds like your test project is unable to locate the `LALALALALA` class in the TFS build environment. Here are some steps you can take to diagnose and resolve the issue:
1. **Check Assembly References:**
Ensure that the assembly containing the `LALALALALA` class (`Example2... | 13,525 | [
{
"from": "human",
"value": "I'm using Castle Windsor for dependency injection in my test project. I'm trying to create an instance one of my 'Repository' classes. \"It works fine on my machine\", but when I run a nightly build in TFS, my tests are not able to load said classes.\nprivate static readonly Win... |
From my experience with OpenID, I see a number of significant downsides:
Adds a Single Point of Failure to the site
It is not a failure that can be fixed by the site even if detected. If the OpenID provider is down for three days, what recourse does the site have to allow its users to login and access the information ... | Making OpenID (or similar federated authentication systems) mandatory for a site can come with several benefits for both the site owner and its users, despite the downsides you've listed. Here are some reasons why a site might choose to implement OpenID as a mandatory login option:
1. **Reduced Password Management**: ... | 12,209 | [
{
"from": "human",
"value": "From my experience with OpenID, I see a number of significant downsides:\nAdds a Single Point of Failure to the site\nIt is not a failure that can be fixed by the site even if detected. If the OpenID provider is down for three days, what recourse does the site have to allow its... |
I have been given the task of implementing a login handler. The only detail the handler captures is username and password. Initially I was going to use a JSP that posted to a servlet. Where the servlet carried out a db lookup and also validated the user credentials. Upon successful login you are redirected but unsu... | Implementing a login handler in a web application can be accomplished in various ways, each with its own benefits and complexities. The two approaches you mentioned—using a traditional JSP/servlet approach and leveraging Java EE security features like `j_security_check` and JAAS (Java Authentication and Authorization S... | 12,537 | [
{
"from": "human",
"value": "I have been given the task of implementing a login handler. The only detail the handler captures is username and password. Initially I was going to use a JSP that posted to a servlet. Where the servlet carried out a db lookup and also validated the user credentials. Upon suc... |
I want to specify a small row height in a Reporting Services report of about 3pt. While the report looks ok in the previewer, once deployed, the row height resets to the standard row height.
I have adjusted the "CanGrow" and "CanShrink" settings as well as the padding, lineHeight, font size, etc...
| In SQL Server Reporting Services (SSRS), achieving a specific small row height can be tricky due to the rendering constraints and limitations of SSRS. Here are some steps you can take to try to enforce a smaller row height in your report:
1. **Set Row Height Explicitly**: In the properties for the table row, try setti... | 10,971 | [
{
"from": "human",
"value": "I want to specify a small row height in a Reporting Services report of about 3pt. While the report looks ok in the previewer, once deployed, the row height resets to the standard row height.\nI have adjusted the \"CanGrow\" and \"CanShrink\" settings as well as the padding, line... |
I have always used the agile Feature Driven Development process for developing software. What does everyone else use, and why do you prefer it? I prefer FDD because that's what I started with fresh out of college. In college, everything was very free-form and my "customer" was typically my professor, who might not h... | Feature Driven Development (FDD) is indeed a valuable agile methodology, especially for projects where clear and distinct features can be developed iteratively. However, different teams and organizations might gravitate towards various methodologies based on their unique needs, project types, team structures, and indus... | 12,938 | [
{
"from": "human",
"value": "I have always used the agile Feature Driven Development process for developing software. What does everyone else use, and why do you prefer it? I prefer FDD because that's what I started with fresh out of college. In college, everything was very free-form and my \"customer\" ... |
I have Laconica (self hosted twitter) configured on my local intranet and would like to integrate the public stream into SharePoint site with a web part. How can I do this?
| Integrating a public stream from Laconica (a self-hosted microblogging platform similar to Twitter) into a SharePoint site can be accomplished using a custom web part or by leveraging existing web part capabilities. Here's a general approach to doing so:
### Steps to Integrate Laconica Public Stream into SharePoint
1... | 8,197 | [
{
"from": "human",
"value": "I have Laconica (self hosted twitter) configured on my local intranet and would like to integrate the public stream into SharePoint site with a web part. How can I do this?\n"
},
{
"from": "gpt",
"value": "Integrating a public stream from Laconica (a self-hosted mic... |
I am releasing a database build to SQL Server 2000 via a batch file using isql. The batch file is used so multiple files are released consistently to different SQL Servers (development, test, live).
The SQL Server uses ANSI code page 1252 (from sp_helpsort) but isql is an OEM client using code page 437. This means that... | To ensure consistent handling of character encoding across different environments and users when running SQL scripts in SQL Server 2000 using a batch file, you can take the following approaches:
### 1. Use OSQL with Unicode Scripts
You can save your SQL scripts in Unicode format, which can correctly handle extended c... | 12,788 | [
{
"from": "human",
"value": "I am releasing a database build to SQL Server 2000 via a batch file using isql. The batch file is used so multiple files are released consistently to different SQL Servers (development, test, live).\nThe SQL Server uses ANSI code page 1252 (from sp_helpsort) but isql is an OEM c... |
With the recent buzz on multicore programming is anyone exploring the possibilities of using MPI ?
| Yes, there has been ongoing interest and exploration of using the Message Passing Interface (MPI) in multicore programming, especially as systems increasingly utilize multicore and manycore architectures. Here are a few key points about this trend:
1. **Scalability**: MPI is inherently designed for distributed computi... | 14,651 | [
{
"from": "human",
"value": "With the recent buzz on multicore programming is anyone exploring the possibilities of using MPI ?\n"
},
{
"from": "gpt",
"value": "Yes, there has been ongoing interest and exploration of using the Message Passing Interface (MPI) in multicore programming, especially ... |
I need to select a bunch of data into a temp table to then do some secondary calculations; To help make it work more efficiently, I would like to have an IDENTITY column on that table. I know I could declare the table first with an identity, then insert the rest of the data into it, but is there a way to do it in 1 st... | Yes, you can create a temporary table with an `IDENTITY` column and insert data into it in a single step by using the `SELECT INTO` statement combined with a `ROW_NUMBER()` function. Unfortunately, the `SELECT INTO` statement does not directly allow for the creation of an `IDENTITY` column, but you can achieve similar ... | 14,858 | [
{
"from": "human",
"value": "I need to select a bunch of data into a temp table to then do some secondary calculations; To help make it work more efficiently, I would like to have an IDENTITY column on that table. I know I could declare the table first with an identity, then insert the rest of the data int... |
I had a discussion a few weeks back with some co-workers on refactoring, and I seem to be in a minority that believes "Refactor early, refactor often" is a good approach that keeps code from getting messy and unmaintainable. A number of other people thought that it just belongs in the maintenance phases of a project.
I... | Your perspective of "Refactor early, refactor often" is indeed a strong one, and there are several reasons to support it:
1. **Code Quality**: Early and frequent refactoring promotes high code quality. By continually improving the codebase, you can catch and address technical debt before it accumulates to a point wher... | 13,693 | [
{
"from": "human",
"value": "I had a discussion a few weeks back with some co-workers on refactoring, and I seem to be in a minority that believes \"Refactor early, refactor often\" is a good approach that keeps code from getting messy and unmaintainable. A number of other people thought that it just belong... |
I have a ASP.Net website that is failing on AJAX postbacks (both with ASP.Net AJAX and a 3rd part control) in IE. FireFox works fine. If I install the website on another machine without .Net 3.5 SP1, it works as expected.
When it fails, Fiddler shows that I'm getting a 405 "Method Not Allowed". The form seems to b... | The issue you're experiencing with AJAX postbacks in your ASP.NET website on Internet Explorer after installing .NET 3.5 SP1 can stem from several factors. Here are some suggestions and troubleshooting steps you can follow to resolve the 405 "Method Not Allowed" error:
### 1. Check Web.config Settings
Make sure that y... | 13,667 | [
{
"from": "human",
"value": "I have a ASP.Net website that is failing on AJAX postbacks (both with ASP.Net AJAX and a 3rd part control) in IE. FireFox works fine. If I install the website on another machine without .Net 3.5 SP1, it works as expected.\nWhen it fails, Fiddler shows that I'm getting a 405 ... |
I'm writing a Delphi expert. I need to be able to write a value to a property on a property which is an object. E.g. I have a GroupBox on the form and I want to edit the Margins.Left property. I'm using the following procedure to do it but if gives an AV on the marked line.
The procedure takes a component from the (pro... | It looks like you're encountering an Access Violation (AV) error when trying to set a sub-property's value in your Delphi expert. This issue could arise due to several reasons, such as not correctly identifying the object or property types or even due to the way you're handling the property name parsing.
Here’s how yo... | 12,015 | [
{
"from": "human",
"value": "I'm writing a Delphi expert. I need to be able to write a value to a property on a property which is an object. E.g. I have a GroupBox on the form and I want to edit the Margins.Left property. I'm using the following procedure to do it but if gives an AV on the marked line.\nThe... |
I have a C# application that includes the following code:
string file = "relativePath.txt";
//Time elapses...
string contents = File.ReadAllText(file);
This works fine, most of the time. The file is read relative to the directory that the app was started from. However, in testing, it has been found that if left al... | The behavior you're experiencing suggests that the working directory of your application might be changing after a period of inactivity. This can occur if the application is invoked from a different context (like a scheduled task or a different user session), or if it interacts with other applications or services that ... | 13,746 | [
{
"from": "human",
"value": "I have a C# application that includes the following code:\nstring file = \"relativePath.txt\";\n\n//Time elapses...\n\nstring contents = File.ReadAllText(file);\n\nThis works fine, most of the time. The file is read relative to the directory that the app was started from. Howe... |
Is it possible to use BugzScout in the fogcreek-hosted version of Fogbugz?
| As of my last knowledge update in October 2023, BugzScout is an integrated bug tracking tool designed to work with FogBugz. However, the availability and functionality of BugzScout in the Fog Creek-hosted version of FogBugz may depend on the specific setup and configurations of the service at that time.
To find out if... | 17,367 | [
{
"from": "human",
"value": "Is it possible to use BugzScout in the fogcreek-hosted version of Fogbugz?\n"
},
{
"from": "gpt",
"value": "As of my last knowledge update in October 2023, BugzScout is an integrated bug tracking tool designed to work with FogBugz. However, the availability and funct... |
I'm trying to find a way to "pretty print" a JavaScript data structure in a human-readable form for debugging.
I have a rather big and complicated data structure being stored in JS and I need to write some code to manipulate it. In order to work out what I'm doing and where I'm going wrong, what I really need is to be ... | To "pretty print" a JavaScript data structure in a human-readable format, you can use the built-in `JSON.stringify()` method, which allows you to convert JavaScript objects into a JSON string. You can provide additional parameters to ensure that the output is formatted with indentation, which will make it easier to rea... | 13,644 | [
{
"from": "human",
"value": "I'm trying to find a way to \"pretty print\" a JavaScript data structure in a human-readable form for debugging.\nI have a rather big and complicated data structure being stored in JS and I need to write some code to manipulate it. In order to work out what I'm doing and where I... |
So I log into a Solaris box, try to start Apache, and find that there is already a process listening on port 80, and it's not Apache. Our boxes don't have lsof installed, so I can't query with that. I guess I could do:
pfiles `ls /proc` | less
and look for "port: 80", but if anyone has a better solution, I'm all ears!... | If you're looking to identify which process is listening on port 80 without root access and without using `lsof`, you can use a combination of the `pfiles` and `ps` commands in a shell script. While `pfiles` is indeed a viable option, it can be inefficient to query every single process.
Here's a shell script that will... | 10,359 | [
{
"from": "human",
"value": "So I log into a Solaris box, try to start Apache, and find that there is already a process listening on port 80, and it's not Apache. Our boxes don't have lsof installed, so I can't query with that. I guess I could do:\npfiles `ls /proc` | less\n\nand look for \"port: 80\", but ... |
We've developed a Java application and would like to use this application from a C# client. The application has dependencies on Spring, Log4j, ...
What would be the most efficient mechanism - make DLL(s) from Java code, ... - to achieve this ?
| To allow a C# client to interact with a Java application, you have several options. Each approach has its trade-offs, and the most efficient mechanism depends on your specific requirements, such as performance, ease of use, and complexity. Here are some common strategies:
### 1. **Java Native Interface (JNI) and C++ W... | 12,665 | [
{
"from": "human",
"value": "We've developed a Java application and would like to use this application from a C# client. The application has dependencies on Spring, Log4j, ... \nWhat would be the most efficient mechanism - make DLL(s) from Java code, ... - to achieve this ?\n"
},
{
"from": "gpt",
... |
In Java, say you have a class that wraps an ArrayList (or any collection) of objects.
How would you return one of those objects such that the caller will not see any future changes to the object made in the ArrayList?
i.e. you want to return a deep copy of the object, but you don't know if it is cloneable.
| To return a deep copy of an object from a class that wraps a collection, and ensure that the caller does not see any future changes made to the original object in the collection, you need to create a copy of the object. If the object is not cloneable and does not provide a copy constructor or a similar method, you will... | 8,807 | [
{
"from": "human",
"value": "In Java, say you have a class that wraps an ArrayList (or any collection) of objects. \nHow would you return one of those objects such that the caller will not see any future changes to the object made in the ArrayList? \ni.e. you want to return a deep copy of the object, but yo... |
Looking at the processmodel element in the Web.Config there are two attributes.
maxWorkerThreads="25"
maxIoThreads="25"
What is the difference between worker threads and I/O threads?
| In the context of ASP.NET applications and the configuration settings within the `processModel` element of the `Web.config` file, the `maxWorkerThreads` and `maxIoThreads` attributes define the maximum number of threads that the ASP.NET runtime can use for processing requests. Understanding the difference between worke... | 10,482 | [
{
"from": "human",
"value": "Looking at the processmodel element in the Web.Config there are two attributes.\nmaxWorkerThreads=\"25\" \nmaxIoThreads=\"25\"\n\nWhat is the difference between worker threads and I/O threads?\n"
},
{
"from": "gpt",
"value": "In the context of ASP.NET applications an... |
I would like to upgrade my team from VS2005 to VS2008 without touching the version of Team Server which is 2005.
Is that possible?
And if so, how do I tell VS to recognize TFS?
Currently in my VS2008 options menu, I don't have any source control to choose from.
| Yes, it is possible to upgrade your development environment from Visual Studio 2005 (VS2005) to Visual Studio 2008 (VS2008) while continuing to use Team Foundation Server (TFS) 2005. However, you'll need to ensure that your VS2008 installation is properly configured to work with TFS 2005.
Here’s how you can set up VS2... | 10,968 | [
{
"from": "human",
"value": "I would like to upgrade my team from VS2005 to VS2008 without touching the version of Team Server which is 2005. \nIs that possible? \nAnd if so, how do I tell VS to recognize TFS?\nCurrently in my VS2008 options menu, I don't have any source control to choose from.\n"
},
{
... |
What makes a language a scripting language? I've heard some people say "when it gets interpreted instead of compiled". That would make PHP (for example) a scripting language. Is that the only criterion? Or are there other criteria?
See also:
What’s the difference between a “script” and an “application”?
| The distinction between a scripting language and other types of programming languages is not solely about whether the code is interpreted or compiled, though that is a significant factor. Here are some key criteria that can help define what makes a language a scripting language:
### 1. **Interpretation vs. Compilation... | 10,633 | [
{
"from": "human",
"value": "What makes a language a scripting language? I've heard some people say \"when it gets interpreted instead of compiled\". That would make PHP (for example) a scripting language. Is that the only criterion? Or are there other criteria?\nSee also:\n\nWhat’s the difference between a... |
Are there any dictionary classes in the .NET base class library which allow duplicate keys to be used? The only solution I've found is to create, for example, a class like:
Dictionary<string, List<object>>
But this is quite irritating to actually use. In Java, I believe a MultiMap accomplishes this, but cannot find ... | In the .NET base class library, the standard `Dictionary<TKey, TValue>` does not allow duplicate keys. However, there are a few alternatives that you can consider if you want to associate multiple values with the same key.
### 1. `Lookup<TKey, TElement>`
The `Lookup<TKey, TElement>` class is an efficient way to repre... | 11,681 | [
{
"from": "human",
"value": "Are there any dictionary classes in the .NET base class library which allow duplicate keys to be used? The only solution I've found is to create, for example, a class like:\nDictionary<string, List<object>>\n\nBut this is quite irritating to actually use. In Java, I believe a ... |
I have a function in a native DLL defined as follows:
#include <string>
void SetPath(string path);
I tried to put this in Microsoft's P/Invoke Interop Assistant, but it chokes on the "string" class (which I think is from MFC?).
I have tried marshaling it as a variety of different types (C# String, char[], byte[]) but ... | To interoperate between C# and a native C++ DLL where the function signature uses `std::string`, you'll need to handle the string conversion since `std::string` is not directly compatible with any of the marshaled types that .NET provides.
### Options to Handle the Interoperability
#### 1. Modify the Native Function... | 14,010 | [
{
"from": "human",
"value": "I have a function in a native DLL defined as follows:\n#include <string>\nvoid SetPath(string path);\n\nI tried to put this in Microsoft's P/Invoke Interop Assistant, but it chokes on the \"string\" class (which I think is from MFC?).\nI have tried marshaling it as a variety of ... |
If I have no connection to internet, does that mean I can't start IDLE (which comes with python 3.0)?
| No, you do not need an internet connection to start IDLE, which is the Integrated Development and Learning Environment that comes with Python. Once Python is installed on your computer, IDLE is available as a part of that installation, and you can run it locally without needing to be connected to the internet.
To star... | 17,269 | [
{
"from": "human",
"value": "If I have no connection to internet, does that mean I can't start IDLE (which comes with python 3.0)?\n"
},
{
"from": "gpt",
"value": "No, you do not need an internet connection to start IDLE, which is the Integrated Development and Learning Environment that comes wi... |
I work for a small web development company (only 2 to 3 developers) that work on a wide range of projects for different customers (everything from CMS's to eCommerce sites).
Usually we work on our own projects but occasionally we need to work together on one. We use subversion as our source control software and sites ... | In a small web development team like yours, especially when working on projects with short development times and minimal maintenance needs, it's important to find a balance between best practices and practical constraints. Here are some considerations that might help guide your approach:
### 1. **Unit Testing**
- **Ne... | 11,817 | [
{
"from": "human",
"value": "I work for a small web development company (only 2 to 3 developers) that work on a wide range of projects for different customers (everything from CMS's to eCommerce sites). \nUsually we work on our own projects but occasionally we need to work together on one. We use subversion... |
There are a few web service frameworks available for Java: Axis2, CXF, JBossWS, and Metro. Does anyone have some good examples of a WS-Eventing client with these frameworks?
| WS-Eventing is a specification for enabling clients to subscribe to notifications from a web service. Here are examples of how to implement a WS-Eventing client using the frameworks you've mentioned: Axis2, CXF, JBossWS, and Metro.
### 1. Apache Axis2
Axis2 does not directly support WS-Eventing, but you can implemen... | 9,464 | [
{
"from": "human",
"value": "There are a few web service frameworks available for Java: Axis2, CXF, JBossWS, and Metro. Does anyone have some good examples of a WS-Eventing client with these frameworks?\n"
},
{
"from": "gpt",
"value": "WS-Eventing is a specification for enabling clients to subsc... |
In an OLAP database I work with there is a 'Location' hierarchy consisting of the levels Company, Region, Area, Site, Room, Till. For a particular company I need to write some MDX that lists all regions, areas and sites (but not any levels below Site). Currently I am achieving this with the following MDX
HIERARCHIZE({
... | Yes, you can simplify your MDX query to achieve the same result using the `Children` and `Descendants` functions in a more concise way. Instead of explicitly listing each level and using multiple commands, you can utilize the `Descendants` function to only retrieve the specified hierarchy levels you need.
Here's an al... | 15,283 | [
{
"from": "human",
"value": "In an OLAP database I work with there is a 'Location' hierarchy consisting of the levels Company, Region, Area, Site, Room, Till. For a particular company I need to write some MDX that lists all regions, areas and sites (but not any levels below Site). Currently I am achieving t... |
In Javascript, I have an object:
obj = { one: "foo", two: "bar" };
Now, I want do do this
var a = 'two';
if(confirm('Do you want One'))
{
a = 'one';
}
alert(obj.a);
But of course it doesn't work. What would be the correct way of referencing this object dynamically?
| In JavaScript, when you want to access an object's property dynamically using a variable, you need to use bracket notation instead of dot notation. In your case, instead of using `obj.a`, you should use `obj[a]`. Here's the corrected code:
```javascript
var obj = { one: "foo", two: "bar" };
var a = 'two';
if (confirm... | 17,645 | [
{
"from": "human",
"value": "In Javascript, I have an object:\nobj = { one: \"foo\", two: \"bar\" };\n\nNow, I want do do this\nvar a = 'two';\nif(confirm('Do you want One'))\n{\n a = 'one';\n}\n\nalert(obj.a);\n\nBut of course it doesn't work. What would be the correct way of referencing this object dyna... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.