instruction
stringlengths
14
27.6k
completion
stringlengths
3
38.3k
__original_row_idx
int64
0
50k
conversations
listlengths
2
2
In Notepad++, I was writing a JavaScript file and something didn't work: an alert had to be shown when a button was clicked, but it wasn't working. I has used the auto-complete plugin provided with Notepad++, which presented me with onClick. When I changed the capital C to a small c, it did work. So first of all, when ...
JavaScript is a case-sensitive programming language, which means that it distinguishes between uppercase and lowercase letters in variable names, function names, and other identifiers. This characteristic is fundamental to how the language operates and affects all of its identifiers. ### JavaScript Functions and Case ...
6,669
[ { "from": "human", "value": "In Notepad++, I was writing a JavaScript file and something didn't work: an alert had to be shown when a button was clicked, but it wasn't working.\nI has used the auto-complete plugin provided with Notepad++, which presented me with onClick.\nWhen I changed the capital C to a s...
We are in the early design stages of a major rewrite of our product. Right now our customers are mostly businesses. We manage accounts. User names for an account are each on their own namespace but it means that we can't move assets between servers. We want to move to a single namespace. But that brings the problem of ...
Transitioning to a single namespace for usernames while catering to a business-oriented customer base presents some interesting challenges. Here are some considerations for each of your proposed ideas, along with additional suggestions: ### 1. **Email Address (w/ Verification)** - **Pros:** - Email addresses a...
4,805
[ { "from": "human", "value": "We are in the early design stages of a major rewrite of our product. Right now our customers are mostly businesses. We manage accounts. User names for an account are each on their own namespace but it means that we can't move assets between servers.\nWe want to move to a single ...
The company I work for is starting to have issues with their current branching model and I was wondering what different kinds of branching strategies the community has been exposed to? Are there any good ones for different situations? What does your company use? What are the advantages and disadvantages of them??
Branching strategies in version control are essential for managing code changes effectively, especially in collaborative environments. Different teams and organizations use different models based on their development workflow, team size, and release cadence. Here are some commonly used branching strategies, along with ...
2,331
[ { "from": "human", "value": "The company I work for is starting to have issues with their current branching model and I was wondering what different kinds of branching strategies the community has been exposed to?\nAre there any good ones for different situations? What does your company use? What are the ...
Ok, narrow question of the day. I'm using GflAx (from xnview) to create some graphic tiles. I would like to put some gradients in as well though. Is there a way I can do this within this product? There is also an SDK which is part of this product but I can't find that info there.
GflAx, a component of XnView, primarily focuses on image manipulation and rendering but doesn't provide advanced gradient editing capabilities directly. However, you can still achieve gradient effects in your graphic tiles using a workaround or by utilizing the SDK. ### Here are some options you can consider: 1. **Us...
7,941
[ { "from": "human", "value": "Ok, narrow question of the day. I'm using GflAx (from xnview) to create some graphic tiles. I would like to put some gradients in as well though.\nIs there a way I can do this within this product?\nThere is also an SDK which is part of this product but I can't find that info t...
I'm trying to customize some TFS work items via the VS2008 xml editor, but every time I open a work item xml file it jumps to the graphical designer. All that gives me is a "View XML" button that doesn't let you edit the xml directly.
Visual Studio 2008 integrates with Team Foundation Server (TFS) to allow you to work with work item types, but as you've experienced, the graphical designer tends to take precedence over direct XML editing. Here are some steps you can take to edit the XML directly: ### Edit Work Item Types via XML in Visual Studio 1....
4,844
[ { "from": "human", "value": "I'm trying to customize some TFS work items via the VS2008 xml editor, but every time I open a work item xml file it jumps to the graphical designer. All that gives me is a \"View XML\" button that doesn't let you edit the xml directly.\n" }, { "from": "gpt", "value...
Someone told me it's more efficient to use StringBuffer to concatenate strings in Java than to use the + operator for Strings. What happens under the hood when you do that? What does StringBuffer do differently?
In Java, the way strings are concatenated can lead to significant performance differences depending on the method used, particularly when concatenating strings in a loop or repeatedly. ### Strings and the `+` Operator When you use the `+` operator to concatenate strings, Java creates a new `String` object every time ...
4,428
[ { "from": "human", "value": "Someone told me it's more efficient to use StringBuffer to concatenate strings in Java than to use the + operator for Strings. What happens under the hood when you do that? What does StringBuffer do differently?\n" }, { "from": "gpt", "value": "In Java, the way strin...
I am trying to come up with the best way to render some hierarchical data in to a nested unordered list using ASP.NET MVC. Does anyone have any tips on how to do this?
Rendering hierarchical data into a nested unordered list in ASP.NET MVC can be achieved by leveraging recursive methods to traverse your data structure and generate the HTML markup accordingly. Here's a step-by-step approach to accomplish this: ### 1. Define Your Data Model First, you need to define a model that repr...
4,561
[ { "from": "human", "value": "I am trying to come up with the best way to render some hierarchical data in to a nested unordered list using ASP.NET MVC. Does anyone have any tips on how to do this?\n" }, { "from": "gpt", "value": "Rendering hierarchical data into a nested unordered list in ASP.NE...
I'm about to inherit a set of large and complex set of stored procedures that do monthly processing on very large sets of data. We are in the process of debugging them so they match the original process which was written in VB6. The reason they decided to re write them in t-sql is because the vb process takes days and ...
Inheriting large and complex T-SQL stored procedures can indeed be daunting, especially when transitioning from a legacy system like VB6 to a modern SQL implementation. Here are some strategies to improve readability, maintainability, and overall manageability of your T-SQL code: ### 1. **Code Organization** - **Br...
4,485
[ { "from": "human", "value": "I'm about to inherit a set of large and complex set of stored procedures that do monthly processing on very large sets of data.\nWe are in the process of debugging them so they match the original process which was written in VB6. The reason they decided to re write them in t-sql...
I've got the following SQL: select * from transaction_log where stoptime like '%2008%' How do I write this in LINQ to SQL syntax?
To convert your SQL query into LINQ to SQL syntax, you can use the `Where` method along with the `Contains` method to filter for records where the `stoptime` field contains the year '2008'. Here’s how you can write it in C#: ```csharp using (var context = new YourDataContext()) { var results = context.TransactionL...
7,601
[ { "from": "human", "value": "I've got the following SQL:\nselect * from transaction_log where stoptime like '%2008%'\n\nHow do I write this in LINQ to SQL syntax?\n" }, { "from": "gpt", "value": "To convert your SQL query into LINQ to SQL syntax, you can use the `Where` method along with the `Co...
Is there an easy way to ensure that after a drag-and-drop fails to complete, the MouseUp event isn't eaten up and ignored by the framework? I have found a blog post describing one mechanism, but it involves a good deal of manual bookkeeping, including status flags, MouseMove events, manual "mouse leave" checking, etc. ...
Handling drag-and-drop operations in applications can be challenging, especially when trying to ensure that events like `MouseUp` are not inadvertently ignored after a drag operation fails. The traditional approach does often require extensive state management, but there are some strategies you can employ to simplify t...
4,193
[ { "from": "human", "value": "Is there an easy way to ensure that after a drag-and-drop fails to complete, the MouseUp event isn't eaten up and ignored by the framework?\nI have found a blog post describing one mechanism, but it involves a good deal of manual bookkeeping, including status flags, MouseMove ev...
If so what are required configuration elements to enable UTF-8 for tiles? I'm finding my tile results are sent as: Content-Type text/html;
To enable UTF-8 encoding for tiles (often related to web applications, templating engines, or web frameworks), you need to ensure that both the server-side configuration and the client-side settings are correctly set up. Here are the essential steps and configuration elements you may need: ### Server-Side Configuratio...
3,268
[ { "from": "human", "value": "If so what are required configuration elements to enable UTF-8 for tiles? \nI'm finding my tile results are sent as:\nContent-Type text/html;\n\n" }, { "from": "gpt", "value": "To enable UTF-8 encoding for tiles (often related to web applications, templating engi...
It may not be best practice but are there ways of removing unsused classes from a third party's jar files. Something that looks at the way in which my classes are using the library and does some kind of coverage analysis, then spits out another jar with all of the untouched classes removed. Obviously there are issues ...
Yes, in principle, it is possible to remove unused classes from a third-party JAR file by analyzing your own application's usage of the library. However, this process involves several challenges and considerations. Here's an overview of how you might approach this: ### 1. **Bytecode Analysis** - You would need to a...
5,880
[ { "from": "human", "value": "It may not be best practice but are there ways of removing unsused classes from a third party's jar files. Something that looks at the way in which my classes are using the library and does some kind of coverage analysis, then spits out another jar with all of the untouched cla...
Does a free .NET library exist with which I can upload a file to a SFTP (SSH FTP) server, which throws exceptions on problems with the upload and allows the monitoring of its progress?
Yes, there are several free .NET libraries that support SFTP file uploads and provide exception handling as well as progress monitoring. One popular library you can use is **SSH.NET**. This library is open-source and available on NuGet. ### Features of SSH.NET: - Supports SFTP (SSH File Transfer Protocol). - Exception...
4,297
[ { "from": "human", "value": "Does a free .NET library exist with which I can upload a file to a SFTP (SSH FTP) server, which throws exceptions on problems with the upload and allows the monitoring of its progress?\n" }, { "from": "gpt", "value": "Yes, there are several free .NET libraries that s...
I've always preferred to use long integers as primary keys in databases, for simplicity and (assumed) speed. But when using a REST or Rails-like URL scheme for object instances, I'd then end up with URLs like this: http://example.com/user/783 And then the assumption is that there are also users with IDs of 782, 781, ....
The considerations you've raised about using long integers versus UUIDs as primary keys in a web application context are very valid. Let's break down the points you've made and explore the implications of each approach. ### Security Considerations 1. **Information Leakage**: - As you pointed out, using sequential...
4,647
[ { "from": "human", "value": "I've always preferred to use long integers as primary keys in databases, for simplicity and (assumed) speed. But when using a REST or Rails-like URL scheme for object instances, I'd then end up with URLs like this:\nhttp://example.com/user/783\n\nAnd then the assumption is that ...
Today I had a coworker suggest I refactor my code to use a label statement to control flow through 2 nested for loops I had created. I've never used them before because personally I think they decrease the readability of a program. I am willing to change my mind about using them if the argument is solid enough however....
Label statements, particularly in languages like Java or C, allow you to define a label that can be used with control flow statements such as `break` or `continue`. While they can be useful for controlling flow in nested loops, they are often considered controversial due to their potential impact on code readability an...
6,099
[ { "from": "human", "value": "Today I had a coworker suggest I refactor my code to use a label statement to control flow through 2 nested for loops I had created. I've never used them before because personally I think they decrease the readability of a program. I am willing to change my mind about using them...
How do I open the default mail program with a Subject and Body in a cross-platform way? Unfortunately, this is for a a client app written in Java, not a website. I would like this to work in a cross-platform way (which means Windows and Mac, sorry Linux). I am happy to execute a VBScript in Windows, or AppleScript in O...
To open the default mail program with a subject and body in a cross-platform manner (Windows and macOS) from a Java application, you can use the following approaches: ### Java Code Implementation 1. **Windows**: Use `cmd.exe` with `start` to open the default mail application. 2. **macOS**: Use the `open` command with...
5,058
[ { "from": "human", "value": "How do I open the default mail program with a Subject and Body in a cross-platform way?\nUnfortunately, this is for a a client app written in Java, not a website.\nI would like this to work in a cross-platform way (which means Windows and Mac, sorry Linux). I am happy to execute...
Over at Can you modify text files when committing to subversion? Grant suggested that I block commits instead. However I don't know how to check a file ends with a newline. How can you detect that the file ends with a newline?
To check if a file ends with a newline in a Unix-like environment (Linux, macOS), you can use several methods. Here are a few common approaches: ### Using `tail` You can use the `tail` command to check the last character of the file: ```bash if [ "$(tail -c 1 yourfile.txt)" == "" ]; then echo "File ends with a ne...
6,822
[ { "from": "human", "value": "Over at Can you modify text files when committing to subversion? Grant suggested that I block commits instead.\nHowever I don't know how to check a file ends with a newline. How can you detect that the file ends with a newline?\n" }, { "from": "gpt", "value": "To che...
I have quite a few developers asking me if certain SQL jobs ran, and I would like to give them access to check it on their own without giving them sysadmin rights. I know that in SQL 2005, you can grant them the SQLAgentReaderRole, but I am looking for a solution in SQL 2000.
In SQL Server 2000, there isn't a built-in role like `SQLAgentReaderRole` that exists in later versions to give users access to view SQL Server Agent jobs. However, you can provide them with the necessary permissions through a combination of granting access to certain system tables and potentially creating a stored pro...
5,037
[ { "from": "human", "value": "I have quite a few developers asking me if certain SQL jobs ran, and I would like to give them access to check it on their own without giving them sysadmin rights. I know that in SQL 2005, you can grant them the SQLAgentReaderRole, but I am looking for a solution in SQL 2000. ...
We are currently storing plain text passwords for a web app that we have. I keep advocating moving to a password hash but another developer said that this would be less secure -- more passwords could match the hash and a dictionary/hash attack would be faster. Is there any truth to this argument?
The argument presented by your colleague is a misunderstanding of how password hashing works and the security principles surrounding it. Storing plain text passwords is inherently insecure, while hashing them is a widely accepted best practice for securing passwords. Here’s a breakdown of the concepts: 1. **Plain Tex...
6,977
[ { "from": "human", "value": "We are currently storing plain text passwords for a web app that we have. \nI keep advocating moving to a password hash but another developer said that this would be less secure -- more passwords could match the hash and a dictionary/hash attack would be faster.\nIs there any t...
In terms of performance and optimizations: When constructing a table in SQL Server, does it matter what order I put the columns in? Does it matter if my primary key is the first column? When constructing a multi-field index, does it matter if the columns are adjacent? Using ALTER TABLE syntax, is it possible to specif...
When constructing a table in SQL Server, the order of columns can have various implications, though not all may be performance-related. Let's address your questions one by one: ### 1. **Does it matter what order I put the columns in?** The order of columns in a table does not significantly affect the performance of qu...
2,204
[ { "from": "human", "value": "In terms of performance and optimizations:\n\nWhen constructing a table in SQL Server, does it matter what order I put the columns in?\nDoes it matter if my primary key is the first column?\nWhen constructing a multi-field index, does it matter if the columns are adjacent?\nUsin...
Anti aliasing cannot be turned off in WPF. But I want to remove the blurred look of WPF fonts when they are small. One possibility would be to use a .net 2.0 component. This looks like it would lose the transparency capability and Blend support. Never tried it though. Anyone has a solution for this? Any drawbacks from...
WPF (Windows Presentation Foundation) uses subpixel rendering and anti-aliasing for fonts, which can sometimes lead to a blurred appearance, especially for small text sizes. While there isn't a straightforward way to turn off anti-aliasing entirely, there are a few approaches you can take to minimize the blurriness of ...
3,806
[ { "from": "human", "value": "Anti aliasing cannot be turned off in WPF. But I want to remove the blurred look of WPF fonts when they are small. \nOne possibility would be to use a .net 2.0 component. This looks like it would lose the transparency capability and Blend support. Never tried it though.\nAnyone ...
I'm trying to retrieve a file from a server using SFTP (as opposed to FTPS) using Java. How can I do this?
To retrieve a file from a server using SFTP in Java, you can use the Apache MINA SSHD or JSch library. Here, I'll provide a simple example using JSch, which is a widely used library for SFTP operations. ### Step 1: Add JSch Dependency If you are using Maven, you can add JSch as a dependency in your `pom.xml` file: `...
4,633
[ { "from": "human", "value": "I'm trying to retrieve a file from a server using SFTP (as opposed to FTPS) using Java. How can I do this?\n" }, { "from": "gpt", "value": "To retrieve a file from a server using SFTP in Java, you can use the Apache MINA SSHD or JSch library. Here, I'll provide a sim...
What considerations do I need to make if I want my code to run correctly on both 32bit and 64bit platforms ? EDIT: What kind of areas do I need to take care in, e.g. printing strings/characters or using structures ?
When writing code that needs to run correctly on both 32-bit and 64-bit platforms, there are several key considerations to take into account. Here are some important areas to focus on: ### 1. Data Types and Size - **Integer Types**: Be cautious with the size of integer types. `int` is typically 32 bits on both platfor...
4,042
[ { "from": "human", "value": "What considerations do I need to make if I want my code to run correctly on both 32bit and 64bit platforms ?\nEDIT: What kind of areas do I need to take care in, e.g. printing strings/characters or using structures ?\n" }, { "from": "gpt", "value": "When writing code...
celsius = (5.0/9.0) * (fahr-32.0); Is it just a development choice that the C developers decided upon or is there a reason to this? I believe a float is smaller than a double, so it might be to prevent overflows caused by not knowing what decimal format to use. Is that the reason, or am I overlooking something?
The line of code you've presented is used to convert a temperature from Fahrenheit to Celsius using the formula \( C = \frac{5}{9} \times (F - 32) \). To break down your question and address the points you raised regarding the use of `float` vs. `double`, we need to consider several factors: 1. **Data Types (float vs....
5,329
[ { "from": "human", "value": "celsius = (5.0/9.0) * (fahr-32.0);\nIs it just a development choice that the C developers decided upon or is there a reason to this? I believe a float is smaller than a double, so it might be to prevent overflows caused by not knowing what decimal format to use. Is that the reas...
I'm looking for a wordpress-like blog interface to put inside a Joomla hosted site. The admin interface of Joomla is quirky enough and hard enough to use that daily updates are infeasible. What I am looking for is an easy-to-use posting interface that supports multiple users with different accounts/names, a tagging ...
If you're looking for a WordPress-like blogging interface that can be integrated into a Joomla-hosted site, there are several extensions you can consider. Here are some popular options that are generally easier to use and may meet your requirements for a user-friendly posting interface, multi-user support, tagging, and...
4,972
[ { "from": "human", "value": "I'm looking for a wordpress-like blog interface to put inside a Joomla hosted site. The admin interface of Joomla is quirky enough and hard enough to use that daily updates are infeasible. \nWhat I am looking for is an easy-to-use posting interface that supports multiple users...
Which is the simplest way to check if two integers have same sign? Is there any short bitwise trick to do this?
Yes, you can use a bitwise operation to check if two integers have the same sign. The simplest way to do this is to use the following expression: ```c (a ^ b) < 0 ``` Here's how it works: 1. The XOR operator `^` will give a negative result when `a` and `b` have different signs. This is because the sign bit (most sig...
7,525
[ { "from": "human", "value": "Which is the simplest way to check if two integers have same sign? Is there any short bitwise trick to do this?\n" }, { "from": "gpt", "value": "Yes, you can use a bitwise operation to check if two integers have the same sign. The simplest way to do this is to use th...
Given 2 rgb colors and a rectangular area, I'd like to generate a basic linear gradient between the colors. I've done a quick search and the only thing I've been able to find is this blog entry, but the example code seems to be missing, or at least it was as of this posting. Anything helps, algorithms, code examples, w...
Creating a linear gradient between two RGB colors over a rectangular area involves interpolating between the two colors based on the position within the rectangle. Below is a Java implementation to generate the gradient color for a specific point in a rectangular area. ### Linear Gradient Algorithm 1. **Define the C...
409
[ { "from": "human", "value": "Given 2 rgb colors and a rectangular area, I'd like to generate a basic linear gradient between the colors. I've done a quick search and the only thing I've been able to find is this blog entry, but the example code seems to be missing, or at least it was as of this posting. Any...
I'm looking for a profiler in order to find the bottleneck in my C++ code. I'd like to find a free, non-intrusive, and good profiling tool. I'm a game developer, and I use PIX for Xbox 360 and found it very good, but it's not free. I know the Intel VTune, but it's not free either.
There are several free and non-intrusive profiling tools you can use for your C++ code, especially in the context of game development. Here are some popular options: 1. **Visual Studio Profiler**: If you're using Visual Studio, the built-in performance profiler is a good option. It's free with the Community edition an...
5,806
[ { "from": "human", "value": "I'm looking for a profiler in order to find the bottleneck in my C++ code. I'd like to find a free, non-intrusive, and good profiling tool. I'm a game developer, and I use PIX for Xbox 360 and found it very good, but it's not free. I know the Intel VTune, but it's not free eithe...
I want to paste something I have cut from my desktop into a file open in Vi. But if I paste the tabs embed on top of each other across the page. I think it is some sort of visual mode change but can't find the command.
When you paste content into Vim, especially when it contains tabs or spaces, you may encounter issues with the indentation or the formatting of the pasted text. This is typically due to how Vim handles paste operations by default. To paste text from your clipboard without Vim altering the formatting, you should use th...
6,520
[ { "from": "human", "value": "I want to paste something I have cut from my desktop into a file open in Vi.\nBut if I paste the tabs embed on top of each other across the page.\nI think it is some sort of visual mode change but can't find the command.\n" }, { "from": "gpt", "value": "When you past...
When installing subversion as a service, I used this command: c:\>svnservice -install --daemon --root "c:\documents and settings\my_repository" And then I got this error: Could not create service in service control manager. After looking at some MSDN docs on the service control manager, I tried granting full control ...
The error you encountered when trying to install Subversion (SVN) as a service can stem from several factors. Here are some troubleshooting steps and suggestions to help you resolve the issue: 1. **Verify the Command Syntax**: Make sure that the command you used is correctly formatted and that you are indeed pointing ...
3,909
[ { "from": "human", "value": "When installing subversion as a service, I used this command:\nc:\\>svnservice -install --daemon --root \"c:\\documents and settings\\my_repository\"\n\nAnd then I got this error:\nCould not create service in service control manager.\n\nAfter looking at some MSDN docs on the ser...
I'm just looking for a simple, concise explanation of the difference between these two. MSDN doesn't go into a hell of a lot of detail here.
Sure! If you could specify which two topics or terms you're referring to, I'd be happy to provide a simple and concise explanation of the differences between them.
9,655
[ { "from": "human", "value": "I'm just looking for a simple, concise explanation of the difference between these two. MSDN doesn't go into a hell of a lot of detail here.\n" }, { "from": "gpt", "value": "Sure! If you could specify which two topics or terms you're referring to, I'd be happy to pro...
I hope this question is not considered too basic for this forum, but we'll see. I'm wondering how to refactor some code for better performance that is getting run a bunch of times. Say I'm creating a word frequency list, using a Map (probably a HashMap), where each key is a String with the word that's being counted and...
Your question is definitely valid and addresses a common scenario in programming. The code you've provided for incrementing word counts in a `Map` is perfectly functional but can be optimized for both readability and performance. In Java, you can simplify the increment operation using the `Map` interface with `compute...
6,267
[ { "from": "human", "value": "I hope this question is not considered too basic for this forum, but we'll see. I'm wondering how to refactor some code for better performance that is getting run a bunch of times.\nSay I'm creating a word frequency list, using a Map (probably a HashMap), where each key is a Str...
I'm designing a language. First, I want to decide what code to generate. The language will have lexical closures and prototype based inheritance similar to javascript. But I'm not a fan of gc and try to avoid as much as possible. So the question: Is there an elegant way to implement closures without resorting to alloca...
Designing a language with lexical closures while minimizing or eliminating garbage collection is a challenging but intriguing problem. Here are some approaches that may help you achieve that goal: ### 1. **Closure Context Pools** Instead of dynamically allocating closure contexts on the heap, you could implement a sys...
5,421
[ { "from": "human", "value": "I'm designing a language. First, I want to decide what code to generate. The language will have lexical closures and prototype based inheritance similar to javascript. But I'm not a fan of gc and try to avoid as much as possible. So the question: Is there an elegant way to imple...
I am maintaining an app for a client that is used in two locations. One in England and one in Poland. The database is stored in England and uses the format £1000.00 for currency, but the information is being gathered locally in Poland where 1000,00 is the format. My question is, in VB6 is there a function that takes a ...
In VB6, there isn't a built-in function specifically designed to convert currency formats between different locale representations (like converting "1,000.00" to "1.000,00"). You typically have to handle this conversion manually by parsing and replacing the characters as necessary. Here’s a simple approach to parse an...
1,552
[ { "from": "human", "value": "I am maintaining an app for a client that is used in two locations. One in England and one in Poland.\nThe database is stored in England and uses the format £1000.00 for currency, but the information is being gathered locally in Poland where 1000,00 is the format.\nMy question i...
I've got a problem where incoming SOAP messages from one particular client are being marked as invalid and rejected by our XML firewall device. It appears extra payload data is being inserted by Visual Studio; we're thinking the extra data may be causing a problem b/c we're seeing "VsDebuggerCausalityData" in these mes...
The presence of "VsDebuggerCausalityData" in SOAP messages typically indicates that the Visual Studio debugger is attaching certain metadata to the messages. This extra data is usually helpful for debugging scenarios but can cause issues with strict XML validation checks, like the ones enforced by your XML firewall. #...
5,454
[ { "from": "human", "value": "I've got a problem where incoming SOAP messages from one particular client are being marked as invalid and rejected by our XML firewall device. It appears extra payload data is being inserted by Visual Studio; we're thinking the extra data may be causing a problem b/c we're seei...
Is there any difference to the following code: class Foo { inline int SomeFunc() { return 42; } int AnotherFunc() { return 42; } }; Will both functions gets inlined? Does inline actually make any difference? Are there any rules on when you should or shouldn't inline code? I often use the AnotherFunc syntax (acc...
In C++, the `inline` keyword serves as a suggestion to the compiler that it might be beneficial to expand the function's code at the call site, rather than incurring the overhead of a function call. Here's a breakdown of your questions regarding the code example you provided: ### Differences between `inline` and non-`...
4,694
[ { "from": "human", "value": "Is there any difference to the following code:\nclass Foo \n{\n inline int SomeFunc() { return 42; }\n int AnotherFunc() { return 42; }\n};\n\nWill both functions gets inlined? Does inline actually make any difference? Are there any rules on when you should or shouldn't inlin...
I understand how JS is run and I think I understand most of the DOM but I've no idea about animation. Does anybody here know of a good guide that can explain to me how it's done in Javascript? In addition, should I even consider Javascript for animation? Should I instead be looking to learn flash?
It's great that you're diving into JavaScript and the DOM! For animations in JavaScript, there are several approaches you can take, each with its own strengths. Here’s a brief guide on how to get started with animations in JavaScript: ### 1. **CSS Animations and Transitions** Before diving into JavaScript for animatio...
4,357
[ { "from": "human", "value": "I understand how JS is run and I think I understand most of the DOM but I've no idea about animation. Does anybody here know of a good guide that can explain to me how it's done in Javascript?\nIn addition, should I even consider Javascript for animation? Should I instead be loo...
What is a good way to render data produced by a Java process in the browser? I've made extensive use of JSP and the various associated frameworks (JSTL, Struts, Tapestry, etc), as well as more comprehensive frameworks not related to JSP (GWT, OpenLaszlo). None of the solutions have ever been entirely satisfactory - in...
Using a servlet to expose your Java data as JSON is a solid approach, especially given your experiences with various frameworks that didn't meet your needs. Here are some considerations and alternative solutions that could enhance your current approach: ### 1. **Using Servlets with JSON** - **Servlets:** This is a lig...
3,960
[ { "from": "human", "value": "What is a good way to render data produced by a Java process in the browser? \nI've made extensive use of JSP and the various associated frameworks (JSTL, Struts, Tapestry, etc), as well as more comprehensive frameworks not related to JSP (GWT, OpenLaszlo). None of the solutions...
I am writting JAVA programme using JDBC for database conntectivity , I am calling one stored procedure in that which is returning ORACLE REF CURSOR , IS there any way I can handle that without importing ORACLE PACKAGES ?
Yes, you can handle an Oracle `REF CURSOR` in your JDBC code without explicitly importing Oracle-specific packages. You can do this using standard JDBC types and interfaces. Below is an example of how you can work with a `REF CURSOR` using a `CallableStatement`. ### Example Code Here’s how you might call a stored pro...
4,406
[ { "from": "human", "value": "I am writting JAVA programme using JDBC for database conntectivity , I am calling one stored procedure in that which is returning ORACLE REF CURSOR , IS there any way I can handle that without importing ORACLE PACKAGES ?\n" }, { "from": "gpt", "value": "Yes, you can ...
My company are thinking about using Mono for an upcoming product, so we were thinking about the $12,995 Mono Kickstart support from Novell. Anybody here used it, is it worth it?
Mono Kickstart support from Novell (now part of SUSE) can be a valuable investment depending on your company's specific needs and project requirements. Here are some factors to consider when evaluating whether it's worth it for your upcoming product: 1. **Expert Guidance**: Mono Kickstart provides access to experience...
7,425
[ { "from": "human", "value": "My company are thinking about using Mono for an upcoming product, so we were thinking about the $12,995 Mono Kickstart support from Novell.\nAnybody here used it, is it worth it?\n" }, { "from": "gpt", "value": "Mono Kickstart support from Novell (now part of SUSE) c...
Typical way of creating a CSV string (pseudocode): Create a CSV container object (like a StringBuilder in C#). Loop through the strings you want to add appending a comma after each one. After the loop, remove that last superfluous comma. Code sample: public string ReturnAsCSV(ContactList contactList) { StringBuil...
You're correct that checking the length of the string (or in this case, the `StringBuilder`) on each iteration could be less efficient due to the extra conditional checks. The approach of appending a comma after each item can lead to the issue of the superfluous comma at the end. To avoid needing to remove the last c...
6,335
[ { "from": "human", "value": "Typical way of creating a CSV string (pseudocode):\n\nCreate a CSV container object (like a StringBuilder in C#).\nLoop through the strings you want to add appending a comma after each one.\nAfter the loop, remove that last superfluous comma.\n\nCode sample:\npublic string Retur...
Using Windows Server 2003 in a multi-user environment (via Remote Desktop, using it as an application server), how to mount a (preferably encrypted) volume in a way, that won't show up on any other user's desktop? Tried, and failed approaches: tweaking user rights -display of mounted volume can not be changed. Bestcry...
Mounting an encrypted volume on Windows Server 2003 in a multi-user environment where the volume is not visible to other users can be challenging. However, there are some approaches you can consider: ### 1. Use Disk Management and User Permissions You can create a volume that’s only accessible to specific users. Here...
5,401
[ { "from": "human", "value": "Using Windows Server 2003 in a multi-user environment (via Remote Desktop, using it as an application server), how to mount a (preferably encrypted) volume in a way, that won't show up on any other user's desktop?\nTried, and failed approaches:\n\ntweaking user rights -display o...
Nevrona Designs' Rave Reports is a Report Engine for use by Embarcadero's Delphi IDE. This is what I call the Rave Endless Loop bug. In Rave Reports version 6.5.0 (VCL10) that comes bundled with Delphi 2006, there is a nortorious bug that plagues many Rave report developers. If you have a non-empty dataset, and the dat...
The Rave Endless Loop bug you've described in Rave Reports version 6.5.0, which is bundled with Delphi 2006, indeed sounds frustrating for developers. The issue of infinite looping when generating reports where the dataset exactly fits a page indicates a flaw in the pagination logic of the report engine. ### Possible ...
5,532
[ { "from": "human", "value": "Nevrona Designs' Rave Reports is a Report Engine for use by Embarcadero's Delphi IDE.\nThis is what I call the Rave Endless Loop bug. In Rave Reports\nversion 6.5.0 (VCL10) that comes bundled with Delphi 2006, there is a\nnortorious bug that plagues many Rave report developers. ...
Am I right in thinking the full name of the LSP is the Liskoff Substitution Principle? I'm having trouble finding an [online] source to cite for any information on this... it seems to be a cornerstone of OOP, and yet I'm having trouble finding definitions.
Yes, you are correct! The full name of LSP is the **Liskov Substitution Principle**. It is one of the five SOLID principles of object-oriented programming and design, which aim to make software designs more understandable, flexible, and maintainable. The Liskov Substitution Principle, introduced by Barbara Liskov in ...
6,203
[ { "from": "human", "value": "Am I right in thinking the full name of the LSP is the Liskoff Substitution Principle? I'm having trouble finding an [online] source to cite for any information on this... it seems to be a cornerstone of OOP, and yet I'm having trouble finding definitions.\n" }, { "from"...
I have a layered application in Java which has a multi thread data access layer which is invoked from different points. A single call to this layer is likely to spawn several threads to parallelize requests to the DB. What I'm looking for is a logging tool that would allow me to define "activities" that are composed b...
Implementing a logging system that can capture and group activity across multiple threads in a layered application can be quite a challenge, especially when you want to correlate logs from different threads into a cohesive activity log. Here are some design guidelines and concepts that could help you achieve the desire...
3,256
[ { "from": "human", "value": "I have a layered application in Java which has a multi thread data access layer which is invoked from different points. A single call to this layer is likely to spawn several threads to parallelize requests to the DB. \nWhat I'm looking for is a logging tool that would allow me ...
We have simple HTML form with <input type="file">, like shown below: <form> <label for="attachment">Attachment:</label> <input type="file" name="attachment" id="attachment"> <input type="submit"> </form> In IE7 (and probably all famous browsers, including old Firefox 2), if we submit a file like '//server1/path/...
Unfortunately, the behavior you're experiencing is a result of security measures implemented in modern browsers to protect user privacy. Here are some key points regarding file uploads and file paths in different browsers: 1. **Security Feature**: As you mentioned, starting with Firefox 3, browsers began to enforce se...
5,976
[ { "from": "human", "value": "We have simple HTML form with <input type=\"file\">, like shown below:\n<form>\n <label for=\"attachment\">Attachment:</label>\n <input type=\"file\" name=\"attachment\" id=\"attachment\">\n <input type=\"submit\">\n</form>\n\nIn IE7 (and probably all famous browsers, includi...
Can this be done by setting a property? I'd prefer that approach then to remove all security before re-adding it. (As this may have other consequences.) Another option I can think of is to replace the particular webpart dll with a temporary one, and restart the .net process, but that's not an approach I like at all. ...
Disabling a web part while updating the underlying database schema without causing significant downtime can be challenging, but there are several strategies you can consider: ### 1. Use a Configuration Property: If your web part supports configuration properties, you could implement a property that allows you to enabl...
4,559
[ { "from": "human", "value": "Can this be done by setting a property? \nI'd prefer that approach then to remove all security before re-adding it. \n(As this may have other consequences.)\nAnother option I can think of is to replace the particular webpart dll with a temporary one, and restart the .net process...
I need to write a Delphi application that pulls entries up from various tables in a database, and different entries will be in different currencies. Thus, I need to show a different number of decimal places and a different currency character for every Currency data type ($, Pounds, Euros, etc) depending on the currenc...
In a Delphi application, if you want to display currency values with different formatting depending on the currency type (including different currency symbols and decimal places), you can achieve this by creating a custom function to format your currency display. While there isn't a built-in way to change the currency ...
3,856
[ { "from": "human", "value": "I need to write a Delphi application that pulls entries up from various tables in a database, and different entries will be in different currencies. Thus, I need to show a different number of decimal places and a different currency character for every Currency data type ($, Pou...
I had a discussion with some colleagues mentioning that there are not too many projects that we do which make use of WPF for creating UI for a windows application (we almost always use Windows Forms instead). Are your experiences the same - i.e. there is not too much adoption of this technology? Why do you think that ...
Your observations about the adoption of WPF (Windows Presentation Foundation) versus Windows Forms are quite common in the developer community. Here are some insights into the current landscape, reasons for the observed trends, and potential future scenarios: ### Current Adoption and Trends 1. **Legacy Systems**: Man...
4,554
[ { "from": "human", "value": "I had a discussion with some colleagues mentioning that there are not too many projects that we do which make use of WPF for creating UI for a windows application (we almost always use Windows Forms instead).\n\nAre your experiences the same - i.e. there is not too much adoption...
I need to determine if I'm on a particular view. My use case is that I'd like to decorate navigation elements with an "on" class for the current view. Is there a built in way of doing this?
In many web frameworks and libraries, there are built-in ways to determine if you're on a particular view or route, which can help you conditionally apply an "on" class to your navigation elements. Here are some common methods for achieving this in popular frameworks: ### 1. **React Router (React)** If you are using ...
3,243
[ { "from": "human", "value": "I need to determine if I'm on a particular view. My use case is that I'd like to decorate navigation elements with an \"on\" class for the current view. Is there a built in way of doing this?\n" }, { "from": "gpt", "value": "In many web frameworks and libraries, th...
How to create a DOM from a User's input in PHP5?
Creating a DOM (Document Object Model) structure in PHP based on user input typically involves using the `DOMDocument` class provided by PHP. This is often used for generating XML or HTML documents dynamically. Below is a step-by-step example of how you can create a simple DOM structure from user input in PHP 5. For t...
4,363
[ { "from": "human", "value": "How to create a DOM from a User's input in PHP5?\n" }, { "from": "gpt", "value": "Creating a DOM (Document Object Model) structure in PHP based on user input typically involves using the `DOMDocument` class provided by PHP. This is often used for generating XML or HT...
I've got a website that I've just uploaded onto the interwebs, and it's displaying differently using Firefox 3.0.1 on Ubuntu and WinXP. Two things I've noticed on Ubuntu: The favicon is missing The background color isn't displaying (it's set in the stylesheet) What have I done wrong? The CSS file is being fetched u...
It sounds like you've encountered a couple of common issues that can arise due to differences in how browsers handle rendering, caching, and HTML/CSS validation. Let's break down the points you raised: ### Background Color Issue 1. **Invalid HTML**: If your HTML is not valid, certain browsers may have different level...
4,860
[ { "from": "human", "value": "I've got a website that I've just uploaded onto the interwebs, and it's displaying differently using Firefox 3.0.1 on Ubuntu and WinXP.\nTwo things I've noticed on Ubuntu:\n\nThe favicon is missing \nThe background color isn't displaying (it's set in the stylesheet)\n\nWhat have...
I'm working on a cross platform application in Java which currently works nicely on Windows, Linux and MacOS X. I'm trying to work out a nice way to do detection (and handling) of 'crashes'. Is there an easy, cross-platform way to detect 'crashes' in Java and to do something in response? I guess by 'crashes' I mean unc...
Handling crashes in a Java application, especially when using JNI (Java Native Interface), can be tricky because Java is primarily designed to handle exceptions at the Java level. Here are some strategies for detecting and handling crashes in a cross-platform manner: ### 1. Uncaught Exception Handlers You can use the...
3,233
[ { "from": "human", "value": "I'm working on a cross platform application in Java which currently works nicely on Windows, Linux and MacOS X. I'm trying to work out a nice way to do detection (and handling) of 'crashes'. Is there an easy, cross-platform way to detect 'crashes' in Java and to do something in ...
For scripting languages, what is the most effective way to utilize a console when developing? Are there ways to be more productive with a console than a "compile and run" only language? Added clarification: I am thinking more along the lines of Ruby, Python, Boo, etc. Languages that are used for full blown apps, but al...
Using a console or REPL (Read-Eval-Print Loop) environment while developing in scripting languages like Ruby, Python, or Boo can greatly enhance your productivity. Here are several effective ways to leverage the console in your development workflow: ### Advantages of Using a Console 1. **Immediate Feedback**: You can...
4,046
[ { "from": "human", "value": "For scripting languages, what is the most effective way to utilize a console when developing? Are there ways to be more productive with a console than a \"compile and run\" only language?\nAdded clarification: I am thinking more along the lines of Ruby, Python, Boo, etc. Languag...
I have a set of multiple assemblies (one assembly is to be used as an API and it depends on other assemblies). I would like to merge all assemblies into one single assembly but prevent all assemblies except the API one to be visible from the outside. I will then obfuscate this assembly with Xenocode. From what I have s...
ILMerge is a tool from Microsoft that allows you to combine multiple .NET assemblies into a single assembly. It does have some features that can help you with your requirement of merging assemblies while restricting visibility. Here’s how you can achieve your goal: 1. **Use ILMerge to Combine Assemblies**: Start by me...
5,750
[ { "from": "human", "value": "I have a set of multiple assemblies (one assembly is to be used as an API and it depends on other assemblies). I would like to merge all assemblies into one single assembly but prevent all assemblies except the API one to be visible from the outside.\nI will then obfuscate this ...
How do I implement a Copy menu item in a Windows application written in C#/.NET 2.0? I want to let the user to mark some text in a control and then select the Copy menu item from an Edit menu in the menubar of the application and then do a Paste in for example Excel. What makes my head spin is how to first determine w...
To implement a "Copy" menu item in a Windows Forms application written in C#/.NET 2.0, you need to accomplish a few tasks: 1. **Create the Menu Structure**: Ensure you have an Edit menu with a Copy menu item in your application. 2. **Determine the Active Control**: Identify which form and control currently has focus. ...
1,978
[ { "from": "human", "value": "How do I implement a Copy menu item in a Windows application written in C#/.NET 2.0?\nI want to let the user to mark some text in a control and then select the Copy menu item from an Edit menu in the menubar of the application and then do a Paste in for example Excel. \nWhat mak...
Can anyone point me in the right direction on this. From reading the FAQs at cruisecontrol, it appears that you should develop in the same environment as you produce. But i have Windows XP (which only runs IIS 5.1) on my dev machine and the server is 2003.
It's true that developing in a similar environment to your production server can help avoid issues that arise from differences in configuration or behavior. Given that you're working with Windows XP and IIS 5.1 while your production environment is on Windows Server 2003 with IIS 6.0, here are a few suggestions to help ...
4,677
[ { "from": "human", "value": "Can anyone point me in the right direction on this. From reading the FAQs at cruisecontrol, it appears that you should develop in the same environment as you produce.\nBut i have Windows XP (which only runs IIS 5.1) on my dev machine and the server is 2003.\n" }, { "from...
Anyone know of a way to use SVK with perforce? The docs seem to imply it used to be possible, but some mailing list messages claim that is no longer the case?
SVK is a version control system that was designed to work as a distributed extension of Subversion (SVN), and it doesn't natively support Perforce (P4). Historically, there were some attempts to integrate SVK with different version control systems, including Perforce, but the level of support and functionality might ha...
4,370
[ { "from": "human", "value": "Anyone know of a way to use SVK with perforce? The docs seem to imply it used to be possible, but some mailing list messages claim that is no longer the case?\n" }, { "from": "gpt", "value": "SVK is a version control system that was designed to work as a distributed...
In a web application like wiki or forums or blogging software, it is often useful to store your data in a relational database. Since many hosting companies offer a single database with their hosting plans (with additional databases costing extra) it is very useful for your users when your database objects (tables, view...
When it comes to using a custom table prefix that can be specified in a web.config file for a .NET-based ORM, you have a few options, although each has its own set of challenges. Let’s take a closer look at the alternatives you've mentioned and their capabilities in this context: ### 1. **Entity Framework (EF)** Entit...
2,789
[ { "from": "human", "value": "In a web application like wiki or forums or blogging software, it is often useful to store your data in a relational database. Since many hosting companies offer a single database with their hosting plans (with additional databases costing extra) it is very useful for your users...
While cross-site scripting is generally regarded as negative, I've run into several situations where it's necessary. I was recently working within the confines of a very limiting content management system. I needed to include database code within the page, but the hosting server didn't have anything usable available. ...
It sounds like you've been navigating a complex scenario with multiple constraints, and while your approach is clever, there are a few methods and best practices that can streamline your efforts and potentially offer more robust solutions for including content from a different domain. Here are some suggestions to consi...
3,930
[ { "from": "human", "value": "While cross-site scripting is generally regarded as negative, I've run into several situations where it's necessary.\nI was recently working within the confines of a very limiting content management system. I needed to include database code within the page, but the hosting serv...
What are they and what are they good for? I do not have a CS degree and my background is VB6 -> ASP -> ASP.NET/C#. Can anyone explain it in a clear and concise manner?
It seems like you might be asking about a range of technologies or concepts related to programming and web development, especially since your background includes languages and frameworks like VB6, ASP, and ASP.NET/C#. I'll provide a brief overview of some key concepts in modern software development and web technologies...
3,745
[ { "from": "human", "value": "What are they and what are they good for?\nI do not have a CS degree and my background is VB6 -> ASP -> ASP.NET/C#. Can anyone explain it in a clear and concise manner?\n" }, { "from": "gpt", "value": "It seems like you might be asking about a range of technologies o...
I am looking for a way to concatenate the strings of a field within a group by query. So for example, I have a table: ID COMPANY_ID EMPLOYEE 1 1 Anna 2 1 Bill 3 2 Carol 4 2 Dave and I wanted to group by company_id to get something like: COMPANY_ID EMPLOYEE 1 Anna, Bill 2 Carol, Dave Ther...
Yes, in MySQL, you can achieve this using the `GROUP_CONCAT` function. The `GROUP_CONCAT` function concatenates values from multiple rows into a single string for each group. Here’s how you can write a query to group the employees by `COMPANY_ID` and concatenate their names: ```sql SELECT COMPANY_ID, GROUP_C...
8,168
[ { "from": "human", "value": "I am looking for a way to concatenate the strings of a field within a group by query. So for example, I have a table:\n\n\n\n\nID\nCOMPANY_ID\nEMPLOYEE\n\n\n\n\n1\n1\nAnna\n\n\n2\n1\nBill\n\n\n3\n2\nCarol\n\n\n4\n2\nDave\n\n\n\n\nand I wanted to group by company_id to get someth...
Is anyone using Elmah to send exceptions via email? I've got Elmah logging set up via SQL Server, and can view the errors page via the Elmah.axd page, but I am unable to get the email component working. The idea here is to get the email notification so we can react more quickly to exceptions. Here is my web.config (unn...
To enable email notifications for exceptions using Elmah in your ASP.NET application, you'll want to ensure a few things are correctly configured in your `web.config` file and that the SMTP server is properly set up. Here are the steps you should follow: 1. **SMTP Server Configuration**: Ensure that the SMTP server y...
4,578
[ { "from": "human", "value": "Is anyone using Elmah to send exceptions via email? I've got Elmah logging set up via SQL Server, and can view the errors page via the Elmah.axd page, but I am unable to get the email component working. The idea here is to get the email notification so we can react more quickly ...
It seems like the generation of SQL scripts from the SQL Server Management Studio is terribly slow. I think that the old Enterprise Manager could run laps around the newer script generation tool. I've seen a few posts here and there with other folks complaining about the speed, but I haven't seen much offered in the wa...
Yes, there are several alternatives to SQL Server Management Studio (SSMS) for generating scripts that may perform better or at least provide a different experience when scripting SQL Server databases. Here are a few low-cost or free tools you can
4,177
[ { "from": "human", "value": "It seems like the generation of SQL scripts from the SQL Server Management Studio is terribly slow. I think that the old Enterprise Manager could run laps around the newer script generation tool. I've seen a few posts here and there with other folks complaining about the speed, ...
Can anyone tell me what is the memory usage overhead associated with PHP opcode cache? I've seen a lot of reviews of opcode cache but all of them only concentrate on the performance increase. I have a small entry level VPS and memory limits are a concern for me.
The memory usage overhead associated with PHP opcode caches, like OPcache, can vary depending on several factors, including the size of your PHP codebase, the number of PHP files, and the configuration settings of the opcode cache itself. However, here are some general points to consider: 1. **Base Memory Usage**: The...
6,180
[ { "from": "human", "value": "Can anyone tell me what is the memory usage overhead associated with PHP opcode cache? \nI've seen a lot of reviews of opcode cache but all of them only concentrate on the performance increase. I have a small entry level VPS and memory limits are a concern for me. \n" }, { ...
I am new to the .Net Compact Framework and have been unable to find an answer via Google. Gasp! Yes, it's true, but that is part of why StackOverflow is here, right? I have a form that is longer than the screen, so a vertical scroll-bar appears as expected. However, this appears to force a horizontal scroll-bar to appe...
The issue you're experiencing with the horizontal scrollbar appearing when you have a vertical scrollbar in a form using the .NET Compact Framework can be related to how the layout is managed for the controls on the form. In many cases, forms and controls in the Compact Framework can have some quirks due to their limit...
3,898
[ { "from": "human", "value": "I am new to the .Net Compact Framework and have been unable to find an answer via Google. Gasp! Yes, it's true, but that is part of why StackOverflow is here, right?\nI have a form that is longer than the screen, so a vertical scroll-bar appears as expected. However, this appear...
I have a blogengine.net install that requires privatization. I'm doing research work at the moment, but I have to keep my blog/journal private until certain conditions are met. How can I privatize my blogEngine.net install so that readers must log in to read my posts?
To privatize your BlogEngine.NET installation so that readers must log in to view posts, you can take the following steps: ### 1. Enable Membership Ensure that the membership features are enabled in your BlogEngine.NET installation. This will allow user registration and logins. - Navigate to your BlogEngine.NET admin...
5,187
[ { "from": "human", "value": "I have a blogengine.net install that requires privatization.\nI'm doing research work at the moment, but I have to keep my blog/journal private until certain conditions are met.\nHow can I privatize my blogEngine.net install so that readers must log in to read my posts?\n" }, ...
In Ruby on Rails, there's RJS templates that help do AJAX by returning javascript code that will be executed in the client browser. How can I do a similar thing in the Java/J2EE world? Is Google Widget Toolkit similar to RJS? What options do I have?
In the Java/J2EE world, you have a variety of options to achieve similar AJAX functionality as RJS templates in Ruby on Rails, which primarily involves returning JavaScript code to be executed in the client's browser. ### Options for AJAX in Java/J2EE: 1. **JSP with JavaScript/AJAX**: - You can use JSP (JavaServer...
4,568
[ { "from": "human", "value": "In Ruby on Rails, there's RJS templates that help do AJAX by returning javascript code that will be executed in the client browser. How can I do a similar thing in the Java/J2EE world? Is Google Widget Toolkit similar to RJS? What options do I have? \n" }, { "from": "gpt...
How do I declare "as any" in VB.NET, or what is the equivalent?
In VB.NET, the equivalent of declaring a variable as `Object` (which is similar to `as any` in other programming languages like TypeScript) is simply to declare it as an `Object`. The `Object` type can hold any data type, so you can use it to store different kinds of values. Here’s how you can declare a variable as `O...
7,445
[ { "from": "human", "value": "How do I declare \"as any\" in VB.NET, or what is the equivalent?\n" }, { "from": "gpt", "value": "In VB.NET, the equivalent of declaring a variable as `Object` (which is similar to `as any` in other programming languages like TypeScript) is simply to declare it as a...
On IIS 6, what does an IIS reset do? Please compare to recycling an app pool and stopping and starting an ASP.NET web site. If you replace a DLL or edit/replace the web.config on an ASP.NET web site is that the same as stopping and starting that web site?
In IIS 6, performing an **IIS Reset** is a more drastic operation compared to recycling an application pool or stopping and starting a web site. Here's a detailed comparison of the different actions: ### IIS Reset - **Definition**: An IIS Reset is a command that stops and restarts the entire IIS service (World Wide We...
3,656
[ { "from": "human", "value": "On IIS 6, what does an IIS reset do? \nPlease compare to recycling an app pool and stopping and starting an ASP.NET web site.\nIf you replace a DLL or edit/replace the web.config on an ASP.NET web site is that the same as stopping and starting that web site?\n" }, { "fro...
I'm developing a compiler framework for .NET and want a flexible way of defining pipelines. I've considered the following options: WWF Custom XML pipeline description Custom pipeline description in code (using Nemerle's macros to define syntax for it) Other code-based description Requirements: Must not depend on fu...
Creating a compiler framework with a flexible pipeline definition can indeed be challenging, especially with the constraints you're working under. Based on your requirements, here are some possible solutions you might consider: ### 1. **Custom XML Pipeline Description** This is a viable option since XML is a widely s...
3,426
[ { "from": "human", "value": "I'm developing a compiler framework for .NET and want a flexible way of defining pipelines. I've considered the following options:\n\nWWF\nCustom XML pipeline description\nCustom pipeline description in code (using Nemerle's macros to define syntax for it)\nOther code-based des...
The point of this question is to collect a list of examples of hashtable implementations using arrays in different languages. It would also be nice if someone could throw in a pretty detailed overview of how they work, and what is happening with each example. Edit: Why not just use the built in hash functions in your...
Implementing a hashtable using arrays is a great exercise to understand how hash functions and collision handling work. Below, I will provide a detailed overview of how a basic hashtable works, including how to implement it in various languages, along with links to full code examples. ### Overview of Hashtable Impleme...
4,184
[ { "from": "human", "value": "The point of this question is to collect a list of examples of hashtable implementations using arrays in different languages. It would also be nice if someone could throw in a pretty detailed overview of how they work, and what is happening with each example. \nEdit: \nWhy not j...
I'm currently generating an 8-character pseudo-random uppercase string for "A" .. "Z": value = ""; 8.times{value << (65 + rand(25)).chr} but it doesn't look clean, and it can't be passed as an argument since it isn't a single statement. To get a mixed-case string "a" .. "z" plus "A" .. "Z", I changed it to: value = ...
You can simplify your code using the `Array` and `join` methods, which will make it cleaner and allow you to generate the random string in a single line. Here’s a cleaner approach for generating an 8-character pseudo-random string that includes both uppercase and lowercase letters: ```ruby def generate_random_string(l...
7,214
[ { "from": "human", "value": "I'm currently generating an 8-character pseudo-random uppercase string for \"A\" .. \"Z\":\nvalue = \"\"; 8.times{value << (65 + rand(25)).chr}\n\nbut it doesn't look clean, and it can't be passed as an argument since it isn't a single statement. To get a mixed-case string \"a...
How do you tell if a function in JavaScript is defined? I want to do something like this function something_cool(text, callback) { alert(text); if( callback != null ) callback(); } But it gets me a callback is not a function error when callback is not defined.
To check if a function is defined in JavaScript, you can use the `typeof` operator. The `typeof` operator will allow you to determine if the `callback` parameter is a function before trying to invoke it. Here's how you can modify your `something_cool` function to check if `callback` is defined and is a function: ```...
3,727
[ { "from": "human", "value": "How do you tell if a function in JavaScript is defined?\nI want to do something like this\nfunction something_cool(text, callback) {\n alert(text);\n if( callback != null ) callback();\n}\n\nBut it gets me a\n\ncallback is not a function\n\nerror when callback is not defin...
I like ReSharper, but it is a total memory hog. It can quickly swell up and consume a half-gig of RAM without too much effort and bog down the IDE. Does anybody know of any way to configure it to be not as slow?
ReSharper is indeed a powerful tool, but it can consume a significant amount of memory, especially in large solutions. Here are some tips to help you configure ReSharper to reduce its memory footprint and improve performance: 1. **Disable Unused Features**: - Go to `ReSharper` > `Options` > `Code Inspection` and d...
3,885
[ { "from": "human", "value": "I like ReSharper, but it is a total memory hog. It can quickly swell up and consume a half-gig of RAM without too much effort and bog down the IDE. Does anybody know of any way to configure it to be not as slow?\n" }, { "from": "gpt", "value": "ReSharper is indeed a ...
I am currently loading a lightbox style popup that loads it's HTML from an XHR call. This content is then displayed in a 'modal' popup using element.innerHTML = content This works like a charm. In another section of this website I use a Flickr 'badge' (http://www.elliotswan.com/2006/08/06/custom-flickr-badge-api-docume...
You're correct in your observation that using `innerHTML` to inject content into the DOM and then calling `document.write` can lead to issues, particularly when the content is dynamically loaded after the page has already finished rendering. Here's a breakdown of the situation: 1. **`innerHTML` and DOM Manipulation**...
6,287
[ { "from": "human", "value": "I am currently loading a lightbox style popup that loads it's HTML from an XHR call. This content is then displayed in a 'modal' popup using element.innerHTML = content This works like a charm.\nIn another section of this website I use a Flickr 'badge' (http://www.elliotswan.com...
Are there any conflicts with having any combination of Visual Studio 2003, 2005 and/or 2008 installed? I noticed a related question here but wanted a more general answer.
Installing multiple versions of Visual Studio, such as 2003, 2005, and 2008, on the same machine is generally supported by Microsoft, and many developers do this for compatibility reasons with different projects. However, there are some considerations and potential conflicts to be aware of: 1. **Project Compatibility*...
4,703
[ { "from": "human", "value": "Are there any conflicts with having any combination of Visual Studio 2003, 2005 and/or 2008 installed? I noticed a related question here but wanted a more general answer.\n" }, { "from": "gpt", "value": "Installing multiple versions of Visual Studio, such as 2003, 2...
What are some guidelines for maintaining responsible session security with PHP? There's information all over the web and it's about time it all landed in one place!
Maintaining responsible session security in PHP is crucial for protecting user data and preventing unauthorized access. Below are comprehensive guidelines that can help you ensure session security in your PHP applications: ### 1. **Use HTTPS** - Always serve your web application over HTTPS to encrypt data in transit....
2,266
[ { "from": "human", "value": "What are some guidelines for maintaining responsible session security with PHP? There's information all over the web and it's about time it all landed in one place!\n" }, { "from": "gpt", "value": "Maintaining responsible session security in PHP is crucial for prote...
Could somebody please name a few. I could given time, but this is for somebody else, and I'd also like some community input.
Sure! However, I need a bit more context to help you effectively. Are you looking for names of books, movies, songs, places, or something else? Let me know what specific type of names you need, and I'll be happy to provide some suggestions!
9,683
[ { "from": "human", "value": "Could somebody please name a few. I could given time, but this is for somebody else, and I'd also like some community input.\n" }, { "from": "gpt", "value": "Sure! However, I need a bit more context to help you effectively. Are you looking for names of books, movies...
See here http://www.hanselman.com/blog/InSearchOfThePerfectMonospacedProgrammersFontInconsolata.aspx - for want of a better description - the statement block highlighting - eg in the pics on the link the "statement blocks" are grouped with a vertical line. I understand this is a feature of CodeRush - does R# have eithe...
As of my last update, ReSharper (R#) does not natively include a feature that adds vertical line highlighting to statement blocks, similar to what is found in CodeRush. However, ReSharper does offer a variety of other visual enhancements and code analysis tools that improve code readability and navigation. If you are ...
7,533
[ { "from": "human", "value": "See here http://www.hanselman.com/blog/InSearchOfThePerfectMonospacedProgrammersFontInconsolata.aspx - for want of a better description - the statement block highlighting - eg in the pics on the link the \"statement blocks\" are grouped with a vertical line. I understand this is...
X has the method XCreatePixmapCursor to create a cursor from a pixmap with a color depth of 1. The foreground and background colors can be other than black and white, but there are only two colors. Is there a way to create a multicolored cursor in X?
In X11, the `XCreatePixmapCursor` function is designed to create a cursor using a pixmap with a color depth of 1, meaning that the resulting cursor can only have two colors: a foreground color and a background color. This limitation means that it is not possible to directly create a multicolored cursor using this funct...
6,738
[ { "from": "human", "value": "X has the method XCreatePixmapCursor to create a cursor from a pixmap with a color depth of 1. The foreground and background colors can be other than black and white, but there are only two colors.\nIs there a way to create a multicolored cursor in X?\n" }, { "from": "g...
I want to get the results of a stored procedure and place them into a CSV file onto an FTP location. The catch though is that I cannot create a local/temporary file that I can then FTP over. The approach I was taking was to use an SSIS package to create a temporary file and then have a FTP Task within the pack to FTP t...
If you're unable to create temporary files on the server for your SSIS package, here are a few alternative approaches that you might consider for exporting the results of a stored procedure directly to a CSV file at an FTP location without intermediate file storage: ### 1. **Using a Script Task in SSIS with FTP Upload...
2,921
[ { "from": "human", "value": "I want to get the results of a stored procedure and place them into a CSV file onto an FTP location.\nThe catch though is that I cannot create a local/temporary file that I can then FTP over.\nThe approach I was taking was to use an SSIS package to create a temporary file and th...
I find myself doing some relatively advanced stuff with memcached in PHP. It's becoming a mental struggle to think about and resolve race conditions and concurrency issues caused by the lock-free nature of the cache. PHP seems pretty poor in tools when it comes to concurrency (threads, anyone?), so I wonder if there ar...
Dealing with concurrency issues in PHP, especially when using a cache like memcached, can indeed be challenging. While PHP does not natively support multithreading in the same way some other languages do, there are tools and strategies you can employ to help manage and test for race conditions and concurrency issues. H...
3,623
[ { "from": "human", "value": "I find myself doing some relatively advanced stuff with memcached in PHP. It's becoming a mental struggle to think about and resolve race conditions and concurrency issues caused by the lock-free nature of the cache.\nPHP seems pretty poor in tools when it comes to concurrency (...
Is anyone else having trouble running Swing applications from IntelliJ IDEA 8 Milestone 1? Even the simplest application of showing an empty JFrame seems to crash the JVM. I don't get a stack trace or anything, it looks like the JVM itself crashes and Windows shows me a pop-up that says the usual "This process is no ...
It sounds like you're encountering a compatibility issue between IntelliJ IDEA 8 Milestone 1, the JDK you're using (1.6 Update 10 beta), and potentially Windows Vista x64. Here are some steps you can take to troubleshoot and possibly resolve the issue: 1. **Update IntelliJ IDEA**: If you’re using a milestone version (...
1,505
[ { "from": "human", "value": "Is anyone else having trouble running Swing applications from IntelliJ IDEA 8 Milestone 1? Even the simplest application of showing an empty JFrame seems to crash the JVM. I don't get a stack trace or anything, it looks like the JVM itself crashes and Windows shows me a pop-up...
I hope this qualifies as a programming question, as in any programming tutorial, you eventually come across 'foo' in the code examples. (yeah, right?) what does 'foo' really mean? If it is meant to mean nothing, when did it begin to be used so?
Yes, "foo" is often used as a placeholder name in programming, similar to "bar" and "baz." These terms are typically used in examples, tutorials, and documentation to represent generic variables, functions, or classes. They serve as stand-ins to help illustrate concepts without getting bogged down by specific naming co...
7,148
[ { "from": "human", "value": "I hope this qualifies as a programming question, as in any programming tutorial, you eventually come across 'foo' in the code examples. (yeah, right?)\nwhat does 'foo' really mean?\nIf it is meant to mean nothing, when did it begin to be used so?\n" }, { "from": "gpt", ...
Every now and then in a high volume .NET application, you might see this exception when you try to execute a query: System.Data.SqlClient.SqlException: A transport-level error has occurred when sending the request to the server. According to my research, this is something that "just happens" and not much can be do...
Handling `SqlException` that results from transport-level errors in a .NET application can be tricky, especially in high-volume OLTP systems. Here are some alternative strategies to better handle these intermittent issues without relying solely on parsing exception messages: ### 1. **Use Polly for Resilience** Instea...
1,358
[ { "from": "human", "value": "Every now and then in a high volume .NET application, you might see this exception when you try to execute a query:\n\nSystem.Data.SqlClient.SqlException: A transport-level error has\n occurred when sending the request to the server.\n\nAccording to my research, this is someth...
I have a 1920x1200 screen an would like to customize VS2008 code windows to have some areas split vertically and horizontally (tab groups). I can only seem to do all vertical or all horizontal in VS2008. Is there any crafty way of getting a mixing both?
Visual Studio 2008's window management features allow you to split the code editor windows either vertically or horizontally, but unfortunately, it does not support a mixed tab grouping layout (i.e., both vertical and horizontal splits) natively. However, there are a few workarounds you can consider to achieve a simila...
6,524
[ { "from": "human", "value": "I have a 1920x1200 screen an would like to customize VS2008 code windows to have some areas split vertically and horizontally (tab groups). \nI can only seem to do all vertical or all horizontal in VS2008. Is there any crafty way of getting a mixing both?\n" }, { "from":...
How can I monitor an SQL Server database for changes to a table without using triggers or modifying the structure of the database in any way? My preferred programming environment is .NET and C#. I'd like to be able to support any SQL Server 2000 SP4 or newer. My application is a bolt-on data visualization for another c...
Your approach of using the `BINARY_CHECKSUM` function along with a polling mechanism is a valid method for monitoring changes in a SQL Server database without requiring any schema modifications or triggers. Here’s a more detailed explanation and some recommendations to refine your approach. ### Step-by-Step Implementa...
153
[ { "from": "human", "value": "How can I monitor an SQL Server database for changes to a table without using triggers or modifying the structure of the database in any way? My preferred programming environment is .NET and C#.\nI'd like to be able to support any SQL Server 2000 SP4 or newer. My application is ...
Which is more efficient for the compiler and the best practice for checking whether a string is blank? Checking whether the length of the string == 0 Checking whether the string is empty (strVar == "") Also, does the answer depend on language?
When it comes to checking if a string is blank (i.e., empty), both methods you mentioned—checking the length of the string and checking if the string is equal to an empty string—are common practices. However, the efficiency and best practice can vary based on the programming language you are using. ### Checking Length...
4,911
[ { "from": "human", "value": "Which is more efficient for the compiler and the best practice for checking whether a string is blank? \n\nChecking whether the length of the string == 0\nChecking whether the string is empty (strVar == \"\")\n\nAlso, does the answer depend on language?\n" }, { "from": "...
My path to a 'fulltime'- developer stated as a analyst using VBA with Excel, Access, and then onto C#. I went to college part time once I discovered I had a passion for coding not business. I do about most of my coding in C#, but being an ASP.NET developer I also write in HTML, JavaScript, SQL etc. . . the usual susp...
It's great to hear about your journey into development and your eagerness to learn and advance in your career! Given your background and interests, here are some suggestions for what to learn next that can both deepen your skills in the .NET ecosystem and broaden your overall development knowledge: ### 1. **Advanced C...
3,147
[ { "from": "human", "value": "My path to a 'fulltime'- developer stated as a analyst using VBA with Excel, Access, and then onto C#. I went to college part time once I discovered I had a passion for coding not business.\nI do about most of my coding in C#, but being an ASP.NET developer I also write in HTML...
I know this sounds like a point-whoring question but let me explain where I'm coming from. Out of college I got a job at a PHP shop. I worked there for a year and a half and thought that I had learned all there was to learn about programming. Then I got a job as a one-man internal development shop at a sizable corpora...
It's great to hear about your journey and the growth you've experienced as a developer! Transitioning from one programming language to another can indeed be a challenge, especially when you've become accustomed to the features and paradigms of a specific language like C#. PHP has its own unique characteristics and stre...
3,022
[ { "from": "human", "value": "I know this sounds like a point-whoring question but let me explain where I'm coming from.\nOut of college I got a job at a PHP shop. I worked there for a year and a half and thought that I had learned all there was to learn about programming.\nThen I got a job as a one-man int...
Without the use of any external library, what is the simplest way to fetch a website's HTML content into a String?
You can fetch a website's HTML content into a String using Java's built-in `HttpURLConnection` class. Below is a simple example of how to do this: ```java import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.URL; public class F...
4,589
[ { "from": "human", "value": "Without the use of any external library, what is the simplest way to fetch a website's HTML content into a String?\n" }, { "from": "gpt", "value": "You can fetch a website's HTML content into a String using Java's built-in `HttpURLConnection` class. Below is a simple...
Generally, what's the best way to tackle a layout bug in IE6? What are the most common bugs or problems that one should look for when trying to figure out why your page suddenly looks like a monkey coded it?
Tackling layout bugs in Internet Explorer 6 (IE6) can be a frustrating experience, as the browser is notorious for its non-standard compliance and quirky behavior. Here are some strategies for addressing layout issues in IE6, along with common bugs to look out for: ### General Strategies 1. **Validate Your HTML and C...
3,682
[ { "from": "human", "value": "Generally, what's the best way to tackle a layout bug in IE6? What are the most common bugs or problems that one should look for when trying to figure out why your page suddenly looks like a monkey coded it?\n" }, { "from": "gpt", "value": "Tackling layout bugs in In...
For the past 10 years or so there have been a smattering of articles and papers referencing Christopher Alexander's newer work "The Nature of Order" and how it can be applied to software. Unfortunately, the only works I can find are from James Coplien and Richard Gabriel; there is nothing beyond that, at least from my ...
Your interest in applying Christopher Alexander's principles from "The Nature of Order" to software design touches on a rich area of exploration that has not been extensively documented. While figures like James Coplien and Richard Gabriel have made strides in connecting Alexander’s work to software, the broader discou...
4,322
[ { "from": "human", "value": "For the past 10 years or so there have been a smattering of articles and papers referencing Christopher Alexander's newer work \"The Nature of Order\" and how it can be applied to software.\nUnfortunately, the only works I can find are from James Coplien and Richard Gabriel; the...
At the moment my code (PHP) has too many SQL queries in it. eg... // not a real example, but you get the idea... $results = $db->GetResults("SELECT * FROM sometable WHERE iUser=$userid"); if ($results) { // Do something } I am looking into using stored procedures to reduce this and make things a little more robust...
Transitioning to stored procedures can be an effective way to manage SQL queries, improve performance, and enhance security. However, as you've noted, moving from inline SQL to stored procedures does come with challenges, especially if you have many queries scattered throughout your code. Here’s a structured approach t...
3,736
[ { "from": "human", "value": "At the moment my code (PHP) has too many SQL queries in it. eg...\n// not a real example, but you get the idea...\n$results = $db->GetResults(\"SELECT * FROM sometable WHERE iUser=$userid\");\nif ($results) {\n // Do something\n}\n\nI am looking into using stored procedures t...
I have a habit of keeping my variable usage to a bare minimum. So I'm wondering if there is any advantage to be gained by the following: $query = $mysqli->query('SELECT * FROM `people` ORDER BY `name` ASC LIMIT 0,30'); // Example 1 $query = $query->fetch_assoc(); // Example 2 $query_r = $query->fetch_assoc(); $query...
Your question touches on several important aspects of memory management and efficiency when working with MySQLi in PHP. Let’s break down the examples and clarify the behavior of `free()` and variable reassignment. ### Understanding Memory Management 1. **MySQLi Result Object**: When you execute a query using `$mys...
5,184
[ { "from": "human", "value": "I have a habit of keeping my variable usage to a bare minimum. So I'm wondering if there is any advantage to be gained by the following:\n$query = $mysqli->query('SELECT * FROM `people` ORDER BY `name` ASC LIMIT 0,30');\n\n// Example 1\n$query = $query->fetch_assoc();\n\n// Exa...
How do I get the latest version of my solution recursively like its done in the solution explorer context menu of Visual Studio? I want to do this from the command line or via a macro. I'm trying to automate a part of my daily routine by using a set of batch files. I am sure a lot of developers would love to have somet...
To get the latest version of a Visual Studio solution and its project dependencies recursively from the command line, you can utilize the `tf` command-line utility from Team Foundation Version Control (TFVC). However, as you've already noted, `tf get` alone will not resolve project dependencies automatically. To achie...
4,173
[ { "from": "human", "value": "How do I get the latest version of my solution recursively like its done in the solution explorer context menu of Visual Studio? I want to do this from the command line or via a macro. I'm trying to automate a part of my daily routine by using a set of batch files. I am sure a l...
I have a script that has a part that looks like that: for file in `ls *.tar.gz`; do echo encrypting $file gpg --passphrase-file /home/$USER/.gnupg/backup-passphrase \ --simple-sk-checksum -c $file done For some reason if I run this script manually, works perfectly fine and all files are encrypted. If I run thi...
When you encounter a situation where a script runs successfully manually but fails to perform the desired actions when run as a cron job, there are a few common issues that you can investigate. Here are some potential reasons and suggestions for your case: 1. **Environment Variables**: - Cron jobs typically run wit...
1,045
[ { "from": "human", "value": "I have a script that has a part that looks like that:\nfor file in `ls *.tar.gz`; do\n echo encrypting $file\n gpg --passphrase-file /home/$USER/.gnupg/backup-passphrase \\\n --simple-sk-checksum -c $file\ndone\n\nFor some reason if I run this script manually, works perfect...
So this is IT more than programming but Google found nothing, and you guys are just the right kind of geniuses. My Exchange Server 2007 and Entourage clients don't play nice. Right now the big issue is that the entourage client will not connect to Exchange 2007 ( Entourage 2004 or 2008) The account settings are corr...
It sounds like you're dealing with a pretty tricky issue involving both Exchange Server 2007 and Entourage. Here are a few suggestions to troubleshoot and potentially resolve the problem: ### 1. **Check Exchange Server Configuration** - Ensure that your Exchange 2007 server is correctly configured to support WebDAV...
2,043
[ { "from": "human", "value": "So this is IT more than programming but Google found nothing, and you guys are just the right kind of geniuses.\nMy Exchange Server 2007 and Entourage clients don't play nice.\nRight now the big issue is that the entourage client will not connect to Exchange 2007 ( Entourage 20...
I'm building a website that requires very basic markup capabilities. I can't use any 3rd party plugins, so I just need a simple way to convert markup to HTML. I might have a total of 3 tags that I'll allow. What is the best way to convert ==Heading== to <h2>Heading</h2>, or --bold-- to <b>bold</b>? Can this be done sim...
You can definitely achieve simple markup to HTML conversion using regular expressions. Since you mentioned that you have a total of 3 tags, let's assume the tags you want to convert are: 1. `==Heading==` to `<h2>Heading</h2>` 2. `--bold--` to `<b>bold</b>` 3. `__italic__` to `<i>italic</i>` In C#, you can use `Regex....
4,974
[ { "from": "human", "value": "I'm building a website that requires very basic markup capabilities. I can't use any 3rd party plugins, so I just need a simple way to convert markup to HTML. I might have a total of 3 tags that I'll allow.\nWhat is the best way to convert ==Heading== to <h2>Heading</h2>, or --b...