instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
In dopplr [http://www.dopplr.com] there is an option to fill the city of travel and the site will automatically find the city around the world. Is there any web service or database for such a city lookup?
| Yes, there are several web services and databases available that can help with city lookups and geolocation. Here are a few options you might consider:
1. **GeoNames**: GeoNames is a geographical database that covers all countries and contains over eleven million placenames. It offers a web service where you can searc... | 38,919 | [
{
"from": "human",
"value": "In dopplr [http://www.dopplr.com] there is an option to fill the city of travel and the site will automatically find the city around the world. Is there any web service or database for such a city lookup?\n"
},
{
"from": "gpt",
"value": "Yes, there are several web se... |
I'm trying to implement some hooks, both pre and post fail however. I get the same error message for both when I try to commit:
'*-commit' hook failed (did not exit cleanly: apr_exit_why_e was 2, exitcode was
-1073741515). with no output.
Exitcode -1073741515 looks to be an odd one, and a quick bit of google-fu go... | It looks like you're dealing with a problem related to a missing DLL when trying to execute the `SubversionNotify.exe` during your pre-commit hook. The exit code `0xC0000135` indeed indicates that a DLL required for the executable to run is missing.
Here are some steps to help you troubleshoot and resolve this issue:
... | 37,827 | [
{
"from": "human",
"value": "I'm trying to implement some hooks, both pre and post fail however. I get the same error message for both when I try to commit:\n\n'*-commit' hook failed (did not exit cleanly: apr_exit_why_e was 2, exitcode was\n-1073741515). with no output.\n\nExitcode -1073741515 looks to ... |
I have a situation where I want to copy the output assembly from one project into the output directory of my target application using MSBuild, without hard-coding paths in my MSBuild Copy task. Here's the scenario:
Project A - Web Application Project
Project B - Dal Interface Project
Project C - Dal Implementation Pro... | To achieve your goal of copying the output assembly from Project C (Dal Implementation) to the output directory of Project A (Web Application Project) without hard-coding paths in MSBuild, you can leverage the `ProjectReference` outputs within your MSBuild targets.
Here’s a step-by-step guide on how to set this up usi... | 34,204 | [
{
"from": "human",
"value": "I have a situation where I want to copy the output assembly from one project into the output directory of my target application using MSBuild, without hard-coding paths in my MSBuild Copy task. Here's the scenario:\n\nProject A - Web Application Project\nProject B - Dal Interfac... |
I have an ARM kit beside me and a Linux kernel source code patched with Xenomai on my machine. I understand I can send data to the kit through an USB cable and a (windows-based, of course) software, but I'm stumped as to exactly what I should be sending that would make the kit run Linux.
(clarifications from comments: ... | To run Linux on your Atmel AT91SAM9260-EK kit using SAM-BA (SAM Bootloader Application), you will need to follow a series of steps. Here’s a detailed guide on what you need to do:
### 1. Prepare the Linux Kernel
1. **Build the Linux Kernel**:
- Ensure you have configured the kernel appropriately for the AT91SAM926... | 35,964 | [
{
"from": "human",
"value": "I have an ARM kit beside me and a Linux kernel source code patched with Xenomai on my machine. I understand I can send data to the kit through an USB cable and a (windows-based, of course) software, but I'm stumped as to exactly what I should be sending that would make the kit r... |
This has been troubling me for a few years, and was recently exacerbated by the introduction of Windows Vista (driver requirements & UAC restrictions being major factors).
There are many different flavours of Windows Vista (compared here), and there are also the alternative options (running Windows Server as a worksta... | Choosing the best operating system for Microsoft platform development can indeed be tricky, especially with the introduction of Windows Vista and its subsequent updates and alternatives. Here are some considerations that might help you make a decision:
### Current Preferred OS for Development
1. **Windows 10 (and lat... | 38,398 | [
{
"from": "human",
"value": "This has been troubling me for a few years, and was recently exacerbated by the introduction of Windows Vista (driver requirements & UAC restrictions being major factors).\nThere are many different flavours of Windows Vista (compared here), and there are also the alternative op... |
Is there any way to set an event handler without doing it manually in the classname.designer.cs file other than double clicking the UI element?
| Yes, there are alternative ways to set event handlers in a Windows Forms application without manually editing the `classname.designer.cs` file or double-clicking the UI element in the designer.
Here are some methods to do this:
### 1. Setting Event Handlers Programmatically
You can set the event handlers programmati... | 36,251 | [
{
"from": "human",
"value": "Is there any way to set an event handler without doing it manually in the classname.designer.cs file other than double clicking the UI element?\n"
},
{
"from": "gpt",
"value": "Yes, there are alternative ways to set event handlers in a Windows Forms application witho... |
How can I convert a Google search query to something I can feed PostgreSQL's to_tsquery() ?
If there's no existing library out there, how should I go about parsing a Google search query in a language like PHP?
For example, I'd like to take the following Google-ish search query:
("used cars" OR "new cars") -ford -mistub... | To convert a Google-like search query into a format suitable for PostgreSQL's `to_tsquery()`, you can implement a parser that recognizes the specific components of the search query and translates them into the appropriate SQL constructs. Here's a high-level approach on how you might tackle this using PHP, along with ex... | 35,515 | [
{
"from": "human",
"value": "How can I convert a Google search query to something I can feed PostgreSQL's to_tsquery() ?\nIf there's no existing library out there, how should I go about parsing a Google search query in a language like PHP?\nFor example, I'd like to take the following Google-ish search query... |
I'd like to find all the types inheriting from a base/interface. Anyone have a good method to do this? Ideas?
I know this is a strange request but its something I'm playing with none-the-less.
| To find all types that inherit from a specific base class or implement an interface in a programming language, the method can vary depending on the language and the environment you are using. Below are some methods for various languages:
### C#
In C#, you can use reflection to find all types that inherit from a speci... | 35,866 | [
{
"from": "human",
"value": "I'd like to find all the types inheriting from a base/interface. Anyone have a good method to do this? Ideas?\nI know this is a strange request but its something I'm playing with none-the-less.\n"
},
{
"from": "gpt",
"value": "To find all types that inherit from a sp... |
My employer is a large Swiss Telco. We have many Systems used to transfer data for different tasks, e.g. Performance Management, Fault Management, Configuration Management etc.
In order explain to "Management" (pointy haired, and other) how these systems interact, I collected information about data flow/formats/protoc... | Visualizing data flow between enterprise applications can be challenging, especially when dealing with changes in the architecture over time. Here are several approaches you could consider to maintain clarity and consistency in your visualizations, thereby making it easier for management and stakeholders to understand ... | 32,546 | [
{
"from": "human",
"value": "My employer is a large Swiss Telco. We have many Systems used to transfer data for different tasks, e.g. Performance Management, Fault Management, Configuration Management etc.\nIn order explain to \"Management\" (pointy haired, and other) how these systems interact, I collecte... |
How can I determine if a Win32 thread has terminated?
The documentation for GetExitCodeThread warns to not to use it for this reason since the error code STILL_ACTIVE can be returned for other reasons.
Thanks for the help! :)
| To determine if a Win32 thread has terminated, using `GetExitCodeThread` is indeed not the most reliable method due to the potential confusion with the `STILL_ACTIVE` return code. Instead, you can use a combination of `WaitForSingleObject` and `WaitForMultipleObjects` functions to reliably check the termination status ... | 37,169 | [
{
"from": "human",
"value": "How can I determine if a Win32 thread has terminated?\nThe documentation for GetExitCodeThread warns to not to use it for this reason since the error code STILL_ACTIVE can be returned for other reasons.\nThanks for the help! :)\n"
},
{
"from": "gpt",
"value": "To det... |
When obtaining the DPI for the screen under Windows (by using ::GetDeviceCaps) will the horizontal value always be the same as the vertical? For example:
HDC dc = ::GetDC(NULL);
const int xDPI = ::GetDeviceCaps(dc, LOGPIXELSX);
const int yDPI - ::GetDeviceCaps(dc, LOGPIXELSY);
assert(xDPI == yDPI);
::ReleaseDC(NULL, d... | In general, the horizontal DPI (dots per inch) and vertical DPI of a display under Windows can be different, but they usually are the same for most standard displays, particularly for traditional monitors. However, the ability to have different values for horizontal and vertical DPI exists in certain scenarios, especia... | 37,050 | [
{
"from": "human",
"value": "When obtaining the DPI for the screen under Windows (by using ::GetDeviceCaps) will the horizontal value always be the same as the vertical? For example:\nHDC dc = ::GetDC(NULL);\nconst int xDPI = ::GetDeviceCaps(dc, LOGPIXELSX);\nconst int yDPI - ::GetDeviceCaps(dc, LOGPIXELSY... |
The method is static, but I cannot find mention of if it is thread-safe or not. I plan on hitting this method with several threads at once and I would like to avoid a synchronized block if possible.
javax.mail.Transport.send(msg);
| The `javax.mail.Transport.send(Message msg)` method is used to send an email message. The `Transport` class in the JavaMail API is generally not thread-safe when it comes to sending messages. This means that if you call `Transport.send(msg)` from multiple threads simultaneously with the same instance of the `Transport`... | 35,922 | [
{
"from": "human",
"value": "The method is static, but I cannot find mention of if it is thread-safe or not. I plan on hitting this method with several threads at once and I would like to avoid a synchronized block if possible.\njavax.mail.Transport.send(msg);\n\n"
},
{
"from": "gpt",
"value": ... |
I am developing a page view counter to track the amount of views a page is having on our site and displaying it to the user. (I asked an intro question before: Page View Counter like on StackOverFlow).
Using the recommendations, I developed a httpHandler which will handle the request whenever this gets fired off:
<lin... | When implementing a page view counter, there are several factors to consider to ensure that user experience is not compromised and that the system is efficient and scalable. Here are some insights based on your questions:
### 1. Synchronous vs. Asynchronous Processing
Using a synchronous approach where the HTTP reque... | 38,125 | [
{
"from": "human",
"value": "I am developing a page view counter to track the amount of views a page is having on our site and displaying it to the user. (I asked an intro question before: Page View Counter like on StackOverFlow).\nUsing the recommendations, I developed a httpHandler which will handle the r... |
I'm building a JSF+Facelets web app, one piece of which is a method that scans a directory every so often and indexes any changes. This method is part of a bean which is in application scope. I have built a subclass of TimerTask to call the method every X milliseconds. My problem is getting the bean initialized. I ... | Yes, you can initialize a JSF managed bean (in this case, your application-scoped bean) when the web application starts up by using a `ServletContextListener` to trigger the initialization. However, since you want to ensure that the JSF context is properly set up before interacting with your bean, you can use the `@Pos... | 37,613 | [
{
"from": "human",
"value": "I'm building a JSF+Facelets web app, one piece of which is a method that scans a directory every so often and indexes any changes. This method is part of a bean which is in application scope. I have built a subclass of TimerTask to call the method every X milliseconds. My pro... |
There are a lot of procedures and functions in the master database of SQL Server that provide handy tools for the database developer. For instance, sp_help [database object] will provide several results sets with useful attributes of the specified object; sp_helptext [procedure or function name] will return the body ... | Absolutely! SQL Server provides a number of stored procedures and system functions that can help you navigate, analyze, and understand your database. Here are some additional ones you might find useful:
1. **sp_who and sp_who2**: These procedures provide information about the current users and processes in the SQL Ser... | 38,203 | [
{
"from": "human",
"value": "There are a lot of procedures and functions in the master database of SQL Server that provide handy tools for the database developer. For instance, sp_help [database object] will provide several results sets with useful attributes of the specified object; sp_helptext [procedur... |
I'm attempting to help our network engineers troubleshoot a situation for one of our clients. This client purchased a point-of-sale system from quite literally a "mom-and-pop" vendor, and said vendor recommended SQL Server Express 2005 as the back-end database to save the client from having to incur extra licensing fee... | Your situation certainly sounds frustrating, especially given the limitations you've mentioned regarding the application and its logging. Let’s break down your questions:
### SQL Server Express and Partial Data
1. **Partial Data Returns**: SQL Server itself does not return partial data. If a query is executed and it ... | 34,819 | [
{
"from": "human",
"value": "I'm attempting to help our network engineers troubleshoot a situation for one of our clients. This client purchased a point-of-sale system from quite literally a \"mom-and-pop\" vendor, and said vendor recommended SQL Server Express 2005 as the back-end database to save the clie... |
I having to downgrade my Oracle instance from 10g (10.1.0.2.0) to 9i (9.2.x.x.x).
Not having planned on ever doing this, I didn't document 10g dependencies.
What are some of the dependencies on 10g that I will have to address?
Is there any type of query that I could perform to detect dependencies?
Of course I'm hoping ... | Downgrading an Oracle database from 10g to 9i can indeed be a challenging task, as there are numerous features and functionalities introduced in 10g that are either not supported or behave differently in 9i. While there isn’t a single "magic bullet" query that can capture all dependencies comprehensively, you can use s... | 30,848 | [
{
"from": "human",
"value": "I having to downgrade my Oracle instance from 10g (10.1.0.2.0) to 9i (9.2.x.x.x).\nNot having planned on ever doing this, I didn't document 10g dependencies.\nWhat are some of the dependencies on 10g that I will have to address?\nIs there any type of query that I could perform t... |
I am trying to migrate structured documents (i.e. documents that are mostly some metadata and one big table) to a database. When I try to move tabular data from Word to Excel, my main point of pain is handling CRLFs within a cell in Word. Any solution for this?
Now, since I will be transferring from Word to Access:
W... | Migrating structured documents, especially those with embedded line breaks (CRLFs) in cells, can indeed present challenges. Here are some insights and solutions for your situation:
### Handling CRLFs in Word when Transferring to Excel
When copying tabular data from Word to Excel, you may run into issues with carriage... | 35,628 | [
{
"from": "human",
"value": "I am trying to migrate structured documents (i.e. documents that are mostly some metadata and one big table) to a database. When I try to move tabular data from Word to Excel, my main point of pain is handling CRLFs within a cell in Word. Any solution for this?\nNow, since I wil... |
I don't want to have the user install Google Gears so I can show him his guessed location. Is there a way to get the location without having to use Google Gears?
I have found http://www.wipmania.com/de/blog/google-geolocation-api/ but it does not offer an example.
| If you want to obtain a user's location without requiring them to install Google Gears, you can use the HTML5 Geolocation API. This API allows you to get the user's current geographical location with their consent. Most modern browsers support this API, so it's a convenient solution.
Here’s a simple example of how to ... | 36,479 | [
{
"from": "human",
"value": "I don't want to have the user install Google Gears so I can show him his guessed location. Is there a way to get the location without having to use Google Gears?\nI have found http://www.wipmania.com/de/blog/google-geolocation-api/ but it does not offer an example.\n"
},
{
... |
I run Jetty6 yet gladly place Apache in the front if needs be.
I would like to have two webserver instances running on the same machine on different ports.
I would like the instance on port 80 to redirect the second public domain name to the second webserver on port 8080.
This should not be visible to web users.
Thank ... | To achieve your goal of having two web server instances running on the same machine (one on port 80 and one on port 8080) and redirecting requests from the first to the second without exposing the port to end-users, you can set up Apache as a reverse proxy in front of Jetty. Here's a step-by-step guide to configure Apa... | 31,270 | [
{
"from": "human",
"value": "I run Jetty6 yet gladly place Apache in the front if needs be.\nI would like to have two webserver instances running on the same machine on different ports.\nI would like the instance on port 80 to redirect the second public domain name to the second webserver on port 8080.\nThi... |
What are some good templating engines for web designers? I definitely have my preferences as to what I'd prefer to work with as a programmer. But web designers seem to have a different way of thinking about things and thus may prefer a different system.
So:
Web designers: what templating engine do you prefer to wor... | When it comes to templating engines for web designers, the preferences can vary based on their familiarity with code, the complexity of the projects, and the specific frameworks they are using. Below are some popular templating engines that appeal to both web designers and programmers, along with their features:
### F... | 30,979 | [
{
"from": "human",
"value": "What are some good templating engines for web designers? I definitely have my preferences as to what I'd prefer to work with as a programmer. But web designers seem to have a different way of thinking about things and thus may prefer a different system.\nSo:\n\nWeb designers: ... |
At work I use mostly the .NET Compact Framework 3.5 for developing applications that run on smart devices. Our devices are not phones or handhelds - they are measurement instruments which you get with a whole punch of features. Our application is pretty advanced - we are even using a N-Layer architecture, a self-made G... | The .NET Compact Framework (CF) 3.5 is indeed a powerful platform for developing applications for resource-constrained devices like measurement instruments. Developing sophisticated applications using N-Layer architecture and a custom GUI framework is no small feat.
### Advanced Implementations with the Compact Frame... | 34,201 | [
{
"from": "human",
"value": "At work I use mostly the .NET Compact Framework 3.5 for developing applications that run on smart devices. Our devices are not phones or handhelds - they are measurement instruments which you get with a whole punch of features. Our application is pretty advanced - we are even us... |
what's the best/proper way of interacting between several windows in C# app?
Recently, I've run into a problem where one of program windows has to call method modifying main window. My solution was to create factory-like class, that would arrange all underlying model-data and organize the communication between various... | Interacting between multiple windows in a C# application can indeed become complex, especially when it comes to passing data and functionality between those windows. Using delegates is one possible approach, but it can lead to challenges if you find yourself needing to pass many delegates. Below, I'll explore some conc... | 35,098 | [
{
"from": "human",
"value": "what's the best/proper way of interacting between several windows in C# app? \nRecently, I've run into a problem where one of program windows has to call method modifying main window. My solution was to create factory-like class, that would arrange all underlying model-data and ... |
I have a table of music albums. I have a second table of album art. Unfortunately, not every album has some album art data. As such, i will need to do an OUTER JOIN between music and album art.
Assumption: both tables just contain ints and varchars .. no blobs, etc.
Question
Is it better to merge both tables into one ... | Merging both tables into one to reduce the need for an outer join is a possible approach, but whether it's the best option depends on various factors. Here are some points to consider:
### Pros of Merging Tables
1. **Simplicity**: Having a single table can simplify queries since you don't have to deal with joins. Thi... | 37,895 | [
{
"from": "human",
"value": "I have a table of music albums. I have a second table of album art. Unfortunately, not every album has some album art data. As such, i will need to do an OUTER JOIN between music and album art.\nAssumption: both tables just contain ints and varchars .. no blobs, etc.\nQuestion\n... |
I would really appreciate some thoughts on the following issue.
When I attached to the w3wp.exe process.
It starts to load the symbols.
Then the debugger stops before ever hitting a breakpoint.
If I restart the w3wp process and refresh “Attach to process” I can debug but only one page cycle.
I have reinstalled IIS7... | Debugging issues with IIS and the w3wp.exe process can be frustrating, but there are several potential reasons why you may experience the debugger stopping after one page cycle. Here are some common causes and solutions to help you troubleshoot:
### 1. **Ensure Symbols are Loaded Correctly**
Make sure that your symbol... | 36,677 | [
{
"from": "human",
"value": "I would really appreciate some thoughts on the following issue.\nWhen I attached to the w3wp.exe process.\n\nIt starts to load the symbols.\nThen the debugger stops before ever hitting a breakpoint.\n\nIf I restart the w3wp process and refresh “Attach to process” I can debug bu... |
I'm stuck in having to write a simple spam filter
I'm not really sure about how I'm going to do it.
So far I've come up with wordlist and domain filtering, which will give or remove points up to a certain threshold.
For example, if you're writing about "v1agr4" from a blacklisted domain, you'll get like 2 points for sp... | Creating a simple spam filter is a great way to learn about natural language processing (NLP) and the challenges of classification. Here are some suggestions and additional techniques you might consider incorporating into your spam filter:
### 1. **Naive Bayes Classifier**
- Use a Naive Bayes classifier for spam de... | 34,750 | [
{
"from": "human",
"value": "I'm stuck in having to write a simple spam filter\nI'm not really sure about how I'm going to do it.\nSo far I've come up with wordlist and domain filtering, which will give or remove points up to a certain threshold.\nFor example, if you're writing about \"v1agr4\" from a black... |
I am trying to find the crc that works with the following results. The byte string consists of 2 bytes (ie. 0xCE1E) and the crc is an single byte (ie. 0x03)
byte crc
CE1E 03
CE20 45
CE22 6F
0000 C0
0001 D4
FFFF 95
Can anyone help?
| To determine the CRC algorithm used for your provided byte strings and their respective CRC values, we can perform some analysis. The data and the CRC results you provided suggest that a certain polynomial and initialization value might be in use, but additional details about the algorithm are necessary to make a defin... | 34,907 | [
{
"from": "human",
"value": "I am trying to find the crc that works with the following results. The byte string consists of 2 bytes (ie. 0xCE1E) and the crc is an single byte (ie. 0x03)\n\nbyte crc\nCE1E 03\nCE20 45\nCE22 6F\n0000 C0\n0001 D4\nFFFF 95\n\nCan anyone help?\n"
},
{
"from": "gpt",
"... |
I'm new using makefiles and I have some makefiles. One of them has these statements I tried to understand but I can't.
What is this makefile doing?
# debugging support
ifeq ($(DEBUG), true)
CFLAGS+=-DDEBUG -g
endif
ifeq ($(DEBUG), gdb)
CFLAGS+=-g
endif
ifeq ($(PROFILING), true)
CFLAGS+=-p
endif
# symbolic names de... | This snippet of a Makefile is setting up various compilation flags based on certain environment variables. Let's break down what each section does:
1. **Debugging Support**:
- The `ifeq` statements check the value of the `DEBUG` variable. Depending on its value, specific flags are added to the `CFLAGS` variable, w... | 37,555 | [
{
"from": "human",
"value": "I'm new using makefiles and I have some makefiles. One of them has these statements I tried to understand but I can't.\nWhat is this makefile doing?\n# debugging support\nifeq ($(DEBUG), true)\nCFLAGS+=-DDEBUG -g\nendif \n\nifeq ($(DEBUG), gdb)\nCFLAGS+=-g\nendif\n\nifeq ($(PRO... |
I need to get a list of directories shared by the current computer, and their shared names. How do I do this in C++ / MFC?
| To retrieve a list of shared directories and their share names in a C++ application using MFC (Microsoft Foundation Classes), you can use the Windows API. The function `NetShareEnum` from the `Netapi32.lib` library is used to enumerate shared resources on the computer.
Here’s a step-by-step guide and a sample code sni... | 32,199 | [
{
"from": "human",
"value": "I need to get a list of directories shared by the current computer, and their shared names. How do I do this in C++ / MFC?\n"
},
{
"from": "gpt",
"value": "To retrieve a list of shared directories and their share names in a C++ application using MFC (Microsoft Founda... |
Does anyone know of a twitter clone written in .NET (or ideally C#)?
I wanna experiment with a private twitter network between some friends and work colleagues.
| There are a few open-source projects and frameworks in .NET (C#) that can help you create a Twitter-like application or experiment with a private social network. Here are some options you can explore:
1. **MiniTwitter**:
- **GitHub Repository**: You can find various implementations of MiniTwitter on GitHub. This is... | 39,124 | [
{
"from": "human",
"value": "Does anyone know of a twitter clone written in .NET (or ideally C#)?\nI wanna experiment with a private twitter network between some friends and work colleagues.\n"
},
{
"from": "gpt",
"value": "There are a few open-source projects and frameworks in .NET (C#) that ca... |
I can't figure out how to define the default constructor (when it exists overloads) for a type in StructureMap (version 2.5) by code.
I want to get an instance of a service and the container has to inject a Linq2Sql data context instance into it.
I wrote this in my 'bootstrapper' method :
ForRequestedType<MyDataContext... | It looks like you're trying to configure StructureMap to resolve a LINQ to SQL data context, but you are facing issues due to the existence of multiple constructors in your `MyDataContext` class. StructureMap may have trouble determining which constructor to use if there are overloads.
To solve this issue without usin... | 39,360 | [
{
"from": "human",
"value": "I can't figure out how to define the default constructor (when it exists overloads) for a type in StructureMap (version 2.5) by code.\nI want to get an instance of a service and the container has to inject a Linq2Sql data context instance into it.\nI wrote this in my 'bootstrapp... |
I'm looking for a way to upload a file to s3. I am using django. I am currently using amazon's python library for uploading along with the following code:
View:
def submitpicture(request):
fuser = request.session["login"]
copied_data = request.POST.copy()
copied_data.update(request.FILES)
content_type... | It looks like you're encountering a `MultiValueDictKeyError` because the `file` key is not found in the `QueryDict` that represents your form data. This usually happens when the form is submitted without a file being selected. Here are some steps to help you troubleshoot and fix the issue:
### 1. Ensure the Form is Pr... | 38,108 | [
{
"from": "human",
"value": "I'm looking for a way to upload a file to s3. I am using django. I am currently using amazon's python library for uploading along with the following code: \nView:\ndef submitpicture(request):\n fuser = request.session[\"login\"]\n\n copied_data = request.POST.copy()\n c... |
This fails with 'X.m is not a function'...
var Y = function () {
this.m = function () {
alert('this is m');
};
};
var X = new function () { };
X.prototype = new Y();
X.m();
It would certainly work if I skipped the new keyword in the X definition and then instantiated X before calling m() on it. Why c... | The issue with your code arises from the way you are defining the `X` object and its prototype.
When you write:
```javascript
var X = new function () { };
```
You are creating an instance of an anonymous function. This instance does not have a prototype chain that refers to the `Y` constructor. The prototype assignm... | 35,888 | [
{
"from": "human",
"value": "This fails with 'X.m is not a function'...\nvar Y = function () {\n this.m = function () {\n alert('this is m');\n };\n};\n\nvar X = new function () { };\n\nX.prototype = new Y();\nX.m();\n\nIt would certainly work if I skipped the new keyword in the X definition an... |
I am interested if there is a port for the server implementation.
| Could you please clarify which server implementation you are referring to? There are many different server implementations for various technologies, frameworks, and protocols. Providing more specific details will help me give you a more accurate answer. | 41,917 | [
{
"from": "human",
"value": "I am interested if there is a port for the server implementation.\n"
},
{
"from": "gpt",
"value": "Could you please clarify which server implementation you are referring to? There are many different server implementations for various technologies, frameworks, and pro... |
Short of rolling your own. There has to be something out there. FlexLM/FlexNet is overpriced, and does not work for a company like ours. The same goes for RLM. There was one product I had hope in called LUM, but IBM no longer licenses the API. So what else is available? Or do you have any known way to get LUM?
Pl... | Finding a suitable licensing solution can indeed be challenging, especially when commercial offerings like FlexLM/FlexNet and RLM are either too costly or not a good fit for your company's needs. Here are some alternatives that you might consider:
1. **Open Source Licensing Solutions**:
- **OpenLM**: Although it’s ... | 37,534 | [
{
"from": "human",
"value": "Short of rolling your own. There has to be something out there. FlexLM/FlexNet is overpriced, and does not work for a company like ours. The same goes for RLM. There was one product I had hope in called LUM, but IBM no longer licenses the API. So what else is available? Or... |
I've tried disabling cookies in Internet Explorer 7, I've changed the settings under Internet Options->Privacy and this did nothing, when I reloaded the page.
I read somewhere that you need to restart IE7, than physically delete the Internet cache and cookie files first, and finally reload your page to disable cookies.... | Disabling cookies in Internet Explorer 7 can be a bit tricky due to the way the browser handles cache and sessions. Here are some steps you can follow to ensure that cookies are properly disabled, and to address the issues you are encountering:
1. **Disable Cookies**:
- Go to `Tools` -> `Internet Options`.
- Cl... | 37,326 | [
{
"from": "human",
"value": "I've tried disabling cookies in Internet Explorer 7, I've changed the settings under Internet Options->Privacy and this did nothing, when I reloaded the page.\nI read somewhere that you need to restart IE7, than physically delete the Internet cache and cookie files first, and fi... |
While an applet is loading, it displays a white rectangle for a split second. How can we get rid of it?
| To eliminate the brief display of a white rectangle while an applet is loading, you can employ several strategies:
1. **Set Background Color**: Specify a background color for your applet in its initialization code. For example, use the `setBackground(Color)` method in the `init()` method of your applet.
```java
... | 35,650 | [
{
"from": "human",
"value": "While an applet is loading, it displays a white rectangle for a split second. How can we get rid of it?\n"
},
{
"from": "gpt",
"value": "To eliminate the brief display of a white rectangle while an applet is loading, you can employ several strategies:\n\n1. **Set Bac... |
As the title says, I'm starting one project right now, and trying to layout the infrastructure for the project (SVN, Email, Bug tracking, Online Forums, etc...)
So, Bugzilla or Mantis?
| Choosing between Bugzilla and Mantis for bug tracking depends on several factors related to your project’s specific needs, team size, and preferred features. Here’s a comparison to help you decide:
### Bugzilla
**Pros:**
1. **Robust Features:** Bugzilla offers a wide range of features including advanced search capabil... | 38,103 | [
{
"from": "human",
"value": "As the title says, I'm starting one project right now, and trying to layout the infrastructure for the project (SVN, Email, Bug tracking, Online Forums, etc...)\nSo, Bugzilla or Mantis?\n"
},
{
"from": "gpt",
"value": "Choosing between Bugzilla and Mantis for bug tra... |
I'm writing this question in the spirit of answering your own questions, since I found a solution to the problem, but if anyone has a better solution I would gladly listen to it.
In the application I am currently working on I am subclassing the ListView control to add some functionality of which some interacts with the... | When unit testing a subclass of `ListView`, particularly with properties like `SelectedIndices` and `SelectedItems`, you may encounter issues where the selection does not appear to update as expected. This can happen due to the way Windows Forms controls manage their state and interactions.
### Solution Approach
To e... | 36,236 | [
{
"from": "human",
"value": "I'm writing this question in the spirit of answering your own questions, since I found a solution to the problem, but if anyone has a better solution I would gladly listen to it.\nIn the application I am currently working on I am subclassing the ListView control to add some func... |
I've asked a few other questions here about this system, so I'll try to avoid repeating a lot of detail.
The short version is that I have many html pages, each with a form that accepts input, but never saves the input anywhere- they are only ever printed out for mailing. A previously developer who had never heard of @... | It sounds like you're facing a common challenge with legacy systems and browsers, especially with older versions like IE6. Since you want to make the input fields blend seamlessly into the printed output while ensuring the layout works well for users, there are a couple of approaches you can take that might be more ele... | 36,310 | [
{
"from": "human",
"value": "I've asked a few other questions here about this system, so I'll try to avoid repeating a lot of detail.\nThe short version is that I have many html pages, each with a form that accepts input, but never saves the input anywhere- they are only ever printed out for mailing. A pre... |
While working on an existing project I suddenly got the following error when trying to compile the solution:
error MSB3105: The item "[filename]" was specified more than once in the "Resources" parameter. Duplicate items are not supported by the "Resources" parameter.
Now, as far as I'm aware, I did not make any change... | The MSB3105 error you're encountering indicates that a resource file is being referenced more than once, even if you can't see the duplicates in the project file. Here are some additional steps you can take to troubleshoot and resolve the issue:
1. **Check the `.csproj` File Thoroughly**:
- Sometimes, duplicate en... | 36,407 | [
{
"from": "human",
"value": "While working on an existing project I suddenly got the following error when trying to compile the solution:\nerror MSB3105: The item \"[filename]\" was specified more than once in the \"Resources\" parameter. Duplicate items are not supported by the \"Resources\" parameter.\nNo... |
Forgive me for being a complete newbie with Windows DDK.
I have create a simple file named test.cpp:
#include <windows.h>
#define BAD_ADDRESS 0xBAADF00D
int __cdecl main(int argc, char* args[])
{
char* p =(char*)BAD_ADDRESS;
*p='A';
return 0;
}
In the same directory I created a sources file like this:
T... | The issue you're encountering with the message "The application cannot be run in Win32 mode" is typically related to a mismatch between the target environment for your executable and the environment you're trying to run it in. In your case, it appears that you're trying to build a Windows driver (or kernel-mode applica... | 38,546 | [
{
"from": "human",
"value": "Forgive me for being a complete newbie with Windows DDK.\nI have create a simple file named test.cpp:\n#include <windows.h>\n\n#define BAD_ADDRESS 0xBAADF00D\n\nint __cdecl main(int argc, char* args[])\n{\n char* p =(char*)BAD_ADDRESS;\n *p='A';\n return 0;\n}\n\nIn the... |
I'm lead to believe that I cannot count on the order of items added to a dictionary for enumeration purposes.
Is there a class (generic if possible) to which items may be added with a key and which can be enumerated in addition order or which can be retrieved by key?
Clarification: I do not want to enumerate in Key Ord... | If you need a data structure that allows you to store key-value pairs and also enumerate the items in the order they were added (FIFO), you can use a combination of a dictionary and a queue, or utilize specific data structures available in certain programming languages.
### Python
In Python, you can use the `collecti... | 36,699 | [
{
"from": "human",
"value": "I'm lead to believe that I cannot count on the order of items added to a dictionary for enumeration purposes.\nIs there a class (generic if possible) to which items may be added with a key and which can be enumerated in addition order or which can be retrieved by key?\nClarifica... |
How do I launch an app and capture the output via stdout and maybe stderr?
I am writing an automated build system and I need to capture the output to analyze. I'd like to update the svn repo and grab the revision number so I can move the files in autobuild/revNumber/ if successful. I also would like to build using make... | To launch a process and capture its output (both `stdout` and `stderr`) in a Windows application using `CreateProcess`, you'll need to set up pipes. This process can be a bit involved, but here's a general overview along with a sample code implementation to help you get started.
### Steps to Capture Output from a Proc... | 34,563 | [
{
"from": "human",
"value": "How do I launch an app and capture the output via stdout and maybe stderr?\nI am writing an automated build system and I need to capture the output to analyze. I'd like to update the svn repo and grab the revision number so I can move the files in autobuild/revNumber/ if success... |
I want to design a class that will parse a string into tokens that are meaningful to my application.
How do I design it?
Provide a ctor that accepts a string, provide a Parse method and provide methods (let's call them "minor") that return individual tokens, count of tokens etc. OR
Provide a ctor that accepts nothing,... | Designing a parser class in C# involves considering both usability and maintainability. Here are the main considerations and the recommended approach:
### Considerations
1. **Encapsulation**: Users should not have to worry about the internal state of the parser. The class should manage its state well and offer methods... | 36,242 | [
{
"from": "human",
"value": "I want to design a class that will parse a string into tokens that are meaningful to my application.\nHow do I design it?\n\nProvide a ctor that accepts a string, provide a Parse method and provide methods (let's call them \"minor\") that return individual tokens, count of token... |
I have the string which that encoded in quoted-printable. How do I decode this in php?
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Vestibulum felis =
pede, vestibulum et, ullamcorper in, ultrices eget, metus. Suspendisse in n=
ulla. Sed justo. Donec dapibus auctor neque. Pellentesque faucibus ante nec=
... | To decode a quoted-printable encoded string in PHP, you can use the built-in function `quoted_printable_decode()`. This function takes a quoted-printable encoded string as an argument and returns the decoded string.
Here’s how you can decode the provided string:
```php
<?php
// Your quoted-printable encoded string
$e... | 39,172 | [
{
"from": "human",
"value": "I have the string which that encoded in quoted-printable. How do I decode this in php?\nLorem ipsum dolor sit amet, consectetuer adipiscing elit. Vestibulum felis =\npede, vestibulum et, ullamcorper in, ultrices eget, metus. Suspendisse in n=\nulla. Sed justo. Donec dapibus auc... |
Is there a way in FreeBSD to (being root) run a command as unprivileged user, like nobody? Kind of like reverse of sudo. Oh and considering that 'nobody' has /usr/sbin/nologin as shell - so su is not an option.
| Yes, you can run a command as an unprivileged user in FreeBSD, even if that user has `/usr/sbin/nologin` as their shell. You can use the `su` command with the `-m` (or `-p`) option to preserve the environment, or you can use a combination of `su` with a different user and command execution methods.
Here are a couple o... | 38,231 | [
{
"from": "human",
"value": "Is there a way in FreeBSD to (being root) run a command as unprivileged user, like nobody? Kind of like reverse of sudo. Oh and considering that 'nobody' has /usr/sbin/nologin as shell - so su is not an option.\n"
},
{
"from": "gpt",
"value": "Yes, you can run a comm... |
For the moment my batch file look like this:
myprogram.exe param1
The program starts but the DOS Window remains open. How can I close it?
| If you want the DOS (Command Prompt) window to close automatically after your batch file runs `myprogram.exe`, you can use the `start` command with the `/b` option, which will run the program without opening a new Command Prompt window.
Here’s how you can modify your batch file:
```batch
@echo off
start /b myprogram... | 39,706 | [
{
"from": "human",
"value": "For the moment my batch file look like this:\nmyprogram.exe param1\n\nThe program starts but the DOS Window remains open. How can I close it?\n"
},
{
"from": "gpt",
"value": "If you want the DOS (Command Prompt) window to close automatically after your batch file run... |
Are there any initiatives to implement/agree upon a standard API for connectivity between web browsers and client hardware.
Example: The iPhone has a GPS/Camera/Accellerometer in it. It'd be very cool if my web app could communicate with them (rather than me having to write a thick ObjectiveC application).
| Yes, there are several initiatives and standards aimed at enhancing the capabilities of web applications to communicate with client hardware. Here are some key points and technologies relevant to your interest:
1. **Web APIs**: The Web platform has seen the development of various APIs that allow web applications to ac... | 37,952 | [
{
"from": "human",
"value": "Are there any initiatives to implement/agree upon a standard API for connectivity between web browsers and client hardware.\nExample: The iPhone has a GPS/Camera/Accellerometer in it. It'd be very cool if my web app could communicate with them (rather than me having to write a t... |
I was wondering if there is a single API documentation with "argument list" and the detailed description (and struct definition) of all the return values for all the blogging APIs like Blogger API,mt, metaweblog, and wp?
| While there is no single unified API documentation that encompasses all blogging APIs like Blogger API, MovableType (MT), MetaWeblog, and WordPress (WP) with a complete argument list and return value descriptions, you can find detailed documentation for each of these APIs individually. Here’s a brief overview and links... | 37,572 | [
{
"from": "human",
"value": "I was wondering if there is a single API documentation with \"argument list\" and the detailed description (and struct definition) of all the return values for all the blogging APIs like Blogger API,mt, metaweblog, and wp?\n"
},
{
"from": "gpt",
"value": "While there... |
Currently we're using Web Application project, so we have a gain with compilation. But as far as I know, the aspx pages a still compiled at the first page hit. So does precompilation give a perceptible performance gain ? (first hit exluded).
What type of web site (hits/sec, number of users) will benefit of it ?
| Precompilation of ASP.NET web applications can provide performance benefits beyond just the first hit, particularly in scenarios where the application experiences significant traffic or has a complex structure. Here’s a breakdown of how precompilation works and when it can be beneficial:
### What is Precompilation?
Pr... | 37,361 | [
{
"from": "human",
"value": "Currently we're using Web Application project, so we have a gain with compilation. But as far as I know, the aspx pages a still compiled at the first page hit. So does precompilation give a perceptible performance gain ? (first hit exluded).\nWhat type of web site (hits/sec, num... |
My table has the following schema:
id, parent_id, text
Given the following data I would like to return an xml hierarchy:
Data: (1,null,'x'), (2,1,'y'), (3,1,'z'), (4,2,'a')
XML:
[row text="x"]
[row text="y"]
[row text="a"/]
[/row]
[row text="z"/]
[/row]
Added: the hierachy has no maximum depth
| To generate an XML hierarchy from the given table data with the specified schema, you can use a recursive query. The hierarchical structure of the data can be represented using a Common Table Expression (CTE) in SQL, which can then be transformed into XML. Below, I'll provide a step-by-step guide to achieving this.
##... | 37,486 | [
{
"from": "human",
"value": "My table has the following schema:\nid, parent_id, text\nGiven the following data I would like to return an xml hierarchy:\nData: (1,null,'x'), (2,1,'y'), (3,1,'z'), (4,2,'a')\nXML:\n[row text=\"x\"]\n [row text=\"y\"]\n [row text=\"a\"/]\n [/row]\n [row text=\"z\"/]\n[/row] \... |
$images = array();
$images[0][0] = "boxes/blue.jpg";
$images[0][1] = "blah.html";
$images[1][0] = "boxes/green.jpg";
$images[1][1] = "blah.html";
$images[2][0] = "boxes/orange.jpg";
$images[2][1] = "blah.html";
$images[3][0] = "boxes/pink.jpg";
$images[3][1] = "blah.html";
$images[4][0] = "boxes/purple.jpg";
$images[4]... | Let's take a look at the code you provided and analyze the issues you are experiencing.
### Initial Issue with Splice
In your first code snippet, the line:
```php
$slice = array_splice($images, $rand);
```
The `array_splice` function is used to remove elements from an array, but it returns the removed elements as a... | 33,865 | [
{
"from": "human",
"value": "$images = array();\n$images[0][0] = \"boxes/blue.jpg\";\n$images[0][1] = \"blah.html\";\n$images[1][0] = \"boxes/green.jpg\";\n$images[1][1] = \"blah.html\";\n$images[2][0] = \"boxes/orange.jpg\";\n$images[2][1] = \"blah.html\";\n$images[3][0] = \"boxes/pink.jpg\";\n$images[3][1... |
I have Plone product that uses a custom folder type for containing a set of custom content objects. The folder type was created by subclassing BaseFolder and it has a schema with a couple of text fields. Currently, when custom objects are added to the custom folder, the objects are sorted alphabetically by their id. ... | To implement manual sorting of content objects within your custom folder type in Plone, you'll need to take a few steps. The goal is to override the default sorting behavior that Plone uses for folders and enable a way to manually sort the items. Here's how you can achieve this:
### Step 1: Extend Your Custom Folder T... | 35,474 | [
{
"from": "human",
"value": "I have Plone product that uses a custom folder type for containing a set of custom content objects. The folder type was created by subclassing BaseFolder and it has a schema with a couple of text fields. Currently, when custom objects are added to the custom folder, the object... |
I found strange bug (maybe). When I send parameters to $.ajax in a form of hash, and tried to check that params in $.ajaxSend, I found that settings.data is null, settings.url was normal with parameters included. Then I look inside jQuery code, and found that data erased.
// If data is available, append data to url... | The behavior you're observing is due to how jQuery handles data in AJAX requests, particularly when dealing with GET and POST requests. When you send a request using `$.ajax()`, if it's a GET request, jQuery appends the data to the URL query string and sets `settings.data` to `null` to avoid sending it in the request b... | 38,274 | [
{
"from": "human",
"value": "I found strange bug (maybe). When I send parameters to $.ajax in a form of hash, and tried to check that params in $.ajaxSend, I found that settings.data is null, settings.url was normal with parameters included. Then I look inside jQuery code, and found that data erased.\n /... |
Is there anybody who has successfully accessed a Web service from an Oracle stored procedure? If so, was it a Java stored procedure? A PL/SQL stored procedure?
Is there any reason why I should not be trying to access a WS from a stored proc?
Here are a couple refs that I found so far
Database Web Services
Calling ex... | Yes, it is indeed possible to access a web service from an Oracle stored procedure. You can do this through either PL/SQL or Java stored procedures, but each method has its own considerations. Let's explore both options and some points to keep in mind.
### 1. Java Stored Procedures
Using Java stored procedures to cal... | 37,890 | [
{
"from": "human",
"value": "Is there anybody who has successfully accessed a Web service from an Oracle stored procedure? If so, was it a Java stored procedure? A PL/SQL stored procedure?\nIs there any reason why I should not be trying to access a WS from a stored proc?\nHere are a couple refs that I fou... |
I'm trying to store in a variable the name of the current file that I've opened from a folder.
How can I do that?
I've tried cwd = os.getcwd() but this only gives me the path of the folder, and I need to store the name of the opened file.
Can you please help me?
| To store the name of the currently opened file in Python, you typically need to have the file name available when you open it. The `os.getcwd()` function only gives you the current working directory, not the name of any file that you may have opened.
Here are a few ways to achieve this, depending on how you are openin... | 38,254 | [
{
"from": "human",
"value": "I'm trying to store in a variable the name of the current file that I've opened from a folder.\nHow can I do that?\nI've tried cwd = os.getcwd() but this only gives me the path of the folder, and I need to store the name of the opened file.\nCan you please help me?\n"
},
{
... |
The examples I can find use a two layer architecture, where the controllers directly use the repository classes in the data access layer. See here or here.
Where would you register components from the data access layer if you have a service or business logic layer that uses those components? The data access layer shoul... | In a layered architecture, it's important to clearly separate concerns and maintain a clean structure. If you're using a service or business logic layer that interacts with the data access layer (DAL), you want to keep the layers decoupled, and your registration of dependencies should reflect that.
### Dependency Inje... | 38,936 | [
{
"from": "human",
"value": "The examples I can find use a two layer architecture, where the controllers directly use the repository classes in the data access layer. See here or here.\nWhere would you register components from the data access layer if you have a service or business logic layer that uses tho... |
I have a dialog that resizes. It also has a custom background which I paint in response to a WM_ERASEBKGND call (currently a simple call to FillSolidRect).
When the dialog is resized, there is tremendous flickering going on. To try and reduce the flickering I enumerate all child windows and add them to the clipping... | To achieve flicker-free resizing of a dialog in MFC, you're on the right track with double-buffering. However, the flickering often occurs due to the way the dialog and its controls are redrawn during resizing. Below is a comprehensive approach to minimize or eliminate flickering:
1. **Use Double Buffering**: Create a... | 32,366 | [
{
"from": "human",
"value": "I have a dialog that resizes. It also has a custom background which I paint in response to a WM_ERASEBKGND call (currently a simple call to FillSolidRect). \nWhen the dialog is resized, there is tremendous flickering going on. To try and reduce the flickering I enumerate all ... |
I have a set of Silverlight controls and I want to create a webpage that will automatically alternate between these controls. Any idea how I go about doing this?
The order that they are displayed and the period of time each one is displayed for needs to be configurable, but any tips on just getting the basic paging to... | To create a webpage that automatically alternates between Silverlight controls, you have a couple of options. Since you mentioned you could either handle it via ASP.NET WinForms or have a master Silverlight control, I'll provide an approach for each option. For both methods, the core idea is to utilize a timer that cha... | 32,126 | [
{
"from": "human",
"value": "I have a set of Silverlight controls and I want to create a webpage that will automatically alternate between these controls. Any idea how I go about doing this?\nThe order that they are displayed and the period of time each one is displayed for needs to be configurable, but an... |
As you may already know, the .NET Framework's protected internal access modifier works in a strange way: It doesn't mean the class is protected AND internal, it says the class is protected OR internal; that is, the modified class or member can be accessed from whitin the same assembly as well as from the same hierarchy... | The `protected internal` access modifier in .NET indeed indicates that a member can be accessed either from within the same assembly (internal) or from derived classes (protected). This means that the member is accessible if you are within the same assembly or if you are in a class that derives from the containing clas... | 35,812 | [
{
"from": "human",
"value": "As you may already know, the .NET Framework's protected internal access modifier works in a strange way: It doesn't mean the class is protected AND internal, it says the class is protected OR internal; that is, the modified class or member can be accessed from whitin the same as... |
I am wondering what copy-local=true for references exactly does. Does it copy the referenced assembly along with all of its dependencies to the output directory?
My scenario is the following:
I have a custom log wrapper that utilizes log4net. I build a release assembly of MyLogWrapper.dll with log4net.dll reference set... | The `Copy Local` property in Visual Studio for a reference determines whether the referenced assembly (DLL) is copied to the output directory of the project that is referencing it. Here's how it works in the context of your scenario:
1. **Copy Local Behavior**: If `Copy Local` is set to `true` for a reference in a pro... | 38,429 | [
{
"from": "human",
"value": "I am wondering what copy-local=true for references exactly does. Does it copy the referenced assembly along with all of its dependencies to the output directory?\nMy scenario is the following:\nI have a custom log wrapper that utilizes log4net. I build a release assembly of MyLo... |
I am using Java Struts, sending it to user using the following codes
response.setContentType("application/vnd.ms-excel");
response.setHeader("Content-Disposition", "attachment;filename=" + fileFullName);
Firstly I hope that this is the correct place for my question... :) I hope
that you can help me.
The error message... | The issue you're experiencing with Internet Explorer when trying to open a CSV file directly from a web application using Struts can be attributed to a few potential causes. Here are some suggestions to help you resolve the problem:
### 1. Correct Content Type
Make sure you are setting the correct content type for CSV... | 37,456 | [
{
"from": "human",
"value": "I am using Java Struts, sending it to user using the following codes\nresponse.setContentType(\"application/vnd.ms-excel\"); \nresponse.setHeader(\"Content-Disposition\", \"attachment;filename=\" + fileFullName);\n\nFirstly I hope that this is the correct place for my question..... |
Once again a very beginner-ish question, but here I go:
I would like to use a servlet or similar to copy an uploaded file (from an html file select) to a permanent location. This is all I need to do with the file. I am currently going with using the Apache Commons FileUpload and IO libraries. Is there no easier or more... | Using Apache Commons FileUpload is a common approach to handling file uploads in Java servlets, but there are indeed other, more modern, and often simpler alternatives available, depending on your project setup. Here are a couple of options you can consider:
### 1. **Using Servlet 3.0 File Upload Support**
If you're u... | 33,804 | [
{
"from": "human",
"value": "Once again a very beginner-ish question, but here I go:\nI would like to use a servlet or similar to copy an uploaded file (from an html file select) to a permanent location. This is all I need to do with the file. I am currently going with using the Apache Commons FileUpload an... |
UPDATE: I discovered that I was calling the permalink from another table, with the old values. How can I take the data from the permalinks table and change only the permalinks column in the other table?
New id=7005 permalink=beef-ground-85%25-lean-meat-15%25-fat-raw
Old id=7005 permalink=beef-ground-85pct-lean... | It sounds like you're trying to update the `permalink` value in one table using values from another table in your Rails application, but after making the update, you're still seeing the old values. Here are some steps and considerations to help you troubleshoot this issue:
### 1. Update the `permalink`
If you want to... | 36,703 | [
{
"from": "human",
"value": "UPDATE: I discovered that I was calling the permalink from another table, with the old values. How can I take the data from the permalinks table and change only the permalinks column in the other table?\nNew id=7005 permalink=beef-ground-85%25-lean-meat-15%25-fat-raw\nOld ... |
I have Flex based consumer website where I would like to change various look and feel type settings based on random and other criteria, and then track these through to what results in the most sales.
For instance I might completely switch out the homepage, show different things depending upon where people come from. I... | Designing a flexible database schema for an A/B testing system or a dynamic content management system that can handle various look-and-feel settings, while also efficiently tracking user interactions and sales, is a critical step. You need to balance normalization (to reduce redundancy) with the need for quick access a... | 21,563 | [
{
"from": "human",
"value": "I have Flex based consumer website where I would like to change various look and feel type settings based on random and other criteria, and then track these through to what results in the most sales. \nFor instance I might completely switch out the homepage, show different thing... |
I was re-reading Effective Java (2nd edition) item 18, prefer interfaces to abstract classes. In that item Josh Bloch provides an example of a skeletal implementation of the Map.Entry<K,V> interface:
// Skeletal Implementation
public abstract class AbstractMapEntry<K,V>
implements Map.Entry<K,V> {
// Primi... | You raise some important points regarding the design choices made in the skeletal implementation of the `Map.Entry<K,V>` interface and the reasoning behind those choices as described in "Effective Java." Let's break down both of your questions.
### 1. Why are `getKey` and `getValue` explicitly declared as abstract met... | 35,249 | [
{
"from": "human",
"value": "I was re-reading Effective Java (2nd edition) item 18, prefer interfaces to abstract classes. In that item Josh Bloch provides an example of a skeletal implementation of the Map.Entry<K,V> interface:\n// Skeletal Implementation\npublic abstract class AbstractMapEntry<K,V>\n ... |
How can I set default value in ActiveRecord?
I see a post from Pratik that describes an ugly, complicated chunk of code: http://m.onkey.org/2007/7/24/how-to-set-default-values-in-your-model
class Item < ActiveRecord::Base
def initialize_with_defaults(attrs = nil, &block)
initialize_without_defaults(attrs) do
... | In ActiveRecord, setting default values for model attributes can be done in several ways. Here are the most common approaches:
### 1. Using `after_initialize` Callback
One of the cleanest ways to set default values for attributes in an ActiveRecord model is by using the `after_initialize` callback. This method is cal... | 38,949 | [
{
"from": "human",
"value": "How can I set default value in ActiveRecord?\nI see a post from Pratik that describes an ugly, complicated chunk of code: http://m.onkey.org/2007/7/24/how-to-set-default-values-in-your-model\nclass Item < ActiveRecord::Base \n def initialize_with_defaults(attrs = nil, &block)\... |
After installing asp.net (and aspnet_regIIS.exe -i) the site doesn't accept my default.aspx page. When trying to access it I get a 404.
When hitting directly to my mvc pages (/search.mvc for example) it works like a charm.
We checked the website configuration and noted that there are no .aspx references in the scriptma... | It seems like your IIS configuration might not be set up to handle `.aspx` pages correctly. Since you mentioned that you can access your MVC pages but are getting a 404 error for the `default.aspx` page, here are some steps to troubleshoot and resolve the issue:
### 1. Ensure ASP.NET is Enabled
Make sure that ASP.NET ... | 28,681 | [
{
"from": "human",
"value": "After installing asp.net (and aspnet_regIIS.exe -i) the site doesn't accept my default.aspx page. When trying to access it I get a 404.\nWhen hitting directly to my mvc pages (/search.mvc for example) it works like a charm.\nWe checked the website configuration and noted that th... |
I have this form in my view:
<!-- Bug (extra 'i') right here-----------v -->
<!-- was: <form method="post" enctype="mulitipart/form-data" action="/Task/SaveFile"> -->
<form method="post" enctype="multipart/form-data" action="/Task/SaveFile">
<input type="file" id="FileBlob" name="FileBlob"/>
<input type="submit" val... | It looks like you're encountering an issue with file uploads in your ASP.NET MVC application. The key problem is that you're trying to access the uploaded file from `Request.Files` after using `FormCollection` to access the form values. However, `Request.Files` is the correct way to access uploaded files, and using `Fo... | 37,826 | [
{
"from": "human",
"value": "I have this form in my view: \n<!-- Bug (extra 'i') right here-----------v -->\n<!-- was: <form method=\"post\" enctype=\"mulitipart/form-data\" action=\"/Task/SaveFile\"> -->\n<form method=\"post\" enctype=\"multipart/form-data\" action=\"/Task/SaveFile\">\n<input type=\"file\... |
I have a csv file of the format:
270291014011 ED HARDY - TRUE TO MY LOVE - Cap NEU 2008 NEU 0,00 € 0,00 € 0 1 0 22.10.2008 03:37:10 21.11.2008 02:37:10 21.11.2008 02:42:10 50 0 0 0 39,99 € http://i7.ebayimg.com/02/i/001/16/0d/68af_1.JPG?set_id=800005007 0 2 8.10.2008 13:40:20 8.10.2008 1... | Yes, it's possible to accomplish the tasks you've outlined using `awk` or `sed`. Below, I will provide examples for both tasks: removing HTML tags while keeping `<p>` tags and replacing specific `<embed>` tags with a formatted link.
### 1. Remove HTML Tags Except for `<p>` Tags
You can use `sed` to achieve this. Here... | 39,378 | [
{
"from": "human",
"value": "I have a csv file of the format:\n270291014011 ED HARDY - TRUE TO MY LOVE - Cap NEU 2008 NEU 0,00 € 0,00 € 0 1 0 22.10.2008 03:37:10 21.11.2008 02:37:10 21.11.2008 02:42:10 50 0 0 0 39,99 € http://i7.ebayimg.com/02/i/001/16/0d/68af_1.JPG?set_id=800005007 ... |
I'd like to know how to convert Perforce depot locations to client view locations for the purpose of script writing.
I have a script that first checks out a file for edit in perforce and then interacts with the file. I need to have the depot location (i.e. \Projects\Project6) converted to the client view location. (... | Yes, it is possible to convert Perforce depot locations to client view locations using the Perforce command-line tools or APIs. The mapping between depot paths and client workspace paths is defined in the Perforce client workspace specification (the client view).
Here's how you can achieve this:
### Steps to Convert ... | 34,635 | [
{
"from": "human",
"value": "I'd like to know how to convert Perforce depot locations to client view locations for the purpose of script writing.\nI have a script that first checks out a file for edit in perforce and then interacts with the file. I need to have the depot location (i.e. \\Projects\\Project... |
Hi i am encountering problems trying to post a WebRequest under Https.
i received the following errors
1.-The underlying connection was closed: Unable to connect to the remote server.
2.-the operation TimeOut
3-The underlying connection was closed: Could not establish secure channel for SSL/TLS.
i tried with about 3 o... | Based on the errors you're encountering, there are a few potential issues and troubleshooting steps to consider when making HTTPS WebRequest calls in .NET Framework 1.1:
### 1. SSL/TLS Configuration
The error `Could not establish secure channel for SSL/TLS` suggests there may be issues with SSL/TLS configuration. The ... | 37,162 | [
{
"from": "human",
"value": "Hi i am encountering problems trying to post a WebRequest under Https. \ni received the following errors\n1.-The underlying connection was closed: Unable to connect to the remote server.\n2.-the operation TimeOut\n3-The underlying connection was closed: Could not establish secur... |
I want my errors to float above, left-justified, the input field that doesn't validate. How can I do this?
If I can't, how can I turn the errors off? I still want the fields to validate (and highlight on error), but not for the actual error messages to display. I couldn't seem to find anything in the jQuery docs tha... | To achieve the behavior of displaying error messages above and left-justified to your input fields in a form, you can utilize jQuery along with some CSS. Below, I will provide a basic approach to display error messages above the input fields, and then I'll show you how to suppress the display of error messages while st... | 36,108 | [
{
"from": "human",
"value": "I want my errors to float above, left-justified, the input field that doesn't validate. How can I do this?\nIf I can't, how can I turn the errors off? I still want the fields to validate (and highlight on error), but not for the actual error messages to display. I couldn't se... |
I'm trying to write a simple ruby function that can prompt the user for a value and if the user presses ENTER by itself, then a default value is used.
In the following example, the first call to the Prompt function can be handled by pressing ENTER by itself and the default value will be used. However, the second time I... | The issue you're facing occurs because of how the input buffer works in Ruby. When you use `gets`, it waits for the user to press Enter, and if you have pressed Enter without entering any other character in a prior call, it may still contain an invisible newline or carriage return that affects subsequent calls to `gets... | 39,815 | [
{
"from": "human",
"value": "I'm trying to write a simple ruby function that can prompt the user for a value and if the user presses ENTER by itself, then a default value is used.\nIn the following example, the first call to the Prompt function can be handled by pressing ENTER by itself and the default valu... |
Greetings to all! This is my first question here on stackoverflow. I have a WPF application that I am writing for the fellow developers in my department, and there are a couple of settings that I need to check for at startup and update if they are not set (one is the location of an executable on the users computer, w... | Hello James! Welcome to Stack Overflow!
To update values in the `appSettings` section of the `app.config` file in a WPF application, you can use the `ConfigurationManager` class from the `System.Configuration` namespace. Here's how you can accomplish this:
1. **Read the existing setting**: You can read the existing s... | 37,439 | [
{
"from": "human",
"value": "Greetings to all! This is my first question here on stackoverflow. I have a WPF application that I am writing for the fellow developers in my department, and there are a couple of settings that I need to check for at startup and update if they are not set (one is the location ... |
I have a control application - using asp.net webservices.
I have a timer which does an asynchronous webservice call every 5 seconds to update the screen.There are also user buttons to refresh parts of the screen, also doing async webservice calls.
The issue is my screen get messy if a user webservice command is issued ... | To manage the synchronization between the timer's asynchronous web service calls and the user-triggered actions in JavaScript, you can use a simple flag to indicate when an async operation is in progress. By using this approach, you can make sure that user-triggered actions wait until the timer call has completed befor... | 36,884 | [
{
"from": "human",
"value": "I have a control application - using asp.net webservices.\nI have a timer which does an asynchronous webservice call every 5 seconds to update the screen.There are also user buttons to refresh parts of the screen, also doing async webservice calls.\nThe issue is my screen get me... |
I'm looking for a way to connect a Windows Mobile device to a PC via Bluetooth and have it show up on the PC as a HID device (i.e. Keyboard or Mouse). I imagine this would mostly be a matter of modifying the available Bluetooth profiles on the Windows Mobile device so that it exposes a Bluetooth HID interface... Is t... | Creating a Bluetooth HID interface on a Windows Mobile (WinMo) device to connect it as a keyboard or mouse to a PC is quite a complex task that involves several technical challenges. Here are some points to consider:
### Feasibility
1. **Windows Mobile Limitations**: WinMo devices typically have limited support for Bl... | 36,391 | [
{
"from": "human",
"value": "I'm looking for a way to connect a Windows Mobile device to a PC via Bluetooth and have it show up on the PC as a HID device (i.e. Keyboard or Mouse). I imagine this would mostly be a matter of modifying the available Bluetooth profiles on the Windows Mobile device so that it e... |
I'm using T4 for generating repositories for LINQ to Entities entities.
The repository contains (amongst other things) a List method suitable for paging. The documentation for Supported and Unsupported Methods does not mention it, but you can't "call" Skip on a unordered IQueryable. It will raise the following excepti... | To determine if an `IQueryable` contains any sorting (i.e., if it has an `OrderBy` applied), you can inspect the expression tree of the query. Since LINQ to Entities queries are built using expression trees, you'll need to look for `OrderBy`, `OrderByDescending`, or any other sorting operators in the tree.
Here's how ... | 37,390 | [
{
"from": "human",
"value": "I'm using T4 for generating repositories for LINQ to Entities entities. \nThe repository contains (amongst other things) a List method suitable for paging. The documentation for Supported and Unsupported Methods does not mention it, but you can't \"call\" Skip on a unordered IQu... |
I have some binary data I've read in. I wish to convert it to an System.Drawing.Image, so I create an instance of an Image object, using a memory stream as the input data.
After I've done that, I serialize then deserialize the image (for some business logic). The deserialize throws an exception. If I create the Image i... | The issue you are encountering with deserialization of the `Image` object created from a `MemoryStream` likely stems from how the `Bitmap` class handles the underlying stream. When you create a `Bitmap` using a `MemoryStream`, it may retain a reference to the stream, which could lead to problems when the `Image` object... | 38,618 | [
{
"from": "human",
"value": "I have some binary data I've read in. I wish to convert it to an System.Drawing.Image, so I create an instance of an Image object, using a memory stream as the input data.\nAfter I've done that, I serialize then deserialize the image (for some business logic). The deserialize th... |
For the following header I get the same two errors on all my sitemaps. It's confusing because, if Google can't read my sitemap, then how can they say that each URL has the same priority? The header counts as line 2, after the XML declaration. Google claims only to have indexed about 2% of the URLs from the maps. Pl... | The XML parsing errors you're experiencing with your sitemap are indeed related to the `xsi:schemaLocation` attribute, as well as the fact that your sitemap needs to comply with XML schema definitions to be correctly processed.
Here are the problems and how to fix them:
1. **SchemaLocation Attribute**: The `xsi:schem... | 36,491 | [
{
"from": "human",
"value": "For the following header I get the same two errors on all my sitemaps. It's confusing because, if Google can't read my sitemap, then how can they say that each URL has the same priority? The header counts as line 2, after the XML declaration. Google claims only to have indexe... |
So far I've seen many posts dealing with equality of floating point numbers. The standard answer to a question like "how should we decide if x and y are equal?" is
abs(x - y) < epsilon
where epsilon is a fixed, small constant. This is because the "operands" x and y are often the results of some computation where a rou... | Your intuition about floating-point comparisons, especially in the context of large magnitudes, is correct. Comparing floating-point numbers requires careful consideration of both absolute and relative differences to account for potential scaling issues.
### Absolute vs. Relative Error
The standard approach using `ab... | 38,702 | [
{
"from": "human",
"value": "So far I've seen many posts dealing with equality of floating point numbers. The standard answer to a question like \"how should we decide if x and y are equal?\" is\nabs(x - y) < epsilon\n\nwhere epsilon is a fixed, small constant. This is because the \"operands\" x and y are o... |
I have a winforms application that is doing the following:
on each query:
Db connect
Db query
Db disconnect
as we are trying to avoid having to keep the db connection open. This suffers from performance as we have to connect / disconnect everytime.
What is the idealized model here to have the fastest performance but... | In a WinForms application, continuously opening and closing database connections can lead to significant performance overhead, especially when the application is making many queries in quick succession. Instead, you can adopt a more efficient approach by using connection pooling, implementing a repository pattern, and ... | 35,698 | [
{
"from": "human",
"value": "I have a winforms application that is doing the following:\non each query:\n\nDb connect\nDb query\nDb disconnect\n\nas we are trying to avoid having to keep the db connection open. This suffers from performance as we have to connect / disconnect everytime.\nWhat is the idealiz... |
How do I search the whole classpath for an annotated class?
I'm doing a library and I want to allow the users to annotate their classes, so when the Web application starts I need to scan the whole classpath for certain annotation.
I'm thinking about something like the new functionality for Java EE 5 Web Services or EJB... | To search the entire classpath for classes with specific annotations at runtime, you can use several techniques. The approach generally involves classpath scanning to locate all classes, followed by reflection to check for the desired annotation. Here are some common methods and libraries you might consider for this ta... | 33,707 | [
{
"from": "human",
"value": "How do I search the whole classpath for an annotated class?\nI'm doing a library and I want to allow the users to annotate their classes, so when the Web application starts I need to scan the whole classpath for certain annotation.\nI'm thinking about something like the new func... |
Imagine you're creating a presentation that will be translated into a dozen different languages, including ones with non-latin characters (Chinese, for instance). The client's branding style guide dictates that certain fonts are acceptable for certain languages. The content itself is required to be externalized, so tha... | To accomplish the task of dynamically loading fonts in Flash while adhering to your client's branding style guide and ensuring that text can be externalized, you'll need to follow a systematic approach. Here’s how you can achieve this using ActionScript 3.0 in Flash:
### Step 1: Prepare Your Fonts
First, make sure you... | 33,296 | [
{
"from": "human",
"value": "Imagine you're creating a presentation that will be translated into a dozen different languages, including ones with non-latin characters (Chinese, for instance). The client's branding style guide dictates that certain fonts are acceptable for certain languages. The content itse... |
I have no idea. This causes seemingly random time-outs. These in turn break the flash that i am loading it into. Has anyone seen anything like this before?
<?php
require_once("../includes/class.database.php");
require_once("../includes/dbConnectInfo.inc");
require_once("../includes/functions.php");
include("../include... | The provided PHP code contains several potential issues that could lead to timeouts and break the Flash application loading the data. Here are some observations and suggestions for improving the code:
1. **Deprecated MySQL Extension**: The code uses the deprecated `mysql` extension, which is no longer supported in PHP... | 32,228 | [
{
"from": "human",
"value": "I have no idea. This causes seemingly random time-outs. These in turn break the flash that i am loading it into. Has anyone seen anything like this before?\n<?php\nrequire_once(\"../includes/class.database.php\");\nrequire_once(\"../includes/dbConnectInfo.inc\");\nrequire_once(\... |
I have an implicit scalar field defined in 2D, for every point in 2D I can make it compute an exact scalar value but its a somewhat complex computation.
I would like to draw an iso-line of that surface, say the line of the '0' value. The function itself is continuous but the '0' iso-line can have multiple continuous in... | Yes, your current approach using recursive space division (quad-tree) is a reasonable starting point for isoline extraction, but as you noted, it has limitations, particularly with transitions that do not align with the corners of the sampled squares. Here are some methods you can explore to improve your iso-line drawi... | 37,799 | [
{
"from": "human",
"value": "I have an implicit scalar field defined in 2D, for every point in 2D I can make it compute an exact scalar value but its a somewhat complex computation.\nI would like to draw an iso-line of that surface, say the line of the '0' value. The function itself is continuous but the '0... |
I am using Eclipse 3.3 ("Europa"). Periodically, Eclipse takes an inordinately long time (perhaps forever) to start up. The only thing I can see in the Eclipse log is:
!ENTRY org.eclipse.core.resources 2 10035 2008-10-16 09:47:34.801
!MESSAGE The workspace exited with unsaved changes in the previous session; r... | Eclipse 3.3 ("Europa") is quite an old version, and there can be various reasons for slow startup times, especially when dealing with workspace issues. Here are a few suggestions to help resolve the slow startup problem without starting from a new workspace:
1. **Clean the Workspace**:
Sometimes, cleaning the work... | 36,847 | [
{
"from": "human",
"value": "I am using Eclipse 3.3 (\"Europa\"). Periodically, Eclipse takes an inordinately long time (perhaps forever) to start up. The only thing I can see in the Eclipse log is:\n\n !ENTRY org.eclipse.core.resources 2 10035 2008-10-16 09:47:34.801\n !MESSAGE The workspace exited w... |
I've read a number of books and websites on the subject of TDD, and they all make a lot of sense, especially Kent Beck's book. However, when I try to do TDD myself, i find myself staring at the keyboard wondering how to begin. Is there a process you use? What is your thought process? How do you identify your first ... | Test-Driven Development (TDD) can be challenging to adopt, especially when transitioning from a traditional development approach. Here’s a structured process and thought process you might find helpful for practicing TDD effectively in real-world applications:
### 1. Understand the Requirements
Before you write any cod... | 31,134 | [
{
"from": "human",
"value": "I've read a number of books and websites on the subject of TDD, and they all make a lot of sense, especially Kent Beck's book. However, when I try to do TDD myself, i find myself staring at the keyboard wondering how to begin. Is there a process you use? What is your thought ... |
I'm programming in FORTRAN and C on an SGI running Irix 6.5, but this should be applicable to all Unix-like systems. How do I find which library I need to link to my program when I get an "unresolved text symbol" link error? Here's an example of what I'm seeing from the linker:
ld32: ERROR 33 Unresolved text symbol ... | When you encounter an "unresolved text symbol" error during linking, it indicates that the linker cannot find the definition of the specified symbol (in your case, `ortho2_`). Here are several strategies you can use to identify which library you need to link against:
### 1. Use `nm` to Inspect Library Contents
You ca... | 35,063 | [
{
"from": "human",
"value": "I'm programming in FORTRAN and C on an SGI running Irix 6.5, but this should be applicable to all Unix-like systems. How do I find which library I need to link to my program when I get an \"unresolved text symbol\" link error? Here's an example of what I'm seeing from the link... |
Update for future readers: When .NET 4 comes out, LazyInit<T> from the CTP will have been renamed to Lazy<T> and will be changed from a struct to a class, so very little of this will apply, except as an illustration of why mutable structs can be problematic if you're not careful.
I've been experimenting with LazyInit i... | The behavior you're experiencing is indeed due to how the `LazyInit<T>` was implemented as a mutable struct in the Parallel Extensions June CTP (Community Technology Preview). The `LazyInit<T>` class is designed to provide lazy initialization of an instance, ensuring that the instance is only created when it is accesse... | 37,665 | [
{
"from": "human",
"value": "Update for future readers: When .NET 4 comes out, LazyInit<T> from the CTP will have been renamed to Lazy<T> and will be changed from a struct to a class, so very little of this will apply, except as an illustration of why mutable structs can be problematic if you're not careful... |
In our web applications, we seperate our Data Access Layers out into their own projects.
This creates some problems related to settings.
Because the DAL will eventually need to be consumed from perhaps more than one application, web.config does not seem like a good place to keep the connection strings and some of the ... | You're facing a common challenge in the design of applications that require flexible and configurable settings across multiple environments, especially when these settings need to be easily adjustable without requiring recompilation or redeployment. Here are some best practices and strategies that you might consider to... | 37,123 | [
{
"from": "human",
"value": "In our web applications, we seperate our Data Access Layers out into their own projects.\nThis creates some problems related to settings. \nBecause the DAL will eventually need to be consumed from perhaps more than one application, web.config does not seem like a good place to k... |
I seem to be losing a lot of precision with floats.
For example I need to solve a matrix:
4.0x -2.0y 1.0z =11.0
1.0x +5.0y -3.0z =-6.0
2.0x +2.0y +5.0z =7.0
This is the code I use to import the matrix from a text file:
f = open('gauss.dat')
lines = f.readlines()
f.close()
j=0
for line in lines:
bits = string.spl... | Floating-point precision issues are common in numerical computations due to how numbers are represented in binary. Python's built-in `float` type is based on the IEEE 754 standard, which can lead to small inaccuracies, particularly when dealing with arithmetic operations. Here are a few ways to address your issues:
1.... | 33,622 | [
{
"from": "human",
"value": "I seem to be losing a lot of precision with floats.\nFor example I need to solve a matrix:\n4.0x -2.0y 1.0z =11.0\n1.0x +5.0y -3.0z =-6.0\n2.0x +2.0y +5.0z =7.0\n\nThis is the code I use to import the matrix from a text file:\nf = open('gauss.dat')\nlines = f.readlines()\nf.clo... |
In my database application I sometimes have to deal with null strings in the database. In most cases this is fine, but when it comes do displaying data in a form the Swing components - using JTextField for example - cannot handle null strings. (.setText(null) fails)
(EDIT: I just noticed that JTextField actually accept... | Handling null strings effectively in your application is important to ensure smooth functioning and a better user experience. Given your scenario, here are several best practices you can consider:
1. **Introduce a Utility Method**: Create a static utility method that converts null values to empty strings. This will ce... | 37,192 | [
{
"from": "human",
"value": "In my database application I sometimes have to deal with null strings in the database. In most cases this is fine, but when it comes do displaying data in a form the Swing components - using JTextField for example - cannot handle null strings. (.setText(null) fails)\n(EDIT: I ju... |
How do I write the getDB() function and use it properly?
Here is a code snippet of my App Object:
public class MyApp extends UiApplication {
private static PersistentObject m_oStore;
private static MyBigObjectOfStorage m_oDB;
static {
store = PersistentStore.getPersistentObject(0xa1a569278238dad2L... | Your `getDB()` function is correctly implemented to return a reference to the `m_oDB` object. This means that any changes made to the object through the reference returned by `getDB()` will directly affect the original `m_oDB` instance because both refer to the same underlying object.
However, there are a couple of im... | 36,913 | [
{
"from": "human",
"value": "How do I write the getDB() function and use it properly?\nHere is a code snippet of my App Object:\npublic class MyApp extends UiApplication {\n\n private static PersistentObject m_oStore;\n private static MyBigObjectOfStorage m_oDB;\n\n static {\n store = Persis... |
i have a data access layer which returns data from stored procedures. If i bind this to a gridview control in asp.net 2.0, the users then have an option of filtering on that data select list where in they can choose the conditional clause of
like
=
or
and
Once the result is returned, I do not want to hit the Db agai... | To filter a `GridView` control in ASP.NET without hitting the database again after the initial bind, you can implement client-side filtering using LINQ (if you switch to .NET 3.5) or perform filtering on the data in memory. Here's a step-by-step approach on how to achieve this in both .NET 2.0 and .NET 3.5.
### Option... | 31,909 | [
{
"from": "human",
"value": "i have a data access layer which returns data from stored procedures. If i bind this to a gridview control in asp.net 2.0, the users then have an option of filtering on that data select list where in they can choose the conditional clause of \n\nlike\n=\nor\nand\n\nOnce the resu... |
Every example I've seen of CGI/Perl basically a bunch of print statements containing HTML, and this doesn't seem like the best way to write a CGI app. Is there a better way to do this? Thanks.
EDIT: I've decided to use CGI::Application and HTML::Template, and use the following tutorial: http://docs.google.com/View?do... | Using `CGI::Application` and `HTML::Template` is indeed a much better approach for building CGI applications in Perl compared to using a series of `print` statements with embedded HTML. Here are some benefits and practices to consider with your chosen modules:
### Benefits
1. **Separation of Concerns**: `HTML::Templa... | 37,235 | [
{
"from": "human",
"value": "Every example I've seen of CGI/Perl basically a bunch of print statements containing HTML, and this doesn't seem like the best way to write a CGI app. Is there a better way to do this? Thanks.\nEDIT: I've decided to use CGI::Application and HTML::Template, and use the followin... |
WCF is Microsoft's replacement for .Net Remoting and Web services. It's critical to understand if you are a .NET component developer.
The best reference for WCF appears to be (by word of mouth, blogs and Amazon) Juval Lowy's "Programming WCF Services," published by O'Reilly.
This book is advertised in several places... | It seems you're encountering a common issue faced by many developers who are interested in Juval Lowy's "ServiceModelEx" library, especially as it pertains to the "Programming WCF Services" book. While Juval Lowy’s book is a highly regarded resource for understanding and working with Windows Communication Foundation (W... | 38,846 | [
{
"from": "human",
"value": "WCF is Microsoft's replacement for .Net Remoting and Web services. It's critical to understand if you are a .NET component developer. \nThe best reference for WCF appears to be (by word of mouth, blogs and Amazon) Juval Lowy's \"Programming WCF Services,\" published by O'Reill... |
How to use batch file to check if an application still running or not? If the application still running, this process will loop again and again. Else, there will be error message.
Thank you very much
| To create a batch file that checks if a specific application is still running and loops until it is not, you can use the `tasklist` command to check for the application's process and the `ping` command to create a delay.
Here’s a step-by-step guide to create such a batch file:
1. Open Notepad or any text editor.
2. C... | 37,671 | [
{
"from": "human",
"value": "How to use batch file to check if an application still running or not? If the application still running, this process will loop again and again. Else, there will be error message.\nThank you very much\n"
},
{
"from": "gpt",
"value": "To create a batch file that check... |
We would need to embed mathematical formulas through AsciiMathML into Google Sites pages (internal wiki for a research team). I am stuck with the limitation of Google Sites.
Any idea how to do that?
(ps: I have finally found a poorly practical work-around, but better ideas would still be appreciated)
| Embedding mathematical formulas into Google Sites can indeed be challenging due to its limitations. However, there are a few options you might consider to improve upon your current workaround:
1. **Use Google Docs**: One way to create mathematical formulas is to use Google Docs. You can insert equations into Google Do... | 36,944 | [
{
"from": "human",
"value": "We would need to embed mathematical formulas through AsciiMathML into Google Sites pages (internal wiki for a research team). I am stuck with the limitation of Google Sites.\nAny idea how to do that?\n(ps: I have finally found a poorly practical work-around, but better ideas wou... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.