instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
In C#, does anybody know why the following will compile:
int i = 1;
++i;
i++;
but this will not compile?
int i = 1;
++i++;
(Compiler error: The operand of an increment or decrement operator must be a variable, property or indexer.)
| In C#, the reason why the first code snippet compiles while the second does not is due to how the increment operator (`++`) works and the expressions involved.
### Explanation of the code snippets:
1. **First Snippet:**
```csharp
int i = 1;
++i; // Pre-increment: increments 'i' to 2 and the expression e... | 15,415 | [
{
"from": "human",
"value": "In C#, does anybody know why the following will compile:\nint i = 1;\n++i;\ni++;\n\nbut this will not compile?\nint i = 1;\n++i++;\n\n(Compiler error: The operand of an increment or decrement operator must be a variable, property or indexer.)\n"
},
{
"from": "gpt",
"... |
I may be wrong, but if you are working with SmtpClient.SendAsync in ASP.NET
2.0 and it throws an exception, the thread processing the request waits
indefinitely for the operation to complete.
To reproduce this problem, simply use an invalid SMTP address for the host
that could not be resolved when sending an email.
... | You're correct that when using `SmtpClient.SendAsync` in ASP.NET 2.0, the behavior can lead to issues if an exception is thrown during the asynchronous send operation. Here's a more detailed explanation of the scenario you're describing:
### SmtpClient.SendAsync Behavior
1. **Asynchronous Operation**: When you call `... | 12,321 | [
{
"from": "human",
"value": "I may be wrong, but if you are working with SmtpClient.SendAsync in ASP.NET \n2.0 and it throws an exception, the thread processing the request waits \nindefinitely for the operation to complete.\nTo reproduce this problem, simply use an invalid SMTP address for the host \nthat ... |
I'm trying to run the following SQL statement in Oracle, and it takes ages to run:
SELECT orderID FROM tasks WHERE orderID NOT IN
(SELECT DISTINCT orderID FROM tasks WHERE
engineer1 IS NOT NULL AND engineer2 IS NOT NULL)
If I run just the sub-part that is in the IN clause, that runs very quickly in Oracle, i.e.
SELE... | The performance issues you're encountering with your SQL query in Oracle, especially compared to SQL Server, can often be traced back to differences in how the two databases handle query execution and optimization.
### Why is the original query slow?
In your original query, the `NOT IN` clause with a subquery can in... | 13,859 | [
{
"from": "human",
"value": "I'm trying to run the following SQL statement in Oracle, and it takes ages to run:\nSELECT orderID FROM tasks WHERE orderID NOT IN \n(SELECT DISTINCT orderID FROM tasks WHERE\n engineer1 IS NOT NULL AND engineer2 IS NOT NULL)\n\nIf I run just the sub-part that is in the IN claus... |
I work in an multi-site environment that's currently using Rational ClearCase for source control and Rational ClearQuest for issue tracking (I accept your condolences ahead of time). As a rough estimate I would say this is supporting 200 engineers.
How would you effectively migrate this SCM methodology to a comparativ... | Migrating from Rational ClearCase and Rational ClearQuest to an open-source tool suite can indeed yield significant cost savings and potentially improve developer productivity. Below is a comprehensive plan that outlines steps for a successful migration to an alternative source control management (SCM) and issue tracki... | 14,072 | [
{
"from": "human",
"value": "I work in an multi-site environment that's currently using Rational ClearCase for source control and Rational ClearQuest for issue tracking (I accept your condolences ahead of time). As a rough estimate I would say this is supporting 200 engineers.\nHow would you effectively mi... |
I am looking to use a PHP library for uploading pictures to a web server so that I can use something that has been tested and hopefully not have to design one myself. Does anyone know of such a library?
Edit: I am aware that file uploads are built into PHP, I am looking for a library that may make the process simpler ... | There are several PHP libraries that can help simplify and secure the process of file uploads, including images. Here are a few popular options you might consider:
1. **Dropzone.js**: While not a PHP library per se, Dropzone.js is a popular JavaScript library that provides drag-and-drop file uploads with image preview... | 15,144 | [
{
"from": "human",
"value": "I am looking to use a PHP library for uploading pictures to a web server so that I can use something that has been tested and hopefully not have to design one myself. Does anyone know of such a library?\nEdit: I am aware that file uploads are built into PHP, I am looking for a ... |
Are there any good MVC frameworks for native Windows Mobile code?
Barring that could someone link to an open source Windows Mobile or CE project that uses the MVC pattern?
| Developing applications for Windows Mobile and Windows CE using the MVC (Model-View-Controller) pattern can be challenging due to the limited number of modern frameworks specifically designed for those platforms. However, there are some options and resources that you can explore:
### MVC Frameworks for Windows Mobile/... | 16,074 | [
{
"from": "human",
"value": "Are there any good MVC frameworks for native Windows Mobile code?\nBarring that could someone link to an open source Windows Mobile or CE project that uses the MVC pattern?\n"
},
{
"from": "gpt",
"value": "Developing applications for Windows Mobile and Windows CE usi... |
How do you trigger a javascript function using actionscript in flash?
The goal is to trigger jQuery functionality from a flash movie
| To trigger a JavaScript function from ActionScript in a Flash movie, you can use the `ExternalInterface` class, which allows ActionScript to call JavaScript functions in the HTML container of the Flash application. Here's a step-by-step guide on how to achieve this:
### Step 1: Set Up Your HTML Page
Ensure that your ... | 15,339 | [
{
"from": "human",
"value": "How do you trigger a javascript function using actionscript in flash?\nThe goal is to trigger jQuery functionality from a flash movie\n"
},
{
"from": "gpt",
"value": "To trigger a JavaScript function from ActionScript in a Flash movie, you can use the `ExternalInter... |
Given the following example, why do I have to explicitly use the statement b->A::DoSomething() rather than just b->DoSomething()?
Shouldn't the compiler's overload resolution figure out which method I'm talking about?
I'm using Microsoft VS 2005. (Note: using virtual doesn't help in this case.)
class A
{
public:
... | In your example, you have two classes, `A` and `B`, where `B` inherits from `A`. Class `A` has a method `DoSomething()`, while class `B` has an overloaded version of `DoSomething(int x)`. Here's a breakdown of why you need to use `b->A::DoSomething()` instead of just `b->DoSomething()`.
### Understanding Method Overlo... | 5,846 | [
{
"from": "human",
"value": "Given the following example, why do I have to explicitly use the statement b->A::DoSomething() rather than just b->DoSomething()?\nShouldn't the compiler's overload resolution figure out which method I'm talking about?\nI'm using Microsoft VS 2005. (Note: using virtual doesn't h... |
I have read the documentation on this and I think I understand. An AutoResetEvent resets when the code passes through event.WaitOne(), but a ManualResetEvent does not.
Is this correct?
| Yes, that is correct!
- **AutoResetEvent**: This event automatically resets to the non-signaled state (not available) after a single waiting thread is released. When a thread calls `WaitOne()` on an `AutoResetEvent`, it will wait until the event is set (signaled), and once it is signaled and the thread acquires it, th... | 19,011 | [
{
"from": "human",
"value": "I have read the documentation on this and I think I understand. An AutoResetEvent resets when the code passes through event.WaitOne(), but a ManualResetEvent does not.\nIs this correct?\n"
},
{
"from": "gpt",
"value": "Yes, that is correct!\n\n- **AutoResetEvent**: T... |
I was wondering are there any security concerns with adding crossdomain.xml to the root of an application server? Can it be added to any other parts of the server and are you aware of any work arounds that dont require the server to have this file in place?
Thanks
Damien
| The `crossdomain.xml` file is a security mechanism used primarily in Adobe Flash applications to control access to resources on a web server from a different domain. While it was more relevant in the era of Flash, understanding its implications is still important, especially if you are managing web applications that mi... | 14,060 | [
{
"from": "human",
"value": "I was wondering are there any security concerns with adding crossdomain.xml to the root of an application server? Can it be added to any other parts of the server and are you aware of any work arounds that dont require the server to have this file in place?\nThanks\nDamien\n"
... |
I'm using the JFrame plugin with jquery 1.2.6.
It works fine in FF3, however it won't display the requested pages in IE 7.
The jQuery library and the JFrame plugin are called in the included header.cfm.
Page code is here (note: ignore the ColdFusion calls, I don't think they're generating the problem): http://cfm.paste... | It sounds like you’re encountering a compatibility issue between jQuery 1.2.6 and Internet Explorer 7 when using the JFrame plugin. Given that jQuery and related plugins from that time period may not work optimally across all browsers, here are a few troubleshooting steps and suggestions to help you resolve the issue:
... | 9,444 | [
{
"from": "human",
"value": "I'm using the JFrame plugin with jquery 1.2.6.\nIt works fine in FF3, however it won't display the requested pages in IE 7.\nThe jQuery library and the JFrame plugin are called in the included header.cfm.\nPage code is here (note: ignore the ColdFusion calls, I don't think they'... |
Coming from a background, I'm familiar with GUI editors that do a poor job of producing code. However, I've never written a GUI using .NET. Does the GUI editor in Visual Studio have the same problem(s)? Are both the source files and output GUI good?
| Visual Studio provides a powerful GUI designer for .NET applications, particularly for Windows Forms and WPF (Windows Presentation Foundation) projects. Here are some insights regarding the quality of the code generated by the GUI editor in Visual Studio:
### Code Quality
1. **Generated Code**: The GUI designer in Vis... | 16,850 | [
{
"from": "human",
"value": "Coming from a background, I'm familiar with GUI editors that do a poor job of producing code. However, I've never written a GUI using .NET. Does the GUI editor in Visual Studio have the same problem(s)? Are both the source files and output GUI good?\n"
},
{
"from": "gpt"... |
I'm trying to put together a comprehensive regex to validate phone numbers. Ideally it would handle international formats, but it must handle US formats, including the following:
1-234-567-8901
1-234-567-8901 x1234
1-234-567-8901 ext1234
1 (234) 567-8901
1.234.567.8901
1/234/567/8901
12345678901
I'll answer with my c... | Creating a comprehensive regex to validate phone numbers, especially considering various formats and international standards, can be a bit challenging. Here's a regex pattern that covers the US formats you've listed, as well as some additional flexibility for international numbers:
```regex
^(?:\+?\d{1,3}\s*[-.\s]?)?(... | 14,860 | [
{
"from": "human",
"value": "I'm trying to put together a comprehensive regex to validate phone numbers. Ideally it would handle international formats, but it must handle US formats, including the following:\n\n1-234-567-8901\n1-234-567-8901 x1234\n1-234-567-8901 ext1234\n1 (234) 567-8901\n1.234.567.8901\n1... |
My client has a multi-page PDF file. They need it split by page. Does anyone know of a way to do this - preferably in C#.
| Yes, you can split a multi-page PDF into individual pages using C#. One popular library for manipulating PDF files in .NET is **iTextSharp**. Below is an example of how to use iTextSharp to split a PDF file by pages.
First, you will need to install the iTextSharp library. If you're using NuGet, you can add it by runni... | 15,214 | [
{
"from": "human",
"value": "My client has a multi-page PDF file. They need it split by page. Does anyone know of a way to do this - preferably in C#.\n"
},
{
"from": "gpt",
"value": "Yes, you can split a multi-page PDF into individual pages using C#. One popular library for manipulating PDF f... |
I know I can specify one for each form, or for the root form and then it'll cascade through to all of the children forms, but I'd like to have a way of overriding the default Java Coffee Cup for all forms even those I might forget.
Any suggestions?
| If you're looking to globally override the default Java Coffee Cup icon for all forms in a Java Swing application, you can set a custom icon for the entire application using the `UIManager` class. The `UIManager` allows you to set the defaults for various components, including icons.
Here's a general approach you can ... | 14,172 | [
{
"from": "human",
"value": "I know I can specify one for each form, or for the root form and then it'll cascade through to all of the children forms, but I'd like to have a way of overriding the default Java Coffee Cup for all forms even those I might forget.\nAny suggestions?\n"
},
{
"from": "gpt"... |
Does attempting to develop some sort of game, even just as a hobby during leisure time provide useful (professional) experience or is it a childish waste of time?
I have pursued small personal game projects on and off throughout my programming career. I've found the (often) strict performance requirements and escalatin... | Hobby game development can be immensely valuable for professional programmers, and it's far from being a childish waste of time. Here are several reasons why pursuing game projects—whether as a primary focus or a side project—can provide significant benefits to developers:
### 1. **Skill Enhancement**
Game development... | 14,817 | [
{
"from": "human",
"value": "Does attempting to develop some sort of game, even just as a hobby during leisure time provide useful (professional) experience or is it a childish waste of time?\nI have pursued small personal game projects on and off throughout my programming career. I've found the (often) str... |
Here's the idea, I'd like to make a service? that will look for a certain program starting up and dissallow it unless certain conditions are met.
Let's say I have a game I want to stop myself from playing during the week. So if I start it up on any day other than Friday/Saturday/Sunday, it will intercept and cancel. ... | Yes, it is possible to create a service in C# that intercepts the launch of a specific program based on certain conditions, such as the day of the week. However, there are a few considerations and approaches to take into account.
### Overview of Steps
1. **Create a Windows Service**: This service will run in the back... | 11,885 | [
{
"from": "human",
"value": "Here's the idea, I'd like to make a service? that will look for a certain program starting up and dissallow it unless certain conditions are met. \nLet's say I have a game I want to stop myself from playing during the week. So if I start it up on any day other than Friday/Satur... |
My favorite equation for centering an xhtml element using only CSS is as follows:
display: block;
position: absolute;
width: _insert width here_;
left: 50%;
margin-left: _insert width divided by two & multiplied by negative one here_
There's also the simpler margin:auto method in browsers that support it. Does anyone ... | Centering elements in CSS can be approached in various ways, depending on the layout you're aiming for and whether you need to account for vertical centering as well. Here are some alternative techniques to center elements both horizontally and vertically:
### 1. **Flexbox**
Flexbox is a modern and straightforward way... | 16,073 | [
{
"from": "human",
"value": "My favorite equation for centering an xhtml element using only CSS is as follows:\ndisplay: block;\nposition: absolute;\nwidth: _insert width here_;\nleft: 50%;\nmargin-left: _insert width divided by two & multiplied by negative one here_\n\nThere's also the simpler margin:auto ... |
I'm writing an application which reads large arrays of floats and performs some simple operations with them. I'm using floats, because I thought it'd be faster than doubles, but after doing some research I've found that there's some confusion about this topic. Can anyone elaborate on this?
| When deciding between `float` and `double` in your application, there are several factors to consider, especially when working with large arrays of floating-point numbers and performing operations on them. Here’s a breakdown of the differences between `float` and `double`, as well as performance considerations:
### 1.... | 14,174 | [
{
"from": "human",
"value": "I'm writing an application which reads large arrays of floats and performs some simple operations with them. I'm using floats, because I thought it'd be faster than doubles, but after doing some research I've found that there's some confusion about this topic. Can anyone elabora... |
I'm using Eclipse's AntRunner to build a set of plugins, but I'm having trouble in configuring the logging behavior. Specifically, I'd like AntRunner not to display empty tasks. Anybody knows how to do this?
| To configure the logging behavior of Eclipse's AntRunner so that it does not display empty tasks, you can adjust the logging level by modifying the `build.xml` file or by using command-line options when invoking Ant. Here are some steps to help you achieve this:
### Step 1: Modify `build.xml`
1. Open your `build.xml`... | 16,835 | [
{
"from": "human",
"value": "I'm using Eclipse's AntRunner to build a set of plugins, but I'm having trouble in configuring the logging behavior. Specifically, I'd like AntRunner not to display empty tasks. Anybody knows how to do this?\n"
},
{
"from": "gpt",
"value": "To configure the logging b... |
Leaving aside the question of whether you should serve single or multiple stylesheets, assuming you're sending just one, what do you think of this as a basic structure?
/* Structure */
Any template layout stuff should be put into here, so header, footer, body etc.
/* Structure End */
/* Common Components*/
Repeated ele... | Your basic structure for organizing a single stylesheet is quite logical and offers clear sections that can help with maintainability and readability. Here are some thoughts and suggestions for each section:
### General Structure
1. **Overall Organization**:
- Using comments to delineate sections is a good practic... | 15,827 | [
{
"from": "human",
"value": "Leaving aside the question of whether you should serve single or multiple stylesheets, assuming you're sending just one, what do you think of this as a basic structure?\n/* Structure */\nAny template layout stuff should be put into here, so header, footer, body etc.\n/* Structur... |
Since I'm not a huge fan of any of the current solutions for managing the resources and knowledge that I have, I was thinking about making my own solution, which will involve custom code as well as possible integration of FOSS solutions. I would start development on my local machine, but if I like it, how difficult wou... | Creating your own solution for managing resources and knowledge can be a rewarding project, and migrating it from a local development environment to a public server involves several considerations and potential challenges. Here's a breakdown of the key steps and challenges you might face during this process:
### Steps... | 14,153 | [
{
"from": "human",
"value": "Since I'm not a huge fan of any of the current solutions for managing the resources and knowledge that I have, I was thinking about making my own solution, which will involve custom code as well as possible integration of FOSS solutions. I would start development on my local mac... |
Problem:
Given a list of strings, find the substring which, if subtracted from the beginning of all strings where it matches and replaced by an escape byte, gives the shortest total length.
Example:
"foo", "fool", "bar"
The result is: "foo" as the base string with the strings "\0", "\0l", "bar" and a total length of 9 ... | To optimize the problem of finding the best prefix substring to minimize the total length of transformed strings in a list, we can employ a more efficient approach using a trie (prefix tree) or a simpler greedy strategy with a frequency count. Here's an outline of a more efficient solution:
### Solution Outline:
1. *... | 13,548 | [
{
"from": "human",
"value": "Problem:\nGiven a list of strings, find the substring which, if subtracted from the beginning of all strings where it matches and replaced by an escape byte, gives the shortest total length.\nExample:\n\"foo\", \"fool\", \"bar\"\nThe result is: \"foo\" as the base string with th... |
I keep hearing that Flex is open source and I figured that a great way to learn about the inner workings would be to look at it. I can easily find the Flex SDK (http://opensource.adobe.com/wiki/display/flexsdk/Get+Source+Code), but I'm wanting to look at the class definitions for the MXML core library (like NumericStep... | You're correct that the Flex SDK is open source and available for you to explore. However, the core components of the MXML library, including things like `NumericStepper`, are actually part of the Flex framework, which is included in the SDK but may not be immediately obvious where to find.
In the Flex SDK repository,... | 17,633 | [
{
"from": "human",
"value": "I keep hearing that Flex is open source and I figured that a great way to learn about the inner workings would be to look at it. I can easily find the Flex SDK (http://opensource.adobe.com/wiki/display/flexsdk/Get+Source+Code), but I'm wanting to look at the class definitions fo... |
C++ preprocessor #define is totally different.
Is the PHP define() any different than just creating a var?
define("SETTING", 0);
$something = SETTING;
vs
$setting = 0;
$something = $setting;
| Yes, `define()` in PHP is quite different from just creating a variable in a few important ways. Let's break down the differences:
### 1. Scope and Mutability
- **`define()`**:
- When you use `define()`, you create a constant. Constants are globally accessible, meaning that they can be accessed from any part of the... | 15,986 | [
{
"from": "human",
"value": "C++ preprocessor #define is totally different.\nIs the PHP define() any different than just creating a var?\ndefine(\"SETTING\", 0); \n$something = SETTING;\n\nvs\n$setting = 0; \n$something = $setting;\n\n"
},
{
"from": "gpt",
"value": "Yes, `define()` in PHP is q... |
How do I toggle the visibility of an element using .hide(), .show(), or .toggle()?
How do I test if an element is visible or hidden?
| In jQuery, you can easily toggle the visibility of elements using the `.hide()`, `.show()`, and `.toggle()` methods. Here’s how you can use each of these methods:
### Toggling Visibility
1. **`.hide()`**: This method will hide the selected elements.
```javascript
$('#element').hide(); // Hides the element with... | 17,569 | [
{
"from": "human",
"value": "How do I toggle the visibility of an element using .hide(), .show(), or .toggle()?\nHow do I test if an element is visible or hidden?\n"
},
{
"from": "gpt",
"value": "In jQuery, you can easily toggle the visibility of elements using the `.hide()`, `.show()`, and `.t... |
I'm making a simple jquery command:
element.html(" ");
using the attributes/html method: http://docs.jquery.com/Attributes/html
It works on my local app engine server, but it doesn't work once I push to the Google server. The element empties but doesn't... | The issue you're encountering is related to how HTML handles whitespace. In HTML, multiple consecutive spaces are collapsed into a single space when rendered in the browser. This means that when you use ` ` (non-breaking space), it should work as expected, but if it's being stripped or not interpreted correctly, y... | 15,402 | [
{
"from": "human",
"value": "I'm making a simple jquery command:\nelement.html(\" \");\nusing the attributes/html method: http://docs.jquery.com/Attributes/html\nIt works on my local app engine server, but it doesn't work once I push to the ... |
I've got a WCF Web Service method whose prototype is:
[OperationContract]
Response<List<Customer>> GetCustomers();
When I add the service reference to a client, Visual Studio (2005) creates a type called "ResponseOfArrayOfCustomerrleXg3IC" that is a wrapper for "Response<List<Customer>>". Is there any way I can contr... | In WCF (Windows Communication Foundation), when you expose a service and generate a client proxy (such as when adding a service reference), Visual Studio uses certain conventions to name generated types, particularly when working with generics. This can lead to less than ideal class names, as you've noticed.
Unfortuna... | 15,570 | [
{
"from": "human",
"value": "I've got a WCF Web Service method whose prototype is:\n[OperationContract]\nResponse<List<Customer>> GetCustomers();\n\nWhen I add the service reference to a client, Visual Studio (2005) creates a type called \"ResponseOfArrayOfCustomerrleXg3IC\" that is a wrapper for \"Response... |
I'm developing a little project plan and I came to a point when I need to decide what local databse system to use.
The input data is going to be stored on webserver (hosting - MySQL DB). The idea is to build a process to download all necessary data (for example at midnight) and process them. However, there are going to... | When deciding on a local database system to work with a C# (.NET) application, there are a few key factors to consider, especially given your requirements for performance, ease of use, and the need to interface easily with MySQL. Here are a few recommended options:
### 1. **SQLite**
- **Overview**: SQLite is a lightwe... | 15,345 | [
{
"from": "human",
"value": "I'm developing a little project plan and I came to a point when I need to decide what local databse system to use.\nThe input data is going to be stored on webserver (hosting - MySQL DB). The idea is to build a process to download all necessary data (for example at midnight) and... |
In my current job the supervisor's practice is to only check in production ready code. Most recently the project I was on involved work by 3 different developers with some file overlap. This meant manually integrating changes despite the fact that some changes took a day and then it was done. I wanted to see if this... | The practice of checking in only production-ready code, often referred to as "trunk-based development," can indeed lead to challenges, especially in team environments where multiple developers are contributing to the same codebase. While it promotes stability and quality, it can also create friction during integration ... | 12,047 | [
{
"from": "human",
"value": "In my current job the supervisor's practice is to only check in production ready code. Most recently the project I was on involved work by 3 different developers with some file overlap. This meant manually integrating changes despite the fact that some changes took a day and t... |
I searched the net and handbook, but I only managed to learn what is the masked package, and not how to install it. I did find some commands, but they don't seem to work on 2008 (looking at it, it seems those are for earlier versions). I have something like this:
localhost ~ # emerge flamerobin
Calculating dependencies... | It looks like you're trying to install a masked package (in this case, `flamerobin`) on a Gentoo-based system. Masked packages are those that are not considered stable for your architecture (in this case, `~x86` indicates that the package is for testing and not recommended for production systems).
To install a masked... | 14,576 | [
{
"from": "human",
"value": "I searched the net and handbook, but I only managed to learn what is the masked package, and not how to install it. I did find some commands, but they don't seem to work on 2008 (looking at it, it seems those are for earlier versions). I have something like this:\nlocalhost ~ # ... |
If I want to inject a globally scoped array variable into a page's client-side javascript during a full page postback, I can use:
this.Page.ClientScript.RegisterArrayDeclaration("WorkCalendar", "\"" + date.ToShortDateString() + "\"");
to declare and populate a client-side javascript array on the page. Nice and simple.... | You can indeed inject a globally scoped array variable during an async postback in an UpdatePanel without resorting to creating and updating a separate .js file. A more straightforward approach involves using the `ScriptManager` to register the array directly on the page in the same way you did for the full postback, b... | 15,633 | [
{
"from": "human",
"value": "If I want to inject a globally scoped array variable into a page's client-side javascript during a full page postback, I can use:\nthis.Page.ClientScript.RegisterArrayDeclaration(\"WorkCalendar\", \"\\\"\" + date.ToShortDateString() + \"\\\"\");\n\nto declare and populate a clie... |
What function will let us know whether a date in VBA is in DST or not?
| In VBA (Visual Basic for Applications), you can determine if a specific date falls within Daylight Saving Time (DST) by using the `IsDaylightSavingTime` method from the `TimeZoneInfo` class, but this is not directly available in VBA as it's a .NET feature.
However, you can implement a custom solution for standard scen... | 15,394 | [
{
"from": "human",
"value": "What function will let us know whether a date in VBA is in DST or not?\n"
},
{
"from": "gpt",
"value": "In VBA (Visual Basic for Applications), you can determine if a specific date falls within Daylight Saving Time (DST) by using the `IsDaylightSavingTime` method fro... |
I am trying to find a library to parse JSON on C# on Windows Mobile (working with Visual Studio 2005). The libraries that I have found that allow me to parse JSON in C# (litjson and Jayrock) don't work on Windows Mobile, they require classes that are not present in the .NET compact framework. Is there any library that ... | Parsing JSON in the .NET Compact Framework, especially for older platforms like Windows Mobile and using Visual Studio 2005, can be challenging due to the limited support for certain libraries. However, there are a few options you can consider:
1. **Json.NET (Newtonsoft.Json)**: The widely used Json.NET library is one... | 16,503 | [
{
"from": "human",
"value": "I am trying to find a library to parse JSON on C# on Windows Mobile (working with Visual Studio 2005). The libraries that I have found that allow me to parse JSON in C# (litjson and Jayrock) don't work on Windows Mobile, they require classes that are not present in the .NET comp... |
I'm having a problem running a T4 template using TextTransform.exe on my build server. On my dev machine the template works perfectly. The error message is as follows.
error : Running transformation: System.TypeLoadException: Could not instantiate type System.Xml.Linq.XDocument
The build server has the windows 2008 S... | The error you are encountering, `System.TypeLoadException: Could not instantiate type System.Xml.Linq.XDocument`, suggests that your build server may be missing the necessary assemblies or may have a compatibility issue with the version of .NET Framework being used.
Here are some steps to troubleshoot and resolve the ... | 15,409 | [
{
"from": "human",
"value": "I'm having a problem running a T4 template using TextTransform.exe on my build server. On my dev machine the template works perfectly. The error message is as follows.\n\nerror : Running transformation: System.TypeLoadException: Could not instantiate type System.Xml.Linq.XDocume... |
I am displaying pages from an external site (that I own) in an iframe in one of my pages. It's all fine except when viewed in Opera with the browser window size reduced (not widescreen), when the iframe shrinks and squashes the content. It works in widescreen (maximize browser window), and is OK in IE7, Firefox, Chrome... | The issue you're encountering with the iframe in Opera is likely due to the way the browser handles responsive design and iframe sizing, especially when the window is resized. Here are a few strategies you can try to mitigate the problem:
1. **Use CSS to Control Size**: Instead of setting fixed dimensions for the ifra... | 12,755 | [
{
"from": "human",
"value": "I am displaying pages from an external site (that I own) in an iframe in one of my pages. It's all fine except when viewed in Opera with the browser window size reduced (not widescreen), when the iframe shrinks and squashes the content. It works in widescreen (maximize browser w... |
I created a couple of tables procedurally via C# named something like [MyTableOneCustom0] and [MyTableTwoCustom0]. When I try to return all of the values from these tables via "Open Table" in MSSQL Server Management Studio, I receive the following error:
Error Source:
Microsoft.VisualStudio.DataTools
Error Message: Ex... | The issue you are encountering seems to be related to how SQL Server Management Studio (SSMS) tries to retrieve the metadata for the tables when you use the "Open Table" feature. Here are a few potential reasons for the error you are seeing:
1. **Table Naming Conventions**: The names of your tables, especially if they... | 13,596 | [
{
"from": "human",
"value": "I created a couple of tables procedurally via C# named something like [MyTableOneCustom0] and [MyTableTwoCustom0]. When I try to return all of the values from these tables via \"Open Table\" in MSSQL Server Management Studio, I receive the following error:\n\nError Source:\nMicr... |
Is there a way to add a single criteria on a session factory(configuration) level which will apply to all entities retrieved with a Session ?
We have a requirement to not delete any rows from our database but "mark" deleted entities as such so that they will not participate in any further operations.
I know that we can... | Yes, you can achieve this in Hibernate by using a concept called "Entity Filters." Hibernate supports soft deletes through the use of filters, which can be applied at the session factory level and automatically affect all queries made with that session.
### Steps to implement global filtering for soft deletes:
1. **D... | 12,108 | [
{
"from": "human",
"value": "Is there a way to add a single criteria on a session factory(configuration) level which will apply to all entities retrieved with a Session ?\nWe have a requirement to not delete any rows from our database but \"mark\" deleted entities as such so that they will not participate i... |
Let's say I have code like this:
$dbh = new PDO("blahblah");
$stmt = $dbh->prepare('SELECT * FROM users where username = :username');
$stmt->execute( array(':username' => $_REQUEST['username']) );
The PDO documentation says:
The parameters to prepared statements don't need to be quoted; the driver handles it for you... | Yes, using prepared statements with PDO in PHP, as you've shown in your code, is an effective way to protect against SQL injection attacks. When you prepare a statement and bind parameters (whether through the `execute` method or by using `bindParam`/`bindValue`), the database driver takes care of properly quoting and ... | 15,101 | [
{
"from": "human",
"value": "Let's say I have code like this:\n$dbh = new PDO(\"blahblah\");\n\n$stmt = $dbh->prepare('SELECT * FROM users where username = :username');\n$stmt->execute( array(':username' => $_REQUEST['username']) );\n\nThe PDO documentation says:\n\nThe parameters to prepared statements don... |
I don't want a discussion about when to and not to throw exceptions. I wish to resolve a simple issue. 99% of the time the argument for not throwing exceptions revolves around them being slow while the other side claims (with benchmark test) that the speed is not the issue. I've read numerous blogs, articles, and posts... | The debate around using exceptions in programming often centers on performance versus readability and maintainability of code. Here are the key points for both sides of the argument:
### Arguments Against Throwing Exceptions:
1. **Performance Overhead**: In many programming languages, throwing exceptions is generally ... | 13,657 | [
{
"from": "human",
"value": "I don't want a discussion about when to and not to throw exceptions. I wish to resolve a simple issue. 99% of the time the argument for not throwing exceptions revolves around them being slow while the other side claims (with benchmark test) that the speed is not the issue. I've... |
I have a large int[] array and a much smaller int[] array. I want to fill up the large array with values from the small array, by repeat copying the small array into the large array until it is full (so that large[0] = large[13] = large[26] ... = small[0] etc.). I already have a simple method:
int iSource = 0;
for (i... | Certainly! You can achieve a more elegant and potentially faster solution using a combination of the modulus operator and array copying. Here's a more concise way to fill the large array with values from the small array:
```csharp
int[] sourceArray = ...; // Your small array
int[] destArray = new int[largeArraySize]; ... | 17,193 | [
{
"from": "human",
"value": "I have a large int[] array and a much smaller int[] array. I want to fill up the large array with values from the small array, by repeat copying the small array into the large array until it is full (so that large[0] = large[13] = large[26] ... = small[0] etc.). I already have... |
I know very little (arguably nothing) about Sybase setup, but I do know SSIS is having trouble enlisting Sybase in a distributed transaction. Has anyone been able to make this work?
The SSIS Runtime has failed to enlist the OLE DB connection in a
distributed transaction with error 0x80004005 "Unspecified error".
Thi... | Setting up Sybase with SSIS for distributed transactions can be tricky due to various factors, including driver support and transaction management. The error you're experiencing typically indicates a problem with how SSIS is attempting to enlist the Sybase connection in a distributed transaction.
Here are some steps a... | 15,441 | [
{
"from": "human",
"value": "I know very little (arguably nothing) about Sybase setup, but I do know SSIS is having trouble enlisting Sybase in a distributed transaction. Has anyone been able to make this work?\nThe SSIS Runtime has failed to enlist the OLE DB connection in a \ndistributed transaction with... |
Does anyone know of any HMM implementation in .net?
I've some stuff that I did that was basicly reverse engineered from what little knowledge that I have regarding the subject and some c++ code of a very domain specific application that one of my professors did.
I want to improve it somewhat and having another's work ... | Yes, there are several implementations of Hidden Markov Models (HMM) available for .NET. Here are a few libraries you might find useful:
1. **Accord.NET**: This is a comprehensive framework for scientific computing in .NET. It includes a variety of machine learning algorithms, including HMMs. You can find the library ... | 15,234 | [
{
"from": "human",
"value": "Does anyone know of any HMM implementation in .net?\nI've some stuff that I did that was basicly reverse engineered from what little knowledge that I have regarding the subject and some c++ code of a very domain specific application that one of my professors did. \nI want to imp... |
I know this would be easy with position:fixed, but unfortanately I'm stuck with supporting IE 6. How can I do this? I would rather use CSS to be clean, but if I have to use Javascript, that's not the end of the world. In my current implementation I have a "floating footer" that floats above the main content area and... | Creating a "floating footer" that stays visible at the bottom of the viewport, particularly in older browsers like IE6, can indeed be a challenge. Here's how you can approach the problem step by step.
### 1. Using Pure CSS (limited solutions for IE6)
Unfortunately, with IE6, the options for creating a fixed footer us... | 12,272 | [
{
"from": "human",
"value": "I know this would be easy with position:fixed, but unfortanately I'm stuck with supporting IE 6. How can I do this? I would rather use CSS to be clean, but if I have to use Javascript, that's not the end of the world. In my current implementation I have a \"floating footer\" ... |
fopen is failing when I try to read in a very moderately sized file in PHP. A 6 meg file makes it choke, though smaller files around 100k are just fine. i've read that it is sometimes necessary to recompile PHP with the -D_FILE_OFFSET_BITS=64 flag in order to read files over 20 gigs or something ridiculous, but shoul... | It's great to hear that you found the issue—it was indeed a simple permissions problem! File handling issues in PHP can sometimes lead to unexpected behavior, but here are some additional tips and tricks for working with larger files in PHP, particularly if you plan to handle files in the range of 100 MB or more.
### ... | 14,040 | [
{
"from": "human",
"value": "fopen is failing when I try to read in a very moderately sized file in PHP. A 6 meg file makes it choke, though smaller files around 100k are just fine. i've read that it is sometimes necessary to recompile PHP with the -D_FILE_OFFSET_BITS=64 flag in order to read files over 2... |
I'm trying to wrap my head around SharePoint. Why is it good? Why is it bad?
At a glance it appears to offer some incredible collaboration tools. However, the cost looks astronomical and it seems to be rigid & difficult to customize.
To those who've worked with SharePoint; please describe something good and somethin... | SharePoint is a powerful platform developed by Microsoft that offers various tools for collaboration, document management, and content management. It's used by many organizations to facilitate teamwork, manage projects, and store files. Here’s a breakdown of some of the positive and negative aspects of SharePoint based... | 15,969 | [
{
"from": "human",
"value": "I'm trying to wrap my head around SharePoint. Why is it good? Why is it bad?\nAt a glance it appears to offer some incredible collaboration tools. However, the cost looks astronomical and it seems to be rigid & difficult to customize.\nTo those who've worked with SharePoint; ... |
I am looking for a replacement for javadeps, which I used to use to generate sections of a Makefile to specify which classes depended on which source files.
Unfortunately javadeps itself has not been updated in a while, and cannot parse generic types or static imports.
The closest thing I've found so far is Dependency ... | If you are looking for a tool that can accurately infer Java dependencies, including handling generics and non-public classes, there are a few options you could consider:
1. **Java Parser Libraries**: Libraries such as [JavaParser](https://javaparser.org/) can help you analyze Java source code to build a representatio... | 15,577 | [
{
"from": "human",
"value": "I am looking for a replacement for javadeps, which I used to use to generate sections of a Makefile to specify which classes depended on which source files.\nUnfortunately javadeps itself has not been updated in a while, and cannot parse generic types or static imports.\nThe clo... |
So is there a way to initialize and start a command line Spring app without writing a main method. It seems like all such main methods have the same form
public static void main(final String[] args) throws Exception {
ApplicationContext ctx = new ClassPathXmlApplicationContext("context.xml", Boot.class);
FooSer... | Yes, it is indeed possible to create a Spring application that can be executed from the command line without writing a typical `main` method. However, you'll still need a way to initiate the Spring Application Context. To achieve this, we can use a custom utility class that reads parameters from the command line and in... | 14,665 | [
{
"from": "human",
"value": "So is there a way to initialize and start a command line Spring app without writing a main method. It seems like all such main methods have the same form\npublic static void main(final String[] args) throws Exception {\n ApplicationContext ctx = new ClassPathXmlApplicationCon... |
Would it be useful to be able to mark objects where the value ofString.valueOf() would included in any stack trace. In my example below I used "trace". Variables that aren't declared at the point of the stack trace would just be ingored.
It would make debugging much easier and make it much easier to write programs tha... | The idea of enhancing stack traces with additional contextual information about variables at the time an exception occurs is indeed an interesting concept. It could potentially improve the debugging experience significantly by providing immediate visibility into variable states, allowing developers to pinpoint issues m... | 14,578 | [
{
"from": "human",
"value": "Would it be useful to be able to mark objects where the value ofString.valueOf() would included in any stack trace. In my example below I used \"trace\". Variables that aren't declared at the point of the stack trace would just be ingored.\nIt would make debugging much easier a... |
This is a question with many answers - I am interested in knowing what others consider to be "best practice".
Consider the following situation: you have an object-oriented program that contains one or more data structures that are needed by many different classes. How do you make these data structures accessible?
You ... | The question of how to manage shared data structures in an object-oriented program is a common design challenge, and different solutions can be applied depending on the specifics of the project and personal or team preferences. Here are some considerations and best practices that can help navigate this situation:
### ... | 12,943 | [
{
"from": "human",
"value": "This is a question with many answers - I am interested in knowing what others consider to be \"best practice\".\nConsider the following situation: you have an object-oriented program that contains one or more data structures that are needed by many different classes. How do you ... |
So I have a daemon running on a Linux system, and I want to have a record of its activities: a log. The question is, what is the "best" way to accomplish this?
My first idea is to simply open a file and write to it.
FILE* log = fopen("logfile.log", "w");
/* daemon works...needs to write to log */
fprintf(log, "foo%s\n"... | Using `fopen` and writing to a log file directly is a simple approach, but there are several issues and considerations that could arise with this method when running a daemon. Here are some potential drawbacks, as well as suggestions for better approaches:
### Issues with the Current Approach:
1. **Single Open/Close*... | 13,913 | [
{
"from": "human",
"value": "So I have a daemon running on a Linux system, and I want to have a record of its activities: a log. The question is, what is the \"best\" way to accomplish this?\nMy first idea is to simply open a file and write to it.\nFILE* log = fopen(\"logfile.log\", \"w\");\n/* daemon works... |
I've got a bunch of unit tests built using Visual Studio 2005's built-in unit testing functionality. For the last little while, it's been taking absolutely forever to start the tests... Everything just sits there at "Pending" for two minutes or more. Now Visual Studio's decided to take things to a new level and never... | It sounds like you're encountering a frustrating issue with the unit testing framework in Visual Studio 2005. Here are several steps you can take to troubleshoot and potentially resolve the "Failed to establish communication environment for local run" error:
1. **Restart Visual Studio**: Sometimes, simply restarting V... | 17,563 | [
{
"from": "human",
"value": "I've got a bunch of unit tests built using Visual Studio 2005's built-in unit testing functionality. For the last little while, it's been taking absolutely forever to start the tests... Everything just sits there at \"Pending\" for two minutes or more. Now Visual Studio's deci... |
I am working with a log of events where there are about 60 different "types" of events. Each event shares about 10 properties, and then there are subcategories of events that share various extra properties.
How I work with these events does depend on their type or what categorical interfaces they implement.
But it seem... | You've hit upon a classic design dilemma in object-oriented programming (OOP): the balance between using inheritance (and interfaces) versus composition (and categorization) to model complex behaviors and properties. Let's break down both approaches.
### First Approach: Inheritance with Subclasses
**Pros:**
- **Polym... | 12,710 | [
{
"from": "human",
"value": "I am working with a log of events where there are about 60 different \"types\" of events. Each event shares about 10 properties, and then there are subcategories of events that share various extra properties.\nHow I work with these events does depend on their type or what catego... |
I'm sick of remembering all the passwords for different logins. Lately I found the interesting tool password composer which lets you generate passwords base on the hostname and a secret master password. But I don't want to use a website or installing software to generate my passwords.
So I'm looking for a simple one wa... | If you're looking for a simple way to generate passwords based on a hostname and a master password without relying on software, you can use a manual hashing approach. While this won't be as secure as using a well-tested hashing algorithm like SHA-256, you can create a system that works for you.
Here’s a method that co... | 10,469 | [
{
"from": "human",
"value": "I'm sick of remembering all the passwords for different logins. Lately I found the interesting tool password composer which lets you generate passwords base on the hostname and a secret master password. But I don't want to use a website or installing software to generate my pass... |
How do I authenticate against AD using Python + LDAP. I'm currently using the python-ldap library and all it is producing is tears.
I can't even bind to perform a simple query:
import sys
import ldap
Server = "ldap://my-ldap-server"
DN, Secret, un = sys.argv[1:4]
Base = "dc=mydomain,dc=co,dc=uk"
Scope = ldap.SCOPE_S... | It looks like you're on the right track, but let's review the code and your connection setup step by step to ensure everything is configured correctly for authenticating against Active Directory using LDAP.
### Troubleshooting Steps
1. **Verify the Server Address**: Ensure that the `ldap://my-ldap-server` is correct ... | 12,384 | [
{
"from": "human",
"value": "How do I authenticate against AD using Python + LDAP. I'm currently using the python-ldap library and all it is producing is tears.\nI can't even bind to perform a simple query:\nimport sys\nimport ldap\n\n\nServer = \"ldap://my-ldap-server\"\nDN, Secret, un = sys.argv[1:4]\n\nB... |
What would be the best WPF control in C# (VS 2008) that you can place on a form that would allow you to do drawing similar to the "Paint" function for the CWnd class in C++? Also, that could display bitmaps, have a scroll bar, and the ability to accept user inputs (ie. MouseMove, Button Clicks, etc...). Basically all... | In WPF (Windows Presentation Foundation), the best control to achieve drawing functionalities similar to the "Paint" function in a `CWnd` class is the `Canvas` control. The `Canvas` control allows for free-form drawing and positioning of child elements, making it versatile for rendering graphics, handling user inputs, ... | 10,024 | [
{
"from": "human",
"value": "What would be the best WPF control in C# (VS 2008) that you can place on a form that would allow you to do drawing similar to the \"Paint\" function for the CWnd class in C++? Also, that could display bitmaps, have a scroll bar, and the ability to accept user inputs (ie. MouseM... |
I'm trying to script the shutdown of my VM Servers in a .bat.
if one of the vmware-cmd commands fails (as the machine is already shutdown say), I'd like it to continue instead of bombing out.
c:
cd "c:\Program Files\VMWare\VmWare Server"
vmware-cmd C:\VMImages\TCVMDEVSQL01\TCVMDEVSQL01.vmx suspend soft -q
vmware-cmd C... | To ensure that your batch script continues executing even if one of the `vmware-cmd` commands fails, you can use the `||` operator, which allows you to specify an alternative command to run if the previous command fails. Alternatively, you can use the `EXIT /B` command with a conditional check, or you can use `cmd` bui... | 13,503 | [
{
"from": "human",
"value": "I'm trying to script the shutdown of my VM Servers in a .bat.\nif one of the vmware-cmd commands fails (as the machine is already shutdown say), I'd like it to continue instead of bombing out.\nc:\ncd \"c:\\Program Files\\VMWare\\VmWare Server\"\n\nvmware-cmd C:\\VMImages\\TCVMD... |
All throughout an application wherever error messages (or other user messages) are used I typically hard-code a string. Obviosly this can be really bad (especially when you may have to come back and localize an app). What is the best approach to centralize these strings? A static class? Constants? An XML File? Or a com... | Centralizing strings used for error messages and user notifications is a best practice for maintaining code quality, readability, and ease of localization. Here are several approaches you can take, along with their advantages and disadvantages:
### 1. Resource Files
**Usage:** This is the most common approach, especia... | 14,761 | [
{
"from": "human",
"value": "All throughout an application wherever error messages (or other user messages) are used I typically hard-code a string. Obviosly this can be really bad (especially when you may have to come back and localize an app). What is the best approach to centralize these strings? A stati... |
Is it possible to to take a screenshot of a webpage with JavaScript and then submit that back to the server?
I'm not so concerned with browser security issues. etc. as the implementation would be for HTA. But is it possible?
| Yes, it is possible to take a screenshot of a webpage using JavaScript and then submit that screenshot back to the server. However, you need to consider that standard web technologies like JavaScript in a web browser don’t allow you to capture screenshots directly due to security and privacy concerns. However, you can ... | 12,437 | [
{
"from": "human",
"value": "Is it possible to to take a screenshot of a webpage with JavaScript and then submit that back to the server?\nI'm not so concerned with browser security issues. etc. as the implementation would be for HTA. But is it possible?\n"
},
{
"from": "gpt",
"value": "Yes, it ... |
I have a question about best practices regarding how one should approach storing complex workflow states for processing tasks in a database. I've been looking online to no avail, so I figured I'd ask the community what they thought was best.
This question comes out of the same "BoxItem" example I gave in a prior quest... | You've identified a common challenge in workflow management systems: how to efficiently store and retrieve the states of complex tasks associated with an entity, like your `BoxItem`, without creating an unwieldy number of columns in a single table. Your exploration of different approaches is a great starting point, and... | 12,695 | [
{
"from": "human",
"value": "I have a question about best practices regarding how one should approach storing complex workflow states for processing tasks in a database. I've been looking online to no avail, so I figured I'd ask the community what they thought was best.\nThis question comes out of the same... |
I have a class that map objects to objects, but unlike dictionary it maps them both ways. I am now trying to implement a custom IEnumerator interface that iterates through the values.
public class Mapper<K,T> : IEnumerable<T>, IEnumerator<T>
{
C5.TreeDictionary<K,T> KToTMap = new TreeDictionary<K,T>();
C5.Hash... | To implement the `IEnumerator<T>` interface properly in your `Mapper<K, T>` class, you'll need to maintain a state to track the current position of the iteration over your collection. Here's a complete implementation of the `Mapper<K, T>` class, including a correct implementation of the `IEnumerator<T>` interface.
###... | 6,419 | [
{
"from": "human",
"value": "I have a class that map objects to objects, but unlike dictionary it maps them both ways. I am now trying to implement a custom IEnumerator interface that iterates through the values.\npublic class Mapper<K,T> : IEnumerable<T>, IEnumerator<T>\n\n{\n C5.TreeDictionary<K,T> KTo... |
I need advice on how to handle relatively large set of flags in my SQL2k8 table.
Two question, bear with me please :)
Let's say I have 20 flags I'd like to store for one record.
For example:
CanRead = 0x1
CanWrite = 0x2
CanModify = 0x4
...
and so on to the final flag 2^20
Now, if i set the following combination of one ... | You're working with a common scenario of handling permissions or flags in a database using bitwise operations. Let's tackle your questions one by one.
### Question 1: Retrieving Records with Any of the Flags
You want to find records that match **any** of the flags in a bitmask, which can be done using a bitwise AND o... | 13,930 | [
{
"from": "human",
"value": "I need advice on how to handle relatively large set of flags in my SQL2k8 table.\nTwo question, bear with me please :)\nLet's say I have 20 flags I'd like to store for one record.\nFor example:\nCanRead = 0x1\nCanWrite = 0x2\nCanModify = 0x4\n...\nand so on to the final flag 2^2... |
Events are synchronous in C#. I have this application where my main form starts a thread with a loop in it that listens to a stream. When something comes along on the stream an event is fired from the loop to the main form.
If the main form is slow or shows a messagebox or something the loop will be suspended. What is... | In C#, when dealing with events and multithreading, particularly with UI elements, it’s essential to ensure that long-running tasks do not block the UI thread. If your main form is busy (e.g., showing a message box or performing a long operation), it can result in the event processing being delayed or even dropped.
To... | 12,318 | [
{
"from": "human",
"value": "Events are synchronous in C#. I have this application where my main form starts a thread with a loop in it that listens to a stream. When something comes along on the stream an event is fired from the loop to the main form. \nIf the main form is slow or shows a messagebox or som... |
This question is related to (but perhaps not quite the same as):
Does Django have HTML helpers?
My problem is this: In Django, I am constantly reproducing the basic formatting for low-level database objects. Here's an example:
I have two classes, Person and Address. There are multiple Addresses for each Person, setup l... | In Django, the separation of concerns is an essential principle that helps to maintain a clean and manageable codebase. Your problem of repetitive code for rendering addresses can be addressed in several ways without cluttering your models or views. Here are some recommended approaches:
### 1. Use Template Tags
Creat... | 12,504 | [
{
"from": "human",
"value": "This question is related to (but perhaps not quite the same as):\nDoes Django have HTML helpers?\nMy problem is this: In Django, I am constantly reproducing the basic formatting for low-level database objects. Here's an example:\nI have two classes, Person and Address. There are... |
We've pre-defined Excel document structure with lots of formulas and macros written.
During download of Excel, thru Java application we populate certain cells in Excel with data. After download when user open Excel, macros & formulas embedded in it will read the pre-populated data and behave accordingly.
We are right n... | When looking for a Java library to generate and manipulate Excel files, there are several alternatives to ExtenXLS that you might consider. Here are some options, along with their licensing models and support details:
### 1. Apache POI
- **Description**: A popular open-source Java library for reading and writing Micro... | 14,039 | [
{
"from": "human",
"value": "We've pre-defined Excel document structure with lots of formulas and macros written.\nDuring download of Excel, thru Java application we populate certain cells in Excel with data. After download when user open Excel, macros & formulas embedded in it will read the pre-populated d... |
We have SOAP web services in production that are relying on SOAP Headers (containing plain client credentials) for the authentication. The WS are used in heterogeneous environments with .NET/Java/PHP/Python/C++ clients both web app or desktop app.
We are considering a v2 for those WS and I am wondering what are conside... | When designing a v2 for your SOAP web services and considering best practices for authentication, especially in a heterogeneous environment, you should consider the following strategies that balance security with usability:
### 1. **WS-Security**
- **Use WS-Security Standards**: Implement WS-Security to add security h... | 14,319 | [
{
"from": "human",
"value": "We have SOAP web services in production that are relying on SOAP Headers (containing plain client credentials) for the authentication. The WS are used in heterogeneous environments with .NET/Java/PHP/Python/C++ clients both web app or desktop app.\nWe are considering a v2 for th... |
I want to split an arithmetic expression into tokens, to convert it into RPN.
Java has the StringTokenizer, which can optionally keep the delimiters. That way, I could use the operators as delimiters. Unfortunately, I need to do this in PHP, which has strtok, but that throws away the delimiters, so I need to brew somet... | You're correct that splitting an arithmetic expression into tokens is a common task in compiler design and can be handled effectively using lexical analysis principles. In PHP, you can create a function to tokenize an arithmetic expression while keeping the operators as part of the token list. Here's how you can approa... | 15,445 | [
{
"from": "human",
"value": "I want to split an arithmetic expression into tokens, to convert it into RPN.\nJava has the StringTokenizer, which can optionally keep the delimiters. That way, I could use the operators as delimiters. Unfortunately, I need to do this in PHP, which has strtok, but that throws aw... |
I am working on a site where users can login to get more private information.
My client has another site else where that uses nt authentication for accessing it.
What they want to do is have a button on the site I am working on under the private area that will send them to the nt authenticated site, but not require th... | Passing credentials from one site to another, especially in the context of NT (Windows) Authentication, raises significant security and design considerations. Here are some points to consider and potential approaches to accomplish what you want:
### Security Concerns
1. **Credential Exposure**: Transmitting usernames ... | 11,077 | [
{
"from": "human",
"value": "I am working on a site where users can login to get more private information.\n My client has another site else where that uses nt authentication for accessing it.\nWhat they want to do is have a button on the site I am working on under the private area that will send them to th... |
How do I perform a network login, to access a shared driver for instance, programmatically in c#? The same can be achieved by either attempting to open a share through the explorer, or by the net use shell command.
| To perform a network login programmatically in C# and access a shared drive, you can use the `System.Runtime.InteropServices` library to call native Windows API functions. The typical approach is to use the `WNetAddConnection2` function to map a network drive. Here's an example of how you can achieve this:
### Example... | 13,920 | [
{
"from": "human",
"value": "How do I perform a network login, to access a shared driver for instance, programmatically in c#? The same can be achieved by either attempting to open a share through the explorer, or by the net use shell command.\n"
},
{
"from": "gpt",
"value": "To perform a networ... |
This PHP code...
207 if (getenv(HTTP_X_FORWARDED_FOR)) {
208 $ip = getenv('HTTP_X_FORWARD_FOR');
209 $host = gethostbyaddr($ip);
210 } else {
211 $ip = getenv('REMOTE_ADDR');
212 $host = gethostbyaddr($ip);
213 }
Throws this warning...
Warning: gethostbyaddr()
[function.geth... | The warning you are encountering indicates that the `$ip` variable is blank or contains an invalid value, which results in the `gethostbyaddr()` function failing. This typically happens when the `HTTP_X_FORWARDED_FOR` header is not set, or when it is incorrectly referenced. In your code, there is a typo in line 208; yo... | 15,559 | [
{
"from": "human",
"value": "This PHP code...\n207 if (getenv(HTTP_X_FORWARDED_FOR)) {\n208 $ip = getenv('HTTP_X_FORWARD_FOR');\n209 $host = gethostbyaddr($ip);\n210 } else {\n211 $ip = getenv('REMOTE_ADDR');\n212 $host = gethostbyaddr($ip);\n213 }\n\nThrows this war... |
While most operating systems and web browsers have very good support for bidirectional text such as Hebrew and Arabic, most commercial and open-source software does not:
Most text editors, besides the original notepad and the visual studio editor, does a very poor job. (And I tried dozens of them).
I could not find an... | I understand your frustrations regarding bidirectional (BiDi) text support in various software applications. It's a common issue that many users face, particularly when dealing with text editors, file comparison tools, and reporting software. Here’s a breakdown of your questions:
1. **Do you share the same pain I do?*... | 16,293 | [
{
"from": "human",
"value": "While most operating systems and web browsers have very good support for bidirectional text such as Hebrew and Arabic, most commercial and open-source software does not:\n\nMost text editors, besides the original notepad and the visual studio editor, does a very poor job. (And I... |
I recently started learning Emacs. I went through the tutorial, read some introductory articles, so far so good.
Now I want to use it for Python development. From what I understand, there are two separate Python modes for Emacs: python-mode.el, which is part of the Python project; and python.el, which is part of Emacs ... | It's great to hear that you're diving into Emacs for Python development! Both `python-mode.el` and `python.el` can be used for Python development in Emacs, but they have some differences that you should consider.
### Differences between `python-mode.el` and `python.el`
1. **Origin and Maintenance**:
- `python-mode... | 13,140 | [
{
"from": "human",
"value": "I recently started learning Emacs. I went through the tutorial, read some introductory articles, so far so good.\nNow I want to use it for Python development. From what I understand, there are two separate Python modes for Emacs: python-mode.el, which is part of the Python proje... |
I'm looking for a solution to map one or all of the following Flickr, twitter, vimeo, by exif, keywords or whatever to google maps. I'm trying to show a map of my location from updating social sites.
| To map your social media posts and photos from platforms like Flickr, Twitter, and Vimeo to Google Maps, you can use various methods to extract geolocation data (if available) and then visualize it on a map. Here's a step-by-step approach you might consider:
### Step 1: Extract Geolocation Data
1. **Flickr:**
- Us... | 11,673 | [
{
"from": "human",
"value": "I'm looking for a solution to map one or all of the following Flickr, twitter, vimeo, by exif, keywords or whatever to google maps. I'm trying to show a map of my location from updating social sites.\n"
},
{
"from": "gpt",
"value": "To map your social media posts and... |
Background:
I have a VB6 application I've "inherited" that generates a PDF for the user to review using unsupported Acrobat Reader OCX integration. The program generates an FDF file with the data, then renders the merged result when the FDF is merged with a PDF. It only works correctly with Acrobat Reader 4 :-(. Ins... | It sounds like you're embarking on an important re-architecture of your application, and there are several approaches and technologies you can consider for generating PDFs from data on the server. Here’s a comprehensive strategy to help you make the best decision:
### 1. **Select a PDF Generation Library**
Since yo... | 12,531 | [
{
"from": "human",
"value": "Background:\nI have a VB6 application I've \"inherited\" that generates a PDF for the user to review using unsupported Acrobat Reader OCX integration. The program generates an FDF file with the data, then renders the merged result when the FDF is merged with a PDF. It only wor... |
We have an intranet site backed by SVN, such that the site is a checkout out copy of the repository (working folder used only by IIS). Something on the site has been causing problems today, and I want to know how to find out what was checked out to that working folder in the last 48 hours.
Update: If there's an option... | To find out what was checked out to your SVN working folder in the last 48 hours, you can use the following steps:
### Checking SVN Logs
1. **Open Command Prompt or Terminal**: Navigate to the working copy of your repository where your intranet site is located.
2. **Use the SVN log command**:
You can use the foll... | 14,433 | [
{
"from": "human",
"value": "We have an intranet site backed by SVN, such that the site is a checkout out copy of the repository (working folder used only by IIS). Something on the site has been causing problems today, and I want to know how to find out what was checked out to that working folder in the la... |
(best in your own eyes) Most features? Coolest Features? Slickest Design?
Centreon?
NagVis?
Other?
| When comparing network and system monitoring tools like Centreon, NagVis, and others, it's essential to assess their features, design, and user experience. Here’s a breakdown based on common perceptions and user feedback:
### Centreon
**Most Features**:
- Centreon offers extensive features for IT monitoring, includin... | 13,839 | [
{
"from": "human",
"value": "(best in your own eyes) Most features? Coolest Features? Slickest Design?\nCentreon?\nNagVis?\nOther?\n"
},
{
"from": "gpt",
"value": "When comparing network and system monitoring tools like Centreon, NagVis, and others, it's essential to assess their features, des... |
As I understand it, .bat is the old 16-bit naming convention, and .cmd is for 32-bit Windows, i.e., starting with NT. But I continue to see .bat files everywhere, and they seem to work exactly the same using either suffix. Assuming that my code will never need to run on anything older than NT, does it really matter whi... | You're correct that `.bat` files are associated with the older MS-DOS command scripts, while `.cmd` files were introduced with Windows NT as a way to signify scripts meant to run in the NT command interpreter (cmd.exe). However, in practice, the two extensions are largely interchangeable in modern Windows environments.... | 15,185 | [
{
"from": "human",
"value": "As I understand it, .bat is the old 16-bit naming convention, and .cmd is for 32-bit Windows, i.e., starting with NT. But I continue to see .bat files everywhere, and they seem to work exactly the same using either suffix. Assuming that my code will never need to run on anything... |
Can anyone suggest a good source control system that interfaces with VB2005 Express? As the Express editions of Visual Studio do not allow add-ins does this mean that I will not be able to integrate source control into the IDE? I'm used to the check-in/check-out process of SourceSafe integrated into VB6. Can anyone rec... | You're correct that the Express editions of Visual Studio, including VB2005 Express, do not support add-ins and therefore lack built-in integration for source control systems. However, you can still use source control outside of the IDE.
TortoiseSVN is a solid choice if you're considering a Subversion (SVN) solution.... | 15,282 | [
{
"from": "human",
"value": "Can anyone suggest a good source control system that interfaces with VB2005 Express? As the Express editions of Visual Studio do not allow add-ins does this mean that I will not be able to integrate source control into the IDE? I'm used to the check-in/check-out process of Sourc... |
If you had to iterate through a loop 7 times, would you use:
for (int i = 0; i < 7; i++)
or:
for (int i = 0; i <= 6; i++)
There are two considerations:
performance
readability
For performance I'm assuming Java or C#. Does it matter if "less than" or "less than or equal to" is used? If you have insight for a diff... | When considering the choice between `for (int i = 0; i < 7; i++)` and `for (int i = 0; i <= 6; i++)`, let's evaluate both performance and readability aspects in the context of languages like Java and C#.
### Performance
1. **Comparison Operations**: In most cases, compilers and interpreters can optimize both condition... | 15,937 | [
{
"from": "human",
"value": "If you had to iterate through a loop 7 times, would you use:\nfor (int i = 0; i < 7; i++)\n\nor:\nfor (int i = 0; i <= 6; i++)\n\nThere are two considerations:\n\nperformance\nreadability \n\nFor performance I'm assuming Java or C#. Does it matter if \"less than\" or \"less tha... |
Which scenarios, areas of an application/system, etc. are best suited for 'classic' state based testing versus using mock objects?
| State-based testing and the use of mock objects are both important techniques in software testing, but they serve different purposes and are best suited for different scenarios and application areas. Here’s a breakdown of when to use each approach:
### State-Based Testing
**Best Suited Scenarios:**
1. **Complex Stat... | 13,597 | [
{
"from": "human",
"value": "Which scenarios, areas of an application/system, etc. are best suited for 'classic' state based testing versus using mock objects?\n"
},
{
"from": "gpt",
"value": "State-based testing and the use of mock objects are both important techniques in software testing, but ... |
I have a database column "WantsReply" that logically holds a boolean (bit) but is unfortunately implemented as an integer. Any nonzero value means "yes" and zero means "no".
If I write
class Entry {
[Column] public int WantsReply {get; set;}
}
in my model, and map it to a checkbox in the view using
Html.CheckBox( ... | To resolve the impedance mismatch between the database representation of the `WantsReply` field as an integer and the desired boolean behavior in your model, you can implement a custom property in your `Entry` class that manages the conversion between the integer and boolean representations.
Here's how you can do it:... | 14,978 | [
{
"from": "human",
"value": "I have a database column \"WantsReply\" that logically holds a boolean (bit) but is unfortunately implemented as an integer. Any nonzero value means \"yes\" and zero means \"no\".\nIf I write\nclass Entry {\n [Column] public int WantsReply {get; set;}\n}\n\nin my model, and m... |
We want to maintain 3 webservices for the different steps of deployment, but how do we define in our application which service to use? Do we just maintain 3 web references and ifdef the uses of them somehow?
| Maintaining multiple web services for different steps of deployment is a common architecture pattern. There are several strategies you can use to define and manage which service to use in your application. Here are a few approaches you can consider:
### 1. **Service Locator Pattern**
- Implement a service locator that... | 11,248 | [
{
"from": "human",
"value": "We want to maintain 3 webservices for the different steps of deployment, but how do we define in our application which service to use? Do we just maintain 3 web references and ifdef the uses of them somehow?\n"
},
{
"from": "gpt",
"value": "Maintaining multiple web s... |
First off, let me start off that I am not a .net developer. The reason why I am asking this question is that we rolled out our REST-API and one of our first integration partners is a .net shop.
So basically we assumed that .net would provide some sort of wrapper to create JSON, but the developer in question created the... | Yes, .NET provides robust support for JSON serialization and deserialization, which makes it unnecessary to manually construct JSON strings as you've described. Depending on the version of .NET you are using, you can leverage either the `Newtonsoft.Json` library (popular in .NET Framework applications) or the built-in ... | 14,154 | [
{
"from": "human",
"value": "First off, let me start off that I am not a .net developer. The reason why I am asking this question is that we rolled out our REST-API and one of our first integration partners is a .net shop.\nSo basically we assumed that .net would provide some sort of wrapper to create JSON,... |
Ideally, something cross-platform.
| Could you please provide more context or specify what you are looking for that's cross-platform? Are you referring to software, development tools, games, or something else? This will help me give you a more tailored response. | 20,869 | [
{
"from": "human",
"value": "Ideally, something cross-platform.\n"
},
{
"from": "gpt",
"value": "Could you please provide more context or specify what you are looking for that's cross-platform? Are you referring to software, development tools, games, or something else? This will help me give you... |
It seems that when I use a tool (such as winmerge) to update my codebase... my Visual Studio Team System (VSTS) integration with Team Foundation Server (TFS) doesn't seem to pick it up.
How do I know which files to check out and check back in? Is there something I am missing? Is this a feature that isn't part of VSTS &... | Using tools like WinMerge to update your codebase outside of Visual Studio can lead to some challenges with version control integration in Team Foundation Server (TFS) or Azure DevOps (formerly known as VSTS). Here are some steps and considerations to help ensure that your changes are correctly tracked by TFS:
### 1. ... | 15,542 | [
{
"from": "human",
"value": "It seems that when I use a tool (such as winmerge) to update my codebase... my Visual Studio Team System (VSTS) integration with Team Foundation Server (TFS) doesn't seem to pick it up.\nHow do I know which files to check out and check back in? Is there something I am missing? I... |
I would like to be able to monitor my major system health indicators from inside our Java-based system. Major points of interest include CPU temperature, motherboard temperature, fan speed, etc.
Is there a package available that:
Makes this sort of data available to Java?
Works on Windows or Linux or both?
Is open ... | Yes, there are several options you can consider for monitoring system health indicators such as CPU temperature, motherboard temperature, fan speed, etc., from within a Java-based system. Here are a few packages and libraries that can help you achieve this:
1. **Sigar (System Information Gatherer and Reporter)**:
-... | 14,937 | [
{
"from": "human",
"value": "I would like to be able to monitor my major system health indicators from inside our Java-based system. Major points of interest include CPU temperature, motherboard temperature, fan speed, etc. \nIs there a package available that:\n\nMakes this sort of data available to Java?... |
inline int factorial(int n)
{
if(!n) return 1;
else return n*factorial(n-1);
}
As I was reading this, found that the above code would lead to "infinite compilation" if not handled by compiler correctly.
How does the compiler decide whether to inline a function or not ?
| In C and C++, the `inline` keyword suggests to the compiler that it should attempt to expand the function inline, rather than generating a traditional function call. However, whether the compiler actually inlines a function is ultimately up to the compiler's optimization settings and heuristics. There are several facto... | 17,389 | [
{
"from": "human",
"value": "inline int factorial(int n)\n{\n if(!n) return 1;\n else return n*factorial(n-1);\n}\n\nAs I was reading this, found that the above code would lead to \"infinite compilation\" if not handled by compiler correctly.\nHow does the compiler decide whether to inline a function ... |
I maintain a Java Swing application.
For backwards compatibility with java 5 (for Apple machines), we maintain two codebases, 1 using features from Java 6, another without those features.
The code is largely the same, except for 3-4 classes that uses Java 6 features.
I wish to just maintain 1 codebase. Is there a way d... | Maintaining a single codebase that targets both Java 5 and Java 6 can be challenging, especially when you want to use Java 6 features without having to comment or uncomment sections of your code. While there isn't a straightforward way to "ignore" specific parts of the code during compilation, there are some strategies... | 13,183 | [
{
"from": "human",
"value": "I maintain a Java Swing application.\nFor backwards compatibility with java 5 (for Apple machines), we maintain two codebases, 1 using features from Java 6, another without those features.\nThe code is largely the same, except for 3-4 classes that uses Java 6 features.\nI wish t... |
How can I get the list of available databases on a SQL Server instance? I'm planning to make a list of them in a combo box in VB.NET.
| To get a list of available databases on a SQL Server instance, you can use a SQL query that retrieves the database names from the system catalog views. One common way to do this is to use the `sys.databases` view. Here's how you can do this in VB.NET.
### Step 1: Set up your SQL Connection
First, you will need to est... | 14,469 | [
{
"from": "human",
"value": "How can I get the list of available databases on a SQL Server instance? I'm planning to make a list of them in a combo box in VB.NET.\n"
},
{
"from": "gpt",
"value": "To get a list of available databases on a SQL Server instance, you can use a SQL query that retrieve... |
I have a web application where there are number of Ajax components which refresh themselves every so often inside a page (it's a dashboard of sorts).
Now, I want to add functionality to the page so that when there is no Internet connectivity, the current content of the page doesn't change and a message appears on the p... | To handle offline scenarios gracefully in your web application, you can implement a combination of JavaScript and some event listeners to detect connectivity changes. Here's a step-by-step approach to achieve this:
### Step 1: Set Up Offline Detection
You can use the `navigator.onLine` property and `online` and `offl... | 13,764 | [
{
"from": "human",
"value": "I have a web application where there are number of Ajax components which refresh themselves every so often inside a page (it's a dashboard of sorts).\nNow, I want to add functionality to the page so that when there is no Internet connectivity, the current content of the page doe... |
Okay, you don't need to be a guru, but if you happen to have a good working knowledge on SSIS and you used some tutorials around the web to get you there, then please share them. I have been trying to find some solid stuff (screencasts maybe), but I am having a hard time.
Any solid links would be appreciated and I wil... | Sure! SSIS (SQL Server Integration Services) is a powerful tool for data integration and workflow applications. Here are some additional resources, including tutorials and screencasts, that can help you deepen your understanding of SSIS:
1. **Microsoft Learn - SSIS**: Microsoft's official documentation and learning pa... | 14,944 | [
{
"from": "human",
"value": "Okay, you don't need to be a guru, but if you happen to have a good working knowledge on SSIS and you used some tutorials around the web to get you there, then please share them. I have been trying to find some solid stuff (screencasts maybe), but I am having a hard time. \nAny ... |
How do you use the nant <copy> command and maintain the directory structure? This is what I am doing, but it is copying all the files to a single directory.
<copy todir="..\out">
<fileset>
<includes name="..\src\PrecompiledWeb\**\*" />
</fileset>
</copy>
| To maintain the directory structure while using the `<copy>` command in Nant, you need to ensure that the destination path reflects the relative structure of the source files. In your current approach, the files are being copied into a single directory because you are specifying a `todir` without preserving the directo... | 14,099 | [
{
"from": "human",
"value": "How do you use the nant <copy> command and maintain the directory structure? This is what I am doing, but it is copying all the files to a single directory.\n<copy todir=\"..\\out\">\n <fileset>\n <includes name=\"..\\src\\PrecompiledWeb\\**\\*\" />\n </fileset>\n</copy>\n\... |
One I am aware of is Perl::Critic
And my googling has resulted in no results on multiple attempts so far. :-(
Does anyone have any recommendations here?
Any resources to configure Perl::Critic as per our coding standards and run it on code base would be appreciated.
| Perl::Critic is a popular module used for static code analysis in Perl, and it can help enforce coding standards across your codebase. Here are some recommendations and resources to help you configure Perl::Critic according to your coding standards and to run it on your codebase:
### Getting Started with Perl::Critic
... | 11,861 | [
{
"from": "human",
"value": "One I am aware of is Perl::Critic\nAnd my googling has resulted in no results on multiple attempts so far. :-(\nDoes anyone have any recommendations here?\nAny resources to configure Perl::Critic as per our coding standards and run it on code base would be appreciated.\n"
},
... |
In what scenarios is it better to use a struct vs a class in C++?
| In C++, both `struct` and `class` can be used to define complex data types that can hold variables and functions (methods). However, there are certain conventions and scenarios where it may be better to use one over the other:
### Scenarios to Use `struct`:
1. **Plain Old Data (POD)**:
- If your data type is essen... | 11,552 | [
{
"from": "human",
"value": "In what scenarios is it better to use a struct vs a class in C++?\n"
},
{
"from": "gpt",
"value": "In C++, both `struct` and `class` can be used to define complex data types that can hold variables and functions (methods). However, there are certain conventions and s... |
I've seen a lot of commonality in regex capabilities of different regex-enabled tools/languages (e.g. perl, sed, java, vim, etc), but I've also many differences.
Is there a standard subset of regex capabilities that all regex-enabled tools/languages will support? How do regex capabilities vary between tools/languages?
| Regular expressions (regex) are widely used in various programming languages and tools for string matching and manipulation. While there is a lot of commonality among regex implementations, differences do exist, which can lead to confusion if you switch between tools or languages.
### Common Subset of Regex Capabilit... | 10,783 | [
{
"from": "human",
"value": "I've seen a lot of commonality in regex capabilities of different regex-enabled tools/languages (e.g. perl, sed, java, vim, etc), but I've also many differences.\nIs there a standard subset of regex capabilities that all regex-enabled tools/languages will support? How do regex c... |
I use FB1.5.3 and need to eventually add some FK to the database.
It happens that if I try to do it while anyone else is connected to the DB I get an exception.
Is there a way to add an FK while the system is running?
| In Firebird 1.5.3, adding a foreign key (FK) constraint while the database is actively being used can lead to exceptions if there are concurrent connections that could violate the constraint or if the underlying data is in a state that prevents the operation from completing. Unfortunately, in older versions like FB 1.5... | 14,270 | [
{
"from": "human",
"value": "I use FB1.5.3 and need to eventually add some FK to the database.\nIt happens that if I try to do it while anyone else is connected to the DB I get an exception.\nIs there a way to add an FK while the system is running?\n"
},
{
"from": "gpt",
"value": "In Firebird 1.... |
I have a Windows Form app written in C#. Its job is to send messages to a list of users. While those messages are being sent, I'd like to display status of the operation for each user. What I am doing (for each user) is creating a Label control and adding it to Panel. This works without a problem for a small set of ... | The issue you're experiencing when trying to create and display a large number of UI controls (like Label controls) on a Windows Form is likely due to the performance limits of Windows Forms in handling many controls. When you add a large number of controls, the overhead in managing those controls can cause the applica... | 15,126 | [
{
"from": "human",
"value": "I have a Windows Form app written in C#. Its job is to send messages to a list of users. While those messages are being sent, I'd like to display status of the operation for each user. What I am doing (for each user) is creating a Label control and adding it to Panel. This wo... |
Has anyone had good experiences with any Java libraries for Graph algorithms. I've tried JGraph and found it ok, and there are a lot of different ones in google. Are there any that people are actually using successfully in production code or would recommend?
To clarify, I'm not looking for a library that produces graph... | Yes, there are several Java libraries that are widely used and well-regarded for implementing graph algorithms. Here are some recommendations that may suit your needs:
1. **JGraphT**: This is one of the most popular libraries for graph data structures and algorithms in Java. It offers a rich set of graph types, includ... | 12,518 | [
{
"from": "human",
"value": "Has anyone had good experiences with any Java libraries for Graph algorithms. I've tried JGraph and found it ok, and there are a lot of different ones in google. Are there any that people are actually using successfully in production code or would recommend?\nTo clarify, I'm not... |
I installed mediawiki on my server as my personal knowledge base. Sometimes I copy some stuff from Web and paste to my wiki - such as tips & tricks from somebody's blog. How do I make the copied content appear in a box with border?
For example, the box at the end of this blog post looks pretty nice:
http://blog.dreamho... | To create a styled box for your copied content in MediaWiki, you can use the `{{Quote}}` template, or create a custom CSS style if you prefer a more personalized design.
### Option 1: Using the `Quote` Template
MediaWiki usually includes a `Quote` or similar template you can use, depending on your installation. You c... | 15,702 | [
{
"from": "human",
"value": "I installed mediawiki on my server as my personal knowledge base. Sometimes I copy some stuff from Web and paste to my wiki - such as tips & tricks from somebody's blog. How do I make the copied content appear in a box with border?\nFor example, the box at the end of this blog p... |
I'm building a java/spring application, and i may need to incorporate a stateful web service call.
Any opinions if i should totally run away from a stateful services call, or it can be done and is enterprise ready?
| When designing a Java/Spring application, whether to use stateful or stateless web services depends on your specific requirements and the context of your application. Here's an overview of the considerations for using stateful services, along with best practices:
### Considerations for Stateful Services
1. **Use Case... | 13,312 | [
{
"from": "human",
"value": "I'm building a java/spring application, and i may need to incorporate a stateful web service call.\nAny opinions if i should totally run away from a stateful services call, or it can be done and is enterprise ready?\n"
},
{
"from": "gpt",
"value": "When designing a J... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.