instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
do you use a tool? or just manually make them?
| I don't manually create responses; instead, I generate them using machine learning algorithms based on the data and training I've received. So, in a sense, I utilize a complex model as a "tool" to generate text. If you have any specific questions or need assistance with something, feel free to ask! | 23,673 | [
{
"from": "human",
"value": "do you use a tool? or just manually make them?\n"
},
{
"from": "gpt",
"value": "I don't manually create responses; instead, I generate them using machine learning algorithms based on the data and training I've received. So, in a sense, I utilize a complex model as a... |
I wanted to write a small Rapid Serial Visual Presentation (RSVP) program for my mobile device but I realized that there are some patent issues associated with that technique (exhibit 1 and exhibit 2).
Can I write such program and try to make money with it? Would it be legal to give such program for free?
| When considering the legality of creating and distributing a Rapid Serial Visual Presentation (RSVP) program, it's essential to understand the following points:
1. **Patent Issues**: If there are existing patents that cover the specific method or technology used in RSVP, creating a program that utilizes those patented... | 22,740 | [
{
"from": "human",
"value": "I wanted to write a small Rapid Serial Visual Presentation (RSVP) program for my mobile device but I realized that there are some patent issues associated with that technique (exhibit 1 and exhibit 2). \nCan I write such program and try to make money with it? Would it be legal t... |
My application is implemented as a service (running under services.exe).
I am adding a new feature which requires being notified when the user sends an SMS.
I have tried using IMAPIAdviseSink, registering with both IMAPISession and IMsgStore, but I do not get any notifications.
The other options I can see are to create... | To receive SMS notifications in a service running under `services.exe`, you may encounter some restrictions due to the way services operate in Windows. Specifically, services often run in a different session than the interactive user, which can lead to issues with certain APIs designed for user-interactive applications... | 19,439 | [
{
"from": "human",
"value": "My application is implemented as a service (running under services.exe).\nI am adding a new feature which requires being notified when the user sends an SMS.\nI have tried using IMAPIAdviseSink, registering with both IMAPISession and IMsgStore, but I do not get any notifications... |
I have a class that has a Generic type "G"
In my class model i have
public class DetailElement : ElementDefinition
Let's say i have a method like this
public void DoSomething<G>(G generic)
where G : ElementDefinition
{
if (generic is DetailElement)
{
... | The difference in behavior between line 1 and line 3 of your code stems from the way generics and type inference work in C#. Let's break down the relevant parts of your code and their implications.
### Understanding Lines 1 and 3
1. **Line 1:**
```csharp
((DetailElement)generic).DescEN = "Hello people"; // line... | 20,423 | [
{
"from": "human",
"value": "I have a class that has a Generic type \"G\"\nIn my class model i have\npublic class DetailElement : ElementDefinition\n\nLet's say i have a method like this\n public void DoSomething<G>(G generic)\n where G : ElementDefinition\n {\n if (gener... |
I was developing a web page, where I was laying out a board for a Chess-like game, along with a couple of piece trays. It's all done using HTML (with jQuery for dynamic updating as the game is played). Somewhere I'd got the notion that using absolute positioning of elements within a page was considered a bad practice, ... | Absolute and relative positioning each have their own use cases and benefits, and the choice between them often depends on the specific requirements of your layout. Here's a breakdown of the differences and some guidelines for when to use each:
### Absolute Positioning
- **Definition**: Elements with `position: absolu... | 19,321 | [
{
"from": "human",
"value": "I was developing a web page, where I was laying out a board for a Chess-like game, along with a couple of piece trays. It's all done using HTML (with jQuery for dynamic updating as the game is played). Somewhere I'd got the notion that using absolute positioning of elements with... |
I saw an article on creating Excel UDFs in VSTO managed code, using VBA: http://blogs.msdn.com/pstubbs/archive/2004/12/31/344964.aspx.
However I want to get this working in a C# Excel add-in using VSTO 2005 SE, can any one help?
I tried the technique Romain pointed out but when trying to load Excel I get the following... | The issue you are experiencing is likely due to a type mismatch between the arguments you are passing to your User Defined Function (UDF) in your C# Excel Add-in using VSTO. Below is a detailed guide on how to set up an Excel UDF in C# using VSTO, along with how to avoid common pitfalls that may lead to the "type misma... | 16,631 | [
{
"from": "human",
"value": "I saw an article on creating Excel UDFs in VSTO managed code, using VBA: http://blogs.msdn.com/pstubbs/archive/2004/12/31/344964.aspx. \nHowever I want to get this working in a C# Excel add-in using VSTO 2005 SE, can any one help?\nI tried the technique Romain pointed out but wh... |
How can our team gather requirements from our "Product Owner" in as low friction yet useable of a way as possible?
Now here's the guidelines- No posts that it can't be done or that the business needs to make a decision that it cares about quality, yada yada. The product I work for is a small group that has been success... | It's great that you’re looking to improve the way your team gathers requirements in a low-friction, usable manner. Here are some strategies that could help streamline the process while being mindful of the Product Owner's time constraints:
1. **Synchronized Meeting Notes**:
- After each meeting, designate one team ... | 13,040 | [
{
"from": "human",
"value": "How can our team gather requirements from our \"Product Owner\" in as low friction yet useable of a way as possible?\nNow here's the guidelines- No posts that it can't be done or that the business needs to make a decision that it cares about quality, yada yada. The product I wor... |
I'm really baffled by this - I know how to do this in VB, unmanaged C++ and C# but for some reason I can't accept a ref variable of a managed type in C++. I'm sure there's a simple answer, really - but here's the C# equivalent:
myClass.myFunction(ref variableChangedByfunction);
I've tried C++ pointers - no dice. I've ... | In C++/CLI, which is the managed extension of C++, the equivalent of passing a variable by reference is somewhat different than in C#. You cannot directly use the `ref` keyword as in C#. Instead, you typically use a managed pointer (`%`) for reference semantics.
Here's how you can implement a function that accepts a r... | 21,943 | [
{
"from": "human",
"value": "I'm really baffled by this - I know how to do this in VB, unmanaged C++ and C# but for some reason I can't accept a ref variable of a managed type in C++. I'm sure there's a simple answer, really - but here's the C# equivalent:\nmyClass.myFunction(ref variableChangedByfunction);... |
I'm using OpenGL ES on a low-resolution, embedded device.
I've applied a vertical color gradient, using vertex coloring, to a large polygon serving as a backdrop to my rendered scene. I can see clear visible banding artifacts in the color gradient.
My main experience is using software renderers. With software renderers... | In OpenGL ES, you can certainly implement dithering to help mitigate color banding artifacts in your gradient rendering. However, dithering is not an automatic part of the OpenGL pipeline, and you will need to implement it manually. Here are a couple of approaches you can take:
### 1. **Dithering in Shader Code**
You... | 22,087 | [
{
"from": "human",
"value": "I'm using OpenGL ES on a low-resolution, embedded device.\nI've applied a vertical color gradient, using vertex coloring, to a large polygon serving as a backdrop to my rendered scene. I can see clear visible banding artifacts in the color gradient.\nMy main experience is using ... |
I've got a LOT of tests written for a piece of software (which is a GREAT thing) but it was built essentially as a standalone test in C#. While this works well enough, it suffers from a few shortcomings, not the least of which is that it isn't using a standard testing framework and ends up requiring the person running... | Migrating a large amount of test code into a proper testing framework like NUnit or MSTest can indeed seem daunting, especially when you have a substantial codebase to work with. However, with a structured approach and the right tools, you can make this process smoother and more manageable. Here are some steps and tips... | 18,245 | [
{
"from": "human",
"value": "I've got a LOT of tests written for a piece of software (which is a GREAT thing) but it was built essentially as a standalone test in C#. While this works well enough, it suffers from a few shortcomings, not the least of which is that it isn't using a standard testing framework... |
What is the easiest way to match non-ASCII characters in a regex? I would like to match all words individually in an input string, but the language may not be English, so I will need to match things like ü, ö, ß, and ñ. Also, this is in Javascript/jQuery, so any solution will need to apply to that.
| To match non-ASCII characters in a regex in JavaScript, you can use Unicode property escapes, which provide a powerful way to match characters based on their Unicode properties.
For matching words that include any non-ASCII characters, you can use the `\p{L}` Unicode property escape, which matches any character that i... | 23,230 | [
{
"from": "human",
"value": "What is the easiest way to match non-ASCII characters in a regex? I would like to match all words individually in an input string, but the language may not be English, so I will need to match things like ü, ö, ß, and ñ. Also, this is in Javascript/jQuery, so any solution will ne... |
It is possible to prevent scroll bars from appearing when you drag a Mdichild outside the bounds of the Mdiparent in vb.net?
I would prefer the solution to not involve checking the posistion of the child form as there are too many forms to alter.
Obviously autoscroll is set to false on the mdiparent
and setting VScrol... | In a Windows Forms application using VB.NET, if you want to prevent scroll bars from appearing when an MDI child form is dragged outside the bounds of its MDI parent form, the default behavior of the MDI parent is to allow the MDI child to be dragged out of its bounds, and this can cause the scroll bars to appear when ... | 19,898 | [
{
"from": "human",
"value": "It is possible to prevent scroll bars from appearing when you drag a Mdichild outside the bounds of the Mdiparent in vb.net? \nI would prefer the solution to not involve checking the posistion of the child form as there are too many forms to alter.\nObviously autoscroll is set t... |
This question is fairly straightforward -- I am trying to debug a memory leak in a silverlight application using s.o.s. I was able to get some good info using !gcroot to determine what objects have open references to the one that should be getting cleared; but in these cases they tend to be core UI elements (like grid... | Debugging memory leaks in Silverlight applications can indeed be tricky due to the way that dependency properties and UI elements are managed. Here are some steps and tips to help you identify the values of dependency properties associated with UI elements, which can help you differentiate between them during your debu... | 19,377 | [
{
"from": "human",
"value": "This question is fairly straightforward -- I am trying to debug a memory leak in a silverlight application using s.o.s. I was able to get some good info using !gcroot to determine what objects have open references to the one that should be getting cleared; but in these cases th... |
I wrote a SQL function to convert a datetime value in SQL to a friendlier "n Hours Ago" or "n Days Ago" etc type of message. And I was wondering if there was a better way to do it.
(Yes I know "don't do it in SQL" but for design reasons I have to do it this way).
Here is the function I've written:
CREATE FUNCTION dbo.... | Your SQL function for converting datetime values into a more human-friendly format is quite functional, but there are definitely opportunities for simplification and improvement. Here are a few suggestions to enhance readability, maintainability, and efficiency:
1. **Reduce Redundancy**: You can combine the time inter... | 18,130 | [
{
"from": "human",
"value": "I wrote a SQL function to convert a datetime value in SQL to a friendlier \"n Hours Ago\" or \"n Days Ago\" etc type of message. And I was wondering if there was a better way to do it. \n(Yes I know \"don't do it in SQL\" but for design reasons I have to do it this way).\nHere i... |
How do I pull out the filename from a full path using regular expressions in C#?
Say I have the full path C:\CoolDirectory\CoolSubdirectory\CoolFile.txt.
How do I get out CoolFile.txt using the .NET flavor of regular expressions? I'm not really good with regular expressions, and my RegEx buddy and me couldn't figure th... | It's great that you're exploring regular expressions! To extract the filename from a full path using regular expressions in C#, you can use the following pattern:
```csharp
var pattern = @"[^\\]+$";
```
This pattern works as follows:
- `[^\\]` matches any character that is not a backslash.
- `+` means "one or more" ... | 22,162 | [
{
"from": "human",
"value": "How do I pull out the filename from a full path using regular expressions in C#?\nSay I have the full path C:\\CoolDirectory\\CoolSubdirectory\\CoolFile.txt.\nHow do I get out CoolFile.txt using the .NET flavor of regular expressions? I'm not really good with regular expressions... |
I have a table with one field that can point to a foreign key in one of 3 other tables based on what the descriminator value is (Project, TimeKeep, or CostCenter. Usually this is implemented with subclasses, and I am wondering if what I have below will work. Note the subclass name is the same as the parent class and ... | The implementation you've provided contains a few misconceptions and issues related to Hibernate's handling of polymorphic associations and the way you are using subclasses. Here are some points to consider:
1. **Subclassing and Discriminator Value**: In Hibernate, subclasses represent different entities that extend a... | 19,070 | [
{
"from": "human",
"value": "I have a table with one field that can point to a foreign key in one of 3 other tables based on what the descriminator value is (Project, TimeKeep, or CostCenter. Usually this is implemented with subclasses, and I am wondering if what I have below will work. Note the subclass ... |
Can anyone recommend a good Source Code control (SCC) that works for the mostly disconnected consultant? I'd prefer something that allows one to save into a local repository and then once connected 'syncs' to the server however I've never seen such a feature. Suggestions? [Windows solution is preferred that integrates ... | For a mostly disconnected consultant looking for a source code control (SCC) solution that allows local repositories and syncing to a server, here are some popular options you might consider:
### 1. **Git**
- **Overview**: Git is a distributed version control system that allows you to create a local repository. You ca... | 21,263 | [
{
"from": "human",
"value": "Can anyone recommend a good Source Code control (SCC) that works for the mostly disconnected consultant? I'd prefer something that allows one to save into a local repository and then once connected 'syncs' to the server however I've never seen such a feature. Suggestions? [Windo... |
What is the easiest way to test (using reflection), whether given method (i.e. java.lang.Method instance) has a return type, which can be safely casted to List<String>?
Consider this snippet:
public static class StringList extends ArrayList<String> {}
public List<String> method1();
public ArrayList<String> method2();
... | To determine whether a given method (represented as a `java.lang.Method` instance) has a return type that can be safely cast to `List<String>`, you can follow these steps using reflection in Java:
1. **Check the Return Type**: First, get the return type of the method using `getGenericReturnType()`. This will allow you... | 16,079 | [
{
"from": "human",
"value": "What is the easiest way to test (using reflection), whether given method (i.e. java.lang.Method instance) has a return type, which can be safely casted to List<String>?\nConsider this snippet:\npublic static class StringList extends ArrayList<String> {}\n\npublic List<String> me... |
I'm working with JIntegra java com bridge.
I have an object of type Object which true coclass is unknown.
I need to check if that object can be casted to specific COM interface (which has a proxy class generated by JIntegra).
| To check if an object of type `Object` can be cast to a specific COM interface using JIntegra, you can use the `instanceof` operator along with the proxy class generated by JIntegra for that COM interface.
Here’s a general approach you can take:
1. Ensure that you have the proxy class for the specific COM interface ... | 19,773 | [
{
"from": "human",
"value": "I'm working with JIntegra java com bridge.\nI have an object of type Object which true coclass is unknown.\nI need to check if that object can be casted to specific COM interface (which has a proxy class generated by JIntegra).\n"
},
{
"from": "gpt",
"value": "To che... |
I'm going through MSIL and noticing there are a lot of nop instructions in the MSIL.
The MSDN article says they take no action and are used to fill space if the opcode is patched. They're used a lot more in debug builds than release builds.
I know that these kinds of statements are used in assembly languages to align l... | In MSIL (Microsoft Intermediate Language), NOP (No Operation) instructions indeed serve several purposes, primarily related to the management and organization of code rather than direct execution. Here are some reasons why NOPs are used in MSIL:
1. **Space Filling**: As you noted, NOPs can act as placeholders in the e... | 24,127 | [
{
"from": "human",
"value": "I'm going through MSIL and noticing there are a lot of nop instructions in the MSIL.\nThe MSDN article says they take no action and are used to fill space if the opcode is patched. They're used a lot more in debug builds than release builds.\nI know that these kinds of statement... |
I'm trying to get all the direct reports of a User through Active Directory, recursively.
So given a user, i will end up with a list of all users who have this person as manager or who have a person as manager who has a person as manager ... who eventually has the input user as manager.
My current attempt is rather slo... | Your optimization by searching based on the `manager` attribute is a significant improvement for fetching direct reports recursively from Active Directory (AD). Below are some additional suggestions that can further enhance the efficiency and readability of your method, along with ensuring best practices for handling A... | 17,582 | [
{
"from": "human",
"value": "I'm trying to get all the direct reports of a User through Active Directory, recursively.\nSo given a user, i will end up with a list of all users who have this person as manager or who have a person as manager who has a person as manager ... who eventually has the input user as... |
I'm trying to find about ALL the possible options that I can set in web.config.
Surprisingly, I can't find this at all. I expected it to be somewhere inside MSDN.
I know I can technically add "anything" to web.config, what I'm looking for is the things that the .NET Framework "as shipped" uses.
In particular, right now... | In ASP.NET, the `web.config` file is used to configure various settings for your web application, including mail settings in the `<system.net>` section. You're correct that while you can technically add any XML to `web.config`, the framework recognizes certain predefined sections and attributes.
To find the official d... | 20,843 | [
{
"from": "human",
"value": "I'm trying to find about ALL the possible options that I can set in web.config.\nSurprisingly, I can't find this at all. I expected it to be somewhere inside MSDN.\nI know I can technically add \"anything\" to web.config, what I'm looking for is the things that the .NET Framewor... |
I'm running a MySQL database locally for development, but deploying to Heroku which uses Postgres. Heroku handles almost everything, but my case-insensitive Like statements become case sensitive. I could use iLike statements, but my local MySQL database can't handle that.
What is the best way to write a case insensitiv... | To ensure compatibility between MySQL and PostgreSQL when it comes to case-insensitive searches, you can use a couple of approaches. Below are the recommended strategies:
### 1. Use `LOWER()` Function
You can standardize your queries by transforming both the column and the search term to lowercase (or uppercase) usin... | 19,879 | [
{
"from": "human",
"value": "I'm running a MySQL database locally for development, but deploying to Heroku which uses Postgres. Heroku handles almost everything, but my case-insensitive Like statements become case sensitive. I could use iLike statements, but my local MySQL database can't handle that.\nWhat ... |
I'm looking for a tool that will be able to build a parser (in C#) if I give it a BNF grammar (eg. http://savage.net.au/SQL/sql-2003-2.bnf)
Does such a generator exist?
| Yes, there are several parser generators that can take a BNF (Backus-Naur Form) grammar and produce a parser in C#. Here are a few options you might consider:
1. **ANTLR (ANother Tool for Language Recognition)**:
- ANTLR is a powerful parser generator that can generate parsers in multiple languages, including C#. W... | 17,668 | [
{
"from": "human",
"value": "I'm looking for a tool that will be able to build a parser (in C#) if I give it a BNF grammar (eg. http://savage.net.au/SQL/sql-2003-2.bnf)\nDoes such a generator exist?\n"
},
{
"from": "gpt",
"value": "Yes, there are several parser generators that can take a BNF (Ba... |
I can't tell you how many times I've run into situations where a higher-up says 'Look, just do it'. This is obviously at the expense of rigidity in the planning process, and will (probably) affect product quality.
By now, I have more experience with this, and with that, I have the confidence to stand up for the quality... | Handling the "just do it" directive from higher-ups can be challenging, especially when it comes to maintaining product quality and adhering to best practices in development. Here are some strategies to navigate this situation:
### 1. **Communicate Clearly**
- **Understand the Context**: Before responding, ensure y... | 18,216 | [
{
"from": "human",
"value": "I can't tell you how many times I've run into situations where a higher-up says 'Look, just do it'. This is obviously at the expense of rigidity in the planning process, and will (probably) affect product quality.\nBy now, I have more experience with this, and with that, I have ... |
I've been a longtime ASP.NET developer in the web forms model, and am using a new project as an opportunity to get my feet wet with ASP.NET MVC.
The application will need an API so that a group of other apps can communicate with it. I've always built API's out just using a standard web service prior to this.
As a side... | Welcome to the world of ASP.NET MVC! It's great that you're exploring new technologies and patterns. Given your background and current project requirements, there are several options for building an API in ASP.NET MVC while addressing your concerns about versioning and organization.
### ASP.NET MVC for APIs
You can c... | 20,252 | [
{
"from": "human",
"value": "I've been a longtime ASP.NET developer in the web forms model, and am using a new project as an opportunity to get my feet wet with ASP.NET MVC.\nThe application will need an API so that a group of other apps can communicate with it. I've always built API's out just using a sta... |
Shark on Mac OS X is a great tool for profiling an application on a running system. Is there any similar tools for Linux?
OProfile looks like it could be, anyone used it?
| Yes, OProfile is indeed a powerful tool for profiling applications on Linux systems. It is similar in concept to Shark on macOS, allowing you to analyze the performance of your applications and identify bottlenecks.
### OProfile
- **Overview**: OProfile is a system-wide profiler for Linux systems, capable of profiling... | 23,280 | [
{
"from": "human",
"value": "Shark on Mac OS X is a great tool for profiling an application on a running system. Is there any similar tools for Linux? \nOProfile looks like it could be, anyone used it? \n"
},
{
"from": "gpt",
"value": "Yes, OProfile is indeed a powerful tool for profiling applic... |
I use RegexBuddy while working with regular expressions. From its library I copied the regular expression to match URLs. I tested successfully within RegexBuddy. However, when I copied it as Java String flavor and pasted it into Java code, it does not work. The following class prints false:
public class RegexFoo {
... | The issue you're experiencing is related to how the `matches()` method works in Java's `Matcher` class. The `matches()` method attempts to match the entire input string against the pattern, while your regex is designed to match URLs that may appear anywhere in the string (because it contains `\b`, which indicates a wor... | 22,241 | [
{
"from": "human",
"value": "I use RegexBuddy while working with regular expressions. From its library I copied the regular expression to match URLs. I tested successfully within RegexBuddy. However, when I copied it as Java String flavor and pasted it into Java code, it does not work. The following class p... |
I have a web form that I am attempting to implement dynamic drop down lists on using the .NET AJAX 1.0 extensions. I have successfully implemented the needed bits, but have an interesting quirk.
When I select a value from my first drop down list, my call back happens and my page is updated correctly. The next value I s... | The issue you're encountering relates to how ASP.NET handles requests and the URL resolution when using `Server.Transfer`. When you perform a `Server.Transfer`, the URL in the browser remains that of the original page (e.g., `Page1.aspx`), but the server processes the request for the destination page (e.g., `NewPlanned... | 21,200 | [
{
"from": "human",
"value": "I have a web form that I am attempting to implement dynamic drop down lists on using the .NET AJAX 1.0 extensions. I have successfully implemented the needed bits, but have an interesting quirk.\nWhen I select a value from my first drop down list, my call back happens and my pag... |
I am thinking along the lines of replicating a web hosts PHP setup environment for offline local development. The idea is to parse the output of phpinfo() and write any setup values it contains into a local php.ini. I would imagine everything ism included in phpinfo and that certain things would only be specific to th... | Replicating a web host's PHP setup environment for offline local development can be a great way to ensure that your development environment closely matches the production environment. Using the output of `phpinfo()` to generate a local `php.ini` file is a useful approach, though there are some caveats to consider. Here... | 16,235 | [
{
"from": "human",
"value": "I am thinking along the lines of replicating a web hosts PHP setup environment for offline local development. The idea is to parse the output of phpinfo() and write any setup values it contains into a local php.ini. I would imagine everything ism included in phpinfo and that ce... |
I'm working on trying to generate a report from a couple of database tables. The simplified version looks like this
Campaign
----------
CampaignID
Source
-----------------------
Source_ID | Campaign_ID
Content
---------------------------------------------------------
Content_ID | Campaign_ID | Content_Row_ID | Conten... | Certainly! To generate a report from your database tables by pivoting rows into columns in an Oracle 10g database, you can use a combination of SQL queries with either `JOIN` statements or the `PIVOT` operator. Since you are looking to select specific content rows based on their identifiers (like "A" and "B"), you can ... | 21,332 | [
{
"from": "human",
"value": "I'm working on trying to generate a report from a couple of database tables. The simplified version looks like this\nCampaign\n----------\nCampaignID\n\nSource\n-----------------------\nSource_ID | Campaign_ID\n\nContent\n---------------------------------------------------------... |
I getting the following error when I try to connect to my server app using remoting:
A problem seems to have occured whilst connecting to the remote server:
Server encountered an internal error. For more information, turn off customErrors in the server's .config file.
This is the code on my server app:
TcpChannel t... | The issue you're encountering may be related to the way your server application is managing its remoting objects and the associated channels. Here are several things to consider that could help you troubleshoot and resolve the problem:
1. **Channel Registration**: Ensure that you are registering your TCP channel befor... | 21,090 | [
{
"from": "human",
"value": "I getting the following error when I try to connect to my server app using remoting:\n\nA problem seems to have occured whilst connecting to the remote server:\n Server encountered an internal error. For more information, turn off customErrors in the server's .config file.\n\nT... |
Is there a way to print all methods of an object in JavaScript?
| Yes, you can print all methods of an object in JavaScript by using a combination of the `Object.getOwnPropertyNames` method, the `typeof` operator, and filtering the results to only include functions. Here's how you can do it:
### Example Code
```javascript
function printMethods(obj) {
const methods = Object.getO... | 22,370 | [
{
"from": "human",
"value": "Is there a way to print all methods of an object in JavaScript?\n"
},
{
"from": "gpt",
"value": "Yes, you can print all methods of an object in JavaScript by using a combination of the `Object.getOwnPropertyNames` method, the `typeof` operator, and filtering the resu... |
If I have a VB.Net function that returns an Int32, but uses an unsigned int (UInt32) for calculations, etc. How can I convert a variable "MyUintVar32" with a value of say "3392918397 into a standard Int32 in VB.Net?
In c# if I just do a "return (int)(MyUintVar32);", I get -902048899, not an error.
I've tried several... | In VB.Net, you can convert an `UInt32` value (which is an unsigned integer) to an `Int32` (which is a signed integer) similarly to how you do it in C#. However, it's essential to remember that when you convert a `UInt32` value that exceeds the maximum value of an `Int32`, you will end up with a negative number, as the ... | 22,838 | [
{
"from": "human",
"value": "If I have a VB.Net function that returns an Int32, but uses an unsigned int (UInt32) for calculations, etc. How can I convert a variable \"MyUintVar32\" with a value of say \"3392918397 into a standard Int32 in VB.Net? \nIn c# if I just do a \"return (int)(MyUintVar32);\", I g... |
I have to lock user accounts in Active Directory programmatically in C#.
Unfortunately it doesn't work via the userAccountControl attribute. Every time I set userAccountControl to 528 (=normal account w/ lockout flag), Active Directory won't accept the value and resets it without further notice to 512 (=normal account... | Locking a user account in Active Directory programmatically can be a bit tricky. The `userAccountControl` attribute is indeed used to manage account lockout states, but it's important to understand how the lockout mechanism works in Active Directory.
Here are some key points to consider:
1. **User Account Control (UA... | 18,151 | [
{
"from": "human",
"value": "I have to lock user accounts in Active Directory programmatically in C#. \nUnfortunately it doesn't work via the userAccountControl attribute. Every time I set userAccountControl to 528 (=normal account w/ lockout flag), Active Directory won't accept the value and resets it with... |
How is it possible for this to be true
XmlDocument d = BuildReportXML(schema);
DataSet ds = new DataSet();
ds.ReadXmlSchema(schema);
ds.ReadXml(new XmlNodeReader(d));
Schema is the schema location that I apply to the XmlDocument before I start setting data, assuring that all the columns are of the correct type. Then I... | The error "Input string was not in a correct format" that you're encountering when loading your XML data into a `DataSet` is often related to data type mismatches, particularly with decimal fields. Even though your `XmlDocument` is well-formed and you have applied the schema correctly, there are a few things to conside... | 19,102 | [
{
"from": "human",
"value": "How is it possible for this to be true\nXmlDocument d = BuildReportXML(schema);\nDataSet ds = new DataSet();\nds.ReadXmlSchema(schema);\nds.ReadXml(new XmlNodeReader(d));\n\nSchema is the schema location that I apply to the XmlDocument before I start setting data, assuring that ... |
lsof is an increadibly powerful command-line utility for unix systems. It lists open files, displaying information about them. And since most everything is a file on unix systems, lsof can give sysadmins a ton of useful diagnostic data.
What are some of the most common and useful ways of using lsof, and which command-l... | `lsof` is indeed a powerful tool for diagnosing issues related to file usage in Unix/Linux systems. Here are some common and useful ways to use `lsof`, along with their corresponding command-line switches:
1. **List all open files**:
```bash
lsof
```
This command lists all open files by all processes.
2. ... | 17,776 | [
{
"from": "human",
"value": "lsof is an increadibly powerful command-line utility for unix systems. It lists open files, displaying information about them. And since most everything is a file on unix systems, lsof can give sysadmins a ton of useful diagnostic data.\nWhat are some of the most common and usef... |
I use an activex component in my C# program that was created with Delphi. It works fine a lot of the time, but occasionally (sometimes frequently!) the component crashes with this exception:
Exception EOSError (A call to an OS function failed)(0)
which leaves the control in a somewhat unusable state until the progra... | Debugging issues with ActiveX components, especially those created in Delphi and used in a C# environment, can be quite challenging. The `EOSError` exception indicates that there was an error in a call to an operating system function, which could stem from a variety of underlying causes. Here are some ideas that may he... | 21,193 | [
{
"from": "human",
"value": "I use an activex component in my C# program that was created with Delphi. It works fine a lot of the time, but occasionally (sometimes frequently!) the component crashes with this exception:\n\nException EOSError (A call to an OS function failed)(0)\n\nwhich leaves the control ... |
Imagine I have these python lists:
keys = ['name', 'age']
values = ['Monty', 42, 'Matt', 28, 'Frank', 33]
Is there a direct or at least a simple way to produce the following list of dictionaries ?
[
{'name': 'Monty', 'age': 42},
{'name': 'Matt', 'age': 28},
{'name': 'Frank', 'age': 33}
]
| Yes, you can create a list of dictionaries from the `keys` and `values` lists in a straightforward manner using a list comprehension along with the `zip` function. You can achieve this by grouping the values in pairs and creating a dictionary for each pair. Here's how you can do it:
```python
keys = ['name', 'age']
va... | 25,342 | [
{
"from": "human",
"value": "Imagine I have these python lists:\nkeys = ['name', 'age']\nvalues = ['Monty', 42, 'Matt', 28, 'Frank', 33]\n\nIs there a direct or at least a simple way to produce the following list of dictionaries ?\n[\n {'name': 'Monty', 'age': 42},\n {'name': 'Matt', 'age': 28},\n ... |
Say if I had a table of books in a MySQL database and I wanted to search the 'title' field for keywords (input by the user in a search field); what's the best way of doing this in PHP? Is the MySQL LIKE command the most efficient way to search?
| When searching for keywords in a database using the `title` field in a MySQL table, the `LIKE` operator is a common method, but it may not always be the most efficient, especially for larger datasets. Here’s a breakdown of your options and how to implement them in PHP:
### 1. Using MySQL `LIKE`
The `LIKE` operator all... | 21,895 | [
{
"from": "human",
"value": "Say if I had a table of books in a MySQL database and I wanted to search the 'title' field for keywords (input by the user in a search field); what's the best way of doing this in PHP? Is the MySQL LIKE command the most efficient way to search?\n"
},
{
"from": "gpt",
... |
I'm trying to pass one method to another in elisp, and then
have that method execute it. Here is an example:
(defun t1 ()
"t1")
(defun t2 ()
"t1")
(defun call-t (t)
; how do I execute "t"?
(t))
; How do I pass in method reference?
(call-t 't1)
| In Emacs Lisp (elisp), you can pass the reference of a function to another function and then call that function. When you pass a function as an argument, you typically use the `function` special form or just quote the function name using a single quote. Here is how you can modify your example to work correctly:
```eli... | 21,180 | [
{
"from": "human",
"value": "I'm trying to pass one method to another in elisp, and then\nhave that method execute it. Here is an example:\n(defun t1 ()\n \"t1\")\n\n(defun t2 ()\n \"t1\")\n\n(defun call-t (t)\n ; how do I execute \"t\"?\n (t))\n\n; How do I pass in method reference?\n(call-t 't1)\n\n"... |
I'm learning DirectX as part of a hobby project. I've been looking for some good online resources for DirectX9 (using C++, if that distinction matters), but haven't found anything that's a) great for a beginner and b) up to date.
Any recommendations?
| Learning DirectX 9 can be a rewarding experience, especially if you're looking to develop graphics applications or games. While DirectX 9 is quite dated, there are still some resources that can help you get started. Here are some recommendations for online resources that cater to beginners:
1. **Official DirectX SDK D... | 19,422 | [
{
"from": "human",
"value": "I'm learning DirectX as part of a hobby project. I've been looking for some good online resources for DirectX9 (using C++, if that distinction matters), but haven't found anything that's a) great for a beginner and b) up to date.\nAny recommendations?\n"
},
{
"from": "gp... |
Is there an easy way to create standalone .exe files from Lua scripts? Basically this would involve linking the Lua interpreter and the scripts.
I believe it is possible (PLT Scheme allows the creation of standalone executables in the same way), but how, exactly?
| Creating standalone `.exe` files from Lua scripts typically involves packaging the Lua interpreter along with your scripts into a single executable. There are several tools and methods to accomplish this:
### 1. **LuaJIT + LuaJIT Compiler**
LuaJIT is a Just-In-Time Compiler for Lua which can be used to compile Lua scr... | 18,334 | [
{
"from": "human",
"value": "Is there an easy way to create standalone .exe files from Lua scripts? Basically this would involve linking the Lua interpreter and the scripts.\nI believe it is possible (PLT Scheme allows the creation of standalone executables in the same way), but how, exactly?\n"
},
{
... |
Logging can get complicated, quickly. Considering that you have some code, how do you add logging to it? What library(ies) do you use?
What are some good code techniques for getting the most out of your logging statements while having minimal impact on your application?
| Adding logging to your code can indeed complicate things, but it is crucial for understanding application behavior, especially in production environments. Here’s a step-by-step guide on how to effectively add logging, which libraries to use, and techniques to maximize the utility of your logging statements while minimi... | 18,403 | [
{
"from": "human",
"value": "Logging can get complicated, quickly. Considering that you have some code, how do you add logging to it? What library(ies) do you use? \nWhat are some good code techniques for getting the most out of your logging statements while having minimal impact on your application?\n"
}... |
I'm using watermark extenders on textboxes and an exception is being thrown from the AJAX Control Toolkit .dll. It's strange because this just started happening.
I tried debugging from the Ajax solution and Ajax examples (but with my code), but no dice.
Is there a way to step into the Ajax .dll from my solution to s... | Yes, you can step into the AJAX Control Toolkit's DLL to debug the issue you're experiencing with the watermark extender. Here’s how you can do that:
### 1. Obtain the Source Code
The AJAX Control Toolkit is open-source, and you can find the source code on GitHub. You can either clone the repository or download it as ... | 21,509 | [
{
"from": "human",
"value": "I'm using watermark extenders on textboxes and an exception is being thrown from the AJAX Control Toolkit .dll. It's strange because this just started happening. \nI tried debugging from the Ajax solution and Ajax examples (but with my code), but no dice. \nIs there a way to st... |
I'm working on a forums system. I'm trying to allow users to see the posts they've made. In order for this link to work, I'd need to jump to the page on the particular topic they posted in that contained their post, so the bookmarks could work, etc. Since this is a new feature on an old forum, I'd like to code it so t... | To achieve your goal of determining the position of a specific row in a sorted query without having to explicitly keep track of all the posts, you can utilize SQL window functions. Specifically, you can use the `ROW_NUMBER()` function to assign a unique sequential integer to rows in the result set based on a specified ... | 20,991 | [
{
"from": "human",
"value": "I'm working on a forums system. I'm trying to allow users to see the posts they've made. In order for this link to work, I'd need to jump to the page on the particular topic they posted in that contained their post, so the bookmarks could work, etc. Since this is a new feature ... |
I need to replace all WinAPI calls of the
CreateFile,
ReadFile,
SetFilePointer,
CloseHandle
with my own implementation (which use low-level file reading via Bluetooth).
The code, where functions will be replaced, is Video File Player and it already works with the regular hdd files.
It is also needed, that Video P... | To replace the specified WinAPI calls with your own implementation while still allowing the original functionality for HDD files, you can follow these best practices:
### 1. Abstraction Layer
Create an abstraction layer for file operations. This way, you can easily switch between HDD and Bluetooth implementations wit... | 13,823 | [
{
"from": "human",
"value": "I need to replace all WinAPI calls of the\n\nCreateFile, \nReadFile, \nSetFilePointer,\nCloseHandle \n\nwith my own implementation (which use low-level file reading via Bluetooth).\nThe code, where functions will be replaced, is Video File Player and it already works with the r... |
I am working on a program that makes RPC calls where the client and the server are running on the same machine. I want the client have a timeout on its calls to the server because we ran into problems of it becoming unresponsive waiting on the server.
In order to solve this problem, we used an asynchronous RPC call and... | It sounds like you're experiencing a very specific issue with the RPC subsystem on Windows Vista, especially related to asynchronous RPC calls and timeouts. This kind of problem can be quite challenging, particularly when the crash occurs within system libraries (in this case, `rpcrt4.dll`) and isn't directly related t... | 19,481 | [
{
"from": "human",
"value": "I am working on a program that makes RPC calls where the client and the server are running on the same machine. I want the client have a timeout on its calls to the server because we ran into problems of it becoming unresponsive waiting on the server.\nIn order to solve this pro... |
I want to deploy my site on my web hosting package by doing a checkout through subversion. I do not have SSH access to my hosting package, which is just a basic LAMP web hosting package, but I do know that there is an SVN client installed on the web server.
I was thinking of writing some sort of script (PHP or Shell) t... | It sounds like you have a solid plan in place for deploying your site using Subversion (SVN) without SSH access. Using cron jobs to execute shell scripts is a practical approach to automate your deployment processes. Here are some best practices and suggestions to enhance your current setup:
### Best Practices
1. **K... | 19,544 | [
{
"from": "human",
"value": "I want to deploy my site on my web hosting package by doing a checkout through subversion. I do not have SSH access to my hosting package, which is just a basic LAMP web hosting package, but I do know that there is an SVN client installed on the web server.\nI was thinking of wr... |
Are pipes considered dangerous to use in Windows, from a security standpoint?
| Yes, using pipes in Windows can present certain security risks, though they are also useful for inter-process communication. Here are some potential security concerns associated with their use:
1. **Unauthorized Access**: If named pipes are not secured properly, unauthorized processes could access them, potentially le... | 23,505 | [
{
"from": "human",
"value": "Are pipes considered dangerous to use in Windows, from a security standpoint?\n"
},
{
"from": "gpt",
"value": "Yes, using pipes in Windows can present certain security risks, though they are also useful for inter-process communication. Here are some potential securit... |
In my php web app, suppose I want to go the extra mile and in addition to going gang-busters and being anal-retentive about sanitizing my inputs, I also want to ensure that no JavaScript is being output in strings I am inserting into html templates.
Is there a standard way to make sure I don't put JavaScript in the ge... | When developing a PHP web application and aiming to prevent JavaScript (or any other malicious code) from being output in your HTML templates, you can follow several best practices to sanitize and escape your output effectively. Here are some standard techniques:
### 1. **HTML Escape Output**
One of the simplest and ... | 21,631 | [
{
"from": "human",
"value": "In my php web app, suppose I want to go the extra mile and in addition to going gang-busters and being anal-retentive about sanitizing my inputs, I also want to ensure that no JavaScript is being output in strings I am inserting into html templates. \nIs there a standard way to ... |
I have a question about asp.net compiling. I know the different ways you can compile but my question is with the default method.
Microsoft says that pages and code are compiled on their first use and then cached. My question is, when does that cache clear...
when the app pool recycles? Or, does it cache it until i... | In ASP.NET, the default compilation behavior does indeed cache the compiled assemblies of your pages and code after the first use. Here's how caching works in relation to your questions about application pool recycling and server reboots:
1. **First Use Compilation**: When an ASP.NET application is accessed for the fi... | 22,113 | [
{
"from": "human",
"value": "I have a question about asp.net compiling. I know the different ways you can compile but my question is with the default method. \nMicrosoft says that pages and code are compiled on their first use and then cached. My question is, when does that cache clear... \nwhen the app p... |
We are using the Infragistics controls for .net (both ASP.Net and WinForms) for a few years. We want to upgrade our current version (v6.3) and are in a pickle. We can upgrade to v7.3 or v8.1 but not to a later one due to licensing limitations, and we don't want to spend more money on licenses unless it is really necess... | When it comes to upgrading Infragistics controls for .NET, there are several factors to consider, especially regarding stability, features, and your project's specific needs. Here's a breakdown of the options you mentioned:
### Upgrade to v7.3
**Pros:**
- **Familiarity**: If you are currently using v6.3, upgrading to ... | 19,694 | [
{
"from": "human",
"value": "We are using the Infragistics controls for .net (both ASP.Net and WinForms) for a few years. We want to upgrade our current version (v6.3) and are in a pickle. We can upgrade to v7.3 or v8.1 but not to a later one due to licensing limitations, and we don't want to spend more mon... |
As a follow up to a recent question, I wonder why it is impossible in Java, without attempting reading/writing on a TCP socket, to detect that the socket has been gracefully closed by the peer? This seems to be the case regardless of whether one uses the pre-NIO Socket or the NIO SocketChannel.
When a peer gracefully c... | The behavior you're observing in your Java socket implementation is rooted in how TCP and Java socket APIs manage connection states. Here are some clarifications on why you can't directly detect a peer's graceful closure without performing I/O operations:
### Understanding TCP Connection States
When one side of a TCP ... | 20,238 | [
{
"from": "human",
"value": "As a follow up to a recent question, I wonder why it is impossible in Java, without attempting reading/writing on a TCP socket, to detect that the socket has been gracefully closed by the peer? This seems to be the case regardless of whether one uses the pre-NIO Socket or the NI... |
I'd like to know what stored procedures are currently running to diagnose some performance problems. How can I find that out?
| To diagnose performance problems related to stored procedures currently running in a SQL Server database, you can use several methods. Below are some options you can try:
### 1. Using SQL Server Management Studio (SSMS)
You can use the Activity Monitor in SSMS:
1. Open SSMS and connect to your SQL Server instance.
2... | 21,028 | [
{
"from": "human",
"value": "I'd like to know what stored procedures are currently running to diagnose some performance problems. How can I find that out?\n"
},
{
"from": "gpt",
"value": "To diagnose performance problems related to stored procedures currently running in a SQL Server database, yo... |
As I am coding my unit tests, I tend to find that I insert the following lines:
Console.WriteLine("Starting InteropApplication, with runInBackground set to true...");
try
{
InteropApplication application = new InteropApplication(true);
application.Start();
Console.WriteLine("Application started correctly");... | When it comes to unit testing, the best practices can often differ based on the context and the team's workflow. However, there are some widely accepted principles that you can consider when deciding whether to log information during your tests.
### Guidelines for Unit Testing Output
1. **Silent by Default**: Unit te... | 22,800 | [
{
"from": "human",
"value": "As I am coding my unit tests, I tend to find that I insert the following lines:\nConsole.WriteLine(\"Starting InteropApplication, with runInBackground set to true...\");\ntry\n{\n InteropApplication application = new InteropApplication(true);\n application.Start();\n Co... |
Specifically, in VS 2008, I want to connect to a data source that you can have by right-clicking on the automatically-generated App_Data folder (an .mdf "database"). Seems easy, and it is once you know how.
| Connecting to a SQL Server database (.mdf) in Visual Studio 2008 using the App_Data folder is a straightforward process. Here’s a step-by-step guide to help you accomplish this:
### Step 1: Ensure Database is in App_Data Folder
1. **Create or Locate Database**: Make sure your `.mdf` file is located in the `App_Data` ... | 16,574 | [
{
"from": "human",
"value": "Specifically, in VS 2008, I want to connect to a data source that you can have by right-clicking on the automatically-generated App_Data folder (an .mdf \"database\"). Seems easy, and it is once you know how.\n"
},
{
"from": "gpt",
"value": "Connecting to a SQL Serve... |
Whilst refactoring some legacy C++ code I found that I could potentially remove some code duplication by somehow defining a variable that could point to any class method that shared the same signature. After a little digging, I found that I could do something like the following:
class MyClass
{
protected:
bool Cas... | Your approach to refactoring the code using a member function pointer is a valid strategy for reducing duplication in your `TestSwitch` method. Using function pointers is a common technique in C++ to decouple the selection logic from the method calls. However, there are a few considerations and alternatives you might w... | 14,676 | [
{
"from": "human",
"value": "Whilst refactoring some legacy C++ code I found that I could potentially remove some code duplication by somehow defining a variable that could point to any class method that shared the same signature. After a little digging, I found that I could do something like the following... |
Sometimes I add a \n at the end, and the relevant number of \t the beginning, and sometimes not - what's the recommended way to do this?
| The use of newline (`\n`) and tab (`\t`) characters in programming and data formatting depends on the context and the specific conventions of the language or format you're working with. Here are some guidelines to consider:
### Newlines (`\n`)
1. **Ending Statements**:
- It is generally a good practice to end you... | 22,285 | [
{
"from": "human",
"value": "Sometimes I add a \\n at the end, and the relevant number of \\t the beginning, and sometimes not - what's the recommended way to do this? \n"
},
{
"from": "gpt",
"value": "The use of newline (`\\n`) and tab (`\\t`) characters in programming and data formatting depen... |
I am writing a page where I need an HTML table to maintain a set size. I need the headers at the top of the table to stay there at all times but I also need the body of the table to scroll no matter how many rows are added to the table. Think a mini version of excel. This seems like a simple task but almost every solut... | To create a scrollable HTML table with fixed headers, you can use a combination of HTML and CSS. Here’s a simple implementation that achieves this:
1. **HTML Structure**: Create a table with headers and a body.
2. **CSS Styling**: Use `overflow` and `height` properties to create a scrollable body while keeping the hea... | 14,286 | [
{
"from": "human",
"value": "I am writing a page where I need an HTML table to maintain a set size. I need the headers at the top of the table to stay there at all times but I also need the body of the table to scroll no matter how many rows are added to the table. Think a mini version of excel. This seems ... |
Newbie WiX question: How do I
1. Copy a single-use shell script to temp along with the installer
e.g.
<Binary Id='permissions.cmd' src='permissions.cmd'/>
2. Find and run that script at the end of the install.
e.g.
<CustomAction Id='SetFolderPermissions' BinaryKey='permissions.cmd'
ExeCommand='permissions... | To achieve your goal of copying a shell script during the installation and executing it at the end, you can follow these steps. I'll clarify how to manage the binary, correctly set the paths, and handle the execution of the script.
### 1. Copying the Shell Script to Temp
You need to ensure that the `permissions.cmd` ... | 19,605 | [
{
"from": "human",
"value": "Newbie WiX question: How do I\n1. Copy a single-use shell script to temp along with the installer\ne.g. \n <Binary Id='permissions.cmd' src='permissions.cmd'/> \n\n2. Find and run that script at the end of the install.\ne.g. \n<CustomAction Id='SetFolderPermissions' BinaryKe... |
Why do I need to specify various driver info when I call a remote EJB?
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
java.naming.provider.url=localhost:1099
Shouldn't we only need to specify the url/port and the EJB container should... | When working with remote EJB (Enterprise JavaBeans) in Java EE, specifying various properties for the Java Naming and Directory Interface (JNDI) is necessary for a few reasons:
1. **JNDI Context Configuration**: JNDI is a part of the Java EE API that allows Java applications to look up resources like EJBs, DataSources... | 22,887 | [
{
"from": "human",
"value": "Why do I need to specify various driver info when I call a remote EJB?\njava.naming.factory.initial=org.jnp.interfaces.NamingContextFactory\njava.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces\njava.naming.provider.url=localhost:1099\n\nShouldn't we only need to spe... |
I am working on an application that detects the most prominent rectangle in an image, then seeks to rotate it so that the bottom left of the rectangle rests at the origin, similar to how IUPR's OSCAR system works. However, once the most prominent rectangle is detected, I am unsure how to take into account the depth co... | To achieve the goal of rotating a detected rectangle in an image so that its bottom left corner aligns with the origin, you'll need to consider both the 2D position of the rectangle in the image and the z-axis depth component to account for any tilt or perspective distortion. Here's a structured approach to tackle the ... | 12,323 | [
{
"from": "human",
"value": "I am working on an application that detects the most prominent rectangle in an image, then seeks to rotate it so that the bottom left of the rectangle rests at the origin, similar to how IUPR's OSCAR system works. However, once the most prominent rectangle is detected, I am uns... |
In terms of quick dynamically typed languages, I'm really starting to like Javascript, as I use it a lot for web projects, especially because it uses the same syntax as Actionscript (flash).
It would be an ideal language for shell scripting, making it easier to move code from the front and back end of a site, and less ... | Yes, there are several JavaScript interpreters and runtimes that you can use for shell scripting without requiring Java. One of the most popular and widely used options is **Node.js**. Here are a few key points about Node.js and other alternatives:
### 1. Node.js
- **Overview**: Node.js is a JavaScript runtime built o... | 17,249 | [
{
"from": "human",
"value": "In terms of quick dynamically typed languages, I'm really starting to like Javascript, as I use it a lot for web projects, especially because it uses the same syntax as Actionscript (flash).\nIt would be an ideal language for shell scripting, making it easier to move code from t... |
Is there a way to determine who is logged on to a particular (remote) machine given the IP address (or the workstation name) of the machine?
The machines in question are on an Active Directory Domain
The user running the script probably won't have any special rights on either their local or the remote machine
Operatin... | To determine who is logged onto a remote machine in an Active Directory domain environment, you can leverage several approaches. However, since you specified that the script should ideally be in VBScript or other specified languages, I will provide a solution using VBScript, as well as a C# example.
### VBScript Metho... | 19,888 | [
{
"from": "human",
"value": "Is there a way to determine who is logged on to a particular (remote) machine given the IP address (or the workstation name) of the machine?\n\nThe machines in question are on an Active Directory Domain\nThe user running the script probably won't have any special rights on eithe... |
I have a function that includes a file based on the string that gets passed to it i.e. the action variable from the query string. I use this for filtering purposes etc so people can't include files they shouldn't be able to and if the file doesn't exist a default file is loaded instead.
The problem is that when the fu... | It's great to hear that you've found a solution to your problem! Indeed, using `include` directly instead of encapsulating it within a function is often simpler and allows you to maintain the scope of your variables.
However, to address your initial question and provide some additional context:
1. **Scope in PHP**: I... | 20,461 | [
{
"from": "human",
"value": "I have a function that includes a file based on the string that gets passed to it i.e. the action variable from the query string. I use this for filtering purposes etc so people can't include files they shouldn't be able to and if the file doesn't exist a default file is loaded ... |
I'd like to generate unique random numbers between 0 and 1000 that never repeat (i.e. 6 doesn't show up twice), but that doesn't resort to something like an O(N) search of previous values to do it. Is this possible?
| Yes, it is possible to generate unique random numbers between 0 and 1000 without resorting to an O(N) search for previous values by utilizing a different approach. Here's a method you can use:
### Approach: Shuffle a List
1. **Create a List**: Start by creating a list of numbers from 0 to 1000.
2. **Shuffle the List*... | 22,231 | [
{
"from": "human",
"value": "I'd like to generate unique random numbers between 0 and 1000 that never repeat (i.e. 6 doesn't show up twice), but that doesn't resort to something like an O(N) search of previous values to do it. Is this possible?\n"
},
{
"from": "gpt",
"value": "Yes, it is possibl... |
What Latex styles do you use and where do you find them?
The reason I'm asking this is that it seems that some 99.9999% of all styles on the internet are copies of each other and of a physics exam paper
However, when you try to find a style for a paper like this one... Good luck, you are never going to find it.
Creatin... | When working with LaTeX, it's true that many document styles are often variations of a few common templates, particularly those tailored for specific fields like physics, mathematics, or engineering. Here are some strategies and resources you can use to find or create LaTeX styles that suit your needs:
### 1. **Standa... | 19,793 | [
{
"from": "human",
"value": "What Latex styles do you use and where do you find them?\nThe reason I'm asking this is that it seems that some 99.9999% of all styles on the internet are copies of each other and of a physics exam paper\nHowever, when you try to find a style for a paper like this one... Good lu... |
I was looking for a way to remove text from and RTF string and I found the following regex:
({\\)(.+?)(})|(\\)(.+?)(\b)
However the resulting string has two right angle brackets "}"
Before: {\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0 MS Shell Dlg 2;}{\f1\fnil MS Shell Dlg 2;}} {\colortbl ;\re... | To properly remove unwanted text from an RTF string without ending up with extra characters or artifacts like double closing braces, you can improve the regex pattern. The existing pattern seems to create matches that include both `{` and `}`, leading to confusion in the output.
### Improved Regex
To specifically remo... | 17,088 | [
{
"from": "human",
"value": "I was looking for a way to remove text from and RTF string and I found the following regex:\n({\\\\)(.+?)(})|(\\\\)(.+?)(\\b)\n\nHowever the resulting string has two right angle brackets \"}\"\nBefore: {\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset... |
Do you know what may cause memory leaks in JavaScript?
I am interested in browsers: IE 7, FireFox 3, Safari 3
| Memory leaks in JavaScript occur when the garbage collector cannot reclaim memory that is no longer needed, leading to increased memory usage over time. Here are some common causes of memory leaks in JavaScript, particularly in older browsers like IE 7, Firefox 3, and Safari 3:
1. **Global Variables**:
- Declaring... | 20,450 | [
{
"from": "human",
"value": "Do you know what may cause memory leaks in JavaScript?\nI am interested in browsers: IE 7, FireFox 3, Safari 3\n"
},
{
"from": "gpt",
"value": "Memory leaks in JavaScript occur when the garbage collector cannot reclaim memory that is no longer needed, leading to incr... |
I would like to use an add-in like simple-modal or the dialog add-in in the UI kit. However, how do I use these or any other and get a result back. Basically I want the modal to do some AJAX interaction with the server and return the result for the calling code to do some stuff with.
| To use a modal dialog add-in (like Simple Modal or a dialog from a UI kit) that performs AJAX interactions with the server and returns results back to the calling code, you can follow these general steps:
### Step 1: Set Up the Modal
First, you'll need to include the modal library in your project. For instance, if yo... | 17,925 | [
{
"from": "human",
"value": "I would like to use an add-in like simple-modal or the dialog add-in in the UI kit. However, how do I use these or any other and get a result back. Basically I want the modal to do some AJAX interaction with the server and return the result for the calling code to do some stuff ... |
E.g. Is it more secure to use mod_php instead of php-cgi?
Or is it more secure to use mod_perl instead of traditional cgi-scripts?
I'm mainly interested in security concerns, but speed might be an issue if there are significant differences.
| When considering security and performance in the context of PHP and Perl web applications, it's important to look at the differences between using Apache modules like `mod_php` and `mod_perl` versus traditional CGI scripts.
### mod_php vs. php-cgi
1. **Security**:
- **mod_php**: Runs as part of the Apache server p... | 20,022 | [
{
"from": "human",
"value": "E.g. Is it more secure to use mod_php instead of php-cgi?\nOr is it more secure to use mod_perl instead of traditional cgi-scripts?\nI'm mainly interested in security concerns, but speed might be an issue if there are significant differences.\n"
},
{
"from": "gpt",
"... |
I am attempting to write an application that uses libCurl to post soap requests to a secure web service. This Windows application is built against libCurl version 7.19.0 which, in turn, is built against openssl-0.9.8i. The pertinent curl related code follows:
FILE *input_file = fopen(current->post_file_name.c_str()... | The `CURLE_OUT_OF_MEMORY` error can occur for a variety of reasons, and when it relates to the SSL context, it may indicate that libcurl is having trouble initializing its SSL backend. Here are some possible causes and solutions you can explore:
### 1. OpenSSL Version Compatibility
You are using a very old version of ... | 20,437 | [
{
"from": "human",
"value": "I am attempting to write an application that uses libCurl to post soap requests to a secure web service. This Windows application is built against libCurl version 7.19.0 which, in turn, is built against openssl-0.9.8i. The pertinent curl related code follows:\n\n\nFILE *input_... |
I want to split a command line like string in single string parameters. How look the regular expression for it. The problem are that the parameters can be quoted. For example like:
"param 1" param2 "param 3"
should result in:
param 1, param2, param 3
| To split a command line-like string into individual parameters while handling quoted parameters correctly, you can use a regular expression that takes into account both quoted and unquoted strings. In this case, the pattern should match either a sequence of characters that are not whitespace (for unquoted parameters) o... | 19,531 | [
{
"from": "human",
"value": "I want to split a command line like string in single string parameters. How look the regular expression for it. The problem are that the parameters can be quoted. For example like:\n\"param 1\" param2 \"param 3\"\nshould result in:\nparam 1, param2, param 3\n"
},
{
"from... |
Did Microsoft abandon support for Windows Presentation Foundation (WPF) on Visual Studio 2005?
There was the a Community Technology Preview (CTP) for the WPF and WCF, but it's no longer available for download. There are released extensions for Windows Workflow Foundation (WF) for Visual Studio 2005.
But as far as i can... | Yes, you are correct. Microsoft did not provide complete support for Windows Presentation Foundation (WPF) in Visual Studio 2005. While there were Community Technology Previews (CTPs) that included WPF and Windows Communication Foundation (WCF), these were not fully integrated features of Visual Studio 2005.
WPF was ... | 24,789 | [
{
"from": "human",
"value": "Did Microsoft abandon support for Windows Presentation Foundation (WPF) on Visual Studio 2005?\nThere was the a Community Technology Preview (CTP) for the WPF and WCF, but it's no longer available for download. There are released extensions for Windows Workflow Foundation (WF) f... |
When using resources such as brushes, templates and styles in WPF, they can be specified either as StaticResources
<Rectangle Fill="{StaticResource MyBrush}" />
or as a DynamicResource
<ItemsControl ItemTemplate="{DynamicResource MyItemTemplate}" />
Most of the times (always?), only one works and the other will thr... | In WPF (Windows Presentation Foundation), the choice between `StaticResource` and `DynamicResource` is indeed not arbitrary, and understanding the differences can help you decide which one to use in different scenarios.
### Key Differences Between StaticResource and DynamicResource:
1. **Resource Resolution Time**:
... | 20,189 | [
{
"from": "human",
"value": "When using resources such as brushes, templates and styles in WPF, they can be specified either as StaticResources \n<Rectangle Fill=\"{StaticResource MyBrush}\" />\n\nor as a DynamicResource\n<ItemsControl ItemTemplate=\"{DynamicResource MyItemTemplate}\" />\n\nMost of the tim... |
How is Oracle date implemented? Is it stored as milliseconds or something like that?
| In Oracle Database, the `DATE` data type is not stored as milliseconds but rather in a more specific format. An Oracle `DATE` value actually consists of a fixed-length, 7-byte structure that includes:
1. **Year**: 4 bits (representing the year from 1 to 9999)
2. **Month**: 4 bits (representing the month from 1 to 12)
... | 24,485 | [
{
"from": "human",
"value": "How is Oracle date implemented? Is it stored as milliseconds or something like that?\n"
},
{
"from": "gpt",
"value": "In Oracle Database, the `DATE` data type is not stored as milliseconds but rather in a more specific format. An Oracle `DATE` value actually consists... |
In an app I'm working on, I have a plain style UITableView that can contain a section containing zero rows. I want to be able to scroll to this section using scrollToRowAtIndexPath:atScrollPosition:animated: but I get an error when I try to scroll to this section due to the lack of child rows.
Apple's calendar applicat... | It sounds like you've run into a common issue when dealing with `UITableView` sections that may not contain any rows. Apple’s Calendar app does indeed handle this gracefully, and it is possible to achieve similar functionality in your own app.
Here are a couple of workarounds and strategies you can consider to enable ... | 19,796 | [
{
"from": "human",
"value": "In an app I'm working on, I have a plain style UITableView that can contain a section containing zero rows. I want to be able to scroll to this section using scrollToRowAtIndexPath:atScrollPosition:animated: but I get an error when I try to scroll to this section due to the lack... |
How can I determine if I have write permission on a remote machine in my intranet using C# in .Net?
| To determine if you have write permission on a remote machine in your intranet using C#, you can attempt to access a specific location on that remote machine (like a shared folder) and try to create, write to, and then delete a test file. Here's a simple approach to do that using the `System.IO` namespace.
Before run... | 18,446 | [
{
"from": "human",
"value": "How can I determine if I have write permission on a remote machine in my intranet using C# in .Net?\n"
},
{
"from": "gpt",
"value": "To determine if you have write permission on a remote machine in your intranet using C#, you can attempt to access a specific location... |
I have this code:
@PersistenceContext(name="persistence/monkey", unitName="deltaflow-pu")
...
@Stateless
public class GahBean implements GahRemote {
But when I use this:
try{
InitialContext ic = new InitialContext();
System.out.println("Pissing me off * " + ic.lookup("java:comp/env/persistent/monkey"));
Iterator e ... | The issue you're encountering stems from how JNDI (Java Naming and Directory Interface) resources are configured and accessed within your application server's environment. Here are some things to consider and possible solutions for your `javax.naming.NameNotFoundException`:
1. **Check the JNDI Name**:
- Ensure tha... | 20,391 | [
{
"from": "human",
"value": "I have this code:\n@PersistenceContext(name=\"persistence/monkey\", unitName=\"deltaflow-pu\")\n...\n@Stateless\npublic class GahBean implements GahRemote {\n\nBut when I use this:\ntry{\n InitialContext ic = new InitialContext();\n System.out.println(\"Pissing me off * \" + ic.... |
I want to be able to run a text editor from my app, as given by the user in the TEXT_EDITOR environment variable. Now, assuming there is nothing in that variable, I want to default to the TextEdit program that ships with OSX. Is it kosher to hardcode /Applications/TextEdit.app/Contents/MacOS/TextEdit into my app, or ... | Yes, it is generally acceptable to hardcode the path to the TextEdit application in your app if you are specifically targeting macOS, as the path to the application is unlikely to change significantly between macOS versions. However, there are alternative ways to launch applications in a more dynamic or flexible way.
... | 21,906 | [
{
"from": "human",
"value": "I want to be able to run a text editor from my app, as given by the user in the TEXT_EDITOR environment variable. Now, assuming there is nothing in that variable, I want to default to the TextEdit program that ships with OSX. Is it kosher to hardcode /Applications/TextEdit.app... |
I have a bit of code that passes around a ton of objects and I want to determine if there are any references still lingering around that I am unaware of and where it is those references are located. Any idea of how I can do this?
My understanding is that the watch window only allows me to see items available to the cu... | To track down lingering references to objects in a programming environment (let's assume you are working in .NET languages like C#), you can utilize several approaches to identify and analyze the references in memory. Here are some strategies that could help you:
### 1. **Use a Memory Profiler**
Memory profilers are s... | 21,092 | [
{
"from": "human",
"value": "I have a bit of code that passes around a ton of objects and I want to determine if there are any references still lingering around that I am unaware of and where it is those references are located. Any idea of how I can do this? \nMy understanding is that the watch window only ... |
How can I unset variable? For example, PHP has an unset($var) function.
| In Python, you can "unset" a variable by using the `del` statement. This removes the variable from the namespace, effectively making it undefined. Here’s how you can do it:
```python
# Define a variable
var = 10
print(var) # Output: 10
# Unset the variable
del var
# Trying to access the variable after deletion will... | 19,707 | [
{
"from": "human",
"value": "How can I unset variable? For example, PHP has an unset($var) function.\n"
},
{
"from": "gpt",
"value": "In Python, you can \"unset\" a variable by using the `del` statement. This removes the variable from the namespace, effectively making it undefined. Here’s how yo... |
I have a String such as:
Cerepedia, una apliación web
I would like to transform it into something URL valid such as:
Cerepedia,unaaplicacionweb
Note: the special character transformation and spaces removal.
By the way, are commas allowed in URLs?
| In URLs, certain characters are not allowed or need to be percent-encoded. Commas (`,`) are technically allowed in URLs, but they are not commonly used and could lead to confusion or misinterpretation in some contexts.
To transform your string into a URL-valid format, you can follow these steps:
1. **Remove special c... | 24,612 | [
{
"from": "human",
"value": "I have a String such as: \nCerepedia, una apliación web\n\nI would like to transform it into something URL valid such as: \nCerepedia,unaaplicacionweb\n\nNote: the special character transformation and spaces removal. \nBy the way, are commas allowed in URLs?\n"
},
{
"fro... |
I have a multi-threaded C++ app which does 3D rendering with the OpenSceneGraph library. I'm planning to kick off OSG's render loop as a separate thread using boost::threads, passing a data structure containing shared state in to the thread. I'm trying to avoid anything too heavyweight (like mutexes) for synchronizatio... | When dealing with multi-threaded applications in C++, especially with shared data between threads, it's important to consider the visibility of changes made in one thread to another. In your case, you are dealing with two simple boolean flags that the application thread modifies and the render thread reads.
### Consid... | 21,836 | [
{
"from": "human",
"value": "I have a multi-threaded C++ app which does 3D rendering with the OpenSceneGraph library. I'm planning to kick off OSG's render loop as a separate thread using boost::threads, passing a data structure containing shared state in to the thread. I'm trying to avoid anything too heav... |
I am importing the CreateICeeFileGen() function from the unmanaged DLL mscorpe.dll in a C# application, in order to generate a PE file. This function returns a pointer to an C++ object defined here, is there any way I can access fields from this class via C# or do I need to write an unmanaged wrapper DLL?
The code I'm... | Accessing fields from a C++ class in an unmanaged DLL from C# requires a bit of work because of the differences in memory management and data representation between C++ and C#. Here are the steps you might follow to achieve this:
### Option 1: Define a Wrapper DLL
1. **Create a Wrapper DLL**: This is the most common ... | 20,551 | [
{
"from": "human",
"value": "I am importing the CreateICeeFileGen() function from the unmanaged DLL mscorpe.dll in a C# application, in order to generate a PE file. This function returns a pointer to an C++ object defined here, is there any way I can access fields from this class via C# or do I need to wri... |
We are considering a move from SVN to Mercurial, and have encountered a stumbling block.
We currently use svn:externals to automatically pull a common set of libraries into the working directory. I can't find support for anything like this in Mercurial.
Is there a way to do this automatically with Mercurial, or do I ne... | In Mercurial, there isn't a direct equivalent to SVN's `svn:externals` feature, which allows you to pull in external repositories as part of your working directory. However, there are a few approaches you can take to achieve similar functionality:
### 1. **Subrepositories**
Mercurial has a feature called **subreposito... | 21,853 | [
{
"from": "human",
"value": "We are considering a move from SVN to Mercurial, and have encountered a stumbling block.\nWe currently use svn:externals to automatically pull a common set of libraries into the working directory. I can't find support for anything like this in Mercurial.\nIs there a way to do th... |
Ok, so I have an nHibernate ICriteria that returns an object. I want to order by a single property but NOT asc or desc I want certain values of the property to come to the top of the repeater based on the selection. Like if I choose "video" I want all records with videos to come to the top.
Now, can I do this in the q... | You can achieve the desired ordering behavior directly in your NHibernate `ICriteria` query by utilizing a `Case` statement to define custom sorting logic. If you want specific values of a property to appear at the top of the result set, you can use the `OrderBy` clause in combination with a `Case` expression.
Here's ... | 17,271 | [
{
"from": "human",
"value": "Ok, so I have an nHibernate ICriteria that returns an object. I want to order by a single property but NOT asc or desc I want certain values of the property to come to the top of the repeater based on the selection. Like if I choose \"video\" I want all records with videos to co... |
Consider the following method signatures:
public fooMethod (Foo[] foos) { /*...*/ }
and
public fooMethod (Foo... foos) { /*...*/ }
Explanation: The former takes an array of Foo-objects as an argument - fooMethod(new Foo[]{..}) - while the latter takes an arbitrary amount of arguments of type Foo, and presents them as... | You've touched upon a nuanced aspect of Java method signatures and variadic parameters, and your understanding is mostly correct. Let's break down the differences and when you might consider using one approach over the other.
### Differences Between the Two Methods
1. **Method Signatures**:
- `public void fooMetho... | 15,331 | [
{
"from": "human",
"value": "Consider the following method signatures:\npublic fooMethod (Foo[] foos) { /*...*/ }\n\nand\npublic fooMethod (Foo... foos) { /*...*/ }\n\nExplanation: The former takes an array of Foo-objects as an argument - fooMethod(new Foo[]{..}) - while the latter takes an arbitrary amount... |
In Eclipse, its easy to specify buttons for your toolbar using the ActionSets extension point. However, when I need to specify some items programmatically, I can't get the same look. I don't believe that the framework is using native buttons for these, but so far, I can't find the right recipe to match the Eclipse lo... | In Eclipse, to create toolbar buttons programmatically that match the look and feel of the Eclipse UI, you'll want to use the `ToolBar` and `ToolItem` classes provided by the SWT (Standard Widget Toolkit). Here’s a simple snippet that demonstrates how to create a toolbar with buttons that resemble the Eclipse style:
`... | 16,775 | [
{
"from": "human",
"value": "In Eclipse, its easy to specify buttons for your toolbar using the ActionSets extension point. However, when I need to specify some items programmatically, I can't get the same look. I don't believe that the framework is using native buttons for these, but so far, I can't find... |
What do I need to set up and maintain a local CPAN mirror? What scripts and best practices should I be aware of?
| Setting up and maintaining a local CPAN (Comprehensive Perl Archive Network) mirror can be a useful way to manage Perl modules efficiently, especially in environments with limited internet access or for better performance in package installations. Below is a guide on what you need to set up and maintain a local CPAN mi... | 17,366 | [
{
"from": "human",
"value": "What do I need to set up and maintain a local CPAN mirror? What scripts and best practices should I be aware of?\n"
},
{
"from": "gpt",
"value": "Setting up and maintaining a local CPAN (Comprehensive Perl Archive Network) mirror can be a useful way to manage Perl mo... |
I am using Python to extract the filename from a link using rfind like below:
url = "http://www.google.com/test.php"
print url[url.rfind("/") +1 : ]
This works ok with links without a / at the end of them and returns "test.php". I have encountered links with / at the end like so "http://www.google.com/test.php/". I... | To handle both cases (with and without a trailing slash) when extracting the filename from a URL, you can use the `rstrip` method to remove any trailing slashes before applying the `rfind` method. Here's how you can modify your code:
```python
url = "http://www.google.com/test.php/"
# Remove trailing slashes from the... | 23,079 | [
{
"from": "human",
"value": "I am using Python to extract the filename from a link using rfind like below:\nurl = \"http://www.google.com/test.php\"\n\nprint url[url.rfind(\"/\") +1 : ]\n\nThis works ok with links without a / at the end of them and returns \"test.php\". I have encountered links with / at t... |
Trying to use an excpetion class which could provide location reference for XML parsing, found an interesting behavior - compiler could not choose between overload which consumes an interface and one which needs System.Exception when I trying to pass XmlReader as a parameter.
Detais are following:
//exception overloads... | The situation you're encountering is a result of how C# handles method overload resolution, especially with interfaces and class hierarchies. Let's break down what's happening.
You have two overloads for the `FilterXmlParseException` constructor:
1. `public FilterXmlParseException(string message, Exception innerExcep... | 18,156 | [
{
"from": "human",
"value": "Trying to use an excpetion class which could provide location reference for XML parsing, found an interesting behavior - compiler could not choose between overload which consumes an interface and one which needs System.Exception when I trying to pass XmlReader as a parameter.\nD... |
I've got a windows form in Visual Studio 2008 using .NET 3.5 which has a WebBrowser control on it. I need to analyse the form's PostData in the Navigating event handler before the request is sent. Is there a way to get to it?
The old win32 browser control had a Before_Navigate event which had PostData as one of its a... | In the .NET Framework, the `WebBrowser` control does not expose the `PostData` directly in its events like the older Win32 control did. Unfortunately, there’s no built-in way to directly intercept and modify the HTTP POST data in the `Navigating` event of the `WebBrowser` control in .NET 3.5.
However, you can achieve... | 20,379 | [
{
"from": "human",
"value": "I've got a windows form in Visual Studio 2008 using .NET 3.5 which has a WebBrowser control on it. I need to analyse the form's PostData in the Navigating event handler before the request is sent. Is there a way to get to it?\nThe old win32 browser control had a Before_Navigat... |
I have a footer that is a 1 x 70px, which is set as the background and tiles horizonally.
In cases when the web page does not contain a lot of content on it, it will display the footer above where the footer should be. I want it to fill in with a solid color, so if they scroll down, it won't show the footer, then the w... | To achieve the desired effect where the footer appears only when the content is scrolled down far enough, and you want the area above the footer to be filled with a solid color, you can adjust your CSS and add some HTML structure. Here are some steps and modifications you can follow:
### Step 1: Update Your HTML Struc... | 21,660 | [
{
"from": "human",
"value": "I have a footer that is a 1 x 70px, which is set as the background and tiles horizonally.\nIn cases when the web page does not contain a lot of content on it, it will display the footer above where the footer should be. I want it to fill in with a solid color, so if they scroll ... |
I have a J2ME application that needs to communicate with my server, and download information for the application in XML.
My application could run a lot faster if I had a better format of data, which would allow me to have more efficient parsing code.
Does anyone know an efficient substitute for XML? Maybe something spe... | For J2ME applications, where performance and memory usage are critical due to limited resources, several alternatives to XML can be considered for data transmission and parsing. Here are some efficient formats:
1. **JSON (JavaScript Object Notation)**:
- **Pros**: Lightweight, easier to parse than XML, and more hum... | 20,479 | [
{
"from": "human",
"value": "I have a J2ME application that needs to communicate with my server, and download information for the application in XML.\nMy application could run a lot faster if I had a better format of data, which would allow me to have more efficient parsing code.\nDoes anyone know an effici... |
I have some styles applied to html for example
<body style="background: #C3DAF9;">
and when I use forms authentication it is ignored. If I put the style into an external .css file then it works.
This doesn't seem like normal behaviour to me.
| This behavior might seem unusual, but it can occur due to a few potential reasons. Here are a few possibilities and things you might want to check:
1. **Forms Authentication and ASP.NET**: When using forms authentication in ASP.NET, the authentication mechanism redirects users to a login page if they are not authentic... | 22,409 | [
{
"from": "human",
"value": "I have some styles applied to html for example \n<body style=\"background: #C3DAF9;\">\n\nand when I use forms authentication it is ignored. If I put the style into an external .css file then it works. \nThis doesn't seem like normal behaviour to me. \n"
},
{
"from": "gp... |
Many, if not all, of my old VC++ 6.0 MFC apps don't work in Vista and Server 2008. I had that migration was a problem, but now it's my problem :(
How do I go about making these things work? Is that possible? I've searched, but is there some repository of knowledge on this subject?
edit:
Compatibility mode seems to ... | Getting old MFC applications developed with Visual C++ 6.0 to work on newer operating systems like Windows Vista and Windows Server 2008 can be challenging due to differences in the operating system's architecture, security features, and runtime libraries. Here are some strategies you can consider to help make your app... | 21,215 | [
{
"from": "human",
"value": "Many, if not all, of my old VC++ 6.0 MFC apps don't work in Vista and Server 2008. I had that migration was a problem, but now it's my problem :(\nHow do I go about making these things work? Is that possible? I've searched, but is there some repository of knowledge on this s... |
In order to lighten Apache's load people often suggest using lighttpd to serve up static content.
e.g. http://www.linux.com/feature/51673
In this setup Apache passes requests for static content back to lighttpd via mod_proxy, while serving dynamic requests itself.
My question is: how does this reduce the load on the se... | Using lighttpd to serve static content in combination with Apache can help reduce the overall load on the server, even though it might seem counterintuitive at first glance. Here's how it works and the benefits it can bring:
### 1. **Specialization of Server Roles**
- **Apache for Dynamic Content:** Apache is a ver... | 20,695 | [
{
"from": "human",
"value": "In order to lighten Apache's load people often suggest using lighttpd to serve up static content.\ne.g. http://www.linux.com/feature/51673\nIn this setup Apache passes requests for static content back to lighttpd via mod_proxy, while serving dynamic requests itself.\nMy question... |
I have an OpenDocument spreadsheet with macros in StarBasic/OOoBasic that I want to convert into an Excel spreadsheet, with the StarBasic macros translated to VBA. While OpenOffice.org claims to have the ability to translate VBA macros to StarBasic and back, my attempts to have OOo convert these original StarBasic macr... | Converting OpenDocument spreadsheets with StarBasic/OOoBasic macros to Excel with VBA can be challenging due to the differences in how each application handles macros. Here are steps you can take to facilitate the conversion process and reduce the need for complete rewrites:
### 1. **Manual Extraction of Code:**
- ... | 21,109 | [
{
"from": "human",
"value": "I have an OpenDocument spreadsheet with macros in StarBasic/OOoBasic that I want to convert into an Excel spreadsheet, with the StarBasic macros translated to VBA. While OpenOffice.org claims to have the ability to translate VBA macros to StarBasic and back, my attempts to have ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.