instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
I'm trying to create some skinned forms (just the border and caption) with a different approach than you usually see but I'm having some issues with form flickering while I resize the form.
I don't know how else to explain the problem, so here's a video I created to demonstrate the problem:
http://www.screencast.com/t/... | Flickering during form resizing often occurs due to how the Windows Forms handles painting and redrawing of controls. To minimize or eliminate flickering, you can take several approaches:
### 1. Use Double Buffering
Enable double buffering on your form. Double buffering helps reduce flicker by drawing everything to an... | 49,049 | [
{
"from": "human",
"value": "I'm trying to create some skinned forms (just the border and caption) with a different approach than you usually see but I'm having some issues with form flickering while I resize the form.\nI don't know how else to explain the problem, so here's a video I created to demonstrate... |
This is what I am working with to get back to the web dev world
ASP.Net with VS2008
Subsonic as Data Access Layer
SqlServer DB
Home Project description:
I have a student registration system. I have a web page which should display the student records.
At present I have a gridview control which shows the records
The us... | It sounds like you're working on an interesting project! Filtering a dataset in memory (i.e., the result set returned from the initial query) is indeed possible, and you have a couple of approaches to implement this without hitting the database again. Here are some suggestions for how you can achieve dynamic filtering ... | 47,289 | [
{
"from": "human",
"value": "This is what I am working with to get back to the web dev world\nASP.Net with VS2008\nSubsonic as Data Access Layer\nSqlServer DB\nHome Project description:\nI have a student registration system. I have a web page which should display the student records. \nAt present I have a ... |
I am tasked with developing a web application and am thinking of using the Struts framework as it seems to be a standard and is easy to implement.
However, before making a decision I need to know the security features available in Struts.
Are there effective ways to handle the OWASP Top 10 using Struts?
And if so, h... | Apache Struts is a popular framework for building web applications in Java, but like any framework, it needs to be used carefully to ensure secure development practices. Here’s an overview of security features and strategies to address the OWASP Top 10 vulnerabilities using Struts:
### 1. **Injection Attacks (A1)**
... | 49,585 | [
{
"from": "human",
"value": "I am tasked with developing a web application and am thinking of using the Struts framework as it seems to be a standard and is easy to implement.\nHowever, before making a decision I need to know the security features available in Struts. \nAre there effective ways to handle t... |
I am designing a web app and I intent to embed data on an XML island so that I can dynamically render it on an HTML table on the client-side based on options the users will select.
I have the broad concepts, but I need pointers on how to use DOM in navigating my XML. And how to update my XML island possibly for posting... | Certainly! Working with XML islands in a web application to dynamically render data involves using the Document Object Model (DOM) to navigate and manipulate the XML. Below are some pointers and examples to help you with navigating your XML and updating it, along with client-side rendering in an HTML table.
### 1. Emb... | 48,974 | [
{
"from": "human",
"value": "I am designing a web app and I intent to embed data on an XML island so that I can dynamically render it on an HTML table on the client-side based on options the users will select.\nI have the broad concepts, but I need pointers on how to use DOM in navigating my XML. And how to... |
I would like to know the simplest and most effective way to open and write data to a socket in the C programming language for network programming.
| To open and write data to a socket in C, you generally follow a series of steps: create a socket, connect to a server (or bind if you're writing a server), send or receive data, and then close the socket. Here's a simplified example that demonstrates how to create a client socket, connect to a server, send data, and th... | 49,895 | [
{
"from": "human",
"value": "I would like to know the simplest and most effective way to open and write data to a socket in the C programming language for network programming.\n"
},
{
"from": "gpt",
"value": "To open and write data to a socket in C, you generally follow a series of steps: create... |
We have a system that is concurrently inserted a large amount of data from multiple stations while also exposing a data querying interface. The schema looks something like this (sorry about the poor formatting):
[SyncTable]
SyncID
StationID
MeasuringTime
[DataTypeTable]
TypeID
TypeName
[DataTable]
SyncI... | To achieve your goals of maximizing concurrency while ensuring that queries only return committed data and avoiding "dirty reads," you can consider a combination of techniques, which includes optimizing your transaction isolation levels, using appropriate locking strategies, and possibly leveraging other SQL Server fea... | 48,240 | [
{
"from": "human",
"value": "We have a system that is concurrently inserted a large amount of data from multiple stations while also exposing a data querying interface. The schema looks something like this (sorry about the poor formatting):\n[SyncTable]\n SyncID\n StationID\n MeasuringTime\n\n\n[DataType... |
Range intersection is a simple, but non-trivial problem.
Its has been answered twice already:
Find number range intersection
Comparing date ranges
The first solutions is O(n) and the second solution is for a database (which is less than O(n) of course).
I have the same problem, but for a large n and I am not within a... | To efficiently store a set of ranges and enable fast retrieval of intersecting ranges, you can consider several data structures that are well-suited for range queries. Here are a few options:
### 1. Interval Tree
An **interval tree** is a binary search tree variant that holds intervals (ranges) instead of single valu... | 46,397 | [
{
"from": "human",
"value": "Range intersection is a simple, but non-trivial problem.\nIts has been answered twice already:\n\nFind number range intersection\nComparing date ranges\n\nThe first solutions is O(n) and the second solution is for a database (which is less than O(n) of course).\nI have the same ... |
How does one prevent an inclusion cycle in C? ie. You shouldn't have a.h #include "b.h", which #include's "c.h" which #include's "a.h". I'm looking for a way of preventing this from happening using some sort of C directive.
I had originally thought this would've prevented this from happening:
Contents of a.h:
#ifndef _... | Preventing inclusion cycles in C header files is a common issue, and the approach you've taken with include guards is a standard way to prevent multiple inclusions. However, include guards alone do not prevent circular dependencies; they only prevent the same header file from being included multiple times in the same t... | 46,328 | [
{
"from": "human",
"value": "How does one prevent an inclusion cycle in C? ie. You shouldn't have a.h #include \"b.h\", which #include's \"c.h\" which #include's \"a.h\". I'm looking for a way of preventing this from happening using some sort of C directive.\nI had originally thought this would've prevented... |
I just installed an application on a win2003 server and I'm getting this error:
Line 149: <roleManager>
Line 150: <providers>
Line 151: <add name="AspNetSqlRoleProvider" connectionStringName="LocalSqlServer" applicationName="/" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Cultu... | The error message you are encountering indicates that the ASP.NET application is having trouble with the role management configuration as specified in `machine.config`. Here are some points to consider and steps to debug the issue:
### Understanding the Error
1. **Configuration Hierarchy**:
- ASP.NET applications ... | 41,564 | [
{
"from": "human",
"value": "I just installed an application on a win2003 server and I'm getting this error:\nLine 149: <roleManager>\nLine 150: <providers>\nLine 151: <add name=\"AspNetSqlRoleProvider\" connectionStringName=\"LocalSqlServer\" applicationName=\"/\" type=\"System.Web.Security.... |
I was curious as to what other shops are doing regarding base application frameworks? I look at an application framework as being able to provide additional or extended functionality to improve the quality of applications built from it.
There are a variety of out of the box frameworks, such as Spring (or Spring.NET), ... | It's great to hear about your hybrid approach to building a base application framework that balances between open-source components and custom development. Many organizations grapple with similar challenges, and your insights reflect a thoughtful strategy to optimize productivity and maintainability while addressing co... | 44,504 | [
{
"from": "human",
"value": "I was curious as to what other shops are doing regarding base application frameworks? I look at an application framework as being able to provide additional or extended functionality to improve the quality of applications built from it.\nThere are a variety of out of the box fr... |
I was searching here about converting a string like "16:20" to a DateTime type without losing the format, I said I dont want to add dd/MM/yyy or seconds or AM/PM, because db just accept this format.
I tried with Cultures yet
Thanks in Advance
| If you're looking to convert a string in the format "HH:mm" (e.g., "16:20") into a `DateTime` type in C#, but you want to retain the time-only aspect without adding any date information, you can do this by using the `DateTime.ParseExact` method. However, keep in mind that `DateTime` inherently includes date information... | 48,308 | [
{
"from": "human",
"value": "I was searching here about converting a string like \"16:20\" to a DateTime type without losing the format, I said I dont want to add dd/MM/yyy or seconds or AM/PM, because db just accept this format.\nI tried with Cultures yet\nThanks in Advance\n"
},
{
"from": "gpt",
... |
How are you tracking changes, testing effort for bugs that impact multiple artifacts released separately?
Code sharing is good because it reduces the total number of paths through the code which means more impact for fewer changes and less bugs (or more bugs addressed with fewer changes). For example, we may build a s... | Managing a complex software ecosystem with shared components requires a robust strategy for tracking changes, testing, and releases, particularly when dealing with bugs that affect multiple artifacts. Here are some suggestions and best practices to help achieve your goals:
### 1. **Centralized Issue Tracking with JIRA... | 44,278 | [
{
"from": "human",
"value": "How are you tracking changes, testing effort for bugs that impact multiple artifacts released separately?\nCode sharing is good because it reduces the total number of paths through the code which means more impact for fewer changes and less bugs (or more bugs addressed with fewe... |
I am trying to learn Python and WxPython. I have been a SAS programmer for years. This OOP stuff is slowly coming together but I am still fuzzy on a lot of the concepts. Below is a section of code. I am trying to use a button click to create an instance of another class. Specifically-I have my main panel in one cl... | It looks like you're trying to create a secondary panel (subPanel) when the user selects a menu item from the main panel. However, the way you are binding the menu item event to create an instance of `subPanel` is not correct.
In wxPython, when you want to handle an event (like a menu item selection), you need to bin... | 45,957 | [
{
"from": "human",
"value": "I am trying to learn Python and WxPython. I have been a SAS programmer for years. This OOP stuff is slowly coming together but I am still fuzzy on a lot of the concepts. Below is a section of code. I am trying to use a button click to create an instance of another class. Sp... |
I have a problem on how to read text from file and perform operations on it for example
i have this text file that include
//name-//sex---------//birth //m1//m2//m3
fofo, male, 1986, 67, 68, 69
momo, male, 1986, 99, 98, 100
Habs, female, 1988, 99, 100, 87
toto, male, 1989, 67, 68, 69
lolo, female, 1990,... | Don't worry! You're on the right track thinking about how to read the data and process it, and I'm here to help you through it. Let's break this down step by step.
### 1. Read the File
First, you'll want to read the contents of the text file line by line. You can use `File.ReadAllLines()` if you want to read all lines... | 47,769 | [
{
"from": "human",
"value": "I have a problem on how to read text from file and perform operations on it for example\ni have this text file that include\n//name-//sex---------//birth //m1//m2//m3\nfofo, male, 1986, 67, 68, 69\nmomo, male, 1986, 99, 98, 100\nHabs, female, 1988, 99, 100, 87\ntoto, ... |
my company is small with only one full time tester, and mostly we're doing web apps.
so i'm glad that we have tester as i think i would probably be bias or lazy when debugging my own code...
and our tester is actually located in another country, so usually we communicate via IM or email only. usually i try to do as muc... | It's great that you're already collaborating with a dedicated tester, and it sounds like you have a good process in place. However, there are always ways to improve communication and testing efficiency, especially in a remote setup. Here are some suggestions to help your tester find more bugs and improve the overall qu... | 49,788 | [
{
"from": "human",
"value": "my company is small with only one full time tester, and mostly we're doing web apps.\nso i'm glad that we have tester as i think i would probably be bias or lazy when debugging my own code...\nand our tester is actually located in another country, so usually we communicate via I... |
I am the newest member of a project that is an amalgam of various Applications written in various Programming Languages on both Unix and Windows operating systems. I get the 'honor' of figuring out how to implement a nightly Regression Build/Test for all these various Apps.
Unfortunately, these Apps were NOT built wit... | Implementing a nightly regression build/test for a diverse set of applications across different programming languages and operating systems can indeed be a daunting task. While it may seem like you're facing an insurmountable challenge with limited opportunities for code reuse, there are strategies you can adopt to max... | 48,773 | [
{
"from": "human",
"value": "I am the newest member of a project that is an amalgam of various Applications written in various Programming Languages on both Unix and Windows operating systems. I get the 'honor' of figuring out how to implement a nightly Regression Build/Test for all these various Apps. \nUn... |
I have a service that sometimes calls a batch file. The batch file takes 5-10 seconds to execute:
System.Diagnostics.Process proc = new System.Diagnostics.Process(); // Declare New Process
proc.StartInfo.FileName = fileName;
proc.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
proc.Sta... | The issue you're encountering seems to stem from the way services handle process execution and user permissions. When a service tries to execute a process that interacts with user sessions (like a command-line application), it may face issues, especially with UI interactions and output handling.
Here are some steps to... | 49,482 | [
{
"from": "human",
"value": "I have a service that sometimes calls a batch file. The batch file takes 5-10 seconds to execute:\nSystem.Diagnostics.Process proc = new System.Diagnostics.Process(); // Declare New Process\n proc.StartInfo.FileName = fileName;\n proc.StartInfo.WindowStyle = System.Diagnos... |
I have an issue where when a textField is clicked on in a UITableViewCell, the method tableView:didSelectRowAtIndexPath: does not get invoked. The problem is, I need to scroll my tableView into proper position, otherwise the keyboard goes right over the first responder.
I have to then move code like this:
[[self tableV... | Yes, your approach to creating a separate method for scrolling the `UITableView` is a good practice. This way, you avoid code duplication and ensure that scrolling is handled consistently from multiple locations.
Here's a suggested implementation:
1. **Create a Custom Method for Scrolling**: Define a method that take... | 43,625 | [
{
"from": "human",
"value": "I have an issue where when a textField is clicked on in a UITableViewCell, the method tableView:didSelectRowAtIndexPath: does not get invoked. The problem is, I need to scroll my tableView into proper position, otherwise the keyboard goes right over the first responder.\nI have ... |
I am creating an application for video capturing on a Windows Mobile device. In the MainFrame, there is a menu and status window (custom window). The video size width:height ratio is 4:3 so in the case, there are some other elements on the screen the video doesn't fill the whole area.
This is the function that arranges... | To achieve the desired effect of filling the available screen area with the video preview while maintaining the 4:3 aspect ratio, you will have to adjust the size and position of your camera view (`m_wndCameraView`). You can accomplish this by dynamically calculating the appropriate dimensions for the video view based ... | 49,377 | [
{
"from": "human",
"value": "I am creating an application for video capturing on a Windows Mobile device. In the MainFrame, there is a menu and status window (custom window). The video size width:height ratio is 4:3 so in the case, there are some other elements on the screen the video doesn't fill the whole... |
I'd like to set a connection string programmatically, with absolutely no change to any config files / registry keys.
I have this piece of code, but unfortunately it throws an exception with "the configuration is read only".
ConfigurationManager.ConnectionStrings.Clear();
string connectionString = "Server=myserver;Port=... | If you're trying to set a connection string programmatically without modifying any configuration files or registry keys, you'll need to work with the `DbConnection` class directly rather than relying on `ConfigurationManager.ConnectionStrings`.
`ConfigurationManager.ConnectionStrings` is read-only at runtime, and any... | 44,579 | [
{
"from": "human",
"value": "I'd like to set a connection string programmatically, with absolutely no change to any config files / registry keys.\nI have this piece of code, but unfortunately it throws an exception with \"the configuration is read only\".\nConfigurationManager.ConnectionStrings.Clear();\nst... |
I'd like to be able to detect Vista IE7 Protected Mode within a page using javascript, preferably. My thinking is to perform an action that would violate protected mode, thus exposing it. The goal is to give appropriate site help messaging to IE7 Vista users.
| Detecting Internet Explorer 7’s Protected Mode directly through JavaScript is challenging, as there’s no built-in method to query the browser's security features, including Protected Mode. However, you can infer whether Protected Mode is enabled by attempting to access restricted functionality and then handling the pot... | 48,780 | [
{
"from": "human",
"value": "I'd like to be able to detect Vista IE7 Protected Mode within a page using javascript, preferably. My thinking is to perform an action that would violate protected mode, thus exposing it. The goal is to give appropriate site help messaging to IE7 Vista users. \n"
},
{
"f... |
I'm developing a script that involves creating an email contact and forwarding mail to that contact. Last part of the script is to automatically send a test email to the address to make sure the forwarding works.
So I use the following code:
[void] [Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.Core")
[vo... | The error message "You cannot call a method on a null-valued expression" indicates that the `$olApp` object was not successfully created. This is likely due to differences in the environment between your home setup and your work setup.
When working with `Microsoft.Office.Interop.Outlook`, it is possible that Outlook i... | 47,507 | [
{
"from": "human",
"value": "I'm developing a script that involves creating an email contact and forwarding mail to that contact. Last part of the script is to automatically send a test email to the address to make sure the forwarding works.\nSo I use the following code:\n[void] [Reflection.Assembly]::LoadW... |
I would like to do something like this: a rotating cube on a form. I don't want to use any external library or dll, just pure .NET 3.5 (without directx). And a cube build with lines only. Could you please tell me how to do this?
I don't want to use external libraries because I don't need > 100 MB library to do this thi... | Creating a simple rotating cube using pure .NET 3.5 without any external libraries or frameworks such as DirectX can be done by leveraging GDI+ for drawing. Below is a basic example of how you can implement this in a Windows Forms application.
### Step 1: Create a New Windows Forms Application
1. Open Visual Studio a... | 46,614 | [
{
"from": "human",
"value": "I would like to do something like this: a rotating cube on a form. I don't want to use any external library or dll, just pure .NET 3.5 (without directx). And a cube build with lines only. Could you please tell me how to do this?\nI don't want to use external libraries because I ... |
I am attempting to programmatically monitor the size of a SQL Server database, so that my admin section of my web app can report it, and I can use that to execute some cleanup SPs, to clear log files, etc.
I use the following code to calculate the size of the tables, per SO recommendation:
CREATE TABLE #t (name SYSNAME... | To address your questions about monitoring the size of a SQL Server database and understanding the differences in reported sizes, here are the answers to each of your questions:
### 1. What else can make up the difference?
The difference in the reported database size can be attributed to several factors:
- **Log Fil... | 49,692 | [
{
"from": "human",
"value": "I am attempting to programmatically monitor the size of a SQL Server database, so that my admin section of my web app can report it, and I can use that to execute some cleanup SPs, to clear log files, etc.\nI use the following code to calculate the size of the tables, per SO rec... |
I'm parsing big XML file with XPathExpression selection for some nodes existing at various depth levels.
What is the easiest way to export selected nodes to separate XML file, preserving all direct-ancestors nodes (and their attributes)? C# is preferred.
Example source XML :
<a>
<x>
<b>
<c/>
<z/>
</b>
<... | To achieve your goal of exporting selected nodes while preserving their direct ancestor structure in XML, you can utilize the `XPathNavigator` class along with LINQ to XML in C#. Below, I've provided a step-by-step approach to construct the output XML based on your requirements.
### Step-by-Step Approach
1. Parse the... | 47,376 | [
{
"from": "human",
"value": "I'm parsing big XML file with XPathExpression selection for some nodes existing at various depth levels.\nWhat is the easiest way to export selected nodes to separate XML file, preserving all direct-ancestors nodes (and their attributes)? C# is preferred.\nExample source XML :\n... |
I've seen examples in silverlight where the achieve a effect using 1 of 2 ways:
Two image objects, both
displaying the same image, but the
bottom one rotating it 180 degrees
and applying a gradient image
opacity
A MediaElement object and a VideoBrush element.
I have a series of path objects, rectanges, etc which I wo... | In Silverlight, applying a reflection effect to visual elements like `Path`, `Rectangle`, etc. can indeed be achieved in a couple of ways. While manually copying and rotating the objects is one approach, there are more elegant solutions that can simplify your workflow. Here are a couple of alternatives:
### 1. Using a... | 46,835 | [
{
"from": "human",
"value": "I've seen examples in silverlight where the achieve a effect using 1 of 2 ways:\n\nTwo image objects, both\ndisplaying the same image, but the\nbottom one rotating it 180 degrees\nand applying a gradient image\nopacity\nA MediaElement object and a VideoBrush element.\n\nI have a... |
Avast there fellow programmers!
I have the following problem:
I have two rectangles overlapping like shown on the picture below.
I want to figure out the polygon consisting of point ABCDEF.
Alternate christmas description: The red cookie cutter is cutting away a bit of the black cookie. I want to calculate the black c... | Ahoy, fellow programmer! To find the polygon that represents the area of the black rectangle after the red rectangle has cut away its overlapping region, you can follow a series of steps that involve calculating the intersection of the two rectangles and then determining the resulting polygon. Here’s a structured appro... | 48,668 | [
{
"from": "human",
"value": "Avast there fellow programmers!\nI have the following problem:\nI have two rectangles overlapping like shown on the picture below.\n\nI want to figure out the polygon consisting of point ABCDEF.\nAlternate christmas description: The red cookie cutter is cutting away a bit of the... |
I am using jfreechart to draw the graphs. I need to show the value when the cursor is placed on the graph.
| To display the value when the cursor hovers over a graph in JFreeChart, you can utilize a `ChartMouseListener` to respond to mouse movements and show a tooltip with the data value at the mouse pointer's location. Here's a basic example of how to implement this:
1. First, make sure you have JFreeChart added to your pro... | 49,223 | [
{
"from": "human",
"value": "I am using jfreechart to draw the graphs. I need to show the value when the cursor is placed on the graph.\n"
},
{
"from": "gpt",
"value": "To display the value when the cursor hovers over a graph in JFreeChart, you can utilize a `ChartMouseListener` to respond to mo... |
I am trying to use the System.Net.Mail.MailMessage class in C# to create an email that is sent to a list of email addresses all via BCC. I do not want to include a TO address, but it seems that I must because I get an exception if I use an empty string for the TO address in the MailMessage constructor. The error states... | In C#, when using the `System.Net.Mail.MailMessage` class, it's indeed required to specify at least one address in the "To" field when you create an instance of `MailMessage`. However, if you want to send an email solely using BCC and don't want to show any recipients in the "To" field, you can simply provide a dummy e... | 49,224 | [
{
"from": "human",
"value": "I am trying to use the System.Net.Mail.MailMessage class in C# to create an email that is sent to a list of email addresses all via BCC. I do not want to include a TO address, but it seems that I must because I get an exception if I use an empty string for the TO address in the ... |
I am looking for a bells and whistles CSS framework. I have found a number online that deal with "grids", and some that deal with "typography" and others that deal with "resetting".
What I have not found is something that will give my web applications a consistent reusable style or theme.
I guess it would have to have ... | It sounds like you're looking for a comprehensive CSS framework that provides a wide variety of pre-designed components, themes, and skinning capabilities, but is independent of any specific JavaScript libraries. Here are some CSS frameworks and libraries that might meet your needs:
### 1. **Bootstrap**
- **Overview**... | 47,985 | [
{
"from": "human",
"value": "I am looking for a bells and whistles CSS framework. I have found a number online that deal with \"grids\", and some that deal with \"typography\" and others that deal with \"resetting\".\nWhat I have not found is something that will give my web applications a consistent reusabl... |
I've used the Views Theming Wizard to output a template and it gave me the following chunk of code to go in template.php.
I'd prefer to just maintain the one template, so all my functions will be calling the same one, and rather than writing numerous versions of the same function, I'm wondering if there's a way to stri... | Hi Steve,
It seems you're looking to streamline your code by using a single function to handle multiple view types in Drupal. You can achieve this by passing a parameter that determines the type of view being processed, and then executing common logic within a single function. Here's an approach you might consider:
1... | 45,567 | [
{
"from": "human",
"value": "I've used the Views Theming Wizard to output a template and it gave me the following chunk of code to go in template.php.\nI'd prefer to just maintain the one template, so all my functions will be calling the same one, and rather than writing numerous versions of the same functi... |
I have thread exception handler which saves the exception stack trace and should close the application. I call Applicatoin.Exit, but that only closes the window, living the app running windowless.
I know, that this usually happens because some background threads are still running. I attached windbg to the windowless p... | When you call `Application.Exit()` in a WPF application, it signals the application to close, but it doesn't necessarily terminate all running threads immediately. This is particularly true if you have background threads running or if your application's message loop is still active.
### Differences Between `Applicatio... | 47,176 | [
{
"from": "human",
"value": "I have thread exception handler which saves the exception stack trace and should close the application. I call Applicatoin.Exit, but that only closes the window, living the app running windowless. \nI know, that this usually happens because some background threads are still runn... |
I'm running a django instance behind nginx connected using fcgi (by using the manage.py runfcgi command). Since the code is loaded into memory I can't reload new code without killing and restarting the django fcgi processes, thus interrupting the live website. The restarting itself is very fast. But by killing the fcgi... | To achieve zero-downtime deployment in your Django application that is running with FastCGI (fcgi) behind Nginx, you can use a technique that involves gradually replacing the old processes with new ones without interrupting active connections. Here are some strategies you can consider:
### 1. Use `supervisor` or `syst... | 48,232 | [
{
"from": "human",
"value": "I'm running a django instance behind nginx connected using fcgi (by using the manage.py runfcgi command). Since the code is loaded into memory I can't reload new code without killing and restarting the django fcgi processes, thus interrupting the live website. The restarting its... |
I need a portable C/C++ solution, so I'm looking for a C/C++ client library for Memcached that work on both Windows and Unix. Any suggestions?
| For a portable C/C++ client library for Memcached that works on both Windows and Unix, you can consider the following options:
1. **libmemcached**:
- **Description**: A C client library for Memcached that is lightweight and portable. It provides a rich API and supports both simple and complex commands.
- **Platf... | 49,063 | [
{
"from": "human",
"value": "I need a portable C/C++ solution, so I'm looking for a C/C++ client library for Memcached that work on both Windows and Unix. Any suggestions?\n"
},
{
"from": "gpt",
"value": "For a portable C/C++ client library for Memcached that works on both Windows and Unix, you ... |
I have two system calls GetSystemTime() and GetThreadTimes() that I need to calculate the CPU utilization by a given Win32 thread.
For the sake of accuracy, I need to ensure that both GetSystemTime() and GetThreadTimes() are executed atomically; i.e. there should be no context switch in between a call to GetSystemTime(... | To achieve atomic execution of `GetSystemTime()` and `GetThreadTimes()` such that there are no context switches between the two calls, you can take advantage of critical sections, mutexes, or other synchronization mechanisms provided by the Win32 API. The basic idea is to block other threads from executing while you pe... | 46,270 | [
{
"from": "human",
"value": "I have two system calls GetSystemTime() and GetThreadTimes() that I need to calculate the CPU utilization by a given Win32 thread.\nFor the sake of accuracy, I need to ensure that both GetSystemTime() and GetThreadTimes() are executed atomically; i.e. there should be no context ... |
I couldn't complie java file using GBK encoding in eclipse. there is no "GBK" option in properties of project,even though I have typed the "GBK" in "Text file encoding".
my eclipse is installed in ubuntu, maybe the default file-encoding of my ubuntu is utf-8. How to configure the ubuntu and let it support "GBK" in ecli... | To configure Eclipse to use GBK encoding for your Java files on Ubuntu, you can follow these steps:
### Step 1: Configure Eclipse Settings
1. **Open Eclipse**:
Launch your Eclipse IDE.
2. **Change Workspace Encoding**:
- Go to `Window` -> `Preferences`.
- In the Preferences window, expand the `General` sect... | 48,082 | [
{
"from": "human",
"value": "I couldn't complie java file using GBK encoding in eclipse. there is no \"GBK\" option in properties of project,even though I have typed the \"GBK\" in \"Text file encoding\".\nmy eclipse is installed in ubuntu, maybe the default file-encoding of my ubuntu is utf-8. How to confi... |
I've downloaded the svntask for ant from tigris.org, so it is the "official" one.
I have a simple task to update my entire project
<target name="prepare">
<svn username="user" password="pass">
<update>
<fileset dir="."/>
</update>
</svn>
</target>
Running this task t... | The performance issue you're experiencing when using the `svntask` Ant task compared to the command line `svn update` could be due to a few different factors. Here are some ideas to investigate and potential solutions to consider:
1. **Ant Environment Configuration**:
- Ensure that your Ant environment is correctly... | 49,657 | [
{
"from": "human",
"value": "I've downloaded the svntask for ant from tigris.org, so it is the \"official\" one.\nI have a simple task to update my entire project\n<target name=\"prepare\">\n <svn username=\"user\" password=\"pass\">\n <update> \n <fileset dir=\".\"/>\n ... |
I have a .NET 3.5 C# library that uses OleDb to pull data from an Excel file and return it in a DataRowCollection which is used by a CLR Table-Valued Function in SQL Server 2005.
I deployed the ASSEMBLY in SQL Server as sa and used PERMISSION_SET = EXTERNAL_ACCESS. The sa login has EXTERNAL ACCESS ASSEMBLY and the dat... | The error message you are encountering is related to code access security (CAS) in .NET, specifically around the permissions required by the `OleDb` provider when accessed from a SQL Server CLR environment. Given the context you've provided, here are some steps and considerations to help troubleshoot and potentially re... | 46,749 | [
{
"from": "human",
"value": "I have a .NET 3.5 C# library that uses OleDb to pull data from an Excel file and return it in a DataRowCollection which is used by a CLR Table-Valued Function in SQL Server 2005.\nI deployed the ASSEMBLY in SQL Server as sa and used PERMISSION_SET = EXTERNAL_ACCESS. The sa logi... |
I'm developing an ASP.NET 2.0 application that includes Crystal Reports (version 10, included with VS 2005). Originally, the reports were working properly, both when run from my machine using the ASP.NET development web server, and also when deployed to an IIS server.
I made some changes to the reports and re-deployed... | It sounds like you're encountering a common issue where the updated Crystal Reports are not reflecting on your IIS server after deployment. Here are several suggestions to help troubleshoot and resolve the problem:
1. **Check Deployment Location**:
- Ensure that the updated .rpt files were deployed to the correct l... | 47,327 | [
{
"from": "human",
"value": "I'm developing an ASP.NET 2.0 application that includes Crystal Reports (version 10, included with VS 2005). Originally, the reports were working properly, both when run from my machine using the ASP.NET development web server, and also when deployed to an IIS server.\nI made s... |
I am new to php and wanted to make a blog using php where every one can see the contents posted in the site but another administrator page should be there which can edit, add or delete posts
How can i code a page like that? What are the logics required?
| Creating a simple blog in PHP that allows users to view posts and administrators to manage (add, edit, delete) posts involves a few key components. Below is a structured guide to help you get started.
### 1. Setup Your Environment
Make sure you have a local development environment ready. You can use:
- **XAMPP** or ... | 38,441 | [
{
"from": "human",
"value": "I am new to php and wanted to make a blog using php where every one can see the contents posted in the site but another administrator page should be there which can edit, add or delete posts\nHow can i code a page like that? What are the logics required?\n"
},
{
"from": ... |
Is there a way to set up a second persistence.xml file in a Maven project such that it is used for testing instead of the normal one that is used for deployment?
I tried putting a persistence.xml into src/test/resources/META-INF, which gets copied into target/test-classes/META-INF, but it seems target/classes/META-INF ... | Yes, you can set up a separate `persistence.xml` file for your testing environment in a Maven project. It sounds like you've taken the right steps, but let's clarify how to ensure that your test configuration is used correctly.
### Directory Structure
You should indeed place your test-specific `persistence.xml` file ... | 48,104 | [
{
"from": "human",
"value": "Is there a way to set up a second persistence.xml file in a Maven project such that it is used for testing instead of the normal one that is used for deployment?\nI tried putting a persistence.xml into src/test/resources/META-INF, which gets copied into target/test-classes/META-... |
How can I write a semi transparent text on an Image (Jpg,Bmp), or a transparent text (color as same background Image) but with a shadow, something I want to do to watermark the images.
I want to accomplish that using Delphi win32.
| To create semi-transparent text or transparent text with a shadow for watermarking images in Delphi Win32, you can use the GDI (Graphics Device Interface) or GDI+. GDI+ provides better support for transparency and text rendering.
Here’s a simple approach using GDI+ to draw semi-transparent text or transparent text wit... | 45,443 | [
{
"from": "human",
"value": "How can I write a semi transparent text on an Image (Jpg,Bmp), or a transparent text (color as same background Image) but with a shadow, something I want to do to watermark the images.\nI want to accomplish that using Delphi win32.\n"
},
{
"from": "gpt",
"value": "To... |
In my C++ program (on Windows), I'm allocating a block of memory and can make sure it stays locked (unswapped and contiguous) in physical memory (i.e. using VirtualAllocEx(), MapUserPhysicalPages() etc).
In the context of my process, I can get the VIRTUAL memory address of that block,
but I need to find out the PHYS... | To address your questions about obtaining the physical address from a virtual address in Windows, let's break down the problem step by step.
### 1. Translating Virtual Address to Physical Address in User Mode
In user mode, you cannot directly translate a virtual address to a physical address. Windows is designed with ... | 49,025 | [
{
"from": "human",
"value": "In my C++ program (on Windows), I'm allocating a block of memory and can make sure it stays locked (unswapped and contiguous) in physical memory (i.e. using VirtualAllocEx(), MapUserPhysicalPages() etc). \nIn the context of my process, I can get the VIRTUAL memory address of tha... |
I'm compiling library for a private project, which depends on a number of libraries. Specifically one of the dependencies is compiled with Fortran. On some instances, I've seen the dependency compiled with g77, on others I've seen it compiled with gfortran. My project then is ./configure'd to link with either -lg2c or ... | To determine whether a compiled Fortran library uses `g77` or `gfortran`, you can use the `nm` utility or `objdump` to inspect the symbols in the library. Each compiler has distinct naming conventions for symbols, which can help you identify which compiler was used to create the library. Here are steps you can take:
#... | 48,549 | [
{
"from": "human",
"value": "I'm compiling library for a private project, which depends on a number of libraries. Specifically one of the dependencies is compiled with Fortran. On some instances, I've seen the dependency compiled with g77, on others I've seen it compiled with gfortran. My project then is ./... |
I have a lengthy user-interface operation on my form which is triggered whenever an event is fired. Rather than have the UI block while the operation takes place, I'd like to perform the operation in another thread, and abort that thread and start again if the event fires again.
However, to safely alter controls on my... | To achieve the desired functionality without blocking the UI or complicating your code with multiple delegates for each UI operation, you can utilize the `BackgroundWorker` component or `Task` with `async/await`, which greatly simplifies multithreading in WinForms applications while keeping the UI responsive.
The `Bac... | 47,763 | [
{
"from": "human",
"value": "I have a lengthy user-interface operation on my form which is triggered whenever an event is fired. Rather than have the UI block while the operation takes place, I'd like to perform the operation in another thread, and abort that thread and start again if the event fires again... |
Hello all you helpful folks @ stackoverflow!
Best resources for Java GUI's?
Looking at the Java Documentation, it is pretty easy to figure out the basics of JButtons, JFrames, etc but grasping the concepts of accessing JComponents from a frame, what creating a different panel does, etc is not very easy to understand.
I... | Hello! Here are some great resources and recommendations for learning about Java GUI programming, particularly with Swing. These include tutorials, online resources, and book suggestions to help you grasp the concepts more effectively.
### Online Tutorials
1. **Java Tutorials by Oracle**:
- The official [Java Tuto... | 47,839 | [
{
"from": "human",
"value": "Hello all you helpful folks @ stackoverflow!\nBest resources for Java GUI's?\nLooking at the Java Documentation, it is pretty easy to figure out the basics of JButtons, JFrames, etc but grasping the concepts of accessing JComponents from a frame, what creating a different panel ... |
I'm getting this worthless error in my code. it's very consistant and restarting the compiler hasn't done anything. Has anyone else ever solved this?
while( int CharPos = _Message.Pos(_What) )
{
_Message.Insert( _With, CharPos);
_Message.Delete(CharPos + 1, 1);
}
| It looks like there are a couple of potential issues in your code snippet. Without knowing the specific error message you're encountering, I'll go through some common problems and improvements related to your code.
1. **Condition in While Loop**: The condition `int CharPos = _Message.Pos(_What)` is not correct for the... | 49,924 | [
{
"from": "human",
"value": "I'm getting this worthless error in my code. it's very consistant and restarting the compiler hasn't done anything. Has anyone else ever solved this? \nwhile( int CharPos = _Message.Pos(_What) )\n{\n _Message.Insert( _With, CharPos);\n _Message.Delete(CharPos + 1, 1);\n... |
Is there a way to check how much a flash file is (down)loaded to the page before it is shown?
Our team cant put loading indicator inside the flash file because the swf file is uploaded by our client. Is there some kind of property on xmlhttprequest that we can use to indicate how much has been downloaded?
Or any other ... | To monitor the download progress of a Flash file (SWF) before it is fully loaded, you have a few options, but these depend on the context in which the Flash file is being used. Here are some potential approaches you could consider:
### 1. Use the HTML `<object>` or `<embed>` Tag
When you include a Flash file in your ... | 49,424 | [
{
"from": "human",
"value": "Is there a way to check how much a flash file is (down)loaded to the page before it is shown?\nOur team cant put loading indicator inside the flash file because the swf file is uploaded by our client. Is there some kind of property on xmlhttprequest that we can use to indicate h... |
I'd like to play mp3 files (b/c they compress smaller than .wav's) from a vb6 app but without needing any other player installed.
Any suggestions?
| Playing MP3 files in a VB6 application without requiring an external player can be accomplished using a few different methods. One of the simplest ways is to use a third-party library or ActiveX control that handles MP3 playback. Here are a few options you can consider:
### 1. **Using the Windows Media Player ActiveX ... | 46,937 | [
{
"from": "human",
"value": "I'd like to play mp3 files (b/c they compress smaller than .wav's) from a vb6 app but without needing any other player installed.\nAny suggestions?\n"
},
{
"from": "gpt",
"value": "Playing MP3 files in a VB6 application without requiring an external player can be acc... |
I am creating a web service that generates the following in the WSDL file:
<wsdl:portType name="myServicePortSoap">
and would like to have it renamed to generate:
<wsdl:portType name="myServicePort">
How can I do that within the .asmx file to do so? Any ideas please?
| To change the name of the `wsdl:portType` in an `.asmx` web service, you'll need to override the default WSDL generation behavior provided by ASP.NET. Here’s a step-by-step approach to achieve this.
1. **Create a custom ASMX handler**: You can override the `GetWSDL` method in your ASMX service to customize the WSDL ou... | 48,591 | [
{
"from": "human",
"value": "I am creating a web service that generates the following in the WSDL file:\n<wsdl:portType name=\"myServicePortSoap\">\n\nand would like to have it renamed to generate:\n<wsdl:portType name=\"myServicePort\">\n\nHow can I do that within the .asmx file to do so? Any ideas please?... |
I have a .NET application which uses an accdb file (MS Access 2007 format) as its database. To install this app on another machine I need to install the Access engine on that machine. Microsoft has this file: AccessDatabaseEngine.exe which includes the engine, but when extracted during installation, runs another .msi i... | Integrating the Microsoft Access Database Engine installation into your .NET application's installer can be a bit challenging due to the way the installers are structured. However, there are a few approaches you can take to handle this issue. Here are some suggestions:
### 1. Use a Bootstrapper or Wrapper
You can crea... | 49,830 | [
{
"from": "human",
"value": "I have a .NET application which uses an accdb file (MS Access 2007 format) as its database. To install this app on another machine I need to install the Access engine on that machine. Microsoft has this file: AccessDatabaseEngine.exe which includes the engine, but when extracted... |
I have to store blog style comments in a database. Each comment can have a parent one.
I am doing it with a column called "parentComment" that has a null value when it is a top level comment or have a value if it is a response to another comment.
What is the most efficient way to retrieve a comment and all its childs?... | To efficiently retrieve a comment along with all its child comments in a hierarchical structure (where comments can have parent-child relationships), you can use the following approaches depending on your database system and how complex your needs are.
### 1. Recursive Common Table Expressions (CTE)
If you're using a... | 44,656 | [
{
"from": "human",
"value": "I have to store blog style comments in a database. Each comment can have a parent one. \nI am doing it with a column called \"parentComment\" that has a null value when it is a top level comment or have a value if it is a response to another comment.\nWhat is the most efficient ... |
jQuery return links are not working. I have Used jQuery and the basic Ajax feature. My jQuery returns the links from file Links_ajax.php.
I giving the code samples.
GetCustomerData.php has:
<html>
<script type="text/javascript">
<script src="ajax.js" type="text/javascript">
$(function() {
.... | Based on the provided code, it looks like you're trying to make AJAX calls to load links dynamically and then fetch additional data when those links are clicked. However, there are a few issues in your code that could be preventing the expected behavior. Let's go through your code and identify potential problems and im... | 49,228 | [
{
"from": "human",
"value": "jQuery return links are not working. I have Used jQuery and the basic Ajax feature. My jQuery returns the links from file Links_ajax.php.\nI giving the code samples.\nGetCustomerData.php has:\n<html>\n <script type=\"text/javascript\">\n <script src=\"ajax.js\" type=\"text... |
The most recent Crystal XI component for Delphi was released for Delphi 7. That VCL component compiles in D2007, but gives me errors at runtime. What is the best way to display a database-connected Crystal Report in a Delphi 2007 application?
| To display a database-connected Crystal Report in a Delphi 2007 application, given that the Crystal XI component is designed for Delphi 7 and may not function correctly in Delphi 2007, you have a few options:
### 1. Use the Crystal Reports .NET SDK
If you have access to Crystal Reports for Visual Studio, you can creat... | 49,623 | [
{
"from": "human",
"value": "The most recent Crystal XI component for Delphi was released for Delphi 7. That VCL component compiles in D2007, but gives me errors at runtime. What is the best way to display a database-connected Crystal Report in a Delphi 2007 application?\n"
},
{
"from": "gpt",
... |
I was trying the ASP.NET login control tutorial and everything works well. However, I do not know how to have the Log-in control use my own database (SQL Server 2005) instead of using it's mdf file. I also have no idea where this file was created from since it doesn't show up at all on my solution. Any literature that ... | If you are using the ASP.NET Login control and you want to integrate it with your own SQL Server database instead of the default Membership database (which often uses an MDF file), you'll need to take a few steps to customize the setup. Here’s how you can achieve that, along with some resources for further reading.
##... | 49,462 | [
{
"from": "human",
"value": "I was trying the ASP.NET login control tutorial and everything works well. However, I do not know how to have the Log-in control use my own database (SQL Server 2005) instead of using it's mdf file. I also have no idea where this file was created from since it doesn't show up at... |
Running a ServiceHost with a single contract is working fine like this:
servicehost = new ServiceHost(typeof(MyService1));
servicehost.AddServiceEndpoint(typeof(IMyService1), new NetTcpBinding(), "net.tcp://127.0.0.1:800/MyApp/MyService1");
servicehost.Open();
Now I'd like to add a second (3rd, 4th, ...) contract. My ... | You're on the right track with your approach, but as you've noticed, the `ServiceHost` constructor you are using only allows you to specify a single service implementation type (`MyService1` in your example). If you want to expose multiple contracts (interfaces) with different implementations through a single service h... | 43,133 | [
{
"from": "human",
"value": "Running a ServiceHost with a single contract is working fine like this:\nservicehost = new ServiceHost(typeof(MyService1));\nservicehost.AddServiceEndpoint(typeof(IMyService1), new NetTcpBinding(), \"net.tcp://127.0.0.1:800/MyApp/MyService1\");\nservicehost.Open();\n\nNow I'd li... |
I have the following problem: some processes, generated dynamically, have a tendency to eat 100% of CPU. I would like to limit all the process matching some criterion (e.g. process name) to a certain amount of CPU percentage.
The specific problem I'm trying to solve is harnessing folding@home worker processes. The best... | To limit the CPU usage of dynamically generated processes, particularly for a specific user, you have a few options. Here are some suggestions that may help you achieve the desired CPU percentage cap without relying solely on external scripts like `cpulimit`:
### 1. **cgroups (Control Groups)**
Linux cgroups allow yo... | 49,975 | [
{
"from": "human",
"value": "I have the following problem: some processes, generated dynamically, have a tendency to eat 100% of CPU. I would like to limit all the process matching some criterion (e.g. process name) to a certain amount of CPU percentage.\nThe specific problem I'm trying to solve is harnessi... |
Possible Duplicate:
WPF versus Windows Forms
I presume that WPF is intended to eventually replace Windows Forms altogether, but for now, they are both shipping.
My question is, when is one more appropriate than another? Should we be leaving Windows Forms to legacy and creating new Windows Clients in WPF only?
Discla... | The decision to use WPF (Windows Presentation Foundation) or Windows Forms (WinForms) for a new Windows client application depends on several factors, including your project requirements, team expertise, and long-term maintenance considerations. Here are some guidelines to help you decide when to use one over the other... | 49,374 | [
{
"from": "human",
"value": "\nPossible Duplicate:\nWPF versus Windows Forms \n\nI presume that WPF is intended to eventually replace Windows Forms altogether, but for now, they are both shipping.\nMy question is, when is one more appropriate than another? Should we be leaving Windows Forms to legacy and cr... |
I'm reading through "A Gentle Introduction to Haskell," and early on it uses this example, which works fine in GHC and horribly in my brain:
initial = 0
next resp = resp
process req = req+1
reqs = client initial resps
resps = server reqs
s... | This is a great question, and it touches on some important concepts in Haskell, such as lazy evaluation and infinite data structures. Let’s break down the code you've presented step by step.
### Definitions
1. **Initial State**:
```haskell
initial = 0
```
2. **Next Response**:
```haskell
next resp = ... | 49,954 | [
{
"from": "human",
"value": "I'm reading through \"A Gentle Introduction to Haskell,\" and early on it uses this example, which works fine in GHC and horribly in my brain:\ninitial = 0\nnext resp = resp\nprocess req = req+1\n\nreqs = client initia... |
Here is new C# future in version 4.0 known as dynamic. Show me the way i can use it in my code and how this future can help me?
Related questions:
Does the new ‘dynamic’ C# 4.0 keyword deprecate the ‘var’ keyword ?
What do you think of the new C# 4.0 ‘dynamic’ keyword?
| The `dynamic` keyword introduced in C# 4.0 provides a way to bypass compile-time type checking, allowing for more flexible and dynamic programming. When you declare a variable as `dynamic`, its type is resolved at runtime, which can be useful in certain scenarios such as interacting with COM objects, using dynamic lang... | 41,346 | [
{
"from": "human",
"value": "Here is new C# future in version 4.0 known as dynamic. Show me the way i can use it in my code and how this future can help me?\n\nRelated questions:\n\nDoes the new ‘dynamic’ C# 4.0 keyword deprecate the ‘var’ keyword ?\nWhat do you think of the new C# 4.0 ‘dynamic’ keyword?\n\... |
is there an easy way of importing data from a mysql/odbc datasource into an excel spreadsheet?
The user should be able to select some values from drop downs (e..g date range, branch name etc.) and the values from the dropdown should be used to populate (prepared) SQL statements. The results should be displayed in the ... | Yes, you can achieve this in Excel by using a combination of Data Connections, VBA (Visual Basic for Applications), and form controls (such as Combo Boxes for dropdowns). Here's a step-by-step approach to set up a solution based on your requirements:
### Step 1: Set Up Your MySQL/ODBC Connection
1. **Install MySQL ODB... | 47,268 | [
{
"from": "human",
"value": "is there an easy way of importing data from a mysql/odbc datasource into an excel spreadsheet? \nThe user should be able to select some values from drop downs (e..g date range, branch name etc.) and the values from the dropdown should be used to populate (prepared) SQL statement... |
I develop industrial client/server application (C++) with strong real time requirements.
I feel it is time to change the look of the client interface - which is developed in MFC - but I am wondering which would be the right choice.
If I go for a web client is there any way to exchange data between C++ and javascript o... | When transitioning from an MFC-based client interface to a web-based client interface, there are multiple architectural choices and technologies you can consider. To address your specific requirements for quick status refreshes, user commands, and tabular data, you'll want to focus on real-time communication and effici... | 48,152 | [
{
"from": "human",
"value": "I develop industrial client/server application (C++) with strong real time requirements.\nI feel it is time to change the look of the client interface - which is developed in MFC - but I am wondering which would be the right choice.\nIf I go for a web client is there any way to... |
I'm kind of like stuck trying to implement YUI autocomplete textbox. here's the code:
<div id="myAutoComplete">
<input id="myInput" type="text" />
<div id="myContainer"></div>
</div>
<script type="text/javascript">
YAHOO.example.BasicRemote = function() {
oDS = new YAHOO.util.XHRDataSource("../User/Home2.aspx");
// ... | It looks like you are trying to implement an autocomplete feature using YUI (Yahoo User Interface Library). Based on your code and description, there are a few things to check to troubleshoot why the AJAX call is not being made and why the suggestions are not appearing.
### Steps to Troubleshoot:
1. **Ensure YUI Libr... | 45,942 | [
{
"from": "human",
"value": "I'm kind of like stuck trying to implement YUI autocomplete textbox. here's the code:\n<div id=\"myAutoComplete\"> \n<input id=\"myInput\" type=\"text\" /> \n<div id=\"myContainer\"></div> \n</div>\n<script type=\"text/javascript\">\nYAHOO.example.BasicRemote = function() {\noDS... |
I think Cacti is great except for the fact that it takes hours to configure it. There is a lot that you can do with it but I find it a little overly complicated. A script collecting disk utilization recently broke on me (for no apparent reason), I spent 3 hours and got no where.
I would like a tool like Cacti but super... | If you're looking for an easier-to-setup alternative to Cacti, there are several options available, each with different levels of complexity and features. Here are a few alternatives that you might consider:
### Alternatives to Cacti
1. **Netdata**:
- **Ease of Use**: Very easy to install and set up, with automati... | 47,691 | [
{
"from": "human",
"value": "I think Cacti is great except for the fact that it takes hours to configure it. There is a lot that you can do with it but I find it a little overly complicated. A script collecting disk utilization recently broke on me (for no apparent reason), I spent 3 hours and got no where.... |
We have some web pages which have two frames, with one frame in the IE 6 search bar (created using the open("path.htm", "_search"); call). The page shown in the frame on the search bar contains buttons, on click of which we update the right frame. On migration to IE 7, both frames open in their own windows, i.e, I now ... | With the transition from IE6 to IE7, you're right that the behavior of the search bar and frames has changed significantly due to security concerns and the overall shift in how browsers manage search functionality. Since the search bar no longer supports the use of frames like it did in IE6, you will need to consider a... | 49,313 | [
{
"from": "human",
"value": "We have some web pages which have two frames, with one frame in the IE 6 search bar (created using the open(\"path.htm\", \"_search\"); call). The page shown in the frame on the search bar contains buttons, on click of which we update the right frame. On migration to IE 7, both ... |
I hear a lot about map/reduce, especially in the context of Google's massively parallel compute system. What exactly is it?
| MapReduce is a programming model and an associated implementation for processing and generating large datasets that can be parallelized across a distributed cluster of computers. It was popularized by Google and is particularly effective for tasks involving large volumes of data. The model breaks down processing into t... | 49,178 | [
{
"from": "human",
"value": "I hear a lot about map/reduce, especially in the context of Google's massively parallel compute system. What exactly is it?\n"
},
{
"from": "gpt",
"value": "MapReduce is a programming model and an associated implementation for processing and generating large datasets... |
i am running Oracle and SQL SERVER 2oo5 on the same server.
Plstform win 2003 Enterprise.
i have created a System file DSN.
Make the entry in listener.ora and tnsnames.ora.
but when i m tring to ping my dsn system dont responds. and when i m trying to create a database link using my dsn, it gives error.
What to do ?
t... | It looks like you're having issues with the ODBC Data Source Name (DSN) configuration and its integration with Oracle's listener and TNS configuration. Below are some steps and tips to troubleshoot and resolve your issue:
### Step 1: Verify ODBC DSN Configuration
1. **Open ODBC Data Source Administrator**: On your Win... | 49,758 | [
{
"from": "human",
"value": "i am running Oracle and SQL SERVER 2oo5 on the same server.\nPlstform win 2003 Enterprise.\ni have created a System file DSN.\nMake the entry in listener.ora and tnsnames.ora.\nbut when i m tring to ping my dsn system dont responds. and when i m trying to create a database link... |
i am creating a system. What i want to know is if a msg is unsupported what should it do? should i throw saying unsupported msg? should i return 0 or -1? or should i set an errno (base->errno_). Some messages i wouldnt care if there was an error (such as setBorderColour). Others i would (addText or perhaps save if i cr... | When designing a messaging system where unsupported messages need to be handled, you should consider several factors: clarity of error reporting, ease of debugging, maintainability, and extensibility. Here's a detailed breakdown of your options and recommendations based on the criteria you've provided:
### Error Handl... | 47,981 | [
{
"from": "human",
"value": "i am creating a system. What i want to know is if a msg is unsupported what should it do? should i throw saying unsupported msg? should i return 0 or -1? or should i set an errno (base->errno_). Some messages i wouldnt care if there was an error (such as setBorderColour). Others... |
In the 10 years I've been programming, I can count the number of data structures I've used on one hand: arrays, linked lists (I'm lumping stacks and queues in with this), and dictionaries. This isn't really surprising given that nearly all of the applications I've written fall into the forms-over-data / CRUD category.
... | It's great that you're interested in expanding your understanding of data structures! While many applications often revolve around basic data structures like arrays, linked lists, and dictionaries, "exotic" data structures can offer significant advantages in specific scenarios. Here’s a look at some of these data struc... | 49,671 | [
{
"from": "human",
"value": "In the 10 years I've been programming, I can count the number of data structures I've used on one hand: arrays, linked lists (I'm lumping stacks and queues in with this), and dictionaries. This isn't really surprising given that nearly all of the applications I've written fall i... |
Does anybody know how I can see the actual machine code that v8 generates from Javascript? I've gotten as far as Script::Compile() in src/api.cc but I can't figure out where to go from there.
| To view the actual machine code generated by the V8 JavaScript engine from JavaScript code, you can make use of the built-in disassembly features provided by V8. Here are some steps to help you achieve this:
### 1. Use `--print-opt-code` Flag
One of the simplest ways to see the generated machine code is to run a V8 in... | 46,537 | [
{
"from": "human",
"value": "Does anybody know how I can see the actual machine code that v8 generates from Javascript? I've gotten as far as Script::Compile() in src/api.cc but I can't figure out where to go from there.\n"
},
{
"from": "gpt",
"value": "To view the actual machine code generated ... |
This often comes up: your application has gotten extensive enough that it's time to add some programmability into it to make it flexible. One example might be a finance application - you want to add a formula editor so that you can create your own custom formulas without having to re-compile the code.
You have to make ... | When faced with the decision of whether to create a custom tokenizer, parser, and interpreter/compiler chain or to embed an existing scripting language, it's essential to evaluate the trade-offs involved in both approaches, considering several key factors:
### 1. **Scope and Requirements**
- **Complexity of Require... | 47,524 | [
{
"from": "human",
"value": "This often comes up: your application has gotten extensive enough that it's time to add some programmability into it to make it flexible. One example might be a finance application - you want to add a formula editor so that you can create your own custom formulas without having ... |
I want to accomplish the following scenario in Drupal:
You have 2 content-types. Lets say, an application-form for a lisence, and a content-type for persons.
Then when you go to add a lisence in the "node/add" submission form in Drupal, i would like to add a relative number of persons that would be related to this lise... | Yes, you can achieve inline entity creation in Drupal using the **Paragraphs** module or **Entity Reference** with **Inline Entity Form**. Here’s how you can set this up:
### Option 1: Using Paragraphs Module
1. **Install Paragraphs Module**: First, you'll need to install the Paragraphs module if you haven't already ... | 46,347 | [
{
"from": "human",
"value": "I want to accomplish the following scenario in Drupal:\nYou have 2 content-types. Lets say, an application-form for a lisence, and a content-type for persons.\nThen when you go to add a lisence in the \"node/add\" submission form in Drupal, i would like to add a relative number ... |
What algorithms are good for interactive/realtime graph-drawing for live data and direct-manipulation?
Failing that - what libraries do you use to draw graphs?
Suggestions;
Prefuse information-visualization toolkit
any others?
BTW- I mean graphs in the graph-theory sense - points and lines
any language
by live I ... | For interactive and real-time graph drawing, especially for live data and direct manipulation, there are several algorithms and libraries you can consider. Here are some popular options:
### Algorithms for Interactive Graph Drawing
1. **Fruchterman-Reingold Algorithm**: A force-directed layout algorithm that is suita... | 48,843 | [
{
"from": "human",
"value": "What algorithms are good for interactive/realtime graph-drawing for live data and direct-manipulation?\nFailing that - what libraries do you use to draw graphs? \nSuggestions; \n\nPrefuse information-visualization toolkit\nany others?\n\nBTW- I mean graphs in the graph-theory se... |
I've done quite a bit of programming on Windows but now I have to write my first Linux app.
I need to talk to a hardware device using UDP. I have to send 60 packets a second with a size of 40 bytes. If I send less than 60 packets within 1 second, bad things will happen.
The data for the packets may take a while to gen... | Creating a robust Linux application that meets your specific requirements for sending UDP packets involves careful consideration of threading, synchronization, and priority management. Below are some suggestions to design your application effectively:
### Application Architecture
1. **Threads**: Using two threads is ... | 48,995 | [
{
"from": "human",
"value": "I've done quite a bit of programming on Windows but now I have to write my first Linux app. \nI need to talk to a hardware device using UDP. I have to send 60 packets a second with a size of 40 bytes. If I send less than 60 packets within 1 second, bad things will happen.\nThe d... |
I'm making a WPF application that is comprised of Screens (Presenter + View). I want to be able to declare these screens in a config file or SQL database. I have been trying to come up with a good solution I've given up and am asking how some of you design this sort of thing? I've been working at this for over a week a... | Your proposed solution of using a `ScreenService` that retrieves `ScreenInfo` objects from a `ScreenRepository` is a solid approach. It adheres to the principles of separation of concerns and allows for flexibility in terms of data storage. Here are a few suggestions to refine your design and make it more maintainable:... | 45,472 | [
{
"from": "human",
"value": "I'm making a WPF application that is comprised of Screens (Presenter + View). I want to be able to declare these screens in a config file or SQL database. I have been trying to come up with a good solution I've given up and am asking how some of you design this sort of thing? I'... |
I think this mostly applies to web applications, since you often see things like language and database vendor in regards to web applications, but not so much on desktop applications.
If a web application is created using language X, would that have any noticeable impact on who deploys the application? For example, woul... | The programming language and technology stack used to develop a web application can indeed influence a company's decision to deploy it. Several factors come into play that can affect deployment choices, particularly regarding organizational culture, existing infrastructure, and integration capabilities.
Here are some ... | 46,330 | [
{
"from": "human",
"value": "I think this mostly applies to web applications, since you often see things like language and database vendor in regards to web applications, but not so much on desktop applications.\nIf a web application is created using language X, would that have any noticeable impact on who ... |
I have to write a Java Client to connect to an SSL server. The server uses openssl certificate, and is configured to do Client Auth.
I can't seem to locate any useful resources online that can help me (who doesn't know anything about openssl and much about SSL) to understand who to go about implementing my Client Side.... | To connect to an SSL server that requires client authentication in Java, you'll typically need to do the following:
1. **Generate a Keystore**: This is where you'll store your private key and the corresponding certificate. You can generate a Keystore using `keytool`, which is included with the JDK, or by using OpenSSL... | 48,372 | [
{
"from": "human",
"value": "I have to write a Java Client to connect to an SSL server. The server uses openssl certificate, and is configured to do Client Auth.\nI can't seem to locate any useful resources online that can help me (who doesn't know anything about openssl and much about SSL) to understand wh... |
I asked this Can I automate creating a .NET web application in IIS? a little ago, and got solutions for IIS 6 and IIS 7:
IIS6 : iisweb /create C:\Rome "My
Vacations" /d www.reskit.com
/dontstart
IIS7 :
%windir%\system32\inetsrv\AppCmd ADD
SITE /name:MyNewSite
/bindings:http/*:81:
/physicalPath:c:\inetpub\mynewsite
b... | To create a new web application in IIS 5.1 automatically, you'll need to use `adsutil.vbs`, which is a VBScript utility that allows you to manipulate IIS configuration from the command line. IIS 5.1 is typically used on Windows XP Professional, and it doesn't have the same command-line tools as later versions, but you ... | 48,578 | [
{
"from": "human",
"value": "I asked this Can I automate creating a .NET web application in IIS? a little ago, and got solutions for IIS 6 and IIS 7:\n\nIIS6 : iisweb /create C:\\Rome \"My\nVacations\" /d www.reskit.com\n/dontstart \nIIS7 :\n%windir%\\system32\\inetsrv\\AppCmd ADD\nSITE /name:MyNewSite\n/bi... |
How can I send keyboard input messages to either the currently selected window or the previously selected window?
I have a program which I use to type some characters which are not present on my keyboard and I would like it if I could just send the input directly rather than me having to copy and paste all the time.
E... | To send keyboard input messages directly to the currently selected window or the previously selected window in a Windows environment, you can use the Windows API (particularly functions like `SendMessage` or `PostMessage`) or more conveniently, libraries that wrap these functionalities. In the context of your applicati... | 49,047 | [
{
"from": "human",
"value": "How can I send keyboard input messages to either the currently selected window or the previously selected window? \nI have a program which I use to type some characters which are not present on my keyboard and I would like it if I could just send the input directly rather than m... |
I have a ListBox and I want to add a context menu to each item in the list. I've seen the "solution" to have the right click select an item and suppress the context menu if on white space, but this solution feels dirty.
Does anyone know a better way?
| To add a context menu to each item in a ListBox without interfering with the selection behavior, you can handle the `MouseRightButtonDown` event in a cleaner way. Instead of suppressing the context menu when right-clicking on the ListBox's white space, you can directly check if the right-click occurred on an item and s... | 48,137 | [
{
"from": "human",
"value": "I have a ListBox and I want to add a context menu to each item in the list. I've seen the \"solution\" to have the right click select an item and suppress the context menu if on white space, but this solution feels dirty. \nDoes anyone know a better way?\n"
},
{
"from": ... |
I've been reading about the OCP principle and how to use the strategy pattern to accomplish this.
I was going to try and explain this to a couple of people, but the only example I can think of is using different validation classes based on what status an "order" is.
I've read a couple of articles online, but these don'... | Absolutely! The Strategy Pattern is a powerful design pattern that allows you to define a family of algorithms, encapsulate each one of them, and make them interchangeable. This pattern is particularly useful when you want to adhere to the Open/Closed Principle (OCP), which states that software entities should be open ... | 49,089 | [
{
"from": "human",
"value": "I've been reading about the OCP principle and how to use the strategy pattern to accomplish this.\nI was going to try and explain this to a couple of people, but the only example I can think of is using different validation classes based on what status an \"order\" is.\nI've rea... |
I'm using the Win32 CreateProcess function to perform a call to an external executable. The executable returns a string.
Is there a way I can capture and interrogate the returned string after calling the executable? Failing that, I might have to write out the string to a file in the executable and read that in the ca... | Yes, you can capture the output string from an external executable called using the Win32 `CreateProcess` function without writing to a file. To achieve this, you'll need to redirect the standard output of the child process (the executable you are calling) so that you can read the output directly in your calling progra... | 49,448 | [
{
"from": "human",
"value": "I'm using the Win32 CreateProcess function to perform a call to an external executable. The executable returns a string.\nIs there a way I can capture and interrogate the returned string after calling the executable? Failing that, I might have to write out the string to a file... |
I'm writing some code to scale a 32 bit RGBA image in C/C++. I have written a few attempts that have been somewhat successful, but they're slow and most importantly the quality of the sized image is not acceptable.
I compared the same image scaled by OpenGL (i.e. my video card) and my routine and it's miles apart in q... | To create a high-quality downscaling algorithm in C/C++ for a 32-bit RGBA image, you can implement a bicubic interpolation approach. Bicubic interpolation is commonly used for image resizing because it considers 16 surrounding pixels to calculate the output pixel value, leading to smoother transitions and sharper image... | 48,506 | [
{
"from": "human",
"value": "I'm writing some code to scale a 32 bit RGBA image in C/C++. I have written a few attempts that have been somewhat successful, but they're slow and most importantly the quality of the sized image is not acceptable. \nI compared the same image scaled by OpenGL (i.e. my video card... |
I am trying to create an XML schema representing an 'order' for a shopping cart
I want this to completely abstract away my shopping cart's implementation -- and eventually support partners sending us orders using this schema. (yes i'm planning on integrating this schema into our existing cart)
It will have original ord... | Creating an XML schema for representing an order in a shopping cart is a critical task, especially if you plan on integrating with external partners. Leveraging existing standards can help ensure interoperability and simplify integration.
Here are some established standards and best practices that you might consider a... | 46,649 | [
{
"from": "human",
"value": "I am trying to create an XML schema representing an 'order' for a shopping cart\nI want this to completely abstract away my shopping cart's implementation -- and eventually support partners sending us orders using this schema. (yes i'm planning on integrating this schema into ou... |
We want to implement chat on our website so that users can communicate with each other.
Our general requirements are:
It should be rendered on our web pages, but it could be rendered in an IFrame or something like that. The users of our website are part of the general public, not internal teams, so we don't want th... | There are several chat solutions that can meet your requirements for integrating a chat feature on your website, allowing users to communicate with each other without the need for a separate application or account. Below are a few suggestions that may fit your criteria:
### 1. **CometChat**
- **Overview:** CometChat i... | 49,432 | [
{
"from": "human",
"value": "We want to implement chat on our website so that users can communicate with each other. \nOur general requirements are:\n\nIt should be rendered on our web pages, but it could be rendered in an IFrame or something like that. The users of our website are part of the general pub... |
I'm trying to make an XML questions editor in flash.
Basically I load in the XML into a Tree component - XML like so:
<questions>
<question id="1" type="radio" text="This is question 1" isBranch="true">
<option id="1.1" correct="false" text="This is option 1" />
<option id="1.2" correct="false" text="This is option... | In your case, you're trying to achieve two-way binding between the `TextInput` control and the XML data. Since XML does not implement the `IEventDispatcher` interface, it doesn't support binding directly.
However, you can work around this limitation by using event listeners to update the XML when the user edits the `T... | 45,663 | [
{
"from": "human",
"value": "I'm trying to make an XML questions editor in flash.\nBasically I load in the XML into a Tree component - XML like so:\n<questions>\n<question id=\"1\" type=\"radio\" text=\"This is question 1\" isBranch=\"true\">\n <option id=\"1.1\" correct=\"false\" text=\"This is option 1\"... |
How do I apply a repeating texture that always maintains its original scale (1 pixel in the texture = 1 pixel on screen), regardless of the vertex data it is applied with.
I realize this is not the most usual task, but is it possible to easily set opengl to do this, or do I need to apply some kind of mask to vertex dat... | To achieve a repeating texture that maintains its original pixel scale when rendering 2D ellipses in OpenGL ES, you can follow these steps:
### Step 1: Texture Settings
First, ensure your texture is set up correctly for repetition. You need to use the appropriate texture parameters to make the texture repeat and have ... | 49,450 | [
{
"from": "human",
"value": "How do I apply a repeating texture that always maintains its original scale (1 pixel in the texture = 1 pixel on screen), regardless of the vertex data it is applied with.\nI realize this is not the most usual task, but is it possible to easily set opengl to do this, or do I nee... |
What I want to do is to react only on specified root elements. For example, if user sends XmlStream that looks like:
<auth>
<login>user</login>
<pass>dupa.8</pass>
</auth>
My method ._auth should be executed. I've done it with addObserver method called inside connectionMade method.
self.addObserver("/auth", se... | To ensure that your Twisted application reacts only to XML messages where `<auth>` is the root element, you can use the `addObserver` method but with a more specific handler that checks the structure of the received XML. Since you want to restrict it to only react when `<auth>` is the root element, you'll need to valid... | 46,506 | [
{
"from": "human",
"value": "What I want to do is to react only on specified root elements. For example, if user sends XmlStream that looks like:\n<auth>\n <login>user</login>\n <pass>dupa.8</pass>\n</auth>\n\nMy method ._auth should be executed. I've done it with addObserver method called inside conn... |
I'm looking for some examples for asp.net mvc that use the integrated asp.net forms-authentication based membership providers with edit and post scenarios. I'm looking for best practices here.
Let's say I have a Contacts table in my database with a Name field, and a UserId field which is tied to the aspnet_Users UserId... | Certainly! When working with ASP.NET MVC and using the Membership Provider for authentication, there are some best practices that you should keep in mind, especially when dealing with data entry and updates related to authenticated users. Below, I've provided an example of how you might implement a "Save" action for a ... | 31,304 | [
{
"from": "human",
"value": "I'm looking for some examples for asp.net mvc that use the integrated asp.net forms-authentication based membership providers with edit and post scenarios. I'm looking for best practices here.\nLet's say I have a Contacts table in my database with a Name field, and a UserId fiel... |
I've got this problem with dynamically created TextBox.
When the TextBox is created in PageLoad, it's TextChanged event was fired.
But when I dynamically delete and recreated the TextBox, the TextChanged was not fired.
This is the code:
.aspx file
<body>
<form id="form1" runat="server">
<div>
<asp:Table ID... | The issue you're experiencing is due to the way ASP.NET handles dynamic controls and their events. In ASP.NET Web Forms, the controls need to be recreated on every postback in the same way as they were originally created, including setting their event handlers, to ensure that events are fired as expected.
When you del... | 49,921 | [
{
"from": "human",
"value": "I've got this problem with dynamically created TextBox.\nWhen the TextBox is created in PageLoad, it's TextChanged event was fired.\nBut when I dynamically delete and recreated the TextBox, the TextChanged was not fired.\nThis is the code:\n.aspx file\n<body>\n <form id=\"for... |
I want to do some functional testing on a (restful) webservice. The testsuite contains a bunch of test cases, each of which performs a couple of HTTP requests on the webservice.
Naturally, the webservice has to run or the tests will fail. :-)
Starting the webservice takes a couple of minutes (it does some heavy data li... | Certainly! To set up your functional testing suite for a RESTful web service efficiently, you can leverage the `@BeforeClass` annotation provided by testing frameworks like JUnit (if you're using Java, for example). This way, you can start the web service once before any test cases are executed, and all your test cases... | 49,738 | [
{
"from": "human",
"value": "I want to do some functional testing on a (restful) webservice. The testsuite contains a bunch of test cases, each of which performs a couple of HTTP requests on the webservice.\nNaturally, the webservice has to run or the tests will fail. :-)\nStarting the webservice takes a co... |
What is the Best method to http transfer a file from the client to a server, in Java 1.5?
| In Java 1.5, you can use `HttpURLConnection` to transfer files from a client to a server via HTTP POST. Below is a simple example that demonstrates how to do this. The example assumes that the server expects a multipart form-data request for file uploads.
### Example Code
```java
import java.io.DataOutputStream;
impo... | 49,908 | [
{
"from": "human",
"value": "What is the Best method to http transfer a file from the client to a server, in Java 1.5?\n"
},
{
"from": "gpt",
"value": "In Java 1.5, you can use `HttpURLConnection` to transfer files from a client to a server via HTTP POST. Below is a simple example that demonstra... |
My team is working on a conversion project to convert one product (but with many facets) from VB6 to .Net (we have over ~300k LOC). Before I got on board, the decision was made that regardless of the location of the assembly, or folder structure, all classes / structs will be in one namespace:
.
They even go as far as ... | You’re facing a common situation when migrating legacy applications to modern frameworks, especially when dealing with larger codebases. Let's break down why using namespaces effectively is essential and how you can approach your colleagues to advocate for their proper use.
### Understanding Namespaces
A namespace in... | 49,577 | [
{
"from": "human",
"value": "My team is working on a conversion project to convert one product (but with many facets) from VB6 to .Net (we have over ~300k LOC). Before I got on board, the decision was made that regardless of the location of the assembly, or folder structure, all classes / structs will be in... |
Each month I get new CMYK and RGB images that shall be used on the web.
I had a script using a patched up ImageMagick doing this, but it got deleted. So I need to do it again, but it was hard last time.
How do you easily and quickly convert CMYK image files to RGB?
| Converting CMYK images to RGB can be done easily using tools like ImageMagick, which is powerful and widely used for image processing tasks. If you want to automate the process, you can write a simple script. Below is a guide for converting CMYK images to RGB using ImageMagick:
### Step 1: Install ImageMagick
If you ... | 47,139 | [
{
"from": "human",
"value": "Each month I get new CMYK and RGB images that shall be used on the web.\nI had a script using a patched up ImageMagick doing this, but it got deleted. So I need to do it again, but it was hard last time.\nHow do you easily and quickly convert CMYK image files to RGB?\n"
},
{... |
I'm just starting out with WiX as I need to be able to automate building an MSI on our CI server. Is there anyway to automatically include all the dependencies of a project?
| Yes, WiX (Windows Installer XML) can automate the inclusion of dependencies for your MSI package, but it requires some setup to ensure that all necessary files are included in your build. While there is no built-in mechanism in WiX to automatically detect and include dependencies like you might find in some other packa... | 49,776 | [
{
"from": "human",
"value": "I'm just starting out with WiX as I need to be able to automate building an MSI on our CI server. Is there anyway to automatically include all the dependencies of a project?\n"
},
{
"from": "gpt",
"value": "Yes, WiX (Windows Installer XML) can automate the inclusion... |
The description of System.Collection.Specialized.HybridDictionary is this:
Implements IDictionary by using a
System.Collections.Specialized.ListDictionary
while the collection is small, and
then switching to a
System.Collections.Hashtable when the
collection gets large.
Is there an equivalent Generic implem... | As of my last knowledge update in October 2023, there is no direct equivalent to `System.Collections.Specialized.HybridDictionary` in the `System.Collections.Generic` namespace. However, you can achieve similar behavior by using a combination of `Dictionary<TKey, TValue>` and another collection type to handle smaller d... | 48,905 | [
{
"from": "human",
"value": "The description of System.Collection.Specialized.HybridDictionary is this:\n\nImplements IDictionary by using a\n System.Collections.Specialized.ListDictionary\n while the collection is small, and\n then switching to a\n System.Collections.Hashtable when the\n collection ge... |
I am trying a straightforward remote json call with jquery. I am trying to use the reddit api. http://api.reddit.com. This returns a valid json object.
If I call a local file (which is what is returned from the website saved to my local disk) things work fine.
$(document).ready(function() {
$.getJSON("js/reddit.js... | The issue you're experiencing seems to relate to how you're attempting to access the Reddit API using JSONP and how the Reddit API is set up to respond to those requests.
### Understanding JSONP
JSONP (JSON with Padding) is a method used to overcome the same-origin policy that browsers enforce, which restricts web pa... | 49,144 | [
{
"from": "human",
"value": "I am trying a straightforward remote json call with jquery. I am trying to use the reddit api. http://api.reddit.com. This returns a valid json object.\nIf I call a local file (which is what is returned from the website saved to my local disk) things work fine. \n$(document).rea... |
I have created a sample application using the iPhone SDK that uses ExtAudioFileOpenURL from the AudioToolBox framework. I have a test.mp3 audio file in my app's document folder. When I tried to open this audio file using this API I received EXEC_BAD_ACCESS. I couldn't figure out why.
Here is a code snippet:
NSArray *ar... | The `EXC_BAD_ACCESS` error you are experiencing when calling `ExtAudioFileOpenURL` likely stems from the way you're handling the URL or the parameters passed to the function. Here are a few points to consider that may help you resolve the issue:
### 1. Check the Return Value
The `ExtAudioFileOpenURL` function returns... | 48,413 | [
{
"from": "human",
"value": "I have created a sample application using the iPhone SDK that uses ExtAudioFileOpenURL from the AudioToolBox framework. I have a test.mp3 audio file in my app's document folder. When I tried to open this audio file using this API I received EXEC_BAD_ACCESS. I couldn't figure out... |
I want to monitor in real-time the changes of several directories in one thread, so I decided to use ReadDirectoryChangesW() method asynchronously with GetQueuedCompletionStatus. Here is my code:
static DWORD WINAPI Routine( LPVOID lParam )
{
FileSystemWatcher* obj = (FileSystemWatcher*)lParam;
obj->hDir[0] = ... | Your code has several issues that could lead to blocking and improper functionality when monitoring directory changes with `ReadDirectoryChangesW()` and `GetQueuedCompletionStatus()`. Here are some of the problems and potential solutions:
1. **Overlapped Structure**:
- You are passing `NULL` for the `LPOVERLAPPED` ... | 45,943 | [
{
"from": "human",
"value": "I want to monitor in real-time the changes of several directories in one thread, so I decided to use ReadDirectoryChangesW() method asynchronously with GetQueuedCompletionStatus. Here is my code:\nstatic DWORD WINAPI Routine( LPVOID lParam )\n{\n FileSystemWatcher* obj = (Fil... |
I have a weird issue that only seems to be affecting IE 7. The web site is a 3.5 c# asp.net website that utilizes ajax and the ajax control toolkit deployed to a win 2003 server. Everything appears to be correct in the web.config. In fact, everything works perfectly in IE6 and Firefox 3. It is only in IE7 that I get th... | The issue you're encountering with "sys is undefined" in Internet Explorer 7 (IE7) on a specific Windows 2003 server could be related to several factors, especially given that the site works properly on another server with a similar setup. Here are some potential causes and solutions to investigate:
### 1. **Check for... | 47,105 | [
{
"from": "human",
"value": "I have a weird issue that only seems to be affecting IE 7. The web site is a 3.5 c# asp.net website that utilizes ajax and the ajax control toolkit deployed to a win 2003 server. Everything appears to be correct in the web.config. In fact, everything works perfectly in IE6 and F... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.