instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
I am having a problem getting a list of fields from a query defined at run time by the users of my program. I let my users enter a SQL query into a memo control and then I want to let them go through the fields that will return and do such things as format the output, sum column values and so forth. So, I have to get... | To achieve your goal of dynamically obtaining the list of fields from a user-defined SQL query in Delphi using DBExpress with a Firebird database, you can follow these steps:
1. **Prepare the SQL Statement**: Before you can get the fields, you need to prepare the SQL query. However, as you noticed, when the query has ... | 27,491 | [
{
"from": "human",
"value": "I am having a problem getting a list of fields from a query defined at run time by the users of my program. I let my users enter a SQL query into a memo control and then I want to let them go through the fields that will return and do such things as format the output, sum colum... |
Using Restlet I needed to serve some simple static content in the same context as my web service. I've configured the component with a Directory, but in testing, I've found it will only serve 'index.html', everything else results in a 404.
router.attach("/", new Directory(context, new Reference(baseRef, "./content"));
... | The behavior you're experiencing with Restlet and the `Directory` class is likely due to the way the `Directory` is configured and how the file paths are being interpreted. By default, the `Directory` serves files based on their paths, and if the path is not configured correctly, it can lead to 404 errors for resources... | 29,629 | [
{
"from": "human",
"value": "Using Restlet I needed to serve some simple static content in the same context as my web service. I've configured the component with a Directory, but in testing, I've found it will only serve 'index.html', everything else results in a 404.\nrouter.attach(\"/\", new Directory(con... |
I've got a tomcat 6 web app running with Apache httpd as the front end. I'm using mod_proxy and mod_proxy_ajp to forward the requests to tomcat. My server is running Ubuntu. Now I'm trying to use mod_rewrite to remove the leading www, so that my canonical website URL is http://example.com rather than http://www.example... | It sounds like you have resolved your issue with the mod_rewrite configuration, but I'll provide additional troubleshooting tips that can help anyone facing similar challenges with Apache directives in general. Here are several methods you can use to diagnose and troubleshoot issues with Apache, particularly with mod_r... | 28,824 | [
{
"from": "human",
"value": "I've got a tomcat 6 web app running with Apache httpd as the front end. I'm using mod_proxy and mod_proxy_ajp to forward the requests to tomcat. My server is running Ubuntu. Now I'm trying to use mod_rewrite to remove the leading www, so that my canonical website URL is http://e... |
I have a FreeBSD box with Bash set up.
I'm used to Debian Linux where my command history is automatically saved when I log out, so that when I log back in I can press up or Ctrl-R or whatever and have access to my history.
How do I set up Bash to do this on FreeBSD?
| To set up Bash on FreeBSD to save command history automatically when you log out, similar to how it works on Debian, you can follow these steps:
1. **Ensure Bash is Installed**: Make sure you have Bash installed. You can check if Bash is installed by running `bash --version`. If it is not installed, you can install it... | 25,659 | [
{
"from": "human",
"value": "I have a FreeBSD box with Bash set up.\nI'm used to Debian Linux where my command history is automatically saved when I log out, so that when I log back in I can press up or Ctrl-R or whatever and have access to my history.\nHow do I set up Bash to do this on FreeBSD?\n"
},
... |
I have a simple GtkStatusBar created with glade,and want to add a simple message with the date of the last update of the database (just a simple and plain date).
I don't want to use the whole stacks, context and all the other things that gtk developers put on the statusbar code.
(I could simply use a label but I would ... | To add a simple message to a `GtkStatusbar` in your GTK application without using the full stack and context, you can use the `push` method to set a message. Since you're working with GTK 2.0.1 and PHP, you'll be using the PHP GTK bindings.
Here is an example of how to create a `GtkStatusbar`, set a simple message wit... | 26,301 | [
{
"from": "human",
"value": "I have a simple GtkStatusBar created with glade,and want to add a simple message with the date of the last update of the database (just a simple and plain date).\nI don't want to use the whole stacks, context and all the other things that gtk developers put on the statusbar code... |
I am generating the json from PHP.
| Generating JSON from PHP is straightforward. You can use the built-in `json_encode()` function to convert PHP arrays or objects into a JSON format. Here's a simple example to demonstrate how to create JSON from a PHP associative array and output it:
### Example of Generating JSON from PHP
```php
<?php
// Example asso... | 27,013 | [
{
"from": "human",
"value": "I am generating the json from PHP.\n"
},
{
"from": "gpt",
"value": "Generating JSON from PHP is straightforward. You can use the built-in `json_encode()` function to convert PHP arrays or objects into a JSON format. Here's a simple example to demonstrate how to creat... |
After staring at this 3D cube and these triangles for a while I started wondering if there's any good reliable Javascript graphics library with basic 3D support.
Any suggestion?
| Yes, there are several reliable JavaScript libraries that provide basic 3D support and can help you create and manipulate 3D graphics. Here are a few popular ones:
1. **Three.js**:
- **Description**: One of the most popular JavaScript libraries for 3D graphics. It provides a simple and easy-to-use API for creating ... | 30,389 | [
{
"from": "human",
"value": "After staring at this 3D cube and these triangles for a while I started wondering if there's any good reliable Javascript graphics library with basic 3D support.\nAny suggestion?\n"
},
{
"from": "gpt",
"value": "Yes, there are several reliable JavaScript libraries th... |
In my C# source code I may have declared integers as:
int i = 5;
or
Int32 i = 5;
In the currently prevalent 32-bit world they are equivalent. However, as we move into a 64-bit world, am I correct in saying that the following will become the same?
int i = 5;
Int64 i = 5;
| In C#, `int` is a keyword that is an alias for `Int32`, which is a 32-bit signed integer. Similarly, `long` is an alias for `Int64`, which is a 64-bit signed integer.
When you declare:
```csharp
int i = 5; // This is equivalent to Int32 i = 5;
```
You are creating a variable of type `Int32`, which has a range of va... | 31,210 | [
{
"from": "human",
"value": "In my C# source code I may have declared integers as:\nint i = 5;\n\nor\nInt32 i = 5;\n\nIn the currently prevalent 32-bit world they are equivalent. However, as we move into a 64-bit world, am I correct in saying that the following will become the same?\nint i = 5;\nInt64 i = 5... |
In Oracle, given a simple data table:
create table data (
id VARCHAR2(255),
key VARCHAR2(255),
value VARCHAR2(511));
suppose I want to "insert or update" a value. I have something like:
merge into data using dual on
(id='someid' and key='testKey')
when matched then
update set value ... | The `MERGE` statement you've provided is indeed a common way to perform "insert or update" operations in Oracle, but I understand your concerns regarding the duplication of literals and the usage of `DUAL`. Here are some suggestions to improve upon your approach.
### 1. Using a Temporary Variable
You can make the cod... | 29,107 | [
{
"from": "human",
"value": "In Oracle, given a simple data table:\ncreate table data (\n id VARCHAR2(255),\n key VARCHAR2(255),\n value VARCHAR2(511));\n\nsuppose I want to \"insert or update\" a value. I have something like:\nmerge into data using dual on \n (id='someid' and key=... |
I want to convert a string like this:
'10/15/2008 10:06:32 PM'
into the equivalent DATETIME value in Sql Server.
In Oracle, I would say this:
TO_DATE('10/15/2008 10:06:32 PM','MM/DD/YYYY HH:MI:SS AM')
This question implies that I must parse the string into one of the standard formats, and then convert using one of th... | In SQL Server, you can convert a string to a `DATETIME` value using the `CONVERT` function or the `CAST` function, without needing to format the string into one of the standard formats explicitly.
For the specific string you provided ('10/15/2008 10:06:32 PM'), you can use the `CONVERT` function directly. SQL Server ... | 31,424 | [
{
"from": "human",
"value": "I want to convert a string like this:\n'10/15/2008 10:06:32 PM'\n\ninto the equivalent DATETIME value in Sql Server.\nIn Oracle, I would say this:\nTO_DATE('10/15/2008 10:06:32 PM','MM/DD/YYYY HH:MI:SS AM')\n\nThis question implies that I must parse the string into one of the st... |
Hi I have been trying to do this for what feels like all my life
I have a list menu with block display links, each link has a sliding doors png background image. I have used this javascript (http://www.ideashower.com/our_solutions/png-hover/) to implement the alphaimageloader fix for ie6 using a transparent gif.
When I... | It sounds like you are experiencing an issue that might be related to browser caching, especially with Internet Explorer 6, which has known quirks regarding handling images and caching. Here are a few suggestions to troubleshoot and hopefully resolve the issue:
### 1. Cache-Control Headers
Make sure that your server i... | 29,430 | [
{
"from": "human",
"value": "Hi I have been trying to do this for what feels like all my life\nI have a list menu with block display links, each link has a sliding doors png background image. I have used this javascript (http://www.ideashower.com/our_solutions/png-hover/) to implement the alphaimageloader f... |
In the iPhone is there a way I can use JavaScript to close the browser and return to the home screen? After the last page a wizard I am calling out to another iPhone app (ex: maps) and I do NOT what the user to come back to the browser screen when they are done. My backup plan is to have a "Complete" page but that is n... | In Safari on iOS, web pages have limited access to the device’s operating system for security and privacy reasons. Unfortunately, there is no way to programmatically close the browser or navigate the user away from Safari to the home screen using JavaScript.
Here are a few points to consider regarding your scenario:
... | 30,551 | [
{
"from": "human",
"value": "In the iPhone is there a way I can use JavaScript to close the browser and return to the home screen? After the last page a wizard I am calling out to another iPhone app (ex: maps) and I do NOT what the user to come back to the browser screen when they are done. My backup plan i... |
I've got a table structure I'm not really certain of how to create the best way.
Basically I have two tables, tblSystemItems and tblClientItems. I have a third table that has a column that references an 'Item'. The problem is, this column needs to reference either a system item or a client item - it does not matter whi... | In your situation, since you cannot directly create a foreign key reference to a view, but you still want to maintain referential integrity between your `tblSystemItems` and `tblClientItems`, you could consider the following options:
### 1. Use a Discriminator Column
Instead of trying to create a foreign key that can ... | 28,375 | [
{
"from": "human",
"value": "I've got a table structure I'm not really certain of how to create the best way.\nBasically I have two tables, tblSystemItems and tblClientItems. I have a third table that has a column that references an 'Item'. The problem is, this column needs to reference either a system item... |
I usually hate posting these types of questions as normally I find that the best way to really learn is to figure out the answer yourself.
However, I need an answer to this question really quickly as I have a client who can't run her business due to this problem.
Yesterday my ASP.NET host provider moved my application... | The error you're encountering is related to the security permissions set in the .NET Framework. It indicates that your application is attempting to perform an operation that requires higher trust level permissions than what is currently granted.
To address the issue, you can take the following steps:
### 1. Change t... | 27,902 | [
{
"from": "human",
"value": "I usually hate posting these types of questions as normally I find that the best way to really learn is to figure out the answer yourself. \nHowever, I need an answer to this question really quickly as I have a client who can't run her business due to this problem.\nYesterday my... |
I'm tasked with replicating a production environment to create many test/sit environments.
One of the things I need to do is build up Perl, with all the modules which have been installed (including internal and external modules) over the years. I could just use CPAN.pm autobundle, but this will result in the test envir... | Replicating a production environment in Perl, along with its exact versions of modules, requires careful management to ensure consistency. Here are the steps you can follow to achieve that:
### 1. List Installed Modules with Versions
You can use the following command to get a list of all the installed Perl modules alo... | 27,581 | [
{
"from": "human",
"value": "I'm tasked with replicating a production environment to create many test/sit environments.\nOne of the things I need to do is build up Perl, with all the modules which have been installed (including internal and external modules) over the years. I could just use CPAN.pm autobund... |
Most statistics out there for browser stats show you the resolution of the screen.
Thats fine for Windows where browsers typically open full screen and most people leave it as that. So if the browser stats say 1024x768 you just need to subtract a little width for the browser chrome.
On a Mac however browsers typically ... | The behavior of browsers and the resolutions of displays can indeed vary between operating systems and devices. When it comes to Macs, especially with their default behavior, the window sizes can be quite different from what you might expect on Windows machines.
1. **Window Size**: On macOS, browsers often do not laun... | 29,963 | [
{
"from": "human",
"value": "Most statistics out there for browser stats show you the resolution of the screen.\nThats fine for Windows where browsers typically open full screen and most people leave it as that. So if the browser stats say 1024x768 you just need to subtract a little width for the browser ch... |
The .NET coding standards PDF from SubMain that have started showing up in the "Sponsored By" area seems to indicate that properties are only appropriate for logical data members (see pages 34-35 of the document). Methods are deemed appropriate in the following cases:
The operation is a conversion, such as Object.ToS... | The debate around when to use properties versus methods in .NET (and other object-oriented languages) is a nuanced topic, and opinions among developers can vary. However, there are common principles that many developers tend to agree on, particularly in the context of the points you've provided from the .NET coding sta... | 27,390 | [
{
"from": "human",
"value": "The .NET coding standards PDF from SubMain that have started showing up in the \"Sponsored By\" area seems to indicate that properties are only appropriate for logical data members (see pages 34-35 of the document). Methods are deemed appropriate in the following cases:\n\nThe ... |
I'm currently working on a project which needs to persist any kind of object (of which implementation we don't have any control) so these objects could be recovered afterwards.
We can't implement an ORM because we can't restrict the users of our library at development time.
Our first alternative was to serialize it wi... | Given the constraints you've described—namely, needing to persist any arbitrary Java objects without control over their implementation, and having issues with versioning and lack of support from Java's built-in serialization and XML tools—here are a few alternatives you might consider:
### 1. **JSON Serialization Libr... | 27,969 | [
{
"from": "human",
"value": "I'm currently working on a project which needs to persist any kind of object (of which implementation we don't have any control) so these objects could be recovered afterwards. \nWe can't implement an ORM because we can't restrict the users of our library at development time.\nO... |
For example, mysql quote table name using
SELECT * FROM `table_name`;
notice the `
Does other database ever use different char to quote their table name
| Yes, different database management systems (DBMS) use different characters to quote table names and other identifiers. Here are some examples:
1. **MySQL**: Uses backticks (`` ` ``) to quote identifiers (e.g., table names, column names).
```sql
SELECT * FROM `table_name`;
```
2. **PostgreSQL**: Uses double q... | 30,665 | [
{
"from": "human",
"value": "For example, mysql quote table name using \nSELECT * FROM `table_name`;\n\nnotice the ` \nDoes other database ever use different char to quote their table name\n"
},
{
"from": "gpt",
"value": "Yes, different database management systems (DBMS) use different characters... |
Consider the following code:
Public Class Animal
Public Overridable Function Speak() As String
Return "Hello"
End Function
End Class
Public Class Dog
Inherits Animal
Public Overrides Function Speak() As String
Return "Ruff"
End Function
End Class
Dim dog As New Dog
Dim animal As Animal
ani... | In the given code, when you create an instance of `Dog` and assign it to a variable of type `Animal`, you are still calling the `Speak` method of the `Dog` class because it overrides the `Speak` method in the `Animal` class. This behavior is due to polymorphism in object-oriented programming. When you call `animal.Spea... | 25,649 | [
{
"from": "human",
"value": "Consider the following code:\nPublic Class Animal\n\nPublic Overridable Function Speak() As String\n Return \"Hello\"\nEnd Function\n\nEnd Class\n\nPublic Class Dog\n Inherits Animal\n\n Public Overrides Function Speak() As String\n Return \"Ruff\"\n End Funct... |
I have seen some websites use the following tag:
<meta type="title" content="Title of the page" />
Is it needed when you have a <title>?
Also, what's the best formatting for a page title? Some ideas:
Page Description :: Company Name
Page Description - Company Name
Page Description <> Company Name
Company Name: Page D... | ### 1. `<meta type="title">` Tag
The `<meta type="title">` tag you mentioned is not a standard HTML tag. The correct tag for defining the title of a page is the `<title>` tag, which is placed within the `<head>` section of your HTML document. This tag is essential because it provides the title that appears in browser ... | 28,246 | [
{
"from": "human",
"value": "I have seen some websites use the following tag:\n<meta type=\"title\" content=\"Title of the page\" />\n\nIs it needed when you have a <title>?\nAlso, what's the best formatting for a page title? Some ideas:\n\nPage Description :: Company Name\nPage Description - Company Name\n... |
I am experiencing some weird behavior with localized messages reported from my background worker process in my windows forms application.
The application is a setup application with windows forms.
The application launches a background worker to perform and IIS reset and then install MSIs.
The first time I run the appli... | It sounds like you're facing an issue related to localization and resource management specifically in the context of a background worker process in your Windows Forms application. Here are a few suggestions and considerations that might help you troubleshoot and resolve the problem:
1. **Initialization Timing**: It’s ... | 27,781 | [
{
"from": "human",
"value": "I am experiencing some weird behavior with localized messages reported from my background worker process in my windows forms application.\nThe application is a setup application with windows forms.\nThe application launches a background worker to perform and IIS reset and then i... |
I'd like to know what are the most useful JQuery plugins. I'm particularly interested in those which are likely to be useful in general UI development, such as Tablesorter, rather than those which serve uncommon needs.
If you could provide a very brief description of the plugin's purpose, that would be really helpful.... | Sure, Don! Here’s a list of some of the most useful jQuery plugins that can enhance general UI development:
1. **Tablesorter**: A plugin that allows you to easily sort HTML tables. It provides sorting capabilities for multiple columns and can be customized with themes.
2. **jQuery UI**: A collection of interactions, ... | 31,160 | [
{
"from": "human",
"value": "I'd like to know what are the most useful JQuery plugins. I'm particularly interested in those which are likely to be useful in general UI development, such as Tablesorter, rather than those which serve uncommon needs.\nIf you could provide a very brief description of the plugi... |
What is the best way to dynamically create RDLC xml as input to VS2005 Report Viewer?
I would like to autosize columns based on the data sizes. I would also like to programmatically control what columns are displayed.
| Creating RDLC (Report Definition Language Client-side) files dynamically in your application can be a bit involved, but it allows you to customize reports based on runtime data. Here's a general approach you can take to accomplish this with Visual Studio 2005 Report Viewer, including dynamically creating the XML and ha... | 26,603 | [
{
"from": "human",
"value": "What is the best way to dynamically create RDLC xml as input to VS2005 Report Viewer? \nI would like to autosize columns based on the data sizes. I would also like to programmatically control what columns are displayed.\n"
},
{
"from": "gpt",
"value": "Creating RDL... |
I'm having a lot of issues with NSDate objects being prematurely deallocated. I suspect that the issues may be related to the way that I deal with the objects returned from NSDate convenience methods. I think that my showDate property declaration in the JKShow class should be "retain", but changing it to assign or copy... | It looks like you've identified the source of the issue related to the premature deallocation of your `NSDate` objects. The key point you mentioned is that you weren't retaining the `NSDate` object returned from the `NSDate` convenience method within your `JKShow` class.
In Objective-C, memory management relies heavil... | 27,182 | [
{
"from": "human",
"value": "I'm having a lot of issues with NSDate objects being prematurely deallocated. I suspect that the issues may be related to the way that I deal with the objects returned from NSDate convenience methods. I think that my showDate property declaration in the JKShow class should be \"... |
:vimgrep looks like a really useful thing.
Here's how to use it:
:vim[grep][!] /{pattern}/[g][j] {file} ...
:help says that you can essentially glob {file} to name, say, *.c for the current directory. I may have started Vim with a list of files that is complicated enough that I don't want to manually type it in for {... | In Vim, you can use the following commands to run `:vimgrep` over the lists of files obtained from `:args`, `:files`, and `:buffers`.
### Using `:args`
If you want to run `:vimgrep` on the files listed in your argument list (those added via `:args`), you can simply use `%` or `args` as shown below:
```vim
:vimgrep /{... | 32,084 | [
{
"from": "human",
"value": ":vimgrep looks like a really useful thing.\nHere's how to use it:\n:vim[grep][!] /{pattern}/[g][j] {file} ... \n\n:help says that you can essentially glob {file} to name, say, *.c for the current directory. I may have started Vim with a list of files that is complicated enough t... |
This is in relation to this question
I am hosting this WCF service in a custom service host. IIS is not an option.
Is there a way to inject an HTTP "Authenticate" header in the server stack (if it's missing) early on in the request process - such that a default user can be passed into the authentication/authorization ... | To inject an HTTP "Authenticate" header in a WCF service hosted in a custom service host, you can create a custom message inspector or a message encoder. This will allow you to manipulate the incoming requests and add headers before the WCF authentication and authorization processes take place.
### Using a Custom Mes... | 21,178 | [
{
"from": "human",
"value": "This is in relation to this question\nI am hosting this WCF service in a custom service host. IIS is not an option.\nIs there a way to inject an HTTP \"Authenticate\" header in the server stack (if it's missing) early on in the request process - such that a default user can be ... |
I am building a small system administration web application (think Web-Min, but in RoR) and I need to be able to access system parameters from my Ruby code. For instance, I want to allow the user to change the hostname, time zone, or network config of the server.
My current thoughts are to have a separate setuid scr... | Building a system administration web application with Ruby on Rails that modifies system parameters involves some challenges, especially when it comes to permissions. Here are several approaches to consider, including the one you mentioned:
### 1. Setuid Script
Creating a separate setuid script (in Perl, Ruby, or anot... | 28,186 | [
{
"from": "human",
"value": "I am building a small system administration web application (think Web-Min, but in RoR) and I need to be able to access system parameters from my Ruby code. For instance, I want to allow the user to change the hostname, time zone, or network config of the server. \nMy current ... |
I have a program that uses save files. It needs to load the newest save file, but fall back on the next newest if that one is unavailable or corrupted. Can I use the windows file creation timestamp to tell the order of when they were created, or is this unreliable? I am asking because the "changed" timestamps seem unre... | Using file creation timestamps to determine the order of save files in a Windows environment can be a reliable approach, assuming that the file system and the environment you're working in maintain these timestamps accurately. Here are some considerations:
1. **File System**: Most modern file systems used by Windows (... | 28,357 | [
{
"from": "human",
"value": "I have a program that uses save files. It needs to load the newest save file, but fall back on the next newest if that one is unavailable or corrupted. Can I use the windows file creation timestamp to tell the order of when they were created, or is this unreliable? I am asking b... |
$sql = "INSERT INTO images (path, useremail, approved, flagged,caption,date) VALUES ('$target','$email',0,0, '$caption','$b')";
$sql1 = "INSERT INTO users (name, email, phone) VALUES ('$peoplename','$email','$phone')"
$conn->execute($sql, $sql1);
Above is the code Ι am using to try and write to 2 tables. Before Ι intr... | When using a COM object to interact with a database, you need to ensure that you properly execute SQL queries. In your provided code, it seems you are trying to execute two separate SQL statements in one `execute` function call, which might not be supported.
Here’s a general approach to fixing this, ensuring each SQL ... | 26,373 | [
{
"from": "human",
"value": "$sql = \"INSERT INTO images (path, useremail, approved, flagged,caption,date) VALUES ('$target','$email',0,0, '$caption','$b')\";\n$sql1 = \"INSERT INTO users (name, email, phone) VALUES ('$peoplename','$email','$phone')\"\n$conn->execute($sql, $sql1);\n\nAbove is the code Ι am ... |
For years we've been using RealNetworks' Helix server to serve streaming video courses.
It has been a pretty reliable solution up until now.
As of late, our support calls due to RealPlayer issues has gone from 2 or 3 a week (mostly PEBKAC or firewall issues) to up to about 10 a day.
I've been arguing to dump Real in fa... | When evaluating alternative streaming solutions to RealNetworks' Helix server, you'll want to consider several key factors that align with your requirements and constraints. Here’s a structured approach to help you create a compelling proposal:
### 1. **Streaming Capability**
- Ensure the solution supports live str... | 28,573 | [
{
"from": "human",
"value": "For years we've been using RealNetworks' Helix server to serve streaming video courses.\nIt has been a pretty reliable solution up until now.\nAs of late, our support calls due to RealPlayer issues has gone from 2 or 3 a week (mostly PEBKAC or firewall issues) to up to about 10 ... |
Something happened that I'm not sure should be possible. Obviously it is, because I've seen it, but I need to find the root cause & I was hoping you all could help.
We have a system that looks up latitude & longitude for a zipcode. Rather than access it every time, we cache the results in a cheap in-memory HashTable ... | The situation you described raises a few potential concerns, especially given the multi-threaded environment and the synchronization mechanisms you have in place. Let’s analyze the possible causes for the issue where two different zip codes returned the same value.
### Potential Causes
1. **Hash Map Behavior**:
- ... | 25,230 | [
{
"from": "human",
"value": "Something happened that I'm not sure should be possible. Obviously it is, because I've seen it, but I need to find the root cause & I was hoping you all could help.\nWe have a system that looks up latitude & longitude for a zipcode. Rather than access it every time, we cache t... |
I'm trying to convert the below SQL query to HQL and am having a few issues. A straight line by line conversion doesn't work, I am wondering if I should be using an Inner Join in the HQL?
SELECT (UNIX_TIMESTAMP(cosc1.change_date) - UNIX_TIMESTAMP(cosc2.change_date))
FROM customer_order_state_change cos... | When converting a SQL query with multiple LEFT JOINs to HQL, you need to be mindful of the differences in how HQL handles joins and path expressions. In HQL, you typically need to navigate through relationships defined in your entity classes.
To address your issues, here are a few suggestions for converting your SQL q... | 29,461 | [
{
"from": "human",
"value": "I'm trying to convert the below SQL query to HQL and am having a few issues. A straight line by line conversion doesn't work, I am wondering if I should be using an Inner Join in the HQL?\n SELECT (UNIX_TIMESTAMP(cosc1.change_date) - UNIX_TIMESTAMP(cosc2.change_date)) \n ... |
In .NET 3.5, I'm going to be working with System.Reflection to use AOP (probably in the context of Castle's Windsor Interceptors) to do things like define which security actions need to be performed at the method level, etc. I have heard that some parts of Reflection are slow (I've read the MSDN article around it), an... | Your approach for caching reflection information in the context of Aspect-Oriented Programming (AOP) using Castle Windsor and the .NET 3.5 Framework is well thought out. Let’s break down your approach based on the details you provided and offer some suggestions.
### Cache Key
Using a cache key that comprises `{type} +... | 30,178 | [
{
"from": "human",
"value": "In .NET 3.5, I'm going to be working with System.Reflection to use AOP (probably in the context of Castle's Windsor Interceptors) to do things like define which security actions need to be performed at the method level, etc. I have heard that some parts of Reflection are slow (... |
I want to do something like this:
List<Animal> animals = new ArrayList<Animal>();
for( Class c: list_of_all_classes_available_to_my_app() )
if (c is Animal)
animals.add( new c() );
So, I want to look at all of the classes in my application's universe, and when I find one that descends from Animal, I want to ... | You're correct that in Java, reflection alone doesn't provide a straightforward way to automatically discover and instantiate subclasses of a base class like `Animal`. However, libraries like **Reflections** and **ClassGraph** can help with this functionality by scanning the classpath for classes at runtime.
Here’s ho... | 25,966 | [
{
"from": "human",
"value": "I want to do something like this:\nList<Animal> animals = new ArrayList<Animal>();\n\nfor( Class c: list_of_all_classes_available_to_my_app() )\n if (c is Animal)\n animals.add( new c() );\n\nSo, I want to look at all of the classes in my application's universe, and when ... |
How do you calculate the number of <td> elements in a particular <tr>?
I didn't specify id or name to access directly, we have to use the document.getElementsByTagName concept.
| To calculate the number of `<td>` elements within a specific `<tr>` element using JavaScript and the `document.getElementsByTagName` method, you can follow these steps:
1. Use `document.getElementsByTagName` to get all `<tr>` elements in the document or a specific section of the document.
2. Access the specific `<tr>`... | 28,083 | [
{
"from": "human",
"value": "How do you calculate the number of <td> elements in a particular <tr>?\nI didn't specify id or name to access directly, we have to use the document.getElementsByTagName concept.\n"
},
{
"from": "gpt",
"value": "To calculate the number of `<td>` elements within a spec... |
I'm displaying a series of images in a UIScrollView. I pretty much want to replicate the Photos application.
My current architecture is:
A parent UIScrollView with content size that is wide enough for x number of pages + some extra space for margins in between the images.
Each image is contained in a UIImageView.
Ea... | It sounds like you have a good start on implementing a photo viewer with zooming capabilities, but there are some challenges you need to address regarding touch handling and navigation between images. Below are some suggestions to improve the user experience:
### 1. Disable Gesture Recognizers on the Parent UIScrollVi... | 27,543 | [
{
"from": "human",
"value": "I'm displaying a series of images in a UIScrollView. I pretty much want to replicate the Photos application.\nMy current architecture is:\n A parent UIScrollView with content size that is wide enough for x number of pages + some extra space for margins in between the images.\n E... |
In Visual Studio, I can select the "Treat warnings as errors" option to prevent my code from compiling if there are any warnings. Our team uses this option, but there are two warnings we would like to keep as warnings.
There is an option to suppress warnings, but we DO want them to show up as warnings, so that won't w... | To achieve the desired behavior in Visual Studio where you want to treat most warnings as errors but keep certain warnings as warnings, you can use the following methods:
1. **Warning Levels and Code Analysis**:
Instead of suppressing warnings or manually listing all the other warnings, consider adjusting your proj... | 29,667 | [
{
"from": "human",
"value": "In Visual Studio, I can select the \"Treat warnings as errors\" option to prevent my code from compiling if there are any warnings. Our team uses this option, but there are two warnings we would like to keep as warnings. \nThere is an option to suppress warnings, but we DO want ... |
I've been tasked with implementing a Date/Time selector for several areas of our web project, and instructed to use a control that another developer created as part of it. The control I'm working on is supposed to allow the user to choose a date from a calendar, choose a format for the display of that date (from sever... | The issue you are experiencing with multiple instances of the jQuery DatePicker not working correctly when included within a user control is likely due to the way the DatePicker is being initialized in your JavaScript.
Here's a step-by-step approach to troubleshoot and fix the issue:
### 1. Ensure Unique IDs
Make su... | 26,576 | [
{
"from": "human",
"value": "I've been tasked with implementing a Date/Time selector for several areas of our web project, and instructed to use a control that another developer created as part of it. The control I'm working on is supposed to allow the user to choose a date from a calendar, choose a format... |
Is the asp.net membership system used over wcf (transport security turned on) enough for high security internet scenarios with thousands of clients spread all over the internet?
I'm just evaluating possible solutions and wanted to know if this might fit in this category.
If not, what would be the best method to provide... | Using the ASP.NET Membership system over WCF with transport security enabled can provide a decent level of security for web applications, but it may not be sufficient for high-security scenarios, particularly when you have thousands of clients distributed over the internet. Here are some considerations and alternative ... | 27,066 | [
{
"from": "human",
"value": "Is the asp.net membership system used over wcf (transport security turned on) enough for high security internet scenarios with thousands of clients spread all over the internet?\nI'm just evaluating possible solutions and wanted to know if this might fit in this category.\nIf no... |
I think questions like this are the reason why I don't like working with PHP. The manual is good, if you can find what you are looking for. After reading through the Array Functions, I didn't see one that provides the functionality I need.
I have an array (in my case, numerically indexed) that I want to scan for a part... | If you're looking to remove a specific value from an array in PHP and then re-index the array, you can achieve this using a combination of functions. Although there isn't a single built-in function that directly accomplishes this, you can use `array_filter` to filter out the unwanted values, and then `array_values` to ... | 30,399 | [
{
"from": "human",
"value": "I think questions like this are the reason why I don't like working with PHP. The manual is good, if you can find what you are looking for. After reading through the Array Functions, I didn't see one that provides the functionality I need.\nI have an array (in my case, numerical... |
I would like to create a trivial one-off Python object to hold some command-line options. I would like to do something like this:
options = ??????
options.VERBOSE = True
options.IGNORE_WARNINGS = False
# Then, elsewhere in the code...
if options.VERBOSE:
...
Of course I could use a dictionary, but options.VERBOS... | You can create a simple object that allows attribute assignment using Python's built-in `types.SimpleNamespace` or `collections.namedtuple`. The `SimpleNamespace` is particularly straightforward for this purpose as it allows dynamic attributes to be set easily.
Here's how you can use `SimpleNamespace`:
```python
from... | 32,162 | [
{
"from": "human",
"value": "I would like to create a trivial one-off Python object to hold some command-line options. I would like to do something like this:\noptions = ??????\noptions.VERBOSE = True\noptions.IGNORE_WARNINGS = False\n\n# Then, elsewhere in the code...\nif options.VERBOSE:\n ...\n\nOf c... |
As it seems there is no scripting language for Windows mobile devices that gives access to phone (sms, mms, make a call, take photo). I wonder how complex it would be to make a Python library that would enable that (write something in C, compile, and import in PythonCE).
Question: Where shall start to understand how to... | Creating a Python library that interfaces with Windows Mobile features like SMS, MMS, making calls, or taking photos involves several steps. Below, I’ll outline the general approach and tools you would need to accomplish this task.
### 1. Understand the Environment
Windows Mobile is a platform that generally allows f... | 26,645 | [
{
"from": "human",
"value": "As it seems there is no scripting language for Windows mobile devices that gives access to phone (sms, mms, make a call, take photo). I wonder how complex it would be to make a Python library that would enable that (write something in C, compile, and import in PythonCE).\nQuesti... |
This question is related to the question posted here:
Why isn't my custom WCF behavior extension element type being found?
I'm using the WCF Behavior Extension with Custom Credentials demonstrated on MSDN here:
http://msdn.microsoft.com/en-us/library/ms730868.aspx
The only difference is that I'm using the Custom Token ... | It sounds like you're facing an issue with the WCF behavior extension elements not showing up correctly in the WCF Configuration GUI, even though you've successfully added the extension type in the configuration file.
Here are a few potential reasons and troubleshooting steps that may help resolve this issue:
1. **En... | 29,892 | [
{
"from": "human",
"value": "This question is related to the question posted here:\nWhy isn't my custom WCF behavior extension element type being found?\nI'm using the WCF Behavior Extension with Custom Credentials demonstrated on MSDN here:\nhttp://msdn.microsoft.com/en-us/library/ms730868.aspx\nThe only d... |
I'm trying to solve this flickering problem on the iphone (open gl es game). I have a few images that don't have pow-of-2 dimensions. I'm going to replace them with images with appropriate dimensions... but why do the dimensions need to be powers of two?
| In OpenGL ES, especially in earlier versions, using textures with power-of-two (POT) dimensions is essential for several reasons:
1. **Compatibility**: Many older graphics hardware and systems are optimized for textures that are powers of two in size. This is due to how memory is allocated and accessed for textures. I... | 31,489 | [
{
"from": "human",
"value": "I'm trying to solve this flickering problem on the iphone (open gl es game). I have a few images that don't have pow-of-2 dimensions. I'm going to replace them with images with appropriate dimensions... but why do the dimensions need to be powers of two?\n"
},
{
"from"... |
For a upcoming project, there are plans to port the existing C++ code that compiles on Windows and Linux to the MacOS(leopard). The software is command line application, but a GUI front end might be planned. The MacOS uses the g++ compiler. By having the same compiler as Linux, it does not seem like there would be an... | Porting a C++ application from Windows and Linux to macOS can generally be smooth, especially since you’re using the same `g++` compiler on both Linux and macOS. However, there are several potential pitfalls and considerations to keep in mind. Here are some recommendations and common issues to watch for during the port... | 27,856 | [
{
"from": "human",
"value": "For a upcoming project, there are plans to port the existing C++ code that compiles on Windows and Linux to the MacOS(leopard). The software is command line application, but a GUI front end might be planned. The MacOS uses the g++ compiler. By having the same compiler as Linux... |
In Embedded Visual Studio 4, I'm attempting to add a class though the class wizard.
Since, the file existed already, the first attempt failed. So I deleted the file and attempted to add the class again.
Now I get the error message
"A duplicate insert block exists for class xx in the source files"
and I can't figure... | The error message you're encountering in Embedded Visual Studio 4 regarding a duplicate insert block typically indicates that the class wizard still retains some references to the previously existing class definition, even after you've deleted the file. Here are some steps you can take to resolve the issue:
1. **Clean... | 30,268 | [
{
"from": "human",
"value": "In Embedded Visual Studio 4, I'm attempting to add a class though the class wizard. \nSince, the file existed already, the first attempt failed. So I deleted the file and attempted to add the class again. \nNow I get the error message\n\n\"A duplicate insert block exists for cla... |
Is it possible to configure two separate web apps (WAR) in a J2EE application (EAR) to access a shared session context?
Further info:
I ended up creating a shared class from the EAR which stored the required information in static members. This did the trick, even if it seemed like a dirty hack.
| In a J2EE (Java EE) application, it's generally not recommended to share session context directly between two separate web applications (WAR files) packaged in a single EAR (Enterprise Archive) file. Each web application typically has its own session context, which is isolated from others for security and integrity rea... | 27,795 | [
{
"from": "human",
"value": "Is it possible to configure two separate web apps (WAR) in a J2EE application (EAR) to access a shared session context?\nFurther info:\nI ended up creating a shared class from the EAR which stored the required information in static members. This did the trick, even if it seemed... |
I'm writing an application in Delphi which uses an SQLite3 database. I'd like to be able to start the application while holding some modifier keys, such as CTRL + SHIFT, to signal reinitialization of the database.
How can I capture that the application was started while these keys were held?
| To detect if certain modifier keys (like CTRL and SHIFT) were held down when starting your Delphi application, you can use the `GetAsyncKeyState` function from the Windows API. This function allows you to check the state of a specific key at the time your application starts.
Here's how you can implement this:
1. **In... | 31,471 | [
{
"from": "human",
"value": "I'm writing an application in Delphi which uses an SQLite3 database. I'd like to be able to start the application while holding some modifier keys, such as CTRL + SHIFT, to signal reinitialization of the database.\nHow can I capture that the application was started while these ... |
I assume that most of the analyzing and tracking is done based on the data gathered from browser actions like page requests. Tools like AWStats, Google Analytics and Omniture take place in this.
But there is also good amount of data available in databases or service level logs. For example GWT based application might b... | Analyzing data from databases and service-level logs can provide deep insights into user behavior, application performance, and potential security issues. Here are some best practices and approaches that can be implemented for effective database and log analysis:
### Approaches for DB and Log Analysis:
1. **Structure... | 24,560 | [
{
"from": "human",
"value": "I assume that most of the analyzing and tracking is done based on the data gathered from browser actions like page requests. Tools like AWStats, Google Analytics and Omniture take place in this.\nBut there is also good amount of data available in databases or service level logs.... |
How would you reference the models (Accord, CRV, Prius, etc) in this structure?
Is this a bad structure to be able to extract the makes...then use a make to get the models...then use the model to get the options?
var cars = [
{
"makes" : "Honda",
"models" : [
{'Accord' : ["2dr","4dr... | Your structure for representing cars with makes, models, and options is functional, but there are a few aspects that could be improved for easier extraction and usage. Specifically, the use of objects inside arrays can complicate access to models and their respective options. Here’s a revised structure that might be ea... | 17,958 | [
{
"from": "human",
"value": "How would you reference the models (Accord, CRV, Prius, etc) in this structure? \nIs this a bad structure to be able to extract the makes...then use a make to get the models...then use the model to get the options?\nvar cars = [\n {\n \"makes\" : \"Honda\",\n ... |
We are trying to move from using SQL DMO to SMO in our COM+ based application, as we are dropping support for SQL Server 2000 and adding support for SQL Server 2008 in addition to SQL Server 2005.
I have been reading around on this, and found this particular quip on this microsoft forum:
"SMO is only supported in VB/C... | Yes, you can implement SQL Server Management Objects (SMO) in a VB6 application, but it requires some additional steps because SMO is a .NET library and VB6 does not natively support .NET components.
As you've found out, SMO is built on the .NET framework and requires a .NET environment (specifically .NET Framework 2.... | 26,883 | [
{
"from": "human",
"value": "We are trying to move from using SQL DMO to SMO in our COM+ based application, as we are dropping support for SQL Server 2000 and adding support for SQL Server 2008 in addition to SQL Server 2005. \nI have been reading around on this, and found this particular quip on this micro... |
An answer to a question of mine on DB design suggested something called single table inheritance. I've done a bit of searching on that, but I can't seem to find that much clear information on it.
Basically what I seem to understand from it is that you have a big table with all the fields in it and also a type field - a... | Single Table Inheritance (STI) is indeed a technique used in database design, particularly in object-relational mapping (ORM) frameworks like Ruby on Rails. Here's a breakdown of your queries and some additional insights:
### What is Single Table Inheritance?
1. **Basic Concept**: In Single Table Inheritance, you hav... | 29,235 | [
{
"from": "human",
"value": "An answer to a question of mine on DB design suggested something called single table inheritance. I've done a bit of searching on that, but I can't seem to find that much clear information on it.\nBasically what I seem to understand from it is that you have a big table with all ... |
I need to write a rule to redirect any image file to a specific folder. Namely "images"
RewriteCond $1 ^(.*\.jpg|.*\.gif|.*\.bmp)
That will match all the imag, the the rerwrite part is confusing me.
I want that
Http://domain.com/path/controller/view/image.jpg
http://domain.com/any/path/that/i/want/image.jpg
to load ... | Yes, it's possible to use mod_rewrite in an .htaccess file to redirect image requests to a specific folder. Based on your requirement to redirect any image file (like `.jpg`, `.gif`, `.bmp`, etc.) to the `/images/` folder, you can use the following configuration.
Here's how you can set it up:
```apache
RewriteEngine ... | 29,204 | [
{
"from": "human",
"value": "I need to write a rule to redirect any image file to a specific folder. Namely \"images\"\nRewriteCond $1 ^(.*\\.jpg|.*\\.gif|.*\\.bmp)\n\nThat will match all the imag, the the rerwrite part is confusing me.\nI want that \nHttp://domain.com/path/controller/view/image.jpg\nhttp:/... |
Having a bit of trouble with the syntax where we want to call a delegate anonymously within a Control.Invoke.
We have tried a number of different approaches, all to no avail.
For example:
myControl.Invoke(delegate() { MyMethod(this, new MyEventArgs(someParameter)); });
where someParameter is local to this method
The ... | The issue you're encountering with the `Control.Invoke` method stems from how you're attempting to use an anonymous method (in this case, a lambda expression) without specifying the delegate type that `Invoke` expects. The `Invoke` method requires a delegate type that it can invoke on the UI thread, and the compiler ne... | 27,100 | [
{
"from": "human",
"value": "Having a bit of trouble with the syntax where we want to call a delegate anonymously within a Control.Invoke.\nWe have tried a number of different approaches, all to no avail.\nFor example:\nmyControl.Invoke(delegate() { MyMethod(this, new MyEventArgs(someParameter)); }); \n\nwh... |
Is there a free DayView Calendar for WPF like this one?
http://www.codeproject.com/KB/selection/Calendardayview.aspx
Thanks in advance! Cheers from Argentina!
| Yes, there are several free libraries and examples available for implementing a DayView Calendar in WPF. While the specific link you provided points to a CodeProject entry, you might find similar functionality in other resources. Here are a few suggestions:
1. **WPF Calendar Control**: While it may not be a DayView Ca... | 30,161 | [
{
"from": "human",
"value": "Is there a free DayView Calendar for WPF like this one?\nhttp://www.codeproject.com/KB/selection/Calendardayview.aspx\nThanks in advance! Cheers from Argentina!\n"
},
{
"from": "gpt",
"value": "Yes, there are several free libraries and examples available for implemen... |
I'm trying to implement a unit test for a function in a project that doesn't have unit tests and this function requires a System.Web.Caching.Cache object as a parameter. I've been trying to create this object by using code such as...
System.Web.Caching.Cache cache = new System.Web.Caching.Cache();
cache.Add(...);
...a... | Unit testing functions that require `System.Web.Caching.Cache` can indeed be challenging, especially since `Cache` is tightly coupled with the ASP.NET runtime and depends on an active `HttpContext`. Here are several approaches you can take to make your unit testing easier:
### 1. Use Dependency Injection
The best pra... | 25,193 | [
{
"from": "human",
"value": "I'm trying to implement a unit test for a function in a project that doesn't have unit tests and this function requires a System.Web.Caching.Cache object as a parameter. I've been trying to create this object by using code such as...\nSystem.Web.Caching.Cache cache = new System.... |
This post is similar to this previously asked question. I really want to set up my SVN repository in TTB format, but when creating a project in Visual Studio 2008 (ASP.NET/VB.NET), the structure created tends to be incompatible when considering the solution file, project files, folders for projects, multiple projects ... | To set up your ASP.NET project in a TTB (Trunk, Tags, Branches) structure while using Visual Studio 2008, you can follow a systematic approach to streamline the process. Here’s a step-by-step guide to help you transition your newly created ASP.NET project to the desired format without a lot of hassle:
### Step 1: Crea... | 26,323 | [
{
"from": "human",
"value": "This post is similar to this previously asked question. I really want to set up my SVN repository in TTB format, but when creating a project in Visual Studio 2008 (ASP.NET/VB.NET), the structure created tends to be incompatible when considering the solution file, project files,... |
What is the best way to manage the JavaScript files and the functions/objects context in an ASP.NET MVC app?
| Managing JavaScript files and the context of functions and objects in an ASP.NET MVC application requires a structured approach to ensure maintainability, scalability, and performance. Here are some best practices to consider:
### 1. **Organize JavaScript Files**
- **Modular Structure**: Organize your JavaScript into... | 21,732 | [
{
"from": "human",
"value": "What is the best way to manage the JavaScript files and the functions/objects context in an ASP.NET MVC app?\n"
},
{
"from": "gpt",
"value": "Managing JavaScript files and the context of functions and objects in an ASP.NET MVC application requires a structured approa... |
How do I get Watin to bypass (or click "OK") when the "this page is being redirected" popup appears when trying to GoTo(url)?
| If you are using Watin (Web Application Testing in .NET) and are encountering a popup that says "this page is being redirected," it can interfere with your automated tests. Here are some strategies to handle such popups:
### 1. **Disable the Popup in the Browser Settings:**
If you have control over the browser setting... | 27,688 | [
{
"from": "human",
"value": "How do I get Watin to bypass (or click \"OK\") when the \"this page is being redirected\" popup appears when trying to GoTo(url)?\n"
},
{
"from": "gpt",
"value": "If you are using Watin (Web Application Testing in .NET) and are encountering a popup that says \"this p... |
Can someone please point me to articles or books that discusses different programming paradigm (function/logical/OOP)... I am not looking for the syntax details but the ideas that make them good..
for ex: using functional programming we avoid any side-effects.. If I know the idea I could write side effect free program... | Certainly! Understanding different programming paradigms at a conceptual level can greatly enhance your programming skills and ability to solve problems. Here are some recommended articles and books that explore the ideas behind various programming paradigms:
### Books
1. **"Concepts, Techniques, and Models of Comput... | 26,703 | [
{
"from": "human",
"value": "Can someone please point me to articles or books that discusses different programming paradigm (function/logical/OOP)... I am not looking for the syntax details but the ideas that make them good.. \nfor ex: using functional programming we avoid any side-effects.. If I know the i... |
Please take a look at the html listed below and let me know why IE6 freezes when trying to load the remote script (located at 'http://code.katzenbach.com/Default.aspx'). The script returns JSONP and executes the 'callbackFunction' listed in the header. When it runs correctly, you'll see a pop-up alert showing numbers... | The issue you're experiencing with Internet Explorer 6 (IE6) could be related to a few different factors, given that IE6 has significant limitations and quirks compared to modern browsers.
1. **JSONP Parsing Issues**: IE6 has known issues with script injection and how it handles callbacks. If the JSONP response is not... | 30,860 | [
{
"from": "human",
"value": "Please take a look at the html listed below and let me know why IE6 freezes when trying to load the remote script (located at 'http://code.katzenbach.com/Default.aspx'). The script returns JSONP and executes the 'callbackFunction' listed in the header. When it runs correctly, ... |
I am just starting with SL and WPF. I am using the DataGrid control and I need to remove the mouseover effect (I actually will need to do more customizations than that). How do I do this. I think I need to do it with a control template but not sure how. I'm researching and reading right now. Any help would be appreciat... | Customizing the DataGrid in WPF, including removing the mouseover effect, can be done by modifying its ControlTemplate and applying styles to the DataGridRow and DataGridCell elements. Below are steps to help you achieve this.
### Step 1: Create a Style for the DataGrid
You can create a custom style for the DataGrid,... | 23,387 | [
{
"from": "human",
"value": "I am just starting with SL and WPF. I am using the DataGrid control and I need to remove the mouseover effect (I actually will need to do more customizations than that). How do I do this. I think I need to do it with a control template but not sure how. I'm researching and readi... |
I have been asked to setup a course leaflet system for a college. For whatever reason in the past their current system is not linked to their actual course file, they wish to close this link so course leaflets are related to actual course codes. Unfortunately their course file is a ms access database linked to many of ... | Integrating an MS Access database with a SQL Server database can indeed be challenging, particularly when it involves keeping two systems in sync without altering existing functionalities. However, there are several approaches you can consider to facilitate the interaction between the two databases without heavy modifi... | 28,037 | [
{
"from": "human",
"value": "I have been asked to setup a course leaflet system for a college. For whatever reason in the past their current system is not linked to their actual course file, they wish to close this link so course leaflets are related to actual course codes. Unfortunately their course file i... |
It seems if I do something like
$file = fopen($filepath, "w");
$CR = curl_init();
curl_setopt($CR, CURLOPT_URL, $source_path);
curl_setopt($CR, CURLOPT_POST, 1);
curl_setopt($CR, CURLOPT_FAILONERROR, true);
curl_setopt($CR, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($CR, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($CR, CURLOP... | Yes, your guess is correct. When you call `curl_exec()`, it starts downloading the file, and depending on the size of the file and the speed of the connection, it may not complete immediately. The `filesize()` function will return the size of the file at the time it is called, which may be smaller than the full size of... | 29,752 | [
{
"from": "human",
"value": "It seems if I do something like\n$file = fopen($filepath, \"w\");\n$CR = curl_init();\ncurl_setopt($CR, CURLOPT_URL, $source_path);\ncurl_setopt($CR, CURLOPT_POST, 1);\ncurl_setopt($CR, CURLOPT_FAILONERROR, true);\ncurl_setopt($CR, CURLOPT_RETURNTRANSFER, 1);\ncurl_setopt($CR, C... |
I have a problem with the FreeTextBox rich Text Editor in my ASP.NET site. The problem occurs when I access the site with firefox, and I have a freetextbox instance in a hidden div. The hidden div might also be an AJAX Tab Panel. The actual problem is that when the page loads it throws an uncaught exception (firebug sh... | The issue you're facing with the FreeTextBox rich text editor in Firefox is likely due to how the FreeTextBox handles its initialization when it's rendered in a hidden `<div>` or within AJAX panels. When the FreeTextBox tries to initialize while being hidden, it may not be able to compute its dimensions, leading to Jav... | 27,510 | [
{
"from": "human",
"value": "I have a problem with the FreeTextBox rich Text Editor in my ASP.NET site. The problem occurs when I access the site with firefox, and I have a freetextbox instance in a hidden div. The hidden div might also be an AJAX Tab Panel. The actual problem is that when the page loads it... |
I'm using a decimal column to store money values on a database, and today I was wondering what precision and scale to use.
Since supposedly char columns of a fixed width are more efficient, I was thinking the same could be true for decimal columns. Is it?
And what precision and scale should I use? I was thinking precis... | When designing a database to store monetary values, it's crucial to consider precision and scale carefully to ensure accurate representation of values and effective storage.
### Precision and Scale
1. **Understanding Precision and Scale**:
- **Precision** is the total number of digits that can be stored, both to ... | 29,445 | [
{
"from": "human",
"value": "I'm using a decimal column to store money values on a database, and today I was wondering what precision and scale to use.\nSince supposedly char columns of a fixed width are more efficient, I was thinking the same could be true for decimal columns. Is it?\nAnd what precision an... |
I've got a Perforce server set up, and installed the P4V client. I've created a new depot and a new workspace. Per the documentation, I've mapped the workspace to the depot. So far so good.
I now have a .SQL script that was created by an external application that I wish to check in for the first time. I copied the ... | It sounds like you're on the right track with your Perforce setup, but there are a few things you may want to check to resolve the "file(s) not opened on this client" error when you attempt to add your `.SQL` script. Here’s a step-by-step process that might help:
1. **Check Workspace Root**: First, ensure that the fil... | 29,733 | [
{
"from": "human",
"value": "I've got a Perforce server set up, and installed the P4V client. I've created a new depot and a new workspace. Per the documentation, I've mapped the workspace to the depot. So far so good.\nI now have a .SQL script that was created by an external application that I wish to c... |
For better or worse, we have a solution that relies on multiple databases that all reference a common administration database. Databases ship as part of modules, and not all modules are required for an installation (probably why we have multiple databases in the first place). The admin database is required, however .... | Your situation presents a common challenge when dealing with multiple databases that require interdependencies without strict foreign key enforcement. Here’s an analysis of your options, along with some recommendations:
### Options Analysis
1. **Impose pseudo foreign key using triggers:**
- **Pros:** This allows y... | 29,236 | [
{
"from": "human",
"value": "For better or worse, we have a solution that relies on multiple databases that all reference a common administration database. Databases ship as part of modules, and not all modules are required for an installation (probably why we have multiple databases in the first place). ... |
Since I've started my first job as a professional software developer about two years ago, I've read many articles about commonly accepted methodologies (e.g. Scrum, XP), technologies (e.g. EJB, Spring), techniques (e.g. TDD, code reviews), tools (bug tracking, wikis) and so on in software companies.
For many of these ... | It's great to hear about your journey as a software developer and your curiosity about the methodologies and practices used in the industry. The reality of software development can indeed differ from what is often presented in articles, and many companies adopt a mix of methodologies based on their specific needs, cult... | 23,157 | [
{
"from": "human",
"value": "Since I've started my first job as a professional software developer about two years ago, I've read many articles about commonly accepted methodologies (e.g. Scrum, XP), technologies (e.g. EJB, Spring), techniques (e.g. TDD, code reviews), tools (bug tracking, wikis) and so on i... |
Actually I try to find a subclass of InputStream which is also Serializable. I think that doesn't exist. Since both Interfaces have many sublclasses it is hard to find one that is a subclass of both.
Until now I haven't found anything to help my search in Eclipse. Anyone ideas?
Edit: I understand now that serializing a... | You're correct in noting that `InputStream` and `Serializable` are two different types in Java and that the Java standard library does not provide a subclass of `InputStream` that is also `Serializable`. Typically, streams are not serialized because they represent a transient state of input/output, and serializing them... | 28,379 | [
{
"from": "human",
"value": "Actually I try to find a subclass of InputStream which is also Serializable. I think that doesn't exist. Since both Interfaces have many sublclasses it is hard to find one that is a subclass of both.\nUntil now I haven't found anything to help my search in Eclipse. Anyone ideas?... |
I have SBCL running on a Ubuntu machine. I want to write a little program that I want to give to a friend who has only Windows running. What is the quickest way to cross-compile it on my machine into a "standalone" windows program (i.e. the usual runtime+core combination)?
| To cross-compile a Common Lisp program using SBCL (Steel Bank Common Lisp) on Ubuntu for Windows, you can follow these steps. This involves using the SBCL cross-compilation capabilities alongside a tool like `sbcl-win32` or `sbcl-win64`, which provides a Windows-compatible runtime.
### Steps to Cross-Compile a Common ... | 24,211 | [
{
"from": "human",
"value": "I have SBCL running on a Ubuntu machine. I want to write a little program that I want to give to a friend who has only Windows running. What is the quickest way to cross-compile it on my machine into a \"standalone\" windows program (i.e. the usual runtime+core combination)?\n... |
and can it be configured not to happen?
I'm usually finding myself saving a result of a query as a .csv and processing it later on my Unix machine. The characters being null separated makes me have to filter those chars and is a bit of a pain.
So, these are the questions:
Why is this so?
EDIT:
Because it outputs in U... | It looks like you're experiencing issues with exporting CSV files in UTF-16 encoding, which uses null characters to represent each character in the string. This is causing you to have to perform additional steps to convert the file to a more manageable format (UTF-8) before processing it on your Unix machine.
### Why ... | 30,301 | [
{
"from": "human",
"value": "and can it be configured not to happen?\nI'm usually finding myself saving a result of a query as a .csv and processing it later on my Unix machine. The characters being null separated makes me have to filter those chars and is a bit of a pain.\nSo, these are the questions:\n\nW... |
We are trying to copy a BO Query Service from one Universe to another. If you use the BO Query As A Service(QAAS) tool you can do this, but end up basically recreating the query service.
It seems like the BusinessObjects.DSWS.* libraries allow you to read and write query services, but those don't appear in the QAAS to... | Publishing a BusinessObjects (BO) Query Service programmatically similar to the QAAS tool can indeed be a complex task, as it involves interacting with several components within the BusinessObjects ecosystem. Since you noted that the `BusinessObjects.DSWS.*` libraries do not seem to directly expose a method for publish... | 28,698 | [
{
"from": "human",
"value": "We are trying to copy a BO Query Service from one Universe to another. If you use the BO Query As A Service(QAAS) tool you can do this, but end up basically recreating the query service.\nIt seems like the BusinessObjects.DSWS.* libraries allow you to read and write query servi... |
When I have my Helpers in the App_Code Directory of my APS.NET MVC VB Application, I can type <%=HTML.ImageUrl("myImage.gif")%>
If I move it to another folder I get Errors.
I assume I can import the Application Namespace to get it to work, but is that necessary?
| In an ASP.NET MVC application, the `<%= HTML.ImageUrl("myImage.gif") %>` syntax is used to generate the correct URL for the image based on the current application context. The `HTML` helper is typically available in views by default, but when you move helper methods or classes to different folders, you may need to ensu... | 29,376 | [
{
"from": "human",
"value": "When I have my Helpers in the App_Code Directory of my APS.NET MVC VB Application, I can type <%=HTML.ImageUrl(\"myImage.gif\")%>\nIf I move it to another folder I get Errors.\nI assume I can import the Application Namespace to get it to work, but is that necessary?\n"
},
{
... |
Currently using System.Web.UI.WebControls.FileUpload wrapped in our own control.
We have licenses for Telerik. I wanted to know if anyone had experience with that or could suggest a better one?
Some criteria to be measured by
validation
peformance
multiple files
localisation (browse is difficult)
security
| When evaluating file upload controls, especially when considering a switch to Telerik or another library, it's essential to look at various criteria such as validation, performance, multiple file uploads, localization, and security. Below is a summary of how Telerik's components stack up against these criteria, as well... | 27,735 | [
{
"from": "human",
"value": "Currently using System.Web.UI.WebControls.FileUpload wrapped in our own control.\nWe have licenses for Telerik. I wanted to know if anyone had experience with that or could suggest a better one?\nSome criteria to be measured by\n\nvalidation\npeformance\nmultiple files\nlocalis... |
I have a requirement to get the contents of every method in a cs file into a string. What I am looking for is when you have an input of a cs file, a dictionary is returned with the method name as the key and the method body as the value.
I have tried Regex and reflection with no success, can anyone help?
Thanks
| To extract the contents of every method from a C# (`.cs`) file and store them in a dictionary with the method name as the key and the method body as the value, you can use Roslyn, which is a .NET compiler platform that provides rich code analysis APIs. Using Roslyn makes it easier to parse and analyze C# syntax trees w... | 27,569 | [
{
"from": "human",
"value": "I have a requirement to get the contents of every method in a cs file into a string. What I am looking for is when you have an input of a cs file, a dictionary is returned with the method name as the key and the method body as the value.\nI have tried Regex and reflection with n... |
I have a class called EventConsumer which defines an event EventConsumed and a method OnEventConsumed as follows:
public event EventHandler EventConsumed;
public virtual void OnEventConsumed(object sender, EventArgs e)
{
if (EventConsumed != null)
EventConsumed(this, e);
}
I need to add attributes to the ... | The issue you're encountering is likely due to how you're attempting to call the base method using `Callvirt`. When emitting MSIL, calling a method from the base class requires careful attention to the `MethodInfo` object being used. Here's the corrected approach to accomplish what you want.
To call the base method co... | 28,369 | [
{
"from": "human",
"value": "I have a class called EventConsumer which defines an event EventConsumed and a method OnEventConsumed as follows:\npublic event EventHandler EventConsumed;\n\npublic virtual void OnEventConsumed(object sender, EventArgs e)\n{\n if (EventConsumed != null)\n EventConsume... |
What is the best way to truncate a URL when displaying it within a web page? I don't mean a link but literally displaying the URL as a value to the user, assuming that the text might be in a container of fixed width and you don't want to wrap or run outside of the container?
Is it better to truncate from the end, favo... | Truncating a URL for display purposes can be a delicate balancing act between maintaining readability and providing enough context. Here are some considerations to help you make the best decision for your specific use case:
### Truncation Strategy
1. **End Truncation vs. Middle Truncation**:
- **End Truncation**: ... | 29,251 | [
{
"from": "human",
"value": "What is the best way to truncate a URL when displaying it within a web page? I don't mean a link but literally displaying the URL as a value to the user, assuming that the text might be in a container of fixed width and you don't want to wrap or run outside of the container?\nI... |
I have the following in my web.config:
<location path="RestrictedPage.aspx">
<system.web>
<authorization>
<allow roles="Group1Admin, Group3Admin, Group7Admin"/>
<deny users="*"/>
</authorization>
</system.web>
</location>
Within RestrictedPage.aspx.cs, how do I retrieve ... | To retrieve the allowed roles from the `web.config` file in your `RestrictedPage.aspx.cs` code-behind, you can indeed use XPath to parse the configuration settings. However, as you mentioned, you are looking for a more framework-like approach, similar to the way you handle `SiteMap`.
Unfortunately, ASP.NET does not pr... | 26,853 | [
{
"from": "human",
"value": "I have the following in my web.config:\n<location path=\"RestrictedPage.aspx\">\n <system.web>\n <authorization>\n <allow roles=\"Group1Admin, Group3Admin, Group7Admin\"/>\n <deny users=\"*\"/>\n </authorization>\n </system.web>\n</locat... |
I'm pretty sure one would do this using the os.plock(op) function, but I have no idea how. Also, if there's a better way, I'd be grateful to find out. Code snippets are very welcome.
| It seems like you're referring to file locking in Python, possibly to prevent concurrent access to a file. The `os` module in Python provides a way to perform various operations, but `os.plock()` is not a standard function in Python's `os` module.
Instead, for file locking in Python, you can use the `fcntl` module on ... | 26,757 | [
{
"from": "human",
"value": "I'm pretty sure one would do this using the os.plock(op) function, but I have no idea how. Also, if there's a better way, I'd be grateful to find out. Code snippets are very welcome. \n"
},
{
"from": "gpt",
"value": "It seems like you're referring to file locking in ... |
I'm currently developing a Facebook application which will eventually end up on a Facebook Page. The problem is that I don't know how to remove the box header (handle?) with the application name and the close-button.
I've seen other applications on Pages being able to remove the header. Look at Apples Page here: http:/... | To remove the header (the application name and close button) from your Facebook application that will be hosted on a Facebook Page, you'll need to ensure that you are using an IFrame rather than FBML. As of the changes to Facebook's platform policies, the use of FBML has been deprecated, and it is encouraged to use IFr... | 28,299 | [
{
"from": "human",
"value": "I'm currently developing a Facebook application which will eventually end up on a Facebook Page. The problem is that I don't know how to remove the box header (handle?) with the application name and the close-button.\nI've seen other applications on Pages being able to remove th... |
I could use some help creating an XSL template that will take a string of numbers (i.e., 123456789) and format that string into a Social Security Number format (i.e., 123-45-6789). I found one example on the Internet, but it seemed overcomplicated.
I'm new to XSLT, so please keep that in mind when replying. Thank you... | Creating an XSLT template to format a string of numbers into a Social Security Number (SSN) format is straightforward. Below is a simple XSLT example that takes a string of 9 digits and formats it as `XXX-XX-XXXX`.
Here’s the XSLT code you can use:
```xml
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version... | 30,184 | [
{
"from": "human",
"value": "I could use some help creating an XSL template that will take a string of numbers (i.e., 123456789) and format that string into a Social Security Number format (i.e., 123-45-6789). I found one example on the Internet, but it seemed overcomplicated.\nI'm new to XSLT, so please k... |
We all know to keep it simple, right?
I've seen complexity being measured as the number of interactions between systems, and I guess that's a very good place to start. Aside from gut feel though, what other (preferably more objective) methods can be used to determine the level of complexity of a particular design or pi... | Measuring the complexity of a design or piece of software can indeed be challenging, but there are several objective methods, rules, and heuristics that can be used to assess complexity beyond gut feelings. Here are some of the most popular ones:
### 1. **Cyclomatic Complexity**
- **Description**: This metric measures... | 28,045 | [
{
"from": "human",
"value": "We all know to keep it simple, right?\nI've seen complexity being measured as the number of interactions between systems, and I guess that's a very good place to start. Aside from gut feel though, what other (preferably more objective) methods can be used to determine the level ... |
Let's say I have a class
public class ItemController:Controller
{
public ActionResult Login(int id)
{
return View("Hi", id);
}
}
On a page that is not located at the Item folder, where ItemController resides, I want to create a link to the Login method. So which Html.ActionLink method I should use ... | In recent versions of ASP.NET MVC, the `Html.ActionLink` method has been streamlined, and you can still create links to specific actions using a more straightforward syntax.
To create a link to the `Login` action in the `ItemController`, you can use the following code:
```csharp
@Html.ActionLink("Link Text", "Login",... | 27,291 | [
{
"from": "human",
"value": "Let's say I have a class\npublic class ItemController:Controller\n{\n public ActionResult Login(int id)\n {\n return View(\"Hi\", id);\n }\n}\n\nOn a page that is not located at the Item folder, where ItemController resides, I want to create a link to the Login m... |
I have an Expander placed on a window with a blue background and I would like to make the button for the expander another color than the default (blue, which it is receiving from the window). When I modify the background property of the expander it changes the entire expander, header and all to the new color. However... | In WPF (Windows Presentation Foundation), if you want to change the color of only the expander's button (header) while keeping the rest of the expander's background intact, you'll need to style the `Expander` control specifically for the header.
The `Expander` control uses a `Header` property, and by default, the sty... | 27,847 | [
{
"from": "human",
"value": "I have an Expander placed on a window with a blue background and I would like to make the button for the expander another color than the default (blue, which it is receiving from the window). When I modify the background property of the expander it changes the entire expander, ... |
I'd love a good native Python library to write XLS, but it doesn't seem to exist. Happily, Jython does.
So I'm trying to decide between jexcelapi and Apache HSSF:
http://www.andykhan.com/jexcelapi/tutorial.html#writing
http://poi.apache.org/hssf/quick-guide.html
(I can't use COM automation because I'm not on Windows, ... | When deciding between JExcelApi and Apache POI (HSSF), there are a few key factors to consider, including your specific needs, the complexity of the features you want to use, and your comfort level with Java libraries.
### JExcelApi
- **Pros**:
- Simplicity: JExcelApi is designed to be straightforward and easy to us... | 26,327 | [
{
"from": "human",
"value": "I'd love a good native Python library to write XLS, but it doesn't seem to exist. Happily, Jython does.\nSo I'm trying to decide between jexcelapi and Apache HSSF:\nhttp://www.andykhan.com/jexcelapi/tutorial.html#writing\nhttp://poi.apache.org/hssf/quick-guide.html\n(I can't us... |
Does anybody know any plugin, that can show line numbers for SQL queries in Rails logs? Something like this:
User Load (0.003154) SELECT * FROM `users` WHERE (`users`.`id` = 1) - (user.rb, line 24)
Thanks!
| To add line numbers to your SQL queries in Rails logs, you can use the `activerecord-query-trace` gem. This gem adds the ability to log where the SQL query was called from, including the filename and line number.
Here’s how to set it up:
1. Add the gem to your Gemfile:
```ruby
gem 'activerecord-query-trace'
... | 32,478 | [
{
"from": "human",
"value": "Does anybody know any plugin, that can show line numbers for SQL queries in Rails logs? Something like this:\nUser Load (0.003154) SELECT * FROM `users` WHERE (`users`.`id` = 1) - (user.rb, line 24)\n\nThanks!\n"
},
{
"from": "gpt",
"value": "To add line numbers to... |
I am trying to aid another programmer with a page called Default.aspx with a code-behind section, and unfortunately I am at a bit of a loss.
Partial Class _Default
Inherits OverheadClass
'A bunch of global variables here'
Private Sub page_load(ByVal sender As Object, ByVal e As System.Eventarts) Handles Me.Load
'... | In ASP.NET with VB.NET, the order of execution for event handlers like `Load` can be controlled through the inheritance structure. If you want the `Load` method of the `OverheadClass` to execute before the `Load` event of the `Default` page, you have a few options.
The most straightforward approach is to explicitly c... | 23,917 | [
{
"from": "human",
"value": "I am trying to aid another programmer with a page called Default.aspx with a code-behind section, and unfortunately I am at a bit of a loss.\n Partial Class _Default\n Inherits OverheadClass\n 'A bunch of global variables here'\n\n Private Sub page_load(ByVal sender As Object, B... |
I've heard it said that the Entity Framework is overkill or that it's difficult to learn compared to LinqToSql.
I am wondering in what way? I used LinqToSql and like it. So, I am trying the EF and for the things I'm doing they seem almost exactly the same. Namespaces and method names are different but so far I don't... | You've touched on several important points regarding the comparison between LINQ to SQL and Entity Framework (EF). Let's break down some of the key considerations in this discussion:
### 1. **Complexity and Learning Curve**:
- **Configuration**: Entity Framework often requires more initial setup compared to LINQ to SQ... | 30,081 | [
{
"from": "human",
"value": "I've heard it said that the Entity Framework is overkill or that it's difficult to learn compared to LinqToSql.\nI am wondering in what way? I used LinqToSql and like it. So, I am trying the EF and for the things I'm doing they seem almost exactly the same. Namespaces and met... |
I need ideas on how to go about table layout problem.
I want to set different width of the columns dependent on the picked language.
| Creating a dynamic table layout where column widths adjust based on the selected language is a common requirement in multilingual applications. Below are several ideas and approaches to achieve this:
### 1. **CSS with Language-Specific Classes**
You can use CSS classes to define column widths for each language. When ... | 25,749 | [
{
"from": "human",
"value": "I need ideas on how to go about table layout problem.\nI want to set different width of the columns dependent on the picked language.\n"
},
{
"from": "gpt",
"value": "Creating a dynamic table layout where column widths adjust based on the selected language is a commo... |
I have a web application that requires a server based component to periodically access POP3 email boxes and retrieve emails. The service then needs to process the emails which will involve:
Validating the email against some business rules (does it contain a valid reference in the subject line, which user sent the mail... | Your approach to integrating a POP3 email retrieval component into your web application is practical, especially considering your preference not to reinvent the wheel. Based on your updates and reviews of various libraries, here's a streamlined approach to build the desired functionality, focusing on both the email ret... | 29,255 | [
{
"from": "human",
"value": "I have a web application that requires a server based component to periodically access POP3 email boxes and retrieve emails. The service then needs to process the emails which will involve:\n\nValidating the email against some business rules (does it contain a valid reference in... |
I need to tweak some variables (only in a development setting) without having to restart IIS or anything (so I assume Web.Config is the wrong place to put them). Where is the easiest place to put about 500 config settings that have to be read for every request and written to, like I said, while IIS is running?
EDIT: ... | For your scenario, it sounds like you need a simple and flexible way to handle configuration settings in a development environment without the overhead of restarting IIS or dealing with a database. Here are a few options you can consider:
### 1. **Using JSON or XML Files**
You can create a simple JSON or XML file to ... | 27,309 | [
{
"from": "human",
"value": "I need to tweak some variables (only in a development setting) without having to restart IIS or anything (so I assume Web.Config is the wrong place to put them). Where is the easiest place to put about 500 config settings that have to be read for every request and written to, l... |
I want to compare two ms-access .mdb files to check that the data they contain is same in both.
How can I do this?
| Comparing two Microsoft Access `.mdb` files can be done through various methods, depending on your comfort level with tools and programming. Here are some options:
### Method 1: Using Microsoft Access
1. **Import Data into a New Database**:
- Create a new Access database.
- Import tables from both `.mdb` files i... | 26,152 | [
{
"from": "human",
"value": "I want to compare two ms-access .mdb files to check that the data they contain is same in both.\nHow can I do this?\n"
},
{
"from": "gpt",
"value": "Comparing two Microsoft Access `.mdb` files can be done through various methods, depending on your comfort level with ... |
I have a memory of talking to people who have got so far in using Ruby on Rails and then had to abandon it when they have hit limits, or found it was ultimately too rigid. I forget the details but it may have had to do with using more than one database.
So what I'd like is to know is what features/requirements fall ou... | Ruby on Rails is a powerful web application framework that emphasizes convention over configuration, which can speed up development for standard web applications. However, it can also introduce limitations or challenges when building applications that have specific complex requirements or when trying to fit non-standar... | 25,240 | [
{
"from": "human",
"value": "I have a memory of talking to people who have got so far in using Ruby on Rails and then had to abandon it when they have hit limits, or found it was ultimately too rigid. I forget the details but it may have had to do with using more than one database.\nSo what I'd like is to ... |
Does anyone have experience with trellis? Looking at it as a framework for defining rules for field interaction and validation in grids and data entry screens.
| Yes, Trellis is a framework that can be used for various purposes, including defining rules for field interactions and validations in data entry screens and grids. It allows you to create dynamic, responsive interfaces by leveraging its capabilities for data binding, validation, and interaction modeling.
Here are some... | 30,715 | [
{
"from": "human",
"value": "Does anyone have experience with trellis? Looking at it as a framework for defining rules for field interaction and validation in grids and data entry screens.\n"
},
{
"from": "gpt",
"value": "Yes, Trellis is a framework that can be used for various purposes, includ... |
Ok guys just a small game:
I have some specifications for a project. At some point they ask for the following to encrypt a password over the net, saying that it is a challenge response protocol:
CLIENT ----------------------------- SERVER
(1)ask for challenge -------------->
(2) <---------------------------- send... | Your analysis of the challenge-response protocol is correct: if an attacker can capture packets 2 and 3, they can indeed determine the actual password by XORing the two values together. This is a vulnerability of the current implementation, as the protocol does not provide sufficient protection against replay or dictio... | 29,596 | [
{
"from": "human",
"value": "Ok guys just a small game:\nI have some specifications for a project. At some point they ask for the following to encrypt a password over the net, saying that it is a challenge response protocol:\n\nCLIENT ----------------------------- SERVER\n\n(1)ask for challenge ------------... |
The project I'm working on uses a window.onerror event handler to report user problems. I've noticed a single user that just cannot seem to load the Google Analytics script. Our site doesn't see a lot of traffic so I'm not sure how widespread this is, but so far it seems to just effect one user.
His user agent is: ... | It seems that the user experiencing issues is using an extremely outdated version of Firefox (2.0.0.17), which was released in 2008. Given the age of the browser and the underlying operating system (Windows XP), there are several potential reasons why the Google Analytics script may not be loading properly for this use... | 23,005 | [
{
"from": "human",
"value": "The project I'm working on uses a window.onerror event handler to report user problems. I've noticed a single user that just cannot seem to load the Google Analytics script. Our site doesn't see a lot of traffic so I'm not sure how widespread this is, but so far it seems to ju... |
I wrote a small web app using ruby on rails, its main purpose is to upload, store, and display results from xml(files can be up to several MB) files. After running for about 2 months I noticed that the mongrel process was using about 4GB of memory. I did some research on debugging ruby memory leaks and could not find... | Memory leaks in Ruby on Rails applications can indeed lead to increased memory usage over time. Here are answers to your questions regarding tools and coding patterns that can lead to memory leaks.
### Tools to Find Memory Leaks in Ruby/Rails
1. **Memory Profiler**:
- This gem helps you track memory allocations an... | 24,897 | [
{
"from": "human",
"value": "I wrote a small web app using ruby on rails, its main purpose is to upload, store, and display results from xml(files can be up to several MB) files. After running for about 2 months I noticed that the mongrel process was using about 4GB of memory. I did some research on debug... |
If I do this:
// In header
class Foo {
void foo(bar*);
};
// In cpp
void Foo::foo(bar* const pBar) {
//Stuff
}
The compiler does not complain that the signatures for Foo::foo do not match. However if I had:
void foo(const bar*); //In header
void Foo::foo(bar*) {} //In cpp
The code will fail to compile.
What is goin... | The behavior you are observing is due to the differences in pointer qualification between the function signatures in your class `Foo`. Let's break down the two scenarios you presented.
### Scenario 1
**Header:**
```cpp
class Foo {
void foo(bar*);
};
```
**CPP:**
```cpp
void Foo::foo(bar* const pBar) {
// Stu... | 28,945 | [
{
"from": "human",
"value": "If I do this:\n// In header \nclass Foo {\nvoid foo(bar*);\n};\n\n// In cpp\nvoid Foo::foo(bar* const pBar) {\n//Stuff\n}\n\nThe compiler does not complain that the signatures for Foo::foo do not match. However if I had:\nvoid foo(const bar*); //In header\nvoid Foo::foo(bar*) {}... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.