instruction
stringlengths
14
27.6k
completion
stringlengths
3
38.3k
__original_row_idx
int64
0
50k
conversations
listlengths
2
2
So I'm amending someone else's code, and they've used a data-bound Accordion control. I need to disable the Accordion functionality so that the top item is expanded and the rest are just minimized and kept that way. Also is there any way to put a class on the final item? Thanks a lot in advance.
To disable the expanding functionality of a data-bound Accordion control and ensure that only the top item is expanded, you'll need to adjust the behavior of the accordion in your code. The exact implementation can vary depending on the framework or library you are using (e.g., ASP.NET, jQuery UI, Bootstrap, etc.), so ...
23,895
[ { "from": "human", "value": "So I'm amending someone else's code, and they've used a data-bound Accordion control. I need to disable the Accordion functionality so that the top item is expanded and the rest are just minimized and kept that way.\nAlso is there any way to put a class on the final item?\nThank...
I know how to capture a camera snaphot on Windows Mobile 5.0/6 using SHCameraCapture. But is there something more extensive that allows me much finer control? Namely to get available zoom levels and to set the zoom level programmatically, also e.g. different ISO modes / lightsensitivity and setting of macro mode if ava...
When working with camera functionalities on Windows Mobile 5.0 and 6, the SHCameraCapture API provides basic camera access, but it indeed lacks the finer control you are looking for, such as zoom levels, ISO settings, and macro mode. For more extensive control over camera features on Windows Mobile, you should conside...
27,513
[ { "from": "human", "value": "I know how to capture a camera snaphot on Windows Mobile 5.0/6 using SHCameraCapture. But is there something more extensive that allows me much finer control? Namely to get available zoom levels and to set the zoom level programmatically, also e.g. different ISO modes / lightsen...
I have a basic quiz/survey type application I'm working on, and I'd like to give the user a prompt before they submit if they haven't answered all the questions. All the questions are multiple choice using radio buttons: <div class="question"> Q1: What is the second letter of the alphabet? <div class="choices">...
To achieve the functionality of checking whether all questions in your quiz have been answered before submission, you can use jQuery to iterate over the questions and check if each group of radio buttons has a selected option. If any question has not been answered, you can prompt the user accordingly. Here’s a simple ...
26,331
[ { "from": "human", "value": "I have a basic quiz/survey type application I'm working on, and I'd like to give the user a prompt before they submit if they haven't answered all the questions. All the questions are multiple choice using radio buttons:\n<div class=\"question\">\n Q1: What is the second lett...
I would like to allow the logged user to edit MediaWiki/Common.css without adding them to the sysop group. I understand that this will allow user to change it to harful ways but it is a closed wiki so that is not a problem. Any solution is acceptable even changing php code :)
Allowing a logged-in user to edit `MediaWiki:Common.css` directly, without giving them sysop rights, can be done by modifying the MediaWiki code or creating a custom extension. However, this approach should be taken with caution, even in a closed wiki, as it could lead to unintended consequences if the wrong changes ar...
27,650
[ { "from": "human", "value": "I would like to allow the logged user to edit MediaWiki/Common.css without adding them to the sysop group.\nI understand that this will allow user to change it to harful ways but it is a closed wiki so that is not a problem.\nAny solution is acceptable even changing php code :)\...
Option Explicit On Option Strict On Public Class Class1 Dim l As List(Of A) Public Sub New() l = New List(Of B) End Sub End Class Public Class A End Class Public Class B Inherits A End Class<p> I've run into this problem. I have a list declared of a Generic Type 'A' I want to define the l...
The issue you're encountering is due to the way generics work in .NET. In your code, you have declared a list of type `A`, but you are attempting to instantiate it with a list of type `B` (where `B` is a subclass of `A`). This is not allowed because of covariance and contravariance rules in generic collections. In .NE...
26,649
[ { "from": "human", "value": "Option Explicit On\nOption Strict On\n\nPublic Class Class1\n\n Dim l As List(Of A)\n\n Public Sub New()\n l = New List(Of B)\n End Sub\n\nEnd Class\n\nPublic Class A\nEnd Class\n\nPublic Class B\n Inherits A\nEnd Class<p>\n\nI've run into this problem.\nI hav...
I have subclassed java.awt.Frame and have overridden the paint() method as I wish to draw the entire contents of the window manually. However, on the graphics object, (0,0) corresponds to the upper left hand corner of the window inside the title bar decoration, not the first drawable pixel. Can I determine the co-ordin...
In Java AWT, the `paint()` method of a `Frame` (or any other top-level container) draws within the entire bounds of the window, which includes any window decorations such as the title bar and borders. As such, the coordinate (0, 0) corresponds to the top-left corner of the entire window, not just the drawable area. To...
28,396
[ { "from": "human", "value": "I have subclassed java.awt.Frame and have overridden the paint() method as I wish to draw the entire contents of the window manually.\nHowever, on the graphics object, (0,0) corresponds to the upper left hand corner of the window inside the title bar decoration, not the first dr...
I'm trying to design a model for a application allowing 2 people to bet with each other (I know, sounds stupid...). What I'm wondering about is how to connect the bet with users. The structure is like this |-------------| |----------| | Bet | | User | | BetUser1 | |----------| | BetUser...
It sounds like you're designing a simple betting system where two users can place a bet against each other. Your understanding of the relationships between users and bets is correct, but let's clarify a few things to ensure the design is both functional and clean. ### Suggested Model Design In your case, since each b...
27,253
[ { "from": "human", "value": "I'm trying to design a model for a application allowing 2 people to bet with each other (I know, sounds stupid...). What I'm wondering about is how to connect the bet with users. The structure is like this\n|-------------| |----------|\n| Bet | | User |\n...
Is it possible to store web content (such as JSPs, HTML, images, CSS etc) in a JAR file? I've been looking at various options at modularising our web applications and this is one possibility. We are currently using JSF and Facelets for our view technology - I'm thinking it may be possible to write some form of custom v...
Yes, it's indeed possible to store web content such as JSPs, HTML files, images, and CSS in a JAR file and have them loaded by a web container like Tomcat. Here are the ways you can accomplish this, along with suggestions for configuring your application: ### 1. Package Static Resources in a JAR File You can create a ...
26,028
[ { "from": "human", "value": "Is it possible to store web content (such as JSPs, HTML, images, CSS etc) in a JAR file?\nI've been looking at various options at modularising our web applications and this is one possibility.\nWe are currently using JSF and Facelets for our view technology - I'm thinking it may...
How can I rotate a layer using Core Animation around an arbitrary point? ( In my case a point that is not inside the layer I want to rotate ) I prefer doing this without changing the anchor point, because unless I get something wrong every time I change the anchor point it also changes the position of the layer. I trie...
To rotate a layer around an arbitrary point without modifying its anchor point or causing its position to change unexpectedly, you can use a combination of translation and rotation transforms. The key is to translate the layer to the point around which you want to rotate, apply the rotation, and then translate it back....
29,898
[ { "from": "human", "value": "How can I rotate a layer using Core Animation around an arbitrary point? ( In my case a point that is not inside the layer I want to rotate )\nI prefer doing this without changing the anchor point, because unless I get something wrong every time I change the anchor point it also...
I'm working on a service that needs to detect user states for all user(s) logged on to a single machine. Specifically, I want to check to see whether or not the screen saver is active and whether or not their session is locked. This code will run under a system-level service, and has no visible UI, so that may rule out...
Detecting user states such as whether the screensaver is active or whether a session is locked on a Windows machine, especially in a multi-user environment like a terminal server, can be a bit complex. You'll indeed need to leverage several Win32 APIs to get the required information. Here’s a rough outline of how to ap...
25,479
[ { "from": "human", "value": "I'm working on a service that needs to detect user states for all user(s) logged on to a single machine. Specifically, I want to check to see whether or not the screen saver is active and whether or not their session is locked.\nThis code will run under a system-level service, a...
I want to write a program that would print every combination of a set of variables to a text file, creating a word list. Each answer should be written on a separate line and write all of the results for 1 digit, 2 digits, and 3 digits to a single text file. Is there a simple way I can write a python program that can ac...
Certainly! You can create a Python program that generates all the binary combinations for 1-digit, 2-digit, and 3-digit binary numbers and writes them to a text file. Below is an example of how you can achieve this: ```python def generate_binary_combinations(n): # Create a list to hold the combinations combina...
29,989
[ { "from": "human", "value": "I want to write a program that would print every combination of a set of variables to a text file, creating a word list. Each answer should be written on a separate line and write all of the results for 1 digit, 2 digits, and 3 digits to a single text file.\nIs there a simple wa...
I stumbled across my rather ancient photo objects disks, and sadly found out the company (hemera) doesn't provide support for it anymore. this has left me with a whole pile of .hpi files. Luckily, I found this information on extracting the jpg and png components of the file. Unfortunately, I haven't been able to get it...
To solve the issue of extracting JPEG and PNG components from your `.hpi` files, I'll start by translating your Perl code into Python. This will give you an easier way to work with the files and ensure that you're using more widely supported languages. ### Python Solution Here's a Python script that should replicate ...
25,933
[ { "from": "human", "value": "I stumbled across my rather ancient photo objects disks, and sadly found out the company (hemera) doesn't provide support for it anymore. this has left me with a whole pile of .hpi files. Luckily, I found this information on extracting the jpg and png components of the file.\nUn...
Update: Thanks for the suggestions guys. After further research, I’ve reformulated the question here: Python/editline on OS X: £ sign seems to be bound to ed-prev-word On Mac OS X I can’t enter a pound sterling sign (£) into the Python interactive shell. Mac OS X 10.5.5 Python 2.5.1 (r251:54863, Jan 17 2008, 19:35:17)...
The issue you're encountering with typing the pound sterling sign (£) in the Python interactive shell on Mac OS X appears to be related to key bindings within the Readline library, which is used by Python for interactive input handling. The fact that pressing `Shift+3` results in a cursor movement rather than typing th...
28,645
[ { "from": "human", "value": "Update: Thanks for the suggestions guys. After further research, I’ve reformulated the question here: Python/editline on OS X: £ sign seems to be bound to ed-prev-word\nOn Mac OS X I can’t enter a pound sterling sign (£) into the Python interactive shell.\n\nMac OS X 10.5.5\nPyt...
I am using lots of commandLinks in my app. For them to work, JSF generates some wild Javascript ( function dpf(f) {var adp... ). Sadly, the script-tag destroys my layout. (It really does - I am sure about that). Is there a way to force JSF to generate the script-tag somewhere else?
In JSF (JavaServer Faces), when you use command links, JSF generates JavaScript code to handle AJAX requests and other interactions. However, if the auto-generated JavaScript is interfering with your layout, you can control where the script is rendered. ### Here are a few approaches to manage the placement of the scri...
27,813
[ { "from": "human", "value": "I am using lots of commandLinks in my app. For them to work, JSF generates some wild Javascript ( function dpf(f) {var adp... ). Sadly, the script-tag destroys my layout. (It really does - I am sure about that).\nIs there a way to force JSF to generate the script-tag somewhere e...
<a> <xsl:attribute name="href"> <xsl:value-of select="link" /> </xsl:attribute> <xsl:attribute name="target">new</xsl:attribute> <xsl:value-of select="title" /> </a> Thats my template, and in my code: sb.Append("<title>"); sb.AppendFormat("{0} - {1}", f.UserName, f.PointTypeDesc); sb.Append("</title>"); sb.A...
The issue you are facing with the URL rendering as "http://localhost/http://www.cnn.com" is likely due to the way the `<link>` is being processed or transformed in your XSLT template. It seems that the base URL for relative links is being incorrectly interpreted as "http://localhost/". Here are some suggestions to fix...
25,993
[ { "from": "human", "value": "<a>\n <xsl:attribute name=\"href\">\n <xsl:value-of select=\"link\" />\n </xsl:attribute>\n <xsl:attribute name=\"target\">new</xsl:attribute>\n <xsl:value-of select=\"title\" />\n </a>\n\nThats my template, and in my code:\n sb.Append(\"<title>\");\n sb.AppendFormat(\"{0} - {1}...
Announced today. Descriptions so far are confusing. Let's put together a good starting point for understanding Windows Azure. Strongly related to What is a "Cloud OS"?, but not enough to warrant closing.
Sure! Let’s break down the key concepts around Windows Azure (now known as Microsoft Azure) and clarify what it is, how it works, and what a "Cloud OS" means in this context. ### What is Microsoft Azure? Microsoft Azure is a cloud computing platform and service created by Microsoft. It provides a range of cloud servi...
27,767
[ { "from": "human", "value": "Announced today. Descriptions so far are confusing. Let's put together a good starting point for understanding Windows Azure.\nStrongly related to What is a \"Cloud OS\"?, but not enough to warrant closing.\n" }, { "from": "gpt", "value": "Sure! Let’s break down th...
I really like the way gmail has the archive system implemented. I can archive any file after adding a tag to it (if needed) and I can search for it whenever I want to. Is there any program in Windows/Linux which behaves in a similar fashion?
Yes, there are several applications on Windows and Linux that offer an archive system similar to Gmail, allowing you to store files with tagging and efficient search capabilities. Here are a few options: ### Windows 1. **TagSpaces** - An open-source tool for managing and organizing files with tags. You can tag you...
27,985
[ { "from": "human", "value": "I really like the way gmail has the archive system implemented. I can archive any file after adding a tag to it (if needed) and I can search for it whenever I want to.\nIs there any program in Windows/Linux which behaves in a similar fashion?\n" }, { "from": "gpt", "...
How would you unittest a safe-publication guarantee in Java? To be concrete: I have a Cache interface that has a method getOrLoad(K key, ObjectLoader loader). Thing is, if a Cache cannot find an object for the given key, then it must load it from the ObjectLoader instance. However, the Cache is required to guarantee th...
Testing a safe publication guarantee in Java can be a bit tricky, especially in a multithreaded environment. The idea is to ensure that once a value is published (i.e., made visible to other threads), any subsequent reads will see that value correctly. ### Key Concepts 1. **Safe Publication**: Ensures that the objec...
22,460
[ { "from": "human", "value": "How would you unittest a safe-publication guarantee in Java?\nTo be concrete:\nI have a Cache interface that has a method getOrLoad(K key, ObjectLoader loader). Thing is, if a Cache cannot find an object for the given key, then it must load it from the ObjectLoader instance. How...
I know that primary keys based on Guids do not have the best performance (due to the fragmentation), but they are globally unique and allow replication scenarios. Integral identifiers, on the other side, have greater performance at the cost of scalability. But in what scenarios would someone want to use sequential uniq...
You are correct in noting that GUIDs (Globally Unique Identifiers) provide unique identification across distributed systems and replication scenarios, but they can introduce performance issues due to fragmentation in clustered indexes. Integral identifiers (like integers) usually perform better due to their smaller siz...
23,729
[ { "from": "human", "value": "I know that primary keys based on Guids do not have the best performance (due to the fragmentation), but they are globally unique and allow replication scenarios.\nIntegral identifiers, on the other side, have greater performance at the cost of scalability.\nBut in what scenario...
I have overridden the windows ListBox in order to display an image and a piece of text in each ListBoxItem, but I need to filter the contents of the text displayed I was hoping to do this by accessing the DisplayMemberPath of the actual ListBox however I can't get it working. <Setter Property="ItemContainerStyle"> ...
The issue you're encountering stems from trying to use the `DisplayMemberPath` property within the `ListBoxItem` template. The `DisplayMemberPath` is a property of the `ListBox` and not of the `ListBoxItem`. Therefore, it cannot be accessed in this manner. To achieve your goal of displaying an image and filtered text ...
27,062
[ { "from": "human", "value": "I have overridden the windows ListBox in order to display an image and a piece of text in each ListBoxItem, but I need to filter the contents of the text displayed I was hoping to do this by accessing the DisplayMemberPath of the actual ListBox however I can't get it working.\n<...
When reading the registry for file names I get 3 entries loading into my combo box for every 1 registry entry. If I have 1 file listed in the registry I would see : Combo box values: c:\file1.txt <-----Blank here c:\file1.txt I have found the problem lies in this code, it hits 'if (previousFiles != null)' 3 times. How ...
It seems like the issue arises from how the registry values are structured or how you are iterating through the indices. If you are getting duplicate entries in your combo box, there are a couple of potential reasons and solutions to consider. ### 1. Check the Registry Structure First, ensure that the registry keys yo...
26,533
[ { "from": "human", "value": "When reading the registry for file names I get 3 entries loading into my combo box for every 1 registry entry. If I have 1 file listed in the registry I would see :\nCombo box values:\nc:\\file1.txt\n<-----Blank here\nc:\\file1.txt\nI have found the problem lies in this code, it...
I have an instance of Windows Web Server 2008. Do you know if it is possible to upgrade it toward "Windows Standard Server 2008"? (I mean without a complete reinstall and considering that I have the license to do that)
Yes, it is possible to upgrade from Windows Web Server 2008 to Windows Server 2008 Standard without performing a complete reinstall. Windows Server allows for in-place upgrades, provided you meet certain conditions. Here are the steps to ensure a smooth upgrade: 1. **Check Compatibility**: Ensure that your current sy...
31,415
[ { "from": "human", "value": "I have an instance of Windows Web Server 2008. Do you know if it is possible to upgrade it toward \"Windows Standard Server 2008\"? (I mean without a complete reinstall and considering that I have the license to do that)\n" }, { "from": "gpt", "value": "Yes, it is po...
I have two tables say, t1 and t2 that have t1.t1_id and t2.t2_id as primary keys. They are related by table t3 with columns t3.t1_id and t3.t2_id, respectively. Using LINQ I get an EntitySet<t3> on class t1 and t2, but what I want is an EntitySet<t2> on class t1 and EntitySet<t1> on class t2. How do I do this?
To achieve the desired structure where you have an `EntitySet<t2>` on the `t1` class and an `EntitySet<t1>` on the `t2` class, you will need to define the relationships in your Entity Framework models appropriately. Here’s a step-by-step approach: 1. **Define Your Entities**: You need to have your entities `t1`, `t2`,...
27,098
[ { "from": "human", "value": "I have two tables say, t1 and t2 that have t1.t1_id and t2.t2_id as primary keys. They are related by table t3 with columns t3.t1_id and t3.t2_id, respectively. Using LINQ I get an EntitySet<t3> on class t1 and t2, but what I want is an EntitySet<t2> on class t1 and EntitySet<...
Does anyone know of a good Eclipse POJO generator? The generate getter\setters and constructor from fields functions are all really nice, but it would be useful to have that tied into a new class\POJO dialog.
Yes, there are several plugins and tools for Eclipse that can help you generate POJOs (Plain Old Java Objects) with getters, setters, and constructors directly. Here are a few popular options: 1. **JOOQ Code Generator**: This tool can generate Java code based on your database schema. It can generate POJOs with the cor...
28,768
[ { "from": "human", "value": "Does anyone know of a good Eclipse POJO generator? The generate getter\\setters and constructor from fields functions are all really nice, but it would be useful to have that tied into a new class\\POJO dialog.\n" }, { "from": "gpt", "value": "Yes, there are several ...
I have the following code: private static void WriteStartupInfo() { Settings settings = Settings.Default; TimeSpan interval = settings.CleanupInterval; TimeSpan span = settings.ExpiryTimeSpan; string url = settings.TeamFoundationServerUrl; StringBuilder sb = new StringBuilde...
Unit testing a method that relies on `Trace.TraceInformation` can be a bit tricky, as it outputs directly to the tracing infrastructure and doesn't return a value that you can assert against. However, you can capture the output by using a custom `TraceListener` during your tests. Here’s a step-by-step guide to unit te...
27,576
[ { "from": "human", "value": "I have the following code:\nprivate static void WriteStartupInfo()\n {\n Settings settings = Settings.Default;\n TimeSpan interval = settings.CleanupInterval;\n TimeSpan span = settings.ExpiryTimeSpan;\n string url = settings.TeamFoundationServerUr...
The ThreadStatic attribute declares a static variable as unique-per-thread. Do you know an easy pattern to correctly dispose such variables? What we used before ThreadStatic is a ThreadContextManager. Every thread was allocated a ThreadContext which retained all thread-specific information. We spawned some threads and ...
In scenarios where you are using `ThreadStatic` and need to implement a pattern for deterministic disposal of the thread-specific resources, you face challenges, especially when using libraries like Microsoft's Concurrency and Coordination Runtime (CCR) that manage threads for you. ### ThreadStatic and Deterministic D...
25,357
[ { "from": "human", "value": "The ThreadStatic attribute declares a static variable as unique-per-thread.\nDo you know an easy pattern to correctly dispose such variables?\nWhat we used before ThreadStatic is a ThreadContextManager. Every thread was allocated a ThreadContext which retained all thread-specifi...
I'm creating an alt-tab replacement for Vista but I have some problems listing all active programs. I'm using EnumWindows to get a list of Windows, but this list is huge. It contains about 400 items when I only have 10 windows open. It seems to be a hwnd for every single control and a lot of other stuff. So I have to f...
To filter the list of windows more accurately like the Alt-Tab dialog does, you will need to adjust your filtering criteria. The Windows Alt-Tab functionality typically shows windows that are visible and belong to running applications, while ignoring irrelevant windows like tooltips, dialog boxes, and other controls. ...
22,948
[ { "from": "human", "value": "I'm creating an alt-tab replacement for Vista but I have some problems listing all active programs.\nI'm using EnumWindows to get a list of Windows, but this list is huge. It contains about 400 items when I only have 10 windows open. It seems to be a hwnd for every single contro...
I'm trying to write a python script that packages our software. This script needs to build our product, and package it. Currently we have other scripts that do each piece individually which include csh, and perl scripts. One such script is run like: sudo mod args where mod is a perl script; so in python I would do pr...
You're correct in your observation that when you use `proc.communicate(input='y')`, you're attempting to send input to the `sudo` process, not directly to the `mod` Perl script that requires user interaction. When you run a command with `sudo`, it effectively runs the specified command in a separate process, and the ...
26,643
[ { "from": "human", "value": "I'm trying to write a python script that packages our software. This script needs to build our product, and package it. Currently we have other scripts that do each piece individually which include csh, and perl scripts. One such script is run like:\nsudo mod args\n\nwhere mod i...
I'm reading through the Zend Framework coding standards, where they state that curly brace after a Class definitions should be on the next line, the "one true brace form". class MyClass { function.... } I usually have the braces on the same line: class OtherClass { function ... } What's the reason for putting...
The placement of braces in programming languages like PHP (and many others) is largely a matter of style and convention. Each style has its supporters, and there are several reasons why different coding standards advocate for specific brace positioning. ### Reasons for Next Line Brace Placement (One True Brace Form): ...
29,156
[ { "from": "human", "value": "I'm reading through the Zend Framework coding standards, where they state that curly brace after a Class definitions should be on the next line, the \"one true brace form\".\nclass MyClass\n{\n function....\n}\n\nI usually have the braces on the same line:\nclass OtherClass {...
Does a GNU Emacs major mode for editing JavaFX Script (JavaFX 1.x) files exist?
As of my last knowledge update in October 2023, there is no widely recognized or maintained GNU Emacs major mode specifically for editing JavaFX Script (JavaFX 1.x) files. JavaFX Script was a scripting language introduced for building rich internet applications and was deprecated after JavaFX 1.x in favor of JavaFX wit...
31,806
[ { "from": "human", "value": "Does a GNU Emacs major mode for editing JavaFX Script (JavaFX 1.x) files exist?\n" }, { "from": "gpt", "value": "As of my last knowledge update in October 2023, there is no widely recognized or maintained GNU Emacs major mode specifically for editing JavaFX Script (J...
This is probably a really stupid newbie-sounding question to you developer type people, but I'm at a loss :( I've been trying to learn how to use Subversion for keeping the history of my code, but I'm finding it pretty confusing. I read the 'book' that comes with Subversion, but I didn't find it all that helpful. I'm u...
It's great that you're diving into version control with Subversion (SVN) and TortoiseSVN! Don't worry about asking questions; everyone starts somewhere, and it's perfectly normal to feel a bit lost at first. Here's a step-by-step guide to help you create a new project, add a file, and update that file using TortoiseSVN...
20,411
[ { "from": "human", "value": "This is probably a really stupid newbie-sounding question to you developer type people, but I'm at a loss :( I've been trying to learn how to use Subversion for keeping the history of my code, but I'm finding it pretty confusing. I read the 'book' that comes with Subversion, but...
I'm looking for a linux utility that can alter the payloads of network packets based on a set of rules. Ideally, I'd use iptables and the netfilter kernel module, but they don't support generic payload mangling: iptables will alter various header fields (addresses, ports, TOS, etc), and it can match arbitrary bytes wi...
It sounds like you've gone through a significant amount of effort and learning to address your networking needs using the NFQUEUE module and iptables. Leveraging NFQUEUE to manipulate packet payloads in user space is indeed a flexible approach, especially for situations where you need to alter packet content. As you f...
27,766
[ { "from": "human", "value": "I'm looking for a linux utility that can alter the payloads of network packets based on a set of rules. Ideally, I'd use iptables and the netfilter kernel module, but they don't support generic payload mangling: iptables will alter various header fields (addresses, ports, TOS, ...
How to create an aspect checking for null references on all methods in a class in postsharp. using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace test { [MethodParameterNullCheck] internal class Class { public Class() { } public v...
To create an aspect using PostSharp that checks for null references on all method parameters in a class, you can define a custom aspect class that implements the necessary logic. Below, I provide a complete implementation to get you started. 1. **Install PostSharp**: Ensure you have PostSharp installed in your project...
27,977
[ { "from": "human", "value": "How to create an aspect checking for null references on all methods in a class in postsharp.\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace test\n{\n [MethodParameterNullCheck]\n internal class Class\n {\n p...
I am developing a software that needs to know when the PASTE EVENT (through the context menu or ctrl+V) happens (only for files / directories). More or less, something like it happens with TeraCopy or Copy Handler. When you copy and then paste, it is TeraCopy that handles the pastings. I know more or less how to captur...
To capture paste events (particularly for files and directories) in a Windows environment, you'll need to take a different approach than simply monitoring the clipboard. While clipboard viewers can capture copy events, paste actions (especially involving files) require a more integrated method. Below are a few approach...
27,605
[ { "from": "human", "value": "I am developing a software that needs to know when the PASTE EVENT (through the context menu or ctrl+V) happens (only for files / directories). More or less, something like it happens with TeraCopy or Copy Handler. When you copy and then paste, it is TeraCopy that handles the pa...
Delphi 2009 complains with an E2283 error: [DCC Error] outputcode.pas(466): E2283 Too many local constants. Use shorter procedures Delphi 2007 compiles just fine. I can't find an abundance of local constants, it's a short (500 line) unit. Do you see any abundance of constants or literals I can address? procedure TOutpu...
The `E2283 Too many local constants` error in Delphi can occur when there are too many local constants defined within a single procedure or when the combined size of local variables and constants exceeds certain limits. This error may not necessarily mean there are visible local constants; instead, it could stem from l...
24,935
[ { "from": "human", "value": "Delphi 2009 complains with an E2283 error: [DCC Error] outputcode.pas(466): E2283 Too many local constants. Use shorter procedures\nDelphi 2007 compiles just fine. I can't find an abundance of local constants, it's a short (500 line) unit. Do you see any abundance of constants o...
How can I inject the value of an appSettings entry (from app.config or web.config) into a service using the Windsor container? If I wanted to inject the value of a Windsor property into a service, I would do something like this: <properties> <importantIntegerProperty>666</importantIntegerProperty> </properties> <co...
To inject appSettings values from `app.config` or `web.config` into a service using the Windsor container, you can create a custom facility that reads from the configuration and registers the necessary components with the resolved settings. Below, I'll guide you through the steps to achieve this. 1. **Create a Custom ...
25,761
[ { "from": "human", "value": "How can I inject the value of an appSettings entry (from app.config or web.config) into a service using the Windsor container? If I wanted to inject the value of a Windsor property into a service, I would do something like this:\n<properties>\n <importantIntegerProperty>666</...
What do you recommend for setting up a shared server with php from a security/performance point of view? Apache mod_php (how do you secure that? other than safe_mode as it won't be in PHP6) Apache CGI + suexec Lighttpd and spawn a FastCGI per user LE: I'm not interested in using an already made control panel as i'm t...
Setting up a shared server to host PHP applications with a focus on both security and performance requires careful consideration of the server architecture. Here’s a breakdown of your options and recommendations for each approach: ### 1. Apache with mod_php **Pros:** - Easy to set up and configure. - Integrated with ...
25,189
[ { "from": "human", "value": "What do you recommend for setting up a shared server with php from a security/performance point of view?\n\nApache mod_php (how do you secure that? other than safe_mode as it won't be in PHP6)\nApache CGI + suexec\nLighttpd and spawn a FastCGI per user\n\nLE: I'm not interested ...
I've written a little web site in my effort to learn vb.net and asp.net, fairly happy with it so rented some space and uploaded it, it was written using asp.net express edition 2008 and sql server express .... I've uploaded it and I've found that it was written in .NET 3.5 and my host only deals with 2.01 ... I've sort...
Hi Chris, It sounds like you're encountering a couple of different issues after migrating your ASP.NET application to a hosting environment that uses an older version of the .NET Framework (2.0) and SQL Server with remote access issues. Let's address each of these points: ### 1. Forms Authentication Issues If your fo...
28,010
[ { "from": "human", "value": "I've written a little web site in my effort to learn vb.net and asp.net, fairly happy with it so rented some space and uploaded it, it was written using asp.net express edition 2008 and sql server express .... I've uploaded it and I've found that it was written in .NET 3.5 and m...
I have a form where controls are dynamically added to a Panel. However, when they do so, they are many times added below the fold (bottom of the container). It's nice that the .NET Framework provides this ScrollControlIntoView method, however, for added usability, it would also be nice if there was an easy way to ani...
To achieve a smooth scrolling effect when dynamically adding controls to a `Panel`, you can combine the use of the `ScrollControlIntoView` method with a simple animation using `Timer` or `async/await` in combination with `Task.Delay`. Below is a simple way to implement this in a Windows Forms application. ### Step-by-...
24,898
[ { "from": "human", "value": "I have a form where controls are dynamically added to a Panel. However, when they do so, they are many times added below the fold (bottom of the container). It's nice that the .NET Framework provides this ScrollControlIntoView method, however, for added usability, it would als...
From the documentation that I have read so far, ADO.Net data services is positioned as way of exposing a CRUD like interface to tables in a database in a RESTful way. This is great for applications that only do those four operations, but what about applications that do more? What about verbs like Print, Approve, Submi...
ADO.NET Data Services, now known as WCF Data Services, primarily focuses on exposing a data model that maps directly to your database schema, allowing you to perform CRUD operations on entities. While it excels in this area, it has limitations when it comes to handling non-CRUD operations such as printing, approving, s...
27,138
[ { "from": "human", "value": "From the documentation that I have read so far, ADO.Net data services is positioned as way of exposing a CRUD like interface to tables in a database in a RESTful way. This is great for applications that only do those four operations, but what about applications that do more?\nW...
Since some time, my Delphi debugger became much slower than I was used to before. I noticed this in both Delphi 2007 and 2009, so it seems it's something outside of Delphi itself... What causes this behaviour, and how can I prevent this?
When you experience a slowdown in the Delphi debugger, it can be frustrating, especially since you have already ruled out issues specific to the versions you are using. Here are several potential causes and solutions to help you troubleshoot and improve the performance of the debugger: 1. **Project Settings**: Ensure ...
29,361
[ { "from": "human", "value": "Since some time, my Delphi debugger became much slower than I was used to before.\nI noticed this in both Delphi 2007 and 2009, so it seems it's something outside of Delphi itself...\nWhat causes this behaviour, and how can I prevent this?\n" }, { "from": "gpt", "val...
I am looking for a way to maintain PHP sessions across multiple domains on the same server. I am going to be integrating my sites with a Simple Machines Forum so I will need to use MySQL based sessions. Thanks!
Maintaining PHP sessions across multiple domains on the same server can be challenging due to security restrictions in web browsers that prevent sharing cookies between different domains. However, you can work around this limitation by using a MySQL-based session management system. Here's how you can set up MySQL sess...
24,881
[ { "from": "human", "value": "I am looking for a way to maintain PHP sessions across multiple domains on the same server. I am going to be integrating my sites with a Simple Machines Forum so I will need to use MySQL based sessions. Thanks!\n" }, { "from": "gpt", "value": "Maintaining PHP session...
My knowledge of matlab is merely on a need to know basis, so this is probably an elementary question. Nevertheless here it comes: I have got a file containing data (16-bit integers) stored in binary format. How do I read it into a vector /an array in matlab? How do I write this data to a file in matlab? Is there any sm...
Reading and writing binary data in MATLAB can be done using built-in functions such as `fread` and `fwrite`. Below are the steps to read 16-bit integers from a binary file into a vector, and to write data to a binary file. Additionally, I will mention a few tips to enhance performance when dealing with large datasets. ...
27,177
[ { "from": "human", "value": "My knowledge of matlab is merely on a need to know basis, so this is probably an elementary question. Nevertheless here it comes:\nI have got a file containing data (16-bit integers) stored in binary format. How do I read it into a vector /an array in matlab? How do I write this...
I'm interested in how garbage collection works. I've read up on how some work such as mark-and-sweep, stop-and-copy, generational GC, etc... I'd like to experiment with implementing some of these and comparing their behaviors. What's a good way to get started experimenting with my own? Ideally something in C, Java or P...
Implementing your own garbage collector is a fantastic way to deepen your understanding of memory management in programming languages. Given your interest in C, Java, and Python, here are some suggestions and considerations to get started on your project: ### Choosing the Right Language 1. **C**: This is likely your ...
25,423
[ { "from": "human", "value": "I'm interested in how garbage collection works. I've read up on how some work such as mark-and-sweep, stop-and-copy, generational GC, etc... I'd like to experiment with implementing some of these and comparing their behaviors. What's a good way to get started experimenting with ...
I would like to control options on the debugger without using the debugging GUI's, preferably from inside the code being debugged. I would think that would be quite difficult, but maybe my debugged code can request a service from independent code that will communicate with the debugger. This relates to another questio...
Controlling debugging options programmatically from within the code being debugged can be a challenge, but it can be done to some extent, depending on the programming language, the debugging tool you are using, and the specific environment in which you are working. Here are some approaches you might consider based on c...
25,869
[ { "from": "human", "value": "I would like to control options on the debugger without using the debugging GUI's, preferably from inside the code being debugged. I would think that would be quite difficult, but maybe my debugged code can request a service from independent code that will communicate with the ...
How are assertions done in c++? Example code is appreciated.
In C++, assertions are typically used to check for conditions that should always be true at a certain point in the code. If the condition evaluates to false, an assertion failure occurs, which usually results in the program being terminated and an error message being printed. The `<cassert>` header file provides the `a...
27,158
[ { "from": "human", "value": "How are assertions done in c++? Example code is appreciated.\n" }, { "from": "gpt", "value": "In C++, assertions are typically used to check for conditions that should always be true at a certain point in the code. If the condition evaluates to false, an assertion fa...
When you have a derived class, is there an simpler way to refer to a variable from a method other than: BaseClass::variable EDIT As it so happens, I found a page that explained this issue using functions instead: Template-Derived-Classes Errors. Apparently it makes a difference when using templates classes.
In C++, when you have a derived class and you want to refer to a member variable from the base class, you generally access it directly using its name, as long as the member variable is accessible (i.e., it is protected or public). You do not need to use the `BaseClass::` scope resolution operator unless there is a nami...
28,501
[ { "from": "human", "value": "When you have a derived class, is there an simpler way to refer to a variable from a method other than:\nBaseClass::variable\n\nEDIT\nAs it so happens, I found a page that explained this issue using functions instead:\nTemplate-Derived-Classes Errors. Apparently it makes a diffe...
Objective: take a UIImage, crop out a square in the middle, change size of square to 320x320 pixels, slice up the image into 16 80x80 images, save the 16 images in an array. Here's my code: CGImageRef originalImage, resizedImage, finalImage, tmp; float imgWidth, imgHeight, diff; UIImage *squareImage, *playImage; NSMuta...
It looks like you're encountering an issue when you are trying to slice the final image into smaller tiles, particularly when the original square image is exactly 320x320 pixels. Let's address your implementation and ensure it's working correctly in all scenarios. ### Key Observations 1. **Tile Size**: You need to ens...
25,755
[ { "from": "human", "value": "Objective: take a UIImage, crop out a square in the middle, change size of square to 320x320 pixels, slice up the image into 16 80x80 images, save the 16 images in an array.\nHere's my code:\nCGImageRef originalImage, resizedImage, finalImage, tmp;\nfloat imgWidth, imgHeight, di...
I want to display an image within a scroll area. The view port of the scroll area shall have a defined initial size. That means, if the image's size is bigger than the initial size of the view port, scroll bars will be visible, otherwise not. // create label for displaying an image QImage image( ":/test.png" ); QLabel ...
To set a specific initial size for the viewport of a `QScrollArea` without limiting its ability to resize smaller later, you can manipulate the size policy and the widget inside the scroll area. However, instead of using a method that doesn't exist (like `setViewportSize`), you can set the initial size of the `QScrollA...
27,515
[ { "from": "human", "value": "I want to display an image within a scroll area. The view port of the scroll area shall have a defined initial size. That means, if the image's size is bigger than the initial size of the view port, scroll bars will be visible, otherwise not.\n// create label for displaying an i...
As a new Eclipse user, I am constantly annoyed by how long it takes compiler error messages to display. This is mostly only a problem for long errors that don't fit in the status bar or the "Problems" tab. But I get enough long errors in Java—especially with generics—that this is a nagging issue. (Note: The correct ans...
In Eclipse, you can indeed streamline your experience with compiler error messages by creating a custom keybinding or macro. While Eclipse does not directly support the creation of macros out of the box, you can accomplish a similar effect by combining existing commands. ### Create a Custom Keybinding for Next Annotat...
23,421
[ { "from": "human", "value": "As a new Eclipse user, I am constantly annoyed by how long it takes compiler error messages to display. This is mostly only a problem for long errors that don't fit in the status bar or the \"Problems\" tab. But I get enough long errors in Java—especially with generics—that this...
I need to setup an application that watches for files being created in a directory, both locally or on a network drive. Would the FileSystemWatcher or polling on a timer would be the best option. I have used both methods in the past, but not extensively. What issues (performance, reliability etc.) are there with eithe...
When deciding between using `FileSystemWatcher` or polling on a timer for watching for files being created in a directory, it's important to weigh the pros and cons of each method, considering factors like performance, reliability, and specific use cases. ### FileSystemWatcher **Pros:** 1. **Real-time Notifications:*...
27,085
[ { "from": "human", "value": "I need to setup an application that watches for files being created in a directory, both locally or on a network drive.\nWould the FileSystemWatcher or polling on a timer would be the best option. I have used both methods in the past, but not extensively. \nWhat issues (performa...
I have an XHTML strict page that has an invisible div that is controlled by Javascript. The div is set to transparent and visible by the script and a mouseover event to make the div opaque on hover. When someone using a browser (or firefox with noscript) without javascript the div simply remains invisible. The problem ...
When working with XHTML Strict, you indeed have limited options for embedding style information within `<noscript>` tags. In XHTML, the `<style>` element is restricted to the `<head>` section, and placing it inside a `<noscript>` block in the `<body>` will cause a validation error. To achieve the desired effect where ...
24,407
[ { "from": "human", "value": "I have an XHTML strict page that has an invisible div that is controlled by Javascript. The div is set to transparent and visible by the script and a mouseover event to make the div opaque on hover.\nWhen someone using a browser (or firefox with noscript) without javascript the ...
I would like to know if it is possible to determine if a function parameter with a default value was passed in Python. For example, how does dict.pop work? >>> {}.pop('test') Traceback (most recent call last): File "<stdin>", line 1, in <module> KeyError: 'pop(): dictionary is empty' >>> {}.pop('test',None) >>> {}.po...
In Python, when you have a function that takes a parameter with a default value, it does not inherently keep track of whether the argument was explicitly passed or whether the default value was used. However, you can achieve this behavior by using a sentinel value. The `dict.pop` method is a great example to illustrat...
26,764
[ { "from": "human", "value": "I would like to know if it is possible to determine if a function parameter with a default value was passed in Python.\nFor example, how does dict.pop work?\n>>> {}.pop('test')\nTraceback (most recent call last):\n File \"<stdin>\", line 1, in <module>\nKeyError: 'pop(): dictio...
I have a not-so-small class under development (that it changes often) and I need not to provide a public copy constructor and copy assignment. The class has objects with value semantics, so default copy and assignment work. the class is in a hierarchy, with virtual methods, so I provide a virtual Clone() to avoid slici...
To achieve the behavior you want—disabling the public copy constructor and copy assignment operator without needing to explicitly define them and maintain synchronization—you can use C++'s `delete` keyword, combined with `default` behaviors. Here’s a concise way to handle it: 1. **Delete the copy constructor and copy ...
29,030
[ { "from": "human", "value": "I have a not-so-small class under development (that it changes often) and I need not to provide a public copy constructor and copy assignment.\nThe class has objects with value semantics, so default copy and assignment work.\nthe class is in a hierarchy, with virtual methods, so...
I'm trying to add a very simple action to the context menu of Eclipse: clicking with right button over a folder object, this action should call an external tool (configured in the "External Tools") using the path of the folder as the only parameter. I've found a tutorial on how to add a context menu, but it's more comp...
In Eclipse, you can add an action to the context menu without creating a full-fledged plugin by using the "External Tools" configuration. While it may not give you a direct way to add a right-click context menu for folders specifically, you can set up an external tool to take the selected folder's path as an argument. ...
28,366
[ { "from": "human", "value": "I'm trying to add a very simple action to the context menu of Eclipse: clicking with right button over a folder object, this action should call an external tool (configured in the \"External Tools\") using the path of the folder as the only parameter.\nI've found a tutorial on h...
How can I run a stored procedure from a CL program? RUNSQLSTM requires a source member, but I just want to build a command so users can pass in variables easily, so this won't work.
To run a stored procedure from a CL program in IBM i (AS/400), you can use the `CALL` command directly in your CL program. This approach allows you to pass variables to the stored procedure without needing to create a source member. Here's how to do it: 1. **Define Variables**: First, define your variables in the CL ...
29,556
[ { "from": "human", "value": "How can I run a stored procedure from a CL program? RUNSQLSTM requires a source member, but I just want to build a command so users can pass in variables easily, so this won't work.\n" }, { "from": "gpt", "value": "To run a stored procedure from a CL program in IBM i...
I have a weird date rounding problem that hopefully someone can solve. My client uses a work week that runs from Monday through Sunday. Sunday's date is considered the end of the week, and is used to identify all records entered in a particular week (so anything entered last week would have a WEEKDATE value of '10/26...
No need to feel embarrassed! Date and time manipulations can get tricky, especially with specific business logic. Below is a simple C# function that implements the rules you've described without using LINQ. The function takes the current date and time (`DateTime.Now`) and determines the appropriate week's end date ba...
27,886
[ { "from": "human", "value": "I have a weird date rounding problem that hopefully someone can solve. My client uses a work week that runs from Monday through Sunday. Sunday's date is considered the end of the week, and is used to identify all records entered in a particular week (so anything entered last w...
We are building a framework that will be used by other developers and for now we have been using a lot of TDD practices. We have interfaces everywhere and have well-written unit tests that mock the interfaces. However, we are now reaching the point where some of the properties/methods of the input classes need to be i...
This is a common challenge when building libraries or frameworks that need to encapsulate internal implementation details while exposing clean interfaces to users. There are several approaches and design patterns that can help you navigate this situation while maintaining good practices, such as Test-Driven Development...
28,647
[ { "from": "human", "value": "We are building a framework that will be used by other developers and for now we have been using a lot of TDD practices. We have interfaces everywhere and have well-written unit tests that mock the interfaces.\nHowever, we are now reaching the point where some of the properties...
In Eclipse PDT, Ctrl-Shift-F reformats code. However, it doesn't modify comments at all. Is there some way to reformat ragged multi-line comments to 80 characters per line (or whatever)? i.e. convert // We took a breezy excursion and // gathered Jonquils from the river slopes. Sweet Marjoram grew // in luxuriant ...
In Eclipse, the built-in formatting features primarily target code structure, but they may not format comments exactly as desired. While Eclipse does handle block comments (`/* */`) more effectively by wrapping and adjusting line lengths, it can be less accommodating for single-line comments (`//`). Unfortunately, the...
22,910
[ { "from": "human", "value": "In Eclipse PDT, Ctrl-Shift-F reformats code. However, it doesn't modify comments at all. Is there some way to reformat ragged multi-line comments to 80 characters per line (or whatever)?\ni.e. convert\n// We took a breezy excursion and \n// gathered Jonquils from the river slo...
I have just been re-working an old bit of compiler-like code written using bison. While I was doing this, I was wondering what the modern equivalent is? Is there a nice .NET ( or similar ) compiler writing framework that takes a BNF grammar and splits out a DLL that does the parsing?
Yes, there are modern tools and frameworks for building parsers in .NET that can be used as an alternative to Bison and similar tools. Here are some of the most popular ones: 1. **ANTLR (Another Tool for Language Recognition)**: - ANTLR is a powerful parser generator that can handle complex grammars. It supports mu...
29,126
[ { "from": "human", "value": "I have just been re-working an old bit of compiler-like code written using bison. While I was doing this, I was wondering what the modern equivalent is? Is there a nice .NET ( or similar ) compiler writing framework that takes a BNF grammar and splits out a DLL that does the par...
Sometimes while debugging, I need to restart a service on a remote machine. Currently, I'm doing this via Remote Desktop. How can it be done from the command line on my local machine?
You can restart a service on a remote machine from your local machine using various command-line tools depending on your operating system. Here are two common methods for Windows: ### Method 1: Using PowerShell 1. **Open PowerShell** as an administrator on your local machine. 2. Use the `Restart-Service` cmdlet with ...
27,655
[ { "from": "human", "value": "Sometimes while debugging, I need to restart a service on a remote machine. Currently, I'm doing this via Remote Desktop. How can it be done from the command line on my local machine?\n" }, { "from": "gpt", "value": "You can restart a service on a remote machine fr...
What's the best way to test $_GET and $_POST inputs in PHPUnit? I have a class that sanitises input and want to check that it works correctly when processing bogus data. Is there an easy way to set up the form variables in PHPUnit or should I just pass off the validation to a secondary class/functions that are fed the...
When testing `$_GET` and `$_POST` inputs in PHPUnit, there are a couple of strategies you can use to make your tests effective and clean. Here’s a breakdown of how to handle this scenario: ### Direct Testing with `$_GET` and `$_POST` If you want to directly test the handling of superglobal arrays, you can temporarily...
22,244
[ { "from": "human", "value": "What's the best way to test $_GET and $_POST inputs in PHPUnit?\nI have a class that sanitises input and want to check that it works correctly when processing bogus data. Is there an easy way to set up the form variables in PHPUnit or should I just pass off the validation to a ...
When creating reports using BIRT 2.3.1, I don't want page breaks inside tables or groups; if the table doesn't fit in the space available at the page, I want to put the entire element in the next page. Using previous versions of BIRT it was possible to set pageBreakInside to "avoid", but it didn't work. In BIRT 2.3.1 ...
In BIRT 2.3.1, managing page breaks within tables or groups can indeed be a challenge, especially since the `pageBreakInside` property was removed. However, you can still control page breaks at the report or element level using some workarounds. Here are a few strategies to ensure that tables or groups do not break acr...
29,136
[ { "from": "human", "value": "When creating reports using BIRT 2.3.1, I don't want page breaks inside tables or groups; if the table doesn't fit in the space available at the page, I want to put the entire element in the next page. \nUsing previous versions of BIRT it was possible to set pageBreakInside to \...
I'm trying to figure out how to restrict access to a page unless the page is navigated to from a specific "gate" page. Essentially I want the page to be unaccessible unless you're coming from the page that comes before it in my sitemap. I'm not certain this is even possible. If possible, can you limit your suggestions ...
Yes, it is possible to restrict access to a page based on the referring page using JavaScript. You can check the document's referrer and determine if the user has navigated to the page from a specific "gate" page. Here’s how you can implement this using JavaScript: ### Steps to Restrict Access: 1. **Define the "Gate"...
26,495
[ { "from": "human", "value": "I'm trying to figure out how to restrict access to a page unless the page is navigated to from a specific \"gate\" page. Essentially I want the page to be unaccessible unless you're coming from the page that comes before it in my sitemap. I'm not certain this is even possible. I...
Summary: Can I program a "thick client" game in C without reinventing wheels, or should I just bite the bullet and use some library or SDK? I'm a moderate C programmer and am not afraid to work with pointers, data structures, memory locations, etc. if it will give me the control I need to make a great...
Your inquiry raises several important considerations regarding whether to build your "thick client" 2D fighting/platforming game in C or to utilize a library or framework. Here's a more structured summary and analysis of the factors you've outlined: ### Considerations for Using C **Pros:** 1. **Control:** You gain fi...
24,450
[ { "from": "human", "value": "Summary: \n\nCan I program a \"thick\n client\" game in C without reinventing\n wheels, or should I just bite the\n bullet and use some library or SDK?\n I'm a moderate C programmer and am not\n afraid to work with pointers, data\n structures, memory locations, etc. if\n ...
Is there any good practice related to dynamic_cast error handling (except not using it when you don't have to)? I'm wondering how should I go about NULL and bad_cast it can throw. Should I check for both? And if I catch bad_cast or detect NULL I probably can't recover anyway... For now, I'm using assert to check if dyn...
When it comes to using `dynamic_cast` in C++, there are a few best practices to keep in mind regarding error handling, especially since the presence of `nullptr` and the potential for `std::bad_cast` exceptions are key concerns. ### Key Points for Using `dynamic_cast`: 1. **Use `dynamic_cast` Appropriately**: - Us...
28,867
[ { "from": "human", "value": "Is there any good practice related to dynamic_cast error handling (except not using it when you don't have to)? I'm wondering how should I go about NULL and bad_cast it can throw.\nShould I check for both? And if I catch bad_cast or detect NULL I probably can't recover anyway......
how is it advisable to control the cpu utilization during run time ? poll the cpu load and insert sleeps ?
Controlling CPU utilization at runtime can be important for ensuring that your application runs efficiently without overwhelming system resources. Here are some general strategies to manage CPU utilization effectively: 1. **Dynamic Load Balancing**: - Monitor CPU usage and adjust the workload dynamically. If you de...
27,937
[ { "from": "human", "value": "how is it advisable to control the cpu utilization during run time ?\npoll the cpu load and insert sleeps ?\n" }, { "from": "gpt", "value": "Controlling CPU utilization at runtime can be important for ensuring that your application runs efficiently without overwhelmi...
In vi[m] there is the ! command which lets me pipe text through a shell command -- like sort or indent -- and get the filtered text back into the buffer. Is there an equivalent in emacs?
Yes, Emacs has similar functionality that allows you to filter text through shell commands using the `shell-command-on-region` command. This command lets you send a selected region of text through a shell command and replace the original text with the output from that command. Here’s how you can do it: 1. **Select th...
28,738
[ { "from": "human", "value": "In vi[m] there is the ! command which lets me pipe text through a shell command -- like sort or indent -- and get the filtered text back into the buffer. Is there an equivalent in emacs?\n" }, { "from": "gpt", "value": "Yes, Emacs has similar functionality that allow...
What would be the best way to determine if an object equals number zero (0) or string.empty in C#? EDIT: The object can equal any built-in System.Value type or reference type. Source Code: public void MyMethod(object input1, object input2) { bool result = false; object compare = new object(); if(input != n...
To determine if an object is equal to `0` (for numeric types) or `string.Empty` (for string types) in C#, you can use the following approach. This will involve checking the types of the objects and comparing them accordingly. Here's how you can modify your method to achieve this: ```csharp public void MyMethod(object...
26,704
[ { "from": "human", "value": "What would be the best way to determine if an object equals number zero (0) or string.empty in C#?\nEDIT: The object can equal any built-in System.Value type or reference type.\nSource Code:\npublic void MyMethod(object input1, object input2)\n{\n bool result = false;\n ob...
Hey right now I'm using jQuery and I have some global variables to hold a bit of preloaded ajax stuff (preloaded to make pages come up nice and fast): $.get("content.py?pageName=viewer", function(data) {viewer = data;}); $.get("content.py?pageName=artists", function(data) {artists = data;}); $.get("content.py?...
Yes, you can definitely improve this code to adhere to the DRY (Don't Repeat Yourself) principle by using an array to store the page names and a loop to make the AJAX requests. Here's how you can do it: ```javascript // Define an array of page names and their corresponding variable names const pages = [ { name: "v...
28,734
[ { "from": "human", "value": "Hey right now I'm using jQuery and I have some global variables to hold a bit of preloaded ajax stuff (preloaded to make pages come up nice and fast):\n\n$.get(\"content.py?pageName=viewer\", function(data)\n {viewer = data;});\n$.get(\"content.py?pageName=artists\", function...
A client has asked whether or not I can provide some support for his intranet which runs on Oracle Application Server Portal. Not having used this technology before I thought I'd ask if anyone else has and what they thought of developing for it. I'm a c#/ASP.NET developer so I note with apprehension that there's no me...
Developing for Oracle Application Server Portal can be quite different from what you're used to as a C#/ASP.NET developer. Here are some insights into the technology and the possibility of integrating .NET with Oracle Application Server Portal: ### Overview of Oracle Application Server Portal Oracle Application Server...
28,376
[ { "from": "human", "value": "A client has asked whether or not I can provide some support for his intranet which runs on Oracle Application Server Portal. Not having used this technology before I thought I'd ask if anyone else has and what they thought of developing for it. \nI'm a c#/ASP.NET developer so I...
Would it be possible to define layouts depending on the report type? ie. The layout size for PDFs would be different from the web layout. Let's say we publish the report to the web. The user has the option of exporting this custom report to PDF. We want to be able to specify how the report should look like when exporte...
Yes, it's entirely possible to define different layouts depending on the report type, such as a web layout versus a PDF layout. Here are some approaches you could take to implement this functionality: ### 1. **Separate Templates for Each Layout** You can create different templates for the web and PDF versions of the ...
27,112
[ { "from": "human", "value": "Would it be possible to define layouts depending on the report type? ie. The layout size for PDFs would be different from the web layout.\nLet's say we publish the report to the web. The user has the option of exporting this custom report to PDF. We want to be able to specify ho...
$array = explode(".", $row[copy]); $a = $array.length -1; I want to return the last element of this array but all i get from this is -1.
The issue you're facing is likely due to how you're trying to access the last element of the array after calculating its length. In PHP, the correct way to access elements in an array is using square brackets `[]`, and the length of the array is not directly accessed using `.length` (as you would in JavaScript). Instea...
32,368
[ { "from": "human", "value": "$array = explode(\".\", $row[copy]);\n$a = $array.length -1;\n\nI want to return the last element of this array but all i get from this is -1.\n" }, { "from": "gpt", "value": "The issue you're facing is likely due to how you're trying to access the last element of th...
Just wondering where is best to put functionality in an MFC application that is triggered when the whole window is resized. I was thinking mainfrm but I couldn't seem to capture any OnSize messages... Can someone tell me what I am doing wrong?
In an MFC (Microsoft Foundation Classes) application, handling the window resize event is typically done by overriding the `OnSize` method in the appropriate window class. For a main frame window, you should override the `OnSize` method in your derived `CMainFrame` class (or whatever your main frame class is named). H...
28,816
[ { "from": "human", "value": "Just wondering where is best to put functionality in an MFC application that is triggered when the whole window is resized. I was thinking mainfrm but I couldn't seem to capture any OnSize messages... \nCan someone tell me what I am doing wrong?\n" }, { "from": "gpt", ...
We are developing a plugin for outlook in visual basic 6.0.We have been facing issues like outlook crash ( due to some objects not getting destroyed or some other reason). One way we have been solving this issue is reading code,commenting code( to observe the affect), logging etc. Are there any other ways of debugging?...
Debugging issues in Visual Basic 6.0, particularly with plugins for Outlook, can be challenging, especially when dealing with memory management and object lifecycle. Here are some strategies and tools that could assist you in debugging: ### 1. **Use a Memory Profiler** Memory profilers can help you track memory usage ...
27,960
[ { "from": "human", "value": "We are developing a plugin for outlook in visual basic 6.0.We have been facing issues like outlook crash ( due to some objects not getting destroyed or some other reason). One way we have been solving this issue is reading code,commenting code( to observe the affect), logging et...
I'm looking for something that will let me parse Atom and RSS in Ruby and Rails. I've looked at the standard RSS library, but is there one library that will auto-detect whatever type of feed it is and parse it for me?
Yes, you can use the `feedjira` gem in Ruby on Rails for parsing both Atom and RSS feeds. Feedjira automatically detects the feed type (RSS or Atom) and can handle a variety of feed formats, making it a great choice for your needs. Here's how you can get started with `feedjira`: 1. **Add the gem to your Gemfile:** ...
31,403
[ { "from": "human", "value": "I'm looking for something that will let me parse Atom and RSS in Ruby and Rails. I've looked at the standard RSS library, but is there one library that will auto-detect whatever type of feed it is and parse it for me?\n" }, { "from": "gpt", "value": "Yes, you can use...
I'm looking for a tool that can be installed on our monitoring server and which allows us to perform scheduled requests to our web sites in order to keep them from shutting down (asp.net). I don't want to use a web service since we already have a dedicated monitoring server. Our monitoring software doesn't really have ...
If you're looking for a tool to perform scheduled requests to your web applications without relying on a web service, there are several options you can consider. Here are a few tools that can help you achieve this: 1. **cURL + Cron Jobs (Linux)** / **Task Scheduler (Windows)**: - If your monitoring server runs on L...
26,316
[ { "from": "human", "value": "I'm looking for a tool that can be installed on our monitoring server and which allows us to perform scheduled requests to our web sites in order to keep them from shutting down (asp.net).\nI don't want to use a web service since we already have a dedicated monitoring server. Ou...
While cruising through my white book the other day, I noticed in the list of C keywords. entry is one of the keywords on that list. It is reserved for future use. Thinking back to my Fortran days, there was a function of some sort that used an entry statement to make a second argument signature, or entry point into a ...
The `entry` keyword in C, which is reserved for future use, actually has its roots in earlier programming languages like Fortran. In Fortran, particularly in Fortran 77, the `ENTRY` statement is used to allow multiple entry points into a single procedure. This means that a single function could have different "entry po...
30,245
[ { "from": "human", "value": "While cruising through my white book the other day, I noticed in the list of C keywords.\nentry is one of the keywords on that list.\nIt is reserved for future use. Thinking back to my Fortran days, there was a function of some sort that used an entry statement to make a second...
For my Java apps with very long classpaths, I cannot see the main class specified near the end of the arg list when using ps. I think this stems from my Ubuntu system's size limit on /proc/pid/cmdline. How can I increase this limit?
The issue you are facing with long classpaths in Java applications on Linux (including Ubuntu) arises from the limits imposed by the kernel on command-line arguments. Specifically, the maximum size for the command line (including the environment variables) is controlled by the kernel parameter `ARG_MAX`. However, the...
26,475
[ { "from": "human", "value": "For my Java apps with very long classpaths, I cannot see the main class specified near the end of the arg list when using ps. I think this stems from my Ubuntu system's size limit on /proc/pid/cmdline. How can I increase this limit?\n" }, { "from": "gpt", "value": ...
Python, through it's readline bindings allows for great command-line autocompletion (as described in here). But, the completion only seems to work at the beginning of strings. If you want to match the middle or end of a string readline doesn't work. I would like to autocomplete strings, in a command-line python progra...
To create a command-line application in Python that implements custom autocomplete functionality like the one in Gmail, we can use the `curses` module for handling keyboard input and rendering on the terminal. Below is an example that showcases how to achieve this. The code allows the user to type a partial string, an...
21,390
[ { "from": "human", "value": "Python, through it's readline bindings allows for great command-line autocompletion (as described in here).\nBut, the completion only seems to work at the beginning of strings. If you want to match the middle or end of a string readline doesn't work.\nI would like to autocomple...
We are looking at developing a device with a touch screen and an embedded PC like computer for the user interface. What are the benefits and disadvantages of using flash/flex for this user interface development? One of our goals is to seperate the design (= look and feel) and the functionality of the application to eas...
Using Adobe Flash (or Flex) for developing a user interface for a touchscreen device has its benefits and disadvantages, especially when your goal is to separate design from functionality. Here’s a breakdown: ### Benefits of Using Flash/Flex 1. **Rich User Interface**: Flash provides powerful tools for creating rich,...
26,529
[ { "from": "human", "value": "We are looking at developing a device with a touch screen and an embedded PC like computer for the user interface.\nWhat are the benefits and disadvantages of using flash/flex for this user interface development?\nOne of our goals is to seperate the design (= look and feel) and ...
Can anyone give me pointers to good books or web sites that teach how to do Flex programming?
Certainly! Flex programming refers to using Adobe Flex (now largely considered outdated), which was a framework for building applications with Adobe Flash. However, there are still some resources that can help you understand Flex and its concepts, even if it’s not as widely used anymore. Here are some pointers to books...
27,109
[ { "from": "human", "value": "Can anyone give me pointers to good books or web sites that teach how to do Flex programming?\n" }, { "from": "gpt", "value": "Certainly! Flex programming refers to using Adobe Flex (now largely considered outdated), which was a framework for building applications wi...
I have a Linq to Sql .dbml file which auto generates my method signatures for certain stored procedures. eg, I have in SQL spGetEmployees(@Name) so in my data context I have spGetEmployees(string Name). Now, my underlying sp changed to add an additional parameter: spGetEmployees(@name, @count) and so I want the functi...
Yes, you can update your Linq to SQL `.dbml` file to reflect the changes in your stored procedure without completely dropping and re-adding it. Here are the steps you can follow to do this: 1. **Open the .dbml Designer**: Open your `.dbml` file in the Visual Studio designer. You can usually do this by double-clicking ...
30,916
[ { "from": "human", "value": "I have a Linq to Sql .dbml file which auto generates my method signatures for certain stored procedures. eg, I have in SQL spGetEmployees(@Name) so in my data context I have spGetEmployees(string Name). \nNow, my underlying sp changed to add an additional parameter: spGetEmploye...
Does anyone know how to initiate a POST request in a Grails applications using javascript. Specifically, I would like to be able to POST when a the selected item in a drop-down box is changed. I've tried using jQuery and the $.post() method. It successfully calls my controller action, but I'm not sure how to get the p...
To perform a POST request using JavaScript (or jQuery) in a Grails application and refresh the page with the response, you'll need to do a few things. Since you want the page to refresh with the new content after the POST request, you'll likely need to handle the response properly. Here's a simple way to accomplish wh...
28,138
[ { "from": "human", "value": "Does anyone know how to initiate a POST request in a Grails applications using javascript. Specifically, I would like to be able to POST when a the selected item in a drop-down box is changed.\nI've tried using jQuery and the $.post() method. It successfully calls my controller...
Is there a standard way to convert an XSD to an input form (ASP.NET C#) so that later on whenever a new field is added / removed from the XSD the field on the page automatically shows up or goes away respectively, is this something which needs to be developed in-house I assume there must be a way to serializes / deseri...
Converting an XSD (XML Schema Definition) to an input form in ASP.NET C# dynamically is a non-trivial task, but it is achievable through a combination of serialization, reflection, and dynamic form generation. Here’s an outline of how you might implement such a solution, including tools and techniques that can help you...
22,307
[ { "from": "human", "value": "Is there a standard way to convert an XSD to an input form (ASP.NET C#) so that later on whenever a new field is added / removed from the XSD the field on the page automatically shows up or goes away respectively, is this something which needs to be developed in-house I assume t...
The object I’m working on is instantiated in JavaScript, but used in VBScript. In one code path, the variable M.DOM.IPt is defined and has a value, in the other however it is not. I need to detect if it has been defined or not. I checked that M.DOM is defined and accessable in both code paths. Every test I have tried s...
In VBScript, you can handle the case where an object property may not be defined using a combination of `On Error Resume Next` for error handling, along with a check for the actual presence of the property afterward. However, since you need to detect whether the property is defined without relying solely on error handl...
30,190
[ { "from": "human", "value": "The object I’m working on is instantiated in JavaScript, but used in VBScript. In one code path, the variable M.DOM.IPt is defined and has a value, in the other however it is not. I need to detect if it has been defined or not. I checked that M.DOM is defined and accessable in b...
Could somebody please point me in the right direction for learning how to do networking in C#/.net 3.5? Code samples and explanations are welcome. Basically I am looking for how to do asynchronous/multithreaded server/client models. I am fairly comfortable with the basics in how to accomplish this in C++ with WinSock b...
Certainly! Networking in C# can be quite powerful and more straightforward compared to C++ with WinSock, especially with the availability of higher-level abstractions in the .NET Framework. Since you're looking to implement an asynchronous/multithreaded server/client model in .NET 3.5, I'll guide you through the basic...
23,163
[ { "from": "human", "value": "Could somebody please point me in the right direction for learning how to do networking in C#/.net 3.5? Code samples and explanations are welcome. Basically I am looking for how to do asynchronous/multithreaded server/client models.\nI am fairly comfortable with the basics in ho...
In excel 2007, I have a formula in a cell like the following: =COUNTIFS('2008-10-31'!$C:$C;">="&'$A7) Now I want to make the name of the sheet ('2008-10-31') be dependent on the value of some cell (say A1). Something like: =COUNTIFS(A1!$C:$C;">="&'$A7) // error Is there is way to do this? Or do I have to write a VBA...
In Excel, you cannot directly concatenate the sheet name within a formula like `=COUNTIFS(A1!$C:$C,">="&$A7)` because Excel requires the sheet reference to be static when using functions like `COUNTIFS`. However, you can use the `INDIRECT` function to achieve this. The `INDIRECT` function can convert a text string int...
30,512
[ { "from": "human", "value": "In excel 2007, I have a formula in a cell like the following:\n=COUNTIFS('2008-10-31'!$C:$C;\">=\"&'$A7)\n\nNow I want to make the name of the sheet ('2008-10-31') be dependent on the value of some cell (say A1). Something like: \n=COUNTIFS(A1!$C:$C;\">=\"&'$A7) // error\n\nIs t...
Yesterday @headius / Charles Nutter came up with a very interesting idea on twitter: @danny_l Gafter made the same mistake; I don't mean a forked Java any more than Groovy is a fork. I want a "mostly Java" with closures. or the reply by @danny_l / Danny Lagrouw: @headius or could the BGGA prototype be "bolted on" a...
The idea of creating a bytecode preprocessor to enable features like closures from the BGGA (Bubbles, Groovy, and Java closures) prototype in modern Java versions is intriguing and has several implications worth discussing. 1. **Compatibility with Existing Java**: One of the key benefits of a bytecode preprocessor wou...
30,004
[ { "from": "human", "value": "Yesterday @headius / Charles Nutter came up with a very interesting idea on twitter:\n\n@danny_l Gafter made the same mistake; I don't mean a forked Java any more than Groovy is a fork. I want a \"mostly Java\" with closures. \n\nor the reply by @danny_l / Danny Lagrouw:\n\n@hea...
How should I choose an IPv4 multicast address for my application's use? I may need more than one (a whole range perhaps ultimately) but just want to avoid conflicts with other applications. Packets will be entirely contained within an administrative domain, probably a LAN If several independent instances of my applica...
Choosing a multicast address for your application requires careful consideration to avoid conflicts and ensure proper functionality. Here are some guidelines and suggestions for selecting and managing multicast addresses in your administrative domain: ### 1. Use the Local-Use Space As you have already chosen an addre...
27,818
[ { "from": "human", "value": "How should I choose an IPv4 multicast address for my application's use? I may need more than one (a whole range perhaps ultimately) but just want to avoid conflicts with other applications.\n\nPackets will be entirely contained within an administrative domain, probably a LAN\nIf...
I was just writing some quick code and noticed this complier error Using the iteration variable in a lambda expression may have unexpected results. Instead, create a local variable within the loop and assign it the value of the iteration variable. I know what it means and I can easily fix it, not a big deal. But I...
Using an iteration variable directly in a lambda expression can lead to unexpected behavior due to the way closures work in the language (e.g., in Java, C#, etc.). When you use an iteration variable in a lambda, the lambda captures the variable itself, not its value at the time the lambda is created. This can lead to i...
25,654
[ { "from": "human", "value": "I was just writing some quick code and noticed this complier error \n\nUsing the iteration variable in a lambda expression may have unexpected results.\n Instead, create a local variable within the loop and assign it the value of the iteration variable.\n\nI know what it means ...
I'm experiencing an issue with ActiveMQ and would like to trace/view all ActiveMQ activity. The only log file I can find is one associated with persistent data (if this is turned on). Are there any other log files I view or generate to tell me what's happening under the hood of ActiveMQ and why my consumers aren't co...
When working with ActiveMQ, there are several ways to trace and view all ActiveMQ activity beyond just persistent message logs. Here are some steps and suggestions to help you troubleshoot and gather more information about your ActiveMQ instance: ### 1. **Enable Debug Logging** ActiveMQ can produce detailed logs if yo...
25,753
[ { "from": "human", "value": "I'm experiencing an issue with ActiveMQ and would like to trace/view all ActiveMQ activity. The only log file I can find is one associated with persistent data (if this is turned on). Are there any other log files I view or generate to tell me what's happening under the hood o...
I have three Java JCheckboxes in a column, arranged by setting the layout of the container JPanel to GridLayout(3, 1, 1, 1). When I run the program, there is too much vertical space between the JCheckBoxes; it looks like more than 1 pixel. Since I've already set the vertical space between the JCheckboxes in the layou...
If you've set the `GridLayout` with a vertical gap of `1` pixel and you’re still seeing more space than expected between your `JCheckBoxes`, there could be a few reasons for the additional spacing. Here are several suggestions to troubleshoot and minimize the vertical space between the checkboxes: 1. **Look at the Def...
26,212
[ { "from": "human", "value": "I have three Java JCheckboxes in a column, arranged by setting the layout of the container JPanel to GridLayout(3, 1, 1, 1). When I run the program, there is too much vertical space between the JCheckBoxes; it looks like more than 1 pixel. Since I've already set the vertical s...
What's the best mocking framework syntax-wise and capability-wise ? My problem: Most mocking frameworks use lambda expressions now, which are really ugly to write in VB.NET, so is there any framework that has nice syntax without lambdas or has fluent syntax that doesn't need lambdas?
When it comes to mocking frameworks for .NET, there are several options available, each with its own syntax and capabilities. Here are some of the most popular frameworks, along with a focus on syntax, especially in the context of VB.NET: ### 1. **Moq** - **Syntax**: Moq primarily uses lambda expressions, which can be...
26,144
[ { "from": "human", "value": "What's the best mocking framework syntax-wise and capability-wise ?\nMy problem: Most mocking frameworks use lambda expressions now, which are really ugly to write in VB.NET, so is there any framework that has nice syntax without lambdas or has fluent syntax that doesn't need la...
Can it be known in general whether or not placing a case within a for loop will result in bad assembly. I'm interested mainly in Delphi, but this is an interesting programming question, both in terms of style and performance. Here are my codez! case ResultList.CompareType of TextCompareType: begin LastG...
The question of whether to place a `case` statement inside a loop in Delphi (or any programming language) often revolves around code readability, maintainability, and performance. While each of these factors can be subjective and context-dependent, let's break down your scenario. ### Performance Considerations 1. **Co...
25,470
[ { "from": "human", "value": "Can it be known in general whether or not placing a case within a for loop will result in bad assembly. I'm interested mainly in Delphi, but this is an interesting programming question, both in terms of style and performance. \nHere are my codez!\n\n case ResultList.CompareType...
A python script need to spawn multiple sub-processes via fork(). All of those child processes should run simultaneously and the parent process should be waiting for all of them to finish. Having an ability to set some timeout on a "slow" child would be nice. The parent process goes on processing the rest of the script...
To achieve a solution where a parent process spawns multiple child processes using `fork()`, waits for them to complete with a timeout capability, and continues processing after all child processes are collected, you can use the `os`, `signal`, and `time` modules in Python. Here's a step-by-step implementation: 1. *...
19,886
[ { "from": "human", "value": "A python script need to spawn multiple sub-processes via fork(). All of those child processes should run simultaneously and the parent process should be waiting for all of them to finish. Having an ability to set some timeout on a \"slow\" child would be nice.\nThe parent proce...
As well-known, C++ has steeper learning curve than most of the mainstream languages, which results in better performance . But, does using C++ over other languages[like Java,Ruby,Python] for Qt development have still (major) advantages,let's say about Qtopia? If any, what are they?
When considering Qt development, particularly in the context of frameworks like Qtopia (which is a deprecated open-source platform for embedded systems based on Qt), using C++ over languages like Java, Ruby, or Python can offer several notable advantages. Here are some of the major benefits: ### 1. **Performance and R...
29,413
[ { "from": "human", "value": "As well-known, C++ has steeper learning curve than most of the mainstream languages, which results in better performance . But, does using C++ over other languages[like Java,Ruby,Python] for Qt development have still (major) advantages,let's say about Qtopia? If any, what are th...
My application deals with e-mails coming from different sources, e.g. Outlook and IMAP mailboxes. Before parsing them, I write them to the temporary directory (keeping them in memory is not an option). While parsing, I might be writing attachments to the temp directory (for example, if they are too large to keep in mem...
Dealing with virus scanners and their potential interference with file operations can indeed be a challenge, especially when dealing with temporary files and attachments. Here are some strategies you can consider to mitigate the issues caused by virus scanners: 1. **Use Unique Filenames**: Ensure that temporary files ...
23,481
[ { "from": "human", "value": "My application deals with e-mails coming from different sources, e.g. Outlook and IMAP mailboxes. Before parsing them, I write them to the temporary directory (keeping them in memory is not an option). While parsing, I might be writing attachments to the temp directory (for exam...
I've implemented a set of draggable elements that can be dropped into some containers using jQuery. What I need is an animation that moves an element to a specific container without user interaction. The problem is that the elements and the drop containers are in completely different parts of the DOM and mostly positio...
To calculate the absolute position difference between two floating DOM elements using jQuery, you can utilize the `.offset()` method, which provides the coordinates relative to the document. By subtracting the coordinates of one element from the other, you can obtain the distance in both x and y directions. Here’s a f...
30,400
[ { "from": "human", "value": "I've implemented a set of draggable elements that can be dropped into some containers using jQuery. What I need is an animation that moves an element to a specific container without user interaction. The problem is that the elements and the drop containers are in completely diff...
I've evaluated some plugins from official IntelliJ repository, but none of them seems to provide more then basic syntax highlighting. Even highlighting is limited. For example, Database Navigator doesn't highlight IF. It would be great to have proper highlighting. And if it would have auto-complete feature and provide ...
It sounds like you're looking for a more robust solution for working with PL/SQL and SQL in an IntelliJ environment, especially when you're dealing with mixed codebases that include Java and JavaScript. Here are some suggestions that might help you enhance your development experience: 1. **Database Tools and SQL Plugi...
28,646
[ { "from": "human", "value": "I've evaluated some plugins from official IntelliJ repository, but none of them seems to provide more then basic syntax highlighting. Even highlighting is limited. For example, Database Navigator doesn't highlight IF. It would be great to have proper highlighting. And if it woul...