instruction
stringlengths
14
27.6k
completion
stringlengths
3
38.3k
__original_row_idx
int64
0
50k
conversations
listlengths
2
2
Say I am declaring a class C and a few of the declarations are very similar. I'd like to use a function f to reduce code repetition for these declarations. It's possible to just declare and use f as usual: >>> class C(object): ... def f(num): ... return '<' + str(num) + '>' ... v = f(9) ... w = ...
You can achieve the behavior you want by using a private method that you can call during class declaration and later within the class without needing to rely on static methods or any other complicated constructs. One effective way is to define a class-level function as a private method and make use of it directly. He...
35,882
[ { "from": "human", "value": "Say I am declaring a class C and a few of the declarations are very similar. I'd like to use a function f to reduce code repetition for these declarations. It's possible to just declare and use f as usual:\n>>> class C(object):\n... def f(num):\n... return '<' + ...
I took a wsp file, and did my stsadm -o addsolution like usual. Then I went into central administration->solution management and it showed up just fine. Then I deployed the web part, no problems so far. The problem is when I go to add it to the webpart gallery (Web Part Gallery: New Web Parts) usually the web part is...
It sounds like you're encountering an issue with your web part not showing up in the Web Part Gallery after deploying it. Here are a few things to check in your `manifest.xml` file and your web part configuration: 1. **Verify the `ElementManifests` Entry**: Ensure that your `manifest.xml` is correctly referencing your...
32,258
[ { "from": "human", "value": "I took a wsp file, and did my stsadm -o addsolution like usual. Then I went into central administration->solution management and it showed up just fine. Then I deployed the web part, no problems so far.\nThe problem is when I go to add it to the webpart gallery (Web Part Galle...
I am connecting to a MySQL DB trough a terminal who only have a program with an ODBC connection to a MySQL DB. I can put querys in the program, but not access MySQL directly. I there a way to query the DB to obtain the list of tables?
Yes, you can obtain a list of tables in a MySQL database using SQL queries, even if you're connecting through a program with an ODBC connection. You won't have direct access to the MySQL command line, but you can still execute SQL commands through your program. To list the tables in a specific database, you can use on...
35,646
[ { "from": "human", "value": "I am connecting to a MySQL DB trough a terminal who only have a program with an ODBC connection to a MySQL DB. I can put querys in the program, but not access MySQL directly.\nI there a way to query the DB to obtain the list of tables?\n" }, { "from": "gpt", "value":...
How have you guys handled working with jQuery includes <script type="text/javascript" src="jquery.js"></script> in Asp.Net MVC when working with partial views/view controls? Basically, I don't want to make the jquery include in the master page because I am not using jquery in all of my views, but I also want an easy...
Handling jQuery includes in an ASP.NET MVC application, especially when working with partial views or user controls, requires a careful approach to ensure that jQuery is only loaded when necessary and without duplications. Since you're looking for a lightweight solution that doesn't rely on ASP.NET AJAX, here are sever...
33,023
[ { "from": "human", "value": "How have you guys handled working with jQuery includes \n<script type=\"text/javascript\" src=\"jquery.js\"></script>\n\nin Asp.Net MVC when working with partial views/view controls? Basically, I don't want to make the jquery include in the master page because I am not using jq...
I have an input which at some points happens to have the focus. If the user click in the "background" of the page, the input loses its focus. I was trying to simulate the click on the background with the following code, but this doesn't work (you will notice that the input still has the focus). Any suggestion on how to...
To simulate a click on the background of the page and cause an input field to lose focus, you can handle a click event on the background element (in your case, the `<div id="main">` element or even the `<body>`). The simplest way to achieve this is to add an event listener for click events on the background, and within...
35,416
[ { "from": "human", "value": "I have an input which at some points happens to have the focus. If the user click in the \"background\" of the page, the input loses its focus. I was trying to simulate the click on the background with the following code, but this doesn't work (you will notice that the input sti...
Can you recommend peer reviewed libraries that I can use in C environment (something like Boost for C++) ? Something that provides hash, thread, interprocess communications, lists, smart memory management... The environment is embedded system, not a very minimal system, but also not a PC!
For C environments, especially in embedded systems, it can be challenging to find a comprehensive library akin to Boost for C++. However, there are several well-regarded libraries that provide various functionalities you might find useful, including hashing, threading, interprocess communication (IPC), and smart memory...
21,322
[ { "from": "human", "value": "Can you recommend peer reviewed libraries that I can use in C environment (something like Boost for C++) ? Something that provides hash, thread, interprocess communications, lists, smart memory management...\nThe environment is embedded system, not a very minimal system, but als...
What's a good way to generate an icon in-memory in python? Right now I'm forced to use pygame to draw the icon, then I save it to disk as an .ico file, and then I load it from disk as an ICO resource... Something like this: if os.path.isfile(self.icon): icon_flags = win32con.LR_LOADFROMFILE | win32con.LR_DE...
Yes, you can create an icon in memory without saving it to disk by using the `PIL` (Pillow) library to create an image and convert it to an icon resource. However, the standard Windows API requires an icon format (ICO) for icons, which means you need to create an ICO image in memory. Below is an approach that utilizes ...
29,703
[ { "from": "human", "value": "What's a good way to generate an icon in-memory in python? Right now I'm forced to use pygame to draw the icon, then I save it to disk as an .ico file, and then I load it from disk as an ICO resource...\nSomething like this:\n if os.path.isfile(self.icon):\n icon_flags...
I'm running my C++ program in gdb. I'm not real experienced with gdb, but I'm getting messages like: warning: HEAP[test.exe]: warning: Heap block at 064EA560 modified at 064EA569 past requested size of 1 How can I track down where this is happening at? Viewing the memory doesn't give me any clues. Thanks!
The warnings you are seeing in `gdb` indicate that there is a memory corruption issue in your C++ program—specifically, a heap block has been modified beyond its allocated size. This often happens when you write more data to an array than it can hold, or when you access memory that has already been freed. To track dow...
27,451
[ { "from": "human", "value": "I'm running my C++ program in gdb. I'm not real experienced with gdb, but I'm getting messages like:\nwarning: HEAP[test.exe]:\nwarning: Heap block at 064EA560 modified at 064EA569 past requested size of 1\n\nHow can I track down where this is happening at? Viewing the memory do...
What is the best compiler to experiment with C++0x features? I have been experimenting with GNU g++ 4.4.
C++0x is the working name for the C++11 standard, which introduced many new features and improvements to the C++ language. If you are currently using GNU g++ 4.4, it is worth noting that this version does not provide complete support for C++11 features, as it was released before the finalization of the C++11 standard. ...
32,996
[ { "from": "human", "value": "What is the best compiler to experiment with C++0x features? I have been experimenting with GNU g++ 4.4. \n" }, { "from": "gpt", "value": "C++0x is the working name for the C++11 standard, which introduced many new features and improvements to the C++ language. If yo...
I'm a big fan of http://highscalability.com/ and have been looking in my current development to decompose my application along functional boundaries as a route to being able to scale out the server side, specifically the database layer. What this involves is implementing different functional components of the applicati...
The scenario you described is a common challenge when decomposing applications into microservices or functional components, particularly when dealing with shared or linked data. Let's break down the considerations regarding the duplication of link tables and how to approach this problem. ### 1. Understanding the Conte...
33,681
[ { "from": "human", "value": "I'm a big fan of http://highscalability.com/ and have been looking in my current development to decompose my application along functional boundaries as a route to being able to scale out the server side, specifically the database layer. What this involves is implementing differe...
When I run this code: MIXERLINE MixerLine; memset( &MixerLine, 0, sizeof(MIXERLINE) ); MixerLine.cbStruct = sizeof(MIXERLINE); MixerLine.dwComponentType = MIXERLINE_COMPONENTTYPE_SRC_WAVEOUT; mmResult = mixerGetLineInfo( (HMIXEROBJ)m_dwMixerHandle, &MixerLine, MIXER_GETLINEINFOF_COMPONENTTYPE ); Under XP MixerLine.cCh...
The behavior you're observing is likely due to changes in how audio devices are managed in different versions of Windows. In Windows XP, multiple channels could be directly managed using the mixer API, while Vista and later versions have introduced changes that abstract some of the audio management layers. To control ...
32,118
[ { "from": "human", "value": "When I run this code:\nMIXERLINE MixerLine;\nmemset( &MixerLine, 0, sizeof(MIXERLINE) );\nMixerLine.cbStruct = sizeof(MIXERLINE);\nMixerLine.dwComponentType = MIXERLINE_COMPONENTTYPE_SRC_WAVEOUT;\nmmResult = mixerGetLineInfo( (HMIXEROBJ)m_dwMixerHandle, &MixerLine, MIXER_GETLINE...
I'm using an Ajax update panel and have recently added ASP.NET tracing code to aid in debugging. All of the sudden I started getting PageRequestManagerParseErrorExceptions when any Ajax code is executed. For example: Trace.Write("Done setting employeeId."); Apparently this is because I am not allowed to use "server...
Yes, it is true that using ASP.NET tracing (specifically, the server-side tracing) in conjunction with AJAX can lead to issues like `PageRequestManagerParseErrorExceptions`. This problem typically arises because ASP.NET tracing adds additional output to the response that AJAX does not expect, which can interfere with t...
35,615
[ { "from": "human", "value": "I'm using an Ajax update panel and have recently added ASP.NET tracing code to aid in debugging. All of the sudden I started getting PageRequestManagerParseErrorExceptions when any Ajax code is executed.\nFor example:\n Trace.Write(\"Done setting employeeId.\");\nApparently t...
Possible Duplicate: How do I select last 5 rows in a table without sorting? I want to select the top 10 records from a table in SQL Server without arranging the table in ascending or descending order.
In SQL Server, if you want to select the top 10 records from a table without any specific sorting, you can use the `SELECT TOP` clause directly. However, keep in mind that without an `ORDER BY` clause, the results returned can be arbitrary and may vary each time you run the query. Here's how you can do it: ```sql SELE...
37,571
[ { "from": "human", "value": "\nPossible Duplicate:\nHow do I select last 5 rows in a table without sorting? \n\nI want to select the top 10 records from a table in SQL Server without arranging the table in ascending or descending order.\n" }, { "from": "gpt", "value": "In SQL Server, if you want...
Am I allowed to redistribute only parts of the DirectX package? (e.g. only the DirectDraw DLLs, without Show/3D/etc.)
No, you are generally not allowed to redistribute only parts of the DirectX package, such as individual DLLs like DirectDraw, without the proper permissions from Microsoft. The DirectX libraries are part of a larger suite and are typically licensed as a whole. Redistributing individual components can violate the licens...
37,878
[ { "from": "human", "value": "Am I allowed to redistribute only parts of the DirectX package? (e.g. only the DirectDraw DLLs, without Show/3D/etc.)\n" }, { "from": "gpt", "value": "No, you are generally not allowed to redistribute only parts of the DirectX package, such as individual DLLs like Di...
I was wondering if anyone had some resources that describe the binary protocol used by ObjectOutputStream. I realize of course that objects themselves can specify what their data by implementing the Externalizable interface, so I guess I'm looking more toward the structure of the object graph - the metadata if you will...
Reverse engineering the binary protocol used by Java's `ObjectOutputStream` can indeed be a challenging task, especially when interfacing with legacy systems. There are a few resources and approaches you can utilize to better understand the format and potentially speed up your implementation in C. ### Resources to Con...
30,318
[ { "from": "human", "value": "I was wondering if anyone had some resources that describe the binary protocol used by ObjectOutputStream. I realize of course that objects themselves can specify what their data by implementing the Externalizable interface, so I guess I'm looking more toward the structure of th...
I'm using Eclipse 3.4 with WTP 3.0.2 and running a fairly large Dynamic Web Project. I've set up the project so that I can access it at http://127.0.0.1:8080/share/ but whenever I do, I get the following error: java.lang.NoSuchMethodError: javax.servlet.jsp.tagext.TagAttributeInfo.(Ljava/lang/String;ZLjava/lang/Stri...
The `NoSuchMethodError` you are encountering indicates that there is a mismatch between the version of the JSP and Servlet API that your project is using and what is being provided by the server (Tomcat in this case). The error specifically relates to the `javax.servlet.jsp.tagext.TagAttributeInfo` class, which suggest...
32,710
[ { "from": "human", "value": "I'm using Eclipse 3.4 with WTP 3.0.2 and running a fairly large Dynamic Web Project. I've set up the project so that I can access it at http://127.0.0.1:8080/share/ but whenever I do, I get the following error:\n\n java.lang.NoSuchMethodError: javax.servlet.jsp.tagext.TagAttrib...
I have the following classes public interface InterfaceBase { } public class ImplementA:InterfaceBase { } public class ImplementB:InterfaceBase { } public void TestImplementType<T>(T obj) where T: InterfaceBase { } How to infer what the T is whether ImplementA or ImplementB? I tried to use typeof(T) is ImplementA ...
In C#, you can determine the actual type of a generic type parameter `T` at runtime by using the `GetType()` method. You should use `GetType()` on the instance `obj` that you pass into the `TestImplementType` method, not `typeof(T)`, since `typeof(T)` will only give you the type of the generic parameter itself, which i...
33,498
[ { "from": "human", "value": "I have the following classes\npublic interface InterfaceBase\n{\n}\n\npublic class ImplementA:InterfaceBase\n{\n}\n\npublic class ImplementB:InterfaceBase\n{\n}\n\npublic void TestImplementType<T>(T obj) where T: InterfaceBase\n{\n}\n\nHow to infer what the T is whether Implemen...
Imagine I have table like this: id:Product:shop_id 1:Basketball:41 2:Football:41 3:Rocket:45 4:Car:86 5:Plane:86 Now, this is an example of large internet mall, where there are shops which sell to one customer, so customer can choose more products from each shop and buy it in one basket. However, I am not sure if there...
You can achieve your goal using a single SQL query with `GROUP BY` and `COUNT` functions. This will allow you to group the results by `shop_id` and count the number of products in each shop. Here’s how you can do it: ```sql SELECT shop_id, COUNT(*) AS number_of_products FROM your_table_name GROUP BY shop_id; ``` This...
35,523
[ { "from": "human", "value": "Imagine I have table like this:\nid:Product:shop_id\n1:Basketball:41\n2:Football:41\n3:Rocket:45\n4:Car:86\n5:Plane:86\nNow, this is an example of large internet mall, where there are shops which sell to one customer, so customer can choose more products from each shop and buy i...
I am attempting to bind a WPF textbox's Maxlength property to a known constant deep within a class. I am using c#. The class has a structure not too dissimilar to the following: namespace Blah { public partial class One { public partial class Two { public string MyBindingValue { get...
To bind a WPF `TextBox`'s `MaxLength` property to a constant value within a nested class structure, you will need to use a static property or a converter because WPF binding does not directly support binding to static constants. Since `MaxLength` is a dependency property, you can bind it to a property of a view model ...
28,766
[ { "from": "human", "value": "I am attempting to bind a WPF textbox's Maxlength property to a known constant deep within a class. I am using c#.\nThe class has a structure not too dissimilar to the following:\nnamespace Blah\n{\n public partial class One\n {\n public partial class Two\n {...
I can't seems to change the default color of the required field validator. In the source it is: <span class="required">*</span> <asp:RequiredFieldValidator ID="valReq_txtTracks" runat="server" ControlToValidate="txtTracks" Display="Dynamic" /> Here's what I have in my .skin file: <asp:RequiredFieldValidator r...
When dealing with ASP.NET's `RequiredFieldValidator`, you might encounter inline styles that can be difficult to override with CSS. The inline `style="color:Red;"` is applied directly to the rendered HTML, which takes precedence over any external or internal styles you define. To remove or modify this inline style, yo...
32,521
[ { "from": "human", "value": "I can't seems to change the default color of the required field validator. In the source it is:\n<span class=\"required\">*</span>\n<asp:RequiredFieldValidator ID=\"valReq_txtTracks\" runat=\"server\"\n ControlToValidate=\"txtTracks\"\n Display=\"Dynamic\" />\n\nHere's wh...
I am doing the following in PHP: exec('java -jar "/opt/flex3/lib/mxmlc.jar" +flexlib "/opt/flex3/frameworks" MyAS3App.as -default-size 360 280 -output MyAS3App.swf'); When I run this from the command line, it runs fine and finishes in a second or two. When I run this command from PHP exec, the java process takes 100% ...
Running Java applications from PHP's `exec()` can sometimes lead to issues like the one you're experiencing. This behavior may be caused by several factors, especially when the PHP process is executed in a different context than your command line environment. Here are some troubleshooting steps and solutions you might ...
33,384
[ { "from": "human", "value": "I am doing the following in PHP:\nexec('java -jar \"/opt/flex3/lib/mxmlc.jar\" +flexlib \"/opt/flex3/frameworks\" MyAS3App.as -default-size 360 280 -output MyAS3App.swf');\n\nWhen I run this from the command line, it runs fine and finishes in a second or two.\nWhen I run this co...
I have read somewhere that Aurora Feint managed to access the Address Book without using the picker. Is it possible to iterate through all records? Aurora Feint is available on AppStore, so I assume they are using SDK with no private frameworks. Thanks!
In iOS development, accessing a user's Address Book (contacts) requires specific permissions and is governed by Apple's privacy policies. As of iOS 9 and later, developers must use the Contacts framework (CNContact) to interact with contacts, and they must request permission from the user to access their contacts. Whe...
35,459
[ { "from": "human", "value": "I have read somewhere that Aurora Feint managed to access the Address Book without using the picker. Is it possible to iterate through all records? Aurora Feint is available on AppStore, so I assume they are using SDK with no private frameworks.\nThanks!\n" }, { "from": ...
My link is here: Example Page I'm using list-style-image: to give my horizontal lists ( very top and bottom ) seperators. I have a class of .first to remove the image from the first li in each list. Lo and behold in IE6, it doesn't work. What happens is that the bullet images are not being displayed, and also the botto...
It seems like you've made significant progress in resolving your issues with the navigation list styles in IE6. Let's address the points you've raised: 1. **Using `background-image` instead of `list-style-image`:** This is a good approach for better compatibility across browsers, especially older ones like IE6, which ...
33,921
[ { "from": "human", "value": "My link is here:\nExample Page\nI'm using list-style-image: to give my horizontal lists ( very top and bottom ) seperators. I have a class of .first to remove the image from the first li in each list.\nLo and behold in IE6, it doesn't work. What happens is that the bullet images...
I'm using Visual Studio 2008 to develop ASP.NET applications. Currently I'm debugging with running on IIS. I would like to switch to the development web server (Cassini) for debugging, so that I can use features like edit and continue. The reason that I'm not, is because the development web server only starts up when y...
In Visual Studio 2008, Cassini (the ASP.NET Development Server) is designed to start automatically when you run your application in debug mode. Unfortunately, it does not have an option to run continuously as a standalone server like IIS. However, you can use a workaround to keep it running for easier debugging. Here ...
34,253
[ { "from": "human", "value": "I'm using Visual Studio 2008 to develop ASP.NET applications. Currently I'm debugging with running on IIS. I would like to switch to the development web server (Cassini) for debugging, so that I can use features like edit and continue. The reason that I'm not, is because the dev...
Im trying to find a best practice to load usercontrols using Ajax. My first approach where simply using an UpdatePanel and popuplating it with LoadControl() on ajax postbacks but this would rerender other loaded usercontrols in the same UpdatePanel. Also I cannot have a predefined set of UpdatePanels since the number o...
Loading UserControls dynamically using AJAX in ASP.NET can indeed pose some challenges, especially if you want to avoid re-rendering other UserControls present in the same `UpdatePanel`. In ASP.NET 3.5 with the Ajax Control Toolkit, you can achieve this by leveraging a few techniques. Here's a recommended approach: ##...
33,421
[ { "from": "human", "value": "Im trying to find a best practice to load usercontrols using Ajax.\nMy first approach where simply using an UpdatePanel and popuplating it with LoadControl() on ajax postbacks but this would rerender other loaded usercontrols in the same UpdatePanel. Also I cannot have a predefi...
I'm trying to use the Visitor Pattern and I have as follows: public class EnumerableActions<T> : IEnumerableActions<T> { private IEnumerable<T> itemsToActOn; public EnumerableActions ( IEnumerable<T> itemsToActOn ) { this.itemsToActOn = itemsToActOn; } public void VisitAllItemsUsing ( IVisitor<T> visitor ) { for...
You're correct in your understanding of the issue. In C#, when you use a `foreach` loop, the iteration variable (in your case, `newItem` within the `Visit` method) is a read-only variable that is set to each item in the collection, but it doesn't allow you to change the original item in the collection. When you perfor...
34,716
[ { "from": "human", "value": "I'm trying to use the Visitor Pattern and I have as follows:\npublic class EnumerableActions<T> : IEnumerableActions<T>\n{\nprivate IEnumerable<T> itemsToActOn;\n\n\npublic EnumerableActions ( IEnumerable<T> itemsToActOn )\n{\n this.itemsToActOn = itemsToActOn;\n}\n\npublic voi...
Could anyboby help me with the alternative solution in C# regarding AddressOf operator in VB6? AddressOf returns a long value. What way can I get the output in C#?
In Visual Basic 6 (VB6), the `AddressOf` operator is used to obtain the address of a procedure, allowing you to use that address in APIs that require function pointers. In C#, the approach is a bit different because C# has a more structured way of handling delegates. In C#, instead of using `AddressOf`, you would typi...
35,442
[ { "from": "human", "value": "Could anyboby help me with the alternative solution in C# regarding AddressOf operator in VB6? AddressOf returns a long value. What way can I get the output in C#?\n" }, { "from": "gpt", "value": "In Visual Basic 6 (VB6), the `AddressOf` operator is used to obtain th...
Suppose you have two models, User and City, joined by a third model CityPermission: class CityPermission < ActiveRecord::Base belongs_to :city belongs_to :user end class City < ActiveRecord::Base has_many :city_permissions has_many :users, :through => :city_permissions end class User < ActiveRecord::Base ha...
The indexes you've created on the `city_permissions` table are a good start, but they may not be optimal for all use cases. Let's break down your setup and discuss the implications of the indexes. ### Current Indexes: 1. `add_index(:city_permissions, :user_id)` 2. `add_index(:city_permissions, :city_id)` These indexe...
23,778
[ { "from": "human", "value": "Suppose you have two models, User and City, joined by a third model CityPermission:\nclass CityPermission < ActiveRecord::Base\n belongs_to :city\n belongs_to :user\nend\n\nclass City < ActiveRecord::Base\n has_many :city_permissions\n has_many :users, :through => :city_perm...
I'm new to Linux and have inherited keeping our single linux server running. It's our SVN server so it's relatively important. Turns out the guy who maintained it before me had a cron task to email him when there are too many svnserve processes running, as they seem to be left dangling instead of terminating correctly....
To address your first question, if you want to kill processes for a specific user (`cvsuser` in your case) that have a `STIME` not matching today's date, you can use a combination of `ps`, `grep`, and `awk` to filter and kill those processes. Below is a command that does that: 1. First, you need to determine today's d...
33,575
[ { "from": "human", "value": "I'm new to Linux and have inherited keeping our single linux server running. It's our SVN server so it's relatively important.\nTurns out the guy who maintained it before me had a cron task to email him when there are too many svnserve processes running, as they seem to be left ...
I am launching a child process with ProcessBuilder, and need the child process to exit if the parent process does. Under normal circumstances, my code is stopping the child properly. However, if I cause the OS to kill the parent, the child will continue running. Is there any way to "tie" the child process to the pare...
When you launch a child process from a parent process, the operating system manages the lifecycle of both processes independently. This means that if the parent process is terminated (for example, killed by an external signal), the child processes might continue to run unless specific measures are taken to bind their l...
29,269
[ { "from": "human", "value": "I am launching a child process with ProcessBuilder, and need the child process to exit if the parent process does. Under normal circumstances, my code is stopping the child properly. However, if I cause the OS to kill the parent, the child will continue running.\nIs there any ...
A string will be made up of certain symbols (ax,bx,dx,c,acc for example) and numbers. ex: ax 5 5 dx 3 acc c ax bx I want to replace one or all of the symbols (randomly) with another symbol of the same set. ie, replace one of {ax,bx,dx,c,acc} with one of {ax,bx,dx,c,acc}. replacement example: acc 5 5 dx 3 acc c ax bx or...
Yes, you can achieve this in Java using regular expressions (regex). You can utilize the `Pattern` and `Matcher` classes from the `java.util.regex` package. The general approach would be to find all occurrences of the symbols you want to replace and then randomly select one of them to perform the replacement. Here’s a...
33,306
[ { "from": "human", "value": "A string will be made up of certain symbols (ax,bx,dx,c,acc for example) and numbers.\nex:\nax 5 5\ndx 3 acc\nc ax bx\nI want to replace one or all of the symbols (randomly) with another symbol of the same set. ie, replace one of {ax,bx,dx,c,acc} with one of {ax,bx,dx,c,acc}.\nr...
Are there any tricks for preventing SQL Server from entitizing chars like &, <, and >? I'm trying to output a URL in my XML file but SQL wants to replace any '&' with '&amp;' Take the following query: SELECT 'http://foosite.com/' + RTRIM(li.imageStore) + '/ImageStore.dll?id=' + RTRIM(li.imageID) + '&ra...
In SQL Server, when you generate XML using the `FOR XML` clause, it automatically encodes certain characters, including `&`, `<`, and `>`, as part of the XML specification. This is a built-in behavior to ensure that the XML remains valid. If you really need to output the raw URL without the `&` being converted to `&am...
31,552
[ { "from": "human", "value": "Are there any tricks for preventing SQL Server from entitizing chars like &, <, and >? I'm trying to output a URL in my XML file but SQL wants to replace any '&' with '&amp;'\nTake the following query:\nSELECT 'http://foosite.com/' + RTRIM(li.imageStore)\n + '/ImageStore...
I'm using Eclipse for Java development. All my sources compile fine and the resulting application compiles fine. However, I keep getting an "red-x" error notification in the Package Explorer. All my sources in this source directory (too long for the snapshot) compile fine, none of the show the "red-x" error icon. Any s...
If you're seeing a "red-x" error notification in Eclipse's Package Explorer but there are no specific errors in your Java source files, here are several steps you can take to troubleshoot and potentially resolve the issue: 1. **Refresh the Project:** - Right-click on your project in the Package Explorer and select ...
34,538
[ { "from": "human", "value": "I'm using Eclipse for Java development. All my sources compile fine and the resulting application compiles fine. However, I keep getting an \"red-x\" error notification in the Package Explorer.\nAll my sources in this source directory (too long for the snapshot) compile fine, no...
What is the difference between HTML <input type='button' /> and <input type='submit' />?
The `<input>` element in HTML is used to create interactive controls in a web form. The `type` attribute can take different values to specify the type of input control to be created. The two types you've mentioned, `button` and `submit`, serve different purposes: ### `<input type='button' />` - **Function**: This type...
34,508
[ { "from": "human", "value": "What is the difference between HTML <input type='button' /> and <input type='submit' />?\n" }, { "from": "gpt", "value": "The `<input>` element in HTML is used to create interactive controls in a web form. The `type` attribute can take different values to specify the...
Is there a way to bind a Generic List to a multicolumn listbox, yes listbox...I know but this is what I am stuck with and can't add a grid or listview. Thanks
Binding a `List<T>` (or any generic list) to a multi-column ListBox in a Windows Forms application can be challenging because a standard ListBox does not inherently support multi-column layout like a ListView does. However, you can simulate a multi-column effect by customizing the drawing of the ListBox. Here's how yo...
33,354
[ { "from": "human", "value": "Is there a way to bind a Generic List to a multicolumn listbox, yes listbox...I know but this is what I am stuck with and can't add a grid or listview.\nThanks\n" }, { "from": "gpt", "value": "Binding a `List<T>` (or any generic list) to a multi-column ListBox in a W...
As can be seen in the Mozilla changlog for JavaScript 1.7 they have added destructuring assignment. Sadly I'm not very fond of the syntax (why write a and b twice?): var a, b; [a, b] = f(); Something like this would have been a lot better: var [a, b] = f(); That would still be backwards compatible. Python-like dest...
Your approach to destructuring assignments in JavaScript 1.5 is creative, but I understand your concern about using a placeholder object like `_` to store variable names. Here’s a refined solution that maintains the functionality while improving readability and usability. Instead of creating an empty object to hold th...
31,986
[ { "from": "human", "value": "As can be seen in the Mozilla changlog for JavaScript 1.7 they have added destructuring assignment. Sadly I'm not very fond of the syntax (why write a and b twice?):\nvar a, b; \n[a, b] = f();\n\nSomething like this would have been a lot better:\nvar [a, b] = f();\n\nThat would...
Is there a (portable) way to rotate text in a HTML table cell by 90°? (I have a table with many columns and much text for the headings, so I'd like to write it vertically to save space.)
Yes, you can rotate text in a table cell by 90 degrees using CSS. A common approach involves using the CSS `transform` property. Here's a simple example to illustrate how you can achieve this. ### Example HTML Code ```html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" con...
33,075
[ { "from": "human", "value": "Is there a (portable) way to rotate text in a HTML table cell by 90°?\n(I have a table with many columns and much text for the headings, so I'd like to write it vertically to save space.)\n" }, { "from": "gpt", "value": "Yes, you can rotate text in a table cell by 90...
Looking for a way to convert a dynamically linked executable to a static executable. Seems like it should be possible but man pages are turning up short and google's not helping either.
Converting a dynamically linked executable to a statically linked executable is not a straightforward process and may not always be possible, primarily because of the dependencies that the executable has on shared libraries. However, here are some general steps and considerations that can help guide you through the pro...
32,392
[ { "from": "human", "value": "Looking for a way to convert a dynamically linked executable to a static executable. Seems like it should be possible but man pages are turning up short and google's not helping either.\n" }, { "from": "gpt", "value": "Converting a dynamically linked executable to a...
Whenever I do Properties.Settings.Save(), it commites the properties changes to Application.LocalUserAppDataPath but I want the path to be Application.CommonAppDataPath. where Application.CommonAppDataPath = C:\Documents and Settings\**All Users**\Application Data\xxxxx\xxxx\1.0.0.0 Application.LocalUserAppDataPath...
In .NET applications, the `Properties.Settings` class typically saves user-specific settings to the user's local application data directory (`Application.LocalUserAppDataPath`). Unfortunately, it is not possible to change the storage path of `Properties.Settings` directly to `Application.CommonAppDataPath` as it is des...
29,613
[ { "from": "human", "value": "Whenever I do Properties.Settings.Save(), it commites the properties changes to Application.LocalUserAppDataPath but I want the path to be Application.CommonAppDataPath.\nwhere \nApplication.CommonAppDataPath = \nC:\\Documents and Settings\\**All Users**\\Application Data\\xxxxx...
I have a script that needs to extract data temporarily to do extra operations on it, but then doesn't need to store it any further after the script has run. I currently have the data in question in a series of temporary local tables (CREATE TABLE #table), which are then dropped as their use is completed. I was consid...
When considering the performance difference between temporary tables and physical (permanent) tables in SQL Server, several factors come into play: 1. **Scope and Accessibility**: - Temporary tables (prefixed with `#` for local or `##` for global) are scoped to the session that created them. This means they can onl...
33,927
[ { "from": "human", "value": "I have a script that needs to extract data temporarily to do extra operations on it, but then doesn't need to store it any further after the script has run. I currently have the data in question in a series of temporary local tables (CREATE TABLE #table), which are then dropped...
I am using activemq to pass requests between different processes. In some cases, I have multiple, duplicate message (which are requests) in the queue. I would like to have only one. Is there a way to send a message in a way that it will replace an older message with similar attributes? If there isn't, is there a way to...
ActiveMQ does not inherently support the concept of replacing an existing message in the queue or enforcing uniqueness of messages out-of-the-box. However, there are several strategies you can implement to achieve your goal of avoiding duplicate messages in the queue: ### 1. Use Message Deduplication One way to avoid...
24,092
[ { "from": "human", "value": "I am using activemq to pass requests between different processes. In some cases, I have multiple, duplicate message (which are requests) in the queue. I would like to have only one. Is there a way to send a message in a way that it will replace an older message with similar attr...
I've been tasked with build an accessible RSS feed for my company's job listings. I already have an RSS feed from our recruiting partner; so I'm transforming their RSS XML to our own proxy RSS feed to add additional data as well limit the number of items in the feed so we list on the latest jobs. The RSS validates via ...
To remove WordML markup from your RSS feed, you can use C# with the `System.Xml` library for XML manipulation. Below, I've outlined a method to parse the XML, clean the data by removing WordML tags, and create a new RSS feed. This example assumes that the WordML is present in the `<description>` element of your RSS fee...
29,981
[ { "from": "human", "value": "I've been tasked with build an accessible RSS feed for my company's job listings. I already have an RSS feed from our recruiting partner; so I'm transforming their RSS XML to our own proxy RSS feed to add additional data as well limit the number of items in the feed so we list o...
i can upload images to the database using linq and the listview control when referancing the e.Values method for the ListViewInsertEventArgs, but there is no such method in the ListViewEditEventArgs, so what can i use to achieve the same results? here is my inserting code: protected void ProjectPhotosList_ItemInserting...
In ASP.NET's `ListView` control, the `ListViewEditEventArgs` does not have a `Values` property similar to the `ListViewInsertEventArgs`. Instead, when editing, you can directly manipulate the underlying data source to include the uploaded image. To achieve the same result while editing an item, you can access the exis...
34,439
[ { "from": "human", "value": "i can upload images to the database using linq and the listview control when referancing the e.Values method for the ListViewInsertEventArgs, but there is no such method in the ListViewEditEventArgs, so what can i use to achieve the same results?\nhere is my inserting code:\npro...
In an Open Source program I wrote, I'm reading binary data (written by another program) from a file and outputting ints, doubles, and other assorted data types. One of the challenges is that it needs to run on 32-bit and 64-bit machines of both endiannesses, which means that I end up having to do quite a bit of low-le...
You've encountered a common challenge in systems programming when dealing with data that must be read in a platform-independent manner. Your approach using function pointers based on endianness detection is a good strategy, but let's clarify a few things regarding type punning, strict aliasing, and the use of `memcpy`....
32,276
[ { "from": "human", "value": "In an Open Source program I\nwrote, I'm reading binary data (written by another program) from a file and outputting ints, doubles,\nand other assorted data types. One of the challenges is that it needs to\nrun on 32-bit and 64-bit machines of both endiannesses, which means that...
For work I have to code with an external company's API to deal with their proprietary database solution. Unfortunately the documentation they provide is more of an example guide then proper API docs, so it is very light on nitty gritty details like error codes, method returns, and exceptions. So for instance, a class ...
Dealing with poorly documented APIs can be challenging, but there are strategies and tools that can help you navigate this situation. Here are some suggestions tailored to your scenario: ### 1. Explore Reflection Since you are using C# and .NET, you can take advantage of reflection to inspect the API classes at runtim...
32,458
[ { "from": "human", "value": "For work I have to code with an external company's API to deal with their proprietary database solution. Unfortunately the documentation they provide is more of an example guide then proper API docs, so it is very light on nitty gritty details like error codes, method returns, a...
You often see those little 'petal' animations while an image or .swf file is loading in a Flash / Flex application. Do I have to steal this from someone or is there a standard one available from somewhere. i would think there is somethin standard because everyones looks the same! Ideally I want a flex Image control tha...
In Flex applications, if you want to display a loading animation (like the 'petal' animation you mentioned) while an image is loading, you can implement a simple solution using Flex components and styles. While there may not be a "standard" loading animation that comes with Flex, you can create your own using built-in ...
32,083
[ { "from": "human", "value": "You often see those little 'petal' animations while an image or .swf file is loading in a Flash / Flex application.\nDo I have to steal this from someone or is there a standard one available from somewhere. i would think there is somethin standard because everyones looks the sam...
How to declare a static dictionary object inside a static class? I tried public static class ErrorCode { public const IDictionary<string, string> ErrorCodeDic = new Dictionary<string, string>() { { "1", "User name or password problem" } }; } But the compiler complains that A const field of a ...
In C#, the `const` keyword can only be used with certain types of values that can be determined at compile time, such as numbers, booleans, and strings. Since `IDictionary<string, string>` is a reference type and requires instantiation, it cannot be declared as a `const`. Instead, you should use the `readonly` modifier...
36,060
[ { "from": "human", "value": "How to declare a static dictionary object inside a static class? I tried\npublic static class ErrorCode\n{\n public const IDictionary<string, string> ErrorCodeDic = new Dictionary<string, string>()\n {\n { \"1\", \"User name or password problem\" } \n };\n}\n...
A few guys on our team are of the opinion that every web page in the application should be a web user control. So you'll have all of your html + event handling in the Customer.ascx, for example, and there will be a corresponding Customer.aspx page that contains Customer.ascx control. These are their arguments: This ...
The arguments presented by your team highlight some valid points regarding the use of web user controls (ASCX) in ASP.NET applications, but there are also important considerations and potential drawbacks to be aware of. Let's break it down: ### Advantages of Using User Controls: 1. **Reusability**: User controls can ...
33,632
[ { "from": "human", "value": "A few guys on our team are of the opinion that every web page in the application should be a web user control. So you'll have all of your html + event handling in the Customer.ascx, for example, and there will be a corresponding Customer.aspx page that contains Customer.ascx con...
I'm using HttpWebRequest to pull down XML, and POST data back to a 'WebService' and getting a 401 on the POST. When creating the requests I've added Credentials and now tried a credentials cache and setting PreAutenticate to True, still getting the 401! :( Watching the HTTP traffic on the router I set the get make an ...
When dealing with authentication issues in a mobile context using `HttpWebRequest`, it's important to ensure that the authentication flow is handled properly. Here's a series of steps and suggestions you can take to debug and potentially resolve your issue with a 401 status code on a POST request: 1. **Check Authentic...
20,041
[ { "from": "human", "value": "I'm using HttpWebRequest to pull down XML, and POST data back to a 'WebService' and getting a 401 on the POST. \nWhen creating the requests I've added Credentials and now tried a credentials cache and setting PreAutenticate to True, still getting the 401! :(\nWatching the HTTP t...
I'm trying to perform a simple INSERT and return the identity (auto-incrementing primary key). I've tried cmd.CommandText = "INSERT INTO Prototype ( ParentID ) VALUES ( NULL ); SELECT SCOPE_IDENTITY();"; and I receive the following error EnvironmentError: SQLite error no such function: SCOPE_IDENTITY Does SQLite suppo...
SQLite does not support the `SCOPE_IDENTITY()` function, which is specific to SQL Server. Instead, SQLite provides a different mechanism to retrieve the last inserted row ID. You can use the `last_insert_rowid()` function for this purpose. Here's how you can modify your code to insert a record and retrieve the identit...
35,692
[ { "from": "human", "value": "I'm trying to perform a simple INSERT and return the identity (auto-incrementing primary key). I've tried\ncmd.CommandText = \"INSERT INTO Prototype ( ParentID ) VALUES ( NULL ); SELECT SCOPE_IDENTITY();\";\n\nand I receive the following error\nEnvironmentError: SQLite error\nno...
I have a WSS installation that's behind basic authentication/SSL (it's hosted at a public web host). I'm creating a sister site in ASP.NET, and am considering just running the credentials through and allowing users to log into the new system providing there is no 401 Not Authorized error returned. Both are internet-fac...
What you are proposing—using basic authentication to pass credentials from one application to another—can technically work, but it comes with several potential risks and considerations that you need to be aware of. Here are some points to consider: ### Security Concerns: 1. **Password Handling**: Handling user credent...
35,224
[ { "from": "human", "value": "I have a WSS installation that's behind basic authentication/SSL (it's hosted at a public web host). I'm creating a sister site in ASP.NET, and am considering just running the credentials through and allowing users to log into the new system providing there is no 401 Not Authori...
In a forms model, I used to get the current logged-in user by: Page.CurrentUser How do I get the current user inside a controller class in ASP.NET MVC?
In an ASP.NET MVC application, you can get the current logged-in user inside a controller class using the `User` property, which is available in the base `Controller` class. The `User` property gives you access to the `ClaimsPrincipal` of the currently authenticated user. Here's how you can get the current user's info...
31,167
[ { "from": "human", "value": "In a forms model, I used to get the current logged-in user by:\nPage.CurrentUser\n\nHow do I get the current user inside a controller class in ASP.NET MVC?\n" }, { "from": "gpt", "value": "In an ASP.NET MVC application, you can get the current logged-in user inside a...
I have a directory of bitmaps that are all of the same dimension. I would like to convert these bitmaps into a video file. I don't care if the video file (codec) is wmv or avi. My only requirement is that I specify the frame rate. This does not need to be cross platform, Windows (Vista and XP) only. I have read a ...
Creating a video from a series of bitmap images in C# can be achieved using libraries that simplify the process of working with video encoding and processing. Since you're looking for a solution that works on Windows and you mentioned the potential use of WMV or AVI formats, I would recommend using the **AForge.NET** l...
32,743
[ { "from": "human", "value": "I have a directory of bitmaps that are all of the same dimension. I would like to convert these bitmaps into a video file. I don't care if the video file (codec) is wmv or avi. My only requirement is that I specify the frame rate. This does not need to be cross platform, Win...
For new RijndaelManaged(), the documentation says it supports keys of 128 bits and up to 256 bits. When you instantiate new RijndaelManaged(), it creates the Key and IV for you. What size does it default to, 128 bits?
When you instantiate a new `RijndaelManaged` object in .NET without explicitly setting the `KeySize` property, it defaults to a key size of 256 bits. This is specified in the documentation for the `RijndaelManaged` class. Here’s a quick example of how to check the default key size: ```csharp using System.Security.Cr...
36,903
[ { "from": "human", "value": "For new RijndaelManaged(), the documentation says it supports keys of 128 bits and up to 256 bits.\nWhen you instantiate new RijndaelManaged(), it creates the Key and IV for you.\nWhat size does it default to, 128 bits?\n" }, { "from": "gpt", "value": "When you insta...
(define a 42) (set! 'a 10) (define a 42) (define (symbol) 'a) (set! (symbol) 10) (define a (cons 1 2)) (set! (car a) 10) I tried running them in DrScheme and they don't work. Why?
Let's break down the three snippets of Scheme code to understand why they don't work as expected. ### 1. Snippet 1: ```scheme (define a 42) (set! 'a 10) ``` **Issue**: The `set!` function is used to change the value of a variable that has already been defined. However, you are trying to set the value of a quoted symb...
34,466
[ { "from": "human", "value": " (define a 42)\n (set! 'a 10)\n\n\n(define a 42)\n(define (symbol) 'a)\n(set! (symbol) 10)\n\n\n(define a (cons 1 2))\n(set! (car a) 10)\n\nI tried running them in DrScheme and they don't work. Why?\n" }, { "from": "gpt", "value": "Let's break down the three snippets...
char *strtok(char *s1, const char *s2) repeated calls to this function break string s1 into "tokens"--that is the string is broken into substrings, each terminating with a '\0', where the '\0' replaces any characters contained in string s2. The first call uses the string to be tokenized as s1; subsequent c...
The behavior you're observing with the `strtok` function and segmentation faults is closely related to how strings are represented in C, particularly with respect to memory allocation and mutability. ### Difference Between `char *` and `char []` 1. **`char *` (Pointer to Char)**: - When you declare a `char *` vari...
34,185
[ { "from": "human", "value": "\nchar *strtok(char *s1, const char *s2)\nrepeated calls to this function break string s1 into \"tokens\"--that is\n the string is broken into substrings,\n each terminating with a '\\0', where\n the '\\0' replaces any characters\n contained in string s2. The first call\n u...
I am working an a search page that allows users to search for houses for sale. Typical search criteria include price/zip code/# bedrooms/etc. I would like to allow the user to save this criteria in a database and email new homes daily. I could either: 1) Serialize a "SavedSearch" object into a string and save that to t...
This is a common challenge when designing a system that allows users to save search criteria. Both of your proposed solutions have their merits and drawbacks, and the choice depends on your application's needs and potential for future changes. Here are some considerations for both approaches, as well as a third option ...
33,908
[ { "from": "human", "value": "I am working an a search page that allows users to search for houses for sale. Typical search criteria include price/zip code/# bedrooms/etc.\nI would like to allow the user to save this criteria in a database and email new homes daily.\nI could either:\n1) Serialize a \"SavedSe...
Any links to a good template for a windows service? (looking for C# code) Something that has the basic functionality that I could extend.
Creating a Windows Service in C# typically involves setting up a project in Visual Studio, but I'll guide you through the basics and provide a simple template you can use to get started. ### Basic Steps to Create a Windows Service 1. **Create a New Project**: - Open Visual Studio. - Create a new project. - S...
27,705
[ { "from": "human", "value": "Any links to a good template for a windows service? (looking for C# code)\nSomething that has the basic functionality that I could extend.\n" }, { "from": "gpt", "value": "Creating a Windows Service in C# typically involves setting up a project in Visual Studio, but...
Im currently using ie as an active x com thing on wxWidgets and was wanting to know if there is any easy way to change the user agent that will always work. Atm im changing the header but this only works when i manually load the link (i.e. call setUrl)
When using Internet Explorer as an ActiveX control in a wxWidgets application, modifying the user agent string can be done programmatically, but it typically requires some specific steps to ensure the new user agent is consistently applied, especially when navigating to new URLs. ### Changing the User Agent in an Acti...
32,507
[ { "from": "human", "value": "Im currently using ie as an active x com thing on wxWidgets and was wanting to know if there is any easy way to change the user agent that will always work.\nAtm im changing the header but this only works when i manually load the link (i.e. call setUrl)\n" }, { "from": "...
How do you convert between a DateTime and a Time object in Ruby?
In Ruby, you can convert between `DateTime` and `Time` objects easily. Here’s how you can do it: ### Converting DateTime to Time You can convert a `DateTime` object to a `Time` object using the `to_time` method: ```ruby require 'date' # Create a DateTime object datetime = DateTime.now # Convert to Time time = date...
37,527
[ { "from": "human", "value": "How do you convert between a DateTime and a Time object in Ruby?\n" }, { "from": "gpt", "value": "In Ruby, you can convert between `DateTime` and `Time` objects easily. Here’s how you can do it:\n\n### Converting DateTime to Time\n\nYou can convert a `DateTime` objec...
I have a bunch of ASP.NET web pages (that have a standard layout) that are product documentation. I want to create some sort of combination page that will pull all of the other page content in and concatenate them into one long page. IFrames won't work because I don't know the size of each page. I could have the comb...
Certainly! To achieve your goal of combining multiple ASP.NET web pages into one dynamic page without manually managing includes or using iframes, you can leverage ASP.NET's capabilities to load and render content dynamically. Here’s a general approach using ASP.NET Web Forms: ### Step 1: Set Up Your Page Create a ...
31,637
[ { "from": "human", "value": "I have a bunch of ASP.NET web pages (that have a standard layout) that are product documentation. I want to create some sort of combination page that will pull all of the other page content in and concatenate them into one long page.\nIFrames won't work because I don't know the...
I need to get execution time in milliseconds. Note: I originally asked this question back in 2008. The accepted answer then was to use new Date().getTime() However, we can all agree now that using the standard performance.now() API is more appropriate. I am therefore changing the accepted answer to this one.
You're right; using the `performance.now()` method is the preferred way to measure execution time with high precision in JavaScript. Unlike `Date.getTime()`, which returns the time in milliseconds since January 1, 1970, `performance.now()` provides a timestamp measured in milliseconds, including fractions of a millisec...
36,553
[ { "from": "human", "value": "I need to get execution time in milliseconds.\nNote: I originally asked this question back in 2008. The accepted answer then was to use new Date().getTime() However, we can all agree now that using the standard performance.now() API is more appropriate. I am therefore changing ...
I was wondering, is there any possibility to create a table without a primary key, but with two foreign keys, where the foreign keys pairs are always different? For example, a STOCK table with item_id and warehouse_id as foreign keys from ITEMS and WAREHOUSES tables. So same item can be in different warehouses. The vie...
In Oracle (and most relational database management systems), it is recommended to have a primary key for every table, as it uniquely identifies each row in that table. However, it is possible to create a table without an explicit primary key. In your case, you can rely on the combination of `item_id` and `warehouse_id`...
33,840
[ { "from": "human", "value": "I was wondering, is there any possibility to create a table without a primary key, but with two foreign keys, where the foreign keys pairs are always different?\nFor example, a STOCK table with item_id and warehouse_id as foreign keys from ITEMS and WAREHOUSES tables. So same it...
I'm using Strawberry Perl which includes MinGW's GCC, I'm also making use of the GNU debugger GDB and Subversion. How can I have a single development environment that would suit this (other than just UltraEdit, the command shell and IE), and how can I further enhance its features?
Creating a comprehensive development environment for Strawberry Perl with MinGW's GCC, GDB, and Subversion can significantly enhance your productivity. Here are some suggestions to help you set up a single development environment and enhance its features: ### Integrated Development Environment (IDE) 1. **Visual Studi...
30,578
[ { "from": "human", "value": "I'm using Strawberry Perl which includes MinGW's GCC, I'm also making use of the GNU debugger GDB and Subversion. How can I have a single development environment that would suit this (other than just UltraEdit, the command shell and IE), and how can I further enhance its feature...
We recently upgraded to Castor 1.2 from version 0.9.5.3 and we've noticed a dramatic drop in performance when calling unmarshal on XML. We're unmarshaling to java classes that were generated by castor in both cases. For comparison, using identical XML the time for the XML unmarshal call used to take about 10-20ms and...
When upgrading from Castor 0.9.5.3 to Castor 1.2, a significant drop in performance during XML unmarshalling can be caused by several factors. Here are some steps you can take to identify and potentially resolve the performance issues: 1. **Review Configuration Changes**: - Check if there are any changes in the co...
34,248
[ { "from": "human", "value": "We recently upgraded to Castor 1.2 from version 0.9.5.3 and we've noticed a dramatic drop in performance when calling unmarshal on XML. We're unmarshaling to java classes that were generated by castor in both cases. For comparison, using identical XML the time for the XML unma...
I am looking for a Java open source beautifier or reformatter for SQL that I can use to clean up DDL statements that I am generating with openArchitectureWare. Nothing in the answer to "Online Code Beautifier And Formatter" is of use to me and I have not been able to get Simple SQL Formatter to work for me.
If you're looking for a Java open-source beautifier or reformatter for SQL, here are a few options you might consider: 1. **SQLFormatter**: - **URL**: [SQLFormatter on GitHub](https://github.com/paulhitz/sql-formatter) - **Description**: This is a simple SQL formatter that supports multiple SQL dialects. It's ea...
35,549
[ { "from": "human", "value": "I am looking for a Java open source beautifier or reformatter for SQL that I can use to clean up DDL statements that I am generating with openArchitectureWare.\nNothing in the answer to \"Online Code Beautifier And Formatter\" is of use to me and I have not been able to get Simp...
I'm desinging a rich repeater control which needs some controls (specifically just an unordered list) added to it at runtime. The solution I've opted for is to inject the nesseccary markup, onInit, into the header, item and footer templates respectively. I can get the templates out (using InstantiateIn) and then add th...
In a Rich Repeater control, modifying the header, item, and footer templates at runtime involves a couple of steps. Since you want to dynamically inject markup into these templates, you can do this during the control's lifecycle. Here's a general approach to achieve this: 1. **Define Your Templates**: First, ensure y...
33,395
[ { "from": "human", "value": "I'm desinging a rich repeater control which needs some controls (specifically just an unordered list) added to it at runtime.\nThe solution I've opted for is to inject the nesseccary markup, onInit, into the header, item and footer templates respectively.\nI can get the template...
I would like to show a set of consecutive numbers in a UIPickerView component but have it wrap around like the seconds component of the Clock->Timer application. The only behavior I can enable looks like the hours component of the Timer application, where you can scroll in only one direction.
To achieve a wrapping behavior in a `UIPickerView` component similar to the seconds component in the Clock app, you can implement a custom delegate and data source for the `UIPickerView`. Here's a way to set this up: 1. **Setup Your UIPickerView**: Make sure to create and configure your `UIPickerView` in your view. 2...
30,718
[ { "from": "human", "value": "I would like to show a set of consecutive numbers in a UIPickerView component but have it wrap around like the seconds component of the Clock->Timer application. The only behavior I can enable looks like the hours component of the Timer application, where you can scroll in only ...
I am parsing an Expression Tree. Given a NodeType of ExpressionType.MemberAccess, how do I get the value of that Field? From C# MSDN docs: MemberAccess is A node that represents reading from a field or property. A code snippet would be incredibly, incredibly helpful. Thanks in advance!!! My code looks something like...
To get the value of a field or property represented by a `MemberExpression` in an expression tree, you typically need to evaluate the expression using the context of an instance of the object from which you want to retrieve the value. In your case, you have an `Expression<Func<T, bool>>` where `T` is the type of the o...
26,052
[ { "from": "human", "value": "I am parsing an Expression Tree. Given a NodeType of ExpressionType.MemberAccess, how do I get the value of that Field? \nFrom C# MSDN docs: \nMemberAccess is A node that represents reading from a field or property. \nA code snippet would be incredibly, incredibly helpful. Thank...
Any suggestions on how to improve DataGridViewComboBoxColumn performace with large item sets? I've got a DataGridView with several columns of type DataGridViewComboBoxColumn. I'm databinding those combobox columns to a rather large collection (10k+ items). As a result it's very slow to display the items (when i click o...
When dealing with large item sets in a `DataGridViewComboBoxColumn`, performance issues can arise due to the overhead of rendering and data binding. Here are several strategies you can implement to improve performance: 1. **Virtual Mode**: Enable virtual mode for your `DataGridView`. This will allow you to load and...
32,689
[ { "from": "human", "value": "Any suggestions on how to improve DataGridViewComboBoxColumn performace with large item sets?\nI've got a DataGridView with several columns of type DataGridViewComboBoxColumn. I'm databinding those combobox columns to a rather large collection (10k+ items). As a result it's very...
So I've been trying to learn the boost::asio stuff to communicate to a serial device using RS232. The documementation is sparse and the examples are non-existent. Can't figure out exactly how to communicate with the device. The device can't send data so all I need to do is write, but other projects require actual ba...
To communicate with a serial device using `boost::asio`, you'll need to implement the write operations to send data to the device. Since you've mentioned that your device cannot send data back, we can focus on just writing data to it. However, I'll also show you how to implement basic reading functionality for future r...
31,889
[ { "from": "human", "value": "So I've been trying to learn the boost::asio stuff to communicate to a serial device using RS232. The documementation is sparse and the examples are non-existent. Can't figure out exactly how to communicate with the device. The device can't send data so all I need to do is wr...
We have a few developers working on the same VS2005 solution, but our source control is very bad. (Our company uses Harvest, which we give a vote of no confidence). Right now, we're all just working off of the files on a shared lan drive. Obviously, this causes some problems. But we think it's better than working loc...
Working collaboratively on a shared LAN drive can definitely lead to issues like file overwrites, conflicts, and lack of version control. Here are some strategies you can implement to improve collaboration and merging without introducing new tools or software: ### 1. **Establish Clear Communication Protocols** - **...
31,356
[ { "from": "human", "value": "We have a few developers working on the same VS2005 solution, but our source control is very bad. (Our company uses Harvest, which we give a vote of no confidence).\nRight now, we're all just working off of the files on a shared lan drive. Obviously, this causes some problems....
inside my C# app I runs a 7z process to extract an archive into it's directory the archive is located in a random-named directory on the %TEMP% directory for example C:\Documents and Settings\User\Local Settings\Temp\vtugoyrc.fd2 (fullPathFilename = "C:\Documents and Settings\User\Local Settings\Temp\vtugoyrc.fd2\x...
To troubleshoot the issue you're experiencing with the 7-Zip command-line utility and find more elaborate documentation, here are a few resources and steps you can take: ### 1. **7-Zip Documentation** - The official documentation for 7-Zip can be found on their website: - [7-Zip Command Line Version User Guide...
30,866
[ { "from": "human", "value": "inside my C# app I runs a 7z process to extract an archive into it's directory\nthe archive is located in a random-named directory on the %TEMP% directory for example\n\nC:\\Documents and Settings\\User\\Local\n Settings\\Temp\\vtugoyrc.fd2\n\n(fullPathFilename = \"C:\\Document...
I would like to make a list of remarkable robot simulation environments including advantages and disadvantages of them. Some examples I know of are Webots and Player/Stage.
Here’s a list of several notable robot simulation environments, along with their advantages and disadvantages: ### 1. Webots **Advantages:** - **User-Friendly Interface**: Webots offers a graphical user interface that is easy to navigate, making it suitable for beginners and educators. - **Cross-Platform**: It is avai...
21,442
[ { "from": "human", "value": "I would like to make a list of remarkable robot simulation environments including advantages and disadvantages of them. Some examples I know of are Webots and Player/Stage.\n" }, { "from": "gpt", "value": "Here’s a list of several notable robot simulation environment...
In the following case I'm calling a Func with pointer passed to it, but in the called function, the parameter shows the pointer value as something totally bogus. Something like below. bool flag = Func(pfspara);--> pfspara = 0x0091d910 bool Func(PFSPARA pfspara) --> pfspara = 0x00000005 { return false; } Why does...
The issue you are experiencing could be caused by several factors, especially if it is not reproducible in a debug environment but only in production. Here are some common reasons why a pointer value might appear to change or become "bogus": 1. **Undefined Behavior**: If there is any undefined behavior in your code (s...
32,063
[ { "from": "human", "value": "In the following case I'm calling a Func with pointer passed to it, but in the called function, the parameter shows the pointer value as something totally bogus. Something like below.\nbool flag = Func(pfspara);--> pfspara = 0x0091d910 \n\nbool Func(PFSPARA pfspara) --> pfspara ...
What arbitrary-precision integers (and or rationals) library are there for compilers running on Microsoft Windows, and which would you recommend? Please state license type / cost, supported compilers (i.e. GCC and or VC++) for the library.
There are several arbitrary-precision integer and rational libraries available for compilers running on Microsoft Windows. Here are a few notable ones, along with their licenses, supported compilers, and recommendations: ### 1. **GNU Multiple Precision Arithmetic Library (GMP)** - **Description:** GMP is one of the mo...
32,081
[ { "from": "human", "value": "What arbitrary-precision integers (and or rationals) library are there for compilers running on Microsoft Windows, and which would you recommend?\nPlease state license type / cost, supported compilers (i.e. GCC and or VC++) for the library.\n" }, { "from": "gpt", "va...
I'm writing an app for Blackberry that was originally implemented in standard J2ME. The network connection was done using Connector.open("socket://...:80/...") instead of http:// Now, I've implemented the connection using both methods, and it seems like some times, the socket method is more responsive, and some times ...
Yes, there are significant differences between using `socket://` and `http://` protocols in J2ME applications, particularly when working with a BlackBerry device. Here are some key points to consider: ### 1. **Protocol Differences**: - **HTTP (http://)**: When you use the HTTP protocol, the underlying implementatio...
34,604
[ { "from": "human", "value": "I'm writing an app for Blackberry that was originally implemented in standard J2ME. The network connection was done using Connector.open(\"socket://...:80/...\") instead of http://\nNow, I've implemented the connection using both methods, and it seems like some times, the socke...
In short - How do I translate a NETBIOS domain to a FQDN ? Details: Assuming I'm in domain A and I have user credentials for domain B which has a trust relationship with domain A (I can authenticate the credentials). How do I get domain B's FQDN when all I have are the credentials of some authenticated user from that d...
To translate a NETBIOS domain name to a Fully Qualified Domain Name (FQDN) in a scenario where you have user credentials for another domain and there is a trust relationship, you can leverage the Active Directory services available in .NET. Below are steps and code snippets in C# using System.DirectoryServices. ### St...
31,586
[ { "from": "human", "value": "In short - How do I translate a NETBIOS domain to a FQDN ?\nDetails:\nAssuming I'm in domain A and I have user credentials for domain B which has a trust relationship with domain A (I can authenticate the credentials).\nHow do I get domain B's FQDN when all I have are the creden...
I'm trying to write an audio analysis application, and I need to identify local maxima in a 2D array which represents a spectrogram. I've already got an open source library that can generate the spectrogram using Fast Fourier Transforms, but I was wondering if anybody knew of any good libraries to help me with actually...
For identifying local maxima in a 2D array such as a spectrogram, there are several libraries and techniques you can consider. Here are some suggestions: ### C Libraries 1. **OpenCV**: While primarily known for computer vision, OpenCV has many functions that can be helpful for analyzing 2D data. It provides functions...
34,218
[ { "from": "human", "value": "I'm trying to write an audio analysis application, and I need to identify local maxima in a 2D array which represents a spectrogram. I've already got an open source library that can generate the spectrogram using Fast Fourier Transforms, but I was wondering if anybody knew of an...
I'm trying to use a dojo combobox with an Ajax data source. What I have is <div dojoType="dojo.data.ItemFileReadStore" jsId="tags" url="<%=ResolveClientUrl("~/Tag/TagMatches")%>" > </div> <select dojoType="dijit.form.ComboBox" store="tags" value="" name="tagName"> </select> Whi...
To customize the URL for fetching data with a dojo ComboBox, you can utilize a `dojo.data.ItemFileReadStore` in a way that allows for dynamic query parameters to be included in the request. You will need to modify your code slightly to ensure that the URL can accept query parameters based on user input. Here's one app...
34,318
[ { "from": "human", "value": "I'm trying to use a dojo combobox with an Ajax data source. What I have is \n<div dojoType=\"dojo.data.ItemFileReadStore\" \n jsId=\"tags\" \n url=\"<%=ResolveClientUrl(\"~/Tag/TagMatches\")%>\" >\n</div>\n<select dojoType=\"dijit.form.ComboBox\" \n store=\"tags\...
I want to reveal a div with an input inside when you click a button, and set its focus. If I use show(), it works, but if I use slideDown() the focus is lost after the animation completes. How can I prevent this from happening? Sample code: $("document").ready(function(){ $("#MyButton").click(function(e){ e...
When using jQuery's `slideDown()` method, the focus is indeed lost because the focus function is called immediately after `slideDown()` is invoked, before the animation has completed. To ensure that the input element gets focused after the slide animation finishes, you can use the callback function provided by `slideDo...
36,072
[ { "from": "human", "value": "I want to reveal a div with an input inside when you click a button, and set its focus.\nIf I use show(), it works, but if I use slideDown() the focus is lost after the animation completes. How can I prevent this from happening?\nSample code:\n$(\"document\").ready(function(){\n...
I am trying to import an access database to mysql. I have created a mysql database, but do not want to use all of the colums in the access database. Is there a way to export only certain colums from the access database to csv?
Yes, you can export specific columns from an Access database to a CSV file. Here’s how you can do it step-by-step: ### Using Microsoft Access: 1. **Open Your Access Database:** Start Microsoft Access and open the database that contains the table you want to export. 2. **Select the Table:** In the left navigati...
33,010
[ { "from": "human", "value": "I am trying to import an access database to mysql. I have created a mysql database, but do not want to use all of the colums in the access database. Is there a way to export only certain colums from the access database to csv?\n" }, { "from": "gpt", "value": "Yes, yo...
I've spent hours trying to get my code to work, its a rats nest of if/elses. Basically I want to check a country name against these two arrays: //if its in this array add a 'THE' $keywords = array("bahamas","island","kingdom","republic","maldives","netherlands", "isle of man","ivory","philippines"...
It's understandable that this kind of logic can become messy with multiple conditions and loops! You can indeed simplify your code significantly by leveraging PHP's `in_array()` function to check if the country name exists in your `$keywords` and `$exceptions` arrays. Here’s a clean and concise way to achieve the des...
35,022
[ { "from": "human", "value": "I've spent hours trying to get my code to work, its a rats nest of if/elses. Basically I want to check a country name against these two arrays:\n//if its in this array add a 'THE' \n$keywords = array(\"bahamas\",\"island\",\"kingdom\",\"republic\",\"maldives\",\"netherlands\"...
Spring IoC container gives you an option of replacing a method of a bean. Can someone provide a real life example of using this feature to solve real life problem? I can see this used for adapting an old legacy code (w/o sources) to work with your app. But I think I would consider writing an adapter class using the leg...
Certainly! The Spring IoC (Inversion of Control) container allows you to replace or override methods of beans in certain situations. This feature can be quite useful, particularly in scenarios where you want to adapt a third-party library or modify the behavior of a class without altering its source code. ### Real-Lif...
32,559
[ { "from": "human", "value": "Spring IoC container gives you an option of replacing a method of a bean. Can someone provide a real life example of using this feature to solve real life problem?\nI can see this used for adapting an old legacy code (w/o sources) to work with your app. But I think I would consi...
I'm interesting in learning about the different layers of abstraction available for making graphical applications. I see a lot of terms thrown around: At the highest level of abstraction, I hear about things like C#, .NET, pyglet and pygame. Further down, I hear about DirectX and OpenGL. Then there's DirectDraw, SDL...
It's great that you're interested in understanding the layers of abstraction in graphical programming! Let's break this down step by step, starting with definitions and going through sample code for different environments. ### Layers of Abstraction 1. **High-Level Libraries/Frameworks**: These are designed to be user...
24,067
[ { "from": "human", "value": "I'm interesting in learning about the different layers of abstraction available for making graphical applications.\nI see a lot of terms thrown around: At the highest level of abstraction, I hear about things like C#, .NET, pyglet and pygame. Further down, I hear about DirectX...
As a developer, tools that store configuration/options in the registry are the bane of my life. I can't easily track changes to those options, can't easily port them from machine to machine, and it all makes me really yearn for the good old days of .INI files... When writing my own applications, what - if anything - sh...
When deciding whether to store configuration in the Windows Registry versus using traditional configuration files (like .INI files, JSON, XML, etc.), there are several considerations to weigh, and it generally comes down to your application’s needs, the type of configuration data, and user experience. Here’s a breakdow...
34,142
[ { "from": "human", "value": "As a developer, tools that store configuration/options in the registry are the bane of my life. I can't easily track changes to those options, can't easily port them from machine to machine, and it all makes me really yearn for the good old days of .INI files...\nWhen writing my...
Example There is an application that measures temperature in each town of the world. Each measurement is taken every 5 minutes and written in to the Measurement table. CREATE TABLE [dbo].[Measurement]( [MeasurementID] [int] IDENTITY(1,1) NOT NULL, [Town] [varchar](50) NOT NULL, [Date] [datetime] NOT NULL, ...
To retrieve the most current temperature for each town from the `Measurement` table, you want a query that efficiently groups the records by town and selects the maximum date for each town to get the latest temperature measurement. Given the structure of your table and the large number of records, it is crucial to use ...
34,545
[ { "from": "human", "value": "Example\nThere is an application that measures temperature in each town of the world. Each measurement is taken every 5 minutes and written in to the Measurement table.\nCREATE TABLE [dbo].[Measurement](\n [MeasurementID] [int] IDENTITY(1,1) NOT NULL,\n [Town] [varchar](50...
I would like to create a javascript modal pop up window to get some values from a user in a ASP.Net 2.0 webpage. The basic idea is this. When a user clicks a button, a modal window will come up and ask 3 or 4 questions. The asp.net page will not be able to be changed while this window is up. Once the questions have bee...
Certainly! You can implement a modal pop-up in an ASP.NET 2.0 webpage using JavaScript along with some basic HTML/CSS for the modal structure. Below is a step-by-step guide on how to create this functionality. ### Step 1: Create the Modal HTML Structure You can place this modal structure within your ASP.NET page. The...
23,188
[ { "from": "human", "value": "I would like to create a javascript modal pop up window to get some values from a user in a ASP.Net 2.0 webpage.\nThe basic idea is this. When a user clicks a button, a modal window will come up and ask 3 or 4 questions. The asp.net page will not be able to be changed while this...
I have some directories that are bundled with my installer and I need to access them from within a custom action. I have done some research and seen that the SourceDir can be used to obtain the currently executing dir location. However I cannot find any examples of how to obtain this property? Or another way to obta...
To access the directory of your installer from within a custom action in a Windows Installer (MSI) setup project, you can indeed use the `SourceDir` property. However, how you access this property depends on the type of custom action you're writing (e.g., in C#, VBScript, or another language). Here's how you can retri...
34,260
[ { "from": "human", "value": "I have some directories that are bundled with my installer and I need to access them from within a custom action. I have done some research and seen that the SourceDir can be used to obtain the currently executing dir location. However I cannot find any examples of how to obta...
We currently use VSS 6, this is not going to change I am afraid. I am attempting to write a script that will allow a user to quickly copy all files that they have checked out to another directory tree. In order to do this I need to get a list of all the files that the user has checked out, and the directory that the fi...
To get a list of all files that a user has checked out in Visual SourceSafe (VSS) using the command line utility `ss.exe`, you can use the `ss status` command, which displays the status of the files in the specified VSS project or directory. To filter the results for checked-out files, you can use specific options. He...
34,089
[ { "from": "human", "value": "We currently use VSS 6, this is not going to change I am afraid.\nI am attempting to write a script that will allow a user to quickly copy all files that they have checked out to another directory tree. In order to do this I need to get a list of all the files that the user has ...
I have been working on a childish little program: there are a bunch of little circles on the screen, of different colors and sizes. When a larger circle encounters a smaller circle it eats the smaller circle, and when a circle has eaten enough other circles it reproduces. It's kind of neat! However, the way I have it i...
To run loops or processes side by side in Java, you would typically use multithreading. In your case, since you're handling checks for collision detection among circles, using multiple threads can help to parallelize the workload, allowing for more efficient processing of circle interactions. Here's a general approach...
31,440
[ { "from": "human", "value": "I have been working on a childish little program: there are a bunch of little circles on the screen, of different colors and sizes. When a larger circle encounters a smaller circle it eats the smaller circle, and when a circle has eaten enough other circles it reproduces. It's k...
I don’t have advanced knowledge in JavaScript, and I am trying to learn how to use Ext JS framework in ASP.NET (C# or VB.NET) environment. I’ve got couple of samples, but was unable get the project working. Is there such as website or book so I can go a read up about Ext JS in more details and how can I include this in...
Ext JS is a powerful JavaScript framework for building rich web applications. Integrating it with an ASP.NET (C# or VB.NET) environment involves setting up your project to serve the Ext JS components and communicating between the front end (Ext JS) and back end (ASP.NET). Here are some resources and steps to help you g...
27,003
[ { "from": "human", "value": "I don’t have advanced knowledge in JavaScript, and I am trying to learn how to use Ext JS framework in ASP.NET (C# or VB.NET) environment. I’ve got couple of samples, but was unable get the project working. Is there such as website or book so I can go a read up about Ext JS in m...
I'm about to start writing a .Net component which will be called from a VB COM+ service (the new component is a DLL which calls out to a webservice and returns based on the response). I'm not sure how to handle error conditions that might occur in the .Net code in the calling VB. The two types of errors I'm worried abo...
Hi Nick, Handling exceptions between .NET components and VB COM+ services can indeed be a bit tricky, but you're on the right track considering the use of exceptions. Here’s a more detailed breakdown of your scenario: ### 1. Handling Precondition Violations For precondition violations, such as invalid input parameter...
28,622
[ { "from": "human", "value": "I'm about to start writing a .Net component which will be called from a VB COM+ service (the new component is a DLL which calls out to a webservice and returns based on the response). I'm not sure how to handle error conditions that might occur in the .Net code in the calling VB...
I have a user who gets an error from ajax calls on our site. The error is pasted below. They get the error in FF3 Windows, but not IE. Based on some searching it seems this issue is often caused by the client protocol squid (you'll notice at the end of the error, squid is mentioned). My ajax code is the same used here...
The error message you're receiving indicates that the request made by the AJAX call is being blocked or malformed as it passes through a Squid proxy server. Here are several possible reasons for this and steps you can take to troubleshoot: 1. **Invalid Characters in URL**: - Make sure the URL you are trying to POS...
35,000
[ { "from": "human", "value": "I have a user who gets an error from ajax calls on our site.\nThe error is pasted below. \nThey get the error in FF3 Windows, but not IE.\nBased on some searching it seems this issue is often caused by the client protocol squid (you'll notice at the end of the error, squid is me...
Are there differences between the amount of syscalls in the major *NIX variants ? Which syscalls would be supported universally ?
Yes, there are differences in the number of system calls (syscalls) across major Unix-like variants, such as Linux, macOS (BSD-based), FreeBSD, and various other systems like Solaris. Each of these operating systems implements its own kernel and has its own set of system calls, which may lead to variations in both quan...
32,649
[ { "from": "human", "value": "Are there differences between the amount of syscalls in the major *NIX variants ?\nWhich syscalls would be supported universally ?\n" }, { "from": "gpt", "value": "Yes, there are differences in the number of system calls (syscalls) across major Unix-like variants, su...
I have a windows service that uses log4net. We noticed that the service in question was running painfully slow so we attached a debugger to it and stepped through. It appears that each time it tries to write an entry to the log via log4net that it takes anywhere from 10 to 30 seconds before the next line of code can ex...
It sounds like you're experiencing significant performance issues with your logging in the Windows service using log4net. There are several potential causes and remedies that you can explore to help improve the logging performance. ### Possible Causes of Slow Logging 1. **Synchronous Logging**: By default, log4net pe...
33,567
[ { "from": "human", "value": "I have a windows service that uses log4net. We noticed that the service in question was running painfully slow so we attached a debugger to it and stepped through. It appears that each time it tries to write an entry to the log via log4net that it takes anywhere from 10 to 30 se...
I'm using FastCGI to expose a C++ binary (written using the Wt framework) as a web app. However, after I have modified the app and recompiled it, in order for new sessions to see the changes (active sessions keep using the old version until they expire), I have to reload Apache. Is it possible to configure the system i...
Yes, it is possible to configure your FastCGI setup in such a way that you do not need to reload Apache every time you compile a new version of your C++ application. Below are a few strategies you might consider implementing to achieve this: ### 1. Use Apache with a Process Manager Instead of directly running your Fas...
33,251
[ { "from": "human", "value": "I'm using FastCGI to expose a C++ binary (written using the Wt framework) as a web app. However, after I have modified the app and recompiled it, in order for new sessions to see the changes (active sessions keep using the old version until they expire), I have to reload Apache....
How do you estimate a EAI project using Function point?
Estimating an Enterprise Application Integration (EAI) project using Function Points (FP) involves a systematic approach to measure the functional size of the software based on the functionalities provided to the users. Function Point Analysis (FPA) is a standardized method that quantifies the software's functionality ...
30,345
[ { "from": "human", "value": "How do you estimate a EAI project using Function point?\n" }, { "from": "gpt", "value": "Estimating an Enterprise Application Integration (EAI) project using Function Points (FP) involves a systematic approach to measure the functional size of the software based on t...
The team in which I work has been getting problems with the visual inheritance of the forms in the Java platform. We want to develop a base JFrame with some controls in it and to have inherited forms from that base JFrame. The designer of the Netbeans 6.1 does not paint the controls of the base form in the inherited on...
It's a common issue with older versions of NetBeans, like 6.1, that the GUI builder (Matisse) does not handle visual inheritance well. While the runtime behavior is correct and the inherited forms display the controls from the base `JFrame`, the design view does not reflect that, making it difficult to work on the UI v...
35,690
[ { "from": "human", "value": "The team in which I work has been getting problems with the visual inheritance of the forms in the Java platform.\nWe want to develop a base JFrame with some controls in it and to have inherited forms from that base JFrame. The designer of the Netbeans 6.1 does not paint the con...
Given following Ruby statements: (Read input and store each word in array removing spaces between words etc) input = gets.chomp inArr = [] input.strip.each (" ") { |w| inArr.push w } inArr.delete_if {|ele| ele == " "} inArr.each {|w| w.strip!} I was wondering if anyone can suggest a way to optimize this code, maybe vi...
Absolutely, your Ruby code can be optimized and simplified significantly. Let's break down what your code is currently doing and then we'll suggest a more concise solution. ### Original Code Breakdown 1. It reads a line of input and removes leading/trailing whitespace. 2. It initializes an empty array `inArr`. 3. It i...
36,235
[ { "from": "human", "value": "Given following Ruby statements:\n(Read input and store each word in array removing spaces between words etc)\ninput = gets.chomp\ninArr = []\ninput.strip.each (\" \") { |w| inArr.push w }\ninArr.delete_if {|ele| ele == \" \"}\ninArr.each {|w| w.strip!}\n\nI was wondering if any...