instruction
stringlengths
14
27.6k
completion
stringlengths
3
38.3k
__original_row_idx
int64
0
50k
conversations
listlengths
2
2
What is the highest port number one can use?
The highest port number you can use in TCP/IP networking is 65535. Port numbers are 16-bit unsigned integers, which means they can range from 0 to 65535. However, ports 0 to 1023 are typically reserved for well-known services and protocols, while ports 1024 to 49151 are registered ports. The dynamic or private ports ra...
15,447
[ { "from": "human", "value": "What is the highest port number one can use?\n" }, { "from": "gpt", "value": "The highest port number you can use in TCP/IP networking is 65535. Port numbers are 16-bit unsigned integers, which means they can range from 0 to 65535. However, ports 0 to 1023 are typica...
I'm attempting to check for the existence of a node using the following .NET code: xmlDocument.SelectSingleNode( String.Format("//ErrorTable/ProjectName/text()='{0}'", projectName)); This always raises: XPathException: Expression must evaluate to a node-set. Why am I getting this error and how can I resolve...
The error you're encountering is due to the XPath expression you've constructed. The issue is with the use of the `text()` function and the way you're trying to compare the value. In XPath, when you use a comparison operator like `=`, you should not include the `text()` function for the specific value you're looking fo...
13,153
[ { "from": "human", "value": "I'm attempting to check for the existence of a node using the following .NET code:\nxmlDocument.SelectSingleNode(\n String.Format(\"//ErrorTable/ProjectName/text()='{0}'\", projectName));\n\nThis always raises:\n\nXPathException: Expression must evaluate to a node-set. \n...
I have a small server program that accepts connections on a TCP or local UNIX socket, reads a simple command and (depending on the command) sends a reply. The problem is that the client may have no interest in the answer and sometimes exits early. So writing to that socket will cause a SIGPIPE and make my server crash...
Handling SIGPIPE in your server application is a common concern, especially when dealing with TCP sockets where the client might disconnect unexpectedly. Here's how you can manage this situation effectively: ### Best Practices to Prevent SIGPIPE Crashes 1. **Set the Socket to Ignore SIGPIPE:** You can set the sock...
8,605
[ { "from": "human", "value": "I have a small server program that accepts connections on a TCP or local UNIX socket, reads a simple command and (depending on the command) sends a reply.\nThe problem is that the client may have no interest in the answer and sometimes exits early. So writing to that socket wil...
Is there a way to control the Fujitsu Softune debugger with an other application(e.g. Eclipse)? I think about sending the command mentioned in the documentation of Softune and parse the output, but also other approaches are welcome.
Controlling the Fujitsu Softune debugger from another application like Eclipse can be achieved through various methods, depending on the capabilities of the Softune debugger and the architecture of your setup. Here are a few approaches you might consider: ### 1. Command-Line Interface (CLI) If Softune supports a comma...
9,667
[ { "from": "human", "value": "Is there a way to control the Fujitsu Softune debugger with an other application(e.g. Eclipse)? I think about sending the command mentioned in the documentation of Softune and parse the output, but also other approaches are welcome.\n" }, { "from": "gpt", "value": "C...
Does any body know what powers Google Charts? I have been using it for a while but not sure what Google used to build it.
Google Charts is primarily powered by JavaScript and leverages various web technologies, including HTML and SVG (Scalable Vector Graphics), for rendering charts in the browser. It allows users to create interactive charts and visualizations without needing extensive knowledge of web development. Additionally, Google C...
15,146
[ { "from": "human", "value": "Does any body know what powers Google Charts? I have been using it for a while but not sure what Google used to build it. \n" }, { "from": "gpt", "value": "Google Charts is primarily powered by JavaScript and leverages various web technologies, including HTML and SVG...
What's the best way in c# to determine is a given QFE/patch has been installed?
To determine if a specific Quick Fix Engineering (QFE) patch or update is installed on a Windows system using C#, you can query the Windows Management Instrumentation (WMI) for installed hotfixes. You can also check the registry, but querying WMI is generally simpler and more reliable for this purpose. Here's a sample...
7,748
[ { "from": "human", "value": "What's the best way in c# to determine is a given QFE/patch has been installed?\n" }, { "from": "gpt", "value": "To determine if a specific Quick Fix Engineering (QFE) patch or update is installed on a Windows system using C#, you can query the Windows Management Ins...
I'd like to store a properties file as XML. Is there a way to sort the keys when doing this so that the generated XML file will be in alphabetical order? String propFile = "/path/to/file"; Properties props = new Properties(); /*set some properties here*/ try { FileOutputStream xmlStream = new FileOutputStream(pr...
The `Properties` class in Java does not maintain any specific order of its entries; when you call `storeToXML`, it simply writes the properties in the order they were stored. To achieve the goal of storing the properties in alphabetical order, you'll need to sort the entries before writing them to the XML file. Here's...
9,495
[ { "from": "human", "value": "I'd like to store a properties file as XML. Is there a way to sort the keys when doing this so that the generated XML file will be in alphabetical order? \nString propFile = \"/path/to/file\";\nProperties props = new Properties();\n/*set some properties here*/\ntry {\n File...
Is there anything available that isn't trivially breakable?
The question of whether there is anything available that isn't trivially breakable can depend on the context in which you're asking, particularly regarding security, encryption, or even broader philosophical concepts. 1. **Cryptography**: In the field of cryptography, certain algorithms are designed to be secure again...
11,451
[ { "from": "human", "value": "Is there anything available that isn't trivially breakable?\n" }, { "from": "gpt", "value": "The question of whether there is anything available that isn't trivially breakable can depend on the context in which you're asking, particularly regarding security, encrypti...
Developing websites are time-consuming. To improve productivity, I would code a prototype to show to our clients. I don't worry about making the prototype comform to the standard. Most of the time, our clients would approve the prototype and give an unreasonable deadline. I usually end up using the prototype in product...
Using valid HTML is generally advisable, even in a prototype, for several reasons: 1. **Browser Compatibility**: Valid HTML ensures that your website functions correctly across different browsers and devices. Non-standard or invalid HTML might render differently, leading to user experience issues. 2. **Future Scalabi...
12,442
[ { "from": "human", "value": "Developing websites are time-consuming. To improve productivity, I would code a prototype to show to our clients. I don't worry about making the prototype comform to the standard. Most of the time, our clients would approve the prototype and give an unreasonable deadline. I usua...
How do I get a list of the active IP-addresses, MAC-addresses and NetBIOS names on the LAN? I'd like to get NetBIOS name, IP and MAC addresses for every host on the LAN, preferably not having to walk to every single PC and take note of the stuff myself. How to do that with Windows Script Host/PowerShell/whatever?
You can retrieve a list of active IP addresses, MAC addresses, and NetBIOS names on your LAN using a combination of PowerShell and some built-in Windows utilities. Here’s a method to accomplish this: ### Method using PowerShell 1. **Install Required Module**: If you don't have `Nmap` installed, you can use `Get-NetNe...
9,140
[ { "from": "human", "value": "How do I get a list of the active IP-addresses, MAC-addresses and NetBIOS names on the LAN?\nI'd like to get NetBIOS name, IP and MAC addresses for every host on the LAN, preferably not having to walk to every single PC and take note of the stuff myself.\nHow to do that with Win...
If it's possible, I'm interested in being able to embed a PostgreSQL database, similar to sqllite. I've read that it's not possible. I'm no database expert though, so I want to hear from you. Essentially I want PostgreSQL without all the configuration and installation. If it's possible, tell me how.
Embedding PostgreSQL in the same way as SQLite is not directly possible due to fundamental differences in how the two databases are designed. SQLite is a serverless, self-contained database engine that is designed to be embedded directly into applications, making it easy to manage and deploy. In contrast, PostgreSQL is...
11,099
[ { "from": "human", "value": "If it's possible, I'm interested in being able to embed a PostgreSQL database, similar to sqllite. I've read that it's not possible. I'm no database expert though, so I want to hear from you.\nEssentially I want PostgreSQL without all the configuration and installation. If it...
What is the best C++ IDE for a *nix envirnoment? I have heard the C/C++ module of Eclipse is decent as well as Notepad++ but beyond these two I have no real idea. Any thoughts or comments?
There are several good IDEs available for C++ development in a *nix environment. Here are some of the most popular options: 1. **Visual Studio Code**: - While technically not an IDE, VS Code is a powerful and highly extensible code editor. With the right extensions, it can serve as an excellent environment for C++ ...
5,526
[ { "from": "human", "value": "What is the best C++ IDE for a *nix envirnoment? I have heard the C/C++ module of Eclipse is decent as well as Notepad++ but beyond these two I have no real idea. Any thoughts or comments?\n" }, { "from": "gpt", "value": "There are several good IDEs available for C++...
What is the best way to randomize an array of strings with .NET? My array contains about 500 strings and I'd like to create a new Array with the same strings but in a random order. Please include a C# example in your answer.
In C#, you can randomize an array of strings using the `Random` class and the Fisher-Yates shuffle algorithm (also known as the Knuth shuffle). This algorithm is efficient and provides a uniform shuffle. Here’s a complete example of how you can implement this to shuffle an array of strings: ```csharp using System; cl...
10,090
[ { "from": "human", "value": "What is the best way to randomize an array of strings with .NET? My array contains about 500 strings and I'd like to create a new Array with the same strings but in a random order.\nPlease include a C# example in your answer.\n" }, { "from": "gpt", "value": "In C#, y...
I have a T-SQL table variable (not a table) which has an auto incrementing identity column. I want to clear all data from this variable and reset the identity column value to 1. How can this be done?
In T-SQL, table variables do not support truncating directly, and they don't have an explicit method to reset the identity column value. However, you can achieve the desired outcome by creating a new table variable and copying the structure of the existing one. Here's a step-by-step way to clear the data and reset the ...
13,057
[ { "from": "human", "value": "I have a T-SQL table variable (not a table) which has an auto incrementing identity column. I want to clear all data from this variable and reset the identity column value to 1. How can this be done?\n" }, { "from": "gpt", "value": "In T-SQL, table variables do not s...
For example I have such query: Query q = sess.createQuery("from Cat cat"); List cats = q.list(); If I try to make something like this it shows the following warning Type safety: The expression of type List needs unchecked conversion to conform to List<Cat> List<Cat> cats = q.list(); Is there a way to avoid it?
The warning you are encountering is due to Java's type erasure and generics. The method `q.list()` returns a raw type `List`, and when you try to assign it to a generic type `List<Cat>`, the compiler warns you about the potential for a `ClassCastException` at runtime because it can't guarantee the type safety of the co...
9,182
[ { "from": "human", "value": "For example I have such query:\nQuery q = sess.createQuery(\"from Cat cat\");\nList cats = q.list();\n\nIf I try to make something like this it shows the following warning \nType safety: The expression of type List needs unchecked conversion to conform to List<Cat>\n\n\nList<Cat...
I got a comment to my answer on this thread: Malloc inside a function call appears to be getting freed on return? In short I had code like this: int * somefunc (void) { int * temp = (int*) malloc (sizeof (int)); temp[0] = 0; return temp; } I got this comment: Can I just say, please don't cast the return value...
The warning about casting the return value of `malloc` primarily pertains to C, where the cast is unnecessary and can indeed hide potential errors. Here's a detailed explanation of why this is the case: 1. **Error Detection**: In C, if you do not cast the return value of `malloc`, the compiler can raise warnings or er...
10,012
[ { "from": "human", "value": "I got a comment to my answer on this thread:\nMalloc inside a function call appears to be getting freed on return?\nIn short I had code like this:\nint * somefunc (void)\n{\n int * temp = (int*) malloc (sizeof (int));\n temp[0] = 0;\n return temp;\n}\n\nI got this comment:\n\...
I have just started reading Introduction to 80x86 Assembly Language and Computer Architecture.I am trying to use NASM, to run the first example shown in chapter 3 ,but unsuccessfully.Has anyone read the book,and run the examples?
It's great that you’re diving into assembly language and computer architecture! The "Introduction to 80x86 Assembly Language and Computer Architecture" book provides a solid foundation for understanding assembly programming with NASM. To run the first example from chapter 3, make sure you follow these steps: 1. **Ins...
11,824
[ { "from": "human", "value": "I have just started reading Introduction to 80x86 Assembly Language and Computer Architecture.I am trying to use NASM, to run the first example shown in chapter 3 ,but unsuccessfully.Has anyone read the book,and run the examples?\n" }, { "from": "gpt", "value": "It's...
I've been parsing through some log files and I've found that some of the lines are too long to display on one line so Terminal.app kindly wraps them onto the next line. However, I've been looking for a way to truncate a line after a certain number of characters so that Terminal doesn't wrap, making it much easier to sp...
You can indeed achieve line truncation using command-line tools like `awk` or `cut` without needing to write a custom program. Here are a couple of examples using these tools: ### Using `awk` `awk` is a powerful text processing tool that can be used to truncate lines. Here’s how you can do it: ```bash awk -v max_len=...
10,178
[ { "from": "human", "value": "I've been parsing through some log files and I've found that some of the lines are too long to display on one line so Terminal.app kindly wraps them onto the next line. However, I've been looking for a way to truncate a line after a certain number of characters so that Terminal ...
I have 4 versions of file A.txt in my subversion repository, say: A.txt.r1, A.txt.r2, A.txt.r3 and A.txt.r4. My working copy of the file is r4 and I want to switch back to r2. I don't want to use "svn update -r 2 A.txt" because this will delete all the revisions after r2, namely r3 and r4. So is there any way that I u...
In Subversion (SVN), when you perform an `svn update -r <revision>` on a file in your working copy, it does indeed revert that file to the specified revision, and you'll lose the current working version of the file in the history of your working copy. However, you can still access the full history of the file through t...
10,875
[ { "from": "human", "value": "I have 4 versions of file A.txt in my subversion repository, say: A.txt.r1, A.txt.r2, A.txt.r3 and A.txt.r4. My working copy of the file is r4 and I want to switch back to r2. I don't want to use \"svn update -r 2 A.txt\" because this will delete all the revisions after r2, name...
I want to build an executable to distribute to people without python installed on their machines. Is there an add-on to Eclipse that allows this? I couldn't find one. If not, do you have a builder that you recommend that would make it easy to go to my python project directory created in Eclipse, and bundle it all up?...
Hi Mark, To create an executable from your Python project so that it can be distributed to users who may not have Python installed, you can use several tools, but Eclipse itself does not provide a built-in add-on for this purpose. Below are some recommendations for tools you can use to create an executable from your P...
11,306
[ { "from": "human", "value": "I want to build an executable to distribute to people without python installed on their machines. \nIs there an add-on to Eclipse that allows this? I couldn't find one. \nIf not, do you have a builder that you recommend that would make it easy to go to my python project director...
I'm specifically interested in Windows 2000/XP, but Vista/7 would be interesting too (if different). I was thinking along the lines of task scheduling a batch file or equivalent on a daily basis. EDIT: Sorry, I should have provided more info. The question pertains to 10 machines which I manually apply updates. I don't ...
To check for Windows updates using a script on Windows 2000, XP, Vista, or 7, you can utilize the built-in Windows Update API or command-line tools. However, direct querying of the update status using a batch file is limited in older versions of Windows. ### Windows XP and Windows 2000 In Windows XP and 2000, the opti...
11,058
[ { "from": "human", "value": "I'm specifically interested in Windows 2000/XP, but Vista/7 would be interesting too (if different).\nI was thinking along the lines of task scheduling a batch file or equivalent on a daily basis.\nEDIT: Sorry, I should have provided more info. The question pertains to 10 machin...
I'm working with a snippet of code that recursively calls itself and tries to pull out a MIME Type part of text/html from an email (if it exists) for further processing. The "text/html" could exist inside other content such as multipart/alternative, so I'm trying to find out if there is a defined hierarchy for email MI...
Yes, there is a defined hierarchy for email MIME types, which is based on the structure of the MIME specification (RFC 2045 and RFC 2046). Email MIME types can be organized into various categories, and certain types can serve as parents for others. Here's a simplified overview of the hierarchy: ### Top-Level MIME Type...
9,428
[ { "from": "human", "value": "I'm working with a snippet of code that recursively calls itself and tries to pull out a MIME Type part of text/html from an email (if it exists) for further processing.\nThe \"text/html\" could exist inside other content such as multipart/alternative, so I'm trying to find out ...
Is there a side effect in doing this: C code: struct foo { int k; }; int ret_foo(const struct foo* f){ return f.k; } C++ code: class bar : public foo { int my_bar() { return ret_foo( (foo)this ); } }; There's an extern "C" around the C++ code and each code is inside its own compilation u...
The code you've provided has a few issues that will likely result in errors or undefined behavior, and it is not portable across compilers. Let's break down the issues in both the C and C++ code. ### C Code 1. **Accessing struct member**: In the function `ret_foo`, you're trying to access the member `k` of the str...
10,212
[ { "from": "human", "value": "Is there a side effect in doing this:\nC code:\nstruct foo {\n int k;\n};\n\nint ret_foo(const struct foo* f){ \n return f.k; \n}\n\nC++ code:\nclass bar : public foo {\n\n int my_bar() { \n return ret_foo( (foo)this ); \n }\n\n};\n\nThere's an extern \"C\" aro...
Can anyone tell how Adobe Acrobat 9 was made? I like the look and feel of the GUI and I'm curious how it was made. Specifically, what programming language was used to make it?
Adobe Acrobat 9, released in 2008, is part of the Adobe Acrobat family of applications used primarily for creating, viewing, and editing PDF documents. The GUI of Adobe products, including Acrobat 9, is developed using a combination of various technologies. 1. **Programming Languages**: - The core components of Ad...
13,505
[ { "from": "human", "value": "Can anyone tell how Adobe Acrobat 9 was made? I like the look and feel of the GUI and I'm curious how it was made. Specifically, what programming language was used to make it?\n" }, { "from": "gpt", "value": "Adobe Acrobat 9, released in 2008, is part of the Adobe Ac...
I have a COM object written using the MS ATL library. I have declared a bunch of enumerations in the IDL but they do NOT appear when viewing the type library using the MS COM Object Viewer tool. The problem seems to be that the missing enums are not actually used as parameters by any of the COM methods - how can I fo...
Yes, this is a common issue when working with COM and IDL files. In COM, the types that are exported in the type library must be referenced somewhere in the methods of the COM object. If an enumeration (like your `BAR`) is not used as a parameter or return type in any of the methods, it will not appear in the type libr...
10,592
[ { "from": "human", "value": "I have a COM object written using the MS ATL library. I have declared a bunch of enumerations in the IDL but they do NOT appear when viewing the type library using the MS COM Object Viewer tool. The problem seems to be that the missing enums are not actually used as parameters...
What is the definitive way to mimic the CSS property min-width in Internet Explorer 6? Is it better not to try?
Mimicking the CSS `min-width` property in Internet Explorer 6 can be challenging because IE6 does not support this property directly. However, there are several approaches you can take to achieve a similar effect, though each comes with its own set of trade-offs. ### Approaches to Mimic `min-width` in IE6: 1. **Usin...
10,184
[ { "from": "human", "value": "What is the definitive way to mimic the CSS property min-width in Internet Explorer 6? Is it better not to try?\n" }, { "from": "gpt", "value": "Mimicking the CSS `min-width` property in Internet Explorer 6 can be challenging because IE6 does not support this propert...
I'm working on a project that will be distributed with GNU autoconf/automake, and I have a set of bash scripts which call awk scripts. I would like the bash scripts to end up in the $PATH, but not the awk scripts. How should I insert these into the project? Should they be put in with other binaries? Also, is there a...
To effectively integrate your Bash scripts into a project using GNU Autoconf and Automake, follow these steps: 1. **Organize Your Project Structure**: - You should generally place your Bash scripts in a designated directory, such as `bin/` or `scripts/`. For example: ``` your_project/ ├── bin/ │...
10,449
[ { "from": "human", "value": "I'm working on a project that will be distributed with GNU autoconf/automake, and I have a set of bash scripts which call awk scripts. I would like the bash scripts to end up in the $PATH, but not the awk scripts. How should I insert these into the project? Should they be put...
According to the documentation, they're pretty much interchangeable. Is there a stylistic reason to use one over the other?
When considering the choice between two interchangeable terms or phrases, stylistic reasons can include: 1. **Tone**: One term might convey a more formal or informal tone than the other. Choose the one that fits the overall tone of your writing. 2. **Clarity**: Depending on your audience, one term might be more commo...
13,695
[ { "from": "human", "value": "According to the documentation, they're pretty much interchangeable. Is there a stylistic reason to use one over the other?\n" }, { "from": "gpt", "value": "When considering the choice between two interchangeable terms or phrases, stylistic reasons can include:\n\n1...
What the latest figures are on people viewing their emails in text only mode vs. HTML? Wikipedia and it's source both seem to reference this research from 2006 which is an eternity ago in internet terms. An issue with combining both HTML and text based emails is taking a disproportionate amount of time to resolve given...
As of my last update in October 2023, there isn't a widely cited, up-to-date source specifically breaking down the percentage of email users who view their emails in text-only mode versus HTML. The email landscape has evolved significantly since 2006, with a predominant trend toward HTML emails due to their visual appe...
13,229
[ { "from": "human", "value": "What the latest figures are on people viewing their emails in text only mode vs. HTML?\nWikipedia and it's source both seem to reference this research from 2006 which is an eternity ago in internet terms.\nAn issue with combining both HTML and text based emails is taking a dispr...
This question is overflow from the following question: How do I programmatically convert mp3 to an itunes-playable aac/m4a file? Anyway, I learned how to create an aac file and then i found out that an aac is not just an m4a file with a different file extension. In fact, I need to somehow wrap the aac into an m4a cont...
To convert an MP3 file to an AAC file and wrap it into an M4A container using the command line, you can use the `ffmpeg` tool, which is a powerful multimedia framework that can decode, encode, transcode, mux, demux, stream, filter, and play almost anything that humans and machines have created. ### Steps to Install FF...
8,518
[ { "from": "human", "value": "This question is overflow from the following question:\nHow do I programmatically convert mp3 to an itunes-playable aac/m4a file?\nAnyway, I learned how to create an aac file and then i found out that an aac is not just an m4a file with a different file extension. In fact, I ne...
I've been using a small class to emulate Enums in some Python projects. Is there a better way or does this make the most sense for some situations? Class code here: class Enum(object): '''Simple Enum Class Example Usage: >>> codes = Enum('FOO BAR BAZ') # codes.BAZ will be 2 and so on ...''' def __init__(self, names): ...
Using a class to emulate enums in Python is a common approach, especially before the introduction of the `enum` module in Python 3.4. The `enum` module provides a more structured and feature-rich way to create enumerations. If you're working with Python 3.4 or later, it's advisable to use the built-in `enum` module. He...
9,426
[ { "from": "human", "value": "I've been using a small class to emulate Enums in some Python projects. Is there a better way or does this make the most sense for some situations?\nClass code here:\nclass Enum(object):\n'''Simple Enum Class\nExample Usage:\n>>> codes = Enum('FOO BAR BAZ') # codes.BAZ will be 2...
Is it possible to build Visual Studio solutions without having to fire up MonoDevelop?
Yes, it is possible to build Visual Studio solutions without using MonoDevelop. There are a few alternative methods you can use to build .NET projects or solutions from the command line or other development environments. Here are some options: 1. **Command Line with MSBuild**: If you have the .NET SDK installed, you c...
12,388
[ { "from": "human", "value": "Is it possible to build Visual Studio solutions without having to fire up MonoDevelop?\n" }, { "from": "gpt", "value": "Yes, it is possible to build Visual Studio solutions without using MonoDevelop. There are a few alternative methods you can use to build .NET proje...
In FlexBuilder 3, there are two items under the 'Data' menu to import and manage web services. After importing a webservice, I can update it with the manage option. However, the webservices seems to disappear after they are imported. The manager does however recognize that a certain WSDL URL was imported and refuses to...
In FlexBuilder 3, if you encounter a situation where the imported web services seem to disappear or are not visible in the workspace, but the Web Services Manager recognizes that a WSDL URL has been imported, you can follow these steps to troubleshoot and refresh the WSDL: ### Steps to Refresh WSDL in FlexBuilder 3: ...
8,562
[ { "from": "human", "value": "In FlexBuilder 3, there are two items under the 'Data' menu to import and manage web services. After importing a webservice, I can update it with the manage option. However, the webservices seems to disappear after they are imported. The manager does however recognize that a cer...
I'm storing an object (TTF_Font) in a shared_ptr that is provided to me from a third-party API. I cannot use new or delete on the object, so the shared_ptr is also provided a "freeing" functor. // Functor struct CloseFont { void operator()(TTF_Font* font) const { if(font != NULL) { TTF_Close...
Yes, your understanding is correct. When you create a `boost::shared_ptr` with a custom deleter (in your case, the `CloseFont` functor), the custom deleter will be invoked when the `shared_ptr` is reset or when it goes out of scope (i.e., when it is destroyed). By calling `screenFont.reset();`, you are explicitly rele...
12,745
[ { "from": "human", "value": "I'm storing an object (TTF_Font) in a shared_ptr that is provided to me from a third-party API. I cannot use new or delete on the object, so the shared_ptr is also provided a \"freeing\" functor.\n// Functor\nstruct CloseFont\n{\n void operator()(TTF_Font* font) const\n {\...
I attempted to open a C#/VB form in designer mode, and instead of the form, I got an ugly error message saying "The path is not of a legal form". This form used to work! What happened? Thanks to all who have answered. This question is a problem I hit a while back, and I struggled with it for a long time, until I fo...
The error message "The path is not of a legal form" can be frustrating, especially when it occurs unexpectedly in the Visual Studio Designer for C# or VB forms. Here are a few common causes and solutions for this issue: 1. **Corrupted .resx File**: The designer relies on the `.resx` (resource) file associated with the...
11,428
[ { "from": "human", "value": "I attempted to open a C#/VB form in designer mode, and instead of the form, I got an ugly error message saying \"The path is not of a legal form\". This form used to work! What happened?\n\nThanks to all who have answered. This question is a problem I hit a while back, and I ...
I'm looking for a quality WinForms component that supports syntax highlighting, code folding and the like. The key criteria are: Stability Value (price) Ability to easily customize syntax to highlight Light weight
When looking for a WinForms component that supports syntax highlighting, code folding, and other code editing features, you have several options. Here are a few popular choices that meet your criteria for stability, value, customization, and lightweight: 1. **ScintillaNET** - **Description**: ScintillaNET is a .NET...
7,729
[ { "from": "human", "value": "I'm looking for a quality WinForms component that supports syntax highlighting, code folding and the like. The key criteria are:\n\nStability \nValue (price)\nAbility to easily customize syntax to highlight\nLight weight\n\n" }, { "from": "gpt", "value": "When lookin...
Part of the install for an app I am responsible for, compiles some C code libraries. This is done in a console using GNU Make. So, as part of the install, a console window pops open, you see the make file output wiz by as it compiles and links, when finished the console window closes and the installer continues. All go...
To achieve the desired behavior of keeping the console window open when there is a compilation error, you can modify the way you run the Makefile from a batch file (or script). The idea is to use a batch script that calls `make`, checks for the result, and then decides whether to pause or close the console window based...
10,743
[ { "from": "human", "value": "Part of the install for an app I am responsible for, compiles some C code libraries. This is done in a console using GNU Make.\nSo, as part of the install, a console window pops open, you see the make file output wiz by as it compiles and links, when finished the console window ...
I have a GTK notebook with multiple tabs. Each tab label is a composite container containing, among other things, a button I want to use to close the tab. The button has a handler for the "clicked" signal. When the signal is called, I get the button widget and "EventArgs" as a parameter. I need to determine the page ...
To determine the page number of a tab in a GTK Notebook based on the button widget inside the tab label, you need to traverse the parent hierarchy to find the `Notebook` widget that contains your tab label. In your scenario, calling `myNotebook.PageNum(buttonWidget)` will return `-1` because `buttonWidget` is not dire...
9,782
[ { "from": "human", "value": "I have a GTK notebook with multiple tabs. Each tab label is a composite container containing, among other things, a button I want to use to close the tab. The button has a handler for the \"clicked\" signal.\nWhen the signal is called, I get the button widget and \"EventArgs\"...
In OS X, in order to quickly get at menu items from the keyboard, I want to be able to type a key combination, have it run a script, and have the script focus the Search field in the Help menu. It should work just like the key combination for Spotlight, so if I run it again, it should dismiss the menu. I can run the ...
You can create an AppleScript to focus on the Search field in the Help menu and toggle it on and off with a keyboard shortcut. Here’s how you can do that: 1. **Open Script Editor:** - You can find Script Editor in your Applications folder under Utilities, or you can search for it using Spotlight. 2. **Write the Ap...
6,857
[ { "from": "human", "value": "In OS X, in order to quickly get at menu items from the keyboard, I want to be able to type a key combination, have it run a script, and have the script focus the Search field in the Help menu. It should work just like the key combination for Spotlight, so if I run it again, it...
I want to maintain a list of global messages that will be displayed to all users of a web app. I want each user to be able to mark these messages as read individually. I've created 2 tables; messages (id, body) and messages_read (user_id, message_id). Can you provide an sql statement that selects the unread messages fo...
You can use a SQL query that performs a LEFT JOIN between the `messages` table and the `messages_read` table. This will allow you to identify the messages that have not been marked as read by the specified user. Here’s an SQL statement to select the unread messages for a single user: ```sql SELECT m.id, m.body FROM ...
10,771
[ { "from": "human", "value": "I want to maintain a list of global messages that will be displayed to all users of a web app. I want each user to be able to mark these messages as read individually. I've created 2 tables; messages (id, body) and messages_read (user_id, message_id).\nCan you provide an sql sta...
I Adobe Air completly JavaScript? Can't I use a .NET language like VB.NET or C#.NET? Thanks
Adobe AIR primarily supports web technologies like HTML, CSS, and JavaScript for creating applications. However, it does not natively support .NET languages such as VB.NET or C#.NET. Adobe AIR applications are built using ActionScript (similar to JavaScript) and can also incorporate HTML and JavaScript through the use ...
14,604
[ { "from": "human", "value": "I Adobe Air completly JavaScript? Can't I use a .NET language like VB.NET or C#.NET? \nThanks\n" }, { "from": "gpt", "value": "Adobe AIR primarily supports web technologies like HTML, CSS, and JavaScript for creating applications. However, it does not natively suppor...
What is the command to list all triggers in a MySQL database?
To list all triggers in a MySQL database, you can use the following SQL query: ```sql SHOW TRIGGERS; ``` This command will display a list of all triggers in the currently selected database, including their names, the events that activate them, the timing of the triggers (BEFORE or AFTER), the associated table, and ot...
14,447
[ { "from": "human", "value": "What is the command to list all triggers in a MySQL database?\n" }, { "from": "gpt", "value": "To list all triggers in a MySQL database, you can use the following SQL query:\n\n```sql\nSHOW TRIGGERS;\n```\n\nThis command will display a list of all triggers in the cur...
Trying the easy approach: sqlite2 mydb.db .dump | sqlite3 mydb-new.db I got this error: SQL error near line 84802: no such column: Ð In that line the script is this: INSERT INTO vehiculo VALUES(127548,'21K0065217',Ñ,'PA007808',65217,279,1989,3,468,'1998-07-30 00:00:00.000000','14/697/98-07',2,'',1); My guess is t...
The error you're encountering with the `INSERT INTO` statement in your SQLite dump is indeed due to the unquoted character `Ñ`. In SQL, string values should always be enclosed in single quotes (or double quotes for identifiers), especially when they include special characters or are not purely numeric. Here’s a step-b...
8,694
[ { "from": "human", "value": "Trying the easy approach:\n\nsqlite2 mydb.db .dump | sqlite3 mydb-new.db\n\nI got this error:\n\nSQL error near line 84802: no such column: Ð\n\nIn that line the script is this:\n\nINSERT INTO vehiculo VALUES(127548,'21K0065217',Ñ,'PA007808',65217,279,1989,3,468,'1998-07-30 00:0...
I have a flash application running Flash 9 (CS3). Application is able to control the Softkeys when this flash application is loaded in the supported mobile device. But, the application doesn't have control when the same is embedded in HTML page and browsed via supported mobile device. Any ideas how to make this work...
Controlling softkeys in a Flash application running in a mobile device can indeed be tricky, especially when it's embedded in an HTML page. When Flash runs within a browser, the environment is different from when it's running as a standalone application, and this affects its ability to interact with hardware features l...
11,544
[ { "from": "human", "value": "I have a flash application running Flash 9 (CS3). Application is able to control the Softkeys when this flash application is loaded in the supported mobile device. But, the application doesn't have control when the same is embedded in HTML page and browsed via supported mobile...
Is there a NAnt task that will echo out all property names and values that are currently set during a build? Something equivalent to the Ant echoproperties task maybe?
Yes, NAnt provides a way to echo properties similar to the Ant `echoproperties` task, although there is no direct equivalent task named `echoproperties`. You can achieve this by using the `echo` task in combination with property iteration. Here's how you can echo all properties in NAnt: ```xml <project name="EchoProp...
13,337
[ { "from": "human", "value": "Is there a NAnt task that will echo out all property names and values that are currently set during a build? Something equivalent to the Ant echoproperties task maybe?\n" }, { "from": "gpt", "value": "Yes, NAnt provides a way to echo properties similar to the Ant `e...
I have a need to open a popup detail window from a gridview (VS 2005 / 2008). What I am trying to do is in the markup for my TemplateColumn have an asp:Button control, sort of like this: <asp:Button ID="btnShowDetails" runat="server" CausesValidation="false" CommandName="Details" Text="Order Details" onClientCl...
To achieve the behavior you're looking for in a GridView with a TemplateField and a Button that opens a popup window with a query string parameter, you can't directly use `<%# Eval("order_id") %>` inside the `onClientClick` attribute in the ASP.NET markup. However, you can accomplish this by using a bit of JavaScript t...
10,035
[ { "from": "human", "value": "I have a need to open a popup detail window from a gridview (VS 2005 / 2008). What I am trying to do is in the markup for my TemplateColumn have an asp:Button control, sort of like this:\n<asp:Button ID=\"btnShowDetails\" runat=\"server\" CausesValidation=\"false\"\n CommandN...
If you have a table with a compound primary key that is composed of a foreign key and other table columns, how do you get ASP.NET Dynamic Data to allow the non-foreign primary key table columns to be editable?
In ASP.NET Dynamic Data, when you have a compound primary key that includes a foreign key and other columns, you may find that only the foreign key is editable by default. To make the non-foreign key columns of a compound primary key editable, you'll need to customize the Dynamic Data scaffolding and validation rules a...
6,780
[ { "from": "human", "value": "If you have a table with a compound primary key that is composed of a foreign key and other table columns, how do you get ASP.NET Dynamic Data to allow the non-foreign primary key table columns to be editable?\n" }, { "from": "gpt", "value": "In ASP.NET Dynamic Data,...
In Java, I use a class in which some fields can be null. For example: class Foo { String bar; //.... } I want to write a BarComparator for this class, private static class BarComparator implements Comparator<Foo> { public int compare( final Foo o1, final Foo o2 ) { /...
Yes, there is a standard and clean way to handle comparisons in Java, especially when dealing with potentially null values. You can use `Comparator`'s built-in utilities in Java 8 and later, which provide a way to handle nulls gracefully without extensive nested `if...else` statements. Here’s how you can implement a `...
11,201
[ { "from": "human", "value": "In Java, I use a class in which some fields can be null. For example:\nclass Foo {\n String bar;\n //....\n}\n\nI want to write a BarComparator for this class,\n private static class BarComparator\n implements Comparator<Foo> {\n public int compare( fi...
What is the best way to issue a http get in VB.net? I want to get the result of a request like http://api.hostip.info/?ip=68.180.206.184
In VB.NET, one of the simplest and most straightforward ways to issue an HTTP GET request and retrieve the response is by using the `HttpClient` class, which is part of the `System.Net.Http` namespace. Below is an example of how to perform an HTTP GET request to the provided URL and get the result. First, make sure yo...
8,721
[ { "from": "human", "value": "What is the best way to issue a http get in VB.net? I want to get the result of a request like http://api.hostip.info/?ip=68.180.206.184 \n" }, { "from": "gpt", "value": "In VB.NET, one of the simplest and most straightforward ways to issue an HTTP GET request and re...
is there any way to leave a time delay between the execution of two lines of code?
Yes, you can introduce a time delay between the execution of two lines of code in various programming languages. Below are examples in a few commonly used languages: ### Python You can use the `time.sleep()` function from the `time` module to create a delay. ```python import time print("First line of code") time.sle...
7,242
[ { "from": "human", "value": "is there any way to leave a time delay between the execution of two lines of code?\n" }, { "from": "gpt", "value": "Yes, you can introduce a time delay between the execution of two lines of code in various programming languages. Below are examples in a few commonly u...
Is anyone writing applications specifically to take advantage of google chrome? Are there any enterprise users who are considering using it as the standard browser?
Yes, there are many developers and companies writing applications specifically designed to take advantage of Google Chrome's capabilities. Chrome provides a robust platform for web development, including support for modern web standards, extensions, and APIs that enhance user experience. This has led to the creation of...
12,934
[ { "from": "human", "value": "Is anyone writing applications specifically to take advantage of google chrome?\nAre there any enterprise users who are considering using it as the standard browser? \n" }, { "from": "gpt", "value": "Yes, there are many developers and companies writing applications ...
In effect, if I have a class c and instances of $c1 and $c2 which might have different private variable amounts but all their public methods return the same values I would like to be able to check that $c1 == $c2? Does anyone know an easy way to do this?
In PHP, if you want to compare instances of a class based on the output of their public methods rather than their private or protected variables, you can define a method within your class that checks for equality based on the return values of the relevant public methods. Here's a simple approach: 1. Define a method ...
11,602
[ { "from": "human", "value": "In effect, if I have a class c and instances of $c1 and $c2 \nwhich might have different private variable amounts but all their public methods return the same values I would like to be able to check that $c1 == $c2?\nDoes anyone know an easy way to do this?\n" }, { "from...
I am looking to convert a MySQL timestamp to a epoch time in seconds using PHP, and vice versa. What's the cleanest way to do this?
To convert a MySQL timestamp to epoch time (Unix timestamp) and vice versa in PHP, you can use the built-in `strtotime()` function and the `date()` function. Here's a simple and clean way to do both conversions. ### Convert MySQL Timestamp to Epoch Time You can use `strtotime()` to convert a MySQL timestamp string to...
8,866
[ { "from": "human", "value": "I am looking to convert a MySQL timestamp to a epoch time in seconds using PHP, and vice versa. \nWhat's the cleanest way to do this?\n" }, { "from": "gpt", "value": "To convert a MySQL timestamp to epoch time (Unix timestamp) and vice versa in PHP, you can use the b...
As stated in the title, i'm looking for an XML schema (XSD-file) for the Glade markup language? Wikipedia states that Glade is a schema based markup language (list of schemas at wikipedia). I tried to search the web, wikipedia and the glade website,but i couldn't find an XSD for Glade. Thx, Juve
As of my last knowledge update in October 2023, there is no official XML Schema Definition (XSD) file available for Glade markup language. Glade is used primarily with GTK applications to create user interfaces, and while it uses XML to define UI components, its schema is not always formally documented in a way that pr...
11,743
[ { "from": "human", "value": "As stated in the title, i'm looking for an XML schema (XSD-file) for the Glade markup language?\nWikipedia states that Glade is a schema based markup language (list of schemas at wikipedia). I tried to search the web, wikipedia and the glade website,but i couldn't find an XSD fo...
CLR profiler does not seem to work with the Silverlight CLR. Does another memory profiler exist?
As of my last knowledge update in October 2023, there are a few memory profiling options you can consider for Silverlight applications. Although the CLR Profiler specifically targets the .NET Framework and does not support Silverlight, you can use the following alternatives: 1. **Visual Studio's built-in profiling too...
12,815
[ { "from": "human", "value": "CLR profiler does not seem to work with the Silverlight CLR. Does another memory profiler exist?\n" }, { "from": "gpt", "value": "As of my last knowledge update in October 2023, there are a few memory profiling options you can consider for Silverlight applications. A...
I've been using Codegear RAD Studio for a over a year now but since the "May08 Help Update" the help system no longer works. If I open the help the contents pane is entirely blank. If I hit F1 I get the following error: "Unable to interpret the specified HxC file." I've searched for the answer using search engines ...
The issue you are experiencing with the CodeGear RAD Studio help system after the "May08 Help Update" could be related to several factors, including corrupted help files, incorrect settings, or a mismatch in the help file version. Here are some steps you can try to resolve the issue without a full reinstallation: 1. *...
10,990
[ { "from": "human", "value": "I've been using Codegear RAD Studio for a over a year now but since the \"May08 Help Update\" the help system no longer works. If I open the help the contents pane is entirely blank. If I hit F1 I get the following error: \"Unable to interpret the specified HxC file.\" \nI've...
From what I have gleaned from reflector, RunWithElevatedPriveleges simply reverts the current thread identity to the base (non-impersonated) identity. This makes perfect sense in the case of code running inside the WSS application pool, since the base service account is a super-user. Does it have any effect when runn...
The `RunWithElevatedPrivileges` method in SharePoint is specifically designed to allow code to run with elevated permissions. As you noted, it typically reverts the current thread identity to the base (non-impersonated) identity of the application pool in which SharePoint is running. This is particularly important in t...
10,623
[ { "from": "human", "value": "From what I have gleaned from reflector, RunWithElevatedPriveleges simply reverts the current thread identity to the base (non-impersonated) identity. This makes perfect sense in the case of code running inside the WSS application pool, since the base service account is a super...
We used Drools as part of a solution to act as a sort of filter in a very intense processing application, maybe running up to 100 rules on 500,000 + working memory objects. turns out that it is extremely slow. anybody else have any experience using Drools in a batch type processing application?
Yes, using Drools in a high-volume, batch processing application can sometimes lead to performance challenges, especially with a large working memory size and many rules. Here are a few considerations and tips based on common experiences in similar scenarios: 1. **Rule Complexity**: If your rules are complex (e.g., in...
9,685
[ { "from": "human", "value": "We used Drools as part of a solution to act as a sort of filter in a very intense processing application, maybe running up to 100 rules on 500,000 + working memory objects.\nturns out that it is extremely slow.\nanybody else have any experience using Drools in a batch type proce...
When I use quick documentaion lookup (Ctrl+Q) on j2ee classes or annotations in IDEA I only get an empty javadoc. It only contains the basics like class name. How do I add the javadoc to the libs IDEA provides itself?
If you're seeing empty Javadocs for Java EE (J2EE) classes or annotations in IntelliJ IDEA, it's likely because the library that you're using does not have the Javadocs associated with it in the IDE. Here’s how to add Javadocs for the Java EE libraries in IntelliJ IDEA: ### Step 1: Download the Javadocs 1. **Find the...
10,881
[ { "from": "human", "value": "When I use quick documentaion lookup (Ctrl+Q) on j2ee classes or annotations in IDEA I only get an empty javadoc. It only contains the basics like class name.\nHow do I add the javadoc to the libs IDEA provides itself?\n" }, { "from": "gpt", "value": "If you're seein...
I've noticed a lot of Microsoft sites have the *.MSPX extension. While I'm very familiar with ASP.NET, I've not seen this extension before. Does anyone know what this identifies?
The `.mspx` file extension is specific to Microsoft and is used for ASP.NET Web Forms pages that utilize the Microsoft ASP.NET technology for dynamic web applications. The extension stands for "Microsoft ASP.NET Page Extension." While ASP.NET typically uses `.aspx` for its pages, `.mspx` can be used as a variation, of...
14,425
[ { "from": "human", "value": "I've noticed a lot of Microsoft sites have the *.MSPX extension. While I'm very familiar with ASP.NET, I've not seen this extension before.\nDoes anyone know what this identifies?\n" }, { "from": "gpt", "value": "The `.mspx` file extension is specific to Microsoft a...
This is an exercise for the CS guys to shine with the theory. Imagine you have 2 containers with elements. Folders, URLs, Files, Strings, it really doesn't matter. What is AN algorithm to calculate the added and the removed? Notice: If there are many ways to solve this problem, please post one per answer so it can be a...
One efficient algorithm to calculate the added and removed elements between two containers while using only the initial two containers involves utilizing a data structure such as a set. Here’s a step-by-step description of the algorithm: ### Algorithm: Using Sets for Added and Removed Elements 1. **Convert containers...
10,121
[ { "from": "human", "value": "This is an exercise for the CS guys to shine with the theory.\nImagine you have 2 containers with elements. Folders, URLs, Files, Strings, it really doesn't matter.\nWhat is AN algorithm to calculate the added and the removed?\nNotice: If there are many ways to solve this proble...
I have an application where a user has to remember and insert an unix timestamp like 1221931027. In order to make it easier to remember the key I like to reduce the number of characters to insert through allowing the characters [a-z]. So I'm searching for an algorithm to convert the timestamp to a shorter alphanum vers...
To convert a Unix timestamp (like `1221931027`) into a shorter alphanumeric string using the characters [a-z], you can use a base conversion approach. Specifically, you can treat the number as a base-10 number and convert it to a base-26 representation using the lowercase letters of the alphabet. Here's a step-by-step...
10,083
[ { "from": "human", "value": "I have an application where a user has to remember and insert an unix timestamp like 1221931027. In order to make it easier to remember the key I like to reduce the number of characters to insert through allowing the characters [a-z]. So I'm searching for an algorithm to convert...
I'm aware I can add maven repositories for fetching dependencies in ~/.m2/settings.xml. But is it possible to add a repository using command line, something like: mvn install -Dmaven.repository=http://example.com/maven2 The reason I want to do this is because I'm using a continuous integration tool where I have full c...
While Maven does not have a direct command line option like `-Dmaven.repository` to specify a repository, you can achieve a similar effect by using a combination of profiles and the `-D` flag to customize your build. Here’s how you can add a repository dynamically via the command line: 1. **Create a Maven profile in ...
13,676
[ { "from": "human", "value": "I'm aware I can add maven repositories for fetching dependencies in ~/.m2/settings.xml. But is it possible to add a repository using command line, something like:\nmvn install -Dmaven.repository=http://example.com/maven2\n\nThe reason I want to do this is because I'm using a con...
May I request you to clarify the issue I have with QTP err object. I am trying to capture the screen shot of an object on which error occured. I use the code object.captureBitmap(filename) to achieve this. I would like to know if it is possible to get the screen shot of the entire page with the err object higlighted.
In QTP (QuickTest Professional), now known as UFT (Unified Functional Testing), capturing screenshots of errors along with highlighting the specific object that caused the error can be challenging. The `Err` object in VBScript captures runtime errors, but it doesn't directly provide a way to take screenshots. However, ...
10,120
[ { "from": "human", "value": "May I request you to clarify the issue I have with QTP err object.\nI am trying to capture the screen shot of an object on which error occured.\nI use the code object.captureBitmap(filename) to achieve this.\nI would like to know if it is possible to get the screen shot of the e...
I'm using Hudson and Maven 2 for my automated build/CI. I can build fine with maven from the command line, but when I run the same goal with Hudson, the build fails complaining of missing artifacts. I'm running Hudson as a windows XP service.
The issue you are encountering where Hudson (now known as Jenkins) fails to build with Maven while working perfectly on the command line might stem from several potential differences in the environment in which Hudson is running. Here are some steps and considerations to troubleshoot and potentially resolve the issue: ...
11,508
[ { "from": "human", "value": "I'm using Hudson and Maven 2 for my automated build/CI. I can build fine with maven from the command line, but when I run the same goal with Hudson, the build fails complaining of missing artifacts. I'm running Hudson as a windows XP service.\n" }, { "from": "gpt", ...
Lifehacker had a post a couple days ago asking people about the best mouse you've ever had and it appears some people have traded their mouse for a tablet. I'm curious if anyone here has traded their mouse in for a tablet? Does it work well for development? Looking for pros and cons from people who have tried it or a...
Switching from a mouse to a tablet for development can definitely have its pros and cons. Many developers have experimented with using tablets, particularly those that allow for stylus input, like the iPad Pro with Apple Pencil or various Wacom models. Here’s a breakdown of some of the experiences you might find: ### ...
12,350
[ { "from": "human", "value": "Lifehacker had a post a couple days ago asking people about the best mouse you've ever had and it appears some people have traded their mouse for a tablet.\nI'm curious if anyone here has traded their mouse in for a tablet? Does it work well for development? Looking for pros a...
I am writing a query in SQL server2005. This is returning me a duplicate rows in the result. Can i eliminate this duplication with a particular column as the key?
Yes, you can eliminate duplicate rows in your SQL query by using the `DISTINCT` keyword or by using a `GROUP BY` clause, depending on your requirements. ### Using DISTINCT If you want to eliminate duplicate rows based on all selected columns, you can simply use `DISTINCT`: ```sql SELECT DISTINCT column1, column2, co...
12,530
[ { "from": "human", "value": "I am writing a query in SQL server2005. This is returning me a duplicate rows in the result. Can i eliminate this duplication with a particular column as the key?\n" }, { "from": "gpt", "value": "Yes, you can eliminate duplicate rows in your SQL query by using the `D...
What is an efficient way to implement a singleton design pattern in Java?
The Singleton design pattern ensures that a class has only one instance and provides a global point of access to that instance. There are several ways to implement the Singleton pattern in Java, but one of the most efficient and commonly recommended ways is to use the Bill Pugh Singleton Design pattern, which leverages...
10,820
[ { "from": "human", "value": "What is an efficient way to implement a singleton design pattern in Java?\n" }, { "from": "gpt", "value": "The Singleton design pattern ensures that a class has only one instance and provides a global point of access to that instance. There are several ways to implem...
Does anyone know of any problems with using WCF to expose a SOAP interface for non .NET clients? For example incompatibilities with other SOAP libraries? This is so that the SOAP interface can be exposed for third parties to integrate with our software.
Using Windows Communication Foundation (WCF) to expose a SOAP interface can be a practical solution for interoperability, but there are some known issues and incompatibilities that you may encounter when integrating with non-.NET clients. Here are some common problems and considerations: 1. **SOAP Version Compatibilit...
10,487
[ { "from": "human", "value": "Does anyone know of any problems with using WCF to expose a SOAP interface for non .NET clients? For example incompatibilities with other SOAP libraries?\nThis is so that the SOAP interface can be exposed for third parties to integrate with our software.\n" }, { "from":...
Given an Item that has been appended to a Form, whats the best way to find out what index that item is at on the Form? Form.append(Item) will give me the index its initially added at, but if I later insert items before that the index will be out of sync.
In a Form (or any similar data structure) where items can be appended or inserted, the best way to find the index of an item after it has been modified (with additional items inserted before it) is to use a method that searches for the item based on its properties or reference. Here are a few strategies you could use:...
11,318
[ { "from": "human", "value": "Given an Item that has been appended to a Form, whats the best way to find out what index that item is at on the Form?\nForm.append(Item) will give me the index its initially added at, but if I later insert items before that the index will be out of sync.\n" }, { "from":...
I get this error when I do an svn update: Working copy XXXXXXXX locked Please execute "Cleanup" command When I run cleanup, I get Cleanup failed to process the following paths: XXXXXXXX How do I get out of this loop?
If you're stuck in a loop with SVN (Subversion) where `svn update` gives you a locked working copy error and the `svn cleanup` command fails, here are some steps you can take to resolve the issue: ### 1. Ensure No Other SVN Processes are Running Make sure that there are no other SVN operations running in the backgroun...
11,033
[ { "from": "human", "value": "I get this error when I do an svn update:\n\nWorking copy XXXXXXXX locked Please\n execute \"Cleanup\" command\n\nWhen I run cleanup, I get\n\nCleanup failed to process the\n following paths: XXXXXXXX\n\nHow do I get out of this loop?\n" }, { "from": "gpt", "value"...
Is there a clean, preferably standard method of trimming leading and trailing whitespace from a string in C? I'd roll my own, but I would think this is a common problem with an equally common solution.
Yes, trimming leading and trailing whitespace from a string in C is a common problem, and while there isn't a standard library function to do this specifically, you can implement a clean and reusable function for this purpose. Here's a simple example of how you can do it: ```c #include <stdio.h> #include <string.h> #i...
11,722
[ { "from": "human", "value": "Is there a clean, preferably standard method of trimming leading and trailing whitespace from a string in C? I'd roll my own, but I would think this is a common problem with an equally common solution.\n" }, { "from": "gpt", "value": "Yes, trimming leading and traili...
I was wondering if there was an easy way in SQL to convert an integer to its binary representation and then store it as a varchar. For example 5 would be converted to "101" and stored as a varchar.
Yes, you can convert an integer to its binary representation in SQL and store it as a `VARCHAR`. The method to do this may vary slightly depending on the specific SQL database you are using. Below are examples for a few popular SQL databases. ### SQL Server In SQL Server, you can use the `CONVERT` function along with...
10,104
[ { "from": "human", "value": "I was wondering if there was an easy way in SQL to convert an integer to its binary representation and then store it as a varchar.\nFor example 5 would be converted to \"101\" and stored as a varchar.\n" }, { "from": "gpt", "value": "Yes, you can convert an integer t...
Is there a standard framework (maybe part of Enterprise Library... or .NET itself) that allows you to do common parameter validation in method attributes?
In .NET, there is no specific built-in framework within the Enterprise Library or the base .NET Framework that directly supports parameter validation through method attributes. However, there are several approaches you can take to implement parameter validation in your methods. ### 1. **Data Annotations** You can use ...
11,486
[ { "from": "human", "value": "Is there a standard framework (maybe part of Enterprise Library... or .NET itself) that allows you to do common parameter validation in method attributes?\n" }, { "from": "gpt", "value": "In .NET, there is no specific built-in framework within the Enterprise Library ...
I have a Python module installed on my system and I'd like to be able to see what functions/classes/methods are available in it. I want to call the help function on each one. In Ruby I can do something like ClassName.methods to get a list of all the methods available on that class. Is there something similar in Python?...
In Python, you can use the built-in functions `dir()` and `help()` to list the attributes (including methods) of a module, class, or object and to get help information about them. Here's how you can accomplish what you're looking for: 1. **Using `dir()`**: This function returns a list of the attributes and methods of...
11,809
[ { "from": "human", "value": "I have a Python module installed on my system and I'd like to be able to see what functions/classes/methods are available in it.\nI want to call the help function on each one. In Ruby I can do something like ClassName.methods to get a list of all the methods available on that cl...
I am working with a Sharepoint document library and I'm trying to locate the source of the document library page. I'm working on the Sharepoint server. I just can't find it, where should it be stored? Thank you!
In SharePoint, document libraries are built on top of the SharePoint site structure and do not exist as standalone pages or files that you can directly locate in a traditional file system. Instead, the document library is part of the SharePoint site's configuration and data structure, which is stored in the SharePoint ...
10,649
[ { "from": "human", "value": "I am working with a Sharepoint document library and I'm trying to locate the source of the document library page. I'm working on the Sharepoint server. I just can't find it, where should it be stored?\nThank you!\n" }, { "from": "gpt", "value": "In SharePoint, docume...
Normally you can do this: <select size="3"> <option>blah</option> <option>blah</option> <option>blah</option> </select> And it would render as a selectionbox where all three options are visible (without dropping down) I'm looking for a way to set this size attribute from css.
The `size` attribute for the `<select>` element cannot be set directly via CSS. The `size` attribute controls how many options are visible without scrolling, and it must be specified as an attribute in the HTML. However, if you want to control the height of the `<select>` element using CSS to achieve a similar effect,...
12,561
[ { "from": "human", "value": "Normally you can do this:\n<select size=\"3\">\n <option>blah</option>\n <option>blah</option>\n <option>blah</option>\n</select>\n\nAnd it would render as a selectionbox where all three options are visible (without dropping down)\nI'm looking for a way to set this size...
I'm just wondering if there can be a case where the hostname can be successfully resolved but the returned hostEntry.AddressList is empty. Currently I'm doing something like this: IPHostEntry hostEntry = Dns.GetHostEntry("some.hostname.tld"); if (hostEntry.AddressList.Count() < 1) { // can that ever happen? throw n...
Yes, it is indeed possible for `Dns.GetHostEntry` to return a valid `IPHostEntry` object with a non-empty hostname, but with an empty `AddressList`. The `Dns.GetHostEntry` method resolves the specified hostname into an `IPHostEntry` object, which contains information such as the hostname, aliases, and a list of IP ad...
12,845
[ { "from": "human", "value": "I'm just wondering if there can be a case where the hostname can be successfully resolved but the returned hostEntry.AddressList is empty.\nCurrently I'm doing something like this:\nIPHostEntry hostEntry = Dns.GetHostEntry(\"some.hostname.tld\");\nif (hostEntry.AddressList.Count...
When you search in Google (i'm almost sure that Altavista did the same thing) it says "Results 1-10 of about xxxx"... This has always amazed me... What does it mean "about"? How can they count roughly? I do understand why they can't come up with a precise figure in a reasonable time, but how do they even reach this "ap...
The term "about" in the context of search results on platforms like Google indicates that the number displayed is an estimate rather than an exact count. Here's how this approximation generally works: 1. **Indexing and Crawling**: Search engines like Google continuously crawl the web and index pages. They store metada...
12,760
[ { "from": "human", "value": "When you search in Google (i'm almost sure that Altavista did the same thing) it says \"Results 1-10 of about xxxx\"...\nThis has always amazed me... What does it mean \"about\"?\nHow can they count roughly?\nI do understand why they can't come up with a precise figure in a reas...
I've tried cpan and cpanp shell and I keep getting: ExtUtils::PkgConfig requires the pkg-config utility, but it doesn't seem to be in your PATH. Is it correctly installed? What is the pkg-config utility and how do I install it? Updates: OS: Windows This module is a prerequisite for the File::Extractor module
`pkg-config` is a system utility that helps to manage compile and link flags for libraries. It is used to retrieve information about installed libraries in your system, such as their version and location, which is particularly useful for compiling software that depends on them. ### Installing pkg-config on Windows Si...
8,139
[ { "from": "human", "value": "I've tried cpan and cpanp shell and I keep getting:\nExtUtils::PkgConfig requires the pkg-config utility, but it doesn't\nseem to be in your PATH. Is it correctly installed?\n\nWhat is the pkg-config utility and how do I install it? \nUpdates: \n\nOS: Windows\nThis module is a...
In SQL Server 2000, you have the "All Tasks... - Export Data" option. Where is this option the SQL Server 2005 Management Studio? Or, is there a SQL Server 2005 way of doing this? EDIT: I am using the Express edition. EDIT: Joel's response answers my question but Mike's answer gives a great alternative to those of...
In SQL Server 2005 Management Studio (SSMS), the option to export data is located under the "Object Explorer" window. Here's how you can access the data export functionality: 1. **Connect to your Database Engine**: Open SQL Server Management Studio and connect to your database instance. 2. **Navigate to your Database...
12,937
[ { "from": "human", "value": "In SQL Server 2000, you have the \"All Tasks... - Export Data\" option. Where is this option the SQL Server 2005 Management Studio? \nOr, is there a SQL Server 2005 way of doing this?\nEDIT: I am using the Express edition.\nEDIT: Joel's response answers my question but Mike'...
I have mixed data i nvarchar column (words and numbers). Which is fastest way to sort data in this column in Numeric Order. Result example: 1 2 3 ... 10 11 ... aaaa aaab b ba ba ...
To sort mixed data consisting of both numeric strings and alphanumeric strings in SQL, you can use a method that separates the numeric values from the non-numeric values. Here's a general approach to achieve this: 1. **Extract numeric values**: You can utilize a CASE statement to differentiate between numeric and no...
11,996
[ { "from": "human", "value": "I have mixed data i nvarchar column (words and numbers).\nWhich is fastest way to sort data in this column in Numeric Order.\nResult example:\n\n1\n2\n3\n...\n10\n11\n...\naaaa\naaab\nb\nba\nba\n...\n\n" }, { "from": "gpt", "value": "To sort mixed data consisting of ...
Is there a way to use MS WF interactively in ASPNET MVC?
Yes, you can use Windows Workflow Foundation (WF) interactively in an ASP.NET MVC application, though there are some considerations and steps involved in integrating it. Below are the steps and considerations for implementing MS WF in an ASP.NET MVC application: ### Steps to Integrate WF with ASP.NET MVC 1. **Create ...
10,244
[ { "from": "human", "value": "Is there a way to use MS WF interactively in ASPNET MVC?\n" }, { "from": "gpt", "value": "Yes, you can use Windows Workflow Foundation (WF) interactively in an ASP.NET MVC application, though there are some considerations and steps involved in integrating it. Below a...
Is there any conflict?
Could you please provide more context or specify what kind of conflict you are referring to? There are various types of conflicts, including geopolitical, social, personal, and more. Let me know how I can assist you better!
15,631
[ { "from": "human", "value": "Is there any conflict?\n" }, { "from": "gpt", "value": "Could you please provide more context or specify what kind of conflict you are referring to? There are various types of conflicts, including geopolitical, social, personal, and more. Let me know how I can assist...
What is a good implementation of a IsLeapYear function in VBA? Edit: I ran the if-then and the DateSerial implementation with iterations wrapped in a timer, and the DateSerial was quicker on the average by 1-2 ms (5 runs of 300 iterations, with 1 average cell worksheet formula also working).
To implement an `IsLeapYear` function in VBA, you can use two different approaches: one using an if-then conditional structure and another using the built-in `DateSerial` function. Below, I'll provide both implementations. ### Option 1: If-Then Implementation This method manually checks the conditions for determining ...
11,319
[ { "from": "human", "value": "What is a good implementation of a IsLeapYear function in VBA? \nEdit: I ran the if-then and the DateSerial implementation with iterations wrapped in a timer, and the DateSerial was quicker on the average by 1-2 ms (5 runs of 300 iterations, with 1 average cell worksheet formul...
I have a .NET 3.5 (target framework) web application. I have some code that looks like this: public string LogPath { get; private set; } public string ErrorMsg { get; private set; } It's giving me this compilation error for these lines: "must declare a body because it is not marked abstract or extern." Any ideas? M...
It sounds like you've already identified and resolved the issue related to your .NET 3.5 web application. To clarify, the syntax you're using for properties with private setters is indeed supported starting from C# 3.0, which is part of the .NET Framework 3.5. The error message you encountered indicates that the C# c...
9,088
[ { "from": "human", "value": "I have a .NET 3.5 (target framework) web application. I have some code that looks like this:\npublic string LogPath { get; private set; }\npublic string ErrorMsg { get; private set; }\n\nIt's giving me this compilation error for these lines:\n\"must declare a body because it is...
What is the keyboard-shortcut that expands the menu, from the little red line, and offers the option to have the necessary using statement appended to the top of the file?
In many Integrated Development Environments (IDEs) like Visual Studio, the keyboard shortcut to expand the "light bulb" menu (which offers code suggestions, including adding necessary `using` statements) is usually **Ctrl + .** (Control + Period) or **Alt + Enter**. When you place your cursor over a red squiggly line...
15,186
[ { "from": "human", "value": "What is the keyboard-shortcut that expands the menu, from the little red line, and offers the option to have the necessary using statement appended to the top of the file?\n" }, { "from": "gpt", "value": "In many Integrated Development Environments (IDEs) like Visual...
The background should be transparent, but the text should not.
To create a design with a transparent background while keeping the text visible (not transparent), you'll want to follow these general steps depending on the software or tool you're using. Here’s how you can do it in some common applications: ### Adobe Photoshop: 1. **Open Your Document**: Start with a new project and...
10,060
[ { "from": "human", "value": "The background should be transparent, but the text should not.\n" }, { "from": "gpt", "value": "To create a design with a transparent background while keeping the text visible (not transparent), you'll want to follow these general steps depending on the software or t...
Simple question - I've got a bucketload of cruddy html pages to clean up and I'm looking for a open source or freeware script/utility to remove any junk and reformat them into nicely laid out consistent code. Any recommendations? If it's relevant I generally manipulate HTML inside Dreamweaver - but by editing the code...
For cleaning up and reformatting HTML pages, there are several open-source and freeware tools that can help. Here are some recommendations: 1. **HTML Tidy**: This is a popular open-source utility that can help clean up and format HTML code. It fixes common problems and can make your HTML compliant with standards. You ...
11,545
[ { "from": "human", "value": "Simple question - I've got a bucketload of cruddy html pages to clean up and I'm looking for a open source or freeware script/utility to remove any junk and reformat them into nicely laid out consistent code. Any recommendations?\nIf it's relevant I generally manipulate HTML in...
Is there a quick & dirty way of obtaining a list of all the classes within a Visual Studio 2008 (c#) project? There are quite a lot of them and Im just lazy enough not to want to do it manually.
Yes, you can quickly obtain a list of all the classes in a Visual Studio 2008 C# project by using a combination of tools and methods. Here are a couple of approaches you can take: ### Method 1: Using the "Class View" in Visual Studio 1. **Open your project in Visual Studio 2008.** 2. Go to the **View** menu and selec...
10,612
[ { "from": "human", "value": "Is there a quick & dirty way of obtaining a list of all the classes within a Visual Studio 2008 (c#) project? There are quite a lot of them and Im just lazy enough not to want to do it manually.\n" }, { "from": "gpt", "value": "Yes, you can quickly obtain a list of a...
How do I name a result group in a Regex? (.Net)
In .NET, you can name a result group in a regular expression by using the syntax `(?<name>...)`, where `name` is the name you want to give to the group, and `...` is the pattern you want to match. Here’s how you can do it: ### Example Suppose you want to match a date in the format `YYYY-MM-DD` and you want to name th...
13,014
[ { "from": "human", "value": "How do I name a result group in a Regex? (.Net)\n" }, { "from": "gpt", "value": "In .NET, you can name a result group in a regular expression by using the syntax `(?<name>...)`, where `name` is the name you want to give to the group, and `...` is the pattern you want...
I seem to recall reading about an Amazon S3-compatible test server that you could run on your own server for unit tests or whatever. However, I've just exhausted my patience looking for this with both Google and AWS. Does such a thing exist? If not, I think I'll write one. Note: I'm asking about Amazon S3 (the storage ...
Yes, there are several Amazon S3-compatible test servers that you can run locally for unit tests or development purposes. One popular option is **MinIO**. MinIO is an open-source object storage server that is fully compatible with the S3 API, making it an excellent choice for local development and testing. ### Feature...
11,344
[ { "from": "human", "value": "I seem to recall reading about an Amazon S3-compatible test server that you could run on your own server for unit tests or whatever. However, I've just exhausted my patience looking for this with both Google and AWS. Does such a thing exist? If not, I think I'll write one.\nNote...
Do any C++ GNU standalone classes exist which handle paths cross platform? My applications build on Windows and LInux. Our configuration files refer to another file in a seperate directory. I'd like to be able to read the path for the other configuration file into a class which would work on both Linux or Windows. W...
For cross-platform path handling in C++, one of the most widely recommended libraries is the **Filesystem library** introduced in C++17. This library provides a straightforward way to handle paths, directories, and file operations in a way that is portable across different operating systems, including Windows and Linux...
11,149
[ { "from": "human", "value": "Do any C++ GNU standalone classes exist which handle paths cross platform? My applications build on Windows and LInux. Our configuration files refer to another file in a seperate directory. I'd like to be able to read the path for the other configuration file into a class whi...
Why does a user needs privileges over his own schema to create packages and triggers?
In database management systems, a schema is essentially a collection of database objects, such as tables, views, procedures, functions, packages, and triggers, associated with a particular user. Each schema is owned by a user, and the privileges granted to that user determine what actions they can perform on the object...
12,173
[ { "from": "human", "value": "Why does a user needs privileges over his own schema to create packages and triggers?\n" }, { "from": "gpt", "value": "In database management systems, a schema is essentially a collection of database objects, such as tables, views, procedures, functions, packages, an...
I have an actionscript 2 application that I'd like to write automated UI testing for. For example I'd like to simulate a mouse click on a button and validate that a movie-clip is displayed at the right position and in the right color... Basically, UI testing. What are the best tools available or what is the desired app...
Automating UI testing for ActionScript 2 applications (especially those built with Flash) can be quite challenging, as there are fewer tools available compared to more modern web technologies. However, there are some approaches and tools you can consider: ### 1. **Flix (Flash UI Testing Framework)** Flix is a testing ...
11,155
[ { "from": "human", "value": "I have an actionscript 2 application that I'd like to write automated UI testing for.\nFor example I'd like to simulate a mouse click on a button and validate that a movie-clip is displayed at the right position and in the right color... Basically, UI testing.\nWhat are the best...
I'm using Excel VBA to a write a UDF. I would like to overload my own UDF with a couple of different versions so that different arguments will call different functions. As VBA doesn't seem to support this, could anyone suggest a good, non-messy way of achieving the same goal? Should I be using Optional arguments or is...
In VBA, true function overloading (i.e., defining multiple functions with the same name but different argument types or counts) is not supported. However, you can achieve similar functionality by using Optional parameters or by handling different argument types within a single function. Here are two common approaches y...
7,090
[ { "from": "human", "value": "I'm using Excel VBA to a write a UDF. I would like to overload my own UDF with a couple of different versions so that different arguments will call different functions. \nAs VBA doesn't seem to support this, could anyone suggest a good, non-messy way of achieving the same goal? ...
When I enter an object into the DB with Linq-to-SQL can I get the id that I just inserted without making another db call? I am assuming this is pretty easy, I just don't know how.
Yes, when you insert an object into a database using LINQ to SQL, you can retrieve the ID of the inserted object without making another database call. This is possible because LINQ to SQL automatically updates the object with the generated identity value after the insertion. Here's a basic example of how you can do t...
8,463
[ { "from": "human", "value": "When I enter an object into the DB with Linq-to-SQL can I get the id that I just inserted without making another db call? I am assuming this is pretty easy, I just don't know how. \n" }, { "from": "gpt", "value": "Yes, when you insert an object into a database usin...
I have read about JavaFX, and like all new technologies I wanted to get my hands "dirty" with it. However, although it talks of multiplatform support, I can't find specifics on this. What platforms support a JavaFX application? All those with Java SE? ME? Does it depend upon the APIs in JavaFX that I use?
JavaFX is a rich client platform for building Java applications that can run on multiple platforms, including Windows, macOS, and Linux. However, the support for JavaFX and its capabilities can vary depending on the environment and the specific APIs you use. Here are some specifics regarding platform support: ### Supp...
7,114
[ { "from": "human", "value": "I have read about JavaFX, and like all new technologies I wanted to get my hands \"dirty\" with it. However, although it talks of multiplatform support, I can't find specifics on this.\nWhat platforms support a JavaFX application? All those with Java SE? ME? Does it depend upon ...
I'm generating some xml files that needs to conform to an xsd file that was given to me. How should I verify they conform?
To verify that your XML files conform to a given XSD (XML Schema Definition) file, you can follow these steps: ### 1. **Use XML Validation Tools** There are several tools available that can validate XML against XSD: - **Online Validators**: Websites like [XMLValidation.com](https://www.xmlvalidation.com/) or [FreeFor...
4,701
[ { "from": "human", "value": "I'm generating some xml files that needs to conform to an xsd file that was given to me. How should I verify they conform?\n" }, { "from": "gpt", "value": "To verify that your XML files conform to a given XSD (XML Schema Definition) file, you can follow these steps:...
This is a really weird problem that I have been having. When I download Scriptaculous from the official web site, script.aculo.us, bundled in the ZIP is prototype.js version 1.6.0.1. This works perfectly fine, I can follow along the wiki examples and begin learning. However, when I upgrade to prototype 1.6.0.2 (the lat...
The issue you're encountering with Scriptaculous and Prototype.js is likely due to compatibility problems between different versions of the libraries. Scriptaculous was built to work with specific versions of Prototype, and upgrading Prototype can lead to breaking changes that affect Scriptaculous functionality. Here ...
11,709
[ { "from": "human", "value": "This is a really weird problem that I have been having. When I download Scriptaculous from the official web site, script.aculo.us, bundled in the ZIP is prototype.js version 1.6.0.1. This works perfectly fine, I can follow along the wiki examples and begin learning. However, whe...