instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
Basically, I'm trying to write the following (pseudocode) in an ASP.NET HttpModule:
*pre-code*
try { handler.ProcessRequest(...) }
catch (Exception) { *error-code* }
finally { *post-code* }
I've found that I can hook into HttpModule.PreExecuteHandler for "pre-code" and .Error for "error-code". But PostExecuteHandler ... | In ASP.NET, an `HttpModule` allows you to intercept the request pipeline, which is what you're looking to do. However, you're correct that while `BeginRequest` and `EndRequest` run reliably, they may not fit your needs, particularly in terms of the lifecycle and inspection of the chosen handler.
If you want to handle ... | 39,314 | [
{
"from": "human",
"value": "Basically, I'm trying to write the following (pseudocode) in an ASP.NET HttpModule:\n*pre-code*\ntry { handler.ProcessRequest(...) }\ncatch (Exception) { *error-code* }\nfinally { *post-code* }\n\nI've found that I can hook into HttpModule.PreExecuteHandler for \"pre-code\" and ... |
Is there any way to restrict users with administrative privileges from managing specific Windows service based applications? I would like to restrict administrators from stopping or re-starting my service very similar to the Windows event log service. What are some of the more popular approaches or recommended approach... | Restricting administrative privileges from managing specific Windows services can be challenging, as users with administrative rights generally have full control over the system, including the ability to stop or restart services. However, there are some strategies you can use to secure your service and limit its manage... | 41,207 | [
{
"from": "human",
"value": "Is there any way to restrict users with administrative privileges from managing specific Windows service based applications? I would like to restrict administrators from stopping or re-starting my service very similar to the Windows event log service. What are some of the more p... |
Something like this might had worked
<%= Html.RouteLink("", new { controller = "Article", action = "Details", id = A.ArticleID}, new { @class = "image-link" })%>
Except it doesnt like an empty title.
| If you want to create a link without a text title using the `Html.RouteLink` method in ASP.NET MVC, you can provide a non-empty string for the link text. However, you can use a non-breaking space (` `) or other HTML entities to achieve a visually empty link. Here's how you can modify your code:
```csharp
<%= Html... | 44,026 | [
{
"from": "human",
"value": "Something like this might had worked\n<%= Html.RouteLink(\"\", new { controller = \"Article\", action = \"Details\", id = A.ArticleID}, new { @class = \"image-link\" })%>\n\nExcept it doesnt like an empty title.\n"
},
{
"from": "gpt",
"value": "If you want to create ... |
Our site has multiple "wizards" where various data is collected over several pages, and cannot be committed to the database until the last step.
What is the best/correct way to make a wizard like this with ASP.Net MVC
edit: My boss is now saying "no javascript" - any thoughts on how to get around that restriction?
| Creating a multi-step wizard in ASP.NET MVC without using JavaScript requires a different approach since you won’t be able to rely on client-side technologies to manage the state of the form. Instead, you'll have to manage the wizard's state on the server side. Here’s a step-by-step guide on how you can implement this:... | 40,125 | [
{
"from": "human",
"value": "Our site has multiple \"wizards\" where various data is collected over several pages, and cannot be committed to the database until the last step.\nWhat is the best/correct way to make a wizard like this with ASP.Net MVC\nedit: My boss is now saying \"no javascript\" - any thoug... |
I'd like to write a functional test of a RESTful web service I'm working on in a Ruby on Rails app.
The test is of a POST request where the body of the request is a plain XML doc and not a form. Any pointers on how to do this? The problem I'm encountering is how to specify the body XML in the call to the post method.
| To write a functional test for a POST request with an XML body in a Ruby on Rails application, you can use the built-in testing framework, which is typically RSpec or Minitest, depending on your setup.
Here’s how to perform this test with both RSpec and Minitest:
### Using RSpec
If you're using RSpec, you can write... | 41,408 | [
{
"from": "human",
"value": "I'd like to write a functional test of a RESTful web service I'm working on in a Ruby on Rails app. \nThe test is of a POST request where the body of the request is a plain XML doc and not a form. Any pointers on how to do this? The problem I'm encountering is how to specify the... |
void addNewNode (struct node *head, int n)
{
struct node* temp = (struct node*) malloc(sizeof(struct node));
temp -> data = n;
temp -> link = head;
head = temp;
}
The code give above is the popularly wrong version of a function for adding a new node at the head of a linked list.
Generally the correct v... | Your implementation of `addNewNode` as:
```c
struct node* addNewNode (struct node *head, int n)
{
struct node* temp = (struct node*) malloc(sizeof(struct node));
temp -> data = n;
temp -> link = head;
return temp;
}
```
is a valid and clever approach for adding a new node at the head of a linked list,... | 41,202 | [
{
"from": "human",
"value": "void addNewNode (struct node *head, int n)\n{\n struct node* temp = (struct node*) malloc(sizeof(struct node));\n temp -> data = n;\n temp -> link = head;\n head = temp;\n}\n\nThe code give above is the popularly wrong version of a function for adding a new node at t... |
I have created a TCP client that connects to a listening server.
We implemented TCP keep alive also.
Sometimes the client crashes and core is dumped.
Below are the core dump traces.
The problem is in Linux kernel version Update 4, kernel 2.6.9-42.0.10.
We had two core dumps.
(gdb) where
#0 0x005e77a2 in _dl_sysinfo_int... | The core dumps you provided show that the client is encountering a fault while trying to connect to a server or during other operations related to network communication and system calls (like `connect` and `nanosleep`). Given that you're using an older kernel version (2.6.9), there are several potential issues and step... | 40,859 | [
{
"from": "human",
"value": "I have created a TCP client that connects to a listening server.\nWe implemented TCP keep alive also.\nSometimes the client crashes and core is dumped.\nBelow are the core dump traces.\nThe problem is in Linux kernel version Update 4, kernel 2.6.9-42.0.10.\nWe had two core dumps... |
Is there a way to detect that a DirectShow filtergraph has reached the end of its file? By end of its file, I mean that a filtergraph with a SampleGrabber filter will never receive another SampleCB call.
Here are some things that don't work:
Trust IMediaDet::get_StreamLength (it's often says there are more frames in ... | Detecting the end of a media stream in a DirectShow filter graph can be tricky, especially when you're using a `SampleGrabber` to process frames. Here are a few approaches you might consider to properly detect the end of a file or stream:
### 1. **Using SampleGrabber's Buffering Approach**
Instead of using `WaitForSi... | 40,343 | [
{
"from": "human",
"value": "Is there a way to detect that a DirectShow filtergraph has reached the end of its file? By end of its file, I mean that a filtergraph with a SampleGrabber filter will never receive another SampleCB call.\nHere are some things that don't work:\n\nTrust IMediaDet::get_StreamLengt... |
We'd like to see if we can get some improved performance for analysis and reporting by moving some of our key data into Analysis Services cubes. However, I haven't been able to find much in the way of good client front ends.
Our users have Office 2003. The move to 2007 is probably at least a year out and the Analysis ... | Using SQL Server Analysis Services (SSAS) for line-of-business applications can be quite effective, especially when dealing with multi-dimensional data. However, I understand your concern about finding suitable client front ends, especially given the limitations of Office 2003 and the available tools.
Here are some op... | 39,613 | [
{
"from": "human",
"value": "We'd like to see if we can get some improved performance for analysis and reporting by moving some of our key data into Analysis Services cubes. However, I haven't been able to find much in the way of good client front ends. \nOur users have Office 2003. The move to 2007 is prob... |
Every Christmas we draw names for gift exchanges in my family. This usually involves mulitple redraws until no one has pulled their spouse. So this year I coded up my own name drawing app that takes in a bunch of names, a bunch of disallowed pairings, and sends off an email to everyone with their chosen giftee.
Right... | Your problem is a well-known combinatorial challenge that can be framed as a variant of the **"Derangement Problem"**, specifically when you have certain forbidden pairings (edges) in a directed graph. In your case, the goal is to find a perfect matching in a bipartite graph or to find a **perfect derangement** that re... | 42,066 | [
{
"from": "human",
"value": "Every Christmas we draw names for gift exchanges in my family. This usually involves mulitple redraws until no one has pulled their spouse. So this year I coded up my own name drawing app that takes in a bunch of names, a bunch of disallowed pairings, and sends off an email to... |
(Django 1.x, Python 2.6.x)
I have models to the tune of:
class Animal(models.Model):
pass
class Cat(Animal):
def __unicode__(self):
return "This is a cat"
class Dog(Animal):
def __unicode__(self):
return "This is a dog"
class AnimalHome(models.Model):
animal = models.ForeignKey(Animal)
I have instan... | It looks like you've done a great job investigating the problem and have a solid understanding of how Django's ORM and model inheritance work. Let's clarify a few points regarding your `__unicode__()` implementation and the way Django handles model inheritance.
### Understanding the Issue
1. **Model Inheritance in Dj... | 35,889 | [
{
"from": "human",
"value": "(Django 1.x, Python 2.6.x)\nI have models to the tune of:\nclass Animal(models.Model):\n pass\n\nclass Cat(Animal):\n def __unicode__(self):\n return \"This is a cat\"\n\nclass Dog(Animal):\n def __unicode__(self):\n return \"This is a dog\"\n\nclass AnimalHome(models.M... |
The subject pretty much explains it all. I start on frame one of a MovieClip with just a Bitmap covering the whole stage.
Then when a user clicks a button, it goes to frame two and a vector shape is on the stage covering part of the image. At the same time, through code, I place an input Textfield on the stage.
Problem... | In ActionScript 3, the display order of objects is determined by their order in the display list (or the "stage"). When you add a display object (like your input `TextField`), it is added to the display list at a position based on when it was created. Objects that are added later will appear on top of those that were a... | 42,329 | [
{
"from": "human",
"value": "The subject pretty much explains it all. I start on frame one of a MovieClip with just a Bitmap covering the whole stage.\nThen when a user clicks a button, it goes to frame two and a vector shape is on the stage covering part of the image. At the same time, through code, I plac... |
I don't understand why one method would work and the other would throw a NoMethodError if they come from the same lib file.
# app/views/bunnies/show.html.erb
<% if logged_in? %>
<%= current_user.login %> |
<%= link_to 'Logout', logout_path %> |
<% if authorized? %>
<%= link_to 'Edit Details', edit_bunny_path(... | The `NoMethodError` for `authorized?` suggests that the method is not recognized in the context of your view. Since both `logged_in?` and `authorized?` are defined in the `AuthenticatedSystem` module and included in the `ApplicationController`, it's important to understand how Rails views access methods.
Here's a brea... | 42,976 | [
{
"from": "human",
"value": "I don't understand why one method would work and the other would throw a NoMethodError if they come from the same lib file.\n# app/views/bunnies/show.html.erb\n<% if logged_in? %>\n <%= current_user.login %> |\n <%= link_to 'Logout', logout_path %> |\n <% if authorized? %>\n ... |
What is the best method for date of birth selector?
3 text inputs (month / day / year) or one mask input. User MUST use keyboard
3 select boxes. User can use keyboard or mouse.
One nice datepicker.
I want to know what is the most usable and problem free solution, so user wont be confused at all.
| When it comes to choosing a method for a date of birth selector, usability and user experience are critical. Let's evaluate the options you've presented:
1. **Three Text Inputs (Month/Day/Year) with Keyboard Requirement**:
- **Pros**:
- Provides clear separation of inputs, making it easy for users to see what ... | 43,760 | [
{
"from": "human",
"value": "What is the best method for date of birth selector?\n\n3 text inputs (month / day / year) or one mask input. User MUST use keyboard\n3 select boxes. User can use keyboard or mouse. \nOne nice datepicker.\n\nI want to know what is the most usable and problem free solution, so use... |
This is probably a really stupid MSBuild question but if I have
<ItemGroup>
<Dll Include="<Path_to_DLLs>\*.dll" />
</ItemGroup>
And then
<SomeTarget useFiles=@(Dll)>
....do stuff
</someTarget>
What I want to do is to output the current item that @(Dll) is looping through. Basically I wanting to output the name of th... | It's not a stupid question at all! Working with MSBuild can be tricky, especially when trying to access and manipulate items. To output the current item in a target that iterates over an item group, you can use the built-in `Message` task.
Here's a complete example of how you can achieve this:
```xml
<Project xmlns=... | 43,749 | [
{
"from": "human",
"value": "This is probably a really stupid MSBuild question but if I have\n<ItemGroup>\n<Dll Include=\"<Path_to_DLLs>\\*.dll\" />\n</ItemGroup>\n\nAnd then \n<SomeTarget useFiles=@(Dll)>\n....do stuff\n</someTarget>\n\nWhat I want to do is to output the current item that @(Dll) is looping... |
I consider myself to be relatively proficient in terms of application design, but I've never had to work with sensitive data. I've been wondering about what the best practices were for audit trails and how exactly one should implement them. I don't have to do it right now, but it'd be nice to be able to confidently tal... | Implementing effective audit trails for sensitive data, such as that found in a school database, is crucial for compliance, security, and accountability. Here are some best practices and considerations regarding audit trails:
### What to Log
1. **CRUD Operations:**
- **Create**: Log all insert operations in sensit... | 37,986 | [
{
"from": "human",
"value": "I consider myself to be relatively proficient in terms of application design, but I've never had to work with sensitive data. I've been wondering about what the best practices were for audit trails and how exactly one should implement them. I don't have to do it right now, but i... |
I want to display from cache for a long time and I want a slightly different behavior on page render vs loading the page from cache. Is there an easy way I can determine this with JavaScript?
| Yes, you can differentiate between a page being loaded from cache and a fresh load using JavaScript. The `performance` API can help you determine how the page was loaded. Here's a general approach you can use to achieve this:
### Step 1: Use the `Performance` API
You can use the `performance` API to check the `naviga... | 42,162 | [
{
"from": "human",
"value": "I want to display from cache for a long time and I want a slightly different behavior on page render vs loading the page from cache. Is there an easy way I can determine this with JavaScript?\n"
},
{
"from": "gpt",
"value": "Yes, you can differentiate between a page... |
In the Gaia Flash Framework, a file called 'Scaffold.as' is used to make each page a scaffold page. This is accessed by the code,
new Scaffold(this);
But the class itself does not appear to be imported. Am I missing something about the way flash handles external classes? Or is there something else pulling it in?
Any h... | In ActionScript (the programming language used for Flash), there are a couple of ways that classes can be made available without explicit imports. Here are a few possibilities that might explain why you can use `new Scaffold(this);` without seeing an import statement for the `Scaffold` class:
1. **Package Structure**:... | 42,253 | [
{
"from": "human",
"value": "In the Gaia Flash Framework, a file called 'Scaffold.as' is used to make each page a scaffold page. This is accessed by the code,\nnew Scaffold(this);\n\nBut the class itself does not appear to be imported. Am I missing something about the way flash handles external classes? Or ... |
In C#, the questions of what types to create, what members they should have, and what namespaces should hold them, are questions of OO design. They are not the questions I'm interested in here.
Instead, I want to ask how you store these in disk artifacts. Here are some example rules:
Put all of an assembly's types i... | When it comes to organizing and storing C# code in disk artifacts, there are a variety of strategies you can adopt, each with its own advantages and trade-offs. Below, I will outline some common approaches, their rationale, and possible scenarios where they may be applicable.
### 1. **Single Source File per Assembly**... | 39,447 | [
{
"from": "human",
"value": "In C#, the questions of what types to create, what members they should have, and what namespaces should hold them, are questions of OO design. They are not the questions I'm interested in here.\nInstead, I want to ask how you store these in disk artifacts. Here are some exampl... |
I would like to be able to manipulate the DOM just before my page is sent to be printed. Internet Explorer has an event on the window object called "onbeforeprint" but this is proprietary and isn't supported by other browsers. Is it possible to do this via javascript (jQuery in particular, if possible)?
Before you ask,... | You can achieve the desired functionality to manipulate the DOM right before printing by using the `beforeprint` event in modern browsers, which is widely supported. Here's how you can do it with jQuery:
1. **Listen for the `beforeprint` event**: This event is triggered just before the print dialog is displayed.
2. **... | 42,200 | [
{
"from": "human",
"value": "I would like to be able to manipulate the DOM just before my page is sent to be printed. Internet Explorer has an event on the window object called \"onbeforeprint\" but this is proprietary and isn't supported by other browsers. Is it possible to do this via javascript (jQuery i... |
http://localhost:50034/Admin/Delete/723
Always needs this parameter to perform the action, however, if you go to the URL without the parameter, an exception occurs. How do you handle this and redirect back to the main page without doing anything?
Thanks.
| To handle the situation where a required parameter is missing from the URL in a web application (e.g., in an ASP.NET MVC application), you can add a check in your controller action method that processes the delete request. If the required parameter is not present, you can redirect the user back to the main page without... | 43,428 | [
{
"from": "human",
"value": "http://localhost:50034/Admin/Delete/723\nAlways needs this parameter to perform the action, however, if you go to the URL without the parameter, an exception occurs. How do you handle this and redirect back to the main page without doing anything?\nThanks.\n"
},
{
"from"... |
I need a method for adding "business days" in PHP. For example, Friday 12/5 + 3 business days = Wednesday 12/10.
At a minimum I need the code to understand weekends, but ideally it should account for US federal holidays as well. I'm sure I could come up with a solution by brute force if necessary, but I'm hoping there'... | Certainly! You can create a PHP function to add business days while considering weekends and optionally US federal holidays. Here's a method to do this:
### Step-by-step Solution:
1. **Define the holidays**: Create an array that lists the dates of US federal holidays.
2. **Loop through days**: Start from the initial ... | 40,465 | [
{
"from": "human",
"value": "I need a method for adding \"business days\" in PHP. For example, Friday 12/5 + 3 business days = Wednesday 12/10.\nAt a minimum I need the code to understand weekends, but ideally it should account for US federal holidays as well. I'm sure I could come up with a solution by bru... |
let's say I have a excel spread sheet like below:
col1 col2
------------
dog1 dog
dog2 dog
dog3 dog
dog4 dog
cat1 cat
cat2 cat
cat3 cat
I want to return a range of cells (dog1,dog2,dog3,dog4) or (cat1,cat2,cat3) based on either "dog" or "cat"
I know I can do a loop to check one by one, but is there an... | Certainly! In VBA, you can achieve filtering a range of cells based on a criterion (like "dog" or "cat") using the `AutoFilter` method if you are working with a ListObject (Table) or even directly with a Range. If you want to return a specific range based on the criteria without looping through every cell, you can util... | 40,961 | [
{
"from": "human",
"value": "let's say I have a excel spread sheet like below:\n\ncol1 col2\n------------\ndog1 dog\ndog2 dog\ndog3 dog\ndog4 dog\ncat1 cat\ncat2 cat\ncat3 cat\n\nI want to return a range of cells (dog1,dog2,dog3,dog4) or (cat1,cat2,cat3) based on either \"dog\" or \"cat\"\nI... |
In Java, you can qualify local variables and method parameters with the final keyword.
public static void foo(final int x) {
final String qwerty = "bar";
}
Doing so results in not being able to reassign x and qwerty in the body of the method.
This practice nudges your code in the direction of immutability which is ... | The `final` keyword for local variables and method parameters in Java indeed promotes immutability and can lead to cleaner and more maintainable code. Here are some considerations regarding its use:
### Pros:
1. **Immutability**: Declaring variables as `final` signals that once initialized, their values should not cha... | 43,383 | [
{
"from": "human",
"value": "In Java, you can qualify local variables and method parameters with the final keyword.\npublic static void foo(final int x) {\n final String qwerty = \"bar\"; \n}\n\nDoing so results in not being able to reassign x and qwerty in the body of the method.\nThis practice nudges you... |
I have the requirement to support different Master pages on my application (ASP.NET MVC).
What is the recommended way to:
Pass the master page name to the view from.
Store the master page (in session, or something) so it sticks during a user's visit.
| To support different master pages (or layouts) in an ASP.NET MVC application, you can use a combination of session state to store the selected layout and conditional rendering in your views. Below are the steps you can follow to implement this functionality:
### Step 1: Set Up the Layouts
Create multiple layout files... | 41,440 | [
{
"from": "human",
"value": "I have the requirement to support different Master pages on my application (ASP.NET MVC).\nWhat is the recommended way to:\n\nPass the master page name to the view from.\nStore the master page (in session, or something) so it sticks during a user's visit.\n\n"
},
{
"from... |
I'm having problem in the following line:
rd.PrintOptions.PaperSize = PaperSize.PaperFanfoldStdGerman;
it throws an exception saying HRESULT: 0x8002000B (DISP_E_BADINDEX))
if I skip this line, the same error eccurs here:
rd.PrintOptions.ApplyPageMargins(config)
Did anyone have this problem before?
thanks!
| The error you're encountering, `HRESULT: 0x8002000B (DISP_E_BADINDEX)`, typically indicates that there's an issue with the index or parameter you are trying to access in your code. In the context of setting print options for a report, this can often arise from a few common issues. Here are some troubleshooting steps yo... | 40,949 | [
{
"from": "human",
"value": "I'm having problem in the following line:\nrd.PrintOptions.PaperSize = PaperSize.PaperFanfoldStdGerman;\n\nit throws an exception saying HRESULT: 0x8002000B (DISP_E_BADINDEX)) \nif I skip this line, the same error eccurs here:\nrd.PrintOptions.ApplyPageMargins(config)\n\nDid an... |
I have the following shell script registered in my "Login Items" preferences but it does not seem to have any effect. It is meant to launch the moinmoin wiki but only works when it is run by hand from a terminal window, after which it runs until the machine is next shut down.
#!/bin/bash
cd /Users/stuartcw/Documents/Wi... | When you want to run a shell script automatically on login through the "Login Items" on macOS, there are a few things to consider. The script you provided runs a Python server, and there are several reasons why it might not work as expected when run as a Login Item.
### Potential Issues and Solutions
1. **Path Issues... | 40,154 | [
{
"from": "human",
"value": "I have the following shell script registered in my \"Login Items\" preferences but it does not seem to have any effect. It is meant to launch the moinmoin wiki but only works when it is run by hand from a terminal window, after which it runs until the machine is next shut down.\... |
I have a server-side web service that serves to multiple clients. Clients include web browsers, iPhone, BlackBerry, Android etc. My question is, I need to be able to generate dynamic content for views to these clients. Be it a full blown HTML template, an HTML snippet, JSON, XML, etc. Depending on the user-agent of the... | When it comes to generating dynamic content for a variety of clients with different user agents, managing views effectively can indeed be a challenge. Fortunately, there are several frameworks and strategies that can help you organize your view logic and maintain the different output formats (HTML, JSON, XML, etc.) mor... | 40,234 | [
{
"from": "human",
"value": "I have a server-side web service that serves to multiple clients. Clients include web browsers, iPhone, BlackBerry, Android etc. My question is, I need to be able to generate dynamic content for views to these clients. Be it a full blown HTML template, an HTML snippet, JSON, XML... |
Is a string literal in C++ created in static memory and destroyed only when the program exits?
| Yes, in C++, string literals are stored in static memory. This means that they have a lifetime that lasts for the duration of the program. Once a string literal is created, it is allocated in a read-only section of memory (often referred to as the "text" segment), and it is not destroyed until the program exits.
For e... | 44,803 | [
{
"from": "human",
"value": "Is a string literal in C++ created in static memory and destroyed only when the program exits?\n"
},
{
"from": "gpt",
"value": "Yes, in C++, string literals are stored in static memory. This means that they have a lifetime that lasts for the duration of the program. ... |
what is the code to disable an INPUT text box for HTML?
Thanks
| To disable an `<input>` text box in HTML, you can use the `disabled` attribute. Here’s a simple example:
```html
<input type="text" disabled>
```
In this example, the text input box will be rendered on the page, but users will not be able to interact with it or enter any text.
If you want to enable or disable the i... | 46,032 | [
{
"from": "human",
"value": "what is the code to disable an INPUT text box for HTML?\nThanks\n"
},
{
"from": "gpt",
"value": "To disable an `<input>` text box in HTML, you can use the `disabled` attribute. Here’s a simple example:\n\n```html\n<input type=\"text\" disabled>\n```\n\nIn this exampl... |
The follow code (running in ASP.Net 2.0) displays the contents of the requested URL twice. I only want it to display the contents of the requested URL once. I can't figure out what I'm doing wrong. The URL requested is returning XML and if I visit the URL directly, it works fine.
HttpWebRequest request = (HttpWebReques... | The code you've provided sends a POST request to the specified URL and writes the response to the console. If the output is being displayed twice, this is likely due to either the way you're calling this code or how the ASP.NET page is handling requests. Here are some common reasons and solutions:
### 1. Check for Dup... | 39,755 | [
{
"from": "human",
"value": "The follow code (running in ASP.Net 2.0) displays the contents of the requested URL twice. I only want it to display the contents of the requested URL once. I can't figure out what I'm doing wrong. The URL requested is returning XML and if I visit the URL directly, it works fine... |
I am a little curious to know about how OpenID authentication works.
Is there any difference between OpenID authentication and the authentication which sites use exclusively for themselves?
| OpenID is an authentication protocol that allows users to log in to different websites using a single set of credentials, typically managed by a third-party provider. This contrasts with traditional site-specific authentication methods, where users create and manage separate usernames and passwords for each site. Here’... | 42,679 | [
{
"from": "human",
"value": "I am a little curious to know about how OpenID authentication works.\nIs there any difference between OpenID authentication and the authentication which sites use exclusively for themselves?\n"
},
{
"from": "gpt",
"value": "OpenID is an authentication protocol that a... |
This function exists on OS X and allows you to pass custom local to the function. setlocale is not thread-safe, and passing locale as parameter is.
If there is no equivalent, any way of locale-independent printf, or printf just for doubles (%g) will be ok.
| In C, the `setlocale` function allows you to set the program's current locale, but it is indeed not thread-safe. If you want to format numbers independently of the current locale settings, especially for use with `printf` or similar functions, you will need to manage this more carefully.
One approach is to use the `lo... | 43,787 | [
{
"from": "human",
"value": "This function exists on OS X and allows you to pass custom local to the function. setlocale is not thread-safe, and passing locale as parameter is.\nIf there is no equivalent, any way of locale-independent printf, or printf just for doubles (%g) will be ok.\n"
},
{
"from... |
Every time that I create a new form in my application, it uses the "Microsoft Sans Serif, 8.25pt" font by default. I'm not changing it because I know that in this case my form should pick up whatever the default font is for the system. However, when I run my application, the font that is used is still anything but Sego... | When you create a new form in a Windows Forms application and it defaults to "Microsoft Sans Serif", this is a common behavior because Windows Forms uses a default font that may not match the system font used in later versions of Windows (like Segoe UI in Windows Vista and beyond).
### Why Your Application May Not Use... | 43,484 | [
{
"from": "human",
"value": "Every time that I create a new form in my application, it uses the \"Microsoft Sans Serif, 8.25pt\" font by default. I'm not changing it because I know that in this case my form should pick up whatever the default font is for the system. However, when I run my application, the f... |
I am working on an ASP.NET web application that is required to bring up a popup on a roolover. I am using the "OnMouseOver" event and it works as expected. The problem is that the event is on a "hair trigger"; even a casual passage of the mouse over the control brings up the popup (which then must be manually dismiss... | In an ASP.NET web application, if you're using the `OnMouseOver` event and you find that it triggers too easily, you can implement a delay mechanism using JavaScript. One common approach is to use `setTimeout` to create a delay before showing the popup. This way, if the mouse quickly passes over the control, the popup ... | 41,821 | [
{
"from": "human",
"value": "I am working on an ASP.NET web application that is required to bring up a popup on a roolover. I am using the \"OnMouseOver\" event and it works as expected. The problem is that the event is on a \"hair trigger\"; even a casual passage of the mouse over the control brings up t... |
I'm not of the Perl world, so some of this is new to me. I'm running Ubuntu Hardy LTS with apache2 and mod_fcgid packages installed. I'd like to get MT4 running under fcgid rather than mod-cgi (it seems to run OK with plain-old CGI).
I can't seem to get even a simple Perl script to run under fcgid. I created a simple... | It looks like you're trying to run a Perl script under FastCGI using mod_fcgid in Apache, but you're encountering a 500 Internal Server Error when trying to access the script through a web browser.
Here are some steps and troubleshooting tips that may help you resolve the issue:
### 1. Ensure that the FCGI Module is ... | 40,296 | [
{
"from": "human",
"value": "I'm not of the Perl world, so some of this is new to me. I'm running Ubuntu Hardy LTS with apache2 and mod_fcgid packages installed. I'd like to get MT4 running under fcgid rather than mod-cgi (it seems to run OK with plain-old CGI).\nI can't seem to get even a simple Perl scri... |
I have an ASP.NET (2.0) site. I am on my dev box using V Studio 2008 and IIS. I have a separate User Control project that gets called from a javascript function in the default.aspx page. The User Control project is in another solution.
The application is running as expected. The user control is being called and all is ... | It sounds like you've already tried quite a few troubleshooting steps to debug your User Control in an ASP.NET application. Here are some additional steps you can take to help diagnose the problem and allow you to step into the code of your User Control:
1. **Check Debugging Settings in Web.config**:
Ensure that th... | 41,842 | [
{
"from": "human",
"value": "I have an ASP.NET (2.0) site. I am on my dev box using V Studio 2008 and IIS. I have a separate User Control project that gets called from a javascript function in the default.aspx page. The User Control project is in another solution.\nThe application is running as expected. Th... |
I am trying to do a simple datagrid in Flex with a doubleclick event, but I cannot get itemDoubleClick to fire:
<mx:DataGrid id="gridReportConversions" height="100%" width="100%" mouseEnabled="true" doubleClickEnabled="true" itemDoubleClick="refererRowDoubleClicked(event)">
<mx:columns>
... | It sounds like you're experiencing an issue with the `itemDoubleClick` event not firing on your `DataGrid` in Flex. You've already set `doubleClickEnabled="true"` on the `DataGrid`, which is an important step. However, there are a few additional factors that might affect the event firing, especially given that your `Da... | 42,188 | [
{
"from": "human",
"value": "I am trying to do a simple datagrid in Flex with a doubleclick event, but I cannot get itemDoubleClick to fire:\n<mx:DataGrid id=\"gridReportConversions\" height=\"100%\" width=\"100%\" mouseEnabled=\"true\" doubleClickEnabled=\"true\" itemDoubleClick=\"refererRowDoubleClicked(e... |
I'm working on my first Django application. In short, what it needs to do is to display a list of film titles, and allow users to give a rating (out of 10) to each film. I've been able to use the {{ form }} and {{ formset }} syntax in a template to produce a form which lets you rate one film at a time, which correspond... | To create a form that allows users to rate multiple movies at once, you'll want to utilize Django's formsets with some adjustments to allow for dynamic creation of forms based on the movies in your database. Here's how you can achieve that:
### Step 1: Update Your View
You need to modify your view to fetch all the mo... | 41,940 | [
{
"from": "human",
"value": "I'm working on my first Django application. In short, what it needs to do is to display a list of film titles, and allow users to give a rating (out of 10) to each film. I've been able to use the {{ form }} and {{ formset }} syntax in a template to produce a form which lets you ... |
How can I read a Chinese text file using C#, my current code can't display the correct characters:
try
{
using (StreamReader sr = new StreamReader(path,System.Text.Encoding.UTF8))
{
// This is an arbitrary size for this example.
string c = null;
while (sr.Peek() >= 0)
{
... | To read a Chinese text file correctly using C#, you need to ensure that you're using the appropriate encoding that matches the encoding used when the file was saved. Chinese text files are commonly encoded in UTF-8 or GB2312 (or other encodings specific to Chinese characters). If you're sure that the text file is encod... | 42,053 | [
{
"from": "human",
"value": "How can I read a Chinese text file using C#, my current code can't display the correct characters:\ntry\n{ \n using (StreamReader sr = new StreamReader(path,System.Text.Encoding.UTF8))\n {\n // This is an arbitrary size for this example.\n string c = null;... |
First off, I apologize if this doesn't make sense. I'm new to XHTML, CSS and JavaScript.
I gather that in XHTML, the correct way to have a nested page is as follows (instead of an iframe):
<object name="nestedPage" data="http://abc.com/page.html" type="text/html"
width="500" height="400" />
If I have a nested page li... | It's great that you're diving into XHTML, CSS, and JavaScript! Your question about changing the stylesheet of a nested page (using the `<object>` tag) at runtime is a common one, but it does come with some limitations.
In your case, since the nested page is on the same domain, you can indeed manipulate its content usi... | 41,542 | [
{
"from": "human",
"value": "First off, I apologize if this doesn't make sense. I'm new to XHTML, CSS and JavaScript.\nI gather that in XHTML, the correct way to have a nested page is as follows (instead of an iframe):\n<object name=\"nestedPage\" data=\"http://abc.com/page.html\" type=\"text/html\" \nwidth... |
Are there any compatibility issues with running Visual Studio 6.0 (including Visual SourceSafe 6.0 Client), Visual Studio 2003 & Visual Studio 2008 on Windows Vista 64-bit?
Can I interactively debug the applications with the Vista Web Server? Can I still make/compile projects?
Is it correct to assume that Visual Studio... | Running Visual Studio 6.0, Visual Studio 2003, and Visual Studio 2008 on Windows Vista 64-bit can lead to various compatibility issues, particularly with the earlier versions (VS 6.0 and VS 2003). Here’s a breakdown of the compatibility and functionality you can expect:
### Compatibility Issues
1. **Visual Studio 6.0... | 37,031 | [
{
"from": "human",
"value": "Are there any compatibility issues with running Visual Studio 6.0 (including Visual SourceSafe 6.0 Client), Visual Studio 2003 & Visual Studio 2008 on Windows Vista 64-bit?\nCan I interactively debug the applications with the Vista Web Server? Can I still make/compile projects?\... |
Specifically, I currently have a JPanel with a TitledBorder. I want to customize the look of the border. In my app's current state, the title is drawn, but not the line border itself.
If I bind an imagePainter to the panelBorder method for Panel objects, I can put a custom image around panels -- however it only shows u... | To achieve the desired effect of having a custom image border appear only on `JPanel` objects that have a `TitledBorder`, while also ensuring that the line of the border is rendered properly, you can follow these steps:
1. **Create a Custom Border**: Extend the `TitledBorder` class to create a custom border that allow... | 30,549 | [
{
"from": "human",
"value": "Specifically, I currently have a JPanel with a TitledBorder. I want to customize the look of the border. In my app's current state, the title is drawn, but not the line border itself.\nIf I bind an imagePainter to the panelBorder method for Panel objects, I can put a custom imag... |
In Visual Studio I can type e.g.
for TAB TAB
and a code snippet pops in.
Are there built-in code snippets for private, public, etc. methods as well?
| Yes, Visual Studio provides built-in code snippets for various coding constructs, including method definitions for different access modifiers like `private`, `public`, `protected`, and `internal`. You can use these snippets to quickly generate method stubs in your code.
Here are some commonly used snippets related to ... | 43,932 | [
{
"from": "human",
"value": "In Visual Studio I can type e.g. \n\nfor TAB TAB\n\nand a code snippet pops in. \nAre there built-in code snippets for private, public, etc. methods as well?\n"
},
{
"from": "gpt",
"value": "Yes, Visual Studio provides built-in code snippets for various coding constr... |
From the .net 4.0 previews I have read until now there has been lots of talk on how the next .net version will handle and use cpus with multiple cores. We will have additions like plinq that will help us make use of multiple cores. My question is why should I have to bother my mind with handling multiple cores when all... | Your question touches on an important aspect of modern computing and the design challenges that come with multi-core processors. Let's break it down.
1. **Single-threaded vs Multi-threaded Performance**: When you have a single thread in your application, it can only utilize one core at a time. Even if you have multipl... | 35,970 | [
{
"from": "human",
"value": "From the .net 4.0 previews I have read until now there has been lots of talk on how the next .net version will handle and use cpus with multiple cores. We will have additions like plinq that will help us make use of multiple cores. My question is why should I have to bother my m... |
Java and C# support the notion of classes that can't be used as base classes with the final and sealed keywords. In C++ however there is no good way to prevent a class from being derived from which leaves the class's author with a dilemma, should every class have a virtual destructor or not?
Edit: Since C++11 this is... | The choice of whether to include a virtual destructor in a C++ class largely hinges on the intended use of the class and the principles of object-oriented design. Here are some considerations to help clarify the dilemma:
### When to Use a Virtual Destructor
1. **Intended Polymorphism**: If a class is intended to be a... | 42,633 | [
{
"from": "human",
"value": "Java and C# support the notion of classes that can't be used as base classes with the final and sealed keywords. In C++ however there is no good way to prevent a class from being derived from which leaves the class's author with a dilemma, should every class have a virtual dest... |
How to load javascript files using google.load instead of directly using tag in freemarker template language?
| To load JavaScript files using the `google.load` method in a FreeMarker template, you would typically follow these steps:
1. **Ensure you have the Google Loader library included**: First, you need to include the Google Loader library in your HTML. This is generally done using a `<script>` tag in your FreeMarker templa... | 41,926 | [
{
"from": "human",
"value": "How to load javascript files using google.load instead of directly using tag in freemarker template language?\n"
},
{
"from": "gpt",
"value": "To load JavaScript files using the `google.load` method in a FreeMarker template, you would typically follow these steps:\n... |
We are using Google Charts for render the chart images, but 500 requests/day became not enough. What PHP classes/frameworks are worth looking at?
| If you find that Google Charts is insufficient for your needs due to the limit on requests, you can consider several PHP libraries and frameworks for rendering charts and graphs directly on your server or through APIs. Here are some popular options:
### PHP Libraries for Charts
1. **Chart.js**:
- While primarily a... | 42,111 | [
{
"from": "human",
"value": "We are using Google Charts for render the chart images, but 500 requests/day became not enough. What PHP classes/frameworks are worth looking at?\n"
},
{
"from": "gpt",
"value": "If you find that Google Charts is insufficient for your needs due to the limit on reques... |
I am looking to do some tinkering with openGL and Python and haven't been able to find good reasons for using PyOpenGl versus pyglet
Which would you recommend and why?
| When deciding between **PyOpenGL** and **Pyglet** for OpenGL development in Python, it's essential to understand the roles these libraries play and how they interact with OpenGL.
### PyOpenGL
- **Description**: PyOpenGL is a Python binding for OpenGL, providing a direct interface to OpenGL functionality. It primarily... | 39,167 | [
{
"from": "human",
"value": "I am looking to do some tinkering with openGL and Python and haven't been able to find good reasons for using PyOpenGl versus pyglet\nWhich would you recommend and why?\n"
},
{
"from": "gpt",
"value": "When deciding between **PyOpenGL** and **Pyglet** for OpenGL deve... |
Since I'm sure many people have different standard, I've made this post a community wiki.
My question is, what's a good naming scheme for table aliases? I've been using the first letter of every word from the table name, but it's been getting quite unreadable. Here's a quick example.
FROM incidents i
FROM cause_attack ... | Using a good naming scheme for table aliases can significantly improve the readability of your SQL queries. Here are some common strategies you might consider:
1. **Shortened Table Names**: Use a shortened or abbreviated version of the table name, making sure it’s still recognizable. For example:
- `FROM incidents ... | 41,237 | [
{
"from": "human",
"value": "Since I'm sure many people have different standard, I've made this post a community wiki.\nMy question is, what's a good naming scheme for table aliases? I've been using the first letter of every word from the table name, but it's been getting quite unreadable. Here's a quick ex... |
Access Datasheet view appears to be blank(charaters appear in white hence not visible) in WSS3.0
| If you're experiencing an issue with the Access Datasheet view appearing blank in Windows SharePoint Services 3.0 (WSS 3.0), where the characters appear in white or are not visible, there are several steps you can take to troubleshoot and resolve this issue:
1. **Check Font Color Settings**:
- The most common reaso... | 43,702 | [
{
"from": "human",
"value": "Access Datasheet view appears to be blank(charaters appear in white hence not visible) in WSS3.0\n"
},
{
"from": "gpt",
"value": "If you're experiencing an issue with the Access Datasheet view appearing blank in Windows SharePoint Services 3.0 (WSS 3.0), where the c... |
We are developing a WCF based system. In the process we are trying to lock some data from being modified by more than one users. So we decided to have a data structure that will contain the necessary information for the locking logic to execute (by for example storing the ID of the locked objects)
The problem we are ha... | In a WCF-based system, managing data persistence between sessions while minimizing expensive database calls can be challenging. Here are some approaches you could consider:
### 1. In-Memory Cache with Expiry
You can use an in-memory cache solution such as **MemoryCache** (from `System.Runtime.Caching`) or any third-pa... | 42,698 | [
{
"from": "human",
"value": "We are developing a WCF based system. In the process we are trying to lock some data from being modified by more than one users. So we decided to have a data structure that will contain the necessary information for the locking logic to execute (by for example storing the ID of ... |
Suppose you have several applications which share the same code and most of the other resources, but have a somewhat different look and feel, some labels change, etc. (think branding). If each web app is to go in its own WAR file, where do you put the shared resources?
I already use the classpath to share classes and ... | When dealing with multiple web applications that share a significant amount of code and resources but require some variation in branding, there are several strategies you can adopt to manage shared resources like JavaScript and CSS files effectively. Here are some approaches to consider:
### 1. Shared WAR File for Res... | 42,856 | [
{
"from": "human",
"value": "Suppose you have several applications which share the same code and most of the other resources, but have a somewhat different look and feel, some labels change, etc. (think branding). If each web app is to go in its own WAR file, where do you put the shared resources?\nI alrea... |
I would like to document the file format of regedit utility, so data can be merged into the registry.
From the command-line you can (silently) merge data from a batch file like this:
regedit /s file.reg
Exporting from a subkey goes like this:
regedit /e file.reg "HKEY_XX\key"
| To document the file format used by the `regedit` utility for merging data into the Windows Registry, here’s a concise overview:
### Overview of the `.reg` File Format
The `.reg` file format is a plain text file used to represent registry keys and their values. These files can be created and edited manually or genera... | 40,118 | [
{
"from": "human",
"value": "I would like to document the file format of regedit utility, so data can be merged into the registry. \nFrom the command-line you can (silently) merge data from a batch file like this:\nregedit /s file.reg\n\nExporting from a subkey goes like this:\nregedit /e file.reg \"HKEY_XX... |
Is it possible to edit resources for an executable at runtime programmatically? If so, how? If not, is there another program that can easily be used to modify resources?
Thanks, Derek.
| Yes, it is possible to edit resources for an executable at runtime programmatically, although it can be complex depending on the type of resource and the programming environment. Below are the general approaches you might consider:
### 1. **Using Windows API (for Windows executables)**
You can use the Windows API to ... | 40,613 | [
{
"from": "human",
"value": "Is it possible to edit resources for an executable at runtime programmatically? If so, how? If not, is there another program that can easily be used to modify resources? \nThanks, Derek.\n"
},
{
"from": "gpt",
"value": "Yes, it is possible to edit resources for an ex... |
How do I create a shortcut to my website in the VS 2008 Setup project?
I'd like to have a shortcut created inside User's Program Menu\MyProgram , after the application is installed.
I could create a shortcut to the application itself but I have no idea how to make a shortcut to an http:// address.
Can anyone help?
| Creating a shortcut to a website in a Visual Studio 2008 Setup project is a bit different than creating a shortcut to an application. However, it can be done by following these steps:
### Step 1: Create a Shortcut File
You need to create a shortcut (.url file) that points to your website. To do this, follow these ste... | 39,430 | [
{
"from": "human",
"value": "How do I create a shortcut to my website in the VS 2008 Setup project?\nI'd like to have a shortcut created inside User's Program Menu\\MyProgram , after the application is installed.\nI could create a shortcut to the application itself but I have no idea how to make a shortcut ... |
The 'attach to process' dialogue box on VC6 running on win 2003 (I believe vista as well) has no processes to attach to in it... I've tried logging on as an administrator and running as an administrator but no luck. Any other ideas?
| If you are experiencing issues with the "Attach to Process" dialog in Visual C++ 6 (VC6) not displaying any processes to attach to on Windows Server 2003 or Vista, here are several steps you can try to resolve the issue:
1. **Check Project Configuration**: Ensure that your project is properly configured and built. If ... | 41,860 | [
{
"from": "human",
"value": "The 'attach to process' dialogue box on VC6 running on win 2003 (I believe vista as well) has no processes to attach to in it... I've tried logging on as an administrator and running as an administrator but no luck. Any other ideas?\n"
},
{
"from": "gpt",
"value": "I... |
I am writing a batch file, in which I call an EXE to execute. Now, statements after the call to the EXE should not execute till the EXE completes its execution. How can I do it in the batch file (on Windows)?
| In a batch file on Windows, if you want to execute an EXE and wait for it to complete before continuing with the subsequent commands, you can simply call the EXE directly without any special syntax. The batch file will pause execution until the called EXE finishes.
Here’s an example of how to do this:
```batch
@echo... | 44,061 | [
{
"from": "human",
"value": "I am writing a batch file, in which I call an EXE to execute. Now, statements after the call to the EXE should not execute till the EXE completes its execution. How can I do it in the batch file (on Windows)?\n"
},
{
"from": "gpt",
"value": "In a batch file on Window... |
I have two web applications in the same server like this:
/basedir/app1path/default1.aspx
/basedir/app2path/default2.aspx
How can I redirect form default1.aspx to default2.aspx?
| To redirect from `default1.aspx` to `default2.aspx`, you can use the `Response.Redirect` method in your ASP.NET web application. You would typically place this redirection code in the `Page_Load` event of your `default1.aspx.cs` code-behind file. Here's how you can do it:
### Using `Response.Redirect` in `default1.asp... | 42,578 | [
{
"from": "human",
"value": "I have two web applications in the same server like this:\n/basedir/app1path/default1.aspx\n\n/basedir/app2path/default2.aspx\n\nHow can I redirect form default1.aspx to default2.aspx?\n"
},
{
"from": "gpt",
"value": "To redirect from `default1.aspx` to `default2.asp... |
I noticed by looking at sample code from Apple, that they tend to design methods that receive structures instead of multiple parameters. Why is that? As far as ease of use, I personally prefer the latter, but as far as performance goes, is there one better choice than the other?
[pencil drawPoint:Point3Make(20,40,60)]
... | Apple's preference for using structures (or structs) as method parameters instead of multiple individual parameters often comes down to a combination of design principles, maintainability, and performance considerations.
### Reasons for Using Structures
1. **Readability and Clarity**:
- Using a struct can make the... | 40,256 | [
{
"from": "human",
"value": "I noticed by looking at sample code from Apple, that they tend to design methods that receive structures instead of multiple parameters. Why is that? As far as ease of use, I personally prefer the latter, but as far as performance goes, is there one better choice than the other?... |
I'd like to inspect the content of a file before it is uploaded to the SharePoint doc library.
I hooked up a handler to the ItemAdding() event but don't know how to get the content of the file.
Note: I know that in the ItemAdded() I can use properties.ListItem.File but that's too late.
Thanks in advance.
| To inspect the content of a file before it's uploaded to a SharePoint document library, you are correct in using the `ItemAdding()` event. However, the challenge lies in accessing the file content at that stage because the file is not fully processed until after the `ItemAdded()` event.
In SharePoint, when you handle ... | 42,175 | [
{
"from": "human",
"value": "I'd like to inspect the content of a file before it is uploaded to the SharePoint doc library.\nI hooked up a handler to the ItemAdding() event but don't know how to get the content of the file.\nNote: I know that in the ItemAdded() I can use properties.ListItem.File but that's ... |
I'm thinking of choosing Adobe AIR as the client-side implementation technology for an upcoming project. (The previous choice was C# and WPF, but I've been really impressed with Flash/Flex/AIR lately.)
But one of the most important features of my product will be its plugin architecture, allowing third party developers ... | Choosing Adobe AIR for a project with a plugin architecture certainly has its advantages, especially considering the flexibility of the platform. However, as you've noted, there are some nuances and potential challenges to be aware of, particularly when dealing with dynamic class loading and plugin systems. Here are so... | 41,536 | [
{
"from": "human",
"value": "I'm thinking of choosing Adobe AIR as the client-side implementation technology for an upcoming project. (The previous choice was C# and WPF, but I've been really impressed with Flash/Flex/AIR lately.)\nBut one of the most important features of my product will be its plugin arch... |
I have long considered the design of a database that involves shared table purposes to be somewhat a trait of smelly code, and progressively increasing proliferation of smelly-code related problems.
By this I mean, people over-normalizing, using 1 table where 2 tables could be more logical, people who've just discovere... | Your question touches on a fundamental aspect of database design: the balance between normalization and practicality. The dilemma of whether to share tables or create separate ones when dealing with distinct entities that may share some attributes can indeed lead to various design pitfalls. Let's explore the considerat... | 43,027 | [
{
"from": "human",
"value": "I have long considered the design of a database that involves shared table purposes to be somewhat a trait of smelly code, and progressively increasing proliferation of smelly-code related problems.\nBy this I mean, people over-normalizing, using 1 table where 2 tables could be ... |
Can Someone show me a good example of one Adobe Air App (using Javascript) consuming a REST API?
| Certainly! Below is a simple example of an Adobe AIR application using JavaScript that consumes a REST API. In this example, we will create a small application that fetches user data from a public REST API (`https://jsonplaceholder.typicode.com/users`) and displays the data in the application.
### Step 1: Set up the A... | 39,026 | [
{
"from": "human",
"value": "Can Someone show me a good example of one Adobe Air App (using Javascript) consuming a REST API?\n"
},
{
"from": "gpt",
"value": "Certainly! Below is a simple example of an Adobe AIR application using JavaScript that consumes a REST API. In this example, we will crea... |
We have tried to connect to a remote Novell server from our offices.
First, we had to open the firewall port to connect to the server, otherwise we were getting error 91 (which basically tells that the server cannot be joined).
Second, we used a tool called LDAP Browser to test the connection.
We get the error 81 "can'... | The error you're encountering, "can't contact LDAP server" (error 81), typically indicates an issue with the connection to the LDAP server, particularly during the SSL/TLS handshake when trying to establish a secure connection on port 636. Since you are able to connect via Telnet, this suggests that there is a basic co... | 43,307 | [
{
"from": "human",
"value": "We have tried to connect to a remote Novell server from our offices.\nFirst, we had to open the firewall port to connect to the server, otherwise we were getting error 91 (which basically tells that the server cannot be joined).\nSecond, we used a tool called LDAP Browser to tes... |
Look at this image:
alt text http://img139.imageshack.us/img139/4488/picture2ep3.png
I know how to add UITableView with grouped style and how to add label in any table cell.
But how can I add image and labels on top on the view, like screen.
| To add images and labels on top of the UITableView in your iOS application, you can use a combination of UIView, UIImageView, and UILabels, positioned above the UITableView. Here's how you can do it programmatically:
1. **Create a UIView** that acts as a container for your image and labels.
2. **Add the UIImageView** ... | 39,366 | [
{
"from": "human",
"value": "Look at this image:\nalt text http://img139.imageshack.us/img139/4488/picture2ep3.png\nI know how to add UITableView with grouped style and how to add label in any table cell.\nBut how can I add image and labels on top on the view, like screen.\n"
},
{
"from": "gpt",
... |
I'm using jQuery in conjunction with the form plugin and I'd like to intercept the form data before submission and make changes.
The form plugin has a property called beforeSubmit that should do this, but I seem to be having trouble getting the function I specify to run.
Here's the markup for the form (some style deta... | It looks like you might be missing the jQuery Form Plugin, which is necessary for the `ajaxForm()` method to work. Make sure that you've included both jQuery and the jQuery Form Plugin in your HTML file. Here's a checklist and some improvements to help you debug the issue:
### Checklist
1. **Include jQuery**: Make sur... | 41,333 | [
{
"from": "human",
"value": "I'm using jQuery in conjunction with the form plugin and I'd like to intercept the form data before submission and make changes. \nThe form plugin has a property called beforeSubmit that should do this, but I seem to be having trouble getting the function I specify to run.\nHere... |
I'm trying to attach to a remote machine with code similar to the following:
Debugger2 db (Debugger2)dte.Debugger;
Transport trans = db.Transports.Item("Default");
Process2 proc2 = (Process2)db.GetProcesses(trans, "MACHINENAME").Item("SERVICENAME");
proc2.Attach2();
I've gotten it to work by logging on through remote... | To automatically launch the debugger on a remote machine without having to stay logged in, you need to ensure that the Visual Studio Remote Debugger is running and properly configured on the target machine. Here are the steps to set this up:
### 1. Install Visual Studio Remote Debugger
Make sure the Visual Studio Remo... | 42,942 | [
{
"from": "human",
"value": "I'm trying to attach to a remote machine with code similar to the following: \nDebugger2 db (Debugger2)dte.Debugger;\nTransport trans = db.Transports.Item(\"Default\");\nProcess2 proc2 = (Process2)db.GetProcesses(trans, \"MACHINENAME\").Item(\"SERVICENAME\");\nproc2.Attach2();\n... |
Suppose there were several projects mostly maintained by smart interns, who eventually leave after a period of time. Scripts are used here and there in key parts, for example, to back up a database, rename it, zip it, move it over ssh, unzip it, and then to restore it with different settings. You know, the scripting st... | Choosing a single scripting language for your projects, especially in a mixed environment like yours, is an important decision. While there are many opinions on what the "best" scripting language is, I'll present a case for Python, as well as a couple of alternatives, along with their strengths and weaknesses to help y... | 41,668 | [
{
"from": "human",
"value": "Suppose there were several projects mostly maintained by smart interns, who eventually leave after a period of time. Scripts are used here and there in key parts, for example, to back up a database, rename it, zip it, move it over ssh, unzip it, and then to restore it with diffe... |
I have attempted to insert an html image withing an email (Outlook) to save as a template. I am finding that there is a slice that should repeat is not working correctly (to have the color extend to where the text ends). Is there someone who may be able to assist me in this matter? Below is the coding that I am usin... | Creating HTML emails can be tricky, especially when dealing with images, backgrounds, and ensuring that they render correctly across different email clients like Outlook. Here are some tips and adjustments you can make to your existing HTML code to help solve the issue you're experiencing with the repeating color:
###... | 38,918 | [
{
"from": "human",
"value": "I have attempted to insert an html image withing an email (Outlook) to save as a template. I am finding that there is a slice that should repeat is not working correctly (to have the color extend to where the text ends). Is there someone who may be able to assist me in this ma... |
Imagine the following scenario - we have Page1 which contains controls Control A and Control B.
Say Control A has a button, and on the click of this button we want Control B to react.
But we want to do this in an abstract fashion, i.e. we can't have Control B knowing anything about Control A, and vice versa.
That way w... | Your approach to handling inter-control communication while maintaining separation of concerns is well thought out and follows a message-based architecture. Here are some key points to consider regarding your design, along with some thoughts on potential improvements and pitfalls.
### Pros:
1. **Decoupling**: By using... | 39,712 | [
{
"from": "human",
"value": "Imagine the following scenario - we have Page1 which contains controls Control A and Control B.\nSay Control A has a button, and on the click of this button we want Control B to react.\nBut we want to do this in an abstract fashion, i.e. we can't have Control B knowing anything ... |
So, I'm trying to consume a webservice using something like this:
$client = new SoapClient("some.wsdl", array('local_cert' => "cert_key.pem"));
I've done this successfully in the past with other web services that required a cert & key concatenated into the local_cert file. Now, I'm trying to consume a service that... | When consuming a web service using SSL in PHP's SoapClient with a certificate and key, it's essential to properly format the local certificate file. Based on your description, it seems you are on the right track, but let's clarify a few important details regarding the `local_cert` file and the use of a trusted CA.
###... | 41,504 | [
{
"from": "human",
"value": "So, I'm trying to consume a webservice using something like this:\n$client = new SoapClient(\"some.wsdl\", array('local_cert' => \"cert_key.pem\"));\nI've done this successfully in the past with other web services that required a cert & key concatenated into the local_cert f... |
I am looking for some general advice about the mp3 format before I start a small project to make sure I am not on a wild-goose chase.
My understanding of the internals of the mp3 format is minimal. Ideally, I am looking for a library that would abstract those details away. I would prefer to use Python (but could be con... | Your understanding of the MP3 format and the considerations for manipulating it is largely correct. Here’s a breakdown of the points you mentioned, along with recommendations on how to proceed with your project.
### Understanding MP3 Format and Quality Loss
1. **Lossy Compression**: MP3 is indeed a lossy compression ... | 37,249 | [
{
"from": "human",
"value": "I am looking for some general advice about the mp3 format before I start a small project to make sure I am not on a wild-goose chase.\nMy understanding of the internals of the mp3 format is minimal. Ideally, I am looking for a library that would abstract those details away. I wo... |
The following query returns strange results for me:
SELECT
`Statistics`.`StatisticID`,
COUNT(`Votes`.`StatisticID`) AS `Score`,
COUNT(`Views`.`StatisticID`) AS `Views`,
COUNT(`Comments`.`StatisticID`) AS `Comments`
FROM `Statistics`
LEFT JOIN `Votes` ON `Votes`.`StatisticID` = `Statistics`.`StatisticID`... | The issue you are experiencing with your SQL query is due to how SQL handles joins, particularly with the `LEFT JOIN` statements and how the aggregation (the `COUNT()` function) works in conjunction with them.
When you perform a `LEFT JOIN` with multiple tables, if there are multiple matches in the joined tables, the ... | 42,654 | [
{
"from": "human",
"value": "The following query returns strange results for me:\nSELECT\n `Statistics`.`StatisticID`,\n COUNT(`Votes`.`StatisticID`) AS `Score`,\n COUNT(`Views`.`StatisticID`) AS `Views`,\n COUNT(`Comments`.`StatisticID`) AS `Comments`\nFROM `Statistics`\nLEFT JOIN `Votes` ON `V... |
I have found an example for encrypting a web.config during installation here, but my app is a windows service. The aspnetreg_iis method works only for web.config files.
I know how to programatically encrypt the config file, but I don't think I can do that using WiX. Am I wrong? Any ideas?
| You are correct that the `aspnet_regiis` tool is specifically designed for encrypting sections of `web.config` files in ASP.NET applications, and it won't work for other types of configuration files, such as those typically found in Windows services.
However, you can programmatically encrypt your `app.config` (or anot... | 42,295 | [
{
"from": "human",
"value": "I have found an example for encrypting a web.config during installation here, but my app is a windows service. The aspnetreg_iis method works only for web.config files.\nI know how to programatically encrypt the config file, but I don't think I can do that using WiX. Am I wron... |
Suppose to feed the filter standard input with these line:
line 1
line 2
line 3
line 4
line 5
line 6
line 7
line 8
line 9
line 10
It would be nicer if someone tell me how to write a script that prints only every 4 lines, in the case of the example input above:
line 1
line 5
line 9
| You can create a simple script to print every 4th line from standard input. Here's how you can do this using a Python script:
```python
import sys
def print_every_fourth_line():
# Read lines from standard input
for index, line in enumerate(sys.stdin):
# Check if the current line index (0-based) is 0 m... | 44,055 | [
{
"from": "human",
"value": "Suppose to feed the filter standard input with these line:\nline 1 \nline 2\nline 3\nline 4 \nline 5\nline 6\nline 7\nline 8\nline 9\nline 10\n\nIt would be nicer if someone tell me how to write a script that prints only every 4 lines, in the case of the example input above:\nli... |
In my web application, I need to log all the SOAP messages to my SQL 2005 database whenever I make a web service call to my business partners' web service. How do I accomplish that?
Thanks in Advance,
Tony
| To log SOAP messages to your SQL Server 2005 database in your web application, you can follow these general steps:
### Step 1: Create a Database Table
First, you'll need a table in your SQL Server database to store the SOAP messages. You might consider a structure like the following:
```sql
CREATE TABLE SoapLogs (
... | 42,352 | [
{
"from": "human",
"value": "In my web application, I need to log all the SOAP messages to my SQL 2005 database whenever I make a web service call to my business partners' web service. How do I accomplish that?\nThanks in Advance,\nTony\n"
},
{
"from": "gpt",
"value": "To log SOAP messages to yo... |
I'd like some advice on designing a REST API which will allow clients to add/remove large numbers of objects to a collection efficiently.
Via the API, clients need to be able to add items to the collection and remove items from it, as well as manipulating existing items. In many cases the client will want to make bulk ... | Designing a REST API that allows for efficient bulk operations can be challenging, especially when adhering to best practices and HTTP specifications. Below are some recommendations to help you design a REST API that allows clients to add, remove, and manipulate large numbers of objects efficiently.
### 1. Bulk Operat... | 38,050 | [
{
"from": "human",
"value": "I'd like some advice on designing a REST API which will allow clients to add/remove large numbers of objects to a collection efficiently.\nVia the API, clients need to be able to add items to the collection and remove items from it, as well as manipulating existing items. In man... |
I have a .NET Web app which consumes a Java-based Web service. One of the objects, named Optional, contains search criteria fields. The schema is the following:
<xsd:complexType name="Optional">
<xsd:sequence>
<xsd:element name="FromAmount" nillable="true" type="xsd:float" minOccurs="0" />
<xsd:element name="ToAm... | The issue you're facing with serialization in your .NET Web application is related to how optional elements are handled. When an element is defined as optional (using `minOccurs="0"`), it can be omitted from the serialized XML if it is not explicitly set, or if it is `null`. The .NET serializer may skip these elements ... | 42,327 | [
{
"from": "human",
"value": "I have a .NET Web app which consumes a Java-based Web service. One of the objects, named Optional, contains search criteria fields. The schema is the following:\n<xsd:complexType name=\"Optional\">\n <xsd:sequence>\n <xsd:element name=\"FromAmount\" nillable=\"true\" type=\"xsd... |
How do I insert Chinese characters into a SQLExpress text field? I'm using SQL Express from VS 2008. When I add Chinese characters, either via an import app I wrote or by pasting them in from the data view inside Visual Studio, they end up as question marks.
| To properly store and retrieve Chinese characters (or any non-ASCII characters) in SQL Server Express, you need to ensure that both your database and your SQL commands are set up to handle Unicode data. Here's a step-by-step guide to help you insert Chinese characters into a SQL Server text field:
1. **Use the Correct... | 43,275 | [
{
"from": "human",
"value": "How do I insert Chinese characters into a SQLExpress text field? I'm using SQL Express from VS 2008. When I add Chinese characters, either via an import app I wrote or by pasting them in from the data view inside Visual Studio, they end up as question marks.\n"
},
{
"fro... |
We recently moved to a webfarm and setup dfs, only to find a beta application was creating files like there was no tomorrow. 1.2 million files were replicated across the farm, and since then we have prevented the application from creating new files, but every time we try to remove the files, it replaces them on each se... | Yes, you can manage DFS (Distributed File System) replication at the folder level, and there are steps you can take to stop the replication of specific folders. Here’s how you can do it:
### 1. **Exclude Specific Folders from Replication**
You can configure DFS replication to exclude specific folders by modifying the ... | 41,389 | [
{
"from": "human",
"value": "We recently moved to a webfarm and setup dfs, only to find a beta application was creating files like there was no tomorrow. 1.2 million files were replicated across the farm, and since then we have prevented the application from creating new files, but every time we try to remo... |
I want to create a compiled JavaScript file for my website. For development I would prefer to keep the JavaScript in separate files and just as part of my automated scripts concatenate the files into one and run the compressor over it.
My problem is that if I use the old DOS copy command it also puts in the EOF marke... | To create a compiled JavaScript file from multiple source files without introducing unwanted EOF markers, you have several options that are better suited than the DOS `copy` command. Here are some alternatives you can consider:
### 1. Use a Build Tool
Using a build tool like **Gulp**, **Grunt**, or **Webpack** is a co... | 40,927 | [
{
"from": "human",
"value": "I want to create a compiled JavaScript file for my website. For development I would prefer to keep the JavaScript in separate files and just as part of my automated scripts concatenate the files into one and run the compressor over it.\nMy problem is that if I use the old DOS ... |
I've been using gettext in several private projects and now I want to use gettext to translate strings of a Visual Basic 6 application.
I've checked the GNU gettext packages and it seems that I have to write quite some boilerplate code to get it working with VB6 and I fear that my boss won't allow it.
Is there some ... | Using GNU gettext for translating strings in a Visual Basic 6 (VB6) application can indeed be more cumbersome than in more modern programming environments, mainly because VB6 lacks some of the built-in support and libraries found in languages like Python, C#, or Java. However, you can definitely achieve translation usi... | 41,666 | [
{
"from": "human",
"value": "I've been using gettext in several private projects and now I want to use gettext to translate strings of a Visual Basic 6 application. \nI've checked the GNU gettext packages and it seems that I have to write quite some boilerplate code to get it working with VB6 and I fear tha... |
I am looking for an algorithm to hatch a rectangle with shortest overall line length, so that an object of given area can be passed through the hatching.
For example given a rectangle of 5x3 cm, and I hatch using parallel lines 1cm across, the biggest object I can pass through the hatch is a square of 1cm side. I have ... | To solve your problem of minimizing the overall length of hatching lines while still allowing a specified area of shape to pass through, we can consider the principles of geometry and optimization.
### Problem Breakdown
1. **Define the Hatch Area**: We want to hatch a rectangular area of width `W` and height `H` (e.g... | 41,313 | [
{
"from": "human",
"value": "I am looking for an algorithm to hatch a rectangle with shortest overall line length, so that an object of given area can be passed through the hatching.\nFor example given a rectangle of 5x3 cm, and I hatch using parallel lines 1cm across, the biggest object I can pass through ... |
Greetings,
I have a particular object which can be constructed from a file, as such:
public class ConfigObj
{
public ConfigObj(string loadPath)
{
//load object using .Net's supplied Serialization library
//resulting in a ConfigObj object
ConfigObj deserializedObj = VoodooLoadFun... | In C#, the `this` reference in a constructor cannot be reassigned, which is why you're encountering issues with your current approach. However, there are several best practices for handling object deserialization that can help you achieve the desired functionality while maintaining code quality and maintainability.
##... | 37,178 | [
{
"from": "human",
"value": "Greetings, \nI have a particular object which can be constructed from a file, as such:\npublic class ConfigObj\n{\n public ConfigObj(string loadPath)\n {\n //load object using .Net's supplied Serialization library\n //resulting in a ConfigObj object\n ... |
What is the least amount of code you can write to create, sort (ascending), and print a list of 100 random positive integers? By least amount of code I mean characters contained in the entire source file, so get to minifying.
I'm interested in seeing the answers using any and all programming languages. Let's try to ke... | Here are concise examples of generating, sorting, and printing a list of 100 random positive integers in different programming languages. Each snippet is designed to be as short as possible.
### Python
```python
import random;print(sorted([random.randint(1,100)for _ in range(100)]))
```
### JavaScript
```javascript
c... | 43,658 | [
{
"from": "human",
"value": "What is the least amount of code you can write to create, sort (ascending), and print a list of 100 random positive integers? By least amount of code I mean characters contained in the entire source file, so get to minifying.\nI'm interested in seeing the answers using any and ... |
I have a Pocket PC 2003 solution, consisting of three projects, that was created in Visual Studio 2005. I open the solution in Visual Studio 2008 and two of the projects fail to convert due to errors like the following:
Unable to read the project file 'PDA.vbproj'. D:\PDA.vbproj(121,61): The imported project "C:\WINDO... | The issue you’re encountering is related to the project file and the way Visual Studio 2008 handles projects that target the .NET Compact Framework. In your case, it seems that the conversion process is trying to reference a file for the Compact Framework that is not present in the expected directory for version 3.5.
... | 42,678 | [
{
"from": "human",
"value": "I have a Pocket PC 2003 solution, consisting of three projects, that was created in Visual Studio 2005. I open the solution in Visual Studio 2008 and two of the projects fail to convert due to errors like the following:\nUnable to read the project file 'PDA.vbproj'. D:\\PDA.vbp... |
Does anyone know how to add a an MSBuild .proj file to my solution?
I was just given existing code from a vendor with a solution that references an MSBuild .proj file as one of its projects. When I open the solution, the project shows as (unavailable). It appears that I need to install some sort of project template t... | To add an MSBuild .proj file to your Visual Studio solution and ensure it opens correctly, follow these steps:
1. **Verify the .proj File**: First, ensure that the .proj file is compatible with your version of Visual Studio. .proj files can be used for various purposes, and not all of them are supported directly in Vi... | 35,955 | [
{
"from": "human",
"value": "Does anyone know how to add a an MSBuild .proj file to my solution?\nI was just given existing code from a vendor with a solution that references an MSBuild .proj file as one of its projects. When I open the solution, the project shows as (unavailable). It appears that I need ... |
Using Morph Labs' Appspace to deploy a site means no automated way to redirect 'myapp.com' to 'www.myapp.com' (and no access to .htacess).
Is there an in-rails way to do this? Would I need a plugin like subdomain-fu?
More specifically, I'm trying to do something like:
'myapp.com' => 'www.myapp.com'
'myapp.com/session/... | If you're deploying your application using Morph Labs' Appspace and don't have access to server-level configurations (like `.htaccess`), you can handle the redirection directly within your Rails application.
You can accomplish this by using a middleware or adding a before action in your application controller. Here's ... | 42,550 | [
{
"from": "human",
"value": "Using Morph Labs' Appspace to deploy a site means no automated way to redirect 'myapp.com' to 'www.myapp.com' (and no access to .htacess).\nIs there an in-rails way to do this? Would I need a plugin like subdomain-fu?\nMore specifically, I'm trying to do something like:\n\n'myap... |
This only helps kills processes on the local machine. How do I kill processes on remote machines?
| To kill processes on remote machines, you have several options depending on the operating system and the tools available. Below are methods for both Windows and Unix-like operating systems (Linux, macOS):
### For Windows:
1. **Using PsExec:**
PsExec is part of the Sysinternals Suite and allows you to execute comma... | 41,595 | [
{
"from": "human",
"value": "This only helps kills processes on the local machine. How do I kill processes on remote machines?\n"
},
{
"from": "gpt",
"value": "To kill processes on remote machines, you have several options depending on the operating system and the tools available. Below are meth... |
include("conn.php");
$result = mysql_query("SELECT * FROM sggame");
while($row = mysql_fetch_assoc($result));
{
$id = $row['id'];
echo $id;
echo 'working?';
}
The above code simply doesn't return anything out of the db. The row name is correct and the loop runs, showing that there is something in the data... | The issue you are experiencing is likely due to the semicolon at the end of your `while` statement. This semicolon effectively ends the loop, causing the code block that follows it to execute only once after the loop has completed, rather than repeatedly for each iteration of the loop.
Here’s a corrected version of yo... | 43,740 | [
{
"from": "human",
"value": "include(\"conn.php\");\n$result = mysql_query(\"SELECT * FROM sggame\");\n\nwhile($row = mysql_fetch_assoc($result));\n{\n $id = $row['id'];\n echo $id;\n echo 'working?';\n}\n\nThe above code simply doesn't return anything out of the db. The row name is correct and the... |
How can I find the location of exe that runs as a windows service in run-time?
| To find the location of an executable (EXE) that is running as a Windows service during runtime, you can use several methods. Here are some ways to achieve this:
### Method 1: Using the Services Management Console
1. **Open Services**:
- Press `Win + R` to open the Run dialog.
- Type `services.msc` and press En... | 41,244 | [
{
"from": "human",
"value": "How can I find the location of exe that runs as a windows service in run-time?\n"
},
{
"from": "gpt",
"value": "To find the location of an executable (EXE) that is running as a Windows service during runtime, you can use several methods. Here are some ways to achieve... |
An answer (see below) to one of the questions right here on Stack Overflow gave me an idea for a great little piece of software that could be invaluable to coders everywhere.
I'm imagining RAM drive software, but with one crucial difference - it would mirror a real folder on my hard drive. More specifically - the folde... | The concept you're describing—a RAM drive that mirrors a real folder on your hard drive with background synchronization—sounds quite interesting, especially for developers looking to speed up their build processes. While there may not be an out-of-the-box solution that fits your exact requirements perfectly, there are ... | 43,128 | [
{
"from": "human",
"value": "An answer (see below) to one of the questions right here on Stack Overflow gave me an idea for a great little piece of software that could be invaluable to coders everywhere.\nI'm imagining RAM drive software, but with one crucial difference - it would mirror a real folder on my... |
I am considering writing two limited precision alternatives to BigDecimal, namely DecimalInt and DecimalLong. These would be capable of dealing with numbers within the real bounds of int and long with an arbitrary number of decimal places, creatable in both mutable and immutable form. My plan is to make DecimalInt su... | Your idea of implementing `DecimalInt` and `DecimalLong` classes to provide limited precision decimal arithmetic sounds practical and could indeed address a niche for simple use cases, especially in financial applications where precision and performance matter. Let's break down your queries:
### Has this already been ... | 42,887 | [
{
"from": "human",
"value": "I am considering writing two limited precision alternatives to BigDecimal, namely DecimalInt and DecimalLong. These would be capable of dealing with numbers within the real bounds of int and long with an arbitrary number of decimal places, creatable in both mutable and immutabl... |
A typical approach to avoid two instances of the same script running simultaneously looks like this:
[ -f ".lock" ] && exit 1
touch .lock
# do something
rm .lock
Is there a better way to lock on files from a shell-script, avoiding a race condition? Must directories be used instead?
| Using a lock file as you've shown is a common method for preventing multiple instances of a script from running simultaneously, but it can be susceptible to race conditions. A race condition can occur if two instances of the script check for the existence of the lock file at the same time before one of them creates it.... | 43,935 | [
{
"from": "human",
"value": "A typical approach to avoid two instances of the same script running simultaneously looks like this:\n[ -f \".lock\" ] && exit 1\ntouch .lock\n# do something\nrm .lock\n\nIs there a better way to lock on files from a shell-script, avoiding a race condition? Must directories be u... |
We've trying to separate a big code base into logical modules. I would like some recommendations for tools as well as whatever experiences you might have had with this sort of thing.
The application consists of a server WAR and several rich-clients distributed in JARs. The trouble is that it's all in one big, hairy co... | Refactoring a large, monolithic codebase into manageable modules can be a complex but rewarding task. Here are some tools, techniques, and general advice that can help facilitate this process, especially with your current setup using Java, Maven, and existing tests.
### Tools
1. **Dependency Analysis Tools**:
- **... | 41,502 | [
{
"from": "human",
"value": "We've trying to separate a big code base into logical modules. I would like some recommendations for tools as well as whatever experiences you might have had with this sort of thing. \nThe application consists of a server WAR and several rich-clients distributed in JARs. The tro... |
I'm trying to create a check/uncheck all CheckBox for a number of CheckBoxes that are located inside the cell template of a GridViewColumn. I added this column to a GridView (along with other columns), set the GridView to the view property of a ListView, and then databound the ListView to a collection of custom DataObj... | To implement a "Check/Uncheck All" feature for CheckBoxes inside a `GridView` in a `ListView`, while keeping your underlying data model intact, you can use a different approach that incorporates an `ObservableCollection` along with a separate property to track the checked state.
### Step 1: Define a ViewModel
Instead... | 40,570 | [
{
"from": "human",
"value": "I'm trying to create a check/uncheck all CheckBox for a number of CheckBoxes that are located inside the cell template of a GridViewColumn. I added this column to a GridView (along with other columns), set the GridView to the view property of a ListView, and then databound the L... |
I am pretty much the only person making check ins to the svn repo but for some reason over the past week Tortoise is reported that my WCF Service Reference directory is 'obstructed' and I cant commit my changes. If I have no even made any changes to the contents of that directory, why does svn report obstructed and wha... | When TortoiseSVN (or any SVN client) reports that a directory is "obstructed," it typically means that there is a conflict between the working copy and the version control system that prevents SVN from determining the correct status of the directory. This usually happens under a few common scenarios:
1. **Missing or U... | 40,262 | [
{
"from": "human",
"value": "I am pretty much the only person making check ins to the svn repo but for some reason over the past week Tortoise is reported that my WCF Service Reference directory is 'obstructed' and I cant commit my changes. If I have no even made any changes to the contents of that director... |
My web app has a secure area which users log in to via a JSP. The JSP posts the user name and password to a servlet, which then checks to see if the users credentials are valid. If they are valid then the user is directed to the secure resource. How can I ensure that users can't just navigate to the secure resource ... | To ensure that users cannot access a secure resource without proper validation (authentication) in your web application, you need to implement a few essential practices. Here are the steps you can take:
### 1. Implement Session Management
After the user logs in successfully, create a user session to track their authe... | 41,554 | [
{
"from": "human",
"value": "My web app has a secure area which users log in to via a JSP. The JSP posts the user name and password to a servlet, which then checks to see if the users credentials are valid. If they are valid then the user is directed to the secure resource. How can I ensure that users ca... |
For the project I'm working on I noticed that file transfer* speed is really bad if I'm using IIS FTP and HTTP services. I know that the last thing I should think is "it's a Windows bug", but the fact that simply by using IIS on Windows Server or by changing IIS on that Windows XP machine to FileZilla and LightHTTPd, m... | There are several factors that could be affecting the file transfer speeds you are experiencing with IIS on Windows XP compared to FileZilla and LightHTTPd. Here are some possible explanations and considerations:
1. **IIS Configuration**: IIS can have various settings that may limit throughput. Check the following set... | 41,284 | [
{
"from": "human",
"value": "For the project I'm working on I noticed that file transfer* speed is really bad if I'm using IIS FTP and HTTP services. I know that the last thing I should think is \"it's a Windows bug\", but the fact that simply by using IIS on Windows Server or by changing IIS on that Window... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.