instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
How can I display a calendar control (date picker) in Oracle forms 9/10?
| In Oracle Forms 9i and 10g, you can display a calendar control (also known as a date picker) by using the built-in Calendar control feature. Here's how you can implement a date picker in Oracle Forms:
### Step 1: Create a Date Item
1. **Open Oracle Forms Builder.**
2. **Create a new form or open an existing one.**
3. ... | 21,466 | [
{
"from": "human",
"value": "How can I display a calendar control (date picker) in Oracle forms 9/10?\n"
},
{
"from": "gpt",
"value": "In Oracle Forms 9i and 10g, you can display a calendar control (also known as a date picker) by using the built-in Calendar control feature. Here's how you can i... |
This a bit of strange one.... We have an internal web app that runs on server (A) and a document repository that runs on server (B).
I have simple link on a page and I want to enable the user to download a document(From IIS Server (A)). However this document does not exist on Server (A) until the user clicks the butto... | It sounds like you're trying to implement a workflow where a user can request a document from Server B through Server A, and then have that document available for download. The challenge you're facing, especially with Internet Explorer 7, relates to how IE handles file downloads and security settings.
### Here are som... | 17,125 | [
{
"from": "human",
"value": "This a bit of strange one.... We have an internal web app that runs on server (A) and a document repository that runs on server (B). \nI have simple link on a page and I want to enable the user to download a document(From IIS Server (A)). However this document does not exist on ... |
Is it possible to make such buttons (http://img225.imageshack.us/img225/6452/buttonslw9.jpg) using CSS? It should be Menu, and PHP would just feed the text to html/css and css should take care of the design.
Maybe I want too much out of CSS - especially with that red outline of the text.. ? Any ideas how i can achieve... | Yes, you can definitely create buttons similar to the ones shown in your example using CSS! While CSS does have its limitations in terms of creating complex designs, you can use a combination of properties to achieve a similar look. Here's an example of how you might create buttons that look like those in the image usi... | 18,586 | [
{
"from": "human",
"value": "Is it possible to make such buttons (http://img225.imageshack.us/img225/6452/buttonslw9.jpg) using CSS? It should be Menu, and PHP would just feed the text to html/css and css should take care of the design. \nMaybe I want too much out of CSS - especially with that red outline o... |
In T-SQL, you can do this:
SELECT ProductId, COALESCE(Price, 0)
FROM Products
How do you do the same thing in Access SQL? I see examples for doing it with Nz in VBA, but I'm looking for the SQL equivalent.
Thanks.
| In Access SQL, you can achieve similar functionality to T-SQL's `COALESCE` using the `Nz` function. The `Nz` function is specifically designed to handle `NULL` values in Access SQL.
To use the `Nz` function in an Access SQL query, you would write your SQL statement like this:
```sql
SELECT ProductId, Nz(Price, 0) AS ... | 25,069 | [
{
"from": "human",
"value": "In T-SQL, you can do this:\nSELECT ProductId, COALESCE(Price, 0)\nFROM Products\n\nHow do you do the same thing in Access SQL? I see examples for doing it with Nz in VBA, but I'm looking for the SQL equivalent.\nThanks.\n"
},
{
"from": "gpt",
"value": "In Access SQL... |
I'm about to put a beta version of the site I'm working on up on the web. It needs to have a beta code to restrict access. The site is written in django.
I don't want to change the fundamental Auth system to accommodate a beta code, and I don't care particularly that the security of the beta code is iron-clad, just tha... | Your implementation of the `BetaMiddleware` class looks solid for restricting access to your Django application using a beta code. This approach allows you to add a simple mechanism to require users to input the beta code without modifying every view in your large project. Here’s how you can enhance this middleware and... | 14,126 | [
{
"from": "human",
"value": "I'm about to put a beta version of the site I'm working on up on the web. It needs to have a beta code to restrict access. The site is written in django.\nI don't want to change the fundamental Auth system to accommodate a beta code, and I don't care particularly that the securi... |
I'm trying to implement Drag & Drop functionality with source being a TreeView control. When I initiate a drag on a node, I'm getting:
Invalid FORMATETC structure (Exception from HRESULT: 0x80040064 (DV_E_FORMATETC))
The ItemDrag handler (where the exception takes place), looks like:
private void treeView_ItemDrag(obje... | The error you're encountering, "Invalid FORMATETC structure," typically occurs when the data you are trying to drag does not have a proper format defined for the drag-and-drop operation. In your case, when you call `this.DoDragDrop(e.Item, DragDropEffects.Move);`, you're passing the `e.Item`, which is likely a referenc... | 19,431 | [
{
"from": "human",
"value": "I'm trying to implement Drag & Drop functionality with source being a TreeView control. When I initiate a drag on a node, I'm getting:\nInvalid FORMATETC structure (Exception from HRESULT: 0x80040064 (DV_E_FORMATETC))\nThe ItemDrag handler (where the exception takes place), look... |
How do I generate a range of consecutive numbers (one per line) from a MySQL query so that I can insert them into a table?
For example:
nr
1
2
3
4
5
I would like to use only MySQL for this (not PHP or other languages).
| You can generate a range of consecutive numbers in MySQL using a Common Table Expression (CTE) or a recursive CTE, depending on the version of MySQL you are using. Here’s how you can do it in MySQL:
### Using Recursive CTE (MySQL 8.0 and above)
If you're using MySQL 8.0 or later, you can create a recursive CTE to gen... | 19,316 | [
{
"from": "human",
"value": "How do I generate a range of consecutive numbers (one per line) from a MySQL query so that I can insert them into a table?\nFor example:\nnr\n1\n2\n3\n4\n5\n\nI would like to use only MySQL for this (not PHP or other languages).\n"
},
{
"from": "gpt",
"value": "You c... |
Seems like the subtraction is triggering some kind of issue and the resulting value is wrong.
double tempCommission = targetPremium.doubleValue()*rate.doubleValue()/100d;
78.75 = 787.5 * 10.0/100d
double netToCompany = targetPremium.doubleValue() - tempCommission;
708.75 = 787.5 - 78.75
double dCommission = request.g... | The issue you're experiencing with floating-point arithmetic in Java (and many other programming languages) is due to the way that decimal numbers are represented in binary. This can lead to precision issues when performing arithmetic operations.
### Here's a breakdown of the problem:
1. **Floating Point Precision**:... | 20,042 | [
{
"from": "human",
"value": "Seems like the subtraction is triggering some kind of issue and the resulting value is wrong.\ndouble tempCommission = targetPremium.doubleValue()*rate.doubleValue()/100d;\n\n78.75 = 787.5 * 10.0/100d\ndouble netToCompany = targetPremium.doubleValue() - tempCommission;\n\n708.75... |
I have a python module that makes use of a huge dictionary global variable, currently I put the computation code in the top section, every first time import or reload of the module takes more then one minute which is totally unacceptable. How can I save the computation result somewhere so that the next import/reload do... | If you're facing issues with the performance of the computation on initial import and want to cache the results for subsequent imports or reloads, here are some strategies you might consider:
### 1. Cache the Results to Disk
Since you've mentioned that using `cPickle` (or `pickle` in Python 3) takes about the same ti... | 20,241 | [
{
"from": "human",
"value": "I have a python module that makes use of a huge dictionary global variable, currently I put the computation code in the top section, every first time import or reload of the module takes more then one minute which is totally unacceptable. How can I save the computation result so... |
I need to have a working web browser in a fullscreen Direct3D application. For example, Valve's Source-based games (sort of) do it in the MotD window when you join a server. Any tips on where to look?
| Integrating a web browser into a fullscreen Direct3D application can be quite complex, but there are a few approaches you can take. Here are some tips and technologies to consider:
### 1. **Use a Browser Engine or Library**
You can embed a web browser into your application using a suitable library. Here are some popul... | 19,175 | [
{
"from": "human",
"value": "I need to have a working web browser in a fullscreen Direct3D application. For example, Valve's Source-based games (sort of) do it in the MotD window when you join a server. Any tips on where to look?\n"
},
{
"from": "gpt",
"value": "Integrating a web browser into ... |
Presently, we've got several main projects each in their own repository. We will have to version-control up to a dozen additional projects. VisualSVN recommends to create 1 respository for our company and then vc all projects inside that.
It's a good practice to create one repository for the entire company or departm... | When you consolidate multiple projects into a single Subversion (SVN) repository, managing post-commit hooks can become more complex. However, it is definitely feasible to execute different actions based on which project has changes. Here’s how you can approach this:
### 1. Structure Your Repository
To effectively man... | 17,041 | [
{
"from": "human",
"value": "Presently, we've got several main projects each in their own repository. We will have to version-control up to a dozen additional projects. VisualSVN recommends to create 1 respository for our company and then vc all projects inside that. \n\nIt's a good practice to create one r... |
In java, when using SimpleDateFormat with the pattern:
yyyy-MM-dd'T'HH:mm:ss.SSSZ
the date is outputted as:
"2002-02-01T18:18:42.703-0700"
In xquery, when using the xs:dateTime function, it gives the error:
"Invalid lexical value [err:FORG0001]"
with the above date. In order for xquery to parse properly, the date ne... | To format a date in Java using `SimpleDateFormat` so that it produces the desired output with a colon in the time zone (as required by the ISO 8601 format for XQuery), you can use the following approach:
1. Create a `SimpleDateFormat` instance with the appropriate pattern.
2. Manually handle the timezone formatting to... | 20,280 | [
{
"from": "human",
"value": "In java, when using SimpleDateFormat with the pattern:\nyyyy-MM-dd'T'HH:mm:ss.SSSZ\n\nthe date is outputted as:\n\"2002-02-01T18:18:42.703-0700\"\n\nIn xquery, when using the xs:dateTime function, it gives the error:\n\"Invalid lexical value [err:FORG0001]\"\n\nwith the above da... |
Is there some general guidelines online on how to tweak oracle for doing a high number of inserts and low number of reads?
All the answers below are pretty good recommendations. I have to clarify the following things. I am using 10g and this is an absolute requirement that we use Oracle. I am also more interested in or... | Optimizing Oracle for a workload characterized by a high volume of inserts and a low volume of reads involves adjusting various instance parameters and considering specific tuning techniques. Below are some general guidelines and recommendations specifically for Oracle 10g:
### Instance Parameters
1. **Memory Managem... | 18,197 | [
{
"from": "human",
"value": "Is there some general guidelines online on how to tweak oracle for doing a high number of inserts and low number of reads?\nAll the answers below are pretty good recommendations. I have to clarify the following things. I am using 10g and this is an absolute requirement that we u... |
How can you use a ListView to show the user a collection of objects, and to manage those objects?
| Using a `ListView` to display a collection of objects and manage them involves several steps. Below is a general approach that can be adapted based on the specific technology stack you are using (for example, WPF, WinForms, or a web framework like React or Angular). Here, I'll outline the process in a WPF (Windows Pres... | 15,772 | [
{
"from": "human",
"value": "How can you use a ListView to show the user a collection of objects, and to manage those objects?\n"
},
{
"from": "gpt",
"value": "Using a `ListView` to display a collection of objects and manage them involves several steps. Below is a general approach that can be ad... |
Basically I wanted to do something like git push mybranch to repo1, repo2, repo3
right now I'm just typing push many times, and if I'm in a hurry to the the pushing done, I just send them all to the background git push repo1 & git push repo2 &
I'm just wondering if git natively supports what I want to do, or if maybe t... | Git does not natively support pushing to multiple remotes with a single command in the way you are looking for. However, there are some ways to achieve this behavior using scripts or by configuring your repository in a particular way. Here are a few options:
### Option 1: Using a Script
You can create a simple shell ... | 18,328 | [
{
"from": "human",
"value": "Basically I wanted to do something like git push mybranch to repo1, repo2, repo3\nright now I'm just typing push many times, and if I'm in a hurry to the the pushing done, I just send them all to the background git push repo1 & git push repo2 &\nI'm just wondering if git nativel... |
One of my co-workers claims that even though the execution path is cached, there is no way parameterized SQL generated from an ORM is as quick as a stored procedure. Any help with this stubborn developer?
| Your co-worker's assertion that parameterized SQL generated from an ORM (Object-Relational Mapping) is not as fast as a stored procedure is a common viewpoint, but it's important to unpack this statement and consider several factors.
### Understanding Execution Plans
1. **Execution Plan Caching**:
- Both parameter... | 19,470 | [
{
"from": "human",
"value": "One of my co-workers claims that even though the execution path is cached, there is no way parameterized SQL generated from an ORM is as quick as a stored procedure. Any help with this stubborn developer?\n"
},
{
"from": "gpt",
"value": "Your co-worker's assertion th... |
I am having a trouble matching a string in a MySQL-query with the following regex:
I want it to match to this string: "Rue de l' Harmonie"
SELECT
id,
street_name
FROM
street_names
WHERE
street_name REGEXP '^(rue[a-z]+[[:blank:]])((du|de|la|des|d[\']|l[\'])[[:blank:]])*[[:<:]]HARMONIE$'
Anybody can give me a hi... | The regex you provided has a few issues, and it may not properly match the string "Rue de l' Harmonie" as intended. Let's break down what you need to match and adjust your regex accordingly.
1. **Case Sensitivity**: MySQL regex is case sensitive by default. You will want to ensure that your regex can match "Harmonie" ... | 16,420 | [
{
"from": "human",
"value": "I am having a trouble matching a string in a MySQL-query with the following regex:\nI want it to match to this string: \"Rue de l' Harmonie\"\nSELECT\n id,\n street_name\nFROM\n street_names\nWHERE\n street_name REGEXP '^(rue[a-z]+[[:blank:]])((du|de|la|des|d[\\']|l[\\'])[[:... |
I'd like to open the intelligence window without typing a character and then backspacing it. I can't seem to remember the shortcut for this. What is it?
| To open the IntelliSense (or "intelligence window") in many code editors or IDEs like Visual Studio, you can often use the shortcut `Ctrl + Space`. This should bring up the suggestion list without needing to type a character first. If you're using a different environment, let me know, and I can provide specific shortcu... | 25,690 | [
{
"from": "human",
"value": "I'd like to open the intelligence window without typing a character and then backspacing it. I can't seem to remember the shortcut for this. What is it? \n"
},
{
"from": "gpt",
"value": "To open the IntelliSense (or \"intelligence window\") in many code editors or ID... |
We run an old Windows NT Machine, fully patched running IIS4.0.
Today we were hit by "linuXploit_crew", and they took down our websites for a minute or two. (luckily we were quick to notice a change on the websites and fix it within minutes of the attack).
However -- After fixing the website, I'm left with trying to fi... | Dealing with security incidents can be challenging, especially on legacy systems like Windows NT with IIS 4.0. Here are some steps you can take to investigate how the "linuXploit_crew" may have compromised your web server:
1. **Review Event Logs**:
- Examine the Windows Event Logs, especially the Application, Secur... | 19,007 | [
{
"from": "human",
"value": "We run an old Windows NT Machine, fully patched running IIS4.0.\nToday we were hit by \"linuXploit_crew\", and they took down our websites for a minute or two. (luckily we were quick to notice a change on the websites and fix it within minutes of the attack).\nHowever -- After f... |
I was writing some Unit tests last week for a piece of code that generated some SQL statements.
I was trying to figure out a regex to match SELECT, INSERT and UPDATE syntax so I could verify that my methods were generating valid SQL, and after 3-4 hours of searching and messing around with various regex editors I gave ... | Creating a regex pattern to match SQL statements like `SELECT`, `INSERT`, and `UPDATE` can be challenging, especially when you need to account for quoted strings and various whitespace characters. Regex can get quite complex when you try to ensure accurate matching without falling into the trap of greedy matches.
Here... | 16,375 | [
{
"from": "human",
"value": "I was writing some Unit tests last week for a piece of code that generated some SQL statements.\nI was trying to figure out a regex to match SELECT, INSERT and UPDATE syntax so I could verify that my methods were generating valid SQL, and after 3-4 hours of searching and messing... |
I've seen the question (and answer) when posed for MS SQL Server, though I don't yet know of one for Oracle and PL/SQL. Are there xUnit style testing frameworks for Oracle's PL/SQL? What are they?
| Yes, there are several xUnit style testing frameworks available for Oracle PL/SQL that facilitate unit testing. Here are some popular ones:
1. **UTPLSQL**:
- UTPLSQL is one of the most widely used testing frameworks for PL/SQL. It follows a structure similar to xUnit frameworks, allowing you to write test cases for... | 19,866 | [
{
"from": "human",
"value": "I've seen the question (and answer) when posed for MS SQL Server, though I don't yet know of one for Oracle and PL/SQL. Are there xUnit style testing frameworks for Oracle's PL/SQL? What are they?\n"
},
{
"from": "gpt",
"value": "Yes, there are several xUnit style ... |
I have pushed my .htaccess files to the production severs, but they don't work. Would a restart be the next step, or should I check something else.
| Before considering a server restart, there are several troubleshooting steps you can take to resolve issues with your `.htaccess` files:
1. **Check Syntax**: Ensure that your `.htaccess` file does not contain any syntax errors. A simple typo can cause the entire file to be ignored.
2. **File Permissions**: Verify tha... | 19,713 | [
{
"from": "human",
"value": "I have pushed my .htaccess files to the production severs, but they don't work. Would a restart be the next step, or should I check something else.\n"
},
{
"from": "gpt",
"value": "Before considering a server restart, there are several troubleshooting steps you can t... |
If you launch Emacs using the -nw flag to force a console session (rather than an X session if you have X windows running), how do you get to the menu?
There are some items held in the menus that are infrequently-enough used on my part that I don't recall the escape or control sequence to do them.
| When you launch Emacs in a terminal using the `-nw` (no window) flag, the menu bar is not displayed by default. However, you can still access the menus using keyboard shortcuts. Here are a few ways to do so:
1. **Accessing the Menu Bar**:
You can access the menu bar in terminal Emacs by pressing `C-m` (Control + m)... | 21,438 | [
{
"from": "human",
"value": "If you launch Emacs using the -nw flag to force a console session (rather than an X session if you have X windows running), how do you get to the menu?\nThere are some items held in the menus that are infrequently-enough used on my part that I don't recall the escape or control ... |
While Scrum is easy in theory and hard in practice, I wanted to hear your definition of Done; i.e. what are the gates (unit test, code coverage > 80%, code reviews, load tests, perf.test, functional tests, etc.) your product has to go through before you can label the product "Done"
| The "Definition of Done" (DoD) in Scrum is crucial as it establishes the criteria that a product increment must meet to be considered complete. It helps ensure quality and provides a shared understanding among the team members. Here’s a comprehensive definition that incorporates various elements often included in a typ... | 18,808 | [
{
"from": "human",
"value": "While Scrum is easy in theory and hard in practice, I wanted to hear your definition of Done; i.e. what are the gates (unit test, code coverage > 80%, code reviews, load tests, perf.test, functional tests, etc.) your product has to go through before you can label the product \"D... |
What if a Java allow both static and dynamic types. That might allow the best of both worlds. i.e.:
String str = "Hello";
var temp = str;
temp = 10;
temp = temp * 5;
Would that be possible?
Would that be beneficial?
Do any languages currently support both and how well does it work out?
Here is a better example (gene... | Java traditionally uses a strong static type system, which means that type checking is done at compile time. However, the introduction of the `var` keyword in Java 10 allows for local variable type inference, which lets the compiler infer the type of a variable from the context. This is still fundamentally a static typ... | 14,645 | [
{
"from": "human",
"value": "What if a Java allow both static and dynamic types. That might allow the best of both worlds. i.e.:\nString str = \"Hello\";\nvar temp = str;\ntemp = 10;\ntemp = temp * 5;\n\n\nWould that be possible?\nWould that be beneficial?\nDo any languages currently support both and how we... |
Has someone ever measured performance of Sequential Guid vs. Standard Guid when used as Primary Keys inside a database?
I do not see the need for unique keys to be guessable or not, passing them from a web UI or in some other part seems a bad practice by itself and I do not see, if you have security concerns, how usin... | The performance implications of using Sequential GUIDs versus Standard GUIDs as primary keys in a database can be significant, and there have been various studies and anecdotal reports on this topic. Here's a general summary of the key points regarding performance, security, and best practices when it comes to GUIDs in... | 20,086 | [
{
"from": "human",
"value": "Has someone ever measured performance of Sequential Guid vs. Standard Guid when used as Primary Keys inside a database?\n\nI do not see the need for unique keys to be guessable or not, passing them from a web UI or in some other part seems a bad practice by itself and I do not s... |
I'm trying to debug a deadlock in a multi-threaded Python application after it has locked up. Is there a way to attach a debugger to inspect the state of the process?
Edit: I'm attempting this on Linux, but it would be great if there were a cross-platform solution. It's Python after all :)
| Debugging deadlocks in a multi-threaded Python application can be challenging, but there are ways to inspect the state of your application and analyze what's happening at the time it has locked up. Below are some methods to attach a debugger and inspect the state of the process, which should work on Linux and can be us... | 14,733 | [
{
"from": "human",
"value": "I'm trying to debug a deadlock in a multi-threaded Python application after it has locked up. Is there a way to attach a debugger to inspect the state of the process? \nEdit: I'm attempting this on Linux, but it would be great if there were a cross-platform solution. It's Pyt... |
If you had to fix and stabilize a MVC application, where would you start: the Model, Controller or View? The problems are spread equally throughout the application, with bad programming practices that make it hard to add functionality.
The application is written in PHP if it makes a difference.
| When faced with an MVC application that suffers from issues spread throughout the Model, Controller, and View components, the approach to fixing and stabilizing the application should be systematic and prioritized. Here are the steps I would recommend, focusing on the most effective way to address the problems:
1. **A... | 19,381 | [
{
"from": "human",
"value": "If you had to fix and stabilize a MVC application, where would you start: the Model, Controller or View? The problems are spread equally throughout the application, with bad programming practices that make it hard to add functionality.\nThe application is written in PHP if it m... |
Sample code that shows how to create threads using MFC declares the thread function as both static and __cdecl. Why is the latter required? Boost threads don't bother with this convention, so is it just an anachronism?
For example (MFC):
static __cdecl UINT MyFunc(LPVOID pParam)
{
...
}
CWinThread* pThread = AfxBegi... | In the context of MFC (Microsoft Foundation Classes), the `__cdecl` calling convention is used for defining the thread function for the following reasons:
1. **Calling Convention**: The `__cdecl` calling convention defines how a function receives its parameters from the caller. It specifies that the caller is responsi... | 20,272 | [
{
"from": "human",
"value": "Sample code that shows how to create threads using MFC declares the thread function as both static and __cdecl. Why is the latter required? Boost threads don't bother with this convention, so is it just an anachronism?\nFor example (MFC):\nstatic __cdecl UINT MyFunc(LPVOID pPa... |
Does anyone have or know best practices for implementing a custom layout engine in WinForms? I've seen the windowsclient.net link, but it's a bit dated (Sept 2001).
| Implementing a custom layout engine in WinForms can be quite complex but rewarding if you need more control over the positioning and sizing of controls. Here are some best practices you can follow when creating a custom layout engine in WinForms:
### 1. **Understand the Layout Events**
- Familiarize yourself with t... | 19,256 | [
{
"from": "human",
"value": "Does anyone have or know best practices for implementing a custom layout engine in WinForms? I've seen the windowsclient.net link, but it's a bit dated (Sept 2001).\n"
},
{
"from": "gpt",
"value": "Implementing a custom layout engine in WinForms can be quite complex... |
Using classic templates, publishing via FTP to a custom domain.
I want to add custom elements such as:
a tree view for archived posts (expanding using CSS/JavaScript)
a tag cloud
a slideshow of images
| To implement custom elements like a tree view for archived posts, a tag cloud, and a slideshow of images on your website that is being published via FTP to a custom domain, you can follow the guidelines below. Each element will require a combination of HTML, CSS, and JavaScript.
### 1. Tree View for Archived Posts
##... | 9,875 | [
{
"from": "human",
"value": "Using classic templates, publishing via FTP to a custom domain.\nI want to add custom elements such as:\n\na tree view for archived posts (expanding using CSS/JavaScript)\na tag cloud\na slideshow of images\n\n"
},
{
"from": "gpt",
"value": "To implement custom eleme... |
Want my FireFox at work to be in sync with my FireFox at my home. Is there a way to simply export all extensions and settings?
| Yes, you can synchronize your Firefox settings, bookmarks, history, passwords, and extensions between devices using a Firefox account. However, there is no built-in feature to directly export and import extensions and settings between different installations. Here's how you can set up synchronization:
### Step 1: Crea... | 20,796 | [
{
"from": "human",
"value": "Want my FireFox at work to be in sync with my FireFox at my home. Is there a way to simply export all extensions and settings?\n"
},
{
"from": "gpt",
"value": "Yes, you can synchronize your Firefox settings, bookmarks, history, passwords, and extensions between devic... |
We have several common libs. Ideally we want them all to use the latest version of a dll even if they have been compiled against an older different version (assume the latest version is backward compatible)
e.g we have:
Project dll
Common controls dll
Logging dll
Database access dll
Project and common controls referen... | When you have multiple components (DLLs) in a .NET application that reference different versions of the same dependency (like your Database Access DLL), the behavior of the .NET runtime is determined by a process called binding. Here’s how it generally works in .NET and some strategies you can use:
### 1. Binding Redi... | 18,930 | [
{
"from": "human",
"value": "We have several common libs. Ideally we want them all to use the latest version of a dll even if they have been compiled against an older different version (assume the latest version is backward compatible)\ne.g we have:\n\nProject dll\nCommon controls dll\nLogging dll\nDatabase... |
I have a factory class that populates objects with data. I want to implementing saving from the object, but do not want to populate the object with db stuff - is it stupid to have my Factory that creates the class also save the data?
ie: in my .Save() method on the object i would call Factory.Save(myObject);
| It's not inherently "stupid" to have your factory handle the saving of objects, but it can lead to some design challenges and potential violations of design principles. Let's break down a few considerations:
### Separation of Concerns
1. **Single Responsibility Principle**: Ideally, your classes should have a single r... | 16,966 | [
{
"from": "human",
"value": "I have a factory class that populates objects with data. I want to implementing saving from the object, but do not want to populate the object with db stuff - is it stupid to have my Factory that creates the class also save the data?\nie: in my .Save() method on the object i wo... |
Suppose you have a collection of Foo classes:
class Foo
{
public string Bar;
public string Baz;
}
List<Foo> foolist;
And you want to check this collection to see if another entry has a matching Bar.
bool isDuplicate = false;
foreach (Foo f in foolist)
{
if (f.Bar == SomeBar)
{
isDuplicate =... | In .NET 2.0, you can achieve this by using the `foreach` loop as you have done, but to improve the readability and conciseness of your code, you can use a method to encapsulate the duplicate checking logic. Unfortunately, .NET 2.0 doesn't have LINQ, which would have allowed you to use more concise syntax.
However, you... | 18,490 | [
{
"from": "human",
"value": "Suppose you have a collection of Foo classes:\nclass Foo\n{\n public string Bar;\n public string Baz;\n}\n\nList<Foo> foolist;\n\nAnd you want to check this collection to see if another entry has a matching Bar.\nbool isDuplicate = false;\nforeach (Foo f in foolist)\n{\n ... |
I'm developing non-interactive cpu-bound application which does only computations, almost no IO. Currently it works too long and while I'm working on improving the algorithm, I also think if it can give any benefit to change language or platform. Currently it is C++ (no OOP so it is almost C) on windows compiled with I... | Switching to Assembly Language (ASM) can potentially provide performance benefits, but it is also associated with significant trade-offs, including increased complexity, decreased maintainability, and a longer development time. Here are some key points to consider regarding your specific situation:
### Performance of ... | 18,480 | [
{
"from": "human",
"value": "I'm developing non-interactive cpu-bound application which does only computations, almost no IO. Currently it works too long and while I'm working on improving the algorithm, I also think if it can give any benefit to change language or platform. Currently it is C++ (no OOP so i... |
I've got an UberJar with all my java classes, but want to execute this jar with an external persistence.xml file. Per the specification, Hibernate (or any other JPA provider) looks for the persistence.xml file in any META-INF folder that's on the classpath, but I haven't been able to make this work with an UberJar. A... | When dealing with an UberJar (also known as a fat jar), it can be a bit tricky to work with external configuration files like `persistence.xml`, because typically all classes and resources are bundled into the jar file itself. However, it is possible to externalize the `persistence.xml` file so that the JPA provider (l... | 21,704 | [
{
"from": "human",
"value": "I've got an UberJar with all my java classes, but want to execute this jar with an external persistence.xml file. Per the specification, Hibernate (or any other JPA provider) looks for the persistence.xml file in any META-INF folder that's on the classpath, but I haven't been a... |
What's the best and most efficient way to count keywords in JavaScript? Basically, I'd like to take a string and get the top N words or phrases that occur in the string, mainly for the use of suggesting tags. I'm looking more for conceptual hints or links to real-life examples than actual code, but I certainly wouldn't... | You're on the right track with using the `split()` function to break the string into individual words and employing regular expressions to clean up punctuation and handle case insensitivity. Here’s a general approach along with some conceptual hints:
### Conceptual Steps
1. **Normalize the Text**:
- Convert the en... | 17,615 | [
{
"from": "human",
"value": "What's the best and most efficient way to count keywords in JavaScript? Basically, I'd like to take a string and get the top N words or phrases that occur in the string, mainly for the use of suggesting tags. I'm looking more for conceptual hints or links to real-life examples t... |
I have been looking at various dependency injection frameworks for .NET as I feel the project I am working on would greatly benefit from it. While I think I have a good grasp of the capabilities of these frameworks, I am still a little unclear on how best to introduce them into a large system. Most demos (understandabl... | Great questions! Introducing Dependency Injection (DI) into a large .NET system can be quite challenging, but it's definitely worth the effort for the benefits it brings in terms of maintainability, testability, and flexibility. Here are answers to your three questions:
### 1. Common but Uninteresting Dependencies
Fo... | 18,341 | [
{
"from": "human",
"value": "I have been looking at various dependency injection frameworks for .NET as I feel the project I am working on would greatly benefit from it. While I think I have a good grasp of the capabilities of these frameworks, I am still a little unclear on how best to introduce them into ... |
Visual Studio includes support for __forceinline. The Microsoft Visual Studio 2005 documentation states:
The __forceinline keyword overrides
the cost/benefit analysis and relies
on the judgment of the programmer
instead.
This raises the question: When is the compiler's cost/benefit analysis wrong? And, how am... | The `__forceinline` keyword in Microsoft Visual Studio allows developers to enforce inlining of functions, even if the compiler's optimization analysis deems that inlining would not be beneficial. While the compiler generally makes very good decisions based on its analysis of the code, there are certain scenarios where... | 19,857 | [
{
"from": "human",
"value": "Visual Studio includes support for __forceinline. The Microsoft Visual Studio 2005 documentation states:\n\nThe __forceinline keyword overrides\n the cost/benefit analysis and relies\n on the judgment of the programmer\n instead.\n\nThis raises the question: When is the comp... |
The project is ASP.NET 2.0, I have never been able to reproduce this myself, but I get emails informing me it happens to clients many times a week, often a few times in a row.
Here is the full error:
Exception Details:
Microsoft.Reporting.WebForms.AspNetSessionExpiredException: ASP.NET session has expired
Stack Trac... | The `AspNetSessionExpiredException` indicates that the ASP.NET session has expired, which is a common issue in web applications where users may leave the application idle for a period longer than the session timeout. When they try to perform an action that requires a valid session (such as viewing a report), the applic... | 18,001 | [
{
"from": "human",
"value": "The project is ASP.NET 2.0, I have never been able to reproduce this myself, but I get emails informing me it happens to clients many times a week, often a few times in a row.\nHere is the full error:\nException Details: \n\nMicrosoft.Reporting.WebForms.AspNetSessionExpiredExcep... |
I am having fickle of problem in Oracle 9i
select 1"FirstColumn" from dual;
Oracle throwing error while executing above query. ORA-03001: unimplemented feature in my Production server.
The Same query is working fine in my Validation server. Both servers are with Oracle 9i
Any one have Idea what's wrong...? Is this some... | The issue you're encountering is due to how Oracle 9i interprets the syntax in your query. The query you have is using double quotes without a space, which can be problematic in certain configurations or versions.
The SQL syntax you provided is:
```sql
SELECT 1 "FirstColumn" FROM dual;
```
This is actually valid synt... | 19,759 | [
{
"from": "human",
"value": "I am having fickle of problem in Oracle 9i\nselect 1\"FirstColumn\" from dual;\nOracle throwing error while executing above query. ORA-03001: unimplemented feature in my Production server.\nThe Same query is working fine in my Validation server. Both servers are with Oracle 9i\n... |
So basically we have lots of SharePoint usage log files generated by our SharePoint 2007 site and we would like to make sense of them. For that we're thinking of reading the log files and dumping into a database with the appropriate columns and all. Now I was going to make an SSIS package to read all the text files and... | Both SSIS (SQL Server Integration Services) and LogParser can be used to process SharePoint usage log files, and each has its advantages depending on your requirements and setup. Here's a comparison of the two methods along with some other options you might consider:
### LogParser
**Advantages:**
- **Simplicity**: Lo... | 19,762 | [
{
"from": "human",
"value": "So basically we have lots of SharePoint usage log files generated by our SharePoint 2007 site and we would like to make sense of them. For that we're thinking of reading the log files and dumping into a database with the appropriate columns and all. Now I was going to make an SS... |
I am working with an n-tiered architecture in Visual Studio 2008 (Developer Edition), and I have run into an issue.
We are running unit tests on every method of our services layer, and I am attempting to see the code coverage results, to ensure I'm hitting all the main paths through my methods.
When I attempt to view t... | To enable code coverage in Visual Studio 2008 for your unit tests, you need to create a Test Run Configuration file that specifies the settings you want, including enabling code coverage. Here's how to do it:
1. **Open your Solution**:
Launch Visual Studio 2008 and open your solution that contains the unit tests.
... | 18,956 | [
{
"from": "human",
"value": "I am working with an n-tiered architecture in Visual Studio 2008 (Developer Edition), and I have run into an issue.\nWe are running unit tests on every method of our services layer, and I am attempting to see the code coverage results, to ensure I'm hitting all the main paths th... |
I have a JS function that may occasionally get used on some pages. It is dependent on another JS file (swfObject.js), but I'd like to avoid having to include this file all over the place, as thats a wasted request most of the time.
Instead, I'd like to create a generic function that can inject a script reference into t... | Your approach to dynamically load a JavaScript file is on the right track. However, there are a few improvements you can make for better compatibility and functionality. Here’s an updated version of your function that addresses several issues:
1. **Cross-Browser Compatibility**: The `onreadystatechange` event is speci... | 19,586 | [
{
"from": "human",
"value": "I have a JS function that may occasionally get used on some pages. It is dependent on another JS file (swfObject.js), but I'd like to avoid having to include this file all over the place, as thats a wasted request most of the time.\nInstead, I'd like to create a generic function... |
I need to detect whether my application is running within a virtualized OS instance or not.
I've found an article with some useful information on the topic. The same article appears in multiple places, I'm unsure of the original source. VMware implements a particular invalid x86 instruction to return information about ... | Detecting whether your application is running within a virtualized environment can be challenging, especially if you want a solution that is robust and less susceptible to changes in future versions of virtualization products. Here are some general approaches and techniques that are commonly used for detecting virtuali... | 20,337 | [
{
"from": "human",
"value": "I need to detect whether my application is running within a virtualized OS instance or not.\nI've found an article with some useful information on the topic. The same article appears in multiple places, I'm unsure of the original source. VMware implements a particular invalid x8... |
I have this function in VB.net "ENCRYPT" (see below)
Private key() As Byte = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24}
Private iv() As Byte = {65, 110, 68, 26, 69, 178, 200, 219}
Public Function Encrypt(ByVal plainText As String) As Byte()
' Declare a UTF8Encoding obje... | To save the encrypted byte array to an SQL database, you'll typically want to convert the byte array into a format suitable for storage. One common way to do this is to convert the byte array into a Base64 string. Here’s a step-by-step process for achieving this:
1. **Encrypt the String**: Use your existing `Encrypt` ... | 13,221 | [
{
"from": "human",
"value": "I have this function in VB.net \"ENCRYPT\" (see below)\nPrivate key() As Byte = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24}\nPrivate iv() As Byte = {65, 110, 68, 26, 69, 178, 200, 219}\n\nPublic Function Encrypt(ByVal plainText As Stri... |
Will users who do not have admin rights on their computers be able to upgrade to new Flash player version by themselves?
This would be interesting to know for:
Windows 98
Windows XP/2000/Vista
Macs
Unix/Linux
| The ability for users without administrative rights to upgrade Flash Player varies by operating system and specific user permissions. Here's a breakdown for the systems you mentioned:
### Windows 98, XP, 2000, and Vista
- **Windows 98/2000**: Users typically need admin rights to install or upgrade software, including ... | 21,139 | [
{
"from": "human",
"value": "Will users who do not have admin rights on their computers be able to upgrade to new Flash player version by themselves?\nThis would be interesting to know for:\nWindows 98\nWindows XP/2000/Vista\nMacs\nUnix/Linux\n"
},
{
"from": "gpt",
"value": "The ability for user... |
So I have a large 2d array that i serialize, but when I attempt to unserialize the array it just throws the same error to the point of nearly crashing Firefox.
The error is:
Warning: unserialize() [function.unserialize]: Node no longer exists in /var/www/dev/wc_paul/inc/analyzerTester.php on line 24
I would include th... | The error you're encountering with `unserialize()` suggests that the serialized data is corrupted or improperly formatted. This can happen for a variety of reasons, especially when dealing with data conversions between formats like XML and serialized PHP arrays.
Here are some troubleshooting steps and recommendations ... | 16,300 | [
{
"from": "human",
"value": "So I have a large 2d array that i serialize, but when I attempt to unserialize the array it just throws the same error to the point of nearly crashing Firefox.\nThe error is:\nWarning: unserialize() [function.unserialize]: Node no longer exists in /var/www/dev/wc_paul/inc/analyz... |
Following on from this question what would be the best way to write a Char.IsHex() function in C#. So far I've got this but don't like it:
bool CharIsHex(char c) {
c = Char.ToLower(c);
return (Char.IsDigit(c) || c == 'a' || c == 'b' || c == 'c' || c == 'd' || c == 'e' || c == 'f')
}
| Your current implementation is a good start, but you can make it more concise and easier to read. Instead of using multiple `||` conditions, you can utilize the `Char.IsDigit` method for the numeric digits and check if the character is between 'a' and 'f' for the hexadecimal characters. Here's a revised version of your... | 22,412 | [
{
"from": "human",
"value": "Following on from this question what would be the best way to write a Char.IsHex() function in C#. So far I've got this but don't like it:\nbool CharIsHex(char c) {\n c = Char.ToLower(c);\n return (Char.IsDigit(c) || c == 'a' || c == 'b' || c == 'c' || c == 'd' || c == 'e'... |
I have a xml blob that's checked against a schema in sql 2005. My website uses xsl to transform and display the blob. How do I add a hyperlink to the xml (in any node) without the sql 2005 schema complaining a node was found in the wrong place? Or the xsl thinking that the hyperlink is a valid xml node?
thank you
| To add a hyperlink to your XML blob without violating the SQL Server 2005 schema or causing issues with XSLT processing, you can follow a couple of approaches depending on your needs.
### Approach 1: Use an Existing Node
If you want to embed a hyperlink into your existing XML structure, you can do so by adding an att... | 22,148 | [
{
"from": "human",
"value": "I have a xml blob that's checked against a schema in sql 2005. My website uses xsl to transform and display the blob. How do I add a hyperlink to the xml (in any node) without the sql 2005 schema complaining a node was found in the wrong place? Or the xsl thinking that the hyper... |
I have a managed DLL (written in C++/CLI) that contains a class used by a C# executable. In the constructor of the class, I need to get access to the full path of the executable referencing the DLL. In the actual app I know I can use the Application object to do this, but how can I do it from a managed DLL?
| In a managed DLL (C++/CLI), you can access the path of the executable that is referencing the DLL by using the `System::Diagnostics::Process` class from the .NET Framework. Here’s a step-by-step guide on how to retrieve the full path of the executable from your C++/CLI DLL:
1. **Include the Necessary Namespace**: You ... | 18,505 | [
{
"from": "human",
"value": "I have a managed DLL (written in C++/CLI) that contains a class used by a C# executable. In the constructor of the class, I need to get access to the full path of the executable referencing the DLL. In the actual app I know I can use the Application object to do this, but how ca... |
Is it possible to get the route/virtual url associated with a controller action or on a view? I saw that Preview 4 added LinkBuilder.BuildUrlFromExpression helper, but it's not very useful if you want to use it on the master, since the controller type can be different. Any thoughts are appreciated.
| In ASP.NET Core, if you're looking to generate URLs based on your controller actions dynamically (especially when dealing with a master layout where you may not have a direct reference to a specific controller), there are a couple of approaches you can take.
### 1. Using `LinkGenerator`
ASP.NET Core provides the `Lin... | 20,037 | [
{
"from": "human",
"value": "Is it possible to get the route/virtual url associated with a controller action or on a view? I saw that Preview 4 added LinkBuilder.BuildUrlFromExpression helper, but it's not very useful if you want to use it on the master, since the controller type can be different. Any tho... |
When I run this code in the Simulator in the debugger or standalone
[UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]
it tells me the camera is not available (returns NO), as expected.
However, if I run the same code in the simulator in Performance Tool, it returns YES! My code (w... | This issue you're experiencing with the iOS Simulator is not uncommon and can be attributed to the differences in behavior between the regular execution environment and when profiling or running under specific tools. Here are some insights and potential workarounds for your situation:
### Understanding the Issue
1. **... | 20,678 | [
{
"from": "human",
"value": "When I run this code in the Simulator in the debugger or standalone\n[UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]\n\nit tells me the camera is not available (returns NO), as expected.\nHowever, if I run the same code in the simulator in... |
My database contains three tables called Object_Table, Data_Table and Link_Table. The link table just contains two columns, the identity of an object record and an identity of a data record.
I want to copy the data from DATA_TABLE where it is linked to one given object identity and insert corresponding records into Dat... | To efficiently copy data from the `Data_Table` linked to a specific object identity and insert the corresponding records into `Data_Table` and `Link_Table` for a different object identity without using loops, you can use the `OUTPUT` clause in SQL Server or similar functionality in other SQL databases.
### Here’s a g... | 20,691 | [
{
"from": "human",
"value": "My database contains three tables called Object_Table, Data_Table and Link_Table. The link table just contains two columns, the identity of an object record and an identity of a data record.\nI want to copy the data from DATA_TABLE where it is linked to one given object identity... |
One problem I've been toying with off and on is a service that requires my server to produce a screenshot of a webpage at a given url. The problem is that I don't have any idea how I would accomplish this. I mostly use a LAMP software stack, so answers that were given with that in mind would be the most helpful. Again ... | To generate a screenshot of a webpage from a given URL in a LAMP (Linux, Apache, MySQL, PHP) stack, you can utilize tools that allow for headless browser rendering. One common tool for this purpose is **Puppeteer**, which is built for Node.js. However, since you're working with a LAMP stack, we can make use of a PHP li... | 13,509 | [
{
"from": "human",
"value": "One problem I've been toying with off and on is a service that requires my server to produce a screenshot of a webpage at a given url. The problem is that I don't have any idea how I would accomplish this. I mostly use a LAMP software stack, so answers that were given with that ... |
I moved a WordPress installation to a new folder on a Windows/IIS server. I'm setting up 301 redirects in PHP, but it doesn't seem to be working. My post URLs have the following format:
http:://www.example.com/OLD_FOLDER/index.php/post-title/
I can't figure out how to grab the /post-title/ part of the URL.
$_SERVER["R... | When working with a WordPress installation on a Windows/IIS server, you might run into issues with URL rewriting and the way that IIS handles URLs compared to Apache. Here's how you can grab the `/post-title/` part of the URL in your PHP script, especially when working with 301 redirects.
### Understanding the Environ... | 17,537 | [
{
"from": "human",
"value": "I moved a WordPress installation to a new folder on a Windows/IIS server. I'm setting up 301 redirects in PHP, but it doesn't seem to be working. My post URLs have the following format:\nhttp:://www.example.com/OLD_FOLDER/index.php/post-title/\n\nI can't figure out how to grab t... |
Here's my problem - I have some code like this:
<mx:Canvas width="300" height="300">
<mx:Button x="800" />
</mx:Canvas>
So the problem is that the Button inside the canvas has an x property way in excess of the Canvas's width - since it's a child of the Canvas, the Canvas masks it and creates some scrollbars for ... | To achieve the desired behavior of positioning the button outside of the `Canvas` without creating scrollbars, while still keeping the button as a child of the `Canvas`, you can use negative margins or adjust the `Canvas` dimensions and positioning. However, in the context of Flex (assuming that’s the framework you’re ... | 21,603 | [
{
"from": "human",
"value": "Here's my problem - I have some code like this:\n<mx:Canvas width=\"300\" height=\"300\">\n <mx:Button x=\"800\" />\n</mx:Canvas>\n\nSo the problem is that the Button inside the canvas has an x property way in excess of the Canvas's width - since it's a child of the Canvas, ... |
I am looking for a reporting service/tool for visual Studio. My only restraint is my web server is off limits to me as far as installing ANYTHING. So I need something I can just include in my project.
My users need to be able to export a report to PDF and without being able to use Crystal I am pretty much lost.
Any i... | There are several reporting libraries that you can include directly in your Visual Studio project without the need for server-side installations. Here are some options that can generate reports and export them to PDF:
### 1. **Microsoft RDLC Reports**
- **Description**: RDLC (Report Definition Language Client-side)... | 19,382 | [
{
"from": "human",
"value": "I am looking for a reporting service/tool for visual Studio. My only restraint is my web server is off limits to me as far as installing ANYTHING. So I need something I can just include in my project.\nMy users need to be able to export a report to PDF and without being able t... |
We're getting our feet wet with unit testing in VS 2008 Professional Edition and have hit what might be a pretty large snag: there appears to be no way to determine code coverage in this particular VS edition. It seems that this is something only available in VS Team System Development Edition.
In other words, VS 2008 ... | Your observations regarding Visual Studio 2008 Professional Edition are correct. This edition does support unit testing through its testing framework, but it lacks integrated code coverage tools. Code coverage functionality is indeed a feature of Visual Studio Team System Development Edition, which can be a hurdle for ... | 21,484 | [
{
"from": "human",
"value": "We're getting our feet wet with unit testing in VS 2008 Professional Edition and have hit what might be a pretty large snag: there appears to be no way to determine code coverage in this particular VS edition. It seems that this is something only available in VS Team System Deve... |
What open-source / public domain software is there "out there" for conversion between Latitude/Longitude, UTM (Universal Transform Mercator) and MGRS (Military Grid Reference System)? We're using a VB6 library at the moment and would prefer to use something in another language and with a longer pedigree.
| There are several open-source libraries and public domain software options available for converting between Latitude/Longitude, UTM, and MGRS. Here are some notable ones:
1. **PROJ**:
- **Language**: C/C++
- **Description**: PROJ is a widely-used library for performing cartographic projections and coordinate tra... | 18,449 | [
{
"from": "human",
"value": "What open-source / public domain software is there \"out there\" for conversion between Latitude/Longitude, UTM (Universal Transform Mercator) and MGRS (Military Grid Reference System)? We're using a VB6 library at the moment and would prefer to use something in another language... |
We currently are using both Visual Source Safe and Team Foundation Server at work (VSS for old projects, TFS for current or new projects).
We have always used Labels in source control for each build. In VSS if you chose to see a file history you could include labels. In TFS I cannot find an option to include the labl... | In Team Foundation Server (TFS), labels are not directly displayed in the file history view as they were in Visual SourceSafe (VSS). However, you can still access label information and correlate it with file history in TFS, although it requires a bit of extra work since labels are not integrated into the history view.
... | 19,241 | [
{
"from": "human",
"value": "We currently are using both Visual Source Safe and Team Foundation Server at work (VSS for old projects, TFS for current or new projects).\nWe have always used Labels in source control for each build. In VSS if you chose to see a file history you could include labels. In TFS I... |
my goal is to write a stored proc that can collect all field values from multiple rows into one single output variable (maybe varchar(some_length)). It may seem strange solution but i've quite positive its the only one i can use at that situation im in. I have not used Firebird before and stored procs look way differen... | Creating a stored procedure in Firebird that concatenates values from multiple rows into a single output variable is a common task, although Firebird 1.5 has certain limitations. In Firebird, you will typically use a `FOR` loop to iterate through the rows of a query and accumulate the results into a string variable. Be... | 16,755 | [
{
"from": "human",
"value": "my goal is to write a stored proc that can collect all field values from multiple rows into one single output variable (maybe varchar(some_length)). It may seem strange solution but i've quite positive its the only one i can use at that situation im in. I have not used Firebird ... |
I'm looking for a way to create an "it will look cool" effect for a full screen WPF application I'm working on - a "screen glint" effect that animates or moves across the whole screen to give off a shiny display experience. I'm thinking of creating a large rectangle with a highlighted-gradient and transparent backgroun... | Creating a "screen glint" effect in a WPF application can be a fun way to add some visual flair. To achieve this, you can indeed use a large rectangle with a highlighted gradient that moves across the screen. You can animate the rectangle using a `DoubleAnimation` for its `Canvas.Left` or `TranslateTransform.X` propert... | 17,894 | [
{
"from": "human",
"value": "I'm looking for a way to create an \"it will look cool\" effect for a full screen WPF application I'm working on - a \"screen glint\" effect that animates or moves across the whole screen to give off a shiny display experience. I'm thinking of creating a large rectangle with a h... |
I have asked our hosting provider to add mod_python to our httpd server. The server appears to be in an hsphere cluster and they appear to use yum to administer it. He is reporting some dependencies missing and I do't quite understand how that could have come about.
versions (this is as much as I have been given):
Ce... | Based on the error messages and the information you've provided, it looks like there is indeed a version mismatch issue between the `httpd` (Apache) server and the version of `mod_python` that the administrator is trying to install.
### Key Points from the Error Message
1. **Dependencies Required by mod_python**: The ... | 19,282 | [
{
"from": "human",
"value": "I have asked our hosting provider to add mod_python to our httpd server. The server appears to be in an hsphere cluster and they appear to use yum to administer it. He is reporting some dependencies missing and I do't quite understand how that could have come about.\nversions ... |
This is a nut I'm cracking these days
Application I'm working on has some advanced processing towards SQL. One of the operations selects various metadata on the objects in the current context from different tables, based on the item names in the collection. For this, a range of "select...from...where...in()" is execute... | You're correct that SQL Server has a limitation of 2100 parameters in a single query, which can indeed complicate scenarios where you're dealing with a large collection of items. Creating a temporary table and inserting your item names in bulk is a very effective way to bypass this limitation. Here’s how you can achiev... | 19,235 | [
{
"from": "human",
"value": "This is a nut I'm cracking these days\nApplication I'm working on has some advanced processing towards SQL. One of the operations selects various metadata on the objects in the current context from different tables, based on the item names in the collection. For this, a range of... |
As recently as several years ago, the developers actually made the builds that went to clients. This was obviously a disaster for reasons too numerous to list.
Then when we started to learn the errors of our ways, we looked for a way to auto-build the entire application on a dedicated build machine. The culture at th... | It sounds like you’re in a challenging situation, but you’re also in a great position to make impactful improvements to your build process. Here are some recommendations based on your requirements and goals, along with a few established practices you might consider adopting:
### 1. **Choosing the Right Build System**
... | 18,005 | [
{
"from": "human",
"value": "As recently as several years ago, the developers actually made the builds that went to clients. This was obviously a disaster for reasons too numerous to list.\nThen when we started to learn the errors of our ways, we looked for a way to auto-build the entire application on a d... |
Let's say I'm working on a little batch-processing console app in VB.Net. I want to be able to structure the app like this:
Sub WorkerMethod()
'Do some work
Trace.WriteLine("Work progress")
'Do more work
Trace.WriteLine("Another progress update")
'...
End Sub
Sub Main()
'Do any setup, like confi... | Your approach to creating a `ConsoleTrace` listener is a valid and straightforward method for connecting `Trace` output to the console in VB.Net. However, there is indeed a more streamlined way to accomplish this using built-in functionality provided by the .NET Framework. The `ConsoleTraceListener` class provides a st... | 20,558 | [
{
"from": "human",
"value": "Let's say I'm working on a little batch-processing console app in VB.Net. I want to be able to structure the app like this:\nSub WorkerMethod()\n 'Do some work\n Trace.WriteLine(\"Work progress\")\n\n 'Do more work\n Trace.WriteLine(\"Another progress update\")\n\n '.... |
This question is a follow-up from How to indicate that a method was unsuccessful. The xxx() Tryxxx() pattern is something that can be very useful in many libraries. I am wondering what is the best way to offer both implementations without duplicating my code.
What is best:
public int DoSomething(string a)
{
// mig... | When designing methods that can either succeed or fail, using a `Try` pattern is a common practice. Both patterns you've presented have their pros and cons, but I would suggest focusing on the following points to help you determine the best approach for your use case:
### Option 1: Throwing Exceptions in `DoSomething`... | 15,795 | [
{
"from": "human",
"value": "This question is a follow-up from How to indicate that a method was unsuccessful. The xxx() Tryxxx() pattern is something that can be very useful in many libraries. I am wondering what is the best way to offer both implementations without duplicating my code.\nWhat is best:\npub... |
A similar question has been asked: MSDN subscriptions on the cheap?, but I am not interested in the solutions provided:
I am not developing a product for sale, I am starting up a consulting company, so Empower is not an option.
I have visited the links to MS regarding MSDN subscriptions and they do not point to a wa... | If you're looking for cost-effective ways to access Microsoft development tools without going through traditional MSDN subscription routes or becoming an MVP, here are a few alternatives you might consider:
1. **Microsoft 365 Developer Program**: This program offers a free Microsoft 365 E5 developer subscription which... | 21,808 | [
{
"from": "human",
"value": "A similar question has been asked: MSDN subscriptions on the cheap?, but I am not interested in the solutions provided:\n\nI am not developing a product for sale, I am starting up a consulting company, so Empower is not an option. \nI have visited the links to MS regarding MSDN... |
I use a 3rd party tool that outputs a file in Unicode format. However, I prefer it to be in ASCII. The tool does not have settings to change the file format.
What is the best way to convert the entire file format using Python?
| You can convert a Unicode file to ASCII format in Python using the built-in `open` function. The key point is that while converting to ASCII, any non-ASCII characters will need to be handled (typically either removed or replaced). Here’s a simple way to do this using Python:
1. Read the Unicode file.
2. Encode it to A... | 22,315 | [
{
"from": "human",
"value": "I use a 3rd party tool that outputs a file in Unicode format. However, I prefer it to be in ASCII. The tool does not have settings to change the file format.\nWhat is the best way to convert the entire file format using Python?\n"
},
{
"from": "gpt",
"value": "You c... |
Similar questions have been asked, but nothing exactly like mine, so here goes.
We have a collection of Microsoft Word documents on an ASP.NET web server with merge fields whose values are filled in as a result of user form submissions. After the field merge, the server must convert the document to PDF and stream it do... | To convert Word documents to PDF in an ASP.NET environment without using the Microsoft Office Interop or running into the issues associated with Office Automation, you have several viable options. Here are some popular libraries that can help you achieve this task in a scalable, low-cost, and efficient manner:
### 1. ... | 19,517 | [
{
"from": "human",
"value": "Similar questions have been asked, but nothing exactly like mine, so here goes.\nWe have a collection of Microsoft Word documents on an ASP.NET web server with merge fields whose values are filled in as a result of user form submissions. After the field merge, the server must co... |
Which CMS are you using in Java and what is your experience with it (in terms of extensibility, usage comfort, framework API, memory usage, performance etc.). I am looking for suggestions.
Specifically any one that supports a search engine(probably lucene or similar).
| There are several content management systems (CMS) in Java that you might consider, each with its own strengths and weaknesses in terms of extensibility, usability, API framework, memory usage, performance, and support for search engines like Lucene. Here are a few popular ones:
### 1. **Alfresco**
**Overview**: Alfr... | 16,839 | [
{
"from": "human",
"value": "Which CMS are you using in Java and what is your experience with it (in terms of extensibility, usage comfort, framework API, memory usage, performance etc.). I am looking for suggestions.\nSpecifically any one that supports a search engine(probably lucene or similar).\n"
},
... |
I'm working on a set of classes that will be used to serialize to XML. The XML is not controlled by me and is organized rather well. Unfortunately, there are several sets of nested nodes, the purpose of some of them is just to hold a collection of their children. Based on my current knowledge of XML Serialization, t... | When working with XML serialization in C#, it’s a common pattern to create classes that mirror the structure of your XML. For your specific scenario, you can indeed create three main classes: one for the `root`, one for the collection of `users`, and one for the collection of `groups`. Each of these collections can be ... | 11,618 | [
{
"from": "human",
"value": "I'm working on a set of classes that will be used to serialize to XML. The XML is not controlled by me and is organized rather well. Unfortunately, there are several sets of nested nodes, the purpose of some of them is just to hold a collection of their children. Based on my ... |
I have a WinForms application with a view where the user selects a single time span from a list of predefined time spans in a ComboBox, with it's DropDownStyle property set to DropDownList.
Now, the requirements have changed. The users are going to need the ability to make multiple selections from the list of time span... | A standard ComboBox in WinForms does not support multiple selections. However, you can achieve similar functionality through various methods. Here are some options you can consider:
### 1. Use a ListBox
Instead of a ComboBox, you can use a ListBox that allows multiple selections. You can customize the ListBox appeara... | 19,281 | [
{
"from": "human",
"value": "I have a WinForms application with a view where the user selects a single time span from a list of predefined time spans in a ComboBox, with it's DropDownStyle property set to DropDownList.\nNow, the requirements have changed. The users are going to need the ability to make mult... |
I would like to specify a constraint which is another type with a generic argument.
class KeyFrame<T>
{
public float Time;
public T Value;
}
// I want any kind of Keyframe to be accepted
class Timeline<T> where T : Keyframe<*>
{
}
But this cannot be done in c# as of yet, (and I really doubt it will ever be). ... | As of C# 9 and the current state of the language, there is no direct support for wildcard generics (like `*` in your example) that would allow you to specify a constraint on a generic type without providing specific type arguments. Your suggestion of using two type parameters (one for the `KeyFrame` type and one for it... | 22,312 | [
{
"from": "human",
"value": "I would like to specify a constraint which is another type with a generic argument.\nclass KeyFrame<T>\n{\n public float Time;\n public T Value;\n}\n\n// I want any kind of Keyframe to be accepted\nclass Timeline<T> where T : Keyframe<*>\n{\n}\n\nBut this cannot be done in... |
I'm running an old little app which runs in the browser from local files, and I keep getting the, "To help protect your security, Internet Explorer has restricted this webpage from running scripts or Activex controls that could access your computer" message.
Is there a registry setting or something I can tweak to allow... | To allow your local web application to run without restrictions in Internet Explorer, you can make a few adjustments in the Windows Registry or the Internet Explorer settings. However, please be aware that changing these settings can expose your system to potential security risks, so proceed with caution.
### Method 1... | 19,815 | [
{
"from": "human",
"value": "I'm running an old little app which runs in the browser from local files, and I keep getting the, \"To help protect your security, Internet Explorer has restricted this webpage from running scripts or Activex controls that could access your computer\" message.\nIs there a regist... |
I've recently inherited the job of maintaining a database that wasn't designed very well and the designers aren't available to ask any questions. And I have a couple more coming my way in the near future.
It's been tough trying to figure out the relationships between the tables without any kind of visual aid or databa... | It's great to hear that you've found a solution with SchemaSpyGUI for visualizing your database schema! If you're looking for more options, here are some additional open-source and free tools that can help you create entity-relationship diagrams (ERDs) or visualize database schemas:
1. **DbVisualizer**: While primaril... | 21,132 | [
{
"from": "human",
"value": "I've recently inherited the job of maintaining a database that wasn't designed very well and the designers aren't available to ask any questions. And I have a couple more coming my way in the near future. \nIt's been tough trying to figure out the relationships between the table... |
I'm trying to recreate the functionality on Google Video where you can access certain parts of a video by putting #1h1m1m in the URL.
So I have an embedded Google Video and links to the right that I want to link to at certain times in that video.
I can do this with a page refresh but I'm trying to do it via javascript ... | To achieve the functionality you desire, you'll need to use JavaScript to manipulate the embedded video. However, keep in mind that most embedded video players, including Google Video, do not provide a straightforward API for skipping to a time without refreshing the page. Here’s a generalized approach you can use, ass... | 20,317 | [
{
"from": "human",
"value": "I'm trying to recreate the functionality on Google Video where you can access certain parts of a video by putting #1h1m1m in the URL.\nSo I have an embedded Google Video and links to the right that I want to link to at certain times in that video.\nI can do this with a page refr... |
Is there a way to start PowerShell in a specific folder from Windows Explorer, e.g. to right-click in a folder and have an option like "Open PowerShell in this Folder"?
It's really annoying to have to change directories to my project folder the first time I run MSBuild every day.
| Yes, you can easily add an option to the right-click context menu in Windows Explorer to open PowerShell in a specific folder. Here’s how you can do it:
### Method 1: Using Windows Registry Editor
1. **Open the Registry Editor:**
- Press `Win + R`, type `regedit`, and hit `Enter`.
2. **Navigate to the following p... | 19,899 | [
{
"from": "human",
"value": "Is there a way to start PowerShell in a specific folder from Windows Explorer, e.g. to right-click in a folder and have an option like \"Open PowerShell in this Folder\"?\nIt's really annoying to have to change directories to my project folder the first time I run MSBuild every ... |
We're running a web app on Tomcat 6 and Apache mod_proxy 2.2.3. Seeing a lot of 502 errors like this:
Bad Gateway!
The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request GET /the/page.do.
Reason: Error reading from remote server
If you think this is a se... | It sounds like you're experiencing intermittent 502 Bad Gateway errors in a high-load scenario, which can be tricky to diagnose. Here are some suggestions to help narrow down the root cause of the problem:
1. **Check Tomcat Logs**: Examine the `catalina.out` and any application-specific logs in Tomcat. Look for any st... | 16,979 | [
{
"from": "human",
"value": "We're running a web app on Tomcat 6 and Apache mod_proxy 2.2.3. Seeing a lot of 502 errors like this:\n\nBad Gateway!\n The proxy server received an invalid response from an upstream server.\nThe proxy server could not handle the request GET /the/page.do.\nReason: Error readin... |
When using the ObsoleteAtribute in .Net it gives you compiler warnings telling you that the object/method/property is obsolete and somthing else should be used. I'm currently working on a project that requires a lot of refactoring an ex-employees code. I want to write a custom attribute that I can use to mark methods o... | In .NET, creating a custom attribute does not directly allow you to generate compiler warnings. The `ObsoleteAttribute`, for instance, is a special attribute that the compiler recognizes and has built-in behavior to generate warnings or errors based on its presence.
If you want to achieve similar functionality (i.e., ... | 20,053 | [
{
"from": "human",
"value": "When using the ObsoleteAtribute in .Net it gives you compiler warnings telling you that the object/method/property is obsolete and somthing else should be used. I'm currently working on a project that requires a lot of refactoring an ex-employees code. I want to write a custom a... |
Is there any way (maybe directly editing resource files) to configure a Tab Control (add/remove tabs and their captions and contents) at design time with Visual Studio 2008 without SP1 (I heard that SP1 has such feature)?
P.S.: I use c++ with wtl
| In Visual Studio 2008 without Service Pack 1, the support for editing tab controls at design time (like you might see in more recent versions or with SP1) is limited. However, you can manage the contents and tabs of a Tab Control through resource files and some manual coding.
Here’s how you can accomplish this:
### S... | 15,974 | [
{
"from": "human",
"value": "Is there any way (maybe directly editing resource files) to configure a Tab Control (add/remove tabs and their captions and contents) at design time with Visual Studio 2008 without SP1 (I heard that SP1 has such feature)?\nP.S.: I use c++ with wtl\n"
},
{
"from": "gpt",
... |
GDB has severe issues when debugging with multiple threads (pthreads).
Are there any other good multi-threaded debuggers for C/C++ on *nix?
| Yes, there are several alternatives to GDB that can effectively debug multi-threaded C/C++ applications on Unix-like systems. Here are a few options:
1. **LLDB**: Part of the LLVM project, LLDB is a high-performance debugger that supports multi-threaded applications. It provides a more modern interface compared to GDB... | 15,635 | [
{
"from": "human",
"value": "GDB has severe issues when debugging with multiple threads (pthreads).\nAre there any other good multi-threaded debuggers for C/C++ on *nix?\n"
},
{
"from": "gpt",
"value": "Yes, there are several alternatives to GDB that can effectively debug multi-threaded C/C++ ap... |
Just getting started with Linq to SQL so forgive the newbie question. I'm trying to reproduce the following (working) query in Linq to SQL (VB.NET):
Select
f.Title,
TotalArea = Sum(c.Area)
From Firms f
Left Join Concessions c on c.FirmID = f.FirmID
Group By f.Title
Order by Sum(c.Area) DESC
(A Firm has many Co... | You're on the right track, but your LINQ query needs a little adjustment to properly calculate the total area of concessions grouped by firms, and you also need to specify the grouping correctly. In LINQ to SQL (and LINQ in general), you typically use the `Group By` clause followed by an aggregation function (like `Sum... | 21,633 | [
{
"from": "human",
"value": "Just getting started with Linq to SQL so forgive the newbie question. I'm trying to reproduce the following (working) query in Linq to SQL (VB.NET):\nSelect\n f.Title,\n TotalArea = Sum(c.Area)\nFrom Firms f\nLeft Join Concessions c on c.FirmID = f.FirmID\nGroup By f.Title... |
I have come to see an Installer class item in Visual studio. Why they have maintain an seperate item for Installer. Do they create any custom installers ?
| In Visual Studio, an Installer class is used to create a setup and deployment project for your application. This is especially useful for applications that need to be installed on client machines or servers. The Installer class allows you to customize the installation process of your application beyond the standard ins... | 21,501 | [
{
"from": "human",
"value": "I have come to see an Installer class item in Visual studio. Why they have maintain an seperate item for Installer. Do they create any custom installers ?\n"
},
{
"from": "gpt",
"value": "In Visual Studio, an Installer class is used to create a setup and deployment p... |
I've read somewhere that functional programming is suitable to take advantage of multi-core trend in computing. I didn't really get the idea. Is it related to the lambda calculus and von neumann architecture?
| Functional programming (FP) does indeed have properties that make it well-suited for leveraging modern multi-core and distributed computing environments. Let's break down why this is the case, and how it relates to concepts like lambda calculus and the von Neumann architecture.
### Functional Programming and Concurren... | 18,951 | [
{
"from": "human",
"value": "I've read somewhere that functional programming is suitable to take advantage of multi-core trend in computing. I didn't really get the idea. Is it related to the lambda calculus and von neumann architecture?\n"
},
{
"from": "gpt",
"value": "Functional programming (F... |
1.
How can I reinterpret cast a float to an int (or a double to a long)?
float f = 2.0f;
int i = (int)f; // causes conversion
I only want to copy the bit-pattern from f to i. How can this be done?
2.
The implicit and explicit operators in C# uses one intermediate object because the operator function is static
public s... | 1. To reinterpret the bit pattern of a `float` as an `int` in C++, you can use `std::memcpy` or a union. However, the most common and recommended approach is using `std::memcpy`, as it avoids issues with strict aliasing rules. Here’s how you can do it:
```cpp
#include <cstring> // For std::memcpy
float f = 2.0f;
int ... | 16,479 | [
{
"from": "human",
"value": "1.\nHow can I reinterpret cast a float to an int (or a double to a long)?\nfloat f = 2.0f;\nint i = (int)f; // causes conversion\n\nI only want to copy the bit-pattern from f to i. How can this be done?\n2.\nThe implicit and explicit operators in C# uses one intermediate object ... |
Is there a Winform caching library out there? I need to pass a few datasets aroung in a Winform Application, and probably persist to storage upon close.
I've seen some samples around via Google, using System.Web.
What's the recommendation and where can I get some details. I am using VS 2008 for 2.0. 3.0 Framework.
Than... | In a WinForms application, caching is generally handled differently than in a web application, as WinForms applications run on the client side. While there isn't a dedicated caching library specifically designed for WinForms applications, you can implement caching using a few different approaches. Here are some recomme... | 18,314 | [
{
"from": "human",
"value": "Is there a Winform caching library out there? I need to pass a few datasets aroung in a Winform Application, and probably persist to storage upon close.\nI've seen some samples around via Google, using System.Web.\nWhat's the recommendation and where can I get some details. I am... |
I've got a ListBox control and I'm presenting a fixed number of ListBoxItem objects in a grid layout. So I've set my ItemsPanelTemplate to be a Grid.
I'm accessing the Grid from code behind to configure the RowDefinitions and ColumnDefinitions.
So far it's all working as I expect. I've got some custom IValueConverter i... | The binding error you're seeing is indicative of a problem with the data context or the way the binding is trying to resolve the property being accessed. Specifically, the message:
```
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Window... | 18,067 | [
{
"from": "human",
"value": "I've got a ListBox control and I'm presenting a fixed number of ListBoxItem objects in a grid layout. So I've set my ItemsPanelTemplate to be a Grid.\nI'm accessing the Grid from code behind to configure the RowDefinitions and ColumnDefinitions.\nSo far it's all working as I exp... |
I have a drop down like this on my page:
<p>
<%= f.label :episode_id %><br />
<%= f.collection_select(:episode_id, @episodes, :id, :show) %>
</p>
An episode has an id and belongs_to to a show which has a name. In the dropdown, I'd like to display the show name. :show.name doesn't work to display the name. ... | To display the name of the associated show in your dropdown, you need to customize the display method used in `collection_select`. The `:show` you are currently using in your `collection_select` is likely trying to call `to_s` on the Show model, which won't work because you want to display the `name` attribute instead.... | 23,158 | [
{
"from": "human",
"value": "I have a drop down like this on my page:\n<p>\n <%= f.label :episode_id %><br />\n <%= f.collection_select(:episode_id, @episodes, :id, :show) %>\n</p>\n\nAn episode has an id and belongs_to to a show which has a name. In the dropdown, I'd like to display the show name.... |
I enjoy developing algorithms using the STL, however, I have this recurring problem where my data sets are too large for the heap.
I have been searching for drop-in replacements for STL containers and algorithms which are disk-backed, i.e. the data structures on stored on disk rather than the heap.
A friend recently ... | If you're looking for disk-backed STL replacements besides STXXL and want to avoid persistence and embedded databases, you have a few options to consider:
1. **SDSL (Succinct Data Structure Library)**: Although it is not strictly a drop-in STL replacement, SDSL offers several data structures designed to use disk for l... | 18,887 | [
{
"from": "human",
"value": "I enjoy developing algorithms using the STL, however, I have this recurring problem where my data sets are too large for the heap. \nI have been searching for drop-in replacements for STL containers and algorithms which are disk-backed, i.e. the data structures on stored on disk... |
Can someone explain why how the result for the following unpack is computed?
"aaa".unpack('h2H2') #=> ["16", "61"]
In binary, 'a' = 0110 0001. I'm not sure how the 'h2' can become 16 (0001 0000) or 'H2' can become 61 (0011 1101).
| In Ruby, the `unpack` method takes a string and decodes it into an array based on the specified format string. The format you provided, `'h2H2'`, includes two parts: `h2` and `H2`. Let's break down what these mean and how the results are computed.
### Format Codes
1. **`h2`**: This code reads two bytes of the string ... | 18,224 | [
{
"from": "human",
"value": "Can someone explain why how the result for the following unpack is computed?\n\"aaa\".unpack('h2H2') #=> [\"16\", \"61\"]\n\nIn binary, 'a' = 0110 0001. I'm not sure how the 'h2' can become 16 (0001 0000) or 'H2' can become 61 (0011 1101).\n"
},
{
"from": ... |
From within FlexBuilder3, I can go to "Data/Manage Web Services..." select a web service, and click "Update" to ensure that my code and the server are in sync. How do I automate this so that each time I build, the automatically generated web service code is regenerated?
If the server interface changes during developmen... | To automate the regeneration of web service code in FlexBuilder (now part of Adobe Flash Builder), you typically need to create a custom build process that can run the necessary commands to refresh the web service stubs every time you build your project. While FlexBuilder itself does not have a built-in feature to auto... | 20,120 | [
{
"from": "human",
"value": "From within FlexBuilder3, I can go to \"Data/Manage Web Services...\" select a web service, and click \"Update\" to ensure that my code and the server are in sync. How do I automate this so that each time I build, the automatically generated web service code is regenerated?\nIf ... |
I have a report that uses a TChart that I am maintaining. One of the TLineSeries that gets added automatically gets assigned the color clWhite, which is too close to the background (clBtnFace).
If I change it, then the next series that gets added takes clWhite. So short of going back and changing it after all the o... | To address your issue with TChart and the default color assignment for `TLineSeries`, you can customize the color palette of the chart to exclude `clWhite` from being automatically assigned to any new series. Unfortunately, TChart does not have a built-in way to prevent the automatic assignment of `clWhite` directly, b... | 19,601 | [
{
"from": "human",
"value": "I have a report that uses a TChart that I am maintaining. One of the TLineSeries that gets added automatically gets assigned the color clWhite, which is too close to the background (clBtnFace). \nIf I change it, then the next series that gets added takes clWhite. So short of ... |
I am using Apache's Velocity templating engine, and I would like to create a custom Directive. That is, I want to be able to write "#doMyThing()" and have it invoke some java code I wrote in order to generate the text.
I know that I can register a custom directive by adding a line
userdirective=my.package.here.MyDirect... | Creating a custom directive in Apache Velocity involves extending the `Directive` class, and you are correct that the key methods you'll need to override include `getType()`, `init()`, and `render()`. While the official documentation on this specific topic may not be comprehensive, I can provide you with a basic outlin... | 17,397 | [
{
"from": "human",
"value": "I am using Apache's Velocity templating engine, and I would like to create a custom Directive. That is, I want to be able to write \"#doMyThing()\" and have it invoke some java code I wrote in order to generate the text.\nI know that I can register a custom directive by adding a... |
What are the possibilities to enforce restrictions on the package dependencies in a Java build system? For example, the myapp.server.bl.Customer class should not be allowed to refer to the myapp.client.ui.customlayout package.
I'm interested in either Ant-based or IDE-specific solutions.
I'd like to get an error messa... | Enforcing package dependency restrictions in a Java build system, particularly with Ant or an IDE, can be challenging but certainly achievable with some workarounds. Here are a few potential approaches to achieve this:
### 1. Custom Ant Task with Dependency Validation
You can create a custom Ant task to validate pack... | 17,870 | [
{
"from": "human",
"value": "What are the possibilities to enforce restrictions on the package dependencies in a Java build system? For example, the myapp.server.bl.Customer class should not be allowed to refer to the myapp.client.ui.customlayout package.\nI'm interested in either Ant-based or IDE-specific ... |
I have a html page open on my webbrowser object, I can enter username and password okay, but I'm stuck and don't know how to submit the info. Here is the html code for the username/password submit:
<div id="signin">
<h2 class="ir">
<em></em>Sign in</h2>
<form action="/login/" method="post">
<input ... | To submit the form after entering the username and password, you can use the `InvokeMember` method to trigger the click event on the submit button.
In your HTML snippet, the submit button is an image input, and you can find it by its `name` attribute. Here's how you can do it:
```vb
' Set the username and password
W... | 22,788 | [
{
"from": "human",
"value": "I have a html page open on my webbrowser object, I can enter username and password okay, but I'm stuck and don't know how to submit the info. Here is the html code for the username/password submit:\n<div id=\"signin\">\n <h2 class=\"ir\">\n <em></em>Sign in</h2>\n ... |
Is it possible to cancel out of a long running process in VB6.0 without using DoEvents?
For example:
for i = 1 to someVeryHighNumber
' Do some work here '
...
if cancel then
exit for
end if
next
Sub btnCancel_Click()
cancel = true
End Sub
I assume I need a "DoEvents" before the "if cancel... | In VB6, when you're running a long process in a loop, the user interface becomes unresponsive because the program is busy executing the loop and doesn't have a chance to process events, including clicking the Cancel button. The standard approach to handle this is indeed using `DoEvents`, which allows the application to... | 21,496 | [
{
"from": "human",
"value": "Is it possible to cancel out of a long running process in VB6.0 without using DoEvents?\nFor example:\nfor i = 1 to someVeryHighNumber\n ' Do some work here '\n ...\n\n if cancel then\n exit for\n end if\nnext\n\nSub btnCancel_Click()\n cancel = true\nEnd S... |
I wonder if there is a way to limit the WPF framerate within a process?
i.e. I do not want to limit a single animation's framerate, but the global
framerate for my whole application.
I think I've seen something like this before but I can't find it anymore.
| In WPF, there isn't a built-in feature specifically designed to globally limit the frame rate for the entire application. However, you can achieve similar behavior by implementing a custom rendering loop that controls the frame updates.
One common approach to limit the frame rate is to use a `CompositionTarget.Renderi... | 20,402 | [
{
"from": "human",
"value": "I wonder if there is a way to limit the WPF framerate within a process?\ni.e. I do not want to limit a single animation's framerate, but the global\nframerate for my whole application.\nI think I've seen something like this before but I can't find it anymore.\n"
},
{
"fr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.