instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
Why are pointers such a leading factor of confusion for many new, and even old, college-level students in C or C++? Are there any tools or thought processes that helped you understand how pointers work at the variable, function, and beyond level?
What are some good practice things that can be done to bring somebody to... | Pointers can indeed be a significant source of confusion for both new and experienced programmers in C and C++. Here are some reasons for this confusion, along with tools, thought processes, and practice strategies that can help in understanding pointers better.
### Reasons for Confusion
1. **Abstract Concept**: Point... | 3,574 | [
{
"from": "human",
"value": "Why are pointers such a leading factor of confusion for many new, and even old, college-level students in C or C++? Are there any tools or thought processes that helped you understand how pointers work at the variable, function, and beyond level?\nWhat are some good practice th... |
I am not concerned about other kinds of attacks. Just want to know whether HTML Encode can prevent all kinds of XSS attacks.
Is there some way to do an XSS attack even if HTML Encode is used?
| HTML encoding is a crucial defense mechanism against Cross-Site Scripting (XSS) attacks, but it is not infallible and doesn't provide comprehensive protection on its own. Here’s why:
1. **Context Sensitivity**: HTML encoding must be applied correctly based on the context in which user input is placed. For example, enc... | 7,418 | [
{
"from": "human",
"value": "I am not concerned about other kinds of attacks. Just want to know whether HTML Encode can prevent all kinds of XSS attacks.\nIs there some way to do an XSS attack even if HTML Encode is used?\n"
},
{
"from": "gpt",
"value": "HTML encoding is a crucial defense mechan... |
I'm working now on a page that has a column of boxes styled with sexy shadows and corners and whatnot using the example here. I have to admit, I don't fully understand how that CSS works, but it looks great.
Inside the topmost box is a text-type input used for searching. That search box is wired up to a YUI autocompl... | The issue you are experiencing in IE7 with the autocomplete suggestions being rendered underneath the rounded-corner boxes is likely related to how different browsers handle CSS positioning and z-index.
Here are some steps you can take to troubleshoot and potentially resolve the issue:
1. **Check Positioning**: Ensur... | 8,000 | [
{
"from": "human",
"value": "I'm working now on a page that has a column of boxes styled with sexy shadows and corners and whatnot using the example here. I have to admit, I don't fully understand how that CSS works, but it looks great.\nInside the topmost box is a text-type input used for searching. That... |
VMware server 1.0.7 installed with vmware-package
Debian GNU/Linux testing (lenny)
Kernel 2.6.26-1-686
There were several compile problems when trying to build the binary kernel modules from the vmware-server-kernel-source package made by vmware-package from the VMware server tarball. Recently VMware has updated thei... | To submit patches or suggestions to VMware, you typically have a few options:
1. **VMware Community Forums**: You can post your patch or suggestion in the relevant section of the VMware Community Forums. Engaging with other users may also help gain attention for your fix, and VMware staff sometimes monitor these forum... | 10,356 | [
{
"from": "human",
"value": "\nVMware server 1.0.7 installed with vmware-package\nDebian GNU/Linux testing (lenny)\nKernel 2.6.26-1-686\n\nThere were several compile problems when trying to build the binary kernel modules from the vmware-server-kernel-source package made by vmware-package from the VMware se... |
What is the best way to setup one Linux box to listen on its serial port for incoming connections? I've done a lot of googling but I can't find the right combination of commands to actually get them to talk!
My main objective is to provide a serial interface to running instances of kvm/qemu VMs. They currently only hav... | Setting up a Linux box to listen on its serial port for incoming connections, especially for interfacing with KVM/QEMU virtual machines (VMs), can be accomplished using a combination of serial device configuration and a terminal emulation program. Here’s how you can achieve this.
### Step-by-Step Guide
1. **Create a ... | 7,752 | [
{
"from": "human",
"value": "What is the best way to setup one Linux box to listen on its serial port for incoming connections? I've done a lot of googling but I can't find the right combination of commands to actually get them to talk!\nMy main objective is to provide a serial interface to running instance... |
I have 3 Linux machines, and want some way to keep the dotfiles in their home directories in sync. Some files, like .vimrc, are the same across all 3 machines, and some are unique to each machine.
I've used SVN before, but all the buzz about DVCSs makes me think I should try one - is there a particular one that would w... | Using a Distributed Version Control System (DVCS) can be a great choice for managing your dotfiles, as it allows you to work offline, branch, and collaborate more easily. Both Git and Mercurial (Hg) are popular options for this purpose, with Git being the most widely used. Here's a breakdown of why Git might be a great... | 5,935 | [
{
"from": "human",
"value": "I have 3 Linux machines, and want some way to keep the dotfiles in their home directories in sync. Some files, like .vimrc, are the same across all 3 machines, and some are unique to each machine.\nI've used SVN before, but all the buzz about DVCSs makes me think I should try on... |
Can you please point to alternative data storage tools and give good reasons to use them instead of good-old relational databases? In my opinion, most applications rarely use the full power of SQL--it would be interesting to see how to build an SQL-free application.
| Certainly! There are several alternative data storage tools beyond traditional relational databases (RDBMS) that can be advantageous depending on your use case. Here are some notable options along with reasons why one might choose them over relational databases:
### 1. **NoSQL Databases**
- **Examples:** MongoDB, C... | 3,849 | [
{
"from": "human",
"value": "Can you please point to alternative data storage tools and give good reasons to use them instead of good-old relational databases? In my opinion, most applications rarely use the full power of SQL--it would be interesting to see how to build an SQL-free application.\n"
},
{
... |
I'm trying to pick up ruby by porting a medium-sized (non-OO) perl program. One of my personal idioms is to set options like this:
use Getopt::Std;
our $opt_v; # be verbose
getopts('v');
# and later ...
$opt_v && print "something interesting\n";
In perl, I kind of grit my teeth and let $opt_v be (effectively) a globa... | You're right to consider how global state can affect the design of your Ruby program, especially when converting from Perl. Using global variables can lead to tightly coupled code that is difficult to maintain and test. In Ruby, a more idiomatic approach would be to encapsulate the state in a way that classes can acces... | 6,694 | [
{
"from": "human",
"value": "I'm trying to pick up ruby by porting a medium-sized (non-OO) perl program. One of my personal idioms is to set options like this:\nuse Getopt::Std;\nour $opt_v; # be verbose\ngetopts('v');\n# and later ...\n$opt_v && print \"something interesting\\n\";\n\nIn perl, I kind of gr... |
What are the best practices around creating flat file database structures in PHP?
A lot of more matured PHP flat file frameworks out there which I attempt to implement SQL-like query syntax which is over the top for my purposes in most cases. (I would just use a database at that point).
Are there any elegant tricks out... | Creating a flat file database structure in PHP can be a straightforward process, especially for smaller projects or when the overhead of a full database system is unnecessary. While you may not need the full power of SQL for simple tasks, there are still best practices that can help you manage flat file databases effec... | 557 | [
{
"from": "human",
"value": "What are the best practices around creating flat file database structures in PHP?\nA lot of more matured PHP flat file frameworks out there which I attempt to implement SQL-like query syntax which is over the top for my purposes in most cases. (I would just use a database at tha... |
We have got a custom MembershipProvider in ASP.NET. Now there are 2 possible scenario the user can be validated:
User login via login.aspx page by entering his username/password. I have used Login control and linked it with the MyMembershipProvider. This is working perfectly fine.
An authentication token is passed via... | To authenticate a user in ASP.NET using a custom `MembershipProvider` without using the `Login` control, you need to manually create an authentication ticket and sign the user in after successfully validating the user's token.
Here's how to do it step-by-step:
1. **Validate the User**: First, you validate the user u... | 7,295 | [
{
"from": "human",
"value": "We have got a custom MembershipProvider in ASP.NET. Now there are 2 possible scenario the user can be validated:\n\nUser login via login.aspx page by entering his username/password. I have used Login control and linked it with the MyMembershipProvider. This is working perfectly ... |
I'm using OLEDB provider for ADO.Net connecting to an Oracle database. In my loop, I am doing an insert:
insert into ps_tl_compleave_tbl values('2626899', 0, TO_DATE('01/01/2002', 'MM/DD/YYYY'), 'LTKN', 'LTKN', '52', TO_DATE('01/01/2002', 'MM/DD/YYYY'), 16.000000, 24.000)insert into ps_tl_compleave_tbl values('4327142... | The error you're encountering, `ORA-00933: SQL command not properly ended`, is likely due to the way you're concatenating multiple SQL commands together in a single execution. In Oracle SQL, each SQL statement should be executed individually. If you concatenate multiple `INSERT` statements together without a proper sep... | 6,157 | [
{
"from": "human",
"value": "I'm using OLEDB provider for ADO.Net connecting to an Oracle database. In my loop, I am doing an insert:\ninsert into ps_tl_compleave_tbl values('2626899', 0, TO_DATE('01/01/2002', 'MM/DD/YYYY'), 'LTKN', 'LTKN', '52', TO_DATE('01/01/2002', 'MM/DD/YYYY'), 16.000000, 24.000)inser... |
In Perl, a conditional can be expressed either as
if (condition) { do something }
or as
(condition) and do { do something }
Interestingly, the second way seems to be about 10% faster. Does anyone know why?
| The difference in performance you observe between the two constructs in Perl (`if` statement vs. the `and` operator) is generally related to how the Perl interpreter handles them.
1. **Control Structures vs. Operators**:
- The `if` statement is a control structure that is specifically designed for flow control. It... | 7,547 | [
{
"from": "human",
"value": "In Perl, a conditional can be expressed either as\nif (condition) { do something }\n\nor as\n(condition) and do { do something }\n\nInterestingly, the second way seems to be about 10% faster. Does anyone know why?\n"
},
{
"from": "gpt",
"value": "The difference in pe... |
Does anyone know how to achieve the cover-flow effect using JavaScript to scroll through a bunch of images. I'm not talking about the 3D rotating itunes cover-art, but the effect that happens when you hit the space bar in a folder of documents, allowing you to preview them in a lightbox fashion.
| Creating a cover-flow effect to preview images in a lightbox-style can be achieved using HTML, CSS, and JavaScript. Below is a simple implementation that demonstrates how you can achieve this effect.
### HTML Structure
First, let's set up the basic HTML structure for the cover-flow effect.
```html
<!DOCTYPE html>
<h... | 4,396 | [
{
"from": "human",
"value": "Does anyone know how to achieve the cover-flow effect using JavaScript to scroll through a bunch of images. I'm not talking about the 3D rotating itunes cover-art, but the effect that happens when you hit the space bar in a folder of documents, allowing you to preview them in a... |
I'm a beginning C++ programmer / network admin, but I figure I can learn how to do this if someone points me in the right direction. Most of the tutorials are demonstrated using old code that no longer works for some reason.
Since I'm on Linux, all I need is an explanation on how to write raw Berkeley sockets. Can som... | Certainly! Berkeley sockets provide a powerful way to handle network communications in C and C++. Raw sockets give you direct access to the underlying transport layer protocols, allowing you to create and handle custom network packets. Below is a brief guide to help you understand and get started with raw Berkeley sock... | 3,786 | [
{
"from": "human",
"value": "I'm a beginning C++ programmer / network admin, but I figure I can learn how to do this if someone points me in the right direction. Most of the tutorials are demonstrated using old code that no longer works for some reason. \nSince I'm on Linux, all I need is an explanation on ... |
I want to send email from a Ruby application. Is there a call in the core language to do this or is there a library I should use? What's the best way to do this?
| In Ruby, there is no built-in core library specifically for sending emails, but there are several popular gems that can help you accomplish this easily and effectively. The most commonly used gem for sending emails in Ruby applications is `ActionMailer`, which is part of the Rails framework but can also be used indepen... | 5,614 | [
{
"from": "human",
"value": "I want to send email from a Ruby application. Is there a call in the core language to do this or is there a library I should use? What's the best way to do this?\n"
},
{
"from": "gpt",
"value": "In Ruby, there is no built-in core library specifically for sending emai... |
Basically I'm going to go a bit broad here and ask a few questions to get a bit of a picture of how people are handling UI these days.
Lately I've found it pretty easy to do some fancy things with UI design and with WPF specifically we're finding new ways to do layouts that are better looking and more functional for th... | Your questions touch on several important aspects of UI design and development, especially in the context of modern frameworks like WPF, Web technologies, and Silverlight. Here’s a comprehensive overview addressing your queries:
### Rethinking Business App Design
1. **Shifting Perspectives**: As teams move from WinFo... | 4,825 | [
{
"from": "human",
"value": "Basically I'm going to go a bit broad here and ask a few questions to get a bit of a picture of how people are handling UI these days.\nLately I've found it pretty easy to do some fancy things with UI design and with WPF specifically we're finding new ways to do layouts that are... |
@Entity
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
public class Problem {
@ManyToOne
private Person person;
}
@Entity
@DiscriminatorValue("UP")
public class UglyProblem extends Problem {}
@Entity
public class Person {
@OneToMany(mappedBy="person")
private List< UglyProblem > problems;
}
I ... | Your question revolves around the behavior of the Hibernate ORM with respect to the inheritance of relationships, particularly the `@ManyToOne` relationships, when using a single table inheritance strategy. This is indeed an interesting aspect of Hibernate's design.
In Hibernate, when you use `@Inheritance(strategy = ... | 5,228 | [
{
"from": "human",
"value": "@Entity\n@Inheritance(strategy = InheritanceType.SINGLE_TABLE)\npublic class Problem {\n @ManyToOne\n private Person person;\n}\n\n@Entity\n@DiscriminatorValue(\"UP\")\npublic class UglyProblem extends Problem {}\n\n@Entity\npublic class Person {\n @OneToMany(mappedBy=\... |
How can I get a ASP.NET (inc MVC) application talking to a Flex UI over AMF. I am wanting to push approx 100+ records around at a time and AMF would appear to be the way forward, but there doesn't appear to be anything obvious.
| Integrating an ASP.NET application (including MVC) with a Flex UI using AMF (Action Message Format) can indeed be accomplished, but it requires some setup since AMF is not natively supported in ASP.NET. Below are some steps and recommendations to help you achieve this:
### Steps to Integrate ASP.NET with Flex UI via A... | 4,410 | [
{
"from": "human",
"value": "How can I get a ASP.NET (inc MVC) application talking to a Flex UI over AMF. I am wanting to push approx 100+ records around at a time and AMF would appear to be the way forward, but there doesn't appear to be anything obvious.\n"
},
{
"from": "gpt",
"value": "Integ... |
Problem
I need to redirect some short convenience URLs to longer actual URLs. The site in question uses a set of subdomains to identify a set of development or live versions.
I would like the URL to which certain requests are redirected to include the HTTP_HOST such that I don't have to create a custom .htaccess file f... | To achieve the desired functionality of redirecting based on the `HTTP_HOST` using Apache's mod_rewrite module, you can use the following rules in your `.htaccess` file. While mod_alias does not support variable substitution like `HTTP_HOST`, mod_rewrite will allow you to accomplish this with ease.
Here's a solution u... | 6,642 | [
{
"from": "human",
"value": "Problem\nI need to redirect some short convenience URLs to longer actual URLs. The site in question uses a set of subdomains to identify a set of development or live versions.\nI would like the URL to which certain requests are redirected to include the HTTP_HOST such that I don... |
I'm looking for a tool which can generate a Makefile for a C/C++ project for different compilers (GCC, Microsoft Visual C++, C++Builder, etc.) and different platforms (Windows, Linux, and Mac).
| There are several tools and solutions that can help you generate Makefiles (or equivalent build files) for C/C++ projects across different compilers and platforms. Here are some popular options:
1. **CMake**:
- **Description**: CMake is a cross-platform build system generator. It can generate Makefiles for Unix-lik... | 2,249 | [
{
"from": "human",
"value": "I'm looking for a tool which can generate a Makefile for a C/C++ project for different compilers (GCC, Microsoft Visual C++, C++Builder, etc.) and different platforms (Windows, Linux, and Mac).\n"
},
{
"from": "gpt",
"value": "There are several tools and solutions th... |
I am using the tablesorter plugin (http://tablesorter.com) and am having a problem with column widths in IE7. It looks fine in Firefox and sometimes in IE7.
Here's a screenshot of the problem:
IE7 View
and here's how it's supposed to look:
Firefox view
| When dealing with layout issues, especially in older browsers like IE7, there are a few strategies you can use to address column width problems in the tablesorter plugin. Here are some suggestions:
### 1. Set Explicit Column Widths
You can explicitly define the widths of your table columns using CSS. For example:
```... | 7,383 | [
{
"from": "human",
"value": "I am using the tablesorter plugin (http://tablesorter.com) and am having a problem with column widths in IE7. It looks fine in Firefox and sometimes in IE7.\nHere's a screenshot of the problem:\nIE7 View\nand here's how it's supposed to look:\nFirefox view\n"
},
{
"from"... |
In Google Reader, you can use a bookmarklet to "note" a page you're visiting. When you press the bookmarklet, a little Google form is displayed on top of the current page. In the form you can enter a description, etc. When you press Submit, the form submits itself without leaving the page, and then the form disappears.... | Creating a bookmarklet that allows you to "note" a page using a simple overlay form is a fun project! Here’s how you can implement something like this step-by-step, along with considerations for potential issues.
### Step-by-Step Implementation
1. **Creating a Bookmarklet:**
A bookmarklet is simply a JavaScript sn... | 6,251 | [
{
"from": "human",
"value": "In Google Reader, you can use a bookmarklet to \"note\" a page you're visiting. When you press the bookmarklet, a little Google form is displayed on top of the current page. In the form you can enter a description, etc. When you press Submit, the form submits itself without leav... |
I'm working on a utility which needs to resolve hex addresses to a symbolic function name and source code line number within a binary. The utility will run on Linux on x86, though the binaries it analyzes will be for a MIPS-based embedded system. The MIPS binaries are in ELF format, using DWARF for the symbolic debuggi... | There are indeed a few Python libraries available that can help you work with DWARF and ELF binaries directly, without needing to fork external processes like `objdump`. Here are some options you can consider:
1. **pyelftools**: This is a pure Python library for parsing ELF files and DWARF information. It is quite cap... | 4,938 | [
{
"from": "human",
"value": "I'm working on a utility which needs to resolve hex addresses to a symbolic function name and source code line number within a binary. The utility will run on Linux on x86, though the binaries it analyzes will be for a MIPS-based embedded system. The MIPS binaries are in ELF for... |
I've got a generic<> function that takes a linq query ('items') and enumerates through it adding additional properties. How can I select all the properties of the original 'item' rather than the item itself (as the code below does)?
So equivalent to the sql: select *, 'bar' as Foo from items
foreach (var item in items)... | To achieve your goal of selecting all the properties of the original `item` rather than the `item` object itself in a LINQ query, you can use an anonymous object to create a new object that contains all the properties of `item` along with any additional properties you want to add (e.g., `Foo`).
Instead of adding `ite... | 8,141 | [
{
"from": "human",
"value": "I've got a generic<> function that takes a linq query ('items') and enumerates through it adding additional properties. How can I select all the properties of the original 'item' rather than the item itself (as the code below does)?\nSo equivalent to the sql: select *, 'bar' as ... |
Is there a tool that will find for me all the css classes that I am referencing in my HTML that don't actually exist?
ie. if I have <ul class="topnav" /> in my HTML and the topnav class doesn't exist in any of the referenced CSS files.
This is similar to SO#33242, which asks how to find unused CSS styles. This isn't a ... | Yes, there are several tools and methods you can use to identify CSS classes referenced in your HTML that do not exist in any of your CSS files. Here are a few options:
1. **Browser Developer Tools**:
- Most modern browsers have built-in developer tools that can help you identify missing CSS classes. In Chrome, fo... | 5,584 | [
{
"from": "human",
"value": "Is there a tool that will find for me all the css classes that I am referencing in my HTML that don't actually exist?\nie. if I have <ul class=\"topnav\" /> in my HTML and the topnav class doesn't exist in any of the referenced CSS files.\nThis is similar to SO#33242, which asks... |
I have a BSTR object that I would like to convert to copy to a wchar__t object. The tricky thing is the length of the BSTR object could be anywhere from a few kilobytes to a few hundred kilobytes. Is there an efficient way of copying the data across? I know I could just declare a wchar_t array and alway allocate the ma... | To efficiently convert a BSTR (Binary String) to a `wchar_t` object without allocating an excessive amount of memory, you can first determine the length of the BSTR and then allocate just the necessary amount of memory. Here’s how you can do that:
1. **Use `SysStringLen` to get the length of the BSTR**: This function ... | 5,802 | [
{
"from": "human",
"value": "I have a BSTR object that I would like to convert to copy to a wchar__t object. The tricky thing is the length of the BSTR object could be anywhere from a few kilobytes to a few hundred kilobytes. Is there an efficient way of copying the data across? I know I could just declare ... |
I have a list of objects I wish to sort based on a field attr of type string. I tried using -
list.sort(function (a, b) {
return a.attr - b.attr
})
but found that - doesn't appear to work with strings in JavaScript. How can I sort a list of objects based on an attribute with type string?
| In JavaScript, when you want to sort an array of objects based on a string attribute, you should use the `localeCompare` method or the standard string comparison. The `localeCompare` method compares two strings in the current locale and can help with sorting strings correctly.
Here’s an example of how you can sort a l... | 8,925 | [
{
"from": "human",
"value": "I have a list of objects I wish to sort based on a field attr of type string. I tried using -\nlist.sort(function (a, b) {\n return a.attr - b.attr\n})\n\nbut found that - doesn't appear to work with strings in JavaScript. How can I sort a list of objects based on an attribut... |
We are looking for a way to automate windows forms for acceptance testing. Our requirements are:
Must be usable by non-developers (ie: people with no development environment installed)
Must have a recorder
Must support third-party controls
Must have basic functionality (allow clicking on buttons, inputing text, valida... | For automating Windows Forms applications with a focus on usability for non-developers, along with the features you've specified, here are a few options you can consider:
### 1. **TestComplete**
- **Description:** TestComplete is a powerful GUI testing tool that supports Windows Forms, web, and mobile applications. It... | 5,861 | [
{
"from": "human",
"value": "We are looking for a way to automate windows forms for acceptance testing. Our requirements are:\n\nMust be usable by non-developers (ie: people with no development environment installed)\nMust have a recorder\nMust support third-party controls\nMust have basic functionality (al... |
When I build my ASP.NET web application I get a .dll file with the code for the website in it (which is great) but the website also needs all the .aspx files and friends, and these need to be placed in the correct directory structure. How can I get this all in one directory as the result of each build? Trying to pick t... | To achieve the desired outcome of having all necessary files, including the `.aspx` files and other resources, in a single output directory after each build in your ASP.NET web application, you can customize your project file (`.csproj`) to include additional items in the output during the build process. This way, you ... | 7,945 | [
{
"from": "human",
"value": "When I build my ASP.NET web application I get a .dll file with the code for the website in it (which is great) but the website also needs all the .aspx files and friends, and these need to be placed in the correct directory structure. How can I get this all in one directory as t... |
If you have a statically allocated array, the Visual Studio debugger can easily display all of the array elements. However, if you have an array allocated dynamically and pointed to by a pointer, it will only display the first element of the array when you click the + to expand it. Is there an easy way to tell the de... | Yes, you can tell the Visual Studio debugger to display a dynamically allocated array as an array of a specific type and size using a feature called "Watch" or by modifying the "Visualizers" settings.
Here’s how to do it:
### Using the Watch Window
1. **Add to Watch:** While debugging, open the Watch window (you can... | 6,142 | [
{
"from": "human",
"value": "If you have a statically allocated array, the Visual Studio debugger can easily display all of the array elements. However, if you have an array allocated dynamically and pointed to by a pointer, it will only display the first element of the array when you click the + to expand... |
I'm using an older version of ASP.NET AJAX due to runtime limitations, Placing a ASP.NET Validator inside of an update panel does not work. Is there a trick to make these work, or do I need to use the ValidatorCallOut control that comes with the AJAX toolkit?
| When using an older version of ASP.NET AJAX and placing validators inside an UpdatePanel, you may encounter issues with client-side validation not functioning as expected. This is a common issue due to how ASP.NET AJAX updates the page content without a full postback, which can interfere with the validation process.
H... | 5,310 | [
{
"from": "human",
"value": "I'm using an older version of ASP.NET AJAX due to runtime limitations, Placing a ASP.NET Validator inside of an update panel does not work. Is there a trick to make these work, or do I need to use the ValidatorCallOut control that comes with the AJAX toolkit?\n"
},
{
"fr... |
Say a development team includes (or makes use of) graphic artists who create all the images that go into a product. Such things include icons, bitmaps, window backgrounds, button images, animations, etc.
Obviously, everything needed to build a piece of software should be under some form of version control. But most v... | When it comes to version control for a development team that includes graphic artists, the decision on whether to use the same version control system (VCS) as the developers or to use a different one depends on several factors, including the tools in use, team preferences, and the complexity of assets.
### Using the S... | 5,066 | [
{
"from": "human",
"value": "Say a development team includes (or makes use of) graphic artists who create all the images that go into a product. Such things include icons, bitmaps, window backgrounds, button images, animations, etc.\nObviously, everything needed to build a piece of software should be under... |
I'm working on a messaging/notification system for our products. Basic requirements are:
Fire and forget
Persistent set of messages, possibly updating, to stay there until the sender says to remove them
The libraries will be written in C#. Spring.NET just released a milestone build with lots of nice messaging abstr... | When choosing a message broker for your messaging/notification system, especially given the architecture you've outlined, there are a few key considerations to take into account, such as compatibility with .NET, features, ease of deployment, and long-term maintainability.
### ActiveMQ
**Pros:**
- **Rich Features:** Ac... | 5,386 | [
{
"from": "human",
"value": "I'm working on a messaging/notification system for our products. Basic requirements are:\n\nFire and forget\nPersistent set of messages, possibly updating, to stay there until the sender says to remove them\n\nThe libraries will be written in C#. Spring.NET just released a mil... |
In my application I have a DataGridView control that displays data for the selected object. When I select a different object (in a combobox above), I need to update the grid. Unfortunately different objects have completely different data, even different columns, so I need to clear all the existing data and columns, cre... | Yes, you can minimize flickering in a `DataGridView` while updating its data by using the `SuspendLayout` and `ResumeLayout` methods. While these methods are often used with layout operations, they can also help with UI updates by suppressing redrawing of the control until you have finished making changes.
In addition... | 5,209 | [
{
"from": "human",
"value": "In my application I have a DataGridView control that displays data for the selected object. When I select a different object (in a combobox above), I need to update the grid. Unfortunately different objects have completely different data, even different columns, so I need to cle... |
What is the most straightforward way to create a hash table (or associative array...) in Java? My google-fu has turned up a couple examples, but is there a standard way to do this?
And is there a way to populate the table with a list of key->value pairs without individually calling an add method on the object for each... | In Java, the most straightforward way to create a hash table (or an associative array) is to use the `HashMap` class, which is part of the `java.util` package. A `HashMap` allows you to store key-value pairs, where each key is unique, and each key maps to a corresponding value.
Here's how you can create and populate a... | 5,121 | [
{
"from": "human",
"value": "What is the most straightforward way to create a hash table (or associative array...) in Java? My google-fu has turned up a couple examples, but is there a standard way to do this?\nAnd is there a way to populate the table with a list of key->value pairs without individually ca... |
I've set an external tool (sablecc) in eclipse (3.4) that generates a bunch of classes in the current project. I need to run this tool and regenerate these classes fairly frequently. This means that every time I want to run sablecc, I have to manually delete the packages/classes that sablecc creates in order to ensure ... | Yes, you can automate the process of deleting the generated classes before running the SableCC tool in Eclipse. There are a couple of approaches you can take to achieve this:
### Approach 1: Use Ant Build Scripts
1. **Create an Ant Build Script**: You can create an Ant build script that will delete the old generated ... | 6,882 | [
{
"from": "human",
"value": "I've set an external tool (sablecc) in eclipse (3.4) that generates a bunch of classes in the current project. I need to run this tool and regenerate these classes fairly frequently. This means that every time I want to run sablecc, I have to manually delete the packages/classes... |
I have a web system which has a classical parent-children menu saved in a database, with fields id as the PK, and parent_id to pointing to the owning menu. (Yes, I know this doesn't scale very well, but that's another topic).
So for these records (id-parent_id pairs):
0-7 0-4 4-9 4-14 4-16 9-6
I have this tree:
0
├ 7... | Yes, this problem can be classified as a tree problem, as the parent-child relationships in your menu structure form a hierarchical tree. Each node (menu item) can have multiple children but only one parent, which fits the definition of a tree. However, since you want to find all descendants of a certain node, you can ... | 5,334 | [
{
"from": "human",
"value": "I have a web system which has a classical parent-children menu saved in a database, with fields id as the PK, and parent_id to pointing to the owning menu. (Yes, I know this doesn't scale very well, but that's another topic). \nSo for these records (id-parent_id pairs):\n0-7 0-4... |
I have a class with many embedded assets.
Within the class, I would like to get the class definition of an asset by name. I have tried using getDefinitionByName(), and also ApplicationDomain.currentDomain.getDefinition() but neither work.
Example:
public class MyClass
{
[Embed(source="images/image1.png")] private s... | In ActionScript, when you embed assets using the `[Embed]` metadata tag, the class names you've assigned (like `Image1Class`, `Image2Class`, etc.) are not dynamically accessible by their string names. The compiler does not create string mappings for the embedded classes, so when you try to use `getDefinitionByName(name... | 5,840 | [
{
"from": "human",
"value": "I have a class with many embedded assets. \nWithin the class, I would like to get the class definition of an asset by name. I have tried using getDefinitionByName(), and also ApplicationDomain.currentDomain.getDefinition() but neither work.\nExample:\npublic class MyClass\n{\n ... |
Your backend could be PHP or Python but you want to use the controls from the ASP.NET toolkit is there a successful way to do this?
| Using controls from the ASP.NET toolkit in a PHP or Python backend is not straightforward, as ASP.NET is a web framework built on the .NET platform, which primarily uses C#. However, you can achieve similar functionality through a few different approaches:
### 1. **Use ASP.NET as a Microservice:**
- You can build a... | 7,226 | [
{
"from": "human",
"value": "Your backend could be PHP or Python but you want to use the controls from the ASP.NET toolkit is there a successful way to do this?\n"
},
{
"from": "gpt",
"value": "Using controls from the ASP.NET toolkit in a PHP or Python backend is not straightforward, as ASP.NET ... |
I have the following HTML (note the CSS making the background black and text white)
<html>
<select id="opts" style="background-color: black; color: white;">
<option>first</option>
<option>second</option>
</select>
</html>
Safari is smart enough to make the small triangle that appears to the right of the t... | Firefox does not currently provide a direct way to style the dropdown arrow of a `<select>` element using CSS. However, you can achieve a similar effect by using some workarounds. One common method is to hide the native `<select>` element and create a custom dropdown using HTML and CSS.
Here's a simple implementation ... | 4,665 | [
{
"from": "human",
"value": "I have the following HTML (note the CSS making the background black and text white)\n<html>\n <select id=\"opts\" style=\"background-color: black; color: white;\">\n <option>first</option>\n <option>second</option>\n </select> \n</html>\n\nSafari is smart enough to make ... |
In C++ we acquiring a resource in a constructor and release it in a destructor.
So when an exception rises in a middle of a function there will be no resource leak or locked mutexes or whatever.
AFAIK java classes don't have destructors. So how does one do the resource management in Java.
For example:
public int foo() ... | In Java, resource management is typically handled using the **try-with-resources** statement, which was introduced in Java 7. This feature automatically closes resources when they are no longer needed, which helps prevent resource leaks even in the case of exceptions. To use this feature, the resource you want to manag... | 5,904 | [
{
"from": "human",
"value": "In C++ we acquiring a resource in a constructor and release it in a destructor.\nSo when an exception rises in a middle of a function there will be no resource leak or locked mutexes or whatever.\nAFAIK java classes don't have destructors. So how does one do the resource managem... |
Does anybody know a Europe-based provider for OpenID?
I am not using one of the well-known bigger services (Yahoo,..).
| Yes, there are several Europe-based providers for OpenID that you can consider:
1. **Gandi.net** - A French domain registrar that offers OpenID services.
2. **openid.eu** - A project dedicated to providing OpenID services specifically for users in Europe.
3. **Netlog** - Based in Belgium, they offer social networking ... | 8,611 | [
{
"from": "human",
"value": "Does anybody know a Europe-based provider for OpenID?\nI am not using one of the well-known bigger services (Yahoo,..). \n"
},
{
"from": "gpt",
"value": "Yes, there are several Europe-based providers for OpenID that you can consider:\n\n1. **Gandi.net** - A French do... |
We recently lost a database and I want to recover the data from de Production.log.
Every request is logged like this:
Processing ChamadosController#create (for XXX.XXX.XXX.40 at 2008-07-30 11:07:30) [POST]
Session ID: 74c865cefa0fdd96b4e4422497b828f9
Parameters: {"commit"=>"Gravar", "action"=>"create", "funcionario... | Yes, you can recover the session data using the Session ID you have and the corresponding session file stored on your server. Here’s how you can do that, assuming you're using a standard Rails application where session data is stored as files (like in the `tmp/sessions` directory):
1. **Locate the Session File**:
I... | 6,913 | [
{
"from": "human",
"value": "We recently lost a database and I want to recover the data from de Production.log.\nEvery request is logged like this:\nProcessing ChamadosController#create (for XXX.XXX.XXX.40 at 2008-07-30 11:07:30) [POST]\n Session ID: 74c865cefa0fdd96b4e4422497b828f9\n Parameters: {\"commi... |
Suppose we have two stacks and no other temporary variable.
Is to possible to "construct" a queue data structure using only the two stacks?
| Yes, it is possible to construct a queue data structure using two stacks. The general idea is to use one stack for enqueueing (adding elements) and the other stack for dequeueing (removing elements). Here’s how it can be done:
### Queue Operations
1. **Enqueue (add an element to the back of the queue)**:
- Simply ... | 6,446 | [
{
"from": "human",
"value": "Suppose we have two stacks and no other temporary variable.\nIs to possible to \"construct\" a queue data structure using only the two stacks?\n"
},
{
"from": "gpt",
"value": "Yes, it is possible to construct a queue data structure using two stacks. The general idea ... |
I know that garbage collection is automated in Java. But I understood that if you call System.gc() in your code that the JVM may or may not decide to perform garbage collection at that point. How does this work precisely? On what basis/parameters exactly does the JVM decide to do (or not do) a GC when it sees System.gc... | You're correct that garbage collection (GC) in Java is mostly handled automatically by the Java Virtual Machine (JVM). When you call `System.gc()`, you're essentially making a suggestion to the JVM to perform garbage collection, but there's no guarantee that it will actually do so. The behavior of the JVM in response t... | 6,729 | [
{
"from": "human",
"value": "I know that garbage collection is automated in Java. But I understood that if you call System.gc() in your code that the JVM may or may not decide to perform garbage collection at that point. How does this work precisely? On what basis/parameters exactly does the JVM decide to d... |
Is there a way to prevent packages in Delphi to implicitly import units that are not listed in the "Contains" list? I'm looking for a compiler directive that makes the build to fail if it tries to do an implicit import.
Problems occur when you install a package into the IDE that implicitly imports unit A and then you t... | In Delphi, packages implicitly import units that are required by other units, which can lead to complications when trying to manage dependencies and avoid conflicts. Unfortunately, there is no built-in compiler directive in Delphi that will outright prevent implicit imports or cause the build to fail if an implicit imp... | 7,048 | [
{
"from": "human",
"value": "Is there a way to prevent packages in Delphi to implicitly import units that are not listed in the \"Contains\" list? I'm looking for a compiler directive that makes the build to fail if it tries to do an implicit import.\nProblems occur when you install a package into the IDE t... |
In a project I'm working on FxCop shows me lots of (and I mean more than 400) errors on the InitializeComponent() methods generated by the Windows Forms designer. Most of those errors are just the assignment of the Text property of labels.
I'd like to suppress those methods in source, so I copied the suppression code g... | To suppress specific FxCop warnings in your code, you can use the `SuppressMessage` attribute correctly in your `AssemblyInfo.cs` file. However, there are some important aspects to consider, especially regarding the target you are trying to suppress.
The attribute you provided looks correct at first glance, but the sy... | 5,573 | [
{
"from": "human",
"value": "In a project I'm working on FxCop shows me lots of (and I mean more than 400) errors on the InitializeComponent() methods generated by the Windows Forms designer. Most of those errors are just the assignment of the Text property of labels.\nI'd like to suppress those methods in ... |
I have this RewriteRule that works too well :-)
RewriteRule ^([^/]*)/$ /script.html?id=$1 [L]
The bad thing about this rule is that it also matches physical directories which I don't want.
How can I tell the mod_rewrite to ignore physical directories and apply the above rule only when the directory matched does not ex... | To ensure that your `RewriteRule` does not apply to physical directories, you can use a condition (`RewriteCond`) to check if the requested path does not point to an existing directory. You can achieve this by adding a condition before your rule.
Here's how you can modify your existing `RewriteRule` to achieve that:
... | 10,686 | [
{
"from": "human",
"value": "I have this RewriteRule that works too well :-)\nRewriteRule ^([^/]*)/$ /script.html?id=$1 [L]\n\nThe bad thing about this rule is that it also matches physical directories which I don't want.\nHow can I tell the mod_rewrite to ignore physical directories and apply the above rul... |
I'm a Java-developer toying with Ruby, and loving it. I have understood that because of Ruby's metaprogramming facilities my unit-tests become much cleaner and I don't need nasty mocking frameworks. I have a class which needs the File class's services and in my test I don't want to touch my real filesystem. In Java I w... | You're on the right track with your approach to dependency injection in Ruby, and it's indeed a common practice to pass in dependencies like `File` to facilitate testing. Ruby's metaprogramming capabilities can help streamline this even further. Here are a few suggestions to make your code cleaner and more idiomatic in... | 6,272 | [
{
"from": "human",
"value": "I'm a Java-developer toying with Ruby, and loving it. I have understood that because of Ruby's metaprogramming facilities my unit-tests become much cleaner and I don't need nasty mocking frameworks. I have a class which needs the File class's services and in my test I don't want... |
Do you know any open source/free software C++ libraries to manipulate images in these formats:
.jpg .gif .png .bmp ? The more formats it supports, the better. I am implementing a free program in C++ which hides a text file into one or more images, using steganography.
I am working under Unix.
| Certainly! There are several open source C++ libraries that can help you manipulate images in various formats, including JPG, GIF, PNG, and BMP. Here are some of the most popular ones:
1. **OpenCV**:
- Website: [OpenCV](https://opencv.org/)
- OpenCV is a powerful computer vision library that supports a wide rang... | 7,319 | [
{
"from": "human",
"value": "Do you know any open source/free software C++ libraries to manipulate images in these formats:\n.jpg .gif .png .bmp ? The more formats it supports, the better. I am implementing a free program in C++ which hides a text file into one or more images, using steganography.\nI am wor... |
Can anyone recommend an efficient method to execute XSLT transforms of XML data within a Ruby application? The XSL gem (REXSL) is not available yet, and while I have seen a project or two that implement it, I'm wary of using them so early on. A friend had recommended a shell out call to Perl, but I'm worried about reso... | If you're looking for an efficient way to perform XSLT transformations in a Ruby application and the XSL gem (REXSL) isn't available or stable for your needs, there are a few alternatives you can consider:
### 1. **Nokogiri**
Nokogiri is a popular XML and HTML parsing library for Ruby that supports XSLT transformation... | 6,759 | [
{
"from": "human",
"value": "Can anyone recommend an efficient method to execute XSLT transforms of XML data within a Ruby application? The XSL gem (REXSL) is not available yet, and while I have seen a project or two that implement it, I'm wary of using them so early on. A friend had recommended a shell out... |
I have wondered for some time, what a nice, clean solution for joining an array of strings might look like.
Example: I have ["Alpha", "Beta", "Gamma"] and want to join the strings into one, separated by commas – "Alpha, Beta, Gamma".
Now I know that most programming languages offer some kind of join method for this. I ... | Your question about joining an array of strings without adding unnecessary separators is a common one in programming, and there are indeed several elegant approaches to solve this problem. Let's consider some strategies, explaining why they work well and demonstrating their elegance.
### Approach 1: Using Built-in Met... | 5,437 | [
{
"from": "human",
"value": "I have wondered for some time, what a nice, clean solution for joining an array of strings might look like.\nExample: I have [\"Alpha\", \"Beta\", \"Gamma\"] and want to join the strings into one, separated by commas – \"Alpha, Beta, Gamma\".\nNow I know that most programming la... |
Has someone experiment RDF storage solution like Sesame? I'm looking for performance review of this kind of solution compared to the traditional database solution.
| Yes, there have been various experiments and performance reviews comparing RDF storage solutions like Sesame (now known as RDF4J) to traditional relational database systems. Here are some key points based on the general findings from these comparisons:
### Performance Characteristics
1. **Data Structure and Query Lan... | 7,362 | [
{
"from": "human",
"value": "Has someone experiment RDF storage solution like Sesame? I'm looking for performance review of this kind of solution compared to the traditional database solution.\n"
},
{
"from": "gpt",
"value": "Yes, there have been various experiments and performance reviews compa... |
I am wondering if there is a method or format string I'm missing in .NET to convert the following:
1 to 1st
2 to 2nd
3 to 3rd
4 to 4th
11 to 11th
101 to 101st
111 to 111th
This link has a bad example of the basic principle involved in writing your own function, but I am more curious if there is an inbu... | In .NET, there isn't a built-in method or format string that directly converts numbers to their ordinal representations (like converting `1` to `1st`, `2` to `2nd`, etc.). However, you can easily create a custom method to achieve this.
Here's a simple implementation in C#:
```csharp
using System;
public class Progra... | 6,597 | [
{
"from": "human",
"value": "I am wondering if there is a method or format string I'm missing in .NET to convert the following:\n 1 to 1st\n 2 to 2nd\n 3 to 3rd\n 4 to 4th\n 11 to 11th\n 101 to 101st\n 111 to 111th\n\nThis link has a bad example of the basic principle involved in writing your own f... |
Opening an Infopath form with parameter can be done like this:
System.Diagnostics.Process.Start(PathToInfopath + "infopath.exe", "Template.xsn /InputParameters Id=123");
But that requires I know the path to Infopath.exe which changes with each version of Office. Is there a way to simply launch the template and pass a... | Yes, there are ways to dynamically find the path to `Infopath.exe` without hardcoding it, which will allow you to launch an InfoPath form with parameters.
### Finding InfoPath.exe Path
You can locate `Infopath.exe` by querying the Windows Registry, as the installation path of Microsoft Office applications is usually ... | 7,047 | [
{
"from": "human",
"value": "Opening an Infopath form with parameter can be done like this:\nSystem.Diagnostics.Process.Start(PathToInfopath + \"infopath.exe\", \"Template.xsn /InputParameters Id=123\");\n\nBut that requires I know the path to Infopath.exe which changes with each version of Office. Is ther... |
I tried:
$form->addElement(
'select',
'salutation',
array(
'required' => true,
'options' => array(
'Mr.' => 'Mr.',
'Mrs.' => 'Mrs.',
'Ms.' => 'Ms.',
),
)
);
Then I print_r()ed the form, and options for salutation are empty. Does anybody know ... | It looks like you are using Zend Framework to create a form, but there is a small mistake in your code regarding how to set options for the select element. In Zend Framework, the options should be passed as the second parameter of the `addElement` method, not as part of the element's configuration array.
Here's the co... | 10,342 | [
{
"from": "human",
"value": "I tried:\n$form->addElement(\n 'select',\n 'salutation',\n array(\n 'required' => true,\n 'options' => array(\n 'Mr.' => 'Mr.',\n 'Mrs.' => 'Mrs.',\n 'Ms.' => 'Ms.',\n ), \n )\n);\n\nThen I print_r()ed the form, a... |
What is the main difference between an inner class and a static nested class in Java? Does design / implementation play a role in choosing one of these?
| In Java, both inner classes and static nested classes serve as a way to group classes logically and manage visibility, but they have key differences in terms of how they are implemented and used. Here are the main differences:
### Inner Class
1. **Instance Context**: An inner class is associated with an instance of th... | 8,208 | [
{
"from": "human",
"value": "What is the main difference between an inner class and a static nested class in Java? Does design / implementation play a role in choosing one of these?\n"
},
{
"from": "gpt",
"value": "In Java, both inner classes and static nested classes serve as a way to group cla... |
I'm a PHP developer, but honestly my knowledge of server management is somewhat lacking.
I fired off a script today that took a regrettably long time to run, and because it had an embedded call to ignore_user_abort(), pressing "stop" in the browser was obviously futile.
There was a time limit of 15 minutes enforced i... | Yes, you can manage and kill PHP scripts that are running under FastCGI, but the exact method depends on your server environment. Here are a few approaches for both Apache and Nginx setups:
### 1. **Identifying PHP Processes**
First, you'll want to identify the PHP processes that are running on your server. You can do... | 7,496 | [
{
"from": "human",
"value": "I'm a PHP developer, but honestly my knowledge of server management is somewhat lacking. \nI fired off a script today that took a regrettably long time to run, and because it had an embedded call to ignore_user_abort(), pressing \"stop\" in the browser was obviously futile. \nTh... |
There have been some questions about whether or not JavaScript is an object-oriented language. Even a statement, "just because a language has objects doesn't make it OO."
Is JavaScript an object-oriented language?
| JavaScript is often categorized as an object-oriented language, but its approach to object-oriented programming (OOP) differs from traditional class-based languages like Java or C++. Here's a breakdown of why JavaScript is considered object-oriented, along with some nuances:
### Key Points:
1. **Objects in JavaScript... | 7,554 | [
{
"from": "human",
"value": "There have been some questions about whether or not JavaScript is an object-oriented language. Even a statement, \"just because a language has objects doesn't make it OO.\"\nIs JavaScript an object-oriented language?\n"
},
{
"from": "gpt",
"value": "JavaScript is oft... |
I have a WinForms application with a DataGridView control and a column of DataGridViewButtonCell cells within that. When I click on one of these buttons, it starts a background task, and I'd like to disable the buttons until that task completes.
I can disable the DataGridView control, but it gives no visual indication ... | To achieve the desired functionality in a WinForms application with a `DataGridView` containing `DataGridViewButtonCell` buttons, you can follow these steps:
1. **Disable Individual Buttons**: Instead of disabling the entire `DataGridView`, you can override the `OnCellContentClick` event of the `DataGridView` to handl... | 3,890 | [
{
"from": "human",
"value": "I have a WinForms application with a DataGridView control and a column of DataGridViewButtonCell cells within that. When I click on one of these buttons, it starts a background task, and I'd like to disable the buttons until that task completes.\nI can disable the DataGridView c... |
Kind of a special case problem:
I start a process with System.Diagnostics.Process.Start(..)
The process opens a splash screen -- this splash screen becomes the main window.
The splash screen closes and the 'real' UI is shown. The main window (splash screen) is now invalid.
I still have the Process object, and I can q... | When working with a process that initially opens a splash screen and then switches to the main application window, it can be tricky to track the correct window handle, especially since the handle for the splash screen becomes invalid once it is closed. Unfortunately, the `System.Diagnostics.Process` class does not prov... | 5,414 | [
{
"from": "human",
"value": "Kind of a special case problem:\n\nI start a process with System.Diagnostics.Process.Start(..)\nThe process opens a splash screen -- this splash screen becomes the main window.\nThe splash screen closes and the 'real' UI is shown. The main window (splash screen) is now invalid.... |
I have a multiple selection SELECT field which I don't want the end user to be able to change the value of.
For UI reasons, I would like to be able to do this without using the disabled="true" attribute. I've tried using onmousedown, onfocus, onclick and setting each to blur or return false but with no success.
Can th... | You can achieve the desired functionality of preventing users from changing the value of a multiple selection `<select>` field without using the `disabled` attribute. However, the typical methods like `onmousedown`, `onfocus`, and `onclick` might not prevent the behavior effectively across all browsers.
Instead, you c... | 8,397 | [
{
"from": "human",
"value": "I have a multiple selection SELECT field which I don't want the end user to be able to change the value of. \nFor UI reasons, I would like to be able to do this without using the disabled=\"true\" attribute. I've tried using onmousedown, onfocus, onclick and setting each to blur... |
<servlet>
<servlet-name>myservlet</servlet-name>
<servlet-class>workflow.WDispatcher</servlet-class>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>myservlet</servlet-name>
<url-pattern>*NEXTEVENT*</url-pattern>
</servlet-mapping>
Above is the snippet from Tomcat's... | The error you are encountering is due to the invalid use of the `*` wildcard in the `url-pattern` element of your servlet mapping. According to the Servlet Specification, the `url-pattern` must conform to certain rules, and the use of the `*` wildcard can be limited.
### Explanation of the Valid URL Patterns
1. **Exa... | 5,803 | [
{
"from": "human",
"value": "<servlet>\n <servlet-name>myservlet</servlet-name>\n <servlet-class>workflow.WDispatcher</servlet-class>\n <load-on-startup>2</load-on-startup>\n</servlet>\n\n<servlet-mapping>\n <servlet-name>myservlet</servlet-name>\n <url-pattern>*NEXTEVENT*</url-pattern>\n</se... |
I have a multi-frame layout. One of the frames contains a form, which I am submitting through XMLHttpRequest. Now when I use document.write() to rewrite the frame with the form, and the new page I am adding contains any javascript then the javascript is not exectuted in IE6?
For example:
document.write("<html><head><sc... | Using `document.write()` in a frame (or any part of a document) after the document has been loaded can lead to unexpected behavior, especially in older browsers like Internet Explorer 6. In your case, the issue arises because `document.write()` is being called after the document is fully loaded, which causes the curren... | 7,408 | [
{
"from": "human",
"value": "I have a multi-frame layout. One of the frames contains a form, which I am submitting through XMLHttpRequest. Now when I use document.write() to rewrite the frame with the form, and the new page I am adding contains any javascript then the javascript is not exectuted in IE6?\nFo... |
How do I set a property of a user control in ListView's LayoutTemplate from the code-behind?
<asp:ListView ...>
<LayoutTemplate>
<myprefix:MyControl id="myControl" ... />
</LayoutTemplate>
...
</asp:ListView>
I want to do this:
myControl.SomeProperty = somevalue;
Please notice that my control is not in ItemTemplate, ... | To set a property of a user control in the `LayoutTemplate` of an `asp:ListView` from the code-behind, you need to do it after the ListView has been data-bound, typically in the `ListView_DataBound` event. Here's how you can do it:
### Step 1: Define the ListView in the .aspx file
Ensure you have your ListView define... | 6,888 | [
{
"from": "human",
"value": "How do I set a property of a user control in ListView's LayoutTemplate from the code-behind?\n<asp:ListView ...>\n<LayoutTemplate>\n<myprefix:MyControl id=\"myControl\" ... />\n</LayoutTemplate>\n...\n</asp:ListView>\n\nI want to do this:\nmyControl.SomeProperty = somevalue;\n\n... |
I have built a simple C#.Net app on a M/C with only .Net FX 1.1 present. Now when I execute this app on a M/C where there is :
Case 1) Only .Net fx 2.0 is installed
Case 2) Both .Net Fx 1.1 amd 2.0 are installed
How is it determined to load the appropriate .Net framework in the above cases.
| In .NET, the runtime environment decides which version of the framework to use when executing an application based on the configuration settings and the installed versions of the .NET Framework on the machine. Here's how it works for the two cases you provided:
### Case 1: Only .NET Framework 2.0 is installed
In this... | 6,428 | [
{
"from": "human",
"value": "I have built a simple C#.Net app on a M/C with only .Net FX 1.1 present. Now when I execute this app on a M/C where there is :\n Case 1) Only .Net fx 2.0 is installed\n Case 2) Both .Net Fx 1.1 amd 2.0 are installed\nHow is it determined to load the appropriate .Net framewor... |
Silverlight v2.0 is getting closer and closer to RTM but I have yet to hear any stats as to how many browsers are running Silverlight. If I ask Adobe (by googling "Flash install base") they're only too happy to tell me that 97.7% of browsers are running Flash player 9 or better.
Not that I believe everything I read, bu... | As of my last update, Microsoft had not consistently published detailed statistics about the install base of Silverlight. Unlike Adobe Flash, which provided extensive data regarding its penetration and usage, Silverlight's adoption metrics were not as readily available from Microsoft.
However, there are a few ways to ... | 8,868 | [
{
"from": "human",
"value": "Silverlight v2.0 is getting closer and closer to RTM but I have yet to hear any stats as to how many browsers are running Silverlight. If I ask Adobe (by googling \"Flash install base\") they're only too happy to tell me that 97.7% of browsers are running Flash player 9 or bette... |
Can anybody recommend a reliable and decently documented code highlighter for WordPress 2.6.1? I have tried Code Snippet by Roman Roan and Developer Formatter by Gilberto Saraiva. But they don't seem to work as described in the documentation and are mangling the code snippets instead of prettifying them.
| For WordPress 2.6.1, which is quite an old version, finding compatible and reliable code highlighters can be a challenge, as many modern plugins may not support such an outdated platform. However, here are a few suggestions you can consider:
1. **Crayon Syntax Highlighter**:
- Crayon Syntax Highlighter is a popular... | 7,083 | [
{
"from": "human",
"value": "Can anybody recommend a reliable and decently documented code highlighter for WordPress 2.6.1? I have tried Code Snippet by Roman Roan and Developer Formatter by Gilberto Saraiva. But they don't seem to work as described in the documentation and are mangling the code snippets in... |
What is your way of passing data to Master Page (using ASP.NET MVC) without breaking MVC rules?
Personally, I prefer to code abstract controller (base controller) or base class which is passed to all views.
| Passing data to a Master Page (or Layout Page) in ASP.NET MVC without breaking MVC principles can be achieved in several ways. Your approach of using a base controller is valid and provides a centralized way to pass data. However, there are various techniques you can use, and the best choice often depends on the specif... | 4,507 | [
{
"from": "human",
"value": "What is your way of passing data to Master Page (using ASP.NET MVC) without breaking MVC rules?\nPersonally, I prefer to code abstract controller (base controller) or base class which is passed to all views.\n"
},
{
"from": "gpt",
"value": "Passing data to a Master P... |
I flatter myself that I'm a good programmer, and can get away with graphic design. But something I'm incapable of doing is coming up with good names - and it seems neither are the people I work with. We're now in the slightly ludicrous situation that the product we've been working on for a couple of years is being inst... | Choosing a name, logo, and branding can be a daunting task, especially when you want them to resonate with your audience and reflect your product's purpose. Here are some steps and tips that might help you come up with a compelling name and branding for your product:
### 1. **Identify Core Values and Mission**
- Re... | 5,297 | [
{
"from": "human",
"value": "I flatter myself that I'm a good programmer, and can get away with graphic design. But something I'm incapable of doing is coming up with good names - and it seems neither are the people I work with. We're now in the slightly ludicrous situation that the product we've been worki... |
I have created a few small flash widgets that stream .mp3 audio from an Apache/php host. The mp3 file cannot be directly accessed and does not save it self to the browsers cache.
To do this I set the mp3 file permission on the host to "owner: read/write" (numeric value 600). This makes it so that only my .php file can ... | To replicate the behavior you're describing using IIS and ASP.NET, you can follow these steps:
### Step 1: Set File Permissions
You need to set permissions on the MP3 file so that it can only be accessed by your ASP.NET application. To do this, set the file's permission to allow only the application pool identity (use... | 7,136 | [
{
"from": "human",
"value": "I have created a few small flash widgets that stream .mp3 audio from an Apache/php host. The mp3 file cannot be directly accessed and does not save it self to the browsers cache.\nTo do this I set the mp3 file permission on the host to \"owner: read/write\" (numeric value 600). ... |
As I browse through the site, I find a lot of terms that many developers just starting out (and even some advanced developers) may be unfamiliar with.
It would be great if people could post here with a term and definition that might be unknown to beginners or those from different programming backgrounds.
Some not-so-c... | Absolutely! Here are some definitions of terms that may be unfamiliar to developers, along with code snippets where applicable:
### 1. **Auto Boxing**
**Definition:** Auto boxing is the automatic conversion of a primitive data type into its corresponding wrapper class in Java. This happens when an object is needed but... | 4,699 | [
{
"from": "human",
"value": "As I browse through the site, I find a lot of terms that many developers just starting out (and even some advanced developers) may be unfamiliar with.\nIt would be great if people could post here with a term and definition that might be unknown to beginners or those from differe... |
A long time ago I had an apple ][ .
I remember the command call – 151
But I can not remember what it did ?
| The command `CALL -151` on the Apple II series computers was used to access the built-in monitor or "machine language monitor." This monitor provided a way for users to interact with the computer at a low level, allowing them to enter machine code instructions, examine memory, and perform other debugging tasks.
When y... | 11,555 | [
{
"from": "human",
"value": "A long time ago I had an apple ][ . \nI remember the command call – 151 \nBut I can not remember what it did ? \n"
},
{
"from": "gpt",
"value": "The command `CALL -151` on the Apple II series computers was used to access the built-in monitor or \"machine language mon... |
I am trying to install the ibm_db gem so that I can access DB2 from Ruby. When I try:
sudo gem install ibm_db
I get the following request for clarification:
Select which gem to install for your platform (i486-linux)
1. ibm_db 0.10.0 (ruby)
2. ibm_db 0.10.0 (mswin32)
3. ibm_db 0.9.5 (mswin32)
4. ibm_db 0.9.5 (rub... | When you run `gem install ibm_db` and it prompts you to select a platform, it indicates that there are multiple platform-specific gems available. To automate the installation without prompts, you can specify the exact version and platform using the command line.
In your case, you want to install the `ruby` version for... | 8,726 | [
{
"from": "human",
"value": "I am trying to install the ibm_db gem so that I can access DB2 from Ruby. When I try:\nsudo gem install ibm_db\n\nI get the following request for clarification:\n\nSelect which gem to install for your platform (i486-linux)\n 1. ibm_db 0.10.0 (ruby)\n 2. ibm_db 0.10.0 (mswin32)\... |
I have a VB.NET Windows Forms project that at one point paints text directly to onto the form at runtime. Before I paint with the font though, I want to make sure that the font and font-size exists on the user's machine. If they don't, I'll try a few other similar fonts, eventually defaulting with Arial or something.
W... | To determine if a font exists on a user's machine in a VB.NET Windows Forms application, you can use the `InstalledFontCollection` class from the `System.Drawing.Text` namespace. This class allows you to enumerate the fonts installed on the system and check for the specific font you're interested in.
Here’s a step-by-... | 7,005 | [
{
"from": "human",
"value": "I have a VB.NET Windows Forms project that at one point paints text directly to onto the form at runtime. Before I paint with the font though, I want to make sure that the font and font-size exists on the user's machine. If they don't, I'll try a few other similar fonts, eventua... |
Briefly: Does anyone know of a GUI for gdb that brings it on par or close to the feature set you get in the more recent version of Visual C++?
In detail: As someone who has spent a lot of time programming in Windows, one of the larger stumbling blocks I've found whenever I have to code C++ in Linux is that debugging a... | Certainly! There are several GUI front-ends for GDB that aim to enhance the debugging experience, bringing it closer to what Visual Studio offers. Here are some popular options, along with insights into their features and usability:
### 1. **GDB Dashboard**
- **Description**: This is a customizable GDB interface that ... | 5,208 | [
{
"from": "human",
"value": "Briefly: Does anyone know of a GUI for gdb that brings it on par or close to the feature set you get in the more recent version of Visual C++?\nIn detail: As someone who has spent a lot of time programming in Windows, one of the larger stumbling blocks I've found whenever I hav... |
What is the best way to sort the results of a sql query into a random order within a stored procedure?
| To sort the results of an SQL query into a random order within a stored procedure, you can use various approaches depending on the SQL database system you're using. Below are examples for some popular SQL databases:
### SQL Server
You can use the `NEWID()` function to generate a unique value for each row, which can be... | 5,371 | [
{
"from": "human",
"value": "What is the best way to sort the results of a sql query into a random order within a stored procedure?\n"
},
{
"from": "gpt",
"value": "To sort the results of an SQL query into a random order within a stored procedure, you can use various approaches depending on the ... |
So I'm having a really weird issue with my App_Code folder on a new website I'm designing.
I have a basic class inside of a namespace in the App_Code folder. Everything works fine in the IDE when I setup the namespace and make an object from the class. It brings up the class summary on hover, and when you click on ... | It sounds like you're facing a common issue related to the way ASP.NET handles namespaces and class compilation in the `App_Code` folder, particularly when moving from a local development environment to a production server.
Here are several steps you can take to troubleshoot and resolve this issue:
1. **Check Namespa... | 5,689 | [
{
"from": "human",
"value": "So I'm having a really weird issue with my App_Code folder on a new website I'm designing. \nI have a basic class inside of a namespace in the App_Code folder. Everything works fine in the IDE when I setup the namespace and make an object from the class. It brings up the clas... |
Is there any alternative image manipulation library for .net? I would prefer something that is managed and open source.
I ask this because of two reasons:
I have encountered hard to debug GDI+ errors with System.Drawing in the past
I have read that using System.Drawing in asp.net web applications is not 100% support... | Yes, there are several alternative image manipulation libraries for .NET that are managed and open-source. Here are a few popular options:
1. **ImageSharp**:
- **GitHub**: [ImageSharp](https://github.com/SixLabors/ImageSharp)
- **Description**: ImageSharp is a modern, fully managed, cross-platform library for pr... | 6,489 | [
{
"from": "human",
"value": "Is there any alternative image manipulation library for .net? I would prefer something that is managed and open source. \nI ask this because of two reasons:\n\nI have encountered hard to debug GDI+ errors with System.Drawing in the past\nI have read that using System.Drawing in... |
I'm trying to find out the 'correct' windows API for finding out the localized name of 'special' folders, specifically the Recycle Bin. I want to be able to prompt the user with a suitably localized dialog box asking them if they want to send files to the recycle bin or delete them directly.
I've found lots on the inte... | To retrieve the localized name of special folders in Windows, including the Recycle Bin, you can use the `SHGetFolderPathEx` or `SHGetKnownFolderPath` APIs alongside `SHGetLocalizedName`. However, there is a slight nuance when it comes to getting the localized name of the Recycle Bin since it is not a traditional folde... | 4,827 | [
{
"from": "human",
"value": "I'm trying to find out the 'correct' windows API for finding out the localized name of 'special' folders, specifically the Recycle Bin. I want to be able to prompt the user with a suitably localized dialog box asking them if they want to send files to the recycle bin or delete t... |
Suppose I have a directory /dir inside which there are 3 symlinks to other directories
/dir/dir11, /dir/dir12, and /dir/dir13. I want to list all the files in dir including the ones in dir11, dir12 and dir13.
To be more generic, I want to list all files including the ones in the directories which are symlinks. find .,... | To list all files in a directory and also recursively include files from directories that are symlinks, you can use the `find` command with the `-L` option, which tells `find` to follow symbolic links. Here's how you can do it:
```bash
find -L /dir -type f
```
### Explanation:
- `-L`: This option makes `find` follow ... | 9,910 | [
{
"from": "human",
"value": "Suppose I have a directory /dir inside which there are 3 symlinks to other directories \n/dir/dir11, /dir/dir12, and /dir/dir13. I want to list all the files in dir including the ones in dir11, dir12 and dir13.\nTo be more generic, I want to list all files including the ones in ... |
I'm trying to find out if there is any way to elevate a specific function within an application. For example, I have an app with system and user settings that are stored in the registry, I only need elevation for when the system settings need to be changed.
Unfortunately all of the info I've come across talks about on... | When it comes to elevating privileges for specific functions within an application, rather than the entire application, there are several approaches you can consider. The typical approach in Windows applications is indeed to start a new process with elevated privileges, but there are other strategies to consider as wel... | 4,658 | [
{
"from": "human",
"value": "I'm trying to find out if there is any way to elevate a specific function within an application. For example, I have an app with system and user settings that are stored in the registry, I only need elevation for when the system settings need to be changed. \nUnfortunately all o... |
I know RIM has their own IDE (BlackBerry JDE) for building BlackBerry apps, but does anyone know how to configure IntelliJ IDEA to build/debug BlackBerry apps?
| Configuring IntelliJ IDEA to build and debug BlackBerry apps can be a bit complex, as BlackBerry development primarily used the BlackBerry JDE. However, it is possible to set up IntelliJ IDEA for this purpose by following these general steps:
### Prerequisites:
1. **Install IntelliJ IDEA**: Make sure you have IntelliJ... | 4,167 | [
{
"from": "human",
"value": "I know RIM has their own IDE (BlackBerry JDE) for building BlackBerry apps, but does anyone know how to configure IntelliJ IDEA to build/debug BlackBerry apps?\n"
},
{
"from": "gpt",
"value": "Configuring IntelliJ IDEA to build and debug BlackBerry apps can be a bit ... |
How do I dump the data, and only the data, not the schema, of some SQLite3 tables of a database (not all the tables)?
The dump should be in SQL format, as it should be easily re-entered into the database later and should be done from the command line. Something like
sqlite3 db .dump
but without dumping the schema and ... | To dump only the data from specific tables in an SQLite3 database without including the schema, you can utilize the `.dump` command within an SQLite prompt for each table you wish to export. However, SQLite's command-line tool does not support dumping only the data for specific tables directly with a single command.
I... | 7,257 | [
{
"from": "human",
"value": "How do I dump the data, and only the data, not the schema, of some SQLite3 tables of a database (not all the tables)?\nThe dump should be in SQL format, as it should be easily re-entered into the database later and should be done from the command line. Something like\nsqlite3 db... |
When I drag & drop a dll to the assembly folder on vista, I get the error "Access is denied: mydll.dll". How can I bypass the error message and add my dll to gac?
| In Windows Vista, the Global Assembly Cache (GAC) is protected by User Account Control (UAC), which means you need elevated permissions to add assemblies to it. Here’s how to add a DLL to the GAC without encountering the "Access is denied" error:
### Method 1: Using Command Prompt with Administrative Privileges
1. **... | 5,677 | [
{
"from": "human",
"value": "When I drag & drop a dll to the assembly folder on vista, I get the error \"Access is denied: mydll.dll\". How can I bypass the error message and add my dll to gac?\n"
},
{
"from": "gpt",
"value": "In Windows Vista, the Global Assembly Cache (GAC) is protected by Use... |
How do I save each sheet in an Excel workbook to separate CSV files with a macro?
I have an excel with multiple sheets and I was looking for a macro that will save each sheet to a separate CSV (comma separated file). Excel will not allow you to save all sheets to different CSV files.
| You can create a macro in Excel VBA to save each sheet of an Excel workbook as a separate CSV file. Below is a step-by-step guide on how to do that:
1. **Open Excel** and then press `ALT` + `F11` to open the Visual Basic for Applications (VBA) editor.
2. **Insert a new module** by right-clicking on any of the items i... | 7,039 | [
{
"from": "human",
"value": "How do I save each sheet in an Excel workbook to separate CSV files with a macro?\nI have an excel with multiple sheets and I was looking for a macro that will save each sheet to a separate CSV (comma separated file). Excel will not allow you to save all sheets to different CSV ... |
I'm writing some xlst file which I want to use under linux and Windows.
In this file I use node-set function which declared in different namespaces for MSXML and xsltproc ("urn:schemas-microsoft-com:xslt" and "http://exslt.org/common" respectively). Is there any platform independent way of using node-set?
| To achieve platform-independent XSLT that can handle node-set conversion without relying on the specific implementations of MSXML or `xsltproc`, you can avoid using the `node-set` function altogether. Instead, you can use XPath expressions directly in XSLT to achieve the same results.
Here are some strategies to cons... | 7,720 | [
{
"from": "human",
"value": "I'm writing some xlst file which I want to use under linux and Windows. \nIn this file I use node-set function which declared in different namespaces for MSXML and xsltproc (\"urn:schemas-microsoft-com:xslt\" and \"http://exslt.org/common\" respectively). Is there any platform i... |
I'm currently trying to improve the design of a legacy db and I have the following situation
Currently I have a table SalesLead in which we store the the LeadSource.
Create Table SalesLead(
....
LeadSource varchar(20)
....
)
The Lead Sources are helpfully stored in a table.
Create Table LeadSource (
Le... | To address your concerns about working with foreign keys and ensuring that your application remains robust in the face of changes to the `LeadSource` field, consider the following approaches:
### 1. Use a View
Create a database view that provides a unified interface for querying the `SalesLead` table using the `LeadSo... | 6,982 | [
{
"from": "human",
"value": "I'm currently trying to improve the design of a legacy db and I have the following situation\nCurrently I have a table SalesLead in which we store the the LeadSource.\nCreate Table SalesLead(\n ....\n LeadSource varchar(20)\n ....\n)\n\nThe Lead Sources are helpfully st... |
Can anyone point me to a good tutorial on creating a bootable Linux CD from scratch?
I need help with a fairly specialized problem: my firm sells an expansion card that requires custom firmware. Currently we use an extremely old live CD image of RH7.2 that we update with current firmware. Manufacturing puts the cards i... | It sounds like you found a solution that works for your specific needs by using `livecd-creator`. If you're looking for additional resources or tutorials for creating a bootable Linux CD from scratch, especially for a minimal live environment, here are some general guidelines and resources you might find useful:
### S... | 6,223 | [
{
"from": "human",
"value": "Can anyone point me to a good tutorial on creating a bootable Linux CD from scratch?\nI need help with a fairly specialized problem: my firm sells an expansion card that requires custom firmware. Currently we use an extremely old live CD image of RH7.2 that we update with curren... |
In the vxWorks RTOS, there is a shell that allows you to issue command to your embedded system.
The documentation refers to kernel shell, host shell and target shell. What is the difference between the three?
| In VxWorks RTOS, the terminology for shell types can sometimes cause confusion, but here's a breakdown of the three types mentioned: kernel shell, host shell, and target shell:
1. **Kernel Shell**:
- This is the shell that runs directly on the VxWorks kernel itself on the target hardware.
- It allows developers... | 9,158 | [
{
"from": "human",
"value": "In the vxWorks RTOS, there is a shell that allows you to issue command to your embedded system.\nThe documentation refers to kernel shell, host shell and target shell. What is the difference between the three?\n"
},
{
"from": "gpt",
"value": "In VxWorks RTOS, the ter... |
[We have a Windows Forms database front-end application that, among other things, can be used as a CMS; clients create the structure, fill it, and then use a ASP.NET WebForms-based site to present the results to publicly on the Web. For added flexibility, they are sometimes forced to input actual HTML markup right into... | Creating a WYSIWYG editor that outputs Markdown is not only feasible, but it can also significantly improve the user experience for clients who need to create and manage content without getting bogged down by HTML syntax. Here are some suggestions and considerations for implementing this idea:
### Feasibility and Impl... | 2,754 | [
{
"from": "human",
"value": "[We have a Windows Forms database front-end application that, among other things, can be used as a CMS; clients create the structure, fill it, and then use a ASP.NET WebForms-based site to present the results to publicly on the Web. For added flexibility, they are sometimes forc... |
I know this is a broad question, but I've inherited several poor performers and need to optimize them badly. I was wondering what are the most common steps involved to optimize. So, what steps do some of you guys take when faced with the same situation?
Related Question:
What generic techniques can be applied to optim... | Optimizing poor-performing team members and SQL queries can be a challenging task, but it often involves similar methodologies in terms of analysis, understanding root causes, and implementing strategies for improvement. Here are some common steps you can take for both scenarios:
### Optimizing Poor Performers
1. **A... | 2,726 | [
{
"from": "human",
"value": "I know this is a broad question, but I've inherited several poor performers and need to optimize them badly. I was wondering what are the most common steps involved to optimize. So, what steps do some of you guys take when faced with the same situation?\n\nRelated Question:\nWha... |
For example, if I have a page located in Views/Home/Index.aspx and a JavaScript file located in Views/Home/Index.js, how do you reference this on the aspx page?
The example below doesn't work even though the compiler says the path is correct
<script src="Index.js" type="text/javascript"></script>
The exact same issue ... | In ASP.NET MVC, referencing JavaScript files and other static resources needs to be done in a way that respects the routing and folder structure of your application. The issue you're encountering stems from the way the ASP.NET MVC routing works; the JavaScript file located in `Views/Home/Index.js` cannot be directly ac... | 5,527 | [
{
"from": "human",
"value": "For example, if I have a page located in Views/Home/Index.aspx and a JavaScript file located in Views/Home/Index.js, how do you reference this on the aspx page?\nThe example below doesn't work even though the compiler says the path is correct\n<script src=\"Index.js\" type=\"tex... |
What tools are there available for static analysis against C# code? I know about FxCop and StyleCop. Are there others? I've run across NStatic before but it's been in development for what seems like forever - it's looking pretty slick from what little I've seen of it, so it would be nice if it would ever see the light ... | There are several tools available for static analysis of C# code, each with its own strengths and focuses. Here’s an overview of some popular options:
### Static Analysis Tools for C#
1. **Roslyn Analyzers**: Built on the .NET Compiler Platform, Roslyn provides a rich set of APIs for code analysis. You can use built-... | 6,232 | [
{
"from": "human",
"value": "What tools are there available for static analysis against C# code? I know about FxCop and StyleCop. Are there others? I've run across NStatic before but it's been in development for what seems like forever - it's looking pretty slick from what little I've seen of it, so it woul... |
My development shop has put together a fairly useful Python-based test suite, and we'd like to test some Linux-based C++ code with it. We've gotten the test project they ship with Boost to compile (type 'bjam' in the directory and it works), but we're having issues with our actual project.
Building the boost libraries ... | It sounds like you're encountering a few configuration issues while building and linking your C++ code with the Boost.Python library. Here’s a step-by-step guide to help you troubleshoot and potentially resolve the problem:
### 1. Confirm Your Build Type
It seems like the library names you are encountering indicate d... | 3,841 | [
{
"from": "human",
"value": "My development shop has put together a fairly useful Python-based test suite, and we'd like to test some Linux-based C++ code with it. We've gotten the test project they ship with Boost to compile (type 'bjam' in the directory and it works), but we're having issues with our actu... |
a lot of websites like twitter, facebook and others let the users enter their email id and pwd and 'extract' the contacts based on that.
Anyone know how this is done?
| The process by which websites like Twitter, Facebook, and others allow users to extract contacts using their email IDs and passwords typically involves a few key steps. Here’s a general overview:
1. **User Authentication**: When a user provides their email address and password, the website first authenticates the user... | 7,935 | [
{
"from": "human",
"value": "a lot of websites like twitter, facebook and others let the users enter their email id and pwd and 'extract' the contacts based on that. \nAnyone know how this is done? \n"
},
{
"from": "gpt",
"value": "The process by which websites like Twitter, Facebook, and other... |
Convert mysql timestamp to epoch time in python - is there an easy way to do this?
| Yes, you can easily convert a MySQL timestamp to epoch time in Python using the `datetime` module. MySQL timestamps are typically in the format `YYYY-MM-DD HH:MM:SS`. You can parse this string and then convert it to epoch time using the `datetime` module.
Here's a simple example of how to do this:
```python
from date... | 9,375 | [
{
"from": "human",
"value": "Convert mysql timestamp to epoch time in python - is there an easy way to do this?\n"
},
{
"from": "gpt",
"value": "Yes, you can easily convert a MySQL timestamp to epoch time in Python using the `datetime` module. MySQL timestamps are typically in the format `YYYY-M... |
What is the best way of ensuring that a user supplied password is a strong password in a registration or change password form?
One idea I had (in python)
def validate_password(passwd):
conditions_met = 0
conditions_total = 3
if len(passwd) >= 6:
if passwd.lower() != passwd: conditions_met += 1
... | Your approach to password validation covers some essential criteria for determining password strength. However, there are a few improvements and additional checks that could enhance the function. Here are some considerations and suggestions:
1. **Minimum Length**: Generally, a minimum length of at least 8 characters i... | 5,753 | [
{
"from": "human",
"value": "What is the best way of ensuring that a user supplied password is a strong password in a registration or change password form?\nOne idea I had (in python)\ndef validate_password(passwd):\n conditions_met = 0\n conditions_total = 3\n if len(passwd) >= 6: \n if pas... |
Why do elements with the CSS position: fixed applied to them cause Firefox to eat 100% CPU when scrolling the page they are in? And are there any workarounds?
I've noticed this behavior on a few sites, for example the notification bar at the top of the page on StackOverflow. I'm using Linux in case that matters.
| The issue of high CPU usage in Firefox when scrolling a page with elements having `position: fixed` is typically related to how the browser handles rendering and repainting of fixed elements during scrolling. This can happen for a variety of reasons, including:
1. **Reflow and Repaint**: Fixed elements may trigger fre... | 5,887 | [
{
"from": "human",
"value": "Why do elements with the CSS position: fixed applied to them cause Firefox to eat 100% CPU when scrolling the page they are in? And are there any workarounds?\nI've noticed this behavior on a few sites, for example the notification bar at the top of the page on StackOverflow. I'... |
I have an application with one form in it, and on the Load method I need to hide the form.
The form will display itself when it has a need to (think along the lines of a outlook 2003 style popup), but I can' figure out how to hide the form on load without something messy.
Any suggestions?
| In a typical Windows Forms application, you can hide the form during the Load event without causing issues. However, hiding the form immediately in the Load event can lead to unexpected behavior because the form might not be fully initialized yet.
Instead, a good approach is to use the `Shown` event, which occurs afte... | 8,090 | [
{
"from": "human",
"value": "I have an application with one form in it, and on the Load method I need to hide the form. \nThe form will display itself when it has a need to (think along the lines of a outlook 2003 style popup), but I can' figure out how to hide the form on load without something messy.\nAny... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.