instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
This java program I am working on seems to hang on startup, so I tried using jconsole to debug the problem.
As it turns out it is waiting on a call to a method which is declared as -
synchronized void stopQuery()
But here is the crazy part, the lock for the 'synchronized' method is already held by the thread which is ... | It sounds like you're encountering a classic deadlock or contention issue, even though it might not look like a standard deadlock scenario since the thread that's waiting on the `stopQuery()` method already holds the lock on it. In Java, `synchronized` methods acquire a lock on the instance (`this`) of the object when ... | 41,803 | [
{
"from": "human",
"value": "This java program I am working on seems to hang on startup, so I tried using jconsole to debug the problem.\nAs it turns out it is waiting on a call to a method which is declared as -\nsynchronized void stopQuery()\n\nBut here is the crazy part, the lock for the 'synchronized' m... |
I'm trying to validate that a submitted URL doesn't already exist in the database.
The relevant parts of the Form class look like this:
from django.contrib.sites.models import Site
class SignUpForm(forms.Form):
# ... Other fields ...
url = forms.URLField(label='URL for new site, eg: example.com')
def clean... | It looks like you're encountering issues with the way you're checking for the existence of the URL in your `clean_url()` method. The main problem arises from how you are querying the `Site` model with the `domain` field.
### Issues:
1. **Querying the Domain**: The `domain` field in the `Site` model is usually expected... | 40,676 | [
{
"from": "human",
"value": "I'm trying to validate that a submitted URL doesn't already exist in the database.\nThe relevant parts of the Form class look like this:\nfrom django.contrib.sites.models import Site\nclass SignUpForm(forms.Form):\n # ... Other fields ...\n url = forms.URLField(label='URL ... |
I am using UIActivityIndicatorView to showing user that there is something going on, let them wait. But UIActivityIndicatorView looks small, do not have background color, and not very obvious to the user. While in iPhone SDK's UIImagePickerController, it uses the similar mechanism, but with the black background as well... | In iOS development, if you want to create a more user-friendly loading indicator that includes a background, possibly some text, and is more prominent than a default `UIActivityIndicatorView`, you can either use a third-party library or implement your own custom loading view.
Here are a couple of suggestions:
### 1.... | 41,574 | [
{
"from": "human",
"value": "I am using UIActivityIndicatorView to showing user that there is something going on, let them wait. But UIActivityIndicatorView looks small, do not have background color, and not very obvious to the user. While in iPhone SDK's UIImagePickerController, it uses the similar mechani... |
I want to clear a element from a vector using the erase method. But the problem here is that the element is not guaranteed to occur only once in the vector. It may be present multiple times and I need to clear all of them. My code is something like this:
void erase(std::vector<int>& myNumbers_in, int number_in)
{
s... | You're correct that modifying the vector while iterating through it can lead to undefined behavior, particularly because erasing an element invalidates the iterator that points to it. To properly remove all occurrences of an element from a vector without causing issues, you can use the `std::remove` algorithm combined ... | 44,174 | [
{
"from": "human",
"value": "I want to clear a element from a vector using the erase method. But the problem here is that the element is not guaranteed to occur only once in the vector. It may be present multiple times and I need to clear all of them. My code is something like this:\nvoid erase(std::vector<... |
From what I've read about ASP.NET MVC, it appears it requires posting to work, is there any working example (With source available) of a ASP.NET MVC website that has no postbacks with the help of Ajax?
(I checked the related questions earlier but couldn't find what I was looking for)
Thanks in advance.
edit: I need jQu... | Certainly! ASP.NET MVC is designed to work seamlessly with AJAX, allowing you to create applications that do not require postbacks in the traditional sense. Below is a simple example of an ASP.NET MVC application that uses jQuery to perform AJAX calls without requiring postbacks.
### Example: ASP.NET MVC with jQuery A... | 40,704 | [
{
"from": "human",
"value": "From what I've read about ASP.NET MVC, it appears it requires posting to work, is there any working example (With source available) of a ASP.NET MVC website that has no postbacks with the help of Ajax?\n(I checked the related questions earlier but couldn't find what I was lookin... |
I'm writing a desktop app using JOGL, and deploying on Win/Mac/Linux. On Linux we find that the OpenGL libraries installed are not always up to the job, and we need to have the capability of switching our own software emulation OpenGL in. Naturally we expected that we could place out libraries after /usr/lib or before ... | JOGL (Java Binding for the OpenGL) indeed interacts with native OpenGL libraries and, as a result, may have specific behaviors when it comes to loading libraries. Here are some key points and approaches you might consider regarding JOGL and OpenGL library loading on Linux:
1. **Library Loading Mechanism**: JOGL uses J... | 42,197 | [
{
"from": "human",
"value": "I'm writing a desktop app using JOGL, and deploying on Win/Mac/Linux. On Linux we find that the OpenGL libraries installed are not always up to the job, and we need to have the capability of switching our own software emulation OpenGL in. Naturally we expected that we could plac... |
I have asked a similar question before, but I didn't have a firm grasp on what the problem I was encountering was. My problem is I cannot get the data from a TextBox residing on the master when the page changes. Here is what happens:
MasterPage with TextBox and Button.
Data is entered into the TextBox and Button is ... | It looks like you are facing an issue with retrieving the value from a `TextBox` located on a Master Page when you navigate to another page. Based on your description, the key points of confusion are:
1. **Understanding the Control Hierarchy**: In ASP.NET Web Forms, controls are instantiated during the page life cycle... | 33,360 | [
{
"from": "human",
"value": "I have asked a similar question before, but I didn't have a firm grasp on what the problem I was encountering was. My problem is I cannot get the data from a TextBox residing on the master when the page changes. Here is what happens:\n\nMasterPage with TextBox and Button.\nDat... |
I have to call ping from c++ code.I'd like to easily read the output for further utilizations.
I have come up with two solutions:
use a fork and a pipe, redirect ping output to the pipe and then parse it
find a library suited for the purpose to use a ping(ip_addresss) function directly
I'd like the latter but i didn'... | To implement a ping functionality in C++, you can indeed use either of the approaches you mentioned: forking a process and capturing its output, or using a library that provides networking utilities including ping.
If you're looking for a library-based solution, there aren't widely adopted standard C++ libraries dedic... | 36,406 | [
{
"from": "human",
"value": "I have to call ping from c++ code.I'd like to easily read the output for further utilizations.\nI have come up with two solutions:\n\nuse a fork and a pipe, redirect ping output to the pipe and then parse it\nfind a library suited for the purpose to use a ping(ip_addresss) funct... |
WPF doesn't provide the ability to have a window that allows resize but doesn't have maximize or minimize buttons. I'd like to able to make such a window so I can have resizable dialog boxes.
I'm aware the solution will mean using pinvoke but I'm not sure what to call and how. A search of pinvoke.net didn't turn up any... | Certainly! To create a resizable WPF window that does not have maximize or minimize buttons, you can utilize PInvoke to modify the window's styles after it has been created. Below is an example of how you can achieve this using C#.
### Step 1: Create a WPF Window
First, you need to create a WPF Window. Here's a simple... | 40,852 | [
{
"from": "human",
"value": "WPF doesn't provide the ability to have a window that allows resize but doesn't have maximize or minimize buttons. I'd like to able to make such a window so I can have resizable dialog boxes.\nI'm aware the solution will mean using pinvoke but I'm not sure what to call and how. ... |
I am trying to get the Azure SDK up and running on my dev PC and have been having some issues.
I have installed the SDK, tools for VS and am trying to run the samples. Every time I try to run the samples the Development Storage service starts and then the Developer Fabric tries to start. This is where is stops. The De... | It sounds like you're encountering issues with the Azure SDK and the local development environment. Here are some steps you can take to troubleshoot and hopefully resolve the issue with the Developer Fabric not starting properly:
1. **Run as Administrator**: Make sure you are running Visual Studio as an administrator.... | 40,833 | [
{
"from": "human",
"value": "I am trying to get the Azure SDK up and running on my dev PC and have been having some issues. \nI have installed the SDK, tools for VS and am trying to run the samples. Every time I try to run the samples the Development Storage service starts and then the Developer Fabric trie... |
From the haskell report:
The quot, rem, div, and mod class
methods satisfy these laws if y is
non-zero:
(x `quot` y)*y + (x `rem` y) == x
(x `div` y)*y + (x `mod` y) == x
quot is integer division truncated
toward zero, while the result of div
is truncated toward negative infinity.
For example:
Prelude> (-12... | The distinction between `quot` and `div` in Haskell, particularly their different methods of truncation, can lead to different results when operating with negative numbers. The key difference is that `quot` truncates towards zero, while `div` truncates towards negative infinity. This difference can be particularly sign... | 40,991 | [
{
"from": "human",
"value": "From the haskell report:\n\nThe quot, rem, div, and mod class\n methods satisfy these laws if y is\n non-zero:\n(x `quot` y)*y + (x `rem` y) == x\n(x `div` y)*y + (x `mod` y) == x\n\nquot is integer division truncated\n toward zero, while the result of div\n is truncated to... |
What would be the most effective way to grab the schema + table name in this scenario:
SELECT [t0].[Id], [t0].[CODE] AS [arg0], [t0].[DESC] AS [arg1]
FROM [SchemaName].[TableName] AS [t0]
WHERE ([t0].[Id] <> @p0)
The outcome needs to be: "SchemaName.TableName" ....
I'm using C#.
Thanks!
| To extract the schema and table name from a SQL query in C#, you can use regular expressions or string manipulation techniques. Here's a straightforward approach using regular expressions to match the schema and table name in the provided SQL query.
Here’s a C# code snippet that accomplishes this:
```csharp
using Sys... | 43,683 | [
{
"from": "human",
"value": "What would be the most effective way to grab the schema + table name in this scenario:\nSELECT [t0].[Id], [t0].[CODE] AS [arg0], [t0].[DESC] AS [arg1]\nFROM [SchemaName].[TableName] AS [t0]\nWHERE ([t0].[Id] <> @p0)\nThe outcome needs to be: \"SchemaName.TableName\" ....\nI'm us... |
I want to create a serve resampled (downsized) version of images using jsp. The original images are stored in the database as blobs. I want to to create a jsp that serves a downsampled image with decent quality (not pixelated) as per the passed image width/height (e.g. getimage.jsp?imageid=xxxx&maxside=200) . Can you p... | To create a JSP page that serves downsampled images from the database stored as BLOBs, you can use the following approach:
1. **Fetch the Image from the Database**: You will need to query your database to retrieve the image BLOB based on the provided image ID.
2. **Downsample the Image**: For resizing and processing ... | 40,412 | [
{
"from": "human",
"value": "I want to create a serve resampled (downsized) version of images using jsp. The original images are stored in the database as blobs. I want to to create a jsp that serves a downsampled image with decent quality (not pixelated) as per the passed image width/height (e.g. getimage.... |
To follow on from my question yesterday....
MySQL Table Design for a Questionnaire
I sat down with my boss yesterday afternoon to run through how I was proposing to design the database. However, now I am more confused than ever.
He has been using Access for many years, and has questioned whether I will be able to prod... | It's understandable to feel overwhelmed when transitioning from a system like Access to a more relational database management system like MySQL. Your boss's experience with Access might be influencing his thinking, but it's essential to design the database in a way that is scalable and maintains data integrity.
### Co... | 42,940 | [
{
"from": "human",
"value": "To follow on from my question yesterday....\nMySQL Table Design for a Questionnaire\nI sat down with my boss yesterday afternoon to run through how I was proposing to design the database. However, now I am more confused than ever.\nHe has been using Access for many years, and h... |
I'm an email n00b but I am working on an application that sends HTML email with Unicode characters (as my friend noted "enjoy encoding hell").
The Subject: header comes from user input and therefore may contain Unicode characters. Some mail clients (like GMail and Outlook 2007) are OK with this, but from my reading it ... | To handle encoding in email subjects and ensure compatibility with various email clients, you can use MIME Encoded-Word encoding for the subject header. For Ruby, you can use the `mail` gem, which provides utilities for constructing emails with proper encoding.
### Using the `mail` gem for Encoded-Word
First, you nee... | 43,582 | [
{
"from": "human",
"value": "I'm an email n00b but I am working on an application that sends HTML email with Unicode characters (as my friend noted \"enjoy encoding hell\").\nThe Subject: header comes from user input and therefore may contain Unicode characters. Some mail clients (like GMail and Outlook 200... |
On a simple directory creation operation for example, I can make an OSError like this:
(Ubuntu Linux)
>>> import os
>>> os.mkdir('foo')
>>> os.mkdir('foo')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: [Errno 17] File exists: 'foo'
Now I can catch that error like this:
>>> import os... | In Python, the `OSError` exception is platform-dependent, and the specific error codes (like `17` for "File exists" on Linux) may vary across different operating systems. However, Python provides a standard way to handle these errors across platforms by using the `errno` module, which defines symbolic constants for the... | 44,109 | [
{
"from": "human",
"value": "On a simple directory creation operation for example, I can make an OSError like this:\n(Ubuntu Linux)\n>>> import os\n>>> os.mkdir('foo')\n>>> os.mkdir('foo')\nTraceback (most recent call last):\n File \"<stdin>\", line 1, in <module>\nOSError: [Errno 17] File exists: 'foo'\n\... |
A little example
TTest<T> = class
private
f : T;
public
function ToString : string;
end;
If is an object then this should work
TTest<T>.ToString;
begin
Result := f.ToString;
end;
But what happens when is say an integer? This would be ok in .net. of course.
I know it won't work, but how do I code this to work ... | To create a generic class in Delphi (Pascal) that can handle both objects and simple types (like integers), you can use a combination of method overloading and type checking. The main challenge is that simple types (like integers) do not have a `ToString` method, while objects typically do.
In Delphi, you can use the ... | 43,177 | [
{
"from": "human",
"value": "A little example\nTTest<T> = class\nprivate\n f : T;\npublic\n function ToString : string;\nend;\n\nIf is an object then this should work\nTTest<T>.ToString;\nbegin\n Result := f.ToString;\nend;\n\nBut what happens when is say an integer? This would be ok in .net. of course... |
I've developed an application at working using MySQL 5, that uses Views to access the major pieces of data. It turns out that our production server uses MySQL 4, which does not have Views included.
Does anybody have a quick and dirty way to deal with this that doesn't involve rewriting all my code?
| If you're working with MySQL 4 and need to access the data that you would typically retrieve using Views in MySQL 5, there are a few quick and dirty solutions you can consider:
### 1. Use Subqueries
You can often replace Views with subqueries directly in your SELECT statements. For example, if your view looks like thi... | 39,401 | [
{
"from": "human",
"value": "I've developed an application at working using MySQL 5, that uses Views to access the major pieces of data. It turns out that our production server uses MySQL 4, which does not have Views included.\nDoes anybody have a quick and dirty way to deal with this that doesn't involve ... |
My program run fine from anywhere else on my drive apart from the Program Files directory (windows XP), I am logged on as administrator so I have full permissions to the drive. It runs fine from the root of c: the windows directory basically anywhere else apart from Program Files. I have recreated this problem on 4 dif... | It sounds like you're encountering a common issue related to the permissions and file security settings in the Program Files directory on Windows. Here are some possible reasons and solutions to your problem:
1. **User Account Control (UAC):** On Windows Vista, and to a lesser extent on Windows XP, User Account Contro... | 43,819 | [
{
"from": "human",
"value": "My program run fine from anywhere else on my drive apart from the Program Files directory (windows XP), I am logged on as administrator so I have full permissions to the drive. It runs fine from the root of c: the windows directory basically anywhere else apart from Program File... |
Let's say that I'm considering designing a WCF service whose primary purpose is to provide broad services that can be used by three disparate applications: a public-facing Web site, an internal Windows Forms application, and a wireless mobile device. The purpose of the service is twofold: (1) to consolidate code relate... | Your scenario and proposed solution are indeed well thought out and make sense given the requirements of the disparate applications and the need for a secure WCF service architecture. Let me summarize your approach and provide additional considerations:
### Summary of Your Approach
1. **Service Centralization**: You ... | 42,288 | [
{
"from": "human",
"value": "Let's say that I'm considering designing a WCF service whose primary purpose is to provide broad services that can be used by three disparate applications: a public-facing Web site, an internal Windows Forms application, and a wireless mobile device. The purpose of the service i... |
I'm trying to set an invalid value to -1.. But I don't like magic numbers.. Anyone know where to find a set of common constants. I'm working in VS6 (ish).
I'm trying to read a file from across a network, and I need a bad value for the total file size,so I know if I got valid info on it.. 0 is a valid size so I can't u... | When working with programming, especially in C or C++ with Win32, it's indeed a good practice to avoid magic numbers for clarity and maintainability. For indicating an invalid file size, you can define a constant in your code instead of using `-1` directly.
For your specific case, you can define a constant like this:
... | 43,189 | [
{
"from": "human",
"value": "I'm trying to set an invalid value to -1.. But I don't like magic numbers.. Anyone know where to find a set of common constants. I'm working in VS6 (ish). \nI'm trying to read a file from across a network, and I need a bad value for the total file size,so I know if I got valid i... |
In Mootools, I'd just run if ($('target')) { ... }. Does if ($('#target')) { ... } in jQuery work the same way?
| In jQuery, the syntax `if ($('#target')) { ... }` does not work exactly the same way as in Mootools.
In Mootools, when you use `$('target')`, it returns a reference to the element with the ID "target" if it exists, or `null` if it does not. Therefore, your check `if ($('target')) { ... }` will correctly evaluate wheth... | 45,301 | [
{
"from": "human",
"value": "In Mootools, I'd just run if ($('target')) { ... }. Does if ($('#target')) { ... } in jQuery work the same way?\n"
},
{
"from": "gpt",
"value": "In jQuery, the syntax `if ($('#target')) { ... }` does not work exactly the same way as in Mootools.\n\nIn Mootools, when... |
The default seems to be upper case, but is there really any reason to use upper case for keywords?
I started using upper case, because I was just trying to match what SQL Server gives me whenever I tried to create something, like a new stored procedure. But then, I felt terrible for my baby (5th) finger, that always ne... | Using uppercase for SQL keywords is largely a matter of personal preference and team or organizational coding standards, but there are some arguments both for and against the practice. Here are some points to consider:
### Arguments for Uppercase:
1. **Readability**: Uppercase keywords can stand out in your code, mak... | 43,400 | [
{
"from": "human",
"value": "The default seems to be upper case, but is there really any reason to use upper case for keywords?\nI started using upper case, because I was just trying to match what SQL Server gives me whenever I tried to create something, like a new stored procedure. But then, I felt terribl... |
I have included <zlib.h> in my iphone application and the source code I was mocking up the sample code of Molecules provided by Brad Larson, however, when I build the project, it returns the error as below. Can anyone point out for me whether this is a library linking problem or am I missing something else?
"_deflate"... | The error messages you are seeing indicate that the linker is unable to find the symbols for the zlib functions like `_deflate`, `_inflate`, etc. This is usually a result of the zlib library not being properly linked in your Xcode project.
Here's how you can resolve this issue:
### Step 1: Add zlib to Your Project
1... | 39,272 | [
{
"from": "human",
"value": "I have included <zlib.h> in my iphone application and the source code I was mocking up the sample code of Molecules provided by Brad Larson, however, when I build the project, it returns the error as below. Can anyone point out for me whether this is a library linking problem o... |
I'm comparing the results produced when i use the 'Make .exe' compared to when i run the exact same process using the exact same variables though the IDE vb 6 debugger.
I've tried an array of different compiler options but to no avail.
So my question is why would i get a difference between the debugger and the 'Make .e... | It's not uncommon to encounter discrepancies between running code in a debugger and running a compiled executable, particularly in environments like Visual Basic 6 (VB6). Here are some common reasons for such differences, along with potential solutions:
### Common Reasons for Differences:
1. **Optimization Settings**... | 43,540 | [
{
"from": "human",
"value": "I'm comparing the results produced when i use the 'Make .exe' compared to when i run the exact same process using the exact same variables though the IDE vb 6 debugger.\nI've tried an array of different compiler options but to no avail.\nSo my question is why would i get a diffe... |
I'm interested in compressing data using Python's gzip module. It happens that I want the compressed output to be deterministic, because that's often a really convenient property for things to have in general -- if some non-gzip-aware process is going to be looking for changes in the output, say, or if the output is g... | You are right that the `gzip` module in Python adds a timestamp to the gzip header, which can lead to non-deterministic output each time you compress the same data. This can be an issue if you're looking for reproducibility, such as for cryptographic signing or other comparison purposes.
However, there is a way to ach... | 38,023 | [
{
"from": "human",
"value": "I'm interested in compressing data using Python's gzip module. It happens that I want the compressed output to be deterministic, because that's often a really convenient property for things to have in general -- if some non-gzip-aware process is going to be looking for changes ... |
I'm trying to work out how to store and then print the current stack in my C++ apps on Mac OS X. The main problem seems to be getting dladdr to return the right symbol when given an address inside the main executable. I suspect that the issue is actually a compile option, but I'm not sure.
I have tried the backtrace co... | It looks like you're on the right track, but you're experiencing issues with `dladdr()` returning incorrect symbol names for the main executable in your application. This is a common issue on macOS and can be caused by several factors. Here's a summary of solutions and suggestions to help you resolve it:
1. **Compile ... | 40,448 | [
{
"from": "human",
"value": "I'm trying to work out how to store and then print the current stack in my C++ apps on Mac OS X. The main problem seems to be getting dladdr to return the right symbol when given an address inside the main executable. I suspect that the issue is actually a compile option, but I'... |
I've used straight Mongrel, I've used Mongrel clusters behind Apache, I've looked at Thin, and I'm becoming very intrigued by Passenger. I've looked at Nginx, too. I've looked at MRI, Ruby Enterprise Edition, Rubinius, and JRuby. There are a lot of options, each claiming to be the new holy grail.
What is the best optio... | Given your constraints and the technologies you’re considering, let's break down your options to help you decide on the best deployment setup for your Rails 2.2 application.
### 1. **Web Server: Apache vs. Nginx**
- **Apache with Passenger**: This is indeed a popular choice for Rails applications. Using the "worker" M... | 41,744 | [
{
"from": "human",
"value": "I've used straight Mongrel, I've used Mongrel clusters behind Apache, I've looked at Thin, and I'm becoming very intrigued by Passenger. I've looked at Nginx, too. I've looked at MRI, Ruby Enterprise Edition, Rubinius, and JRuby. There are a lot of options, each claiming to be t... |
I recently signed up to shared web hosting with godaddy using Linux and PHP 5. I want to work with multiple RSS feeds. I previously had this all functioning under Apache, however, the host supplied the PEAR installation. Now I have to do this myself and I am in unfamiliar territory.I installed PEAR PHP and managed to... | Certainly! When working with PEAR in a shared hosting environment, it's essential to ensure that all dependencies for your packages are correctly installed and accessible.
### Finding and Installing XML_Parser
1. **Locate XML_Parser**: The `XML_Parser.php` is part of the `XML_Parser` PEAR package. You can find it on ... | 39,988 | [
{
"from": "human",
"value": "I recently signed up to shared web hosting with godaddy using Linux and PHP 5. I want to work with multiple RSS feeds. I previously had this all functioning under Apache, however, the host supplied the PEAR installation. Now I have to do this myself and I am in unfamiliar terr... |
I have an html table
<table border="0" width="100%">
<tr class="headerbg">
<th width="5%">
No
</th>
<th width="30%">
Name
</th>
<th width="20%">
Department or Division
</th>
<th... | To extract the name and email information from your HTML table and process it further (e.g., populate a data grid or store it in a database), you can follow these steps in C#. You already have a good start with using `XElement`. Here’s how you can continue from that point.
1. **Load the HTML and Parse It**: After you'... | 42,419 | [
{
"from": "human",
"value": "I have an html table \n <table border=\"0\" width=\"100%\">\n <tr class=\"headerbg\">\n <th width=\"5%\">\n No\n </th>\n <th width=\"30%\">\n Name\n </th>\n <th width=\"20%\">\n ... |
I have a VS2008 installer project which installs a .NET Windows Service. One of the service's dependencies is a .NET assembly which has localized resources in the form of a satellite assembly. The installer is not packaging or installing the satellite assembly for some reason and the service will consequently not sta... | When dealing with Visual Studio 2008 installer projects and satellite assemblies, there are a few steps you can follow to ensure that the satellite assemblies are packaged correctly with your installer:
1. **Verify Satellite Assembly Location**: Ensure that your satellite assembly is correctly located in the appropria... | 43,081 | [
{
"from": "human",
"value": "I have a VS2008 installer project which installs a .NET Windows Service. One of the service's dependencies is a .NET assembly which has localized resources in the form of a satellite assembly. The installer is not packaging or installing the satellite assembly for some reason ... |
I have two tables:
Client(id,name,...)
Purchase(id,item,date,client_id,...)
They have their respective Model, with their validations. What I need is to create a new client with a new purchase, all into the create method of Client controller. Something like this:
def create
@client = Client.new(params[:client])
r... | To achieve what you want in a clean and conventional way in Ruby on Rails, you can take advantage of Active Record transactions. This way, if any part of your operation fails (for example, if the purchase validation fails), the entire operation will be rolled back, and the client won't be created either.
You can refa... | 43,167 | [
{
"from": "human",
"value": "I have two tables:\nClient(id,name,...)\nPurchase(id,item,date,client_id,...)\nThey have their respective Model, with their validations. What I need is to create a new client with a new purchase, all into the create method of Client controller. Something like this:\ndef create ... |
I'd appreciate some feedback on a particular approach I'm thinking of using. The scenario is below.
I have an object (lets call it MObject) that has a number of properties, say, x and y coordinates, height and width. The properties are named according to the KVC guidelines (MObject.x; MObject.height, etc). My next task... | Your scenario presents a common challenge when dealing with data interchange formats like XML, especially when property names differ in casing or structure. Here are a few potential approaches to handle this while adhering to the principles of key-value coding (KVC) and keeping your code manageable.
### 1. Custom Mapp... | 40,054 | [
{
"from": "human",
"value": "I'd appreciate some feedback on a particular approach I'm thinking of using. The scenario is below.\nI have an object (lets call it MObject) that has a number of properties, say, x and y coordinates, height and width. The properties are named according to the KVC guidelines (MOb... |
Hi sometimes i encoutner this error after restarsting sun application server 8.2 domain anyone have any idea what could be the reason?
javax.servlet.ServletException at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:255) at
javax.servlet.http.HttpServlet.service(HttpServlet.java:860) at
sun.ref... | The error you're encountering is a `java.lang.StackOverflowError`, which indicates that a method has been called recursively too many times, causing the call stack to exceed its limit. Based on the stack trace provided, it appears that the problem is related to Java's security framework, specifically how permissions ar... | 41,632 | [
{
"from": "human",
"value": "Hi sometimes i encoutner this error after restarsting sun application server 8.2 domain anyone have any idea what could be the reason?\n\njavax.servlet.ServletException at\n org.apache.jasper.servlet.JspServlet.service(JspServlet.java:255) at\n javax.servlet.http.HttpServle... |
Is there a way other than looping through the Files in a SPFolder to determine if a give filename (string) exists?
| In SharePoint, particularly when working with the SharePoint Client Object Model or using REST API, the most common method to determine if a file exists in a folder is to loop through the files in a `SPFolder` and check for the filename. However, there are more efficient methods available that do not require you to loo... | 44,282 | [
{
"from": "human",
"value": "Is there a way other than looping through the Files in a SPFolder to determine if a give filename (string) exists?\n"
},
{
"from": "gpt",
"value": "In SharePoint, particularly when working with the SharePoint Client Object Model or using REST API, the most common met... |
I'm looking for a basic software for statistical analysis. Most important is simple and intuitive use, getting started "right out of the box". At least basic operations should be interactive. Free would be a bonus :)
The purpose is analysis of data dumps and logs of various processes.
Importing a comma/tab separated... | There are several free and user-friendly software options that can help you with statistical analysis and data manipulation without the complexities you've encountered with Excel. Here are some recommendations:
1. **LibreOffice Calc**:
- **Overview**: A free alternative to Excel, part of the LibreOffice suite.
-... | 40,470 | [
{
"from": "human",
"value": "I'm looking for a basic software for statistical analysis. Most important is simple and intuitive use, getting started \"right out of the box\". At least basic operations should be interactive. Free would be a bonus :) \nThe purpose is analysis of data dumps and logs of various ... |
I have a Windows forms application running on a terminal server. I need to determine the IP addresses of each client machine.
I found a way to retreive the IP address for computers with DNS entries (example below), but several of my thin clients were set up with static IPs and have no DNS name. Is there a way to dete... | In a Windows Forms application running on a terminal server, retrieving the IP addresses of the client machines can be challenging, especially if those clients do not have DNS entries. However, you can use the `System.Net` namespace to get the IP addresses directly from the remote machine using the `System.Net.Sockets`... | 40,550 | [
{
"from": "human",
"value": "I have a Windows forms application running on a terminal server. I need to determine the IP addresses of each client machine.\nI found a way to retreive the IP address for computers with DNS entries (example below), but several of my thin clients were set up with static IPs and... |
I come from the Java world, where you can hide variables and functions and then run unit tests against them using reflection. I have used nested functions to hide implementation details of my classes so that only the public API is visible. I am trying to write unit tests against these nested functions to make sure th... | In Python, you cannot directly access a nested function from outside its enclosing function, as nested functions are scoped to the enclosing function. This is different from how nested functions are treated in some other programming languages. Consequently, trying to access `outer.inner()` as you've shown will raise an... | 42,049 | [
{
"from": "human",
"value": "I come from the Java world, where you can hide variables and functions and then run unit tests against them using reflection. I have used nested functions to hide implementation details of my classes so that only the public API is visible. I am trying to write unit tests again... |
I recently got stuck on an odd problem.
My friend hired a designer to work on a web site for his company. He asked my recommendation about a tool to allow web designer perform secure file transfers so that he can update web site. Since he's hosting on Windows 2003, my immediate recommendation was to enable webdav, whic... | It sounds like you've encountered a series of challenges with traditional file transfer methods for web hosting, particularly with considerations for security and usability. Here are some tools and methods that are commonly used in the industry for secure file transfers, especially for contractors who need access to up... | 41,807 | [
{
"from": "human",
"value": "I recently got stuck on an odd problem.\nMy friend hired a designer to work on a web site for his company. He asked my recommendation about a tool to allow web designer perform secure file transfers so that he can update web site. Since he's hosting on Windows 2003, my immediate... |
Is multiple inheritance possible in VB .Net? If so, what is the syntax?
| In VB.NET, multiple inheritance (the ability for a class to inherit from more than one class) is not supported directly as it is in some other programming languages like C++. This restriction is mainly to avoid the complexities and ambiguities that can arise with the "diamond problem" when classes have multiple base cl... | 44,409 | [
{
"from": "human",
"value": "Is multiple inheritance possible in VB .Net? If so, what is the syntax?\n"
},
{
"from": "gpt",
"value": "In VB.NET, multiple inheritance (the ability for a class to inherit from more than one class) is not supported directly as it is in some other programming langua... |
I'm writing an application which has to be configurable to connect to Oracle, SQL Server and MySQL depending on client whim.
Up till now I'd been planning on using the JDBC-ODBC bridge and just connecting to the databases using different connection strings.
I'm told this is not very efficient.
Is there a pattern or be... | When designing an application that needs to connect to multiple types of databases (Oracle, SQL Server, MySQL), relying on the JDBC-ODBC bridge is generally not advisable, as it can introduce performance bottlenecks and compatibility issues. Instead, consider using a more robust approach that adheres to best practices ... | 39,398 | [
{
"from": "human",
"value": "I'm writing an application which has to be configurable to connect to Oracle, SQL Server and MySQL depending on client whim.\nUp till now I'd been planning on using the JDBC-ODBC bridge and just connecting to the databases using different connection strings.\nI'm told this is no... |
Is there any way to detect, through WSH, which workstations, in a windows domain, has a locked session?
| To detect which workstations in a Windows domain have locked sessions using Windows Script Host (WSH), you typically do not have a direct API call that will tell you if a session is locked or not. However, you can leverage PowerShell in combination with WSH to achieve this. Here's a general approach:
1. **Get List of ... | 42,027 | [
{
"from": "human",
"value": "Is there any way to detect, through WSH, which workstations, in a windows domain, has a locked session?\n"
},
{
"from": "gpt",
"value": "To detect which workstations in a Windows domain have locked sessions using Windows Script Host (WSH), you typically do not have a... |
I want to calculate what is $x percentage of a $total. $x could be 15%, 20%, etc, and $total could be 1000, 2000, etc. So I'd want the 15% of 1000, for example.
What is the formula for calculating this? (I know this isn't exactly a coding question but I'm coding this feature and need help!
| To calculate \( x \) percentage of a \( total \), you can use the following formula:
\[
\text{Result} = \left( \frac{x}{100} \right) \times total
\]
Here's how you can break it down:
- \( x \) is the percentage you want to calculate (e.g., 15 or 20).
- \( total \) is the total amount you are calculating the percenta... | 44,201 | [
{
"from": "human",
"value": "I want to calculate what is $x percentage of a $total. $x could be 15%, 20%, etc, and $total could be 1000, 2000, etc. So I'd want the 15% of 1000, for example.\nWhat is the formula for calculating this? (I know this isn't exactly a coding question but I'm coding this feature an... |
What is the recommended way to embed PDF in HTML?
iFrame?
Object?
Embed?
What does Adobe say itself about it?
In my case, the PDF is generated on the fly, so it can't be uploaded to a third-party solution prior to flushing it.
| When it comes to embedding a PDF in HTML, there are several methods to choose from: `<iframe>`, `<object>`, and `<embed>`. Each has its pros and cons:
### 1. `<iframe>`
- **Usage**: This is the most commonly recommended way to embed a PDF in HTML. It provides a way to embed another document within a webpage.
- **Examp... | 42,378 | [
{
"from": "human",
"value": "What is the recommended way to embed PDF in HTML?\n\niFrame? \nObject? \nEmbed?\n\nWhat does Adobe say itself about it?\nIn my case, the PDF is generated on the fly, so it can't be uploaded to a third-party solution prior to flushing it.\n"
},
{
"from": "gpt",
"value... |
I have a VB class in an .asmx file in Visual Studio 2008:
public class foo
public bla as String
end class
It generates the wsdl value:
<s:complexType name="foo">
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="bla" type="s:string" />
</s:sequence>
</s:complexType>
But what I want the wsdl to gener... | To achieve the desired WSDL output, there are a couple of approaches you can take. Unfortunately, ASP.NET Web Services (.asmx) do not directly support customization of WSDL generation in a straightforward manner. However, here are some potential options:
### Option 1: Custom Attributes
You can create a custom attribut... | 39,643 | [
{
"from": "human",
"value": "I have a VB class in an .asmx file in Visual Studio 2008:\npublic class foo\n public bla as String\nend class\n\nIt generates the wsdl value:\n<s:complexType name=\"foo\">\n <s:sequence>\n <s:element minOccurs=\"0\" maxOccurs=\"1\" name=\"bla\" type=\"s:string\" /> \n </s:s... |
Beyond the official documentation, are there any recommended resources for learning to build jQuery plugins. I'm particularly interested in building plugins for the UI libary.
I've been looking at the source for some of the official ones, but I've found they all look quite different from each other. Many are not well ... | Building jQuery plugins, especially for a UI library, can be a bit daunting at first, but there are several resources and guidelines you can follow to make the process easier. While official documentation is a good starting point, here are some additional resources and concepts to consider:
### Recommended Resources
... | 42,513 | [
{
"from": "human",
"value": "Beyond the official documentation, are there any recommended resources for learning to build jQuery plugins. I'm particularly interested in building plugins for the UI libary. \nI've been looking at the source for some of the official ones, but I've found they all look quite dif... |
I work on a collaboration web app, built with Flex 3, that needs to support multiple languages.
Does anyone know which fonts are best for creating embedded font libraries for Chinese, Korean, Japanese, and Russian languages? I know Arial Unicode MS will do the job, but I don't know if it will do the job best.
Localiz... | When dealing with multi-language support in a Flex 3 application, especially for languages like Chinese, Korean, Japanese, and Russian, choosing the right fonts is crucial for readability and aesthetics. Here are some recommendations for embedded font libraries that can accommodate these languages effectively:
### 1. ... | 43,018 | [
{
"from": "human",
"value": "I work on a collaboration web app, built with Flex 3, that needs to support multiple languages. \nDoes anyone know which fonts are best for creating embedded font libraries for Chinese, Korean, Japanese, and Russian languages? I know Arial Unicode MS will do the job, but I don'... |
I am running a program and want to see what its return code is (since it returns different codes based on different errors).
I know in Bash I can do this by running
echo $?
What do I do when using cmd.exe on Windows?
| In the Windows Command Prompt (cmd.exe), you can check the return code of the last executed command by using the `echo` command along with the special variable `%ERRORLEVEL%`. After running your program, you can type:
```cmd
echo %ERRORLEVEL%
```
This will display the return code of the last command that was executed... | 47,447 | [
{
"from": "human",
"value": "I am running a program and want to see what its return code is (since it returns different codes based on different errors).\nI know in Bash I can do this by running\n\necho $?\n\nWhat do I do when using cmd.exe on Windows?\n"
},
{
"from": "gpt",
"value": "In the Win... |
I have a heap of unit tests that need to check XML outputs.
I have started out comparing strings but this isn't going to scale as formatting and superficial differences get in the way.
What is the easiest way in .NET to evaluate whether the generated XML is semantically the same as what the test expects?
Closed as du... | When comparing XML outputs in .NET, especially to ensure that they are semantically equivalent rather than just identical in string format, using XML-specific comparison methods is key. You can leverage LINQ to XML along with XML serialization features, which provide a more structured approach to comparing XML document... | 41,662 | [
{
"from": "human",
"value": "I have a heap of unit tests that need to check XML outputs.\nI have started out comparing strings but this isn't going to scale as formatting and superficial differences get in the way.\nWhat is the easiest way in .NET to evaluate whether the generated XML is semantically the s... |
How is it possible to get the FxCop custom dictionary to work correctly?
I have tried adding words to be recognised to the file 'CustomDictionary.xml', which is kept in the same folder as the FxCop project file. This does not seem to work, as I still get the 'Identifiers should be spelled correctly' FxCop message, eve... | To get the FxCop custom dictionary to work correctly, follow these steps:
1. **Location of CustomDictionary.xml**: Ensure that the `CustomDictionary.xml` file is located in the same directory as your FxCop project file (.fxcop). The exact path to the project file is important, as FxCop looks for the custom dictionary ... | 44,033 | [
{
"from": "human",
"value": "How is it possible to get the FxCop custom dictionary to work correctly?\nI have tried adding words to be recognised to the file 'CustomDictionary.xml', which is kept in the same folder as the FxCop project file. This does not seem to work, as I still get the 'Identifiers shoul... |
I have this method in my db class
public function query($queryString)
{
if (!$this->_connected) $this->_connectToDb(); //connect to database
$results = mysql_query($queryString, $this->_dbLink) or trigger_error(mysql_error());
return mysql_num_rows($results) > 0 ? mysql_fetch_assoc($results) : ... | You're correct that the current implementation of your `query` method is only returning a single row of results. To return all rows from a query, you'll need to adjust the method to fetch all rows instead of just one.
While there isn't a built-in PHP function that will fetch multiple rows into a specific structure wit... | 40,675 | [
{
"from": "human",
"value": "I have this method in my db class\npublic function query($queryString)\n {\n\n if (!$this->_connected) $this->_connectToDb(); //connect to database\n\n $results = mysql_query($queryString, $this->_dbLink) or trigger_error(mysql_error());\n\n return mysql_num_ro... |
I would like to convert an array if IDs, into a string of comma separated values, to use in a MySQL UPDATE query. How would I do this?
| To convert an array of IDs into a comma-separated string in a programming context (like Python, JavaScript, PHP, etc.) that can be used in a MySQL `UPDATE` query, you can follow these general steps:
### Example in Python
If you have an array of IDs and you want to create a string of comma-separated values, you can us... | 43,516 | [
{
"from": "human",
"value": "I would like to convert an array if IDs, into a string of comma separated values, to use in a MySQL UPDATE query. How would I do this?\n"
},
{
"from": "gpt",
"value": "To convert an array of IDs into a comma-separated string in a programming context (like Python, Jav... |
I'm trying to read data from a.csv file to ouput it on a webpage as text.
It's the first time I'm doing this and I've run into a nasty little problem.
My .csv file(which gets openened by Excel by default), has multiple rows and I read the entire thing as one long string.
like this:
$contents = file_get_contents("files/... | It's great to see that you've made progress with reading the CSV file! It sounds like you've switched from using `file_get_contents` and `split` to using `fgetcsv`, which is a good approach for reading CSV files in PHP. The `fgetcsv` function is specifically designed to read CSV files and handle them correctly.
### Un... | 42,565 | [
{
"from": "human",
"value": "I'm trying to read data from a.csv file to ouput it on a webpage as text.\nIt's the first time I'm doing this and I've run into a nasty little problem.\nMy .csv file(which gets openened by Excel by default), has multiple rows and I read the entire thing as one long string.\nlike... |
Where should one go to be kept updated on all of the security flaws/problems floating around? Specially in the era of open source where we tend to use libraries from everywhere.
| To stay updated on security flaws and vulnerabilities, especially in an era where open source libraries are widely used, consider the following resources:
1. **National Vulnerability Database (NVD)**: A comprehensive database of known vulnerabilities, maintained by the National Institute of Standards and Technology (N... | 41,147 | [
{
"from": "human",
"value": "Where should one go to be kept updated on all of the security flaws/problems floating around? Specially in the era of open source where we tend to use libraries from everywhere.\n"
},
{
"from": "gpt",
"value": "To stay updated on security flaws and vulnerabilities, e... |
I'm looking to use procedurally-generated sound and music in a Flash program I'm writing. I haven't found anything in the ActionScript 3.0 reference manual that shows how to do this. Is this possible? Have any third-party tools been developed that can do this? Or can Flash/ActionScript communicate with external pro... | Procedurally generated sound and music can be a bit challenging to implement directly in ActionScript 3.0 due to its limitations in real-time audio manipulation. However, there are still ways to achieve this, including some third-party libraries and potential workarounds. Here are a few suggestions:
### 1. Use Sound L... | 42,028 | [
{
"from": "human",
"value": "I'm looking to use procedurally-generated sound and music in a Flash program I'm writing. I haven't found anything in the ActionScript 3.0 reference manual that shows how to do this. Is this possible? Have any third-party tools been developed that can do this? Or can Flash/A... |
I want to store a very large amount of vector data on a server and only poll the parts I need at a given point...
This shouldn't be a problem.
Is there any way to take a vector file like an svg file and import it into a database? I could always write an svg parser to import it into my database, but is there any standar... | Storing vector data like SVG files in a database can be done in several ways, and while there is no universally "standard" method specifically for SVG, there are common approaches that you can consider. Here are a few methods to store vector data in a database:
### 1. **Store SVG as Binary or Text**
- **Binary Storag... | 41,037 | [
{
"from": "human",
"value": "I want to store a very large amount of vector data on a server and only poll the parts I need at a given point...\nThis shouldn't be a problem.\nIs there any way to take a vector file like an svg file and import it into a database? I could always write an svg parser to import it... |
I need to create an API that will allow my customer's developers to use a proprietary C module that will be released as a library (think .lib or .so -- not source).
I'd like to make the header as developer-friendly as possible (so I won't need to be), following best practices and providing comments with descriptions, e... | Creating an API that exposes a proprietary C module requires careful planning and execution. Here’s a comprehensive list of considerations across business, technical, and common-sense perspectives to ensure a successful API release:
### Business Considerations
1. **Licensing and Legal Compliance**:
- Define the li... | 39,027 | [
{
"from": "human",
"value": "I need to create an API that will allow my customer's developers to use a proprietary C module that will be released as a library (think .lib or .so -- not source).\nI'd like to make the header as developer-friendly as possible (so I won't need to be), following best practices a... |
I want to salt a hashed username and password (submitted via http POST) in JS on the client-side with a higher-order time value (< 1 minute resolution) to avoid sending the username and password hash as a constant value that could be used for a log-in attempt via POST fabrication by an unauthorized user (i.e. a sniffer... | Salting hashed values, such as passwords or usernames, is a common practice to enhance security by adding randomness. However, it's important to consider the implications of implementing this on the client-side, particularly for sensitive data like usernames and passwords.
### Using Time-Based Salts
When you use a ti... | 43,672 | [
{
"from": "human",
"value": "I want to salt a hashed username and password (submitted via http POST) in JS on the client-side with a higher-order time value (< 1 minute resolution) to avoid sending the username and password hash as a constant value that could be used for a log-in attempt via POST fabricatio... |
I started using a Sql Compact version of my DB and during the development it occured that the DB needs to be accessible over the network.
Cause I wasn't able to find a way to share the SDF file over net without replication I need to import it into SQL Server 2008 (Express).
Any Ideas?
| To migrate your SQL Server Compact (SDF) database to SQL Server 2008 Express, you can follow a series of steps to ensure a smooth transition. Here are the steps you can take:
### 1. Prepare the Environment
- Make sure you have SQL Server 2008 Express installed and running.
- You may want to use SQL Server Management ... | 40,495 | [
{
"from": "human",
"value": "I started using a Sql Compact version of my DB and during the development it occured that the DB needs to be accessible over the network. \nCause I wasn't able to find a way to share the SDF file over net without replication I need to import it into SQL Server 2008 (Express).\nA... |
i am trying to find the best way to display results on my page via an Ajax call using jQuery, do you think the best way is to pass it as JSON or plain text? I have worked with ajax calls before, but not sure which is preferred over the other and for the JSON version what is the best way to read from a JSON file generat... | When deciding whether to use JSON or plain text for your AJAX calls, JSON is generally the preferred option for several reasons:
1. **Structured Data**: JSON allows you to send structured data (e.g., objects, arrays), making it easier to work with complex datasets.
2. **Ease of Use**: JavaScript can easily parse JSON ... | 42,750 | [
{
"from": "human",
"value": "i am trying to find the best way to display results on my page via an Ajax call using jQuery, do you think the best way is to pass it as JSON or plain text? I have worked with ajax calls before, but not sure which is preferred over the other and for the JSON version what is the ... |
I have 6 servers that i need to deploy my ASP.NET web application to. While deploying enhancements, I usually remove 3 from the cluster, deploy the app, put them back in rotation, and remove the other 3 and do the same.
What is the best practise that you would follow to minimize/eliminate any customer impact when you... | To minimize or eliminate customer impact during deployments, especially with multiple servers, you can adopt a rolling deployment strategy along with certain best practices. Here’s a step-by-step guide to help you with that:
### 1. **Use a Staging Environment**
- Before deploying to production, always deploy your c... | 43,594 | [
{
"from": "human",
"value": "I have 6 servers that i need to deploy my ASP.NET web application to. While deploying enhancements, I usually remove 3 from the cluster, deploy the app, put them back in rotation, and remove the other 3 and do the same. \nWhat is the best practise that you would follow to minim... |
I have a database with one table, like so:
UserID (int), MovieID (int), Rating (real)
The userIDs and movieIDs are large numbers, but my database only has a sample of the many possible values (4000 unique users, and 3000 unique movies)
I am going to do a matrix SVD (singular value decomposition) on it, so I want to re... | To convert your database of ratings into the desired format for matrix SVD, you'll need to first create an ordered list of users and movies, and then construct a two-dimensional array that includes the ratings or null values for the user-movie pairs.
Here's a step-by-step approach to achieve this:
1. **Fetch Unique U... | 37,922 | [
{
"from": "human",
"value": "I have a database with one table, like so:\nUserID (int), MovieID (int), Rating (real)\n\nThe userIDs and movieIDs are large numbers, but my database only has a sample of the many possible values (4000 unique users, and 3000 unique movies)\nI am going to do a matrix SVD (singula... |
I'm working on an ASP.NET page, using VB.NET and I have this hierarchy:
Page A
- Web User Control 1
- Web User Control A
- Web User Control B
- Web User Control C
I need to raise an event from Web User Control B that Page A will receive (the event flow will be Web User Control B -> Web User Control 1... | To raise an event from Web User Control B that Page A will receive, it's a common practice to use events and event handling in a structured way. While your first approach of raising the event twice is functional, it can indeed feel cumbersome. Here's a cleaner way to handle the event propagation using event delegates.
... | 41,790 | [
{
"from": "human",
"value": "I'm working on an ASP.NET page, using VB.NET and I have this hierarchy:\nPage A \n - Web User Control 1 \n - Web User Control A \n - Web User Control B \n - Web User Control C \nI need to raise an event from Web User Control B that Page A will receive (the event flow w... |
I'm working on a PyGTK/glade application that currently has 16 windows/dialogs and is about 130KB, and will eventually have around 25 windows/dialogs and be around 200KB. Currently, I'm storing all the windows in one monolithic glade file. When I run a window I call it like...
self.wTree = gtk.glade.XML("interface.gl... | When deciding whether to use a single monolithic Glade file or to split your windows/dialogs into multiple Glade files, both approaches have their pros and cons. Here's a detailed breakdown to help you make an informed decision:
### Pros of Using a Single Glade File
1. **Simplicity**: Managing one file can be simpler ... | 40,289 | [
{
"from": "human",
"value": "I'm working on a PyGTK/glade application that currently has 16 windows/dialogs and is about 130KB, and will eventually have around 25 windows/dialogs and be around 200KB. Currently, I'm storing all the windows in one monolithic glade file. When I run a window I call it like...... |
The rails books and web pages I've been following have all stuck to very simple projects for the sake of providing complete examples. I'm moving away from the small project app and into a realm of non-browser clients and need to decide where to put code that is shared by all involved parties.
The non-browser client is... | In a Rails application, shared code that needs to be accessible to both your web server (the Rails app) and your non-browser client (the script) should ideally be organized in a way that maintains separation of concerns while still being easily accessible. Here are a few recommended approaches:
### 1. Create a Shared ... | 43,163 | [
{
"from": "human",
"value": "The rails books and web pages I've been following have all stuck to very simple projects for the sake of providing complete examples. I'm moving away from the small project app and into a realm of non-browser clients and need to decide where to put code that is shared by all in... |
I want to use libgadu (library of instant messaging protocol) under Visual Studio 2008.
I have downloaded libgadu http://toxygen.net/libgadu/files/libgadu-1.8.2.tar.gz and under cygwin I've compiled it - ./configure , make , make install.
File libgadu.h which appeard in include folder I copied to another folder which i... | The errors you're encountering are linker errors, which typically indicate that the compiler can't find the implementation of the functions you've declared in your code. In your case, the `gg_login` function and potentially others from the libgadu library are not being linked correctly.
Here's a step-by-step guide to ... | 42,290 | [
{
"from": "human",
"value": "I want to use libgadu (library of instant messaging protocol) under Visual Studio 2008.\nI have downloaded libgadu http://toxygen.net/libgadu/files/libgadu-1.8.2.tar.gz and under cygwin I've compiled it - ./configure , make , make install.\nFile libgadu.h which appeard in includ... |
A classic ASP.NET app - AppSrv + MS SQL DB. Both servers are heavy-lifters 8 cores, 20 GB of RAM. When load testing, the throughput goes somewhere to 400 VirtualUsers (according to LoadRunner) with CPU being approximately 30% utilized an DB server primarily idling - response times go dramatically up, to the point of un... | When faced with performance issues in a classic ASP.NET application under load, and the typical suspects have been ruled out, there are several areas you could investigate further. Here are some suggestions to help diagnose and potentially resolve the issue:
### 1. **Application Bottlenecks**
- **Long-running Requests... | 33,848 | [
{
"from": "human",
"value": "A classic ASP.NET app - AppSrv + MS SQL DB. Both servers are heavy-lifters 8 cores, 20 GB of RAM. When load testing, the throughput goes somewhere to 400 VirtualUsers (according to LoadRunner) with CPU being approximately 30% utilized an DB server primarily idling - response tim... |
I currently have a list view which has several rows of data and I have a contextmenustrip in C# .NET.
What I am having problems with is when you click on the menu strip item I want to know which row has been selected.
| In a WinForms application using a `ListView` with a `ContextMenuStrip`, you can determine which row (or item) was selected when a menu item is clicked by utilizing the `ContextMenuStrip`'s `Opening` event to store the selected item before showing the context menu. Then, you can access the selected item when handling th... | 42,050 | [
{
"from": "human",
"value": "I currently have a list view which has several rows of data and I have a contextmenustrip in C# .NET.\nWhat I am having problems with is when you click on the menu strip item I want to know which row has been selected.\n"
},
{
"from": "gpt",
"value": "In a WinForms a... |
What are release notes for and who reads them? Should/could they be automated by just spitting out bug fixes for the current release, or do they warrant careful human editing?
So, anybody with a link to best practices(reasoning behind) in regards to software release notes?
| Release notes are a critical communication tool in the software development lifecycle. They serve multiple purposes and are read by various stakeholders. Here’s a breakdown of their significance, target audience, and best practices:
### Purpose of Release Notes
1. **Communication**: Release notes inform users about w... | 40,391 | [
{
"from": "human",
"value": "What are release notes for and who reads them? Should/could they be automated by just spitting out bug fixes for the current release, or do they warrant careful human editing? \nSo, anybody with a link to best practices(reasoning behind) in regards to software release notes?\n"
... |
I am preparing a project proposal for a client who wants to publish video in his website. I need to define which video formats will be allowed, which video sizes, as well as the necessary tools for conversion and preparation.
I have no experience with embedding video in websites so which markup do I need to play video... | When preparing a project proposal for video publication on a client's website, you'll want to cover several key areas, including video formats, sizes, tools for conversion, and the markup required to embed videos. Here’s a comprehensive guide:
### 1. Allowed Video Formats
For web video, the following formats are widel... | 41,499 | [
{
"from": "human",
"value": "I am preparing a project proposal for a client who wants to publish video in his website. I need to define which video formats will be allowed, which video sizes, as well as the necessary tools for conversion and preparation. \nI have no experience with embedding video in websit... |
This one has me beat;
I have a WPF window with two (important for this case) controls, both from the WPF toolkit available at CodePlex; A DatePicker and a DataGrid.
The DataContext of this window is set to a CLR object that has all the information it needs. This CLR object has a large list of data, and a method called ... | To achieve the desired behavior where the DataGrid automatically updates its contents based on the selected date in the DatePicker, you can use data binding and an `ObjectDataProvider` combined with a property in your view model that listens to the selected date changes. Here's a step-by-step approach to set this up.
... | 39,455 | [
{
"from": "human",
"value": "This one has me beat;\nI have a WPF window with two (important for this case) controls, both from the WPF toolkit available at CodePlex; A DatePicker and a DataGrid.\nThe DataContext of this window is set to a CLR object that has all the information it needs. This CLR object has... |
In vc++ i am using MScomm for serial communication,
i received data in this format 02120812550006050.0,
i am not gettng how to read this ,in which format it is,
begning starting frame and at the end ending file, remaing i dont know.
EDIT 1:
it contains date time and data how i can seperate this one
| To analyze the received data format `02120812550006050.0`, let's break it down into its components based on your description that it contains date, time, and data.
### Possible Structure of the Data
From the string `02120812550006050.0`, we can infer the following structure:
1. **Date**: The first part `021208` coul... | 40,816 | [
{
"from": "human",
"value": "In vc++ i am using MScomm for serial communication,\ni received data in this format 02120812550006050.0,\ni am not gettng how to read this ,in which format it is,\nbegning starting frame and at the end ending file, remaing i dont know.\nEDIT 1:\nit contains date time and data h... |
I have a Java service which now will execute in a batch mode. Multi threaded support is added to the service so for every batch request a thread pool will be dedicated to execute the batch. The question is how do I test this? I have functional tests that pass under the threaded version of the service but, somehow, I fe... | Testing a multi-threaded service, especially one that handles batch requests, requires a thoughtful approach to ensure both correctness and reliability. Here are some strategies and techniques you can use to effectively test your Java service:
### 1. **Unit Tests with Mocking**
Use mocking frameworks like Mockito to i... | 41,315 | [
{
"from": "human",
"value": "I have a Java service which now will execute in a batch mode. Multi threaded support is added to the service so for every batch request a thread pool will be dedicated to execute the batch. The question is how do I test this? I have functional tests that pass under the threaded ... |
I'm working on a website with a em-based layout (so it can stretch and compress gracefully when users increase or decrease font size). This site has a header that should be displayed across all pages. I have a "header" div in all pages, and the site-wide css file includes the code:
#header
{
width: 50em;
heig... | To make your header image stretch and shrink along with your header div, you can use the CSS `background-size` property. This property allows you to define how the background image behaves when the size of the element changes.
You can achieve the desired effect by updating your `#header` CSS rule as follows:
```css
#... | 43,535 | [
{
"from": "human",
"value": "I'm working on a website with a em-based layout (so it can stretch and compress gracefully when users increase or decrease font size). This site has a header that should be displayed across all pages. I have a \"header\" div in all pages, and the site-wide css file includes th... |
I have an <ItemsControl> with a custom <DataTemplate> (and also a custom <ItemsPanelTemplate> that is just a WrapPanel), bound via ItemsSource to a simple observable collection of strings.
The DataTemplate consists simply of an instance of a custom UserControl whose properties are bound to the string via {Binding}.
The... | To access your custom UserControl instances in a WPF `ItemsControl`, you need to drill down from the `ContentPresenter` returned by `ItemContainerGenerator.ContainerFromIndex()` to get to the actual visual child that is your UserControl.
Here's how you can do that:
1. **Retrieve the ContentPresenter** for the item us... | 43,900 | [
{
"from": "human",
"value": "I have an <ItemsControl> with a custom <DataTemplate> (and also a custom <ItemsPanelTemplate> that is just a WrapPanel), bound via ItemsSource to a simple observable collection of strings.\nThe DataTemplate consists simply of an instance of a custom UserControl whose properties ... |
I am the programmer for the Education department at a county hospital. I would like to be able to see some real-time stats on an IIS6 web server that is only accessible in-house. I'm looking for something similar to what 1and1.com provides for their customers (if you're familiar with what they offer).
I have a Classic ... | To achieve the analytics functionality you’re looking for on your Classic ASP/VBScript-based Learning Management System, you can implement a custom solution tailored to your requirements. Below are steps and suggestions to build a system that meets your needs without requiring external dependencies:
### 1. **Logging U... | 41,510 | [
{
"from": "human",
"value": "I am the programmer for the Education department at a county hospital. I would like to be able to see some real-time stats on an IIS6 web server that is only accessible in-house. I'm looking for something similar to what 1and1.com provides for their customers (if you're familiar... |
I am working on a project that I need to use the Infragistics WebGrid control for some lists of data. I am loading the data on the client-side using JavaScript for display on a Map, and then I need to display that same data within multiple WebGrids. All the data available will be displayed in the WebGrids, but only a s... | Using Infragistics WebGrid (now known as Ignite UI) in conjunction with client-side JavaScript and AJAX is a great approach to ensure that you're efficiently managing your data without making redundant requests to your server. Here's a general approach and some tips to help you get started.
### Steps to Use WebGrid wi... | 40,832 | [
{
"from": "human",
"value": "I am working on a project that I need to use the Infragistics WebGrid control for some lists of data. I am loading the data on the client-side using JavaScript for display on a Map, and then I need to display that same data within multiple WebGrids. All the data available will b... |
I've some experiences on build application with Asp.Net, but now MVC frameworks become more popular. I would like to try building new multilingual web application using with Asp.Net MVC or Castle MonoRail but I don't know which one is good for me. I don't like the web form view engine, but I like routing feature in Asp... | When it comes to building a multilingual web application using ASP.NET, you have a couple of popular frameworks to choose from: ASP.NET MVC and Castle MonoRail. Both have their own sets of advantages and disadvantages.
### ASP.NET MVC
#### Pros:
1. **Popularity and Community Support**: ASP.NET MVC is widely adopted a... | 34,337 | [
{
"from": "human",
"value": "I've some experiences on build application with Asp.Net, but now MVC frameworks become more popular. I would like to try building new multilingual web application using with Asp.Net MVC or Castle MonoRail but I don't know which one is good for me. I don't like the web form view ... |
My current project involves deploying an upgraded .exe file that runs as a Windows Service. In order to overwrite the existing .exe with the new version, I currently need to:
Stop the service
Uninstall the service
Reboot the system (so Windows releases it's hold on the file)
Deploy the new .exe
Reinstall the service
... | To deploy an upgraded .exe file that runs as a Windows Service without rebooting, you can typically follow these steps. It's important to ensure that you are properly stopping and uninstalling the service so that the operating system releases its hold on the executable file. Here are some methods to avoid the need for ... | 43,384 | [
{
"from": "human",
"value": "My current project involves deploying an upgraded .exe file that runs as a Windows Service. In order to overwrite the existing .exe with the new version, I currently need to:\n\nStop the service\nUninstall the service\nReboot the system (so Windows releases it's hold on the fil... |
Here is a simple scenario with table characters:
CharacterName GameTime Gold Live
Foo 10 100 3
Foo 20 100 2
Foo 30 95 2
How do I get this output for the query SELECT Gold, Live FROM characters WHERE name = 'Foo' ORDER BY GameTime:
Gold Live
100 3
0 -1
-5 0
using MySQL stored procedure (or query) if it's even possib... | It is indeed possible to achieve this result in MySQL using a stored procedure. Since MySQL doesn't support array types, we can use variables to hold intermediate values and then create a temporary table to store the results as we calculate them.
Below is a step-by-step approach to create a MySQL stored procedure that... | 40,901 | [
{
"from": "human",
"value": "Here is a simple scenario with table characters:\nCharacterName GameTime Gold Live\nFoo 10 100 3 \nFoo 20 100 2 \nFoo 30 95 2\n\nHow do I get this output for the query SELECT Gold, Live FROM characters WHERE name = 'Foo' ORDER BY GameTime:\nGold Live\n100 3\n0 -1\n-5 0\n\nusing ... |
I am working on an ASP.NET MVC application that contains a header and menu on each page. The menu and header are dynamic. In other words, the menu items and header information are determined at runtime.
My initial thought is to build a base Controller from which all other controllers derive. In the base controller, ... | Your approach to managing dynamic headers and menus in an ASP.NET MVC application using a base controller is a common and effective strategy. Here’s a detailed outline of best practices and recommendations that can help you implement this functionality efficiently.
### 1. Base Controller Approach
Creating a base cont... | 40,177 | [
{
"from": "human",
"value": "I am working on an ASP.NET MVC application that contains a header and menu on each page. The menu and header are dynamic. In other words, the menu items and header information are determined at runtime.\nMy initial thought is to build a base Controller from which all other con... |
I have a class like so:
public class ClassA
{
public bool MethodA()
{
//do something complicated to test requiring a lot of setup
}
public bool MethodB()
{
if (MethodA())
//do something
else
//do something else
endif
}
}
I have tests fo... | Yes, you can certainly use Rhino Mocks to test `MethodB` without needing to set up all the same mocks that you have in the tests for `MethodA`. What you're looking to do is isolate `MethodA` so that you can control its output for your tests of `MethodB`. This is a common practice called "method isolation" where you moc... | 41,386 | [
{
"from": "human",
"value": "I have a class like so:\npublic class ClassA\n{\n public bool MethodA()\n {\n //do something complicated to test requiring a lot of setup\n }\n public bool MethodB()\n {\n if (MethodA())\n //do something\n else\n //do s... |
I'm trying to import some data from Excel to SQL Server, I have a TEXT column with some numbers in it, some of the numbers go over just fine, and some turn into scientific form.
Column in Excel is "text" type, column in the target sql table is varchar(255)
Here are some examples:
Excel [text] -> SQL Server [varcha... | It looks like you've already found a solution by formatting the column in Excel as a number with leading zeros. That's a good approach, especially since you have fixed-length 10-digit numbers. However, if you encounter similar issues in the future or need to deal with other types of data, here are a few additional tips... | 42,031 | [
{
"from": "human",
"value": "I'm trying to import some data from Excel to SQL Server, I have a TEXT column with some numbers in it, some of the numbers go over just fine, and some turn into scientific form.\nColumn in Excel is \"text\" type, column in the target sql table is varchar(255)\nHere are some exam... |
I have a series of forms that I need a user to complete in sequence, which is perfect for the formwizard app. However, I've some need of the admin application also and would like to set the whole thing up to trigger several forms within the admin app.
Is it possible/easy to integrate a 'formwizard' into the admin appl... | Integrating a form wizard directly into Django's admin application can be challenging, as the admin is designed primarily for CRUD (Create, Read, Update, Delete) operations rather than more complex user interactions like multi-step forms. However, there are a few approaches you can take to achieve your goal:
### 1. Us... | 41,998 | [
{
"from": "human",
"value": "I have a series of forms that I need a user to complete in sequence, which is perfect for the formwizard app. However, I've some need of the admin application also and would like to set the whole thing up to trigger several forms within the admin app. \nIs it possible/easy to in... |
I am doing my best to design my web app with good separation between the layers. I am using the repository pattern and as such have a SQLObjectRepository which is called by my ObjectService which is called by my Web front end.
In my object model, the user is associated with one or more regions which should filter the ... | When designing your web application with a clear separation of concerns, it’s important to think about where to place the logic for permission checking and data filtering. Let’s address your questions step by step.
### 1. Where to Implement Permissions Logic
**Repository vs. Service Layer**
- **Repository Layer**: T... | 42,574 | [
{
"from": "human",
"value": "I am doing my best to design my web app with good separation between the layers. I am using the repository pattern and as such have a SQLObjectRepository which is called by my ObjectService which is called by my Web front end.\nIn my object model, the user is associated with on... |
I have a custom XML schema defined for page display that puts elements on the page by evaluating XML elements on the page. This is currently implemented using the preg regex functions, primarily the excellent preg_replace_callback function, eg:
...
$s = preg_replace_callback("!<field>(.*?)</field>!", replace_field, $s... | To effectively handle your XML transformation needs, especially in the context of conditional evaluations and nested elements, you should consider using an XML parsing library that allows you to work with XML as structured data rather than using regular expressions. Below are some libraries and tools, along with approa... | 42,376 | [
{
"from": "human",
"value": "I have a custom XML schema defined for page display that puts elements on the page by evaluating XML elements on the page. This is currently implemented using the preg regex functions, primarily the excellent preg_replace_callback function, eg:\n...\n$s = preg_replace_callback(... |
I'm trying to get a JEditorPane to highlight the full width of a displayed line. All the examples I've tried only highlight the textual content. For example if I have content such as this:
---------------------------------
|Here is some text |
|some more text |
-----------------------... | To achieve full-width highlighting of a line in a `JEditorPane`, you can utilize the `Highlighter` class in conjunction with a custom `Highlighter.HighlightPainter`. The goal is to create a custom painter that draws a highlight rectangle extending the entire width of the `JEditorPane` for the specified line.
Here's an... | 42,317 | [
{
"from": "human",
"value": "I'm trying to get a JEditorPane to highlight the full width of a displayed line. All the examples I've tried only highlight the textual content. For example if I have content such as this:\n ---------------------------------\n|Here is some text |\n|some more text ... |
I am developing a .NET CF 3.5 network game. My issue is the app loads all the resources at first instance. However upon subsequent launches, the app gives me memory out of exception while loading resources especially sounds or big images.
Please guide me
| When developing applications for .NET Compact Framework (CF), especially for games or applications that use a significant amount of resources like images and sounds, running into memory issues can be quite common. Here are some strategies to help you manage resources more effectively and avoid the `OutOfMemoryException... | 43,215 | [
{
"from": "human",
"value": "I am developing a .NET CF 3.5 network game. My issue is the app loads all the resources at first instance. However upon subsequent launches, the app gives me memory out of exception while loading resources especially sounds or big images.\nPlease guide me\n"
},
{
"from":... |
I'm trying to use System.Transaction.TransactionScope to create a transaction to call a few stored procedures but it doesn't seem to clean up after itself. Once the transaction is finished (commited or not and the transaction scope object is disposed) subsequent connections to the database open up with the read commit ... | The issue you are experiencing with the `TransactionScope` and the isolation level defaulting to `Serializable` can arise from how `TransactionScope` manages ambient transactions in .NET. When you create a `TransactionScope`, it may escalate the transaction isolation level if it determines that multiple connections are... | 43,780 | [
{
"from": "human",
"value": "I'm trying to use System.Transaction.TransactionScope to create a transaction to call a few stored procedures but it doesn't seem to clean up after itself. Once the transaction is finished (commited or not and the transaction scope object is disposed) subsequent connections to t... |
I have a UIViewController that manages the display of some data. When the user wants to edit this data I push an edit UIViewController onto the stack. When the user is finished editing the top view controller is popped off the stack. What is the most elegant way to know that I need to update my display after the edit v... | You're on the right track by considering the appropriate places to handle updates after editing the data. However, instead of using `viewDidLoad`, or relying on `UINavigationController` delegation, a cleaner and more elegant solution would be to leverage the delegation pattern or notifications.
### Option 1: Delegatio... | 38,194 | [
{
"from": "human",
"value": "I have a UIViewController that manages the display of some data. When the user wants to edit this data I push an edit UIViewController onto the stack. When the user is finished editing the top view controller is popped off the stack. What is the most elegant way to know that I n... |
Last try to get an answer on this.
I have a simple ASP.NET app which uses Hibernate for data access.
GUI can call methods on Customer object like "CalculateTotalSumOfOrders()".
Lazy loading (even though it's not optimal) will work for me, and when Orders and OrderLines collections are referenced in the domain objects, ... | When transitioning your ASP.NET application with Hibernate for data access to a Silverlight application, it's important to consider how to retrieve and manage data efficiently since Silverlight operates in a browser environment and has different data access patterns.
Here are some strategies you can employ to facilita... | 42,663 | [
{
"from": "human",
"value": "Last try to get an answer on this.\nI have a simple ASP.NET app which uses Hibernate for data access.\nGUI can call methods on Customer object like \"CalculateTotalSumOfOrders()\".\nLazy loading (even though it's not optimal) will work for me, and when Orders and OrderLines coll... |
does anyone know if there is a simple way to bind a textblock to a List.
What I've done so far is create a listview and bind it to the List and then I have a template within the listview that uses a single textblock.
what I'd really like to do is just bind the List to a textblock and have it display all the lines.
In W... | In WPF, unlike WinForms, there is no direct `Lines` property for a `TextBlock` or `TextBox` that accepts a list of strings. However, you can achieve a similar effect by concatenating the strings in your list into a single string with line breaks and then binding that string to a `TextBlock` or `TextBox`.
Here’s how yo... | 42,218 | [
{
"from": "human",
"value": "does anyone know if there is a simple way to bind a textblock to a List.\nWhat I've done so far is create a listview and bind it to the List and then I have a template within the listview that uses a single textblock.\nwhat I'd really like to do is just bind the List to a textbl... |
The following code is just a simplified example to demonstrate my problem:
using System;
using System.IO;
using System.Diagnostics;
using System.Threading;
namespace ConsoleApplication5
{
class Program
{
static string LogFile = @"C:\test.log";
static void Main(string[] args)
{
... | The issue you're facing is related to the way the `StreamWriter` is used in a multithreaded environment, especially when multiple threads (or processes in your real code) attempt to write to the same file concurrently.
The `StreamWriter` does not automatically handle concurrent writes from multiple threads or processe... | 43,158 | [
{
"from": "human",
"value": "The following code is just a simplified example to demonstrate my problem:\nusing System;\nusing System.IO;\nusing System.Diagnostics;\nusing System.Threading;\n\nnamespace ConsoleApplication5\n{\n class Program\n {\n static string LogFile = @\"C:\\test.log\";\n\n ... |
On my home network I have an installation of Windows Server 2008 and for some reason, the windows vista workstations on the network can connect to the server via remote desktop only via the server's IP address, not the hostname. Same for connecting to an instance of SQL Server 2008 that's on the server, only works by ... | The issue you're experiencing, where the Windows Vista workstations can connect to the Windows Server 2008 using the IP address but not the hostname for Remote Desktop and SQL Server connections, can often be attributed to a couple of common network configuration problems. Here are some potential causes and troubleshoo... | 43,675 | [
{
"from": "human",
"value": "On my home network I have an installation of Windows Server 2008 and for some reason, the windows vista workstations on the network can connect to the server via remote desktop only via the server's IP address, not the hostname. Same for connecting to an instance of SQL Server ... |
What are you guys using as reporting engine in .net, with end user designing capabilities?
I tried DevExpress XtraReports, but i am not able to successfully achieve consistent results.
(for example, i try to display a detailreport of sold machines for a certain contact -> first field works fine, other fields don't; n... | If you're looking for a reporting solution in .NET that includes end-user design capabilities and allows users to modify report layouts without extensive IT knowledge, there are several alternatives to DevExpress XtraReports that you can consider:
### 1. **Telerik Reporting**
- **End User Designer**: Telerik offers an... | 41,942 | [
{
"from": "human",
"value": "What are you guys using as reporting engine in .net, with end user designing capabilities?\nI tried DevExpress XtraReports, but i am not able to successfully achieve consistent results. \n(for example, i try to display a detailreport of sold machines for a certain contact -> fir... |
When working with MSSQL on Windows I was used to a very convenient feature called integrated authentication. In short, being authenticated in Windows can give you access to the database, so no need to give any specific password. Now I am developing an application on Linux with no user interaction; this application need... | You're correct in your understanding that MySQL's root user is not tied to the Linux system's root user and that hardcoding a password in your application can be a security risk. There are a few strategies you can employ to manage MySQL authentication securely in a non-interactive, Linux environment:
### 1. Use MySQL ... | 43,737 | [
{
"from": "human",
"value": "When working with MSSQL on Windows I was used to a very convenient feature called integrated authentication. In short, being authenticated in Windows can give you access to the database, so no need to give any specific password. Now I am developing an application on Linux with n... |
I have been attempting to create a new directory for my apache server. As I tried to access the new directory, I type:
sudo /etc/init.d/apache2 restart
But I obtain this error in the Ubuntu Terminal:
Syntax Error on line 1 of /etc/apache2/conf.d/fqdn.save:
ServerName takes one argument, the Hostname and port of the ser... | To resolve the issue with the Apache server and the syntax error you're encountering, you'll want to delete or fix the offending `fqdn.save` file. Here’s how you can do that:
### Steps to Delete the `fqdn.save` File
1. **Open Terminal**: If you haven't already, open your terminal.
2. **Access the Directory**: Naviga... | 42,525 | [
{
"from": "human",
"value": "I have been attempting to create a new directory for my apache server. As I tried to access the new directory, I type:\nsudo /etc/init.d/apache2 restart\nBut I obtain this error in the Ubuntu Terminal:\nSyntax Error on line 1 of /etc/apache2/conf.d/fqdn.save:\nServerName takes o... |
We have a layered application, or at least is in the process of transitioning to one, broken down as follows:
Interface (user-interface or application-interface, ie. webservice, etc.)
Business logic
Data access
To make the rest of this question more concrete, I'll describe a specific instance.
We have a user interfac... | You're grappling with a common design challenge in layered application architectures: maintaining separation of concerns while providing flexibility for different interfaces to consume data in ways that meet their specific needs. Below, I will discuss your options and suggest additional approaches.
### 1. Understand Y... | 43,631 | [
{
"from": "human",
"value": "We have a layered application, or at least is in the process of transitioning to one, broken down as follows:\n\nInterface (user-interface or application-interface, ie. webservice, etc.)\nBusiness logic\nData access\n\nTo make the rest of this question more concrete, I'll descri... |
I have been using TortoiseSVN, svn, and subclipse and I think I understand the basics, but there's one thing that's been bugging me for a while: Merging introduces unwanted code. Here's the steps.
trunk/test.txt@r2. A test file was created with 'A' and a return:
A
[EOF]
branches/TRY-XX-Foo/test.txt@r3. Branched out th... | When you merge in Subversion (SVN), it operates on the notion of merging changes between revisions and applies all changes made in the specified range. In your case, when you merged revisions 4 to 5 from your branch, SVN applied both changes (the unwanted change B from r4 and the important bug fix C from r5).
To avoid... | 42,054 | [
{
"from": "human",
"value": "I have been using TortoiseSVN, svn, and subclipse and I think I understand the basics, but there's one thing that's been bugging me for a while: Merging introduces unwanted code. Here's the steps.\ntrunk/test.txt@r2. A test file was created with 'A' and a return:\nA\n[EOF]\n\nbr... |
I've just started learning linq and lambda expressions, and they seem to be a good fit for finding duplicates in a complex object collection, but I'm getting a little confused and hope someone can help put me back on the path to happy coding.
My object is structured like list.list.uniqueCustomerIdentifier
I need to ens... | Certainly! To find duplicates in a collection of complex objects using LINQ and lambda expressions, you can follow these steps:
1. Flatten the structure to get all the `uniqueCustomerIdentifier`s from the nested lists.
2. Group them and identify which ones have duplicates.
3. Return a list of those duplicates.
Let's ... | 22,625 | [
{
"from": "human",
"value": "I've just started learning linq and lambda expressions, and they seem to be a good fit for finding duplicates in a complex object collection, but I'm getting a little confused and hope someone can help put me back on the path to happy coding.\nMy object is structured like list.l... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.