instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
In my child window I have
$('#opfile').addOption("someval",sometext");
Problem is #opfile is an a parent window I cant get it to communicate
I tried
window.opener.$('#opfile').addOption("someval",sometext");
but no luck any ideas?
Update
Embarssing but I got the above to work might have been caching something
Thanks ... | It's great to hear that you managed to solve your issue with adding an option to the `#opfile` element in the parent window! Caching can often lead to unexpected behavior in web development, so it's always a good idea to check for that when troubleshooting.
For anyone else who might encounter similar issues, here’s a ... | 46,555 | [
{
"from": "human",
"value": "In my child window I have \n$('#opfile').addOption(\"someval\",sometext\");\n\nProblem is #opfile is an a parent window I cant get it to communicate\nI tried\nwindow.opener.$('#opfile').addOption(\"someval\",sometext\");\nbut no luck any ideas?\nUpdate\nEmbarssing but I got the ... |
Does anybody know of any resources (books, classes, lecture notes, or anything) about the general theory of computer algebra systems (e.g. mathematica, sympy)?
"Introductory" materials are preferred, but I realize that with such a specialized subject anything is bound to be fairly advanced.
| Certainly! The theory of computer algebra systems (CAS) can be quite intricate, but there are several resources that can help you get started. Here are some recommendations, including books, online courses, and lecture notes that cover introductory aspects and provide a foundation for understanding CAS:
### Books:
1. ... | 44,060 | [
{
"from": "human",
"value": "Does anybody know of any resources (books, classes, lecture notes, or anything) about the general theory of computer algebra systems (e.g. mathematica, sympy)?\n\"Introductory\" materials are preferred, but I realize that with such a specialized subject anything is bound to be f... |
At University we have VS 2005 and it has some refactoring tool like rename, extract method, extract class, etc.
I have decide to download VS 2008 from MSDN and it has only Rename and Extract method, how can I activate the other?
EDIT: I have downloaded Microsoft VS 2008 C# Express Edition.
| In Visual Studio 2008, especially in the Express edition, there are limitations on the refactoring tools available compared to the full versions of Visual Studio. The Express editions generally have fewer features and tools, including refactoring capabilities.
### Refactoring Options in Visual Studio 2008 Express Edit... | 46,221 | [
{
"from": "human",
"value": "At University we have VS 2005 and it has some refactoring tool like rename, extract method, extract class, etc.\nI have decide to download VS 2008 from MSDN and it has only Rename and Extract method, how can I activate the other?\nEDIT: I have downloaded Microsoft VS 2008 C# Ex... |
Hypothetical situation:
Suppose I ran a hosting firm where I hosted subdomains for people. You could sign up and give me a few bucks a month, and I'd give you yourname.mycompany.com.
Now, say I wanted mail.*.mycompany.com to point to one server and www.*.mycompany.com to point to another.
Is this possible? The RFC seem... | In the scenario you described, you want to have DNS records that route mail and web traffic for different subdomains under your main domain (like `mail.yourname.mycompany.com` and `www.yourname.mycompany.com`) to different servers. This is indeed possible with standard DNS practices.
### DNS Basics
DNS operates on a h... | 43,772 | [
{
"from": "human",
"value": "Hypothetical situation:\nSuppose I ran a hosting firm where I hosted subdomains for people. You could sign up and give me a few bucks a month, and I'd give you yourname.mycompany.com.\nNow, say I wanted mail.*.mycompany.com to point to one server and www.*.mycompany.com to point... |
Do the major web application frameworks (Rails, Django, etc) have libraries that provide functionality for signing in, signing up, creating usernames, changing passwords, and managing lost passwords?
It seems to me that this is common functionality that should be supported by some standard library, but I haven't seen a... | Yes, major web application frameworks typically provide libraries or built-in functionality for handling common authentication tasks, such as signing in, signing up, creating usernames, changing passwords, and managing lost passwords. Here’s a brief overview of how some popular frameworks address these needs:
### Ruby... | 45,110 | [
{
"from": "human",
"value": "Do the major web application frameworks (Rails, Django, etc) have libraries that provide functionality for signing in, signing up, creating usernames, changing passwords, and managing lost passwords?\nIt seems to me that this is common functionality that should be supported by s... |
Does anyone know a simple load balance algorithm (formula) that relates users connected, cpu load, network load and memory usage?
This will be used to compare various servers and assign to a new user the best at the moment.
Thank You.
| Certainly! A simple load balancing algorithm can combine various metrics like CPU load, network load, and memory usage to determine the best server for a new user. The goal is to calculate a "load score" for each server based on these factors and then select the server with the lowest score.
Here's a basic approach us... | 44,127 | [
{
"from": "human",
"value": "Does anyone know a simple load balance algorithm (formula) that relates users connected, cpu load, network load and memory usage?\nThis will be used to compare various servers and assign to a new user the best at the moment.\nThank You.\n"
},
{
"from": "gpt",
"value"... |
Does anyone know which property sets the text color for disabled control?
I have to display some text in a disabled TextBox and I want to set its color to black.
| In a disabled `TextBox` control, the text color is typically determined by the system's theme or style settings, which may default to a gray color to indicate that the control is not editable. However, you can override this default behavior.
In Windows Forms, you cannot directly change the text color of a disabled `Te... | 46,101 | [
{
"from": "human",
"value": "Does anyone know which property sets the text color for disabled control? \nI have to display some text in a disabled TextBox and I want to set its color to black.\n"
},
{
"from": "gpt",
"value": "In a disabled `TextBox` control, the text color is typically determine... |
I know there is an on-screen keyboard which you can access on Mac OSX, however I need to add a toolbar button to launch it from within my application.
Does anybody know how I can do this?
| To add a toolbar button to launch the on-screen keyboard (also known as the Accessibility Keyboard) from within your macOS application, you can utilize the built-in Accessibility features of macOS. However, macOS does not provide a direct API to launch the on-screen keyboard specifically. Instead, you can use AppleScri... | 44,326 | [
{
"from": "human",
"value": "I know there is an on-screen keyboard which you can access on Mac OSX, however I need to add a toolbar button to launch it from within my application.\nDoes anybody know how I can do this?\n"
},
{
"from": "gpt",
"value": "To add a toolbar button to launch the on-scre... |
i search a good tutorial to learn how to use entity framework in the right manner. in particular with asp.net mvc.
| Learning Entity Framework (EF) in the context of ASP.NET MVC is a great choice for building data-driven applications. Here are some good resources and tutorials to help you learn how to use Entity Framework effectively:
### Official Documentation
1. **Microsoft Documentation**
- **Entity Framework Core**: [Entity F... | 46,421 | [
{
"from": "human",
"value": "i search a good tutorial to learn how to use entity framework in the right manner. in particular with asp.net mvc.\n"
},
{
"from": "gpt",
"value": "Learning Entity Framework (EF) in the context of ASP.NET MVC is a great choice for building data-driven applications. H... |
Is there a way to extract the data from an Oracle Lite ODB file without installing Oracle Lite? Is there a reader out there which will let me browse and copy the data?
| Extracting data from an Oracle Lite ODB file without installing Oracle Lite can be challenging, as Oracle Lite is a proprietary database system. However, there are a few approaches you can consider:
1. **Oracle Lite Command-Line Tools**: If you have access to the Oracle Lite command-line tools but cannot install the f... | 45,998 | [
{
"from": "human",
"value": "Is there a way to extract the data from an Oracle Lite ODB file without installing Oracle Lite? Is there a reader out there which will let me browse and copy the data?\n"
},
{
"from": "gpt",
"value": "Extracting data from an Oracle Lite ODB file without installing O... |
I am trying to combine some of my CSS and it is kind of an easy questions but I am kind of having some trouble, i have this code:
h2.post-title, h2.post-title a{
display:block;
background-color:#000;
padding:3px;
color:#ffffff;
text-decoration:none;
text-transform:uppercase;
font:lighter 130... | Yes, you can combine those selectors into a single one if you know that `h2.post-title` will always be a link (an anchor tag inside the `h2`). If `h2.post-title` is always going to have a link inside it, then you can simplify your CSS. However, you need to ensure that the styling applies correctly.
If you want `h2.pos... | 47,011 | [
{
"from": "human",
"value": "I am trying to combine some of my CSS and it is kind of an easy questions but I am kind of having some trouble, i have this code:\nh2.post-title, h2.post-title a{\n display:block;\n background-color:#000;\n padding:3px;\n color:#ffffff;\n text-decoration:none;\n ... |
When creating a criteria for NHibernate all criteria are added as AND.
For instance:
session.CreateCriteria(typeof(someobject))
.Add(critiera)
.Add(other_criteria)
then end result will be
SELECT ...
FROM ...
WHERE criteria **AND** other_criteria
I would like to tell NHibernate to add the criterias as "OR"
SELECT ...
... | In NHibernate, if you want to combine criteria using an OR condition instead of the default AND, you can use the `Disjunction` class to create a disjunction (OR) of multiple criteria. Here’s how you can do this:
### Example
You can use the `Disjunction` to group your criteria as follows:
```csharp
using NHibernate.C... | 48,596 | [
{
"from": "human",
"value": "When creating a criteria for NHibernate all criteria are added as AND.\nFor instance:\nsession.CreateCriteria(typeof(someobject))\n.Add(critiera)\n.Add(other_criteria)\n\nthen end result will be\nSELECT ...\nFROM ...\nWHERE criteria **AND** other_criteria\n\nI would like to tell... |
I am currently working on my first asp.net mvc application. I am trying to drink the kool-aid of all the the sample projects I see and trying to use the repository design pattern.
I have a interface called IUserRepository that looks like the following:
public interface IUserRepository
{
IUser Add(IUser user);
... | In your current implementation, both approaches you mentioned for managing user identity and properties (like `CreatedBy`, `ModifiedBy`, etc.) during user operations (such as `Add` and `Update`) are valid. However, there are pros and cons to each approach, and the best choice often depends on your application's design ... | 43,670 | [
{
"from": "human",
"value": "I am currently working on my first asp.net mvc application. I am trying to drink the kool-aid of all the the sample projects I see and trying to use the repository design pattern.\nI have a interface called IUserRepository that looks like the following:\npublic interface IUserR... |
I have the following table in MySQL (version 5):
id int(10) UNSIGNED No auto_increment
year varchar(4) latin1_swedish_ci No
title varchar(250) latin1_swedish_ci Yes NULL
body text latin1_swedish_ci Yes NULL
And I want the db to... | In MySQL, you cannot use a function like `NOW()` or `YEAR(NOW())` directly as a default value for a column in a table definition. Instead, you can use a trigger to achieve the desired behavior. The trigger will automatically set the `year` field to the current year whenever a new row is inserted into the table.
Here’s... | 45,967 | [
{
"from": "human",
"value": "I have the following table in MySQL (version 5):\nid int(10) UNSIGNED No auto_increment \nyear varchar(4) latin1_swedish_ci No \ntitle varchar(250) latin1_swedish_ci Yes NULL \nbody text latin1_s... |
I have a SQL statement similar to this:
SELECT COUNT(*) AS foo, SUM(foo) AS foo_sum FROM bar
But MySQL doesn't allow this because foo is an alias. Does anyone have an idea of how this could be accomplished in SQL?
| In SQL, you cannot use an alias defined in the `SELECT` list in the same `SELECT` clause for other calculations. However, you can achieve your goal by using a subquery or a common table expression (CTE). Below are two methods to accomplish this in MySQL.
### Method 1: Using a Subquery
You can use a subquery to first ... | 46,368 | [
{
"from": "human",
"value": "I have a SQL statement similar to this:\nSELECT COUNT(*) AS foo, SUM(foo) AS foo_sum FROM bar\n\nBut MySQL doesn't allow this because foo is an alias. Does anyone have an idea of how this could be accomplished in SQL?\n"
},
{
"from": "gpt",
"value": "In SQL, you cann... |
I am dealing with a large codebase that has a lot of classes and a lot of abstract methods on these classes. I am interested in peoples opinions about what I should do in the following situation.
If I have a class Parent-A with an abstract method. There will only be 2 children. If Child-B implements AbstractMethodA... | It sounds like you've already reached a good conclusion about your specific situation. However, for anyone facing similar challenges in a large codebase with abstract methods, here are some considerations regarding your options:
1. **Remove the abstract keyword and use virtual or dynamic**:
- This approach is usefu... | 44,234 | [
{
"from": "human",
"value": "I am dealing with a large codebase that has a lot of classes and a lot of abstract methods on these classes. I am interested in peoples opinions about what I should do in the following situation.\nIf I have a class Parent-A with an abstract method. There will only be 2 childr... |
I have to include Groovy classes into existing Java apps, and include Groovy into Ant's build.xml file.
What is the best way to configure Ant's build.xml for it?
Update: Are there more specifics in combining Java and Groovy compilations? Sequence of tasks?
| Integrating Groovy into a Java application and configuring Ant to build both can be accomplished by following a few steps. Below, I will outline how to set up your `build.xml` file in Ant for this purpose and also address the sequence of tasks necessary for compiling both Groovy and Java code.
### Step 1: Setting Up t... | 42,858 | [
{
"from": "human",
"value": "I have to include Groovy classes into existing Java apps, and include Groovy into Ant's build.xml file.\nWhat is the best way to configure Ant's build.xml for it? \nUpdate: Are there more specifics in combining Java and Groovy compilations? Sequence of tasks?\n"
},
{
"fr... |
I always see the code like this in the blogs:
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "WebService.asmx/HelloWorld",
data: "{}",
dataType: "json",
success: function... | The code snippet you provided is an example of an AJAX call using jQuery to communicate with an ASP.NET Web Service (ASMX). The use of this approach is indeed more common with newer versions of ASP.NET (such as 3.5 and above) because they provide enhanced support for JSON and AJAX functionality.
However, if you are us... | 44,549 | [
{
"from": "human",
"value": "I always see the code like this in the blogs: \n$.ajax({\n type: \"POST\",\n contentType: \"application/json; charset=utf-8\",\n url: \"WebService.asmx/HelloWorld\",\n data: \"{}\",\n ... |
I am trying to use symbolic links in one of the applications I have running on Tomcat5. Thanks to some help from another StackOverflow question I was able to do it
by creating a context.xml file in
/...myapplication/META-INF/context.xml
I am now trying to implement this on a production server. However, there are ot... | In Apache Tomcat, the `conf/context.xml` file serves as a global configuration for all web applications deployed on the server. It can define settings that apply to all applications, such as resource definitions and security settings, including the `allowLinking` attribute.
When it comes to the `allowLinking` attribut... | 46,812 | [
{
"from": "human",
"value": "I am trying to use symbolic links in one of the applications I have running on Tomcat5. Thanks to some help from another StackOverflow question I was able to do it \n by creating a context.xml file in\n/...myapplication/META-INF/context.xml\nI am now trying to implement this on... |
The hover "joke" in #505 xkcd touts "I call rule 34 on Wolfram's Rule 34".
I know what rule 34 is in Internet terms and I've googled up who Wolfram is but I'm having a hard time figuring out what Wolfram's Rule 34 is.
So what exactly is this "Rule 34"?
Here's the comic: http://xkcd.com/505/.
| Wolfram's Rule 34 refers to a concept in cellular automata introduced by Stephen Wolfram, specifically related to one-dimensional binary automata. In the context of Wolfram's work, "Rule 34" is a specific set of rules for how the cells in an automaton are updated based on the states of their neighboring cells.
In the ... | 49,759 | [
{
"from": "human",
"value": "The hover \"joke\" in #505 xkcd touts \"I call rule 34 on Wolfram's Rule 34\".\nI know what rule 34 is in Internet terms and I've googled up who Wolfram is but I'm having a hard time figuring out what Wolfram's Rule 34 is.\nSo what exactly is this \"Rule 34\"?\nHere's the comic:... |
Just wondering if there is any way (in C) to get the contents of the console buffer, preferably as some kind of char array. It is going to be written to a file, so if I am missing out on something stupid that will do exactly that, then point it out. It can be Windows-specific. I am using MinGW (gcc 3.4.5).
Thanks in ad... | In Windows, you can obtain the contents of the console buffer using the Windows API functions. Specifically, you'll want to use the `ReadConsoleOutput` function to read the character and attribute data from the console screen buffer. Here's an example of how you can achieve this in C:
### Example Code
```c
#include <... | 41,905 | [
{
"from": "human",
"value": "Just wondering if there is any way (in C) to get the contents of the console buffer, preferably as some kind of char array. It is going to be written to a file, so if I am missing out on something stupid that will do exactly that, then point it out. It can be Windows-specific. I... |
We use Log4j (and Commons Logging) to log our error messages. Now we want to set up an additional log appender that outputs fatal errors to syslog, but without the exceptionally long Java stacktraces (those will still be available in the full log file).
How would one configure this (using log4j.xml)? Is there a filter ... | To configure Log4j to send fatal error messages to syslog while avoiding lengthy Java stack traces, you'll want to set up a separate appender specifically for this purpose. Unfortunately, Log4j itself does not provide a built-in filter to directly ignore stack traces; however, you can customize the log message format t... | 43,087 | [
{
"from": "human",
"value": "We use Log4j (and Commons Logging) to log our error messages. Now we want to set up an additional log appender that outputs fatal errors to syslog, but without the exceptionally long Java stacktraces (those will still be available in the full log file).\nHow would one configure ... |
I read the SDK document, but can not understand some details, need some help.
for the
-(void)touchesEnded:(NSSet*)touches withEvent:(UIEvent*)event
what's the difference between touches and [event allTouches]?
if user release one finger, but still has other fingers on screen, does the later event still contains the f... | In the context of iOS development, the method `-(void)touchesEnded:(NSSet*)touches withEvent:(UIEvent*)event` is called when one or more fingers have been lifted off the screen. This method receives two parameters: `touches` and `event`.
1. **touches**: This parameter is a set of UITouch objects that represent the tou... | 48,487 | [
{
"from": "human",
"value": "I read the SDK document, but can not understand some details, need some help.\nfor the\n-(void)touchesEnded:(NSSet*)touches withEvent:(UIEvent*)event\n\n\nwhat's the difference between touches and [event allTouches]?\nif user release one finger, but still has other fingers on sc... |
I have a tab navigator control and I would like to make all of the tabs a certain color, say blue...
How can this be done?
I have tried through the following CSS:
TabNavigator
{
tabStyleName: "tabs";
}
.tabs {
backgroundColor:#6588b9;
}
but it only seems to work with the selected tab...
I then tried to do ... | If you want to set the background color of all the tabs in a TabNavigator, you will indeed need to customize the appearance of the tabs. In many frameworks, the TabNavigator's tabs are designed to have different states (selected, unselected, etc.), and setting the style for the unselected state often requires a bit mor... | 45,030 | [
{
"from": "human",
"value": "I have a tab navigator control and I would like to make all of the tabs a certain color, say blue... \nHow can this be done?\nI have tried through the following CSS:\n\n\nTabNavigator\n{\n tabStyleName: \"tabs\";\n}\n.tabs {\n backgroundColor:#6588b9;\n}\n\n\nbut it only s... |
Lets say I have two tables - "child" and "parent" with many-to-one relation. What I need is to delete child entries if parent record is deleted.
It is not a problem if I link child table from parent by creating one-to-many association in parent.hbm and set cascade="all-delete-orphan".
The problem is I don't want one-t... | In Hibernate, when you have a many-to-one relationship defined on the child side, and you don't want to have a one-to-many relationship on the parent side, you can still ensure that child entries are deleted when the corresponding parent is deleted. However, since you aren't using the cascade options directly on the pa... | 44,580 | [
{
"from": "human",
"value": "Lets say I have two tables - \"child\" and \"parent\" with many-to-one relation. What I need is to delete child entries if parent record is deleted.\nIt is not a problem if I link child table from parent by creating one-to-many association in parent.hbm and set cascade=\"all-del... |
I need to pick up list items from an list, and then perform operations like adding event handlers on them. I can think of two ways of doing this.
HTML:
<ul id="list">
<li id="listItem-0"> first item </li>
<li id="listItem-1"> second item </li>
<li id="listItem-2"> third item </li>
</ul>
... | To answer your questions:
### 1. Getting the index using the second method:
Using the second method with `childNodes` can be problematic because `childNodes` returns all child nodes, including text nodes (whitespace), which can lead to confusion and incorrect indices. A better approach is to use `children`, which onl... | 46,827 | [
{
"from": "human",
"value": "I need to pick up list items from an list, and then perform operations like adding event handlers on them. I can think of two ways of doing this.\nHTML:\n <ul id=\"list\">\n <li id=\"listItem-0\"> first item </li>\n <li id=\"listItem-1\"> second item </li> \n ... |
Is there a simple way to detect mouse or keyboard activity in Linux or Xorg or Qt4 or Kde4 environment? Obviously not only on a particular window but in the entire Xorg desktop.
| Yes, you can detect mouse and keyboard activity in a Linux environment using various methods, especially if you're working within an Xorg desktop. Below are some approaches you can consider:
### 1. Using `xev`
`xev` is a simple tool that creates a window and listens for events. You can run it from the terminal:
```b... | 44,239 | [
{
"from": "human",
"value": "Is there a simple way to detect mouse or keyboard activity in Linux or Xorg or Qt4 or Kde4 environment? Obviously not only on a particular window but in the entire Xorg desktop.\n"
},
{
"from": "gpt",
"value": "Yes, you can detect mouse and keyboard activity in a Lin... |
I'm trying to assert that one object is "equal" to another object.
The objects are just instances of a class with a bunch of public properties. Is there an easy way to have NUnit assert equality based on the properties?
This is my current solution but I think there may be something better:
Assert.AreEqual(LeftObject.P... | To simplify your object equality assertions in NUnit, you can create a custom assertion method or use existing libraries that provide functionality for deep comparison of objects based on their properties.
### Option 1: Custom Assertion Method
You can create a custom assertion method that compares all the properties... | 46,574 | [
{
"from": "human",
"value": "I'm trying to assert that one object is \"equal\" to another object. \nThe objects are just instances of a class with a bunch of public properties. Is there an easy way to have NUnit assert equality based on the properties?\nThis is my current solution but I think there may be s... |
I am looking for a more elegant way of concatenating strings in Ruby.
I have the following line:
source = "#{ROOT_DIR}/" << project << "/App.config"
Is there a nicer way of doing this?
And for that matter what is the difference between << and +?
| In Ruby, you can concatenate strings in several ways. The line you provided is using string interpolation along with the `<<` operator. Here's a more elegant way to achieve the same result using string interpolation only:
```ruby
source = "#{ROOT_DIR}/#{project}/App.config"
```
This approach is often considered clean... | 49,081 | [
{
"from": "human",
"value": "I am looking for a more elegant way of concatenating strings in Ruby.\nI have the following line:\nsource = \"#{ROOT_DIR}/\" << project << \"/App.config\"\n\nIs there a nicer way of doing this?\nAnd for that matter what is the difference between << and +?\n"
},
{
"from":... |
(this is regarding the Ramaze.net framework)
I ran into some really strange problems while storing custom Objects
in session. I noticed that only the attributes on the objects
immediately stored in session were being updated. However, if those
objects contained references to other objects, those referenced
objects were... | Your observations about the behavior of session storage in the Ramaze framework are insightful. Let's break down your questions and concerns regarding storing complex or deep objects in the session.
### 1. Is it a safe and reasonable solution?
While your modification (removing the difference check) may solve the imme... | 44,988 | [
{
"from": "human",
"value": "(this is regarding the Ramaze.net framework)\nI ran into some really strange problems while storing custom Objects\nin session. I noticed that only the attributes on the objects\nimmediately stored in session were being updated. However, if those\nobjects contained references to... |
i have a < ajaxToolkit:TabPanel
initially when the page loads, the first tab is "open" ("focused on")
can i do something (preferably server side) so my second tab would be the "default" selected tab?
| In an ASP.NET Web Forms application that uses the Ajax Control Toolkit's `TabPanel`, you can specify which tab should be selected by default when the page loads. While you can achieve this both on the server side and client side, since you prefer a server-side solution, here's how you can do it.
### Server-Side Approa... | 37,029 | [
{
"from": "human",
"value": "i have a < ajaxToolkit:TabPanel\ninitially when the page loads, the first tab is \"open\" (\"focused on\")\ncan i do something (preferably server side) so my second tab would be the \"default\" selected tab?\n"
},
{
"from": "gpt",
"value": "In an ASP.NET Web Forms ap... |
The following code produces an error hr=0x80020005 (wrong type).
#import <msi.dll>
using namespace WindowsInstaller;
main()
{
::CoInitialize(NULL);
InstallerPtr pInstaller("WindowsInstaller.Installer");
DatabasePtr pDB = pInstaller->OpenDatabase(
"c:\\foo\\bar.msi",
msiOpenData... | The error you're encountering (`hr=0x80020005 (wrong type)`) suggests that there is a type mismatch when calling the `OpenDatabase` method of the `Installer` object. Specifically, the second parameter for `OpenDatabase` must be of type `MSIDBOPEN`, which is an enumeration and not a string or a pointer type.
In your ca... | 44,285 | [
{
"from": "human",
"value": "The following code produces an error hr=0x80020005 (wrong type).\n#import <msi.dll>\nusing namespace WindowsInstaller;\nmain()\n{\n ::CoInitialize(NULL);\n InstallerPtr pInstaller(\"WindowsInstaller.Installer\");\n DatabasePtr pDB = pInstaller->OpenDatabase(\n ... |
I have several blocks of the following code that each use there own matrix. Is there a way to run each block in it's own thread rather then run all of them sequentially?
for i=1:length(DJI)
DJI2(:,1) = reshape(datenum(strvcat(DJI(:,2)(:)), length(DJI(:,2)),'yyyy-mm-dd'));
DJI2(:,2:6) = reshape(str2num(strvcat(DJI(:,3:... | To run each block of code in its own thread in MATLAB, you can utilize the `parfor` loop provided by MATLAB's Parallel Computing Toolbox. This allows you to execute iterations of a loop in parallel. However, keep in mind that the code you've provided seems to be for processing a single matrix, so you'll need to adapt i... | 45,924 | [
{
"from": "human",
"value": "I have several blocks of the following code that each use there own matrix. Is there a way to run each block in it's own thread rather then run all of them sequentially?\n\nfor i=1:length(DJI)\nDJI2(:,1) = reshape(datenum(strvcat(DJI(:,2)(:)), length(DJI(:,2)),'yyyy-mm-dd'));\nD... |
When it comes to putting the submit and reset buttons on your forms, what order do you use?
[SUBMIT] [RESET]
or
[RESET] [SUBMIT]
This issue has come up countless times at work...
So, in your opinion, which is the most usable for online users?
I personally favor the latter, but some people tend to think otherwise.
| When designing forms, the order of the submit and reset buttons can significantly impact usability. Generally, the more common and widely accepted practice is to place the **Submit** button first, followed by the **Reset** button. This is often represented as:
**[SUBMIT] [RESET]**
### Reasons for This Order:
1. **Use... | 46,461 | [
{
"from": "human",
"value": "When it comes to putting the submit and reset buttons on your forms, what order do you use?\n[SUBMIT] [RESET]\n\nor\n[RESET] [SUBMIT]\n\nThis issue has come up countless times at work...\nSo, in your opinion, which is the most usable for online users?\nI personally favor the lat... |
I'm implementing some rudimentary SQL Server monitoring to watch for excessive blocking.
I have a stored procedure that looks like this:
CREATE PROCEDURE [dbo].[bsp_GetBlockedProcessCount]
AS
BEGIN
SET NOCOUNT ON;
DECLARE @count INT
SELECT @count = COUNT(*)
FROM master.dbo.sysprocesses WITH (NOLOCK)
... | You are facing a common challenge in SQL Server regarding permission scopes when trying to access system views or objects that require higher privileges. The stored procedure you've written tries to access the `sysprocesses` view, which indeed requires higher-level privileges to see all process information.
Here are s... | 42,795 | [
{
"from": "human",
"value": "I'm implementing some rudimentary SQL Server monitoring to watch for excessive blocking.\nI have a stored procedure that looks like this:\nCREATE PROCEDURE [dbo].[bsp_GetBlockedProcessCount]\nAS\nBEGIN\n SET NOCOUNT ON;\n\n DECLARE @count INT\n\n SELECT @count = COUNT(*... |
I'm executing several discrete queries in a single batch against SQL Server. For example:
update tableX set colA = 'freedom';
select lastName from customers;
insert into tableY (a,b,c) values (x,y,z);
Now, I want to capture the result in a DataSet (from select statement) which is easy enough to do...but how do I al... | When executing multiple queries in a single batch against SQL Server, you can capture the results of both the `SELECT` statement and the "messages" (like the number of affected rows) using the `SqlCommand` and `SqlDataReader` classes in ADO.NET, along with an additional mechanism to read the informational messages.
To... | 45,147 | [
{
"from": "human",
"value": "I'm executing several discrete queries in a single batch against SQL Server. For example:\n\nupdate tableX set colA = 'freedom';\n\nselect lastName from customers;\n\ninsert into tableY (a,b,c) values (x,y,z);\n\nNow, I want to capture the result in a DataSet (from select statem... |
When I call the connect function of the Paramiko SSHClient class, it outputs some log data about establishing the connection, which I would like to suppress.
Is there a way to do this either through Paramiko itself, or Python in general?
| Yes, you can suppress the log output from Paramiko when you call the `connect` function of the `SSHClient` class. Paramiko uses Python's logging framework, so you can adjust the logging level to suppress unwanted messages.
Here’s how you can do it:
1. Import the `logging` module.
2. Set the logging level for Paramiko... | 46,588 | [
{
"from": "human",
"value": "When I call the connect function of the Paramiko SSHClient class, it outputs some log data about establishing the connection, which I would like to suppress.\nIs there a way to do this either through Paramiko itself, or Python in general?\n"
},
{
"from": "gpt",
"valu... |
Does any of you have a clue how to alter the contents of Security.framework/TrustStore.sqlite3. It seems as if the iPhone uses it to store trusted CA certificates. I really want my iPod touch to trust my custom certificate. Beside that, does anyone of you know an app (win32) to edit sqlite3 database files (except sqli... | Altering the contents of `Security.framework/TrustStore.sqlite3` on an iPhone or iPod touch to make a device trust a custom certificate is generally not recommended and could lead to significant security risks. Apple implements strict security measures to prevent unauthorized modifications to system files, including tr... | 44,614 | [
{
"from": "human",
"value": "Does any of you have a clue how to alter the contents of Security.framework/TrustStore.sqlite3. It seems as if the iPhone uses it to store trusted CA certificates. I really want my iPod touch to trust my custom certificate. Beside that, does anyone of you know an app (win32) to... |
Is there a built in way in SQL Server 2005 to audit things specifically like deleting a stored procedure? Is there a history table that I can query? We have a mystery sproc that has disappeared a few times now.
| SQL Server 2005 does not have built-in auditing specifically for tracking changes to database objects like stored procedures, such as when they are created, modified, or deleted. However, there are a few ways you can implement auditing for such actions:
### 1. **Use DDL Triggers:**
You can create a Data Definition La... | 44,712 | [
{
"from": "human",
"value": "Is there a built in way in SQL Server 2005 to audit things specifically like deleting a stored procedure? Is there a history table that I can query? We have a mystery sproc that has disappeared a few times now.\n"
},
{
"from": "gpt",
"value": "SQL Server 2005 does no... |
I'm looking for books / articles / papers on Javascript engine internals along the lines of the many reference works about the JVM internals, CLR internals, etc. I could (and likely will) look at the source code for JavaScriptCore and V8/Chromium, but if there's a book out there or some other "guided tour" documentati... | While resources on JavaScript engine internals may not be as extensive as those for JVM or CLR, there are still several notable books, articles, and papers that can provide insights into JavaScript engine architecture and performance. Here are some recommendations:
### Books
1. **"JavaScript: The Definitive Guide" by ... | 45,666 | [
{
"from": "human",
"value": "I'm looking for books / articles / papers on Javascript engine internals along the lines of the many reference works about the JVM internals, CLR internals, etc. I could (and likely will) look at the source code for JavaScriptCore and V8/Chromium, but if there's a book out ther... |
I don't know if it is possible to add a Flash banner into a Wordpress theme... Ideally, this banner would be in the header of the site always. Any ideas on how I might accomplish this?
| Adding a Flash banner to a WordPress theme is possible, but it's important to note that Flash is no longer widely supported and has been phased out by major browsers. Instead, you may want to consider using HTML5 or animated GIFs for modern compatibility. However, if you're specifically looking to add a Flash banner, h... | 44,318 | [
{
"from": "human",
"value": "I don't know if it is possible to add a Flash banner into a Wordpress theme... Ideally, this banner would be in the header of the site always. Any ideas on how I might accomplish this?\n"
},
{
"from": "gpt",
"value": "Adding a Flash banner to a WordPress theme is pos... |
I observe unmanaged.dll files having a unmanaged.dll.manifest file tagging along. On opening this files in an editor, it seems to be normal XML with links to certain other dependent managed? assemblies. This seems to be like a recent change.. don't remember seeing them earlier.
Why are these files needed? (If I had to... | The presence of `.manifest` files alongside unmanaged DLLs represents a feature of the Windows operating system known as "side-by-side assembly" (SxS). This mechanism allows multiple versions of shared components to be stored and loaded side-by-side, thus minimizing versioning conflicts and improving application compat... | 44,139 | [
{
"from": "human",
"value": "I observe unmanaged.dll files having a unmanaged.dll.manifest file tagging along. On opening this files in an editor, it seems to be normal XML with links to certain other dependent managed? assemblies. This seems to be like a recent change.. don't remember seeing them earlier.\... |
I have a UI-dialog something like this: You must choose a book from a list. Optionally, you can either choose a publisher (another class) from a list or enter the publisher-name as as a string.
I think this gives me 3 types as the output from the dialog.
book
book with publisher-class
book with publisher-string
How ... | Your scenario describes a context where a user interacts with a dialog to select a book and optionally provide publisher information, which can either be a publisher object from a list or a string. Let's explore how to model this using both inheritance and composition.
### Option 1: Inheritance
If you prefer an inher... | 42,793 | [
{
"from": "human",
"value": "I have a UI-dialog something like this: You must choose a book from a list. Optionally, you can either choose a publisher (another class) from a list or enter the publisher-name as as a string. \nI think this gives me 3 types as the output from the dialog.\n\nbook\nbook with pub... |
I want to set up a content mgmt system. And i feel the combination of Alfresco with Opsoro is a gud one. Any other suggestions?
visit Alfresco &
Opsoro
| Setting up a content management system (CMS) is a critical decision for managing digital assets, workflows, and collaboration effectively. While Alfresco combined with Opsoro can indeed be a powerful solution, there are several other CMS options you might consider based on your needs. Here are a few suggestions:
### 1... | 44,164 | [
{
"from": "human",
"value": "I want to set up a content mgmt system. And i feel the combination of Alfresco with Opsoro is a gud one. Any other suggestions?\nvisit Alfresco &\n Opsoro\n"
},
{
"from": "gpt",
"value": "Setting up a content management system (CMS) is a critical decision for ma... |
I have a scenario where users of my ASP.NET web application submit testimonials consisting of text info and images. The submit process has the following steps:
First the user inputs the content and chooses a path to an image
When he clicks preview, the info is once again shown so that he can confirm
Once confirmed the... | To handle the scenario you're describing without causing issues with application pool recycling in a medium trust environment, you can utilize a couple of strategies to store temporary image files without triggering the pool restart. Here are some approaches to consider:
### 1. Unique Temporary File Naming
Instead of ... | 37,982 | [
{
"from": "human",
"value": "I have a scenario where users of my ASP.NET web application submit testimonials consisting of text info and images. The submit process has the following steps:\n\nFirst the user inputs the content and chooses a path to an image\nWhen he clicks preview, the info is once again sho... |
Are there any good (preferably free) tools out there?
Can they give accurate estimates that reflect production results when the app goes live?
| There are several free tools available that can help with estimating various aspects of software development and project management. Here are a few notable ones:
1. **Trello**: While primarily a task management tool, Trello can help you estimate the time and resources needed for tasks using cards and lists. You can ad... | 46,488 | [
{
"from": "human",
"value": "Are there any good (preferably free) tools out there? \nCan they give accurate estimates that reflect production results when the app goes live?\n"
},
{
"from": "gpt",
"value": "There are several free tools available that can help with estimating various aspects of s... |
Recently ASP.NET developer launched its newest control, Charting control. (Microsoft Chart). Does this compatible with ASP.NET MVC, or its only compatible with ASP.NET WebForm ?
| The Microsoft Chart Controls were primarily designed for use with ASP.NET Web Forms, but they can also be used with ASP.NET MVC. However, integrating charting controls into an ASP.NET MVC application may require some additional work compared to using them directly in a Web Forms application.
In ASP.NET MVC, you can us... | 48,395 | [
{
"from": "human",
"value": "Recently ASP.NET developer launched its newest control, Charting control. (Microsoft Chart). Does this compatible with ASP.NET MVC, or its only compatible with ASP.NET WebForm ?\n"
},
{
"from": "gpt",
"value": "The Microsoft Chart Controls were primarily designed for... |
I would like to know how do you determine the hardware needed for a server?
I have a DB Server running MySQL, and now I want to buy a server, but I don't know what hardware specification that I need. This is a server for a hosting a web page.
EDIT:
The software it's just MySQL Server
| Determining the hardware needed for a MySQL database server hosting a webpage involves assessing various factors that contribute to performance, reliability, and scalability. Here are the key considerations:
### 1. **Assess Workload Requirements**
- **Concurrent Connections**: Estimate the number of users that will... | 44,080 | [
{
"from": "human",
"value": "I would like to know how do you determine the hardware needed for a server?\nI have a DB Server running MySQL, and now I want to buy a server, but I don't know what hardware specification that I need. This is a server for a hosting a web page.\nEDIT:\nThe software it's just MySQ... |
I have a simple extension method on the int type so I can do the following:
string timeLength = 61.ToTime() // timeLength will be "1:01"
This works great in code, but I want to use this extension method in a Repeater Template. When databinding I want to do the following:
<%# Eval("LengthInSeconds").ToTime() %>
That d... | In ASP.NET, the issue you're facing with using extension methods in data-binding expressions (like in `<%# Eval(...) %>`) is related to the way the `Eval` method returns its result. Specifically, the `Eval` method returns an `object`, and in C#, extension methods are only available to the type they extend. Since `Eval`... | 45,898 | [
{
"from": "human",
"value": "I have a simple extension method on the int type so I can do the following:\nstring timeLength = 61.ToTime() // timeLength will be \"1:01\"\n\nThis works great in code, but I want to use this extension method in a Repeater Template. When databinding I want to do the following:\n... |
In my javascript I have this
loopDeLoop:
while (foo !== bar) {
switch (fubar) {
case reallyFubar:
if (anotherFoo == anotherBar) {
break loopDeLoop;
}
break;
default:
... | To address the JSLint warning regarding the use of labels in your code, you can refactor your code to avoid using a label for the `while` loop. You can achieve the same control flow using a boolean flag or by simply breaking out of the loop without a label.
Here's how you can refactor the code without using a label:
... | 47,925 | [
{
"from": "human",
"value": "In my javascript I have this\n loopDeLoop:\n while (foo !== bar) {\n switch (fubar) {\n case reallyFubar:\n if (anotherFoo == anotherBar) {\n break loopDeLoop;\n }\n ... |
I'm trying to use Spring WebFlow to redirect to a computed url to an ftp server, but in the ExternalRedirect code are the following lines:
} else if (location.startsWith("http://") || location.startsWith("https://")) {
sendRedirect(location, request, response);
} else {
sendServletRelativeRedirect(location, req... | In Spring WebFlow, the `ExternalRedirect` mechanism is primarily designed to handle HTTP(S) URLs. The code snippet you provided indicates that only URLs starting with `http://` or `https://` are treated as valid external redirects. FTP URLs (like `ftp://example.com/`) do not fall into this category, which is why you're... | 44,953 | [
{
"from": "human",
"value": "I'm trying to use Spring WebFlow to redirect to a computed url to an ftp server, but in the ExternalRedirect code are the following lines:\n} else if (location.startsWith(\"http://\") || location.startsWith(\"https://\")) {\n sendRedirect(location, request, response);\n} else... |
I have the following bit of legacy C++ code that does not compile:
#include <stdio.h>
#include <iostream>
extern ostream *debug;
GCC (g++) complains: "expected initializer before ‘*’ token"
Looking around it seems more common to declare these as external references, like this:
extern ostream& debug;
Why is a pointer... | The issue you're encountering is indeed related to the absence of the `std::` namespace specifier in your code. In C++, `ostream` is defined within the `std` namespace, so you need to refer to it as `std::ostream`.
Let's clarify the points about using pointers and references in this context:
1. **Pointer Declaration*... | 46,302 | [
{
"from": "human",
"value": "I have the following bit of legacy C++ code that does not compile:\n#include <stdio.h>\n#include <iostream>\n\nextern ostream *debug;\n\nGCC (g++) complains: \"expected initializer before ‘*’ token\"\nLooking around it seems more common to declare these as external references, l... |
A client has installed Sql server 2005 reporting services. When we go to the web bit at http://servername/reports/ we just see a blank screen like:
We are using windows authentication and I think it has authenticated us as the "site settings" button is appearing and we can alter site security, add to roles etc.
I ha... | Hi Alex,
A blank screen in SQL Server 2005 Reporting Services can be caused by several issues. Here are some steps to troubleshoot and potentially resolve the issue:
1. **Check for Errors in Event Viewer**:
- Look at the Windows Event Viewer for any errors related to Reporting Services. This can provide insight in... | 44,221 | [
{
"from": "human",
"value": "A client has installed Sql server 2005 reporting services. When we go to the web bit at http://servername/reports/ we just see a blank screen like: \n\nWe are using windows authentication and I think it has authenticated us as the \"site settings\" button is appearing and we can... |
Im trying to extract a line from wget's result but having trouble with it.
This is my wget call:
$ wget -SO- -T 1 -t 1 http://myurl.com:15000/myhtml.html
Output:
--18:24:12-- http://xxx.xxxx.xxxx:15000/myhtml.html
=> `-'
Resolving xxx.xxxx.xxxx... xxx.xxxx.xxxx
Connecting to xxx.xxxx.xxxx|xxx.xxxx.xxxx|:1... | It looks like you are trying to extract the line that contains the HTTP status code `302` from the output of `wget`. However, the way you are currently using `egrep` may not be working due to the way `wget` formats its output.
The status line is usually displayed in a way that may not match exactly what you expect. I... | 48,632 | [
{
"from": "human",
"value": "Im trying to extract a line from wget's result but having trouble with it.\nThis is my wget call:\n$ wget -SO- -T 1 -t 1 http://myurl.com:15000/myhtml.html\n\nOutput:\n\n--18:24:12-- http://xxx.xxxx.xxxx:15000/myhtml.html\n => `-'\nResolving xxx.xxxx.xxxx... xxx.xxxx.... |
Delphi 8 introduced Class Helpers for the purposes of mapping the VCL/RTL to the .NET object hierarchy. They allow injecting methods into an existing class without overriding the the class or modifying the original. Later versions of Delphi found class helpers improved and they were ported to Win32.
In the help it sa... | Class Helpers in Delphi are indeed a powerful feature that allows developers to extend existing classes without modifying their source code, which can be quite advantageous, especially when working with third-party libraries or legacy code. However, the warning against using class helpers as a design tool when developi... | 43,680 | [
{
"from": "human",
"value": "Delphi 8 introduced Class Helpers for the purposes of mapping the VCL/RTL to the .NET object hierarchy. They allow injecting methods into an existing class without overriding the the class or modifying the original. Later versions of Delphi found class helpers improved and the... |
My code processes all the files in a folder on a Windows box. I want to offer the user (who happens to also be me) the option to select the folder to be processed, using the standard File Chooser dialog.
I am trying to use the GetOpenFileName function to make this happen. (I am actually calling it from Python via pywin... | To allow a user to select a folder in a Windows environment using a dialog, you cannot use the `GetOpenFileName` function because it is specifically designed for selecting files, not folders. Instead, you should use the `SHBrowseForFolder` function from the Windows Shell API, which provides a dialog for browsing folder... | 43,161 | [
{
"from": "human",
"value": "My code processes all the files in a folder on a Windows box. I want to offer the user (who happens to also be me) the option to select the folder to be processed, using the standard File Chooser dialog.\nI am trying to use the GetOpenFileName function to make this happen. (I am... |
I created a Web site in VS2008. I'm wondering if I should have created it as a project instead and, if so, can it be converted? Any advantages/disadvantages to either approach?
TIA
| Creating a website in Visual Studio 2008 as a "Web Site Project" or a "Web Application Project" depends on your needs and the way you plan to manage the development process. Below are the key differences, advantages, and disadvantages of each approach.
### Web Site Project
**Advantages:**
1. **File Structure:** Web S... | 43,049 | [
{
"from": "human",
"value": "I created a Web site in VS2008. I'm wondering if I should have created it as a project instead and, if so, can it be converted? Any advantages/disadvantages to either approach?\nTIA\n"
},
{
"from": "gpt",
"value": "Creating a website in Visual Studio 2008 as a \"Web... |
If tan(x) = y and atan(y) = x why Math.Atan(Math.Tan(x)) != x?
I´m trying to calculate x in something like:
tan(2/x +3) = 5
so
atan(tan(2/x + 3) = atan(5)
and so on... but I´ve tried this:
double d = Math.Atan(Math.Tan(10));
and d != 10. Why?
| The reason you're experiencing this behavior is due to the periodic nature of the tangent function and the definition of the arctangent (atan) function. Let's break it down:
1. **Properties of the tangent function**:
- The tangent function, \( \tan(x) \), is periodic with a period of \( \pi \). This means that \( \... | 42,874 | [
{
"from": "human",
"value": "If tan(x) = y and atan(y) = x why Math.Atan(Math.Tan(x)) != x?\nI´m trying to calculate x in something like: \ntan(2/x +3) = 5 \n\nso \natan(tan(2/x + 3) = atan(5)\n\nand so on... but I´ve tried this: \ndouble d = Math.Atan(Math.Tan(10));\n\nand d != 10. Why?\n"
},
{
"fr... |
How do I make one of those hyperlinks where when you click it, it will display a popup asking "are you sure?"
<INPUT TYPE="Button" NAME="confirm" VALUE="???" onClick="message()">
I already have a message() function working. I just need to know what the input type for a hyperlink would be.
| To create a hyperlink that displays a confirmation popup when clicked, you can use an anchor (`<a>`) tag along with an `onClick` event that calls your `message()` function. Instead of an `<input>` type, which is typically used for form elements, an anchor tag is more appropriate for hyperlinks.
Here's an example of ho... | 48,978 | [
{
"from": "human",
"value": "How do I make one of those hyperlinks where when you click it, it will display a popup asking \"are you sure?\"\n<INPUT TYPE=\"Button\" NAME=\"confirm\" VALUE=\"???\" onClick=\"message()\">\n\nI already have a message() function working. I just need to know what the input type f... |
I have a Rails app with some basic models. The website displays data retrieved from other sources. So I need to write a Ruby script that creates new instances in my database. I know I can do that with the test hooks, but I'm not sure that makes sense here.
I'm not sure what this task should look like, how I can invoke ... | In Rails, you can write scripts to create database records by leveraging Rails' environment. This allows you to take advantage of ActiveRecord and all the configurations that Rails provides, including database connections. You should definitely consider using Rake tasks for this purpose.
Here's a guide on how to set u... | 45,523 | [
{
"from": "human",
"value": "I have a Rails app with some basic models. The website displays data retrieved from other sources. So I need to write a Ruby script that creates new instances in my database. I know I can do that with the test hooks, but I'm not sure that makes sense here.\nI'm not sure what thi... |
I'm using .NET 2.0, and a recent code change has invalidated my previous Assert.AreEqual call (which compared two strings of XML). Only one element of the XML is actually different in the new codebase, so my hope is that a comparison of all the other elements will give me the result I want. The comparison needs to be... | If you need to compare XML strings in .NET 2.0 and want to avoid adding dependencies, using `XmlDocument` is indeed a straightforward approach. Here's how you can compare the two XML documents while ignoring differences in specific elements.
### Using `XmlDocument`
You can load the XML strings into `XmlDocument` obje... | 42,931 | [
{
"from": "human",
"value": "I'm using .NET 2.0, and a recent code change has invalidated my previous Assert.AreEqual call (which compared two strings of XML). Only one element of the XML is actually different in the new codebase, so my hope is that a comparison of all the other elements will give me the r... |
When I generate CSS or JavaScript files using PHP I like to use .js.php or .css.php file extensions. so that I know what's going on.
Is there a way of associating these "compound" file extensions to their respective languages?
| Yes, you can associate the `.js.php` and `.css.php` file extensions with their respective languages in your development environment, such as an IDE or text editor, to enable syntax highlighting and appropriate features. The process to do this will vary depending on which editor or IDE you are using. Below are instructi... | 45,042 | [
{
"from": "human",
"value": "When I generate CSS or JavaScript files using PHP I like to use .js.php or .css.php file extensions. so that I know what's going on.\nIs there a way of associating these \"compound\" file extensions to their respective languages?\n"
},
{
"from": "gpt",
"value": "Yes,... |
I would like to intercept any URL which the user enters in their browser and perform some tasks before allowing the navigation to continue (any way could be good - i.e. via plug in, via proxy or any other creative suggestion).
To clarify - I am not referring to a specific application that needs to catch this, but rathe... | Intercepting and modifying browser navigation is a sensitive task, as it can have significant implications for user privacy and security. However, there are several legitimate ways you can implement this, depending on your requirements and technical constraints:
### 1. Browser Extensions
Creating a browser extension i... | 44,099 | [
{
"from": "human",
"value": "I would like to intercept any URL which the user enters in their browser and perform some tasks before allowing the navigation to continue (any way could be good - i.e. via plug in, via proxy or any other creative suggestion).\nTo clarify - I am not referring to a specific appli... |
I have a short preliminary interview with Microsoft in less than 2 hours.
I've been told that they might ask questions in Java and/or C++.
Where can I find a quick overview of both languages?
I don't need to full tutorial, just something that goes over the language-specific features and a refresher of the semantics.
I ... | Sure! Here’s a quick overview and resources for both Java and C++ that should help you refresh your knowledge in a short amount of time.
### Java Quick Overview
1. **Basics**
- **Syntax**: Java is similar to C++ in syntax but is object-oriented and platform-independent (uses JVM).
- **Data Types**: Primitive typ... | 42,961 | [
{
"from": "human",
"value": "I have a short preliminary interview with Microsoft in less than 2 hours.\nI've been told that they might ask questions in Java and/or C++.\nWhere can I find a quick overview of both languages?\nI don't need to full tutorial, just something that goes over the language-specific f... |
Obviously having whitespace in css, aspx and html pages is a great advantage at design time. But is there a way to (a tool that will) clear all the whitespace from all the files and possibly merge javascript and css files in a more optimal way.
I am using asp.net themes so there are quite a lot of separate css files t... | To optimize your ASP.NET project by removing whitespace from your CSS, HTML, and ASPX files, as well as combining and minifying JavaScript and CSS files, you can use various tools and build processes. Here are some common approaches:
### 1. **Build Tools and Task Runners**
You can use build tools such as Gulp, Grunt,... | 43,192 | [
{
"from": "human",
"value": "Obviously having whitespace in css, aspx and html pages is a great advantage at design time. But is there a way to (a tool that will) clear all the whitespace from all the files and possibly merge javascript and css files in a more optimal way. \nI am using asp.net themes so the... |
Is there a "win64" identifier in Qmake project files? Qt Qmake advanced documentation does not mention other than unix / macx / win32.
So far I've tried using:
win32:message("using win32")
win64:message("using win64")
amd64:message("using amd64")
The result is always "using win32".
Must I use a separate project-file f... | In QMake, the `win32` identifier is used for all Windows platforms, regardless of whether it's 32-bit or 64-bit. There is no built-in `win64` identifier in QMake, which can indeed be a limitation when you want to differentiate between 32-bit and 64-bit builds.
To differentiate between 32-bit and 64-bit environments in... | 49,174 | [
{
"from": "human",
"value": "Is there a \"win64\" identifier in Qmake project files? Qt Qmake advanced documentation does not mention other than unix / macx / win32.\nSo far I've tried using:\nwin32:message(\"using win32\")\nwin64:message(\"using win64\")\namd64:message(\"using amd64\")\n\nThe result is alw... |
EDIT: I would really like to see some general discussion about the formats, their pros and cons!
EDIT2: The 'bounty didn't really help to create the needed discussion, there are a few interesting answers but the comprehensive coverage of the topic is still missing. Six persons marked the question as favourites, which s... | When it comes to internationalization (i18n) and localization (l10n), choosing the right format for storing translations is critical, as it can affect everything from ease of use to compatibility with various tools. Here’s a breakdown of some of the popular formats you mentioned, along with their pros and cons:
### 1.... | 42,469 | [
{
"from": "human",
"value": "EDIT: I would really like to see some general discussion about the formats, their pros and cons!\nEDIT2: The 'bounty didn't really help to create the needed discussion, there are a few interesting answers but the comprehensive coverage of the topic is still missing. Six persons ... |
How do I save the iterations that have occurred in an xsl:for-each? (variables in XSL are immutable)
My goal is to find the MAX number of children for any node at a particular level.
For example, I might want to print that there are no more than 2 Response nodes for any Question in this survey:
<?xml version="1.0" enco... | In XSLT 1.0, variables are indeed immutable, which means that you cannot change their values once they have been set. However, you can achieve your goal of finding the maximum number of `Response` nodes for any `Question` by utilizing the `count()` function in a nested `for-each` loop without needing to increment a mut... | 40,318 | [
{
"from": "human",
"value": "How do I save the iterations that have occurred in an xsl:for-each? (variables in XSL are immutable)\nMy goal is to find the MAX number of children for any node at a particular level.\nFor example, I might want to print that there are no more than 2 Response nodes for any Questi... |
I need to add unit testing to some old scripts, the scripts are all basically in the following form:
#!/usr/bin/perl
# Main code
foo();
bar();
# subs
sub foo {
}
sub bar {
}
If I try to 'require' this code in a unit test, the main section of the code will run, where as I want to be able to just test "foo" in isola... | Yes, you can modify your existing Perl script to facilitate unit testing without moving the functions into a separate `.pm` file. A common approach is to use a `BEGIN` block or an `if` statement to control whether the main part of the script runs or not. This allows you to isolate the functions for testing.
Here's a m... | 43,512 | [
{
"from": "human",
"value": "I need to add unit testing to some old scripts, the scripts are all basically in the following form:\n#!/usr/bin/perl\n\n# Main code\nfoo();\nbar();\n\n# subs\nsub foo {\n\n}\nsub bar {\n\n}\n\nIf I try to 'require' this code in a unit test, the main section of the code will run... |
I'm writing a basic sprite engine for my own amusement and to get better aquainted with Java's 2d API. Currently I am making use of large numbers of separate .png files with transparent backgrounds to represent the various sprites and different frames of animation that I need. Most 'real world' game development project... | Creating a sprite engine using sprite sheets is a great way to optimize your game's graphics and improve performance. Let's break down the process of using sprite sheets, including how to manage them programmatically, determine sprite boundaries, and handle transparency.
### 1. Understanding Sprite Sheets
A sprite sh... | 41,971 | [
{
"from": "human",
"value": "I'm writing a basic sprite engine for my own amusement and to get better aquainted with Java's 2d API. Currently I am making use of large numbers of separate .png files with transparent backgrounds to represent the various sprites and different frames of animation that I need. M... |
I need to read the user's fingerprint from my application.
What I really want is a simple SDK that works with a lot of inexpensive fingerprint readers but I can deal with something that works only with one specific model if that model is cheap and available worldwide.
And it has to be royalty-free, I can pay for a deve... | When looking for a fingerprint scanning SDK that meets your requirements, you'll want to consider a few different options that align with your needs for cost, royalty-free licensing, and compatibility with fingerprint readers. Here are some suggestions:
1. **DigitalPersona SDK**: This SDK is well-known for working wit... | 46,035 | [
{
"from": "human",
"value": "I need to read the user's fingerprint from my application.\nWhat I really want is a simple SDK that works with a lot of inexpensive fingerprint readers but I can deal with something that works only with one specific model if that model is cheap and available worldwide.\nAnd it h... |
In Visual c# Express Edition, is it possible to make some (but not all) items in a ListBox bold? I can't find any sort of option for this in the API.
| In the standard `ListBox` control in Windows Forms, you cannot directly set individual items to be bold or apply different styles to specific items. The `ListBox` does not support custom drawing of items out of the box, but you can achieve this by using the `DrawItem` event to customize the rendering of the items.
Her... | 42,888 | [
{
"from": "human",
"value": "In Visual c# Express Edition, is it possible to make some (but not all) items in a ListBox bold? I can't find any sort of option for this in the API.\n"
},
{
"from": "gpt",
"value": "In the standard `ListBox` control in Windows Forms, you cannot directly set individ... |
I am currently using an Apache front end for my Subversion repository, in order to do LDAP authentication.
My setup is fairly vanilla, however I would like to be able to specify a "backup" LDAP URL, in case the primary one is down. I can't currently see a way to do this other then use a second location, or virtual host... | To achieve the goal of having a backup LDAP URL for authentication in an Apache setup without requiring users to select between servers, you can use the `AuthLDAPURL` directive in combination with the `LDAP` provider's failover capabilities. However, with Apache 2.2, there isn't built-in support for LDAP failover direc... | 41,795 | [
{
"from": "human",
"value": "I am currently using an Apache front end for my Subversion repository, in order to do LDAP authentication.\nMy setup is fairly vanilla, however I would like to be able to specify a \"backup\" LDAP URL, in case the primary one is down. I can't currently see a way to do this other... |
I get the following error while trying to use hres = CoInitializeEx(0, COINIT_MULTITHREADED);
error C2065: 'CoInitializeEx' : undeclared identifier
I have already included:
#define _WIN32_DCOM
#include <iostream>
using namespace std;
#include <comdef.h>
#include <Wbemidl.h>
in my cpp file.
Kindly help.
Thanks,
Neha... | The error you are encountering (`C2065: 'CoInitializeEx' : undeclared identifier`) suggests that the `CoInitializeEx` function is not recognized in your code. This could be due to a missing include or a problem with your project settings. Here's how you can resolve the issue:
1. **Include the Correct Headers**: Make s... | 43,838 | [
{
"from": "human",
"value": "I get the following error while trying to use hres = CoInitializeEx(0, COINIT_MULTITHREADED);\n\nerror C2065: 'CoInitializeEx' : undeclared identifier\n\nI have already included:\n#define _WIN32_DCOM\n#include <iostream>\nusing namespace std;\n#include <comdef.h>\n#include <Wbe... |
How do I convert a datetime field in Grails to just date, with out capturing the time? I need to do this for comparison with system date.
class Trip
{
String name
String city
Date startDate
Date endDate
String purpose
String notes
static constraints = {
name(maxLength: 50, blank:... | In Grails, if you need to compare a `Date` object to just the date portion (i.e., year, month, and day) without considering the time, you can achieve this by normalizing both dates to the start of the day (midnight). This way, the time component does not affect the comparison.
Here's how you can modify your validator ... | 46,095 | [
{
"from": "human",
"value": "How do I convert a datetime field in Grails to just date, with out capturing the time? I need to do this for comparison with system date. \nclass Trip \n{\n String name\n String city\n Date startDate\n Date endDate\n String purpose\n String notes\n\n static... |
Continuing my investigation of expressing F# ideas in C#, I wanted a pipe forward operator. For anything wrapped in a IEnumerable, we already have it, as you can .NextFunc() to your heart's content. But for example if you have any fold-like reduction at the end, you can't feed the result of that into a function.
Here a... | The idea behind introducing a pipe operator through extension methods in C# is interesting and can indeed be quite useful for functional-style programming. It provides a more readable way to chain operations on values, especially when working with values that may be null.
Your implementation of the `Pipe` extension me... | 42,032 | [
{
"from": "human",
"value": "Continuing my investigation of expressing F# ideas in C#, I wanted a pipe forward operator. For anything wrapped in a IEnumerable, we already have it, as you can .NextFunc() to your heart's content. But for example if you have any fold-like reduction at the end, you can't feed t... |
Do you need to have JCE embedded in your Java application when you already have LDAP authentication in place?
| The decision to use Java Cryptography Extension (JCE) in your Java application is independent of whether you have LDAP (Lightweight Directory Access Protocol) authentication in place. Here are some points to consider:
1. **Purpose of JCE**: JCE provides a framework and implementation for encryption, key generation, an... | 46,146 | [
{
"from": "human",
"value": "Do you need to have JCE embedded in your Java application when you already have LDAP authentication in place?\n"
},
{
"from": "gpt",
"value": "The decision to use Java Cryptography Extension (JCE) in your Java application is independent of whether you have LDAP (Ligh... |
I have a custom error page set up for my application:
<customErrors mode="On" defaultRedirect="~/errors/GeneralError.aspx"
/>
In Global.asax, Application_Error(), the following code works to get the exception details:
Exception ex = Server.GetLastError();
if (ex != null)
{
if (ex.GetBaseException() != ... | In ASP.NET, when an unhandled exception occurs, it is usually captured in the `Application_Error` method of `Global.asax`. However, after the application redirects to the custom error page, the context of the original exception is lost, and `Server.GetLastError()` will return null on that page.
To pass exception detai... | 45,562 | [
{
"from": "human",
"value": "I have a custom error page set up for my application:\n<customErrors mode=\"On\" defaultRedirect=\"~/errors/GeneralError.aspx\"\n/>\n\nIn Global.asax, Application_Error(), the following code works to get the exception details:\n Exception ex = Server.GetLastError();\n if (ex !... |
I need to be able to change a user's password from a cron task or from an ssh session. Is there an easy way to do that with a bash script? If not, what's the easiest way to do it in Cocoa?
| Yes, you can change a user's password from a bash script that can be run via a cron job or an SSH session. One way to achieve this is by using the `chpasswd` command or `passwd` command in a script. Below is an example of how to do this securely.
### Bash Script Example
1. Create a script named `change_password.sh`.
... | 42,511 | [
{
"from": "human",
"value": "I need to be able to change a user's password from a cron task or from an ssh session. Is there an easy way to do that with a bash script? If not, what's the easiest way to do it in Cocoa?\n"
},
{
"from": "gpt",
"value": "Yes, you can change a user's password from ... |
Is it OK (or even recommended/good practice) to #include a .c file in another .c file?
| Including a `.c` file in another `.c` file using the `#include` directive is technically possible in C, but it is generally not considered good practice. Here are some reasons why:
1. **Code Duplication**: Including a `.c` file can lead to code duplication if the included file is also compiled separately in other tran... | 45,636 | [
{
"from": "human",
"value": "Is it OK (or even recommended/good practice) to #include a .c file in another .c file?\n"
},
{
"from": "gpt",
"value": "Including a `.c` file in another `.c` file using the `#include` directive is technically possible in C, but it is generally not considered good pra... |
I've implemented a tap-and-hold handler using an NSTimer that I first set in the TouchesBegan overload.
However, what I actually want is for an action to be continuously performed in quick-fire succession while the touch is being held. So, on timer expiry I call a handler to do the work, which then sets another timer a... | It sounds like you're encountering a common issue related to event handling in UIKit, especially when dealing with timers and animations that can block the main thread or interfere with event delivery. Here are some potential solutions and considerations that could help you manage your tap-and-hold behavior more effect... | 38,393 | [
{
"from": "human",
"value": "I've implemented a tap-and-hold handler using an NSTimer that I first set in the TouchesBegan overload.\nHowever, what I actually want is for an action to be continuously performed in quick-fire succession while the touch is being held. So, on timer expiry I call a handler to do... |
I really need your help in my issue very quickly and it's too close to the previous issue.
I want to call a function using thread from the main thread.
for more explanaition, here is a sample from my code:
// please look to the code begining from ( //------- )
// this function is being called from the Form1 class ... | It looks like you want to run your `GetFromServer` and `GetFromPC` methods in parallel with a timer's tick event, but you're encountering issues with accessing the UI from a different thread.
In Windows Forms, controls can only be accessed from the thread they were created on, which is usually the main UI thread. To ... | 42,219 | [
{
"from": "human",
"value": "I really need your help in my issue very quickly and it's too close to the previous issue.\nI want to call a function using thread from the main thread.\nfor more explanaition, here is a sample from my code:\n// please look to the code begining from ( //------- ) \n // this f... |
I would like to create a simple file format/DSL which would allow my users to input data. My system is in python and using python's parser is appealing.
Syntax like this for defining a data element seems quite convenient.
Allocation(Param1 = Val1, Param2 = Val2 )
However, it does not support param names with spaces.... | Yes, you can create a more user-friendly domain-specific language (DSL) for your configuration format while still leveraging Python’s syntax and parsing capabilities. One approach is to use a custom parsing method with a more flexible syntax while also allowing for spaces in parameter names.
Here's a solution using a ... | 45,936 | [
{
"from": "human",
"value": "I would like to create a simple file format/DSL which would allow my users to input data. My system is in python and using python's parser is appealing. \nSyntax like this for defining a data element seems quite convenient.\nAllocation(Param1 = Val1, Param2 = Val2 )\n\nHowever,... |
My MFC application has a dialogue with a date picker. When I initialise this dialogue, I need to call CDateTimeCtrl::SetTime() and I'm trying to decide what argument to give it. I have an array of integers representing a year, month, day, hour and minute in UTC. Here's the important bit: the date picker must display... | To work with the `CDateTimeCtrl` in your MFC application and ensure that you are displaying and retrieving UTC time correctly, you are on the right track with your considerations about the different types you can use with the `SetTime()` function.
### Using `COleDateTime` for UTC
1. **Using `COleDateTime`:**
Yes, ... | 42,266 | [
{
"from": "human",
"value": "My MFC application has a dialogue with a date picker. When I initialise this dialogue, I need to call CDateTimeCtrl::SetTime() and I'm trying to decide what argument to give it. I have an array of integers representing a year, month, day, hour and minute in UTC. Here's the im... |
According to the documentation, the decimal.Round method uses a round-to-even algorithm which is not common for most applications. So I always end up writing a custom function to do the more natural round-half-up algorithm:
public static decimal RoundHalfUp(this decimal d, int decimals)
{
if (decimals < 0)
{
... | The design decision to use the round-to-even algorithm (also known as "bankers' rounding") in the .NET framework's `decimal.Round` method is based on a few considerations, primarily around statistical neutrality and accuracy in financial calculations.
### Reasons for Using Round-to-Even (Bankers' Rounding)
1. **Stati... | 44,083 | [
{
"from": "human",
"value": "According to the documentation, the decimal.Round method uses a round-to-even algorithm which is not common for most applications. So I always end up writing a custom function to do the more natural round-half-up algorithm:\npublic static decimal RoundHalfUp(this decimal d, int ... |
I've used Slime within Emacs as my primary development environment for Common Lisp (or Aquamacs on OS X), but are there other compelling choices out there? I've heard about Lispworks, but is that [or something else] worth looking at? Or does anyone have tips to getting the most out of Emacs (e.g., hooking it up to the ... | You’re right in noting that SLIME (Superior Lisp Interaction Mode for Emacs) is a very popular and powerful choice for Common Lisp development. Many developers appreciate its deep integration with Emacs, along with features like interactive REPL, debugger integration, and extensive support for various Common Lisp imple... | 43,910 | [
{
"from": "human",
"value": "I've used Slime within Emacs as my primary development environment for Common Lisp (or Aquamacs on OS X), but are there other compelling choices out there? I've heard about Lispworks, but is that [or something else] worth looking at? Or does anyone have tips to getting the most ... |
Goal
Java client for Yahoo's HotJobs Resumé Search REST API.
Background
I'm used to writing web-service clients for SOAP APIs, where wsimport generates proxy stubs and you're off and running. But this is a REST API, which is new to me.
Details
REST API
No WADL
No formal XML schema (XSD or DTD files). There are exampl... | When working with a REST API that lacks formal schema definitions, there are a few approaches you can take to handle XML responses and requests effectively in Java. Below are your options for generating POJOs and managing marshalling/unmarshalling of XML data:
### 1. **Manually Creating POJOs with JAXB Annotations**
C... | 44,284 | [
{
"from": "human",
"value": "Goal\nJava client for Yahoo's HotJobs Resumé Search REST API. \nBackground\nI'm used to writing web-service clients for SOAP APIs, where wsimport generates proxy stubs and you're off and running. But this is a REST API, which is new to me.\nDetails\n\nREST API\nNo WADL\nNo forma... |
I want to centrally locate all of my application settings in the database. I have a database object which stores the app.settings in an XML column. I'd like to have my application read that object and then parse the XML column into its own app settings. Is there any easy way to arbitrarily read an XML object into yo... | Yes, you can read XML data from a database and parse it into your application's settings fairly easily, depending on the technologies you are using. Below, I'll outline a general approach using C# and .NET, but the concepts can be adapted to other programming languages or frameworks.
### Steps to Read XML from Databas... | 45,935 | [
{
"from": "human",
"value": "I want to centrally locate all of my application settings in the database. I have a database object which stores the app.settings in an XML column. I'd like to have my application read that object and then parse the XML column into its own app settings. Is there any easy way ... |
If have created a custom role within SqlServer which I added to the db__denydatareader and db__denydatawriter roles. I think went through the db and granted exec permission to all neccersary stored procedures.
Everything works fine, calling those sps will run fine. The one exception is a stored procedure which execute... | When dealing with dynamic SQL in SQL Server, particularly using `sp_executesql`, the permissions required for the objects being accessed during execution are determined at runtime. This means that if your dynamic SQL references a table for which the user does not have permission, it will fail with a permissions error, ... | 45,826 | [
{
"from": "human",
"value": "If have created a custom role within SqlServer which I added to the db__denydatareader and db__denydatawriter roles. I think went through the db and granted exec permission to all neccersary stored procedures. \nEverything works fine, calling those sps will run fine. The one exc... |
I have an object, and I want to list all the selectors to which it responds. It feels like this should be perfectly possible, but I'm having trouble finding the APIs.
| In Objective-C, if you want to find out all the selectors that an object responds to, you can use the `class_copyMethodList` function provided by the Objective-C runtime. This function allows you to retrieve a list of methods (selectors) implemented by a class. Here's how you can do it:
1. Import the Objective-C runti... | 47,352 | [
{
"from": "human",
"value": "I have an object, and I want to list all the selectors to which it responds. It feels like this should be perfectly possible, but I'm having trouble finding the APIs.\n"
},
{
"from": "gpt",
"value": "In Objective-C, if you want to find out all the selectors that an o... |
I begin a transaction, which is to insert several records into a table. Can I select the latest inserted record out of the database before the transaction commit?
| In a typical database transaction, when you begin a transaction and insert several records, the changes made during that transaction are not visible to other transactions until the transaction is committed. However, depending on the database system you are using, you may or may not be able to see the newly inserted rec... | 48,040 | [
{
"from": "human",
"value": "I begin a transaction, which is to insert several records into a table. Can I select the latest inserted record out of the database before the transaction commit?\n"
},
{
"from": "gpt",
"value": "In a typical database transaction, when you begin a transaction and ins... |
Our software is built on linux and windows platforms. Depending on the preference of the developer a contribution is developed and tested on either platform and then committed to our subversion repository. It then turns out that the contribution doesn't build on the other platform, and a fix has to be made. The fix on ... | To implement a solution that allows for pre-commit checks on a different platform before contributions are committed to your Subversion repository, you can follow these steps:
### 1. Set Up a Pre-Commit Hook
1. **Create a Pre-Commit Hook Script**:
- Write a script that will be executed during the pre-commit phase.... | 44,446 | [
{
"from": "human",
"value": "Our software is built on linux and windows platforms. Depending on the preference of the developer a contribution is developed and tested on either platform and then committed to our subversion repository. It then turns out that the contribution doesn't build on the other platfo... |
I am developing web services in C# using WCF and I want to create a custom way of handling security. I have found this way to retrieve the username out of the soap message that was sent to web service:
String username = System.ServiceModel.ServiceSecurityContext.Current.PrimaryIdentity.Name;
I was wondering if there w... | In WCF (Windows Communication Foundation), retrieving the password directly from the SOAP message is not a recommended practice, as it poses significant security risks. Passwords should be handled with care, and the WCF framework provides several ways to manage authentication and authorization securely.
### 1. Use Cus... | 44,685 | [
{
"from": "human",
"value": "I am developing web services in C# using WCF and I want to create a custom way of handling security. I have found this way to retrieve the username out of the soap message that was sent to web service:\nString username = System.ServiceModel.ServiceSecurityContext.Current.Primary... |
As we all know, global data, like the locale settings affecting the numeric decimal point printf() and strtod() are using, is evil. Fortunately, MSVC++ 9 allows to use per-thread locales by a _configthreadlocale(_ENABLE_PER_THREAD_LOCALE) call. Unfortunately, it seems that the localeconv() function does not notice this... | The behavior you're observing with `localeconv()` returning the global locale settings despite having configured per-thread locales via `_configthreadlocale(_ENABLE_PER_THREAD_LOCALE)` is expected and is a known limitation in MSVC's implementation.
In Microsoft Visual C++ (MSVC), the `localeconv()` function is designe... | 44,362 | [
{
"from": "human",
"value": "As we all know, global data, like the locale settings affecting the numeric decimal point printf() and strtod() are using, is evil. Fortunately, MSVC++ 9 allows to use per-thread locales by a _configthreadlocale(_ENABLE_PER_THREAD_LOCALE) call. Unfortunately, it seems that the l... |
I currently have a collection with a HasChanges property on it (each object in the collection also has its own HasChanges property) and the collection is the source of my CollectionViewSource.
When I try to databind the HasChanges property of the collection behind the CollectionViewSource to one of my custom controls, ... | To bind the `HasChanges` property of your custom control to the `HasChanges` property of the collection itself, rather than the currently selected item in the `CollectionViewSource`, you need to specify the binding source correctly. The default behavior of a `CollectionViewSource` in WPF is to use the selected item for... | 47,264 | [
{
"from": "human",
"value": "I currently have a collection with a HasChanges property on it (each object in the collection also has its own HasChanges property) and the collection is the source of my CollectionViewSource.\nWhen I try to databind the HasChanges property of the collection behind the Collectio... |
Update - for those of a facetious frame of mind, you can assume that Aggregate still produces the normal result whatever function is passed to it, including in the case being optimized.
I wrote this program to build a long string of integers from 0 to 19999 separate by commas.
using System;
using System.Linq;
using Sys... | It seems like you're hinting at an implementation in the `MakeAggregateGoFaster` namespace that significantly optimizes the string concatenation process within the `Aggregate` method. In C#, string concatenation using `+` creates new string instances, which can be costly in terms of performance, particularly when conca... | 43,356 | [
{
"from": "human",
"value": "Update - for those of a facetious frame of mind, you can assume that Aggregate still produces the normal result whatever function is passed to it, including in the case being optimized.\nI wrote this program to build a long string of integers from 0 to 19999 separate by commas.\... |
I'm doing research on some non-brittle release process techniques in a 24x7x365 web service environment. What are some of your favorite methods for releasing code from a development environment to a critical-production environment. This includes not only code changes -- but also database schema changes. Let's assume th... | Releasing code in a non-brittle manner in a critical 24x7x365 web service environment involves careful planning and execution. Here are some techniques and steps that can streamline the deployment process, ensuring minimal disruption and smooth transitions:
### 1. Blue-Green Deployments
- **Setup**: Maintain two ident... | 43,284 | [
{
"from": "human",
"value": "I'm doing research on some non-brittle release process techniques in a 24x7x365 web service environment. What are some of your favorite methods for releasing code from a development environment to a critical-production environment. This includes not only code changes -- but also... |
i’m trying to create a url string that works like this:
/app/process/example.com/index.html
so in other words,
/app/process/$URL
i then retrieve the url with
$this->uri->segment(3);
the forward slashes in the URL will of course be a problem accessing uri segments, so i’ll go ahead and url encode the URL portion:
/a... | In CodeIgniter (CI), the default URI routing system uses slashes (`/`) to delineate segments of the URI. When you URL encode a forward slash into `%2F`, it will still be treated as a segment separator rather than part of the segment itself, leading to issues like the one you’re experiencing.
To solve this, you have a ... | 44,957 | [
{
"from": "human",
"value": "i’m trying to create a url string that works like this:\n/app/process/example.com/index.html\n\nso in other words,\n/app/process/$URL\n\ni then retrieve the url with \n$this->uri->segment(3);\n\nthe forward slashes in the URL will of course be a problem accessing uri segments, s... |
A couple of years ago the media was rife with all sorts of articles on
how the idea of code reuse was a simple way to improve productivity
and code quality.
From the blogs and sites I check on a regular basis it seems as though
the idea of "code reuse" has gone out of fashion. Perhaps the 'code
reuse' advocates have al... | Code reuse has been a topic of discussion in software development for many years, with varying levels of enthusiasm depending on trends, methodologies, and experiences in the industry. Your observations touch upon several important aspects of code reuse, especially regarding internal practices within organizations.
##... | 45,192 | [
{
"from": "human",
"value": "A couple of years ago the media was rife with all sorts of articles on\nhow the idea of code reuse was a simple way to improve productivity\nand code quality.\nFrom the blogs and sites I check on a regular basis it seems as though\nthe idea of \"code reuse\" has gone out of fash... |
I normally in my projects use such these code:
If user.IsInRole("Admin") Then
deleteButton.Visible = True
else
deleteButton.Visible = False
But I want to control roles, which can see this button in database.
For this purpose how should database design be?
Thanks.
| To control the visibility of the `deleteButton` based on user roles stored in a database, you'll need to design your database schema appropriately. Here's a simple approach to achieve this:
### Database Schema Design
1. **Users Table**: This table will store user information.
- `UserId` (Primary Key)
- `Usernam... | 44,378 | [
{
"from": "human",
"value": "I normally in my projects use such these code:\nIf user.IsInRole(\"Admin\") Then \n deleteButton.Visible = True \nelse \n deleteButton.Visible = False\n\nBut I want to control roles, which can see this button in database.\nFor this purpose how should database design be?\nThank... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.