instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
Is there a simple method of parsing XML files in C#? If so, what?
| Yes, there are several simple methods to parse XML files in C#. One of the most common and straightforward ways is to use the `System.Xml.Linq` namespace, which provides the `XDocument` and `XElement` classes. These classes allow you to work with XML in a more readable and intuitive way using LINQ (Language Integrated ... | 12,571 | [
{
"from": "human",
"value": "Is there a simple method of parsing XML files in C#? If so, what?\n"
},
{
"from": "gpt",
"value": "Yes, there are several simple methods to parse XML files in C#. One of the most common and straightforward ways is to use the `System.Xml.Linq` namespace, which provide... |
I need my ASP.NET web application to use silverlight controls in my web page. Please let me know how to use them. Do i need to add any reference for them in my Visual Studio 2005. Framework 2.0 and ASP.NET 2.0 application environment.
| Integrating Silverlight into your ASP.NET web application requires several steps, especially considering you're working with Visual Studio 2005 and the .NET Framework 2.0. Silverlight, initially released in 2007, is a framework that enables rich internet applications with features similar to Adobe Flash.
Here’s a guid... | 11,502 | [
{
"from": "human",
"value": "I need my ASP.NET web application to use silverlight controls in my web page. Please let me know how to use them. Do i need to add any reference for them in my Visual Studio 2005. Framework 2.0 and ASP.NET 2.0 application environment.\n"
},
{
"from": "gpt",
"value": ... |
I need to write code in python language for comparing the text of document using fingerprint techniques. I do not know to take fingerprint of a document or to generate fingerprint of a document. I'm asking if anyone knows the method or has source code for generating fingerprints of documents which is stored in bits for... | To compare the text of documents using fingerprinting techniques in Python, you can use a method called "MinHash." This technique allows you to efficiently compare the similarity of two documents based on their content. The basic idea is to create a compact representation (the "fingerprint") of the documents that can b... | 10,448 | [
{
"from": "human",
"value": "I need to write code in python language for comparing the text of document using fingerprint techniques. I do not know to take fingerprint of a document or to generate fingerprint of a document. I'm asking if anyone knows the method or has source code for generating fingerprints... |
I know the answer is not going to be simple, and I already use a couple of (I think ugly) cludges. I am simply looking for some elegant answers.
Abstract class:
public interface IOtherObjects;
public abstract class MyObjects<T> where T : IOtherObjects
{
...
public List<T> ToList()
{
...
}
}
Childr... | It sounds like you're trying to achieve a way to utilize the `ToList` method from your `MyObjects<T>` class, even when you only know that you're dealing with instances of `MyObjects` at a higher abstraction level. Here’s a breakdown of your scenario, followed by some elegant solutions you might consider:
### Problem O... | 6,604 | [
{
"from": "human",
"value": "I know the answer is not going to be simple, and I already use a couple of (I think ugly) cludges. I am simply looking for some elegant answers.\nAbstract class:\npublic interface IOtherObjects;\n\npublic abstract class MyObjects<T> where T : IOtherObjects\n{\n ...\n\n publi... |
We are using JBoss Rules (a.k.a. Drools) and have several .drl files that each contain several rules. Is there a way to avoid duplication between files, so that we can define common rules that are available to more than one .drl file?
Unfortunately, there does not seem to be any kind of include or module facility.
| In JBoss Rules (Drools), while there isn't a direct mechanism for including or importing DRL files like you would with traditional programming languages, there are several strategies you can employ to avoid duplication and manage common rules effectively. Here are a few approaches you can consider:
1. **Rule Templates... | 13,443 | [
{
"from": "human",
"value": "We are using JBoss Rules (a.k.a. Drools) and have several .drl files that each contain several rules. Is there a way to avoid duplication between files, so that we can define common rules that are available to more than one .drl file?\nUnfortunately, there does not seem to be an... |
I want to be able to run a single spec file's tests — for the one file I'm editing, for example. rake spec executes all the specs. My project is not a Rails project, so rake spec:doc doesn't work.
Don't know if this matters, but here is my directory structure.
./Rakefile
./lib
./lib/cushion.rb
./lib/cushion
./lib/cu... | To run a specific test file using RSpec with Rake in a non-Rails project, you can modify your Rakefile or use command-line options directly. Here are a few methods you can use to run a single spec file.
### Method 1: Modify Rakefile for Specific File
You can update your Rakefile to include a way to run a specific spe... | 12,001 | [
{
"from": "human",
"value": "I want to be able to run a single spec file's tests — for the one file I'm editing, for example. rake spec executes all the specs. My project is not a Rails project, so rake spec:doc doesn't work.\nDon't know if this matters, but here is my directory structure.\n\n./Rakefile\n... |
While googling, I see that using java.io.File#length() can be slow.
FileChannel has a size() method that is available as well.
Is there an efficient way in java to get the file size?
| Yes, there are multiple ways to efficiently get the size of a file in Java. While `java.io.File#length()` is often sufficient for most use cases, it can have performance issues, especially for network filesystems or very large files. Using `FileChannel` can provide better performance in certain scenarios, particularly ... | 10,313 | [
{
"from": "human",
"value": "While googling, I see that using java.io.File#length() can be slow.\nFileChannel has a size() method that is available as well.\nIs there an efficient way in java to get the file size?\n"
},
{
"from": "gpt",
"value": "Yes, there are multiple ways to efficiently get t... |
From a shell script, how do I check if a directory contains files?
Something similar to this
if [ -e /some/dir/* ]; then echo "huzzah"; fi;
but which works if the directory contains one or several files (the above one only works with exactly 0 or 1 files).
| In a shell script, you can check if a directory contains files by using a wildcard pattern with a conditional statement. However, to ensure that it correctly checks for multiple files, you can use a combination of the `find` command, `ls`, or even the shell's built-in capabilities. Here are a couple of ways to do this:... | 11,117 | [
{
"from": "human",
"value": "From a shell script, how do I check if a directory contains files?\nSomething similar to this\nif [ -e /some/dir/* ]; then echo \"huzzah\"; fi;\n\nbut which works if the directory contains one or several files (the above one only works with exactly 0 or 1 files).\n"
},
{
... |
I visited few web sites in the past where they had a set of photo thumbnails and clicking on one of them created a cool effect of an expanding popup showing the full size image.
Is there any available free JavaScript library that will do this?
I'm interested mostly in the popup effect and less in the rest of the album ... | Yes, there are several free JavaScript libraries that can help you create a lightbox effect for images, which includes a cool expanding popup effect when you click on a thumbnail. Here are a few popular options:
1. **Lightbox2**:
- Website: [Lightbox2](https://lokeshdhakar.com/projects/lightbox2/)
- It’s a simpl... | 7,929 | [
{
"from": "human",
"value": "I visited few web sites in the past where they had a set of photo thumbnails and clicking on one of them created a cool effect of an expanding popup showing the full size image.\nIs there any available free JavaScript library that will do this?\nI'm interested mostly in the popu... |
I am searching for a tutorial (optimally with Zend Framework) on how to use PHPUnit.
I have found a couple on google but have not quiet understood it yet.
| Sure! Testing with PHPUnit in a Zend Framework project can be quite beneficial for ensuring code quality and maintaining functionality. Here’s a basic tutorial to get you started with PHPUnit in a Zend Framework application:
### Setting Up PHPUnit in Zend Framework
1. **Install PHPUnit**:
If you haven't done so al... | 8,392 | [
{
"from": "human",
"value": "I am searching for a tutorial (optimally with Zend Framework) on how to use PHPUnit.\nI have found a couple on google but have not quiet understood it yet.\n"
},
{
"from": "gpt",
"value": "Sure! Testing with PHPUnit in a Zend Framework project can be quite beneficial... |
Any good tutorial with source that will demonstrate how to develop neural network (step bay step for dummies ;-))
| Absolutely! Here's a step-by-step guide to developing a simple neural network using Python with TensorFlow and Keras. This guide assumes you have some basic knowledge of Python. We'll build a neural network to classify images from the MNIST dataset (handwritten digits).
### Step 1: Set Up Your Environment
1. **Instal... | 8,698 | [
{
"from": "human",
"value": "Any good tutorial with source that will demonstrate how to develop neural network (step bay step for dummies ;-))\n"
},
{
"from": "gpt",
"value": "Absolutely! Here's a step-by-step guide to developing a simple neural network using Python with TensorFlow and Keras. Th... |
I'm working with a support person who is supposed to be able to install SSL certs on a web server he maintains. He has local admin rights to the server via a domain security group. He also has permissions on our internal CA running Windows 2003 Server Certificate Authority: "Request cert" and "Issue and Manage certs"... | The "Access is Denied" error when trying to install an SSL certificate on IIS 5 can be caused by several factors, particularly around permissions and configuration on the server itself. Here are some steps you can take to troubleshoot and possibly resolve the issue:
1. **Local Permissions**: Verify that the support pe... | 11,920 | [
{
"from": "human",
"value": "I'm working with a support person who is supposed to be able to install SSL certs on a web server he maintains. He has local admin rights to the server via a domain security group. He also has permissions on our internal CA running Windows 2003 Server Certificate Authority: \"... |
I want to replace a single file inside a msi. How to do it?
| To replace a single file inside an MSI (Microsoft Installer) package, you can use a few different methods, depending on your level of expertise and the tools you have at your disposal. Below are some common methods to modify an MSI file:
### Method 1: Using Orca
Orca is a database editor provided by Microsoft as part... | 11,153 | [
{
"from": "human",
"value": "I want to replace a single file inside a msi. How to do it?\n"
},
{
"from": "gpt",
"value": "To replace a single file inside an MSI (Microsoft Installer) package, you can use a few different methods, depending on your level of expertise and the tools you have at your... |
I've been given the task of laying the groundwork of a SOA for my client. The goal is to open up various processes in an end-client independent way and also to make data available offline e.g. for reps visiting customers.
I do have extensive experience with J2EE (Websphere) and web services but I would appreciate advic... | Designing a Service-Oriented Architecture (SOA) involves careful planning and execution to ensure that the services are reusable, maintainable, and scalable. Here are some key considerations and best practices to help you establish a robust SOA for your client:
### Key Considerations
1. **Service Granularity:**
- ... | 10,676 | [
{
"from": "human",
"value": "I've been given the task of laying the groundwork of a SOA for my client. The goal is to open up various processes in an end-client independent way and also to make data available offline e.g. for reps visiting customers.\nI do have extensive experience with J2EE (Websphere) and... |
I currently have WHM/cPanel on my server, but it doesn't integrate properly with any Java EE App Server. I installed Tomcat manually, and have made it work through Apache, but the configuration is more fragile than I'd like.
So, I'm trying to find a replacement where a Java EE App Server can be properly integrated & ma... | Based on your requirements, here are some recommended software packages that can help you manage a Java EE App Server more effectively than WHM/cPanel while meeting your criteria for open-source, CentOS compatibility, and integration with Apache and Tomcat.
### 1. **Plesk (Open Source Version)**
- **Description**: Whi... | 10,125 | [
{
"from": "human",
"value": "I currently have WHM/cPanel on my server, but it doesn't integrate properly with any Java EE App Server. I installed Tomcat manually, and have made it work through Apache, but the configuration is more fragile than I'd like.\nSo, I'm trying to find a replacement where a Java EE ... |
I have a constructor like as follows:
public Agent(){
this.name = "John";
this.id = 9;
this.setTopWorldAgent(this, "Top_World_Agent", true);
}
I'm getting a null pointer exception here in the method call. It appears to be because I'm using 'this' as an argument in the setTopWorldAgent method. By removing... | The `NullPointerException` you're encountering in the `setTopWorldAgent` method call using `this` as an argument likely occurs because the instance variables you're trying to access within that method have not been fully initialized at the point when the method is called in the constructor.
In Java, when you create a... | 10,148 | [
{
"from": "human",
"value": "I have a constructor like as follows:\npublic Agent(){\n\n this.name = \"John\";\n this.id = 9;\n this.setTopWorldAgent(this, \"Top_World_Agent\", true);\n\n}\n\nI'm getting a null pointer exception here in the method call. It appears to be because I'm using 'this' as a... |
I've got several AssemblyInfo.cs files as part of many projects in a single solution that I'm building automatically as part of TeamCity.
To make the msbuild script more maintainable I'd like to be able to use the AssemblyInfo community task in conjunction with an ItemGroup e.g.
<ItemGroup>
<AllAssemblyInfos Inclu... | You are correct that the `OutputFile` parameter in the AssemblyInfo community task does not accept an `ItemGroup` directly as input. However, you can work around this limitation using MSBuild’s `Items` and `Target` to iterate through each file in your item group and call the `AssemblyInfo` task for each file.
Here’s a... | 9,930 | [
{
"from": "human",
"value": "I've got several AssemblyInfo.cs files as part of many projects in a single solution that I'm building automatically as part of TeamCity.\nTo make the msbuild script more maintainable I'd like to be able to use the AssemblyInfo community task in conjunction with an ItemGroup e.g... |
I'm working on a casual game on XNA with the intention of deploying to the Xbox 360. I'm not going to have access to hardware for a few weeks and I'm on a tight deadline, so I'd like to test that a few things -- Boo and a few custom libraries -- will work properly on the 360. If they don't, I need to work around them... | Unfortunately, there isn't a dedicated simulator specifically for running XNA code targeted at the Xbox 360 in the way you might be hoping. The Xbox 360 environment is different from standard desktop .NET environments, particularly since it operates on the .NET Compact Framework, which has certain limitations and diffe... | 13,446 | [
{
"from": "human",
"value": "I'm working on a casual game on XNA with the intention of deploying to the Xbox 360. I'm not going to have access to hardware for a few weeks and I'm on a tight deadline, so I'd like to test that a few things -- Boo and a few custom libraries -- will work properly on the 360. ... |
I have Drupal 5 site where a button is clicked and it calls a JavaScript function. The function basically builds a string, and then redirects to another page on our site. After clicking the button, sometimes the user gets logged out and sees the "Access Denied" screen, even though they were previously logged in. The pa... | It sounds like you're experiencing a frustrating issue with your Drupal 5 site and the inconsistent logout behavior after the JavaScript function is executed. Given that you mentioned the users experiencing the issue are using Internet Explorer 6, there are a few potential causes and solutions to consider:
### Potenti... | 11,381 | [
{
"from": "human",
"value": "I have Drupal 5 site where a button is clicked and it calls a JavaScript function. The function basically builds a string, and then redirects to another page on our site. After clicking the button, sometimes the user gets logged out and sees the \"Access Denied\" screen, even th... |
I recently built an API and was often asked to replace the StringCollections I was returning by objects containing a single property, The reason being that it was easier to bind with a listview or other controls in ASP.Net.
Since the API was used by the web application, the Web service and the dataloader I decided on k... | Your decision to continue using `StringCollection` as the return type for your API can be justified based on several considerations. However, it also highlights some of the trade-offs you need to weigh in API design. Here are some points you could use to justify your choice:
1. **Consistency Across Services**: If your... | 12,416 | [
{
"from": "human",
"value": "I recently built an API and was often asked to replace the StringCollections I was returning by objects containing a single property, The reason being that it was easier to bind with a listview or other controls in ASP.Net.\nSince the API was used by the web application, the Web... |
ASP.NET MVC seems to be making a pretty big entrance. Can anyone summarize how its MVC implementation stacks up against popular MVC frameworks for other languages? (I'm thinking specifically of Rails and Zend Framework, though there are obviously lots.) Observations on learning curve, common terminology, ease of use ... | ASP.NET MVC has gained popularity as a robust framework for building web applications using the Model-View-Controller (MVC) design pattern. Comparing it to popular frameworks like Ruby on Rails and Zend Framework can give a clearer idea of its strengths and weaknesses. Here's a breakdown based on various aspects:
### ... | 9,396 | [
{
"from": "human",
"value": "ASP.NET MVC seems to be making a pretty big entrance. Can anyone summarize how its MVC implementation stacks up against popular MVC frameworks for other languages? (I'm thinking specifically of Rails and Zend Framework, though there are obviously lots.) Observations on learnin... |
I see __all__ in __init__.py files. What does it do?
| The `__all__` variable in a Python module (including `__init__.py` files) is a convention used to define a list of public objects of that module. When you import a module using the `from module import *` syntax, only the names listed in the `__all__` variable will be imported.
Here’s how it works:
1. **Purpose**: It ... | 12,858 | [
{
"from": "human",
"value": "I see __all__ in __init__.py files. What does it do?\n"
},
{
"from": "gpt",
"value": "The `__all__` variable in a Python module (including `__init__.py` files) is a convention used to define a list of public objects of that module. When you import a module using the ... |
I am new to any scripting language. But, Still I worked on scripting a bit like tailoring other scripts to work for my purpose. For me, What is the best online resource to learn Python?
[Response Summary:]
Some Online Resources:
http://docs.python.org/tut/tut.html - Beginners
http://diveintopython3.ep.io/ - Inte... | It's great to hear that you're diving into Python! Here are some excellent online resources to help you learn Python from beginner to advanced levels:
### Beginner Resources:
1. **[Python Official Tutorial](https://docs.python.org/3/tutorial/index.html)** - A comprehensive guide that's good for beginners.
2. **[Automa... | 9,805 | [
{
"from": "human",
"value": "I am new to any scripting language. But, Still I worked on scripting a bit like tailoring other scripts to work for my purpose. For me, What is the best online resource to learn Python?\n[Response Summary:] \nSome Online Resources:\n http://docs.python.org/tut/tut.html - Beginne... |
In case you don't know of Phoenix, it's a compiler framework from Microsoft that's apparantly going to be the foundation of all their new compilers. It can read in code from CIL, x86, x64, and IA64; and emit code in x86, x64, IA64, or CIL.
Can I use it to transform a pure .Net app into a pure native app? By which I mea... | Phoenix was indeed a project by Microsoft aimed at creating a framework for building compilers and code analysis tools, but it has not been actively developed for public use in a long time. Regarding your question about transforming a pure .NET application into a pure native application, it's important to clarify a few... | 14,140 | [
{
"from": "human",
"value": "In case you don't know of Phoenix, it's a compiler framework from Microsoft that's apparantly going to be the foundation of all their new compilers. It can read in code from CIL, x86, x64, and IA64; and emit code in x86, x64, IA64, or CIL.\nCan I use it to transform a pure .Net ... |
If I was, for example, going to count "activities" across many computers and show a rollup of that activity, what would the database look like to store the data?
Simply this? Seems too simple. I'm overthinking this.
ACTIVITYID COUNT
---------- -----
| Your basic structure of having an `ACTIVITYID` and `COUNT` is a good starting point for rolling up activity data across multiple computers. However, depending on your requirements and the complexity of the data you're working with, you may want to consider expanding your database schema to capture more relevant details... | 11,637 | [
{
"from": "human",
"value": "If I was, for example, going to count \"activities\" across many computers and show a rollup of that activity, what would the database look like to store the data? \nSimply this? Seems too simple. I'm overthinking this.\nACTIVITYID COUNT\n---------- -----\n\n"
},
{
"fr... |
What is the best way to survey and detect bad users behavior or attacks like deny of services or exploits on my web app ?
I know server's statistics (like Awstats) are very useful for that kind of purpose, specially to see 3XX, 4XX and 5XX errors (here's an Awstats example page) which are often bots or bad intentioned ... | Detecting malicious user behavior or attacks on your web application, especially those based on URL manipulation, involves a multi-faceted approach. Here are several strategies you can adopt in addition to reviewing server statistics like AWStats:
### 1. **Log Analysis**
- **Web Server Logs**: Regularly analyze you... | 11,844 | [
{
"from": "human",
"value": "What is the best way to survey and detect bad users behavior or attacks like deny of services or exploits on my web app ?\nI know server's statistics (like Awstats) are very useful for that kind of purpose, specially to see 3XX, 4XX and 5XX errors (here's an Awstats example page... |
Can I use JavaScript to check (irrespective of scrollbars) if an HTML element has overflowed its content? For example, a long div with small, fixed size, the overflow property set to visible, and no scrollbars on the element.
| Yes, you can use JavaScript to check if an HTML element has overflowed its content, regardless of whether scrollbars are present. To determine if an element has overflowed, you need to compare its scroll dimensions (which include the content size) to its client dimensions (which reflect the visible area).
Here is how ... | 11,869 | [
{
"from": "human",
"value": "Can I use JavaScript to check (irrespective of scrollbars) if an HTML element has overflowed its content? For example, a long div with small, fixed size, the overflow property set to visible, and no scrollbars on the element.\n"
},
{
"from": "gpt",
"value": "Yes, you... |
I have an iMac, and I want to be able to turn off the monitor when I go to sleep,. Alas, the iMac has no switch for this. I do not want to put the iMac into sleep mode, i want to write a "expose" like application or service, which when the mouse is put into the upper left hand corner of my screen, the display will sl... | Creating a tool to put the display to sleep based on mouse movement in Windows Vista can be a fun project! Here’s a general outline and guidance on how to get started with such a project:
### 1. **Set Up Your Development Environment**
- Install a development environment suitable for Windows programming (e.g., Visual ... | 8,618 | [
{
"from": "human",
"value": "I have an iMac, and I want to be able to turn off the monitor when I go to sleep,. Alas, the iMac has no switch for this. I do not want to put the iMac into sleep mode, i want to write a \"expose\" like application or service, which when the mouse is put into the upper left ha... |
I want to select the topmost element in a document that has a given namespace (prefix).
More specifically: I have XML documents that either start with /html/body (in the XHTML namespace) or with one of several elements in a particular namespace. I effectively want to strip out /html/body and just return the body conten... | To select the topmost element in a document that has a specific namespace (prefix), you can use XPath, which is a powerful language for navigating through elements and attributes in XML documents.
Here's a step-by-step approach to achieve this:
### 1. Identify the Namespaces
First, you need to identify the namespaces... | 10,916 | [
{
"from": "human",
"value": "I want to select the topmost element in a document that has a given namespace (prefix).\nMore specifically: I have XML documents that either start with /html/body (in the XHTML namespace) or with one of several elements in a particular namespace. I effectively want to strip out ... |
I want to wrap a Perl one-liner in a batch file. For a (trivial) example, in a Unix shell, I could quote up a command like this:
perl -e 'print localtime() . "\n"'
But DOS chokes on that with this helpful error message:
Can't find string terminator "'" anywhere before EOF at -e line 1.
What's the best way to do this... | In a Windows batch file, dealing with quotes and escaping can be a bit tricky due to how the command line interprets special characters. To run your Perl one-liner in a `.bat` file, you can use double quotes instead of single quotes. You can also escape the double quotes within the Perl command itself. Here’s how you c... | 14,361 | [
{
"from": "human",
"value": "I want to wrap a Perl one-liner in a batch file. For a (trivial) example, in a Unix shell, I could quote up a command like this:\nperl -e 'print localtime() . \"\\n\"'\n\nBut DOS chokes on that with this helpful error message:\n\nCan't find string terminator \"'\" anywhere befor... |
I find the autoindent style of Notepad++ a little weird: when I am typing on an indented line, I do want it to indent the next line after I press Enter (this it does properly). However, when I am on an empty line (no indentation, no characters) and I press Enter, it indents the next line, using the same indentation as ... | Yes, the behavior you're experiencing in Notepad++ can indeed be frustrating for those who prefer a different auto-indent functionality, especially when working with languages like HTML or PHP. Fortunately, you can adjust the settings in Notepad++ to minimize or eliminate this behavior.
### Here are a few steps you ca... | 12,493 | [
{
"from": "human",
"value": "I find the autoindent style of Notepad++ a little weird: when I am typing on an indented line, I do want it to indent the next line after I press Enter (this it does properly). However, when I am on an empty line (no indentation, no characters) and I press Enter, it indents the ... |
In VB.Net, I can declare a variable in a function as Static, like this:
Function EncodeForXml(ByVal data As String) As String
Static badAmpersand As Regex = new Regex("&(?![a-zA-Z]{2,6};|#[0-9]{2,4};)")
data = badAmpersand.Replace(data, "&")
''// more processing
return data
End Function
Note tha... | In C#, there isn't a direct equivalent of the `Static` keyword as used in VB.Net for declaring static variables within a method. However, you can achieve similar functionality by using a static variable in a local scope using a static field within the method. You can use a `static` variable inside a method in C# by dec... | 13,416 | [
{
"from": "human",
"value": "In VB.Net, I can declare a variable in a function as Static, like this:\nFunction EncodeForXml(ByVal data As String) As String\n Static badAmpersand As Regex = new Regex(\"&(?![a-zA-Z]{2,6};|#[0-9]{2,4};)\")\n\n data = badAmpersand.Replace(data, \"&\")\n\n ''// more... |
Is there an easy way to find the number of classes contained within a visual studio solution? Other than writing a funky find script, I couldn't find a way to do it within the code metrics piece of VS.
I am running Visual Studio 2008 and this is a VB.Net project through and through.
thanks!
| In Visual Studio 2008, while there's no built-in feature specifically to count classes in a solution, you can still achieve this with a simple approach using the built-in tools and functionalities of Visual Studio or some basic scripting.
### Method 1: Manual Count using Solution Explorer
If your solution is relativel... | 9,764 | [
{
"from": "human",
"value": "Is there an easy way to find the number of classes contained within a visual studio solution? Other than writing a funky find script, I couldn't find a way to do it within the code metrics piece of VS. \nI am running Visual Studio 2008 and this is a VB.Net project through and... |
What is the cause of this exception in ASP.NET? Obviously it is a viewstate exception, but I can't reproduce the error on the page that is throwing the exception (a simple two TextBox form with a button and navigation links).
FWIW, I'm not running a web farm.
Exception
Error Message: Unable to validate
data.
Error ... | The error message you're encountering indicates that ASP.NET is unable to validate the view state of a page, which typically means that the data contained in the view state is either corrupted or was tampered with. Here are some common causes and potential solutions for this issue:
1. **ViewState MAC Validation Failur... | 11,702 | [
{
"from": "human",
"value": "What is the cause of this exception in ASP.NET? Obviously it is a viewstate exception, but I can't reproduce the error on the page that is throwing the exception (a simple two TextBox form with a button and navigation links).\nFWIW, I'm not running a web farm.\nException\n\nErr... |
I have one thread that writes results into a Queue.
In another thread (GUI), I periodically (in the IDLE event) check if there are results in the queue, like this:
def queue_get_all(q):
items = []
while 1:
try:
items.append(q.get_nowait())
except Empty, e:
break
retur... | Your approach to using a `Queue` for communication between threads is generally a good one, as it allows you to safely pass data between threads without needing to deal with complex synchronization mechanisms. The method you've shown for getting all items from the queue using `q.get_nowait()` in a loop is appropriate f... | 12,738 | [
{
"from": "human",
"value": "I have one thread that writes results into a Queue.\nIn another thread (GUI), I periodically (in the IDLE event) check if there are results in the queue, like this:\ndef queue_get_all(q):\n items = []\n while 1:\n try:\n items.append(q.get_nowait())\n ... |
Using the zip function, Python allows for loops to traverse multiple sequences in parallel.
for (x,y) in zip(List1, List2):
Does MATLAB have an equivalent syntax? If not, what is the best way to iterate over two parallel arrays at the same time using MATLAB?
| MATLAB does not have a direct equivalent to Python's `zip` function for iterating over two arrays in parallel using a syntax like `for (x,y) in zip(List1, List2)`. However, there are several ways to achieve similar functionality.
### Method 1: Using a for loop with indexing
The most common way to iterate over two arra... | 10,442 | [
{
"from": "human",
"value": "Using the zip function, Python allows for loops to traverse multiple sequences in parallel. \nfor (x,y) in zip(List1, List2):\nDoes MATLAB have an equivalent syntax? If not, what is the best way to iterate over two parallel arrays at the same time using MATLAB?\n"
},
{
... |
I want to call a web service, but I won't know the url till runtime.
Whats the best way to get the web reference in, without actually committing to a url.
What about having 1 client hit the same web service on say 10 different domains?
| When you don't know the URL of a web service until runtime, you can use a more dynamic approach to create your web service client. Here are several strategies you might consider, particularly if you want to support multiple domains or endpoints:
### 1. **Dynamic HTTP Client**
Instead of generating a static web referen... | 10,465 | [
{
"from": "human",
"value": "I want to call a web service, but I won't know the url till runtime.\nWhats the best way to get the web reference in, without actually committing to a url.\nWhat about having 1 client hit the same web service on say 10 different domains?\n"
},
{
"from": "gpt",
"value... |
I have a WCF service which includes UI components, which forces me to be in STA mode.
How do I set the service behaviour to STA-mode?
The service uses a reference to a WPF DLL file which opens a UI window (used as view port) for picture analysis. When the service is trying to create an instance of that item (inherits ... | In WCF, services by default run in a multi-threaded apartment (MTA) mode. Since you want to use UI components that require single-threaded apartment (STA) mode, you need to modify your service so it creates a thread that operates in STA mode for creating and managing the UI elements.
Here's how you can set up a WCF se... | 12,149 | [
{
"from": "human",
"value": "I have a WCF service which includes UI components, which forces me to be in STA mode.\nHow do I set the service behaviour to STA-mode?\n\nThe service uses a reference to a WPF DLL file which opens a UI window (used as view port) for picture analysis. When the service is trying t... |
I'm now in search for a Java Text to Speech (TTS) framework. During my investigations I've found several JSAPI1.0-(partially)-compatible frameworks listed on JSAPI Implementations page, as well as a pair of Java TTS frameworks which do not appear to follow JSAPI spec (Mary, Say-It-Now). I've also noted that currently n... | When considering Java-based Text-to-Speech (TTS) frameworks, several options are available, each with its own strengths and weaknesses. Here's a breakdown based on your questions:
### 1. Which of the Java-based TTS frameworks have you used?
I've not personally used any framework, but I can provide insights based on g... | 11,565 | [
{
"from": "human",
"value": "I'm now in search for a Java Text to Speech (TTS) framework. During my investigations I've found several JSAPI1.0-(partially)-compatible frameworks listed on JSAPI Implementations page, as well as a pair of Java TTS frameworks which do not appear to follow JSAPI spec (Mary, Say-... |
I have a Linq to objects statement
var confirm = from l in lines.Lines
where (l.LineNumber == startline.LineNumber) || (l.LineNumber == endline.LineNumber)
select l;
The confirm object is returning an 'Object Null or Not A Reference' at at System.Linq.Enumerable.WhereListIterator`1.MoveNext()
If the result of the... | In LINQ to Objects, if you're encountering a `NullReferenceException` during the execution of your query, it's often due to one of the elements in the collection being null. In your case, the query looks for elements in `lines.Lines` where the `LineNumber` matches `startline.LineNumber` or `endline.LineNumber`.
To deb... | 11,250 | [
{
"from": "human",
"value": "I have a Linq to objects statement\n var confirm = from l in lines.Lines \n where (l.LineNumber == startline.LineNumber) || (l.LineNumber == endline.LineNumber) \n select l;\n\nThe confirm object is returning an 'Object Null or Not A Reference' at at System.Linq.Enumerable.Where... |
Errors that occur deep down in a data access layer or even higher up, (say within ADO.net operations for example) rarely make much sense to an end user. Simply bubbling these errors up to a UI and displaying them will usually achieve nothing except frustration for an end user.
I have recently employed a basic technique... | Your approach to error handling—catching exceptions at various layers of your application and wrapping them in more user-friendly messages—is a well-recognized pattern, and many developers adopt similar techniques. However, your concern about the efficiency and best practices surrounding this approach is valid. Here ar... | 7,957 | [
{
"from": "human",
"value": "Errors that occur deep down in a data access layer or even higher up, (say within ADO.net operations for example) rarely make much sense to an end user. Simply bubbling these errors up to a UI and displaying them will usually achieve nothing except frustration for an end user.\n... |
Consider these classes.
class Base
{
...
};
class Derived : public Base
{
...
};
this function
void BaseFoo( std::vector<Base*>vec )
{
...
}
And finally my vector
std::vector<Derived*>derived;
I want to pass derived to function BaseFoo, but the compiler doesn't let me. How do I solve this, without copying... | To pass your vector of pointers to `Derived` (`std::vector<Derived*>`) to the `BaseFoo` function that expects a vector of pointers to `Base` (`std::vector<Base*>`), you need to use a different approach because `std::vector<Derived*>` is not implicitly convertible to `std::vector<Base*>`.
One common solution is to use... | 12,639 | [
{
"from": "human",
"value": "Consider these classes.\nclass Base\n{\n ...\n};\n\nclass Derived : public Base\n{\n ...\n};\n\nthis function\nvoid BaseFoo( std::vector<Base*>vec )\n{\n ...\n}\n\nAnd finally my vector\nstd::vector<Derived*>derived;\n\nI want to pass derived to function BaseFoo, but the ... |
I was trying to remove all the lines of a file except the last line but the following command did not work, although file.txt is not empty.
$cat file.txt |tail -1 > file.txt
$cat file.txt
Why is it so?
| The command you used (`cat file.txt | tail -1 > file.txt`) didn't work as you expected because of how output redirection (`>`) interacts with the input file. When you run this command, the shell processes the redirection first. Here's what happens step-by-step:
1. The `cat file.txt` command is executed, and it starts ... | 14,249 | [
{
"from": "human",
"value": "I was trying to remove all the lines of a file except the last line but the following command did not work, although file.txt is not empty.\n$cat file.txt |tail -1 > file.txt\n\n$cat file.txt\n\nWhy is it so?\n"
},
{
"from": "gpt",
"value": "The command you used (`ca... |
I've download the SDK to try to copy the image to my PC from the server but no cmdlet for copy just get info moving etc
any help?
| It sounds like you're working with a software development kit (SDK) and trying to copy an image file from a server to your local PC. Without more specific information about which SDK you're using, it's a bit challenging to provide a precise answer. However, I can offer some general guidance.
1. **Check SDK Documentati... | 12,592 | [
{
"from": "human",
"value": "I've download the SDK to try to copy the image to my PC from the server but no cmdlet for copy just get info moving etc\nany help?\n"
},
{
"from": "gpt",
"value": "It sounds like you're working with a software development kit (SDK) and trying to copy an image file fr... |
A heap is a list where the following applies:
l[i] <= l[2*i] && l[i] <= [2*i+1]
for 0 <= i < len(list)
I'm looking for in-place sorting.
| To sort an array in-place using the properties of a heap, you can use the **heap sort** algorithm. This algorithm works by first constructing a max heap (or min heap, depending on whether you want ascending or descending order) from the input list, and then repeatedly extracting the maximum (or minimum) element from th... | 8,688 | [
{
"from": "human",
"value": "A heap is a list where the following applies:\nl[i] <= l[2*i] && l[i] <= [2*i+1]\n\nfor 0 <= i < len(list)\nI'm looking for in-place sorting.\n"
},
{
"from": "gpt",
"value": "To sort an array in-place using the properties of a heap, you can use the **heap sort** algo... |
I would like to write small console based applications on Windows Mobile. What console applications might I use?
| Creating console-based applications on Windows Mobile can be a bit challenging due to the platform's limitations and the fact that it is not as widely used as other mobile operating systems. However, if you are interested in developing small console applications, here are some ideas and options you might consider:
###... | 12,016 | [
{
"from": "human",
"value": "I would like to write small console based applications on Windows Mobile. What console applications might I use?\n"
},
{
"from": "gpt",
"value": "Creating console-based applications on Windows Mobile can be a bit challenging due to the platform's limitations and the... |
I am thinking of changing my web site's homegrown search engine. Before I break out Visual Studio, I wondered if anyone can suggest an alternative that gives me what I need. This being:
Works with an ASP.NET site (is a .NET project)
Creates a file-based index
Fast search across hundreds or thousands of pages
Performs ... | There are several alternatives to consider for your ASP.NET website's search engine that meet your requirements. Here are some suggestions:
1. **Lucene.NET**:
- **Overview**: A full-text search engine library that is a port of the popular Apache Lucene. It provides powerful indexing and searching capabilities.
-... | 11,849 | [
{
"from": "human",
"value": "I am thinking of changing my web site's homegrown search engine. Before I break out Visual Studio, I wondered if anyone can suggest an alternative that gives me what I need. This being:\n\nWorks with an ASP.NET site (is a .NET project)\nCreates a file-based index\nFast search ac... |
Would anyone recommend a particular JavaScript charting library - specifically one that doesn't use flash at all?
| There are several excellent JavaScript charting libraries that do not use Flash. Here are some popular ones you can consider:
1. **Chart.js**: A simple and flexible JavaScript charting library that supports various types of charts. It uses the HTML5 `<canvas>` element for rendering and is easy to integrate and customi... | 12,569 | [
{
"from": "human",
"value": "Would anyone recommend a particular JavaScript charting library - specifically one that doesn't use flash at all?\n"
},
{
"from": "gpt",
"value": "There are several excellent JavaScript charting libraries that do not use Flash. Here are some popular ones you can cons... |
Here is the situation: I have 2 pages.
What I want is to have a number of text links(<a href="">) on page 1 all directing to page 2, but I want each link to send a different value.
On page 2 I want to show that value like this:
Hello you clicked {value}
Another point to take into account is that I can't use any php ... | If you're restricted to using only HTML and can't use PHP or any server-side scripting, you can achieve this using HTML anchor links that include query parameters. Here's how you can do it:
### Page 1 (page1.html)
You can create links that include a query string to send different values to page 2. Here's an example:
... | 10,772 | [
{
"from": "human",
"value": "Here is the situation: I have 2 pages.\nWhat I want is to have a number of text links(<a href=\"\">) on page 1 all directing to page 2, but I want each link to send a different value.\nOn page 2 I want to show that value like this: \n\nHello you clicked {value}\n\nAnother point ... |
In ASP.NET, if I databind a gridview with a array of objects lets say , how can I retrieve and use foo(index) when the user selects the row?
i.e.
dim fooArr() as foo;
gv1.datasource = fooArr;
gv1.databind();
On Row Select
Private Sub gv1_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridView... | To retrieve and use an object from your `fooArr` array when a row in a GridView is selected, you can use the `RowIndex` property of the `GridViewCommandEventArgs`. This property gives you the index of the row that was selected. You can then use this index to access the corresponding object in your `fooArr`.
Here's how... | 10,076 | [
{
"from": "human",
"value": "In ASP.NET, if I databind a gridview with a array of objects lets say , how can I retrieve and use foo(index) when the user selects the row?\ni.e.\ndim fooArr() as foo;\ngv1.datasource = fooArr;\ngv1.databind();\n\nOn Row Select\nPrivate Sub gv1_RowCommand(ByVal sender As Objec... |
Maybe I'm just thinking about this too hard, but I'm having a problem figuring out what escaping to use on a string in some JavaScript code inside a link's onClick handler. Example:
<a href="#" onclick="SelectSurveyItem('<%itemid%>', '<%itemname%>'); return false;">Select</a>
The <%itemid%> and <%itemname%> are where ... | Handling special characters in JavaScript embedded within HTML attributes, like `onclick`, can indeed be tricky, especially when you're dealing with user-generated content or dynamic data. Here’s a concise breakdown of how to manage this situation effectively.
### 1. HTML Escape
First, you should HTML escape the value... | 9,963 | [
{
"from": "human",
"value": "Maybe I'm just thinking about this too hard, but I'm having a problem figuring out what escaping to use on a string in some JavaScript code inside a link's onClick handler. Example:\n<a href=\"#\" onclick=\"SelectSurveyItem('<%itemid%>', '<%itemname%>'); return false;\">Select</... |
As I understand it, anything created with an alloc, new, or copy needs to be manually released. For example:
int main(void) {
NSString *string;
string = [[NSString alloc] init];
/* use the string */
[string release];
}
My question, though, is wouldn't this be just as valid?:
int main(void) {
NSAuto... | Yes, your second example is indeed valid and is a common practice in Objective-C to manage memory for objects.
In the first example, you manually release the memory allocated for the `NSString` instance, which is necessary to avoid memory leaks when using manual reference counting. You explicitly call `[string releas... | 15,005 | [
{
"from": "human",
"value": "As I understand it, anything created with an alloc, new, or copy needs to be manually released. For example:\nint main(void) {\n NSString *string;\n string = [[NSString alloc] init];\n /* use the string */\n [string release];\n}\n\nMy question, though, is wouldn't th... |
I am trying to write some JavaScript RegEx to replace user inputed tags with real html tags, so [b] will become <b> and so forth. the RegEx I am using looks like so
var exptags = /\[(b|u|i|s|center|code){1}]((.){1,}?)\[\/(\1){1}]/ig;
with the following JavaScript
s.replace(exptags,"<$1>$2</$1>");
this works fine for ... | You're correct that the current regular expression you are using will only match the outermost tags when nested tags are present. To handle nested tags properly, you'll need to revise your approach.
**Challenge with Regular Expressions for Nested Structures:**
Regular expressions are not designed to handle nested stru... | 12,587 | [
{
"from": "human",
"value": "I am trying to write some JavaScript RegEx to replace user inputed tags with real html tags, so [b] will become <b> and so forth. the RegEx I am using looks like so\nvar exptags = /\\[(b|u|i|s|center|code){1}]((.){1,}?)\\[\\/(\\1){1}]/ig;\n\nwith the following JavaScript\ns.repl... |
One of the stated goals of the PureMVC framework is to avoid platform dependencies in order to be portable. Considering that because of language and API differences application code will always be heavily dependent on the platform, and that avoiding platform dependencies makes the framework reinvent the wheel and/or on... | The portability of the PureMVC framework offers several benefits for application developers, despite the inherent platform dependencies that may still exist in the application code. Here are some key advantages:
1. **Decoupled Architecture**: PureMVC encourages a separation of concerns through its Model-View-Controlle... | 11,572 | [
{
"from": "human",
"value": "One of the stated goals of the PureMVC framework is to avoid platform dependencies in order to be portable. Considering that because of language and API differences application code will always be heavily dependent on the platform, and that avoiding platform dependencies makes t... |
I've been looking into report definition customization extensions (RDCE) in SQL2K8 recently and I've been at a loss to find much documentation or even chatter on the internet about it.
MSDN has a brief overview: http://msdn.microsoft.com/en-us/library/cc281022.aspx
And the sample report from this book http://www.amazon... | Report Definition Customization Extensions (RDCE) in SQL Server 2008 (SQL2K8) is a feature that allows developers to create custom report definitions for SQL Server Reporting Services (SSRS). This enables more flexible reporting scenarios, as you can manipulate report definitions programmatically, creating tailored sol... | 11,579 | [
{
"from": "human",
"value": "I've been looking into report definition customization extensions (RDCE) in SQL2K8 recently and I've been at a loss to find much documentation or even chatter on the internet about it.\nMSDN has a brief overview: http://msdn.microsoft.com/en-us/library/cc281022.aspx\nAnd the sam... |
How to play WMV in a WindowMediaPlayer activeX controlled by a flash component?
I've seen it done here: http://sport5.co.il/
Does anyone know how?
| To play WMV files in a Windows Media Player ActiveX control embedded within a Flash component, you'll need to use ActionScript to interact with the ActiveX control. Here are the general steps you can follow to achieve this:
### Step 1: Setting Up the Environment
1. **Create a new Flash project.**
2. **Add the Windows... | 8,248 | [
{
"from": "human",
"value": "How to play WMV in a WindowMediaPlayer activeX controlled by a flash component?\nI've seen it done here: http://sport5.co.il/\nDoes anyone know how?\n"
},
{
"from": "gpt",
"value": "To play WMV files in a Windows Media Player ActiveX control embedded within a Flash c... |
Imagine this sample java class:
class A {
void addListener(Listener obj);
void removeListener(Listener obj);
}
class B {
private A a;
B() {
a = new A();
a.addListener(new Listener() {
void listen() {}
}
}
Do I need to add a finalize method to B to call a.removeList... | In Java, if you add a listener to an object and that listener is held strongly by the object, you need to ensure that you remove it when it is no longer needed, to avoid memory leaks.
In your example, `B` is adding a listener to `A`, and if you do not remove it when `B` is no longer in use, `A` will still have a refe... | 13,552 | [
{
"from": "human",
"value": "Imagine this sample java class:\nclass A {\n void addListener(Listener obj);\n void removeListener(Listener obj);\n}\n\nclass B {\n private A a;\n B() {\n a = new A();\n a.addListener(new Listener() {\n void listen() {}\n }\n }\n\nDo I... |
Scenario: C# apps uses SQL2000. It excecute 3 stored procs within a try catch in the app. In the catch the error is suppressed. Due to some legalities, the c# code cannot be changed and implemented.
Q: How do I trap the actual SQL error in the stored proc into a log file or other table? @@Error returns an error messag... | If you're unable to change the C# code but need to log SQL errors from your stored procedures, you can create a centralized error logging mechanism within your stored procedures. Here's a straightforward approach to achieve this.
### Step 1: Create an Error Logging Table
First, you need a table to store the error inf... | 11,409 | [
{
"from": "human",
"value": "Scenario: C# apps uses SQL2000. It excecute 3 stored procs within a try catch in the app. In the catch the error is suppressed. Due to some legalities, the c# code cannot be changed and implemented. \nQ: How do I trap the actual SQL error in the stored proc into a log file or ot... |
I'm building an installer for an application. The user gets to select a datasource they have configured and nominate what type of database it is. I want to confirm that the database type is indeed Oracle, and if possible, what version of Oracle they are running by sending a SQL statement to the datasource.
| To verify that the selected data source is indeed an Oracle database and to retrieve its version, you can use the following SQL query:
```sql
SELECT * FROM v$version;
```
This query will return information about the Oracle database version, including its release number.
### Steps to Implement
1. **Connect to the D... | 11,538 | [
{
"from": "human",
"value": "I'm building an installer for an application. The user gets to select a datasource they have configured and nominate what type of database it is. I want to confirm that the database type is indeed Oracle, and if possible, what version of Oracle they are running by sending a SQL... |
How can i check to see if a static class has been declared?
ex
Given the class
class bob {
function yippie() {
echo "skippie";
}
}
later in code how do i check:
if(is_a_valid_static_object(bob)) {
bob::yippie();
}
so i don't get:
Fatal error: Class 'bob' not found in file.php on line 3
| In PHP, to check if a class exists before using it, you can use the `class_exists()` function. This function will return `true` if the class has been declared and `false` otherwise. Here's how you can use it in your example:
```php
class bob {
public static function yippie() {
echo "skippie";
}
}
// L... | 15,329 | [
{
"from": "human",
"value": "How can i check to see if a static class has been declared?\nex\nGiven the class\nclass bob {\n function yippie() {\n echo \"skippie\";\n }\n}\n\nlater in code how do i check:\nif(is_a_valid_static_object(bob)) {\n bob::yippie();\n}\n\nso i don't get:\nFatal erro... |
I'm working on a .Net applications with multiple threads doing all sorts of things.
When something goes wrong in production I want to be able to see which threads are running (by their managed name) and also be able to pause / kill them.
Anyway to achieve this ?
VS isn't always available (although a good option when is... | In a .NET application, especially when dealing with multithreading, it's indeed important to have proper monitoring and management of threads to handle issues that might arise in production. While Visual Studio and WinDbg are powerful tools, you can implement some custom solutions to monitor and control threads directl... | 10,198 | [
{
"from": "human",
"value": "I'm working on a .Net applications with multiple threads doing all sorts of things.\nWhen something goes wrong in production I want to be able to see which threads are running (by their managed name) and also be able to pause / kill them.\nAnyway to achieve this ?\nVS isn't alwa... |
The title is pretty much self explanatory. Given two dates what is the best way of finding the number of week days using PHP? Week days being Monday to Friday.
For instance, how would I find out that there are 10 week days in between 31/08/2008 and 13/09/2008?
| To find the number of weekdays (Monday to Friday) between two dates in PHP, you can iterate through the range of dates and count the weekdays. Here's a simple example of how you can do this:
```php
function countWeekdays($startDate, $endDate) {
// Convert the dates from string to DateTime objects
$start = new ... | 12,267 | [
{
"from": "human",
"value": "The title is pretty much self explanatory. Given two dates what is the best way of finding the number of week days using PHP? Week days being Monday to Friday.\nFor instance, how would I find out that there are 10 week days in between 31/08/2008 and 13/09/2008?\n"
},
{
"... |
I have a list of tuples eg. [{1,40},{2,45},{3,54}....{7,23}] where 1...7 are days of the week (calculated by finding calendar:day_of_the_week()). So now I want to change the list to [{Mon,40},{Tue,45},{Wed,54}...{Sun,23}]. Is there an easier way to do it than lists:keyreplace?
| You can easily convert your list of tuples with day numbers to their corresponding weekday names in a more straightforward manner than using `lists:keyreplace/3`. Instead, you can use a simple mapping approach. Below is an example in Erlang to demonstrate how to achieve this:
```erlang
% Your list of tuples
DaysData =... | 13,158 | [
{
"from": "human",
"value": "I have a list of tuples eg. [{1,40},{2,45},{3,54}....{7,23}] where 1...7 are days of the week (calculated by finding calendar:day_of_the_week()). So now I want to change the list to [{Mon,40},{Tue,45},{Wed,54}...{Sun,23}]. Is there an easier way to do it than lists:keyreplace?\n... |
How do I load the edited .emacs file without restarting Emacs?
| To load your edited `.emacs` file (or `init.el` if you're using that) without restarting Emacs, you can use the following command:
1. Press `M-x` (which means `Alt + x` or `Esc` followed by `x`).
2. Type `load-file` and press `Enter`.
3. Then enter the path to your `.emacs` file (e.g., `~/.emacs`) or the path to your ... | 15,448 | [
{
"from": "human",
"value": "How do I load the edited .emacs file without restarting Emacs?\n"
},
{
"from": "gpt",
"value": "To load your edited `.emacs` file (or `init.el` if you're using that) without restarting Emacs, you can use the following command:\n\n1. Press `M-x` (which means `Alt + x`... |
If you want to create a custom attribute for MS test (say [Repeat(3)]
how would you do that?
| Creating a custom attribute in C# for use with MSTest (or any other testing framework) involves defining a new attribute class and then using a custom test execution mechanism to handle the behavior associated with that attribute. The `[Repeat(3)]` attribute, for example, would indicate that a test should be executed t... | 11,022 | [
{
"from": "human",
"value": "If you want to create a custom attribute for MS test (say [Repeat(3)]\nhow would you do that?\n"
},
{
"from": "gpt",
"value": "Creating a custom attribute in C# for use with MSTest (or any other testing framework) involves defining a new attribute class and then usin... |
PMD would report a violation for:
ArrayList<Object> list = new ArrayList<Object>();
The violation was "Avoid using implementation types like 'ArrayList'; use the interface instead".
The following line would correct the violation:
List<Object> list = new ArrayList<Object>();
Why should the latter with List be used ins... | Using `List<Object> list = new ArrayList<Object>();` instead of `ArrayList<Object> list = new ArrayList<Object>();` is recommended for several reasons:
1. **Programming to an Interface**: By declaring the variable as a `List`, you are programming to an interface rather than a specific implementation. This allows you t... | 13,392 | [
{
"from": "human",
"value": "PMD would report a violation for:\nArrayList<Object> list = new ArrayList<Object>();\n\nThe violation was \"Avoid using implementation types like 'ArrayList'; use the interface instead\".\nThe following line would correct the violation:\nList<Object> list = new ArrayList<Object>... |
MSDN displays the following for CreatePatternBrush:
You can delete a pattern brush without
affecting the associated bitmap by
using the DeleteObject function.
Therefore, you can then use this
bitmap to create any number of pattern
brushes.
My question is the opposite. If the HBRUSH is long lived, can I dele... | When you create a pattern brush using `CreatePatternBrush`, the `HBRUSH` does not store its own copy of the `HBITMAP`. Instead, the brush is simply a reference to the bitmap. This means that if you delete the `HBITMAP` immediately after creating the `HBRUSH`, the `HBRUSH` will become invalid because it relies on the `H... | 13,463 | [
{
"from": "human",
"value": "MSDN displays the following for CreatePatternBrush:\n\nYou can delete a pattern brush without\n affecting the associated bitmap by\n using the DeleteObject function.\n Therefore, you can then use this\n bitmap to create any number of pattern\n brushes.\n\nMy question is the... |
Say I have the following XML...
<root>
<base>
<tent key="1" color="red"/>
<tent key="2" color="yellow"/>
<tent key="3" color="blue"/>
</base>
<bucket>
<tent key="1"/>
<tent key="3"/>
</bucket>
</root>
...what would the XPath be that returns that the "bucket" contains "red" and "blue"?
| To determine the colors of the tents in the "bucket" from the given XML, you can use the following XPath expression:
```xpath
//bucket/tent/@key | //base/tent[@key = //bucket/tent/@key]/@color
```
However, this expression will return both the keys in the bucket and their corresponding colors. If you specifically want... | 14,943 | [
{
"from": "human",
"value": "Say I have the following XML...\n<root>\n <base>\n <tent key=\"1\" color=\"red\"/>\n <tent key=\"2\" color=\"yellow\"/>\n <tent key=\"3\" color=\"blue\"/>\n </base>\n <bucket>\n <tent key=\"1\"/>\n <tent key=\"3\"/>\n </bucket>\n</root>\n\n...what would the XP... |
I'm new to .Net and I'm trying to understand the basics first. What is the difference between MSIL and Java bytecode?
| Great question! Both Microsoft Intermediate Language (MSIL) and Java bytecode are intermediate representations of code that facilitate platform independence and allow for optimization and execution on virtual machines. However, they belong to different ecosystems (Microsoft's .NET framework and Java, respectively) and ... | 8,846 | [
{
"from": "human",
"value": "I'm new to .Net and I'm trying to understand the basics first. What is the difference between MSIL and Java bytecode?\n"
},
{
"from": "gpt",
"value": "Great question! Both Microsoft Intermediate Language (MSIL) and Java bytecode are intermediate representations of co... |
The code currently does this and the fgetpos does handle files larger than 4GB but the seek returns an error, so any idea how to seek to the end of a file > 4GB?
fpos_t currentpos;
sok=fseek(fp,0,SEEK_END);
assert(sok==0,"Seek error!");
fgetpos(fp,¤tpos);
m_filesize=currentpos;
| If you're dealing with files larger than 4GB in C, the standard `fseek` and `ftell` functions are typically limited by the data types they use (usually `long`, which is 32 bits on many systems). This results in an inability to properly handle file sizes greater than 2GB (or 4GB for certain modes).
To work with larger ... | 13,087 | [
{
"from": "human",
"value": "The code currently does this and the fgetpos does handle files larger than 4GB but the seek returns an error, so any idea how to seek to the end of a file > 4GB?\nfpos_t currentpos;\n\nsok=fseek(fp,0,SEEK_END);\nassert(sok==0,\"Seek error!\");\n\nfgetpos(fp,¤tpos);\nm_file... |
I have been looking at XML and HTML libraries on rubyforge for a simple way to pull data out of a web page. For example if I want to parse a user page on stackoverflow how can I get the data into a usable format?
Say I want to parse my own user page for my current reputation score and badge listing. I tried to conver... | To parse data from a web page such as your Stack Overflow user page in Ruby, you can use libraries like `Nokogiri` which is excellent for parsing HTML and XML. `Nokogiri` allows you to navigate the document structure and extract the information you need in a straightforward manner.
Below is a step-by-step guide on how... | 10,763 | [
{
"from": "human",
"value": "I have been looking at XML and HTML libraries on rubyforge for a simple way to pull data out of a web page. For example if I want to parse a user page on stackoverflow how can I get the data into a usable format?\nSay I want to parse my own user page for my current reputation s... |
Could anyone explain with some examples when it is better to call functions by reference and when it is better to call by address?
| In programming, especially in languages like C or C++, you can pass arguments to functions either by value, by reference, or by address. Each of these methods has its own use cases, benefits, and trade-offs. Here, we'll explore when it might be better to use reference or address passing, along with examples.
### 1. Pa... | 11,819 | [
{
"from": "human",
"value": "Could anyone explain with some examples when it is better to call functions by reference and when it is better to call by address?\n"
},
{
"from": "gpt",
"value": "In programming, especially in languages like C or C++, you can pass arguments to functions either by va... |
I just wanted to compare different solutions used when implementing ACLs in Rails.
| Access Control Lists (ACLs) are an important aspect of security in web applications, including those built with Ruby on Rails. There are several approaches to implementing ACLs in Rails, and each has its own advantages and trade-offs. Below are some popular solutions for managing ACLs in Rails applications:
### 1. **P... | 10,980 | [
{
"from": "human",
"value": "I just wanted to compare different solutions used when implementing ACLs in Rails.\n"
},
{
"from": "gpt",
"value": "Access Control Lists (ACLs) are an important aspect of security in web applications, including those built with Ruby on Rails. There are several approa... |
So many different controls to choose from! What are best practices for determining which control to use for displaying data in ASP.NET?
| When determining which control to use for displaying data in ASP.NET, there are several best practices to consider. These will help you choose the right control based on the specific requirements of your application, user experience, and performance. Here are some best practices to keep in mind:
### 1. Understand Data... | 11,893 | [
{
"from": "human",
"value": "So many different controls to choose from! What are best practices for determining which control to use for displaying data in ASP.NET?\n"
},
{
"from": "gpt",
"value": "When determining which control to use for displaying data in ASP.NET, there are several best prac... |
this is my first question to stackoverflow so here it goes...
I use cruise control for my continuous integration scheme, i want to use obfuscation in order to add another protection layer to my assemblies. The thing is that i don't know how to go about it since i couldn't find articles describing about this. Suggestion... | Welcome to Stack Overflow! It sounds like you have a solid CI setup with CruiseControl and are looking to integrate obfuscation into your build process. Here are some suggestions to help you incorporate obfuscation into your continuous integration workflow:
### 1. Choose an Obfuscation Tool
First, you'll need to selec... | 10,447 | [
{
"from": "human",
"value": "this is my first question to stackoverflow so here it goes...\nI use cruise control for my continuous integration scheme, i want to use obfuscation in order to add another protection layer to my assemblies. The thing is that i don't know how to go about it since i couldn't find ... |
I am using VMware Server 1.0.7 on Windows XP SP3 at the moment to test software in virtual machines.
I have also tried Microsoft Virtual PC (do not remeber the version, could be 2004 or 2007) and VMware was way faster at the time.
I have heard of Parallels and VirtualBox but I did not have the time to try them out. Any... | When it comes to virtualization software, performance can vary based on many factors including hardware configuration, guest operating system, workload characteristics, and specific use cases. While there might not be exhaustive benchmarks for every virtualization tool available, here's a general comparison of some pop... | 12,870 | [
{
"from": "human",
"value": "I am using VMware Server 1.0.7 on Windows XP SP3 at the moment to test software in virtual machines.\nI have also tried Microsoft Virtual PC (do not remeber the version, could be 2004 or 2007) and VMware was way faster at the time.\nI have heard of Parallels and VirtualBox but I... |
Any information on how to display the ODBC connections dialog and get the chosen ODBC back?
| To display the ODBC Data Source Administrator dialog and retrieve the selected ODBC Data Source Name (DSN) in a Windows application, you can use the `ODBC` API or utilize a `.NET` application. Below are two methods you can use: one for native applications using the Windows API and the other for .NET applications.
### ... | 8,619 | [
{
"from": "human",
"value": "Any information on how to display the ODBC connections dialog and get the chosen ODBC back?\n"
},
{
"from": "gpt",
"value": "To display the ODBC Data Source Administrator dialog and retrieve the selected ODBC Data Source Name (DSN) in a Windows application, you can u... |
For a project I'm working on. I need to look for an executable on the filesystem. For UNIX derivatives, I assume the user has the file in the mighty $PATH variable, but there is no such thing on Windows.
I can safely assume the file is at most 2 levels deep into the filesystem, but I don't know on what drive it will be... | In Windows, you can list all available drives by using the `wmic` command, the `PowerShell` command, or simply by checking the filesystem directly. Here's how you can do it using various methods:
### Method 1: Using `wmic`
You can run the following command in the Command Prompt:
```cmd
wmic logicaldisk get name
```
... | 10,052 | [
{
"from": "human",
"value": "For a project I'm working on. I need to look for an executable on the filesystem. For UNIX derivatives, I assume the user has the file in the mighty $PATH variable, but there is no such thing on Windows.\nI can safely assume the file is at most 2 levels deep into the filesystem,... |
I'm working on a large application (300K LOC) that is causing a memory leak in the Sun 1.6 JVM (1.6_05). Profiling the Java shows no leak. Are there any diagnostics available from the JVM that might detect the cause of the leak?
I haven't been able to create a simple, isolated Java test case. Is the only way to figure ... | Diagnosing memory leaks in a large Java application, especially in older JVMs like Sun 1.6, can be challenging. Here are some strategies and tools you can use to investigate potential memory leaks:
### Java Diagnostic Tools:
1. **Java Mission Control (JMC) / Flight Recorder**:
- If you're able to update to a later... | 8,507 | [
{
"from": "human",
"value": "I'm working on a large application (300K LOC) that is causing a memory leak in the Sun 1.6 JVM (1.6_05). Profiling the Java shows no leak. Are there any diagnostics available from the JVM that might detect the cause of the leak?\nI haven't been able to create a simple, isolated ... |
Printf got added to Java with the 1.5 release but I can't seem to find how to send the output to a string rather than a file (which is what sprintf does in C). Does anyone know how to do this?
| In Java, you can achieve similar functionality to C's `sprintf` by using the `String.format()` method. This method allows you to format strings using placeholders, and it returns the formatted string directly, instead of printing it to a file or the console.
Here is an example:
```java
public class Main {
public ... | 14,394 | [
{
"from": "human",
"value": "Printf got added to Java with the 1.5 release but I can't seem to find how to send the output to a string rather than a file (which is what sprintf does in C). Does anyone know how to do this? \n"
},
{
"from": "gpt",
"value": "In Java, you can achieve similar functio... |
I have a table UserAliases (UserId, Alias) with multiple aliases per user. I need to query it and return all aliases for a given user, the trick is to return them all in one column.
Example:
UserId/Alias
1/MrX
1/MrY
1/MrA
2/Abc
2/Xyz
I want the query result in the following format:
UserId/Alias
1/ MrX, MrY... | In SQL Server 2005, you can achieve this by using the `FOR XML PATH` method to concatenate the aliases into a single column. Below is the T-SQL query that accomplishes your requirement:
```sql
SELECT UserId,
STUFF((SELECT ', ' + Alias
FROM UserAliases AS UA2
WHERE UA2.UserId = UA1.Us... | 12,711 | [
{
"from": "human",
"value": "I have a table UserAliases (UserId, Alias) with multiple aliases per user. I need to query it and return all aliases for a given user, the trick is to return them all in one column.\nExample:\nUserId/Alias \n1/MrX \n1/MrY \n1/MrA \n2/Abc \n2/Xyz\n\nI want the query result i... |
Is there a way to hide table rows without affecting the overall table width? I've got some javascript that shows/hides some table rows, but when the rows are set to display: none;, the table with shrinks to fit the contents of the visible rows.
| Yes, you can hide table rows without affecting the overall table width by using CSS and JavaScript. Instead of using `display: none;`, which removes the rows from the document flow, you can use `visibility: hidden;` to keep the row's space but hide its content. However, this means the space for the hidden rows will sti... | 13,056 | [
{
"from": "human",
"value": "Is there a way to hide table rows without affecting the overall table width? I've got some javascript that shows/hides some table rows, but when the rows are set to display: none;, the table with shrinks to fit the contents of the visible rows.\n"
},
{
"from": "gpt",
... |
I just started working for a pretty large company and my group manages all of their public facing websites. I opened the style sheet for the first time today and have seen over 20 instances of the designers using the voice-family hack to fix an IE bug. (I don't know why they allow graphic designers to write any kind of... | The voice-family hack, which uses CSS to target specific versions of Internet Explorer (IE) by exploiting how they interpret certain properties, has been a controversial method for handling browser inconsistencies. Here are some points to consider regarding its general public opinion and alternative approaches:
### Ge... | 13,642 | [
{
"from": "human",
"value": "I just started working for a pretty large company and my group manages all of their public facing websites. I opened the style sheet for the first time today and have seen over 20 instances of the designers using the voice-family hack to fix an IE bug. (I don't know why they all... |
I've been reading a little about temporary tables in MySQL but I'm an admitted newbie when it comes to databases in general and MySQL in particular. I've looked at some examples and the MySQL documentation on how to create a temporary table, but I'm trying to determine just how temporary tables might benefit my applic... | Hi Matt,
Temporary tables can be a very useful feature in MySQL and can benefit your applications in several ways. Here’s an overview of their benefits and potential issues:
### Benefits of Using Temporary Tables
1. **Performance Improvement**:
- Temporary tables can help improve query performance by allowing you... | 10,144 | [
{
"from": "human",
"value": "I've been reading a little about temporary tables in MySQL but I'm an admitted newbie when it comes to databases in general and MySQL in particular. I've looked at some examples and the MySQL documentation on how to create a temporary table, but I'm trying to determine just how... |
I am developing an ASP.NET Ajax form, and decided to make most of the site in one page, because it isn't a very involved site (it's more of a form). In the codebehind, I have been making my code more organized by adding regions to it (inside are the click events of the controls, etc).
When I expand a region, all the su... | Visual Studio does not provide a built-in option to change the default behavior of region expansion, meaning that when you expand a region, it will automatically expand all nested regions and methods under it. However, you can use a couple of workarounds to better manage your code structure and navigation, even if it d... | 14,386 | [
{
"from": "human",
"value": "I am developing an ASP.NET Ajax form, and decided to make most of the site in one page, because it isn't a very involved site (it's more of a form). In the codebehind, I have been making my code more organized by adding regions to it (inside are the click events of the controls,... |
Looking for an open source library, for C++, Java, C# or Python, for reading the data from Quicken .qdf files.
@Swati: Quicken .qif format is for transfer only and is not kept up to date by the application like the .qdf file is.
| Reading data from Quicken's .qdf files can be a bit challenging, as these files are proprietary and not well-documented. However, there are some open-source libraries and tools that can help you read .qdf files, though support may vary.
### Python
1. **QDF2CSV**: A Python script that converts Quicken .qdf files to CSV... | 13,365 | [
{
"from": "human",
"value": "Looking for an open source library, for C++, Java, C# or Python, for reading the data from Quicken .qdf files.\n@Swati: Quicken .qif format is for transfer only and is not kept up to date by the application like the .qdf file is.\n"
},
{
"from": "gpt",
"value": "Re... |
What is the syntax to declare a type for my compare-function generator in code like the following?
var colName:String = ""; // actually assigned in a loop
gc.sortCompareFunction = function() : ??WHAT_GOES_HERE??
{
var tmp:String = colName;
return function(a:Object,b:Object):int { return compareGeneral(a,b,tmp); }... | To declare the type for your `compare-function` generator in ActionScript, you will need to define the return type of your generator function and the function it returns. In this case, the generator function returns a comparison function that takes two `Object` parameters and returns an `int`.
Here's the syntax to dec... | 13,747 | [
{
"from": "human",
"value": "What is the syntax to declare a type for my compare-function generator in code like the following?\nvar colName:String = \"\"; // actually assigned in a loop\ngc.sortCompareFunction = function() : ??WHAT_GOES_HERE??\n{\n var tmp:String = colName;\n return function(a:Object,b... |
Can anyone tell me what exactly does this Java code do?
SecureRandom random = SecureRandom.getInstance("SHA1PRNG");
byte[] bytes = new byte[20];
synchronized (random)
{
random.nextBytes(bytes);
}
return Base64.encode(bytes);
Step by step explanation will be useful so that I can recreate this code in VB. Thanks
| Certainly! Let's break down the Java code step by step so you can understand what it does and then recreate it in VB (Visual Basic).
### Step-by-Step Explanation:
1. **SecureRandom Initialization**:
```java
SecureRandom random = SecureRandom.getInstance("SHA1PRNG");
```
This line initializes a new instanc... | 6,722 | [
{
"from": "human",
"value": "Can anyone tell me what exactly does this Java code do?\nSecureRandom random = SecureRandom.getInstance(\"SHA1PRNG\");\nbyte[] bytes = new byte[20];\nsynchronized (random)\n{\n random.nextBytes(bytes);\n}\n\nreturn Base64.encode(bytes);\n\n\nStep by step explanation will be u... |
I deleted a branch in TFS and just found out that I need the changes that were on it.
How do I recover the branch or the changes done on it?
| In Team Foundation Server (TFS), when you delete a branch, the changes associated with it are not immediately lost. TFS retains a history of changesets, so you can potentially recover the branch or the changes made on it. Here’s how you can attempt to recover the deleted branch or its changes:
### Option 1: Using the ... | 12,304 | [
{
"from": "human",
"value": "I deleted a branch in TFS and just found out that I need the changes that were on it.\nHow do I recover the branch or the changes done on it?\n"
},
{
"from": "gpt",
"value": "In Team Foundation Server (TFS), when you delete a branch, the changes associated with it ar... |
This concept is a new one for me -- I first came across it at the YUI dependency configurator. Basically, instead of having multiple requests for many files, the files are chained into one http request to cut down on page load time.
Anyone know how to implement this on a LAMP stack? (I saw a similar question was asked ... | The concept you're referring to is often called "resource aggregation" or "file concatenation." It involves combining multiple CSS or JavaScript files into a single file, which reduces the number of HTTP requests made by the browser, thereby improving page load times.
Here's a simple guide to implementing resource agg... | 8,312 | [
{
"from": "human",
"value": "This concept is a new one for me -- I first came across it at the YUI dependency configurator. Basically, instead of having multiple requests for many files, the files are chained into one http request to cut down on page load time.\nAnyone know how to implement this on a LAMP s... |
We are planning to use the jQuery library to augment our client side JavaScript needs.
Are there any major issues in trying to use both ASP.Net AJAX and jQuery? Both libraries seem to use $ for special purposes. Are there any conflicts that we need to be aware of?
We also use Telerik controls that use ASP.Net AJAX.
T... | Using jQuery alongside ASP.NET AJAX can lead to some potential conflicts, particularly since both libraries use the `$` symbol as a shortcut for their respective functions. However, these conflicts can generally be managed with some attention to detail. Here are some points to consider:
### 1. **Conflict with `$` Symb... | 12,481 | [
{
"from": "human",
"value": "We are planning to use the jQuery library to augment our client side JavaScript needs. \nAre there any major issues in trying to use both ASP.Net AJAX and jQuery? Both libraries seem to use $ for special purposes. Are there any conflicts that we need to be aware of? \nWe also us... |
I'm building a PHP page with data sent from MySQL.
Is it better to have
1 SELECT query with 4 table joins, or
4 small SELECT queries with no table join; I do select from an ID
Which is faster and what is the pro/con of each method? I only need one row from each tables.
| The choice between using one complex `SELECT` query with multiple joins and multiple smaller `SELECT` queries depends on various factors including performance, maintainability, and the specific use case of your application. Here are the pros and cons of each approach:
### 1. Single SELECT Query with Joins
#### Pros:
... | 9,429 | [
{
"from": "human",
"value": "I'm building a PHP page with data sent from MySQL.\nIs it better to have\n\n1 SELECT query with 4 table joins, or\n4 small SELECT queries with no table join; I do select from an ID\n\nWhich is faster and what is the pro/con of each method? I only need one row from each tables.\n... |
Is it possible to run an external process from Perl, capture its stderr, stdout AND the process exit code?
I seem to be able to do combinations of these, e.g. use backticks to get stdout, IPC::Open3 to capture outputs, and system() to get exit codes.
How do you capture stderr, stdout, and the exit code all at once?
| Yes, it is possible to run an external process in Perl and capture its standard output (stdout), standard error (stderr), and exit code all at once. To achieve this, you can use the `IPC::Open3` module, which provides a way to open a process for reading and writing.
Here's a step-by-step example of how you can do this... | 10,514 | [
{
"from": "human",
"value": "Is it possible to run an external process from Perl, capture its stderr, stdout AND the process exit code?\nI seem to be able to do combinations of these, e.g. use backticks to get stdout, IPC::Open3 to capture outputs, and system() to get exit codes.\nHow do you capture stderr,... |
I have to load a PDF within a page.
Ideally I would like to have a loading animated gif which is replaced once the PDF has loaded.
| To load a PDF within a web page and display a loading GIF until the PDF is fully loaded, you can use HTML, CSS, and JavaScript. Below is a simple example of how to achieve this. For the PDF, you can use the `<embed>` or `<iframe>` tag. Here, we'll use an `<iframe>`.
### Example Code:
```html
<!DOCTYPE html>
<html lan... | 10,486 | [
{
"from": "human",
"value": "I have to load a PDF within a page.\nIdeally I would like to have a loading animated gif which is replaced once the PDF has loaded.\n"
},
{
"from": "gpt",
"value": "To load a PDF within a web page and display a loading GIF until the PDF is fully loaded, you can use H... |
I've been thinking about the number of projects we have in-house that are still being developed using visual studio 6 and how best to migrate them forward onto visual studio 2008. The projects range in flavours of C/C++ and VB.
Is it better to let VS2008 convert the work-spaces into solutions, fix any compile errors an... | Migrating projects from Visual Studio 6 to Visual Studio 2008 can be a significant undertaking, especially given the age of Visual Studio 6 and the potential differences in language standards, libraries, and project structures. Here's a breakdown of the two approaches you mentioned, along with some recommendations to h... | 9,421 | [
{
"from": "human",
"value": "I've been thinking about the number of projects we have in-house that are still being developed using visual studio 6 and how best to migrate them forward onto visual studio 2008. The projects range in flavours of C/C++ and VB.\nIs it better to let VS2008 convert the work-spaces... |
I teach a sort of "lite" C++ programming course to novices ("lite" meaning no pointers, no classes, just plain old C, plus references and STL string and vectors). Students have no previous experience in programming, so I believe that using an interactive debugger would help them understand program flow, variables, and ... | For a novice-friendly debugging experience in a Linux environment, you might want to consider the following options that provide a simpler interface than GDB while still allowing students to observe the flow of the program, inspect variables, and understand recursion:
1. **Visual Studio Code with C/C++ Extension**:
... | 8,460 | [
{
"from": "human",
"value": "I teach a sort of \"lite\" C++ programming course to novices (\"lite\" meaning no pointers, no classes, just plain old C, plus references and STL string and vectors). Students have no previous experience in programming, so I believe that using an interactive debugger would help ... |
One thing that's really been making life difficult in getting up to speed on the codebase on an ASP classic project is that the include file situation is kind of a mess. I sometimes find the function I was looking for being included in an include file that is totally unrelated. Does anyone have any advice on how to r... | Refactoring an ASP Classic project, particularly one that uses include files in a messy way, can be quite a challenge. Here are some suggestions to help you organize your codebase and make it easier to locate functions:
### Refactoring Suggestions
1. **Organize Includes by Functionality**:
- Create a directory str... | 11,752 | [
{
"from": "human",
"value": "One thing that's really been making life difficult in getting up to speed on the codebase on an ASP classic project is that the include file situation is kind of a mess. I sometimes find the function I was looking for being included in an include file that is totally unrelated.... |
I am using Eclipse 3.4 (ganymede official, not the service pack).
I have an update site that organizes features into categories; everything looks great in the editor and in the XML.
Once the site is online, accessing it in the usual manner tells me that all the features are "uncategorized". I've tried from multiple com... | It sounds like you are encountering an issue with how Eclipse 3.4 (Ganymede) is handling the categorization of features on your update site. Here are some steps to help troubleshoot and potentially resolve the issue:
1. **Check the Update Site Structure**: Make sure that the update site is structured correctly. The `s... | 12,508 | [
{
"from": "human",
"value": "I am using Eclipse 3.4 (ganymede official, not the service pack).\nI have an update site that organizes features into categories; everything looks great in the editor and in the XML.\nOnce the site is online, accessing it in the usual manner tells me that all the features are \"... |
Imagine a DOS style .cmd file which is used to launch interdependent windowed applications in the right order.
Example:
1) Launch a server application by calling an exe with parameters.
2) Wait for the server to become initialized (or a fixed amount of time).
3) Launch client application by calling an exe with paramete... | You can achieve this kind of task in PowerShell with a simple script that handles launching the server application, waiting for it to initialize, and then launching the client application. Below is an example of how you might structure your PowerShell script:
```powershell
# Define the paths to the server and client e... | 11,221 | [
{
"from": "human",
"value": "Imagine a DOS style .cmd file which is used to launch interdependent windowed applications in the right order.\nExample:\n1) Launch a server application by calling an exe with parameters.\n2) Wait for the server to become initialized (or a fixed amount of time).\n3) Launch clien... |
Is there any way in SSRS2008 to deploy multiple instances of the ReportServer running separate code sets?
I'm developing a very specific deployment of reporting services where I have a number of custom extensions plugged in. But, my company typically deploys multiple versions of a release at once on the same server. ... | Deploying multiple instances of SQL Server Reporting Services (SSRS) 2008 with separate code bases can be challenging due to the nature of how SSRS is designed. Here are some insights on the options you mentioned:
### 1. Multiple Instances of Reporting Services
Running multiple instances of Reporting Services with sep... | 10,402 | [
{
"from": "human",
"value": "Is there any way in SSRS2008 to deploy multiple instances of the ReportServer running separate code sets?\nI'm developing a very specific deployment of reporting services where I have a number of custom extensions plugged in. But, my company typically deploys multiple versions ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.