instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
If I have a method such as:
private function testMethod(param:string):void
{
// Get the object that called this function
}
Inside the testMethod, can I work out what object called us? e.g.
class A
{
doSomething()
{
var b:B = new B();
b.fooBar();
}
}
class B
{
fooBar()
{
// Can I tell that the ... | In the context of ActionScript (as it appears from the syntax you've provided), you don't have a direct way to get the caller's context in the way you might expect in some other languages (like C# with the `CallerMemberName` attribute, or similar features in Java or JavaScript). However, you can implement a workaround ... | 18,521 | [
{
"from": "human",
"value": "If I have a method such as:\nprivate function testMethod(param:string):void\n{\n // Get the object that called this function\n}\n\nInside the testMethod, can I work out what object called us? e.g.\nclass A\n{\n doSomething()\n {\n var b:B = new B();\n b.fooBar();\n }\n... |
As the question states - is there a good tool out there which lists methods an unmanaged DLL exports? I would like it to list COM methods and interfaces too.
| Yes, there are several tools that can help you list the methods exported by an unmanaged DLL, including COM methods and interfaces. Here are a few popular options:
1. **Dependency Walker (depends.exe)**: This classic tool can show you the functions exported by a DLL. However, it may not directly list COM interfaces, b... | 19,880 | [
{
"from": "human",
"value": "As the question states - is there a good tool out there which lists methods an unmanaged DLL exports? I would like it to list COM methods and interfaces too.\n"
},
{
"from": "gpt",
"value": "Yes, there are several tools that can help you list the methods exported by ... |
Assuming I'm trying to automate the installation of something on windows and I want to try to test whether another installation is in progress before attempting install. I don't have control over the installer and have to do this in the automation framework. Is there a better way to do this, some win32 api?, than just ... | Your approach using the mutex `_MSIExecute` is indeed a reliable method for determining whether an MSI installation is in progress. By accessing the mutex directly, you can effectively avoid race conditions and situations where multiple installations are attempted concurrently.
Here’s a brief breakdown of your impleme... | 14,434 | [
{
"from": "human",
"value": "Assuming I'm trying to automate the installation of something on windows and I want to try to test whether another installation is in progress before attempting install. I don't have control over the installer and have to do this in the automation framework. Is there a better wa... |
I'm not sure how familiar people are with the hobbit monitoring system - http://hobbitmon.sourceforge.net/ - but I've got a tricky question.
I've got a custom test, which returns two NCV values. One value normally returns ~300 milliseconds, the other one returns 500 000 euro. Obviously, these two values don't graph ver... | Hobbit (now known as Xymon) does allow for customizing tests and displaying multiple values, but handling multiple graphs for a single test can be tricky. By default, Hobbit expects a single set of data for each test. However, you can achieve your goal by using a couple of techniques.
Here’s how you could set it up to... | 17,586 | [
{
"from": "human",
"value": "I'm not sure how familiar people are with the hobbit monitoring system - http://hobbitmon.sourceforge.net/ - but I've got a tricky question.\nI've got a custom test, which returns two NCV values. One value normally returns ~300 milliseconds, the other one returns 500 000 euro. O... |
It seems that I've never got this to work in the past. Currently, I KNOW it doesn't work.
But we start up our Java process:
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=6002
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
I can telnet to the port, and "s... | It sounds like you've configured JMX (Java Management Extensions) to allow remote monitoring of your Java application using JConsole, but you’re having trouble connecting to it. Here are some common reasons why you might be facing issues along with their solutions:
1. **Firewall Rules**: Ensure that your firewall is n... | 16,535 | [
{
"from": "human",
"value": "It seems that I've never got this to work in the past. Currently, I KNOW it doesn't work.\nBut we start up our Java process:\n-Dcom.sun.management.jmxremote\n-Dcom.sun.management.jmxremote.port=6002\n-Dcom.sun.management.jmxremote.authenticate=false\n-Dcom.sun.management.jmxremo... |
A VB6 application is using the Interop Forms Toolkit to work with forms written in .NET. The documentation for the toolkit advises calling a method on the toolkit to advise the toolkit when the VB6 application is shutting down.
The VB6 application uses a Sub Main procedure that loads a splash screen, then displays seve... | In a VB6 application, especially one using a Sub Main procedure and modeless forms, you typically need to handle the application's shutdown explicitly since VB6 applications do not automatically terminate when there are outstanding forms.
To detect when your VB6 application is shutting down and call the cleanup method... | 15,305 | [
{
"from": "human",
"value": "A VB6 application is using the Interop Forms Toolkit to work with forms written in .NET. The documentation for the toolkit advises calling a method on the toolkit to advise the toolkit when the VB6 application is shutting down.\nThe VB6 application uses a Sub Main procedure that... |
I need to keep as much as I can of large file in the operating system block cache even though it's bigger than I can fit in ram, and I'm continously reading another very very large file. ATM I'll remove large chunk of large important file from system cache when I stream read form another file.
| It sounds like you're dealing with a scenario where you want to keep parts of a large file in the operating system's block cache, but the file itself is larger than your available RAM. At the same time, you're continuously reading from another very large file, which could be evicting parts of the important file from th... | 15,602 | [
{
"from": "human",
"value": "I need to keep as much as I can of large file in the operating system block cache even though it's bigger than I can fit in ram, and I'm continously reading another very very large file. ATM I'll remove large chunk of large important file from system cache when I stream read for... |
Does NetworkStream.DataAvailable know whether the sender's send buffer is empty? Or does it simply indicate whether the receiver's read buffer has data? My assumption is the latter...
Specifically, for some socket work involving an ongoing conversation, I currently use a length-prefix so the the receiver knows exactly ... | Your understanding is correct: `NetworkStream.DataAvailable` indicates whether there is data available to read from the receiver's buffer. It does **not** provide any information about the state of the sender's send buffer or whether the sender has finished sending all the intended data.
When using `DataAvailable`, y... | 19,853 | [
{
"from": "human",
"value": "Does NetworkStream.DataAvailable know whether the sender's send buffer is empty? Or does it simply indicate whether the receiver's read buffer has data? My assumption is the latter...\nSpecifically, for some socket work involving an ongoing conversation, I currently use a length... |
I need a select from table which does not have column that tells when row was inserted, only timestamp column (values like: 0x0000000000530278). Some data was imported to the table yesterday and now I need to find out what exactly was imported :(
Is there a way to do it using only timestamp info? Here I found that:
Ti... | In SQL Server, the `TIMESTAMP` (or `ROWVERSION`) data type is indeed a unique binary value that changes with every insert or update operation but does not represent any actual date or time. The `TIMESTAMP` column does not provide a way to retrieve the date and time when a row was inserted.
Since you're trying to ident... | 17,111 | [
{
"from": "human",
"value": "I need a select from table which does not have column that tells when row was inserted, only timestamp column (values like: 0x0000000000530278). Some data was imported to the table yesterday and now I need to find out what exactly was imported :(\nIs there a way to do it using o... |
I have an odd problem...I'm using a documentation generator which generates a lot of output like docs/foo.php.html. It's XHTML, and thus contains <?xml...> tags at the beginning of file. The problem is, Apache has somehow decided to run it through the PHP interpreter, even though ".php" appears in the middle of the fil... | The issue you're experiencing is due to the way Apache handles file extensions and its `AddHandler` configuration. When you use `AddHandler php5-script .php`, it applies the PHP interpreter to any file that has a `.php` extension, including files that contain `.php` as part of a longer extension, such as `.php.html`.
... | 16,954 | [
{
"from": "human",
"value": "I have an odd problem...I'm using a documentation generator which generates a lot of output like docs/foo.php.html. It's XHTML, and thus contains <?xml...> tags at the beginning of file. The problem is, Apache has somehow decided to run it through the PHP interpreter, even thoug... |
Is there a keyboard shortcut for pasting the content of the clipboard into a command prompt window on Windows XP (instead of using the right mouse button)?
The typical Shift+Insert does not seem to work here.
| In Windows XP Command Prompt, there is no built-in keyboard shortcut like `Ctrl + V` or `Shift + Insert` to paste directly from the clipboard. However, you can use the following method:
1. **Right-click on the title bar of the Command Prompt window.**
2. Select **"Edit"** from the context menu.
3. Then choose **"Paste... | 18,871 | [
{
"from": "human",
"value": "Is there a keyboard shortcut for pasting the content of the clipboard into a command prompt window on Windows XP (instead of using the right mouse button)?\nThe typical Shift+Insert does not seem to work here.\n"
},
{
"from": "gpt",
"value": "In Windows XP Command Pr... |
Currently I am hosting a Django app I developed myself for my clients, but I am now starting to look at selling it to people for them to host themselves.
My question is this: How can I package up and sell a Django app, while protecting its code from pirating or theft? Distributing a bunch of .py files doesn't sound lik... | Packaging and selling a Django app while protecting your code from piracy is a common challenge for developers. Here are several strategies you can consider to help safeguard your application:
### 1. **Code Obfuscation**
Obfuscation involves modifying your code to make it difficult for humans to understand while keepi... | 16,276 | [
{
"from": "human",
"value": "Currently I am hosting a Django app I developed myself for my clients, but I am now starting to look at selling it to people for them to host themselves.\nMy question is this: How can I package up and sell a Django app, while protecting its code from pirating or theft? Distribut... |
In PHP I simply write:
$bob = $_POST['bob'];
How do I do the same in Python?
And yes, I do normally check that it exists etc, I'm just stripping it down specifically to the functionality I am after.
Edit: I am not using a framework
| In Python, if you are not using a framework and want to handle a POST request directly, you can use the built-in `http.server` module or an alternative like `cgi` to parse the POST data. Here's a minimal example of how to extract a POST parameter without using a framework:
### Using `http.server`
You can create a sim... | 16,039 | [
{
"from": "human",
"value": "In PHP I simply write:\n$bob = $_POST['bob'];\n\nHow do I do the same in Python?\nAnd yes, I do normally check that it exists etc, I'm just stripping it down specifically to the functionality I am after.\n\nEdit: I am not using a framework\n"
},
{
"from": "gpt",
"val... |
I am interested in seeing if I can improve the way we use NUnit in a Visual Studio solution containing 30+ projects.
First, would you have one assembly of tests for every assembly in the solution, or would you try to keep the number of test assemblies down? I started off creating many test assemblies, but I think this ... | Improving how you use NUnit in a Visual Studio solution with multiple projects can significantly enhance your development workflow and build times. Below are some considerations and strategies for both your questions.
### 1. Test Assembly Organization
**Single vs. Multiple Test Assemblies:**
- **Single Assembly for T... | 15,025 | [
{
"from": "human",
"value": "I am interested in seeing if I can improve the way we use NUnit in a Visual Studio solution containing 30+ projects.\nFirst, would you have one assembly of tests for every assembly in the solution, or would you try to keep the number of test assemblies down? I started off creati... |
We're building a CMS. The site will be built and managed by the users in aspx pages, but we would like to create a static site of HTML's.
The way we're doing it now is with code I found here that overloads the Render method in the Aspx Page and writes the HTML string to a file. This works fine for a single page, but t... | To create a static site of HTML pages automatically in an ASP.NET CMS before any user edits anything, you can use the following approach:
### Step 1: Define Your Default Pages
First, you need to define a list of the default pages you want to generate. This could be a simple list of strings representing the pages' con... | 15,744 | [
{
"from": "human",
"value": "We're building a CMS. The site will be built and managed by the users in aspx pages, but we would like to create a static site of HTML's. \nThe way we're doing it now is with code I found here that overloads the Render method in the Aspx Page and writes the HTML string to a file... |
On destruction of a restful resource, I want to guarantee a few things before I allow a destroy operation to continue? Basically, I want the ability to stop the destroy operation if I note that doing so would place the database in a invalid state? There are no validation callbacks on a destroy operation, so how does on... | In a RESTful API, especially when dealing with destructive operations like a DELETE request, it's crucial to ensure that such actions do not lead to an inconsistent or invalid state in your database. While it's true that many web frameworks (like Ruby on Rails, Django, etc.) may not have built-in validation callbacks s... | 13,361 | [
{
"from": "human",
"value": "On destruction of a restful resource, I want to guarantee a few things before I allow a destroy operation to continue? Basically, I want the ability to stop the destroy operation if I note that doing so would place the database in a invalid state? There are no validation callbac... |
What would I do if I want to have a generic method that only accepts types that have overloaded an operator, for instance the subtraction operator. I tried using an interface as a constraint but interfaces can't have operator overloading.
What is the best way to achieve this?
| In C#, there is no direct way to enforce operator overloading through a generic type constraint. However, you can use several workarounds depending on your specific requirements. Here are a few common approaches:
### 1. Use an Interface with a Method
You can define an interface that includes a method that performs th... | 14,332 | [
{
"from": "human",
"value": "What would I do if I want to have a generic method that only accepts types that have overloaded an operator, for instance the subtraction operator. I tried using an interface as a constraint but interfaces can't have operator overloading. \nWhat is the best way to achieve this?\... |
Part of the web application I'm working on is an area displaying messages from management to 1...n users. I have a DataAccess project that contains the LINQ to SQL classes, and a website project that is the UI. My database looks like this:
User -> MessageDetail <- Message <- MessageCategory
MessageDetail is a join tabl... | Your concerns about maintaining a clean separation between your data access logic and your UI code are very valid. Although LINQ to SQL does allow for more concise queries compared to traditional SQL, putting complex queries directly in the code-behind still makes it harder to manage and test. Here are a few strategies... | 14,450 | [
{
"from": "human",
"value": "Part of the web application I'm working on is an area displaying messages from management to 1...n users. I have a DataAccess project that contains the LINQ to SQL classes, and a website project that is the UI. My database looks like this:\nUser -> MessageDetail <- Message <- Me... |
I'd be very grateful if you could compare the winning O’Rourke's Perl solution to Lundh's Python solution, as I don't know Perl good enough to understand what's going on there. More specifically I'd like to know what gave Perl version 3x advantage: algorithmic superiority, quality of C extensions, other factors?
Wide F... | To compare O'Rourke's Perl solution to Lundh's Python solution in the context of the Wide Finder challenge, several factors can be taken into account to understand why the Perl version might have achieved a significantly better performance (3x faster):
1. **Algorithmic Efficiency**:
- Both solutions are likely base... | 16,429 | [
{
"from": "human",
"value": "I'd be very grateful if you could compare the winning O’Rourke's Perl solution to Lundh's Python solution, as I don't know Perl good enough to understand what's going on there. More specifically I'd like to know what gave Perl version 3x advantage: algorithmic superiority, quali... |
So, I've been living with my cvs repositories for some time. Though there is a thing I miss - if i rename a file that is already in repository, I need to delete the one with old name from there and add the new one. Hence, I loose all my change-history. And sometimes there's a need to rename a file in alredy existing pr... | You're correct that CVS (Concurrent Versions System) has limitations when it comes to renaming files. In CVS, renaming a file requires you to delete the old file and add a new one, which results in losing the change history of that file. This is a known drawback of CVS.
Subversion (SVN) does support file renaming and ... | 15,741 | [
{
"from": "human",
"value": "So, I've been living with my cvs repositories for some time. Though there is a thing I miss - if i rename a file that is already in repository, I need to delete the one with old name from there and add the new one. Hence, I loose all my change-history. And sometimes there's a ne... |
I've searched for the solution to change the background color on the Compact Framework's MainMenu control, and the only answer I've found is that you need to create a custom control. Does anyone have example code for this?
| Creating a custom control to change the background color of the `MainMenu` control in the .NET Compact Framework is indeed a common solution, as the default `MainMenu` does not support background color customization out of the box. Here is a simple example of how you can create a custom main menu control by inheriting ... | 16,382 | [
{
"from": "human",
"value": "I've searched for the solution to change the background color on the Compact Framework's MainMenu control, and the only answer I've found is that you need to create a custom control. Does anyone have example code for this?\n"
},
{
"from": "gpt",
"value": "Creating a... |
Which is the most correct code?
if (HttpContext.Current.Response.Cookies[authCookieName] != null) {
HttpContext.Current.Response.Cookies[authCookieName].Value = "New Value";
}
or
if (HttpContext.Current != null)
if (HttpContext.Current.Response != null)
if (HttpContext.Current.Response.Cookies != null... | The first code snippet is more correct and preferable for several reasons:
1. **Readability**: The first version is more concise and easier to read. It accomplishes the same goal with fewer lines of code, making it clearer what the intent is.
2. **Null Checks**: In the second snippet, multiple nested `if` statements ... | 20,609 | [
{
"from": "human",
"value": "Which is the most correct code?\nif (HttpContext.Current.Response.Cookies[authCookieName] != null) {\n HttpContext.Current.Response.Cookies[authCookieName].Value = \"New Value\";\n}\n\nor \nif (HttpContext.Current != null)\n if (HttpContext.Current.Response != null)\n ... |
I have a java class:
it.eng.ancona.view.RuoliView$TabElaborazioneFattureValidazione$ElencoDettaglioElaborazioneFattureValidazione$RigaElencoDettaglioElaborazioneFattureValidazione
It's so long for multiple inner class.
If I use 1.4.2_07-b05 on Eclipse and I call this class, all goes fine.
If I use 1.4.2_07-b05 on Tom... | The issue you're encountering with `NoClassDefFoundError` while running on Tomcat 5.0, despite it working fine in Eclipse, can be attributed to a few potential factors, particularly related to class loading and naming conventions in Java.
### Key Points to Consider:
1. **Class Name Length**: While the maximum length ... | 16,560 | [
{
"from": "human",
"value": "I have a java class:\n\nit.eng.ancona.view.RuoliView$TabElaborazioneFattureValidazione$ElencoDettaglioElaborazioneFattureValidazione$RigaElencoDettaglioElaborazioneFattureValidazione\n\nIt's so long for multiple inner class.\nIf I use 1.4.2_07-b05 on Eclipse and I call this clas... |
Let me preface this by saying I'm a complete amateur when it comes to RegEx and only started a few days ago. I'm trying to solve a problem formatting a file and have hit a hitch with a particular type of data. The input file is structured like this:
Two words,Word,Word,Word,"Number, number"
What I need to do is forma... | You're on the right track, and your understanding of using regular expressions (RegEx) is improving! To achieve the result you want, you can modify your RegEx pattern to ensure that you only replace commas that are not followed by a space.
Here's a simple solution that will work for your requirements:
```regex
s/,([^... | 18,695 | [
{
"from": "human",
"value": "Let me preface this by saying I'm a complete amateur when it comes to RegEx and only started a few days ago. I'm trying to solve a problem formatting a file and have hit a hitch with a particular type of data. The input file is structured like this:\n\nTwo words,Word,Word,Word,\... |
How to get the checked option in a group of radio inputs with JavaScript?
| To get the checked option in a group of radio inputs using JavaScript, you can use the `querySelector` method or loop through the radio buttons to find which one is checked. Here are two common methods to achieve this:
### Method 1: Using `querySelector`
You can use `document.querySelector` to select the checked radi... | 14,272 | [
{
"from": "human",
"value": "How to get the checked option in a group of radio inputs with JavaScript?\n"
},
{
"from": "gpt",
"value": "To get the checked option in a group of radio inputs using JavaScript, you can use the `querySelector` method or loop through the radio buttons to find which on... |
After you start tracking the source of a bunch of open source software, how do you keep your code in sync? Run svn update every time you want to look at or play with the code?
It strikes me that it would be better to essentially start mirroring the code with (say) a cron job every night. Have people set up workflows to... | Keeping open source software code in sync with upstream sources can be managed in various ways, depending on your specific needs, the tools you are using, and your workflow preferences. Here are some strategies and tools that you might find useful:
### 1. **Using Version Control Systems:**
If the open source project y... | 14,194 | [
{
"from": "human",
"value": "After you start tracking the source of a bunch of open source software, how do you keep your code in sync? Run svn update every time you want to look at or play with the code?\nIt strikes me that it would be better to essentially start mirroring the code with (say) a cron job ev... |
In MS Transact SQL, let's say I have a table (Orders) like this:
Order Date Order Total Customer #
09/30/2008 8.00 1
09/15/2008 6.00 1
09/01/2008 9.50 1
09/01/2008 1.45 2
09/16/2008 4.50 2
09/17/2008 8.75 ... | To calculate the average order amount for the most recent two orders for each customer in the `Orders` table, you can follow these steps in a SQL query. We'll use a Common Table Expression (CTE) to first rank the orders per customer based on the order date and then calculate the average for the two most recent orders.
... | 17,674 | [
{
"from": "human",
"value": "In MS Transact SQL, let's say I have a table (Orders) like this:\n Order Date Order Total Customer #\n 09/30/2008 8.00 1\n 09/15/2008 6.00 1\n 09/01/2008 9.50 1\n 09/01/2008 1.45 2\n 09/16/2008 4... |
Is it really advantageous to move to Rake from ant?
Anyone migrated from ant and find something monumental?
FYI: Current environment is Ant for J2ME builds
| Migrating from Ant to Rake can offer several advantages, especially for certain types of projects. Here are some considerations that might help you decide if the move is beneficial for your J2ME builds:
### Advantages of Moving to Rake
1. **Ruby Integration**: Rake is a Ruby-based build tool, so if your team is famil... | 17,234 | [
{
"from": "human",
"value": "Is it really advantageous to move to Rake from ant?\nAnyone migrated from ant and find something monumental?\nFYI: Current environment is Ant for J2ME builds\n"
},
{
"from": "gpt",
"value": "Migrating from Ant to Rake can offer several advantages, especially for cert... |
Is there an open-source alternative to MATLAB's fmincon function for constrained linear optimization? I'm rewriting a MATLAB program to use Python / NumPy / SciPy and this is the only function I haven't found an equivalent to. A NumPy-based solution would be ideal, but any language will do.
| Yes, you can use SciPy's optimization library in Python, which provides a function similar to MATLAB's `fmincon` for constrained optimization problems. Specifically, you can use the `scipy.optimize.minimize` function with the `method='SLSQP'` (Sequential Least Squares Programming) for constrained optimization problems.... | 16,898 | [
{
"from": "human",
"value": "Is there an open-source alternative to MATLAB's fmincon function for constrained linear optimization? I'm rewriting a MATLAB program to use Python / NumPy / SciPy and this is the only function I haven't found an equivalent to. A NumPy-based solution would be ideal, but any langu... |
A client of mine uses Oracle 9i's utl_smtp to send mails out notifications to managers when their employees have made travel requests and they woul like quite a few changes made to the mailouts done.
We're having a lot of problems getting utl_smtp to talk to any smtp server on our network. We've even tried installing ... | Hi Dan,
Using Oracle's `utl_smtp` package can sometimes be tricky, especially when dealing with configurations related to SMTP servers. Let me address your two questions.
### 1. Troubleshooting `utl_smtp` and ORA-29278
The error code `ORA-29278` typically indicates that there was a problem connecting to the SMTP ser... | 12,905 | [
{
"from": "human",
"value": "A client of mine uses Oracle 9i's utl_smtp to send mails out notifications to managers when their employees have made travel requests and they woul like quite a few changes made to the mailouts done. \nWe're having a lot of problems getting utl_smtp to talk to any smtp server on... |
I need to get access to the iTunes tags in an RSS feed using PHP. I've used simplepie before for podcast feeds, but I'm not sure how to get the iTunes tags using it. Is there a way to use simplepie to do it or is there a better way?
Okay I tried Simple XML.
All this (the code below) seems to work
$feed = simplexml_loa... | When working with iTunes tags in an RSS feed using PHP and SimpleXML, you can indeed extract categories, including nested categories, from the iTunes namespace. It sounds like you've already been able to get basic iTunes information like summary, subtitle, and owner, but you're having trouble with categories, especiall... | 14,698 | [
{
"from": "human",
"value": "I need to get access to the iTunes tags in an RSS feed using PHP. I've used simplepie before for podcast feeds, but I'm not sure how to get the iTunes tags using it. Is there a way to use simplepie to do it or is there a better way?\n\nOkay I tried Simple XML.\nAll this (the cod... |
I have integrated SRM 5.0 into Portal. Most of the iviews are IAC i.e., all are ITS based services.
The issue is that the Portal Theme does not get reflected on these services after integration.
When a BSP or Webdynpro is integrated then the application reflects the Portal Theme when executed from Portal but the ITS se... | When dealing with SAP Portal and ITS (Internet Transaction Server) based applications, getting the portal theme to reflect correctly in ITS-based iViews can be a challenge due to the different rendering mechanisms involved. Unlike Web Dynpro and BSP applications that adapt better to portal themes, ITS services often re... | 16,123 | [
{
"from": "human",
"value": "I have integrated SRM 5.0 into Portal. Most of the iviews are IAC i.e., all are ITS based services.\nThe issue is that the Portal Theme does not get reflected on these services after integration.\nWhen a BSP or Webdynpro is integrated then the application reflects the Portal The... |
I would like to know how to unload an assembly that is loaded into the main AppDomain.
I have the following code:
var assembly = Assembly.LoadFrom( FilePathHere );
I need/want to be able to unload this assembly when I am done.
Thanks for your help.
| In .NET Framework, once an assembly is loaded into the default application domain (AppDomain), you cannot unload it directly. Assemblies are loaded into the AppDomain and remain there until the entire AppDomain is unloaded, which is typically not something you want to do if you have other resources or code running in t... | 14,490 | [
{
"from": "human",
"value": "I would like to know how to unload an assembly that is loaded into the main AppDomain.\nI have the following code:\nvar assembly = Assembly.LoadFrom( FilePathHere );\n\nI need/want to be able to unload this assembly when I am done.\nThanks for your help.\n"
},
{
"from": ... |
I have a UserControl (Composite control) that can be shown as the following pseudo XAML code:
<UserControl>
<DockPanel>
<TextBox />
<Button />
</DockPanel>
</UserControl>
I use this custom control in a bunch of places and style some of them with a WPF Style. This style sets the Background property of the U... | To achieve the desired behavior where the UserControl’s background color does not show but instead only affects the TextBox’s background, you can make the following adjustments to your UserControl's XAML.
### Option 1: Use a Transparent Background
You can set the UserControl's background to `Transparent`. This way, t... | 17,288 | [
{
"from": "human",
"value": "I have a UserControl (Composite control) that can be shown as the following pseudo XAML code:\n<UserControl>\n <DockPanel>\n <TextBox />\n <Button />\n </DockPanel>\n</UserControl>\n\nI use this custom control in a bunch of places and style some of them with a WPF Style.... |
I've been using Git on Linux for about a year, and everything works fine. Since recently, a colleague has joined development and he's using Windows. Everything works fine there as well, but sometimes when he tries to push changes to a remote repository (bare) on Linux server it bails out with 'Invalid file descriptor' ... | The "Invalid file descriptor" error when pushing from a Windows Git client to a Linux remote repository can be caused by several factors, particularly related to the differences in how filesystems and network protocols work across platforms. Here are some steps to troubleshoot and potentially resolve the issue:
1. **C... | 16,305 | [
{
"from": "human",
"value": "I've been using Git on Linux for about a year, and everything works fine. Since recently, a colleague has joined development and he's using Windows. Everything works fine there as well, but sometimes when he tries to push changes to a remote repository (bare) on Linux server it ... |
I am building my first report in BIRT.
Very quickly I ran into a problem in which I wanted to display some text or data based on an expression that included data from two different tables (not tables that can/should be joined - (hypothetically example- take a student's ACT score from his record in the student table and... | In BIRT (Business Intelligence and Reporting Tools), when dealing with multiple datasets, especially if you want to compare or combine data from different datasets, you have to utilize scripting and parameter passing techniques to work around the limitation of binding a single data element to one dataset. Here’s how yo... | 14,237 | [
{
"from": "human",
"value": "I am building my first report in BIRT.\nVery quickly I ran into a problem in which I wanted to display some text or data based on an expression that included data from two different tables (not tables that can/should be joined - (hypothetically example- take a student's ACT scor... |
I am using Eclipse for quite some time and I still haven't found how to configure the Problems View to display only the Errors and Warnings of interest. Is there an easy way to filter out warnings from a specific resource or from a specific path? For example, when I generate javadoc I get tons of irrelevant html warnin... | In Eclipse, managing the Problems View can be crucial for focusing on the relevant issues in your code, especially when dealing with a lot of warnings and errors. Here are some suggestions on filtering and configuring the Problems View effectively, including how to manage the number of displayed items.
### Filtering E... | 12,973 | [
{
"from": "human",
"value": "I am using Eclipse for quite some time and I still haven't found how to configure the Problems View to display only the Errors and Warnings of interest. Is there an easy way to filter out warnings from a specific resource or from a specific path? For example, when I generate jav... |
I am looking for an algorithm to calculate the next set of operations in a sequence. Here is the simple definition of the sequence.
Task 1A will be done every 500 hours
Task 2A will be done every 1000 hours
Task 3A will be done every 1500 hours
So at t=500, do 1A. At t=1000, do both 1A and 2A, at t=1500 do 1A and 3A,... | The problem you're facing can be modeled using a mathematical approach based on the Least Common Multiple (LCM) of the time intervals of each task. Below, I will outline an algorithm that can help you determine the next set of operations based on the last time tasks were performed.
### Problem Understanding
You have ... | 15,116 | [
{
"from": "human",
"value": "I am looking for an algorithm to calculate the next set of operations in a sequence. Here is the simple definition of the sequence.\n\nTask 1A will be done every 500 hours\nTask 2A will be done every 1000 hours\nTask 3A will be done every 1500 hours\n\nSo at t=500, do 1A. At t=1... |
I'm trying to select a specific HTML element in a document, for firefox i just use:
xpathobj = document.evaluate(xpath, document, null,
XPathResult.FIRST_ORDERED_NODE_TYPE, null);
which works fine. However when I try the IE equivilent:
xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async=false;
xm... | Using XPath in Internet Explorer (IE) is a bit different from using it in modern browsers like Firefox or Chrome. The approach you're attempting to use with `ActiveXObject` is more suited for XML documents rather than for HTML documents.
In IE, to use XPath on an HTML document, you can leverage the `document.evaluate... | 17,191 | [
{
"from": "human",
"value": "I'm trying to select a specific HTML element in a document, for firefox i just use:\nxpathobj = document.evaluate(xpath, document, null,\n XPathResult.FIRST_ORDERED_NODE_TYPE, null);\n\nwhich works fine. However when I try the IE equivilent:\nxmlDoc=new ActiveXObje... |
I am looking for an easily digestible book to present to my boss/team.
Background info: More and more of our meetings at work involve my boss/team pondering how to implement more "best practices" around here. ("Here" = a very small application development shop. 4 developers)
The following things are items that my wh... | I recommend **"The Phoenix Project: A Novel About IT, DevOps, and Helping Your Business Win"** by Gene Kim, Kevin Behr, and George Spafford.
While it’s a novel, it presents key principles of DevOps in a relatable and engaging way. The story follows an IT manager who must rescue a struggling project and implement best... | 21,298 | [
{
"from": "human",
"value": "I am looking for an easily digestible book to present to my boss/team.\n\nBackground info: More and more of our meetings at work involve my boss/team pondering how to implement more \"best practices\" around here. (\"Here\" = a very small application development shop. 4 develo... |
Is it possible to have transport security without authentication? I'm well aware of it's flaws but atm I can't install a certificate a the client side.
It seems I can set WSHttpBinding.SecurityMode to Transport and the ClientCredentialType to HttpClientCredentialType.None, but when I try to call the service I get this ... | In your scenario, you're attempting to use `WSHttpBinding` with `Transport` security mode while setting `ClientCredentialType` to `None`. This setup means you're looking to establish a secure connection (i.e., transport security over HTTPS) without requiring client-side authentication (like a client certificate).
How... | 16,849 | [
{
"from": "human",
"value": "Is it possible to have transport security without authentication? I'm well aware of it's flaws but atm I can't install a certificate a the client side.\nIt seems I can set WSHttpBinding.SecurityMode to Transport and the ClientCredentialType to HttpClientCredentialType.None, but ... |
I installed Visual Studio (Web Developer in this case) Express Edition and was reading through the EULA. One thing that did not jump out at me was what I was allowed to use the software for (private, commercial, etc).
Does anyone know if you are allowed to sell/distribute the code you create in these Express editions?... | Yes, you are allowed to use code created with Visual Studio Express Editions for commercial purposes. The Express Editions of Visual Studio, including the Web Developer version, are designed to help developers learn and build applications without significant cost barriers, and they come with more permissive licensing c... | 20,940 | [
{
"from": "human",
"value": "I installed Visual Studio (Web Developer in this case) Express Edition and was reading through the EULA. One thing that did not jump out at me was what I was allowed to use the software for (private, commercial, etc). \nDoes anyone know if you are allowed to sell/distribute the ... |
Any time I try to publish my Portal project on a Websphere Portal 6.1 Server, I get the following error message:
Portal project publishing is not supported on WebSphere Portal v6.1 Server
Is that really true or have I done something wrong?
I'm trying to deploy a portal project, with the underlying goal of publishing a... | The error message you are encountering, "Portal project publishing is not supported on WebSphere Portal v6.1 Server," indicates a limitation with the integration between your version of Rational Application Developer (RAD) and WebSphere Portal 6.1.
Here are some insights and potential solutions to consider:
1. **Comp... | 20,163 | [
{
"from": "human",
"value": "Any time I try to publish my Portal project on a Websphere Portal 6.1 Server, I get the following error message:\nPortal project publishing is not supported on WebSphere Portal v6.1 Server\n\nIs that really true or have I done something wrong?\nI'm trying to deploy a portal proj... |
We are using log4j behind a selfmade wrapper. We plan to use much more features of it now.
Should we update to logback ?
(I mean the framework not a facade like SLF4J)
| Deciding whether to switch from Log4j to Logback depends on various factors, including your project's specific needs, the features you require, and your team's familiarity with each logging framework. Here are some points to consider when making this decision:
### Advantages of Logback:
1. **Better Performance**: Log... | 17,439 | [
{
"from": "human",
"value": "We are using log4j behind a selfmade wrapper. We plan to use much more features of it now. \nShould we update to logback ?\n(I mean the framework not a facade like SLF4J)\n"
},
{
"from": "gpt",
"value": "Deciding whether to switch from Log4j to Logback depends on var... |
I've noticed that just in the last year or so, many major websites have made the same change to the way their pages are structured. Each has moved their Javascript files from being hosted on the same domain as the page itself (or a subdomain of that), to being hosted on a differently named domain.
It's not simply paral... | The trend you're observing where websites are serving their JavaScript files from distinct domains, often seemingly dedicated or registered for that purpose, can indeed be largely attributed to the use of Content Delivery Networks (CDNs) and a variety of performance and security considerations.
Here are some key reaso... | 17,972 | [
{
"from": "human",
"value": "I've noticed that just in the last year or so, many major websites have made the same change to the way their pages are structured. Each has moved their Javascript files from being hosted on the same domain as the page itself (or a subdomain of that), to being hosted on a differ... |
I have an MFC app which I have been working on for a few weeks now, I want to manually set the dimensions of the main frame when it is loaded, can someone give me a hand with this, specifically where to put the code as well?
Thanks!
| Certainly! In an MFC (Microsoft Foundation Classes) application, you can set the dimensions of the main frame window by overriding the `OnInitialUpdate` method in your main frame class (usually derived from `CFrameWnd`).
Here’s a step-by-step guide on how to manually set the dimensions of your main frame when it is lo... | 17,570 | [
{
"from": "human",
"value": "I have an MFC app which I have been working on for a few weeks now, I want to manually set the dimensions of the main frame when it is loaded, can someone give me a hand with this, specifically where to put the code as well?\nThanks!\n"
},
{
"from": "gpt",
"value": "... |
Whenever I restore a backup of my database in SQL Server I am presented with the following error:
Msg 3101, Level 16, State 1, Line 1
Exclusive access could not be obtained because the database is in use.
Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.
Usually to get around this I just ... | Yes, you can forcefully terminate all existing connections to a SQL Server database in order to obtain exclusive access and perform a database restore without needing to restart the SQL Server instance. Below is a step-by-step guide on how to do this using T-SQL:
### Step 1: Set the Database to SINGLE_USER Mode
Befor... | 16,758 | [
{
"from": "human",
"value": "Whenever I restore a backup of my database in SQL Server I am presented with the following error:\nMsg 3101, Level 16, State 1, Line 1\nExclusive access could not be obtained because the database is in use.\nMsg 3013, Level 16, State 1, Line 1\nRESTORE DATABASE is terminating ab... |
Is there any way to do this in the Powerbuilder properties window for a datawindow's textbox?
| In PowerBuilder, when working with a DataWindow object, you can modify properties of various controls, including text boxes, through the Properties window. Here are some common properties you might want to set for a DataWindow's textbox and how to do it:
1. **Accessing the Properties Window**:
- Open your DataWindo... | 18,275 | [
{
"from": "human",
"value": "Is there any way to do this in the Powerbuilder properties window for a datawindow's textbox?\n"
},
{
"from": "gpt",
"value": "In PowerBuilder, when working with a DataWindow object, you can modify properties of various controls, including text boxes, through the Pro... |
I always felt that expecting exceptions to be thrown on a regular basis and using them as flow logic was a bad thing. Exceptions feel like they should be, well, the "exception". If you're expecting and planning for an exception, that would seem to indicate that your code should be refactored, at least in .NET...
Howe... | You've raised a compelling scenario, and it's one that prompts a lot of discussion about exception handling and flow control in software development. The core of your question hinges on whether using exceptions for control flow is a reasonable approach, particularly when performance is a concern.
### The Principle of ... | 18,936 | [
{
"from": "human",
"value": "I always felt that expecting exceptions to be thrown on a regular basis and using them as flow logic was a bad thing. Exceptions feel like they should be, well, the \"exception\". If you're expecting and planning for an exception, that would seem to indicate that your code sho... |
Maybe this applied to other Delphi's (I've only used 7). We've got our code broken up so that nearly every DLL in our fairly massive app is in a different folder.
99% of the open source stuff I've downloaded to plug into Delphi have had all their source munged into one folder.
It seems like this was an assumption th... | It sounds like you're experiencing a common challenge when working with Delphi, especially in the context of managing projects with many DLLs and a more modular folder structure. While Delphi supports organizing code in multiple directories, many open-source libraries and components tend to be packaged in a single fold... | 16,178 | [
{
"from": "human",
"value": "Maybe this applied to other Delphi's (I've only used 7). We've got our code broken up so that nearly every DLL in our fairly massive app is in a different folder. \n99% of the open source stuff I've downloaded to plug into Delphi have had all their source munged into one folder... |
I've noticed that Internet Explorer adds a number in square brackets to files downloaded from the internet (usually [1]). This creates a big problem with downloading Excel spreadsheets as square brackets are not a valid filename character inside Excel worksheet name. That problem is IE specific, others browsers are kee... | The issue you're encountering with Internet Explorer appending `[1]` to filenames can be frustrating, especially when dealing with Excel worksheets that have restrictions on certain characters. Here are a few potential solutions to work around the issue.
### Option 1: Use VBA to Rename the File Upon Opening
Since you... | 13,855 | [
{
"from": "human",
"value": "I've noticed that Internet Explorer adds a number in square brackets to files downloaded from the internet (usually [1]). This creates a big problem with downloading Excel spreadsheets as square brackets are not a valid filename character inside Excel worksheet name. That proble... |
I have a Linq query that I want to call from multiple places:
var myData = from a in db.MyTable
where a.MyValue == "A"
select new {
a.Key,
a.MyValue
};
How can I create a method, put this code in it, and then c... | To encapsulate your LINQ query in a method that can be called from multiple places, you can define a method that returns a collection of the anonymous type created by your query. However, since you cannot return an anonymous type directly, it's better to define a specific class or use a tuple to hold the results.
Here... | 14,449 | [
{
"from": "human",
"value": "I have a Linq query that I want to call from multiple places:\nvar myData = from a in db.MyTable\n where a.MyValue == \"A\"\n select new {\n a.Key,\n a.MyValue\n };\n\nHow can... |
Basically I'm running some performance tests and don't want the external network to be the drag factor. I'm looking into ways of disabling network LAN. What is an effective way of doing it programmatically? I'm interested in c#. If anyone has a code snippet that can drive the point home that would be cool.
| Disabling the network interface programmatically in C# can be done using the Windows Management Instrumentation (WMI) or by invoking command-line utilities through the process class. Below, I'll show you both methods.
### Method 1: Using WMI
You can use WMI to disable and enable network adapters in C#. The following ... | 16,191 | [
{
"from": "human",
"value": "Basically I'm running some performance tests and don't want the external network to be the drag factor. I'm looking into ways of disabling network LAN. What is an effective way of doing it programmatically? I'm interested in c#. If anyone has a code snippet that can drive the po... |
I'm working on a SaaS application where each customer will have different configurations depending on the edition they have purchased, additional features they have purchased, etc. For example, a customer might have a limit of 3 custom reports.
Obviously I want to store this configuration in the database, but I am unsu... | Designing a configuration management system for a SaaS application can be challenging, especially when aiming for flexibility to accommodate future changes without a schema change. Here are some strategies that you can consider:
### 1. **JSON or JSONB Column**
Using a JSON or JSONB data type (if supported by your dat... | 16,121 | [
{
"from": "human",
"value": "I'm working on a SaaS application where each customer will have different configurations depending on the edition they have purchased, additional features they have purchased, etc. For example, a customer might have a limit of 3 custom reports.\nObviously I want to store this co... |
I am designing a class for log entries of my mail server. I have parsed the log entries and created the class hierarchy. Now I need to save the in memory representation to the disk. I need to save it to multiple destinations like mysql and disk files. I am at a loss to find out the proper way to design the persistence ... | It sounds like you are facing a common challenge in designing a persistence mechanism that is flexible, easy to use, and scalable as you add more persistence options. In Ruby, you can leverage a few design patterns to create a cleaner solution. Here are a couple of approaches you might consider:
### 1. Strategy Patter... | 17,400 | [
{
"from": "human",
"value": "I am designing a class for log entries of my mail server. I have parsed the log entries and created the class hierarchy. Now I need to save the in memory representation to the disk. I need to save it to multiple destinations like mysql and disk files. I am at a loss to find out ... |
I am just curious to know how long, in minutes, does the reporting service take to generate report when it returns 1MB of data. Maybe using views and table is properly index. SSRS reporting and server side generation.
| The time it takes for a reporting service like SQL Server Reporting Services (SSRS) to generate a report returning 1MB of data can vary greatly based on several factors. Here are some key considerations:
1. **Data Source Performance**: The underlying database's performance is crucial. If your database tables are prope... | 15,869 | [
{
"from": "human",
"value": "I am just curious to know how long, in minutes, does the reporting service take to generate report when it returns 1MB of data. Maybe using views and table is properly index. SSRS reporting and server side generation.\n"
},
{
"from": "gpt",
"value": "The time it tak... |
I was reading a post by Brad Wilson (http://bradwilson.typepad.com/blog/2008/08/partial-renderi.html) on the new ViewEngine changes to MVC Preview 5 and thought that it would be great to be able to render a view to string for use in tests. I get the impression from the article that it may be possible to achieve this bu... | Rendering a view to a string in ASP.NET MVC can indeed be useful for unit testing your views. It allows you to verify that the correct content is rendered without the overhead of browser-based testing frameworks like WatIn. You can achieve this by creating a helper method that utilizes the `RazorView` and the `ViewEngi... | 14,560 | [
{
"from": "human",
"value": "I was reading a post by Brad Wilson (http://bradwilson.typepad.com/blog/2008/08/partial-renderi.html) on the new ViewEngine changes to MVC Preview 5 and thought that it would be great to be able to render a view to string for use in tests. I get the impression from the article t... |
For a while the proactive caching process successfully sync the OLAP databse and then is starts giving the following error 'Errors in the OLAP storage engine: The attribute key cannot be found:' followed by spesific data related information. I do not however have a problem if I manually process the databse with the 'Tr... | The error message you are encountering, "Errors in the OLAP storage engine: The attribute key cannot be found," often indicates that the OLAP database is having trouble synchronizing the key values that are used to relate your dimensions to your facts in your star schema. Below are several suggestions to troubleshoot a... | 16,796 | [
{
"from": "human",
"value": "For a while the proactive caching process successfully sync the OLAP databse and then is starts giving the following error 'Errors in the OLAP storage engine: The attribute key cannot be found:' followed by spesific data related information. I do not however have a problem if I ... |
There has been some talk of Website performance monitoring tools and services on stackoverflow, however, they seem fairly expensive for what they actually do. Are there any good opensource libraries for automating checking/monitoring the availability of a website?
| Yes, there are several open-source libraries and tools you can use to automate the monitoring of a website's availability. Here are some popular options:
1. **Pingdom API**: While Pingdom itself is a paid service, you can interact with its API using open-source tools to fetch metrics if you have an account.
2. **Upt... | 12,281 | [
{
"from": "human",
"value": "There has been some talk of Website performance monitoring tools and services on stackoverflow, however, they seem fairly expensive for what they actually do. Are there any good opensource libraries for automating checking/monitoring the availability of a website?\n"
},
{
... |
What is an example of a fast SQL to get duplicates in datasets with hundreds of thousands of records. I typically use something like:
SELECT afield1, afield2 FROM afile a
WHERE 1 < (SELECT count(afield1) FROM afile b WHERE a.afield1 = b.afield1);
But this is quite slow.
| If you are looking for a more efficient way to find duplicates in a large dataset, consider using the `GROUP BY` clause combined with `HAVING`. This approach can significantly improve performance, especially in larger datasets.
Here’s an example of how you can find duplicates using `GROUP BY`:
```sql
SELECT afield1, ... | 19,391 | [
{
"from": "human",
"value": "What is an example of a fast SQL to get duplicates in datasets with hundreds of thousands of records. I typically use something like:\nSELECT afield1, afield2 FROM afile a \nWHERE 1 < (SELECT count(afield1) FROM afile b WHERE a.afield1 = b.afield1);\n\nBut this is quite slow.\n"... |
I am building a site that uses a simple AJAX Servlet to talk JMS (ActiveMQ) and when a message arrives from the topic to update the site.
I have Javascript that creates an XMLHttpRequest for data. The Servlet processes the Get Request and sends back JSON. However I have no idea how to connect my Servlet into my ActiveM... | To connect your AJAX Servlet to an ActiveMQ message broker and receive messages, you can implement the `MessageListener` interface in your servlet. This way, the servlet will be able to listen for incoming messages from the ActiveMQ topic.
Here's how you can set this up step by step:
### 1. Configure ActiveMQ
First... | 11,176 | [
{
"from": "human",
"value": "I am building a site that uses a simple AJAX Servlet to talk JMS (ActiveMQ) and when a message arrives from the topic to update the site.\nI have Javascript that creates an XMLHttpRequest for data. The Servlet processes the Get Request and sends back JSON. However I have no idea... |
My question is simple; is it possible to over object-orient your code?
How much is too much? At what point are you giving up readability and maintainability for the sake of OO?
I am a huge OO person but sometimes I wonder if I am over-complicating my code....
Thoughts?
| Yes, it is indeed possible to over-object-orient your code, a phenomenon often referred to as "over-engineering." While object-oriented programming (OOP) provides numerous benefits such as encapsulation, inheritance, and polymorphism, excessively applying these principles can lead to increased complexity and decreased ... | 9,586 | [
{
"from": "human",
"value": "My question is simple; is it possible to over object-orient your code? \nHow much is too much? At what point are you giving up readability and maintainability for the sake of OO? \nI am a huge OO person but sometimes I wonder if I am over-complicating my code.... \nThoughts?\n"
... |
I want to be able to place an inline inbetween two different fields in a fieldset. You can already do this with foreignkeys, I figured that inlining the class I wanted and defining it to get extra forms would do the trick, but apparently I get a:
"class x" has no ForeignKey to "class y"
error. Is this not something... | The issue you're encountering stems from how Django admin inlines are set up. To use inlines effectively, the model that you're trying to inline (in your case, `Place`) needs to have a ForeignKey pointing to the parent model (in this case, `Owner`). In your current setup, you have the `Place` model defined, but it does... | 16,893 | [
{
"from": "human",
"value": "I want to be able to place an inline inbetween two different fields in a fieldset. You can already do this with foreignkeys, I figured that inlining the class I wanted and defining it to get extra forms would do the trick, but apparently I get a:\n \"class x\" has no ForeignK... |
I need to return only the facet counts from solr. So I basically want to search over all documents and return the facet counts, but I don't want to return any search results. Is this possible?
Thanks
| Yes, it is possible to perform a search in Apache Solr that returns only the facet counts without returning any search results. You can achieve this by setting the `rows` parameter to `0` in your Solr query. This tells Solr not to return any document results, only the facet information.
Here's an example of how you ca... | 20,527 | [
{
"from": "human",
"value": "I need to return only the facet counts from solr. So I basically want to search over all documents and return the facet counts, but I don't want to return any search results. Is this possible?\nThanks\n"
},
{
"from": "gpt",
"value": "Yes, it is possible to perform a ... |
How can I get a single keyboard character from the terminal with Ruby without pressing enter?
I tried Curses::getch, but that didn't really work for me.
| To read a single character input from the terminal in Ruby without waiting for the Enter key, you can use the `io/console` library. This library provides a way to read a single character input in a non-blocking manner.
Here's a simple example of how you can achieve this:
```ruby
require 'io/console'
puts "Press any ... | 20,297 | [
{
"from": "human",
"value": "How can I get a single keyboard character from the terminal with Ruby without pressing enter?\nI tried Curses::getch, but that didn't really work for me.\n"
},
{
"from": "gpt",
"value": "To read a single character input from the terminal in Ruby without waiting for t... |
Context:
A while ago, I stumbled upon this 2001 DDJ article by Alexandrescu:
http://www.ddj.com/cpp/184403799
It's about comparing various ways to initialized a buffer to some value. Like what "memset" does for single-byte values. He compared various implementations (memcpy, explicit "for" loop, duff's device) and did... | This is a well-known problem in the performance optimization domain, especially for tasks like buffer initialization, which can be critical in performance-sensitive applications such as image processing. Here’s a comprehensive analysis of your options given the context of your situation:
### Performance of `memset` in... | 15,275 | [
{
"from": "human",
"value": "Context:\nA while ago, I stumbled upon this 2001 DDJ article by Alexandrescu: \nhttp://www.ddj.com/cpp/184403799\nIt's about comparing various ways to initialized a buffer to some value. Like what \"memset\" does for single-byte values. He compared various implementations (memcp... |
I need to check CPU and memory usage for the server in java, anyone know how it could be done?
| To check CPU and memory usage in Java, you can use the `OperatingSystemMXBean` interface, which is part of the Java Management Extensions (JMX). This allows you to gather system-level information such as CPU load and memory usage. Here's a simple example of how to retrieve this information.
### Example Code
```java
i... | 13,759 | [
{
"from": "human",
"value": "I need to check CPU and memory usage for the server in java, anyone know how it could be done?\n"
},
{
"from": "gpt",
"value": "To check CPU and memory usage in Java, you can use the `OperatingSystemMXBean` interface, which is part of the Java Management Extensions (... |
Is it possible to make it appear to a system that a key was pressed, for example I need to make A key be pressed thousands of times, and it is much to time consuming to do it manually, I would like to write something to do it for me, and the only thing I know well enough is Python.
A better way to put it, I need to em... | Yes, it is possible to simulate key presses in Python, especially on Windows. Since you mentioned that you're running Windows XP, you can use the `pyautogui` library, which allows you to control the mouse and keyboard, or you can use the `pywin32` library to simulate key presses.
### Method 1: Using `pyautogui`
First... | 16,785 | [
{
"from": "human",
"value": "Is it possible to make it appear to a system that a key was pressed, for example I need to make A key be pressed thousands of times, and it is much to time consuming to do it manually, I would like to write something to do it for me, and the only thing I know well enough is Pyt... |
The singleton pattern is a fully paid up member of the GoF's patterns book, but it lately seems rather orphaned by the developer world. I still use quite a lot of singletons, especially for factory classes, and while you have to be a bit careful about multithreading issues (like any class actually), I fail to see why t... | The Singleton pattern is indeed a well-known design pattern cataloged in the "Gang of Four" (GoF) book "Design Patterns: Elements of Reusable Object-Oriented Software." It is primarily designed to ensure that a class has only one instance and provides a global point of access to that instance. Despite its historical po... | 11,304 | [
{
"from": "human",
"value": "The singleton pattern is a fully paid up member of the GoF's patterns book, but it lately seems rather orphaned by the developer world. I still use quite a lot of singletons, especially for factory classes, and while you have to be a bit careful about multithreading issues (like... |
I am setting up a test version of my website against a new schema. I am trying to connect using the proxy connection and am getting the following error:
ORA-28150: proxy not authorized to connect as client
my connect string has the following form:
Data Source=Instance; User Id=user; Proxy User Id=prxy_usr;Proxy Pas... | The error message `ORA-28150: proxy not authorized to connect as client` indicates that the proxy user (in your case, `prxy_usr`) is not authorized to connect as the target user (`user`). This typically happens when the necessary permissions or configurations for proxy authentication have not been set up correctly in t... | 16,607 | [
{
"from": "human",
"value": "I am setting up a test version of my website against a new schema. I am trying to connect using the proxy connection and am getting the following error: \n\nORA-28150: proxy not authorized to connect as client\n\nmy connect string has the following form:\n\nData Source=Instance;... |
dir(re.compile(pattern))
does not return pattern as one of the lists's elements. Namely it returns:
['__copy__', '__deepcopy__', 'findall', 'finditer', 'match', 'scanner', 'search', 'split', 'sub', 'subn']
According to the manual, it is supposed to contain
the object's attributes' names, the
names of its class's... | The `dir()` function in Python is designed to return a list of attributes and methods of an object, but it does not guarantee that this list is exhaustive. It's important to understand that `dir()` may not show certain attributes, especially if they are defined at a lower level, are private, or if they are dynamically ... | 17,941 | [
{
"from": "human",
"value": "dir(re.compile(pattern)) \n\ndoes not return pattern as one of the lists's elements. Namely it returns:\n['__copy__', '__deepcopy__', 'findall', 'finditer', 'match', 'scanner', 'search', 'split', 'sub', 'subn']\n\nAccording to the manual, it is supposed to contain \n\nthe object... |
Table1:
Everything including the kitchen sink. Dates in the wrong format (year last so you cannot sort on that column), Numbers stored as VARCHAR, complete addresses in the 'street' column, firstname and lastname in the firstname column, city in the lastname column, incomplete addresses, Rows that update preceeding row... | It sounds like you’re dealing with a very complex and problematic database system that lacks the foundational principles of data integrity, normalization, and efficient tracking of changes. Here are some suggestions on how to approach this situation:
### 1. Understanding Your Current Environment
Before diving into so... | 13,294 | [
{
"from": "human",
"value": "Table1:\nEverything including the kitchen sink. Dates in the wrong format (year last so you cannot sort on that column), Numbers stored as VARCHAR, complete addresses in the 'street' column, firstname and lastname in the firstname column, city in the lastname column, incomplete ... |
As part of some error handling in our product, we'd like to dump some stack trace information. However, we experience that many users will simply take a screenshot of the error message dialog instead of sending us a copy of the full report available from the program, and thus I'd like to make some minimal stack trace i... | To extract the file and line number information from a .NET stack trace in a language-neutral manner, you can use regular expressions to match the pattern that includes the file path and line number. The general format you're dealing with is:
```
at <class/method> [in <file>:line <line number>]
```
However, since the... | 13,881 | [
{
"from": "human",
"value": "As part of some error handling in our product, we'd like to dump some stack trace information. However, we experience that many users will simply take a screenshot of the error message dialog instead of sending us a copy of the full report available from the program, and thus I'... |
What is currently the best tool for JavaME unit testing? I´ve never really used unit testing before (shame on me!), so learning curve is important. I would appreciate some pros and cons with your answer. :)
| Java ME (Java Platform, Micro Edition) is a set of specifications that extend the Java SE (Standard Edition) to meet the needs of resource-constrained devices, like mobile phones and embedded systems. When it comes to unit testing in Java ME, there are a few tools and frameworks you can consider, but options are limite... | 16,752 | [
{
"from": "human",
"value": "What is currently the best tool for JavaME unit testing? I´ve never really used unit testing before (shame on me!), so learning curve is important. I would appreciate some pros and cons with your answer. :)\n"
},
{
"from": "gpt",
"value": "Java ME (Java Platform, Mic... |
Is it possible to have an anonymous type implement an interface?
I've got a piece of code that I would like to work, but don't know how to do this.
I've had a couple of answers that either say no, or create a class that implements the interface construct new instances of that. This isn't really ideal, but I'm wondering... | In C#, anonymous types are designed to provide a quick way to encapsulate a set of read-only properties without having to explicitly define a class. However, they do not allow you to implement interfaces. This limitation means you cannot pass an anonymous type to a method expecting an interface, as in your example with... | 17,942 | [
{
"from": "human",
"value": "Is it possible to have an anonymous type implement an interface?\nI've got a piece of code that I would like to work, but don't know how to do this.\nI've had a couple of answers that either say no, or create a class that implements the interface construct new instances of that.... |
I was wrestling with some Perl that uses hash references.
In the end it turned out that my problem was the line:
$myhash{$key} |= {};
That is, "assign $myhash{$key} a reference to an empty hash, unless it already has a value".
Dereferencing this and trying to use it as a hash reference, however, resulted in interprete... | Certainly! The issue you're facing stems from how the bitwise OR assignment operator (`|=`) interacts with the assignment of hash references in Perl.
### Understanding the Operators
The line:
```perl
$myhash{$key} |= {};
```
is using the bitwise OR assignment operator (`|=`). The `|=` operator performs a bitwise OR... | 17,101 | [
{
"from": "human",
"value": "I was wrestling with some Perl that uses hash references.\nIn the end it turned out that my problem was the line:\n$myhash{$key} |= {};\n\nThat is, \"assign $myhash{$key} a reference to an empty hash, unless it already has a value\".\nDereferencing this and trying to use it as a... |
I have a c# application that runs as a windows service controlling socket connections and other things.
Also, there is another windows forms application to control and configure this service (systray with start, stop, show form with configuration parameters).
I'm using .net remoting to do the IPC and that was fine, but... | Running a Windows Forms application directly from a Windows Service is not recommended, primarily because services run in a different session than user applications, which can lead to all kinds of complications, including issues with UI accessibility and security.
However, if you absolutely need to combine both applic... | 16,341 | [
{
"from": "human",
"value": "I have a c# application that runs as a windows service controlling socket connections and other things.\nAlso, there is another windows forms application to control and configure this service (systray with start, stop, show form with configuration parameters).\nI'm using .net re... |
I'm testing the speed of some queries in MySQL. The database is caching these queries making it difficult for me to get reliable results when testing how fast these queries are.
Is there a way to disable caching for a query?
System: MySQL 4 on Linux webhosting, I have access to PHPMyAdmin.
Thanks
| In MySQL, you can disable query caching for individual queries by using the `SQL_NO_CACHE` option in your SQL statement. This will instruct MySQL to not use the query cache for that specific query, allowing you to measure the actual performance without interference from cached results.
Here's an example of how to use ... | 20,687 | [
{
"from": "human",
"value": "I'm testing the speed of some queries in MySQL. The database is caching these queries making it difficult for me to get reliable results when testing how fast these queries are.\nIs there a way to disable caching for a query?\nSystem: MySQL 4 on Linux webhosting, I have access t... |
I wanted to change the resolution of a image,this image I am getting from remote location.The image I am getting is too large to fit in iPhone screen is their any way to change that resolution?
| Yes, you can change the resolution of an image to make it fit better on your iPhone screen. Here are a few methods you can use, depending on whether you prefer to do it on a computer or directly on your iPhone.
### On a Computer
1. **Using Image Editing Software:**
- **Photoshop/GIMP/Any Image Editor:**
- Ope... | 14,542 | [
{
"from": "human",
"value": "I wanted to change the resolution of a image,this image I am getting from remote location.The image I am getting is too large to fit in iPhone screen is their any way to change that resolution?\n"
},
{
"from": "gpt",
"value": "Yes, you can change the resolution of an... |
In C/C++, how would I turn a blocking socket into a non blocking socket in both WinSocks and *nix; so that select() would work correctly. You can use the pre-processor for the platform specific code.
| To convert a blocking socket into a non-blocking socket in C/C++, you can use platform-specific functions provided by the respective operating systems. Below is a code snippet that demonstrates how to do this for both WinSock (Windows) and POSIX (Unix-like systems) using preprocessor directives.
### Code Snippet
```c... | 14,539 | [
{
"from": "human",
"value": "In C/C++, how would I turn a blocking socket into a non blocking socket in both WinSocks and *nix; so that select() would work correctly. You can use the pre-processor for the platform specific code.\n"
},
{
"from": "gpt",
"value": "To convert a blocking socket into ... |
using C++Builder 2007, the FindFirstFile and FindNextFile functions doesn't seem to be able to find some files on 64-bit versions of Vista and XP. My test application is 32-bit.
If I use them to iterate through the folder C:\Windows\System32\Drivers they only find a handful of files although there are 185 when I issue ... | The issue you're facing is a result of the way Windows handles file system redirection on 64-bit operating systems. When a 32-bit application tries to access the `C:\Windows\System32` directory, it is actually redirected to the `C:\Windows\SysWOW64` directory. This redirection is a part of the Windows-on-Windows 64-bit... | 9,236 | [
{
"from": "human",
"value": "using C++Builder 2007, the FindFirstFile and FindNextFile functions doesn't seem to be able to find some files on 64-bit versions of Vista and XP. My test application is 32-bit.\nIf I use them to iterate through the folder C:\\Windows\\System32\\Drivers they only find a handful ... |
I have an XML document with un-namespaced elements, and I want to use XSLT to add namespaces to them. Most elements will be in namespace A; a few will be in namespace B. How do I do this?
| To add namespaces to un-namespaced elements in an XML document using XSLT, you can define the desired namespaces and then apply them conditionally based on the specific elements you want to place in each namespace. Here’s a basic guide on how to do this, including an example.
### Example XML Input
Assume you have the... | 12,534 | [
{
"from": "human",
"value": "I have an XML document with un-namespaced elements, and I want to use XSLT to add namespaces to them. Most elements will be in namespace A; a few will be in namespace B. How do I do this?\n"
},
{
"from": "gpt",
"value": "To add namespaces to un-namespaced elements in... |
Long story short, I have a substantial Python application that, among other things, does outcalls to "losetup", "mount", etc. on Linux. Essentially consuming system resources that must be released when complete.
If my application crashes, I want to ensure these system resources are properly released.
Does it make sens... | Your approach of using a `try-except` block to call a `cleanup` function upon catching an exception is a common pattern in Python, but there are some considerations and improvements you can make to ensure that system resources are properly released, even if your application crashes or terminates unexpectedly.
### Usin... | 9,079 | [
{
"from": "human",
"value": "Long story short, I have a substantial Python application that, among other things, does outcalls to \"losetup\", \"mount\", etc. on Linux. Essentially consuming system resources that must be released when complete.\nIf my application crashes, I want to ensure these system reso... |
We let users create ad-hoc queries in our website. We would like to have the user select their criteria, then click submit and have the results streamed automatically to Excel. I have the application populating a DataTable, then using the datatable to create a tab delimited string. The problem is getting that to exc... | To stream data directly to Excel from a web application without requiring users to close an empty window, you can utilize HTTP headers to present the data as a downloadable file. Here’s a step-by-step approach on how to achieve this using the DataTable you already have populated:
### Step 1: Create a Tab-Delimited Str... | 14,826 | [
{
"from": "human",
"value": "We let users create ad-hoc queries in our website. We would like to have the user select their criteria, then click submit and have the results streamed automatically to Excel. I have the application populating a DataTable, then using the datatable to create a tab delimited st... |
How can I find out the decorated name that will be asigned to each method name ? I'm trying to find out what the decorated name is , so that I may export it , in a DLL .
| In C++, decorated names (also known as mangled names) are used by the compiler to encode additional information about a function, such as its return type, parameter types, and the namespace or class it belongs to. This allows the linker to distinguish between functions that may have the same name but differ in their pa... | 17,486 | [
{
"from": "human",
"value": "How can I find out the decorated name that will be asigned to each method name ? I'm trying to find out what the decorated name is , so that I may export it , in a DLL .\n"
},
{
"from": "gpt",
"value": "In C++, decorated names (also known as mangled names) are used b... |
My app keeps track of the state of about 1000 objects. Those objects are read from and written to a persistent store (serialized) in no particular order.
Right now the app uses the registry to store each object's state. This is nice because:
It is simple
It is very fast
Individual object's state can be read/writte... | It sounds like you have a good understanding of the trade-offs involved with using the Windows registry versus a more structured database approach like SQLite or file-based storage. Here are some alternative suggestions, each with its own pros and cons:
### 1. SQLite
While you mentioned concerns about multiple reader... | 14,724 | [
{
"from": "human",
"value": "My app keeps track of the state of about 1000 objects. Those objects are read from and written to a persistent store (serialized) in no particular order. \nRight now the app uses the registry to store each object's state. This is nice because:\n\nIt is simple\nIt is very fast... |
I'm a Java programmer, and I like my compiler, static analysis tools and unit testing frameworks as tools that help me quickly deliver robust and efficient code. The JRE is pretty much everywhere I would work, too.
Given that situation, I can't see a reason why I would ever choose to use shell scripting, vb scripting e... | As a Java programmer with a strong reliance on your development tools and a preference for compiled languages, there are indeed situations where scripting languages can be more advantageous than writing Java code (or similar compiled languages). Here are some scenarios where choosing shell scripting, VB scripting, or o... | 11,986 | [
{
"from": "human",
"value": "I'm a Java programmer, and I like my compiler, static analysis tools and unit testing frameworks as tools that help me quickly deliver robust and efficient code. The JRE is pretty much everywhere I would work, too.\nGiven that situation, I can't see a reason why I would ever cho... |
I have an array of a few million numbers.
double* const data = new double (3600000);
I need to iterate through the array and find the range (the largest value in the array minus the smallest value). However, there is a catch. I only want to find the range where the smallest and largest values are within 1,000 samples ... | The problem you are describing involves finding the maximum range within a sliding window of size 1000 in a large array. The range is defined as the difference between the maximum and minimum values within that window. Given that you want to optimize the algorithm, let's explore a more efficient approach.
Your initial... | 15,526 | [
{
"from": "human",
"value": "I have an array of a few million numbers.\ndouble* const data = new double (3600000);\n\nI need to iterate through the array and find the range (the largest value in the array minus the smallest value). However, there is a catch. I only want to find the range where the smallest ... |
Has anybody established a good naming convention for action in MVC? I was specifically looking at ASP.net MVC but it is a general question. For instance I have an action which displays the login screen (Login) and one which process the login request from that page (LoginTest). I'm not keen on the names and I have a ... | When it comes to naming conventions for actions in an MVC (Model-View-Controller) framework like ASP.NET MVC, it's important to choose names that are clear, consistent, and convey the purpose of the actions. Here are some general guidelines and conventions that can help you establish a good naming scheme:
### General ... | 11,607 | [
{
"from": "human",
"value": "Has anybody established a good naming convention for action in MVC? I was specifically looking at ASP.net MVC but it is a general question. For instance I have an action which displays the login screen (Login) and one which process the login request from that page (LoginTest).... |
Does anyone have experience with LLVM, llvm-gcc, or Clang?
The whole idea behind llvm seems very intriguing to me and I'm interested in seeing how it performs. I just don't want to dump a whole lot of time into trying the tools out if the tools are not ready for production.
If you have experience with the tools, what ... | LLVM, Clang, and llvm-gcc have been widely used in both academic and production settings, and many developers have found them to be powerful tools for modern software development. Here's a summary of the experiences, benefits, and limitations associated with these tools:
### Benefits of LLVM and Clang
1. **Modularity... | 16,170 | [
{
"from": "human",
"value": "Does anyone have experience with LLVM, llvm-gcc, or Clang?\nThe whole idea behind llvm seems very intriguing to me and I'm interested in seeing how it performs. I just don't want to dump a whole lot of time into trying the tools out if the tools are not ready for production.\nI... |
One of our unit tests is to populate properties within our business objects with random data.
These properties are of different intrinsic types and therefore we would like to use the power of generics to return data of the type you pass in. Something along the lines of:
public static T GetData<T>()
How would you go ab... | Using generics to create a method that generates random data for different intrinsic types is a good approach. You can leverage the `IConvertible` interface, but since it deals with type conversion rather than random data generation, it might not be the best fit for your use case.
Instead, you can create a method that... | 16,878 | [
{
"from": "human",
"value": "One of our unit tests is to populate properties within our business objects with random data.\nThese properties are of different intrinsic types and therefore we would like to use the power of generics to return data of the type you pass in. Something along the lines of:\npublic... |
Does windows have any decent sampling (eg. non-instrumenting) profilers available? Preferably something akin to Shark on MacOS, although i am willing to accept that i am going to have to pay for such a profiler on windows.
I've tried the profiler in VS Team Suite and was not overly impressed, and was wondering if ther... | Yes, there are several good sampling profilers available for C/C++ development on Windows. Here are some options you might find useful:
1. **Intel VTune Profiler**: This is a powerful profiler that offers advanced sampling capabilities, including CPU and memory analysis. VTune can help identify hotspots in your code a... | 19,014 | [
{
"from": "human",
"value": "Does windows have any decent sampling (eg. non-instrumenting) profilers available? Preferably something akin to Shark on MacOS, although i am willing to accept that i am going to have to pay for such a profiler on windows.\nI've tried the profiler in VS Team Suite and was not o... |
We use Spring + Hibernate for a Webapp.
This Webapp will be deployed on two unrelated production sites. These two production sites will use the Webapp to generate and use Person data in parallel.
What I need to do, is to make sure that the Persons generated on these two unrelated production sites all have distinct PKs,... | To achieve your goal of having distinct primary keys for `Person` entities across two unrelated production sites while using Hibernate and a sequence generator, you can create a custom identifier generator that is configurable through your Spring context. Here’s how you can do this:
### Step 1: Create a Custom Identif... | 16,007 | [
{
"from": "human",
"value": "We use Spring + Hibernate for a Webapp.\nThis Webapp will be deployed on two unrelated production sites. These two production sites will use the Webapp to generate and use Person data in parallel.\nWhat I need to do, is to make sure that the Persons generated on these two unrela... |
Is there an api to bring the vista side bar to the front (Win+Space) programatically and to do the reverse (send it to the back ground).
| In Windows Vista, the sidebar (which contains gadgets) could be managed programmatically, but there isn't a specific API provided by Microsoft to bring the sidebar to the front or send it to the back like the keyboard shortcut `Win + Space`.
However, you can manipulate the visibility of the sidebar window using Win32 ... | 19,406 | [
{
"from": "human",
"value": "Is there an api to bring the vista side bar to the front (Win+Space) programatically and to do the reverse (send it to the back ground).\n"
},
{
"from": "gpt",
"value": "In Windows Vista, the sidebar (which contains gadgets) could be managed programmatically, but the... |
If something goes wrong in a WCF REST call, such as the requested resource is not found, how can I play with the HTTP response code (setting it to something like HTTP 404, for example) in my OperationContract method?
| In WCF (Windows Communication Foundation), when you are working with RESTful services, you can control the HTTP response codes through the use of the `WebFaultException<T>` class or by manipulating the `WebOperationContext` within your `OperationContract` methods.
Here’s how you can implement it:
### Using WebFaultE... | 17,425 | [
{
"from": "human",
"value": "If something goes wrong in a WCF REST call, such as the requested resource is not found, how can I play with the HTTP response code (setting it to something like HTTP 404, for example) in my OperationContract method?\n"
},
{
"from": "gpt",
"value": "In WCF (Windows C... |
Does my question make sense? Using either Vim or Emacs, you come to understand that the interface exposes the code's representation of the state of the file you are editing in the buffer, the file is the on-disk storage you can fill a buffer from or write a buffer to. All these things a programmer would know, but when ... | Your question makes sense and touches on an interesting aspect of the evolution of text editors. You’re observing a distinction between older, more traditional editors like Vim and Emacs and modern text editors, which tend to abstract away the underlying details of file management and the buffer state.
Historically, e... | 19,494 | [
{
"from": "human",
"value": "Does my question make sense? Using either Vim or Emacs, you come to understand that the interface exposes the code's representation of the state of the file you are editing in the buffer, the file is the on-disk storage you can fill a buffer from or write a buffer to. All these ... |
When I use ApacheBench to test https, the error is returned, "ssl handshake failed".
How can I use ApacheBench to test https?
| When you encounter the "ssl handshake failed" error while using ApacheBench (`ab`) to test HTTPS connections, it typically indicates that there may be issues with the SSL/TLS configuration or compatibility. Here are a few steps you can take to resolve this issue and successfully use ApacheBench for HTTPS testing:
### ... | 17,137 | [
{
"from": "human",
"value": "When I use ApacheBench to test https, the error is returned, \"ssl handshake failed\".\nHow can I use ApacheBench to test https?\n"
},
{
"from": "gpt",
"value": "When you encounter the \"ssl handshake failed\" error while using ApacheBench (`ab`) to test HTTPS connec... |
I have a PHP script that listens on a queue. Theoretically, it's never supposed to die. Is there something to check if it's still running? Something like Ruby's God ( http://god.rubyforge.org/ ) for PHP?
God is language agnostic but it would be nice to have a solution that works on windows as well.
| Yes, there are several approaches and tools you can use to monitor long-running PHP scripts to ensure they are still running, similar to Ruby's God. Here are some options:
### 1. Supervisord
- **Description**: Supervisord is a process control system that can start, stop, and monitor processes. It's language-agnostic a... | 16,737 | [
{
"from": "human",
"value": "I have a PHP script that listens on a queue. Theoretically, it's never supposed to die. Is there something to check if it's still running? Something like Ruby's God ( http://god.rubyforge.org/ ) for PHP?\nGod is language agnostic but it would be nice to have a solution that work... |
Over the past year or so my production platform has been plagued by an odd TCP/IP issue. I've spent zillions of hours working with competent & knowledgeable sysadmins, scouring the net, reading source code, been jerked around by RH's pathetic support, and crying tears of blood! To no avail. (Google 'unkn-4' and you'... | It sounds like you've been through quite the ordeal with your TCP/IP issue! Fortunately, there are several avenues you can explore to seek advice and potentially solve your problem. Here are some suggestions for communities and resources where you can ask detailed questions and get insights from knowledgeable individua... | 17,872 | [
{
"from": "human",
"value": "Over the past year or so my production platform has been plagued by an odd TCP/IP issue. I've spent zillions of hours working with competent & knowledgeable sysadmins, scouring the net, reading source code, been jerked around by RH's pathetic support, and crying tears of blood!... |
Is there an event like onLoad?
just at closing the Site (onClose)?
| In web development, there isn't a specific event like `onLoad` for detecting when a user is about to close a web page. However, you can use the `beforeunload` event to execute some code before a user navigates away from or closes the page. This event allows you to prompt the user with a confirmation dialog, warning the... | 20,428 | [
{
"from": "human",
"value": "Is there an event like onLoad? \njust at closing the Site (onClose)?\n"
},
{
"from": "gpt",
"value": "In web development, there isn't a specific event like `onLoad` for detecting when a user is about to close a web page. However, you can use the `beforeunload` event ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.