instruction
stringlengths
14
27.6k
completion
stringlengths
3
38.3k
__original_row_idx
int64
0
50k
conversations
listlengths
2
2
I need to solve a few mathematical equations in my application. Here's a typical example of such an equation: a + b * c - d / e = a Additional rules: b % 10 = 0 b >= 0 b <= 100 Each number must be integer ... I would like to get the possible solution sets for a, b, c, d and e. Are there any libraries out there, eith...
Yes, there are several libraries and tools available that can help you solve mathematical equations, including the constraints you've mentioned. Below are some popular options, both open source and commercial: ### 1. **SymPy (Python)** - **Description**: SymPy is a Python library for symbolic mathematics. It can solve...
25,602
[ { "from": "human", "value": "I need to solve a few mathematical equations in my application. Here's a typical example of such an equation:\na + b * c - d / e = a\n\nAdditional rules:\n\nb % 10 = 0\nb >= 0\nb <= 100\nEach number must be integer\n...\n\nI would like to get the possible solution sets for a, b,...
The project I'm working on needs to render an ESRI shape file, which can have a large number of polygons/shapes. When I add all these polygons, lines, points, etc to the canvas I'm using, it gets really slow. To draw the shapes on the map, I'm creating a Path object, and setting it's Data property to a StreamGeometry....
Rendering large numbers of polygons or shapes efficiently in a WPF application, especially when you're constrained by partial-trust XBAP, can be challenging. Here are several strategies you can consider to improve performance when dealing with ESRI shape files: ### 1. Use `StreamGeometry` Efficiently Since you are alr...
24,540
[ { "from": "human", "value": "The project I'm working on needs to render an ESRI shape file, which can have a large number of polygons/shapes. When I add all these polygons, lines, points, etc to the canvas I'm using, it gets really slow.\nTo draw the shapes on the map, I'm creating a Path object, and setti...
I am trying to set up JBoss 4.2.2 and JConsole for remote monitoring. As per many of the how-to's I have found on the web to do this you need to enable jmxremote by setting the following options in run.conf. (I realize the other two opts disable authentication) JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.por...
It looks like you're facing challenges with enabling JMX remote monitoring in JBoss 4.2.2 while also using JBoss Web Services (JWS) and deploying a specific `.ear` file. ### Possible Solutions: 1. **Verify JBoss and JDK Compatibility**: Ensure that the version of JBoss 4.2.2 you are using is fully compatible with ...
23,417
[ { "from": "human", "value": "I am trying to set up JBoss 4.2.2 and JConsole for remote monitoring. As per many of the how-to's I have found on the web to do this you need to enable jmxremote by setting the following options in run.conf. (I realize the other two opts disable authentication)\nJAVA_OPTS=\"$J...
we have a problem with an application we're developing. Very seldom, like once in a hundred, the application crashes at start up. When the crash happens it brings down the whole system, the computer starts to beep and freezes up completely, the only way to recover is to turn off the power (we're using Windows XP). The ...
Debugging intermittent crashes, especially ones that cause the entire system to freeze, can indeed be quite challenging. Here are several approaches you can take to log function calls and try to pinpoint the problem: ### 1. **Manual Instrumentation** You can add logging statements at the beginning and end of every fun...
20,540
[ { "from": "human", "value": "we have a problem with an application we're developing. Very seldom, like once in a hundred, the application crashes at start up. When the crash happens it brings down the whole system, the computer starts to beep and freezes up completely, the only way to recover is to turn off...
I am new to strut/web programming and I thought I could learn a lot by reading a sample app. On google, I searched and found a sample app at http://www.roseindia.net/struts/struts2/struts2tutorial.zip , the tutorial is really nice and it gives a sample login page. However, I couldn't run this sample app. I tried postin...
It sounds like you're encountering a common issue with Struts 2 applications, where the framework is unable to find the action specified in your `struts.xml` configuration file. Let's go through some troubleshooting steps and confirm a few details to help you resolve the issue. 1. **Check Your struts.xml Configuration...
23,101
[ { "from": "human", "value": "I am new to strut/web programming and I thought I could learn a lot by reading a sample app. On google, I searched and found a sample app at\nhttp://www.roseindia.net/struts/struts2/struts2tutorial.zip , the tutorial is really nice and it gives a sample login page.\nHowever, I c...
There's a school of thought that null values should not be allowed in a relational database. That is, a table's attribute (column) should not allow null values. Coming from a software development background, I really don't understand this. It seems that if null is valid within the context of the attribute, then it shou...
The debate about null values in relational databases is a nuanced topic, and whether or not they should be allowed often depends on the specific use case and the design principles of the database schema. Here are some points to consider regarding the use of nulls in relational databases: ### Arguments for Allowing Nul...
22,418
[ { "from": "human", "value": "There's a school of thought that null values should not be allowed in a relational database. That is, a table's attribute (column) should not allow null values. Coming from a software development background, I really don't understand this. It seems that if null is valid within t...
Are there plugins for trac that enable cookie based authentication instead of http authentication, and allow keeping the site private for unknown users? We want to allow customers outside the office to log in, add and look at the tickets on their projects, but not the projects for our other clients. Non techie users ar...
Trac, the project management and bug tracking software, traditionally uses HTTP Basic Authentication for user authentication, which can be less user-friendly for non-technical users. While there are no official plugins developed by the Trac team specifically for cookie-based authentication, there are a few alternatives...
26,792
[ { "from": "human", "value": "Are there plugins for trac that enable cookie based authentication instead of http authentication, and allow keeping the site private for unknown users?\nWe want to allow customers outside the office to log in, add and look at the tickets on their projects, but not the projects ...
I got curious by Jon Limjap's interview mishap and started to look for efficient ways to do palindrome detection. I checked the palindrome golf answers and it seems to me that in the answers are two algorithms only, reversing the string and checking from tail and head. def palindrome_short(s): length = len(s) f...
Detecting palindromes in large DNA sequences can indeed be a performance-critical task, and your intuition about optimizing the algorithms is valid. While the straightforward methods you mentioned (reversing the string or comparing characters from both ends) are efficient for small to moderately sized strings, they mig...
25,443
[ { "from": "human", "value": "I got curious by Jon Limjap's interview mishap and started to look for efficient ways to do palindrome detection. I checked the palindrome golf answers and it seems to me that in the answers are two algorithms only, reversing the string and checking from tail and head.\ndef pali...
The output of my JSON call can either be an Array or a Hash. How do I distinguish between these two?
In order to distinguish between an Array and a Hash (or Object) in the output of a JSON call, you can check the data type of the response after parsing the JSON. Below is how you can do this in different programming languages. ### JavaScript In JavaScript, you can use the `Array.isArray()` method to check if the parse...
26,191
[ { "from": "human", "value": "The output of my JSON call can either be an Array or a Hash. How do I distinguish between these two?\n" }, { "from": "gpt", "value": "In order to distinguish between an Array and a Hash (or Object) in the output of a JSON call, you can check the data type of the resp...
Any ideas on how to disable, but not uninstall Resharper 4.x or above?
To temporarily disable ReSharper without uninstalling it, you can follow these steps depending on your version of Visual Studio: ### For Visual Studio: 1. **Disable ReSharper in Options:** - Open Visual Studio. - Go to `Tools` > `Options`. - In the Options window, find and expand the `ReSharper` node on the ...
27,070
[ { "from": "human", "value": "Any ideas on how to disable, but not uninstall Resharper 4.x or above?\n" }, { "from": "gpt", "value": "To temporarily disable ReSharper without uninstalling it, you can follow these steps depending on your version of Visual Studio:\n\n### For Visual Studio:\n\n1. **...
I want to list the thumbnails of a set of photos in a listctrl. But the only way to achieve this is to use the setImageList method to bind a image list to the CListCtrl object and insert items like this: InsertItem (int nItem, LPCTSTR lpszitem, int nImage). I also must modify the listctrl's style by ModifyStyle(LVS_TYP...
In a standard `CListCtrl` in MFC (Microsoft Foundation Classes), the typical way to display images (thumbnails) alongside item text is indeed by using an image list. Unfortunately, `CListCtrl` does not support directly adding bitmap or other image objects without using an image list. Here are the reasons and alternativ...
22,595
[ { "from": "human", "value": "I want to list the thumbnails of a set of photos in a listctrl. But the only way to achieve this is to use the setImageList method to bind a image list to the CListCtrl object and insert items like this: InsertItem (int nItem, LPCTSTR lpszitem, int nImage). I also must modify th...
I want to filter the selectable dates on a datepicker. I basically need to filter by work days - i.e. make holidays and weekends not selectable. I know you can specify dates using a function in the beforeShowDate: and you can also use $.datepicker.noWeekends. Question is: can you do both?
Yes, you can combine both functionalities to filter the selectable dates in a jQuery UI Datepicker by using the `beforeShowDay` function alongside the built-in `$.datepicker.noWeekends` option. Here’s how you can achieve this: 1. Use `$.datepicker.noWeekends` to automatically exclude Saturdays and Sundays. 2. Additio...
27,542
[ { "from": "human", "value": "I want to filter the selectable dates on a datepicker. I basically need to filter by work days - i.e. make holidays and weekends not selectable.\nI know you can specify dates using a function in the beforeShowDate: and you can also use $.datepicker.noWeekends.\nQuestion is: can ...
I'm using ccl/openmcl on Mac OS X. (latest versions of both). When the lisp prompt is displayed, using the cursor keys to navigate the current line results in escape codes, rather than movement, eg: Welcome to Clozure Common Lisp Version 1.2-r9226-RC1 (DarwinX8664)! ? (^[[D Here I've pressed the ( key, and then the le...
The issue you're encountering with cursor navigation in Clozure Common Lisp (CCL/OpenMCL) on Mac OS X is related to terminal settings and how it handles key inputs. The escape codes you're seeing (like `^[[D` for left arrow) indicate that the terminal is not interpreting the keypresses correctly. Here are some potenti...
22,224
[ { "from": "human", "value": "I'm using ccl/openmcl on Mac OS X. (latest versions of both). When the lisp prompt is displayed, using the cursor keys to navigate the current line results in escape codes, rather than movement, eg:\nWelcome to Clozure Common Lisp Version 1.2-r9226-RC1 (DarwinX8664)!\n? (^[[D\n...
I want my WPF ComboBox's ItemsSource property to be bound to MyListObject's MyList property. The problem is that when I update the MyList property in code, the WPF ComboBox is not reflecting the update. I am raising the PropertyChanged event after I perform the update, and I thought WPF was supposed to automatically ...
The issue you are experiencing stems from the fact that you are using a `List(Of String)` as the type for your `MyList` property. While you are correctly raising the `PropertyChanged` event when updating the `MyList` property, WPF's data binding does not automatically reflect changes in the content of a `List`. This is...
24,619
[ { "from": "human", "value": "I want my WPF ComboBox's ItemsSource property to be bound to MyListObject's MyList property. The problem is that when I update the MyList property in code, the WPF ComboBox is not reflecting the update. I am raising the PropertyChanged event after I perform the update, and I t...
I am using MS SQL Server 2005, I have dates stored in epoch time (starting 1970) I need to create a statement that will affect any record that has not been updated in the last 24 hours.
To update records in SQL Server 2005 where the date is stored as epoch time (the number of seconds since January 1, 1970), you first need to convert the current time to epoch time and then determine which records have not been updated in the last 24 hours. Here's how you can do that: 1. **Convert the current time to ...
25,691
[ { "from": "human", "value": "I am using MS SQL Server 2005, I have dates stored in epoch time (starting 1970) I need to create a statement that will affect any record that has not been updated in the last 24 hours.\n" }, { "from": "gpt", "value": "To update records in SQL Server 2005 where the d...
I usually create my SQL tables and stored procedures by writing a script inside Visual Studio. This works really well for me except for one simple annoyance: VS puts blue boxes around all the SQL queries and data-manipulation commands. The purpose of these boxes is to draw undue attention to the fact that VS thinks the...
To disable the blue boxes that appear around SQL queries in Visual Studio (indicating that the Query Builder is available), you can change the settings in the IDE. Here are the steps you can follow: 1. **Open Visual Studio.** 2. **Go to Tools -> Options.** 3. In the Options dialog, navigate to **SQL Server Tools** -...
29,336
[ { "from": "human", "value": "I usually create my SQL tables and stored procedures by writing a script inside Visual Studio. This works really well for me except for one simple annoyance: VS puts blue boxes around all the SQL queries and data-manipulation commands. The purpose of these boxes is to draw undue...
I'm currently using the following code to right-trim all the std::strings in my programs: std::string s; s.erase(s.find_last_not_of(" \n\r\t")+1); It works fine, but I wonder if there are some edge-cases where it might fail? Of course, answers with elegant alternatives and also left-trim solution are welcome.
Your current approach to right-trimming a `std::string` by using `find_last_not_of` and `erase` is valid and should work correctly in most cases. However, there are a few edge cases to consider: 1. **Empty String**: If the string is empty, `find_last_not_of` will return `std::string::npos`, and the subsequent `+1` ope...
21,845
[ { "from": "human", "value": "I'm currently using the following code to right-trim all the std::strings in my programs:\nstd::string s;\ns.erase(s.find_last_not_of(\" \\n\\r\\t\")+1);\n\nIt works fine, but I wonder if there are some edge-cases where it might fail?\nOf course, answers with elegant alternative...
I have defined a fieldset in HTML, and applied the following (simple) CSS rules to it: fieldset { margin: 2em 0; position:relative; padding: 1em; border:1px solid #ccc; } Everything is great, no big deal, except in all versions (well, up to 7 as far as I know) of IE the top border -- but not, interest...
The issue you're encountering with the `<fieldset>` element in Internet Explorer (IE) is a known problem that has to do with the way IE handles the box model and the rendering of form elements. Specifically, IE has historically had quirks with how it calculates the width and padding of elements, particularly with form-...
25,689
[ { "from": "human", "value": "I have defined a fieldset in HTML, and applied the following (simple) CSS rules to it:\nfieldset \n{\n margin: 2em 0;\n position:relative;\n padding: 1em;\n border:1px solid #ccc;\n}\n\nEverything is great, no big deal, except in all versions (well, up to 7 as far as...
I have an application that is creating an new item in Sitecore then opening up the Content Editor to that item, it is loading fine but whenever i try to open the html editor i get a 'NullReferenceException'. This is only happening when i launch the application in this method. Source Code: [Serializable] public class Pu...
The `NullReferenceException` that you are encountering when trying to open the HTML editor in Sitecore could be caused by a number of factors, including issues related to the context in which the editor is being launched or the parameters being passed to it. Let's break down some possible areas of concern in your code...
22,367
[ { "from": "human", "value": "I have an application that is creating an new item in Sitecore then opening up the Content Editor to that item, it is loading fine but whenever i try to open the html editor i get a 'NullReferenceException'. This is only happening when i launch the application in this method.\nS...
We have always had languages that were preferable to be used in a particular scenario. For a quick prototype development, VB6 was an obvious choice. VB6 was chosen in projects that had a simple desktop user interface and standard and un-complicated database interaction requirements. If you wanted to develop a device dr...
The advent of the .NET framework indeed altered the landscape of programming languages and their interoperability. In traditional software development paradigms, different programming languages were often specialized for specific tasks or domains due to their inherent features, libraries, and performance characteristic...
25,272
[ { "from": "human", "value": "We have always had languages that were preferable to be used in a particular scenario. For a quick prototype development, VB6 was an obvious choice. VB6 was chosen in projects that had a simple desktop user interface and standard and un-complicated database interaction requireme...
Like it is the case with jpeg images for example? What's about mp3 or ogg vorbis audio files?
JPEG, MP3, and Ogg Vorbis are all formats used to compress and store media files, but they differ in how they achieve this compression and the specific use cases for which they are best suited. ### JPEG - **Type**: Image format. - **Compression**: Lossy compression, which means that some image data is lost during comp...
26,546
[ { "from": "human", "value": "Like it is the case with jpeg images for example?\nWhat's about mp3 or ogg vorbis audio files?\n" }, { "from": "gpt", "value": "JPEG, MP3, and Ogg Vorbis are all formats used to compress and store media files, but they differ in how they achieve this compression and ...
I know that you can run almost all Java in Dalvik's VM that you can in Java's VM but the limitations are not very clear. Has anyone run into any major stumbling blocks? Any major libraries having trouble? Any languages that compile to Java byte code (Scala, Jython etc...) not work as expected?
Dalvik's Virtual Machine (VM), which was used in Android versions prior to Android 5.0 (Lollipop), indeed has some differences and limitations compared to the standard Java Virtual Machine (JVM). Here are some common stumbling blocks and limitations developers encountered: ### Major Limitations 1. **Java Version Supp...
23,942
[ { "from": "human", "value": "I know that you can run almost all Java in Dalvik's VM that you can in Java's VM but the limitations are not very clear. Has anyone run into any major stumbling blocks? Any major libraries having trouble? Any languages that compile to Java byte code (Scala, Jython etc...) not...
The question is, should we design applications/forms using headers or stick to spans and divs? When the world was using html to link documents, these header tags looked like the 'Table of contents'. In the new era where html is used for applications, using header tags in the orthodox fashion (i.e. h1 contains h2, h2 co...
Your question touches on the fundamental aspects of semantic HTML, accessibility, and the structure of web applications. Let's break down the key points: ### 1. **Semantic HTML and Accessibility**: - **Semantic HTML** refers to using HTML elements according to their intended purpose. Header tags (`<h1>`, `<h2>`, etc.)...
23,063
[ { "from": "human", "value": "The question is, should we design applications/forms using headers or stick to spans and divs? When the world was using html to link documents, these header tags looked like the 'Table of contents'. In the new era where html is used for applications, using header tags in the ort...
We have an x-files problem with our .NET application. Or, rather, hybrid Win32 and .NET application. When it attempts to communicate with Oracle, it just dies. Vanishes. Goes to the big black void in the sky. No event log message, no exception, no nothing. If we simply ask the application to talk to a MS SQL Server in...
It sounds like you've encountered a rather complex issue involving your .NET application, Oracle, and some peculiar behavior related to file paths and case sensitivity. Let's break down the findings and some possible takeaways for future reference. ### Key Findings: 1. **Directory Name with Spaces**: The application w...
26,434
[ { "from": "human", "value": "We have an x-files problem with our .NET application. Or, rather, hybrid Win32 and .NET application.\nWhen it attempts to communicate with Oracle, it just dies. Vanishes. Goes to the big black void in the sky. No event log message, no exception, no nothing.\nIf we simply ask th...
We're using HAProxy as a load balancer at the moment, and it regularly makes requests to the downstream boxes to make sure they're alive using an OPTIONS request: OPTIONS /index.html HTTP/1.0 I'm working with getting nginx set up as a reverse proxy with caching (using ncache). For some reason, nginx is returning a 4...
When Nginx is returning a 405 (Method Not Allowed) response for OPTIONS requests, it indicates that it is not configured to handle those requests. By default, Nginx doesn't have a configuration to pass through OPTIONS requests to the upstream server. You can fix this by explicitly allowing OPTIONS requests in your Ngin...
25,773
[ { "from": "human", "value": "We're using HAProxy as a load balancer at the moment, and it regularly makes requests to the downstream boxes to make sure they're alive using an OPTIONS request:\n\nOPTIONS /index.html HTTP/1.0\n\nI'm working with getting nginx set up as a reverse proxy with caching (using ncac...
When we using a transation from System.Transactions (creating TransationScope for an instance) by default all Sql-connections (System.Data.SqlClient.SqlConnection) (but is't also the true for Oracle.DataAccess.OracleConnection) are enlisted on opening. That's called auto-enlistment. Nice feature. But it can be turned o...
To determine whether a specific `SqlConnection` instance is enlisted in a `System.Transactions.Transaction`, you can use the `Transaction.Current` property combined with the `DbConnection` class's `EnlistTransaction` method. Here’s how you can check if a `SqlConnection` is enlisted in a transaction: 1. **Check `Trans...
22,628
[ { "from": "human", "value": "When we using a transation from System.Transactions (creating TransationScope for an instance) by default all Sql-connections (System.Data.SqlClient.SqlConnection) (but is't also the true for Oracle.DataAccess.OracleConnection) are enlisted on opening.\nThat's called auto-enlist...
This probably has a simple answer, but I must not have had enough coffee to figure it out on my own: If I had a comma delimited string such as: string list = "Fred,Sam,Mike,Sarah"; How would get each element and add quotes around it and stick it back in a string like this: string newList = "'Fred','Sam','Mike','Sarah'...
You're on the right track with using the `Split` method to break your string into its components! However, there are more elegant ways to achieve what you want in C#. Here’s a solution that simplifies your logic using `String.Join` and `LINQ`, which can make your code cleaner. Here's how you can do it: ```csharp usin...
28,833
[ { "from": "human", "value": "This probably has a simple answer, but I must not have had enough coffee to figure it out on my own:\nIf I had a comma delimited string such as:\nstring list = \"Fred,Sam,Mike,Sarah\";\n\nHow would get each element and add quotes around it and stick it back in a string like this...
I have a case where a 3rd party ad is bleeding through my modal window implementation. I'd like to up the z-index of the modal overlay as high as possible so the ad won't show on top of it. Is there a limit to z-index values? I'm sure if there is it varies by browser. Anyone know?
The `z-index` CSS property controls the stacking order of elements on a web page. While you can theoretically assign any integer value to `z-index`, there are some practical considerations to keep in mind: 1. **Limits of Integer Values**: The `z-index` value can be positive or negative integers. In CSS, the values are...
25,146
[ { "from": "human", "value": "I have a case where a 3rd party ad is bleeding through my modal window implementation. I'd like to up the z-index of the modal overlay as high as possible so the ad won't show on top of it. Is there a limit to z-index values? I'm sure if there is it varies by browser. Anyone kno...
In other words, if I set up SSRS Express edition will I be able to consume and make calls through the webservice?
Yes, if you set up SQL Server Reporting Services (SSRS) Express edition, you will be able to consume and make calls through the web service. SSRS provides a web service interface that allows you to programmatically interact with your reports, manage report execution, and access report data. Here are a few points to ke...
29,271
[ { "from": "human", "value": "In other words, if I set up SSRS Express edition will I be able to consume and make calls through the webservice?\n" }, { "from": "gpt", "value": "Yes, if you set up SQL Server Reporting Services (SSRS) Express edition, you will be able to consume and make calls thro...
In terms of the number of servers ready to receive an application written in the language, the number of people who can write code using the language, and so on?
When evaluating programming languages based on factors such as the number of servers ready to receive applications, the number of developers proficient in the language, and overall ecosystem support, here are some considerations: 1. **Popularity of the Language**: - Languages like **JavaScript**, **Python**, **Java...
26,426
[ { "from": "human", "value": "In terms of the number of servers ready to receive an application written in the language, the number of people who can write code using the language, and so on?\n" }, { "from": "gpt", "value": "When evaluating programming languages based on factors such as the numbe...
I'm using the standard edition of JIRA and on the whole, I love it. However, it's a frequent source of irritation that JIRA doesn't seem to record who resolved an issue, just who the current assignee is, and who reported the issue. Because the "resolver" is not recorded there's no way to find issues that I resolved, or...
Hi Don, In JIRA, the standard setup indeed does not have a dedicated field for tracking who resolved an issue. However, you can work around this limitation by using the following methods: 1. **Resolution Field**: When an issue is resolved, JIRA typically allows the user to set a "Resolution" field. If you ensure that...
25,970
[ { "from": "human", "value": "I'm using the standard edition of JIRA and on the whole, I love it. However, it's a frequent source of irritation that JIRA doesn't seem to record who resolved an issue, just who the current assignee is, and who reported the issue.\nBecause the \"resolver\" is not recorded there...
How to check, from C#, are files for complex script and rtl languages (Regional and Language settings) installed? Edit: Or is there another way of checking whether right to left text will display correctly in my form? Edit for better explanation (I hope :)) I'm creating an application that will use Arabic letters (free...
To check if the "Files for complex scripts and right-to-left languages" are installed in the user's system from a C# application, you typically cannot directly query this setting. However, you can leverage the capabilities of the .NET framework and Windows APIs to determine whether the necessary language support is ava...
25,362
[ { "from": "human", "value": "How to check, from C#, are files for complex script and rtl languages (Regional and Language settings) installed?\nEdit:\nOr is there another way of checking whether right to left text will display correctly in my form?\nEdit for better explanation (I hope :))\nI'm creating an a...
I have implemented what I thought was a pretty decent representation of MVC in several web applications but since having joined crackoverflow, I'm finding that perhaps my initial definitions were a bit simplistic and thus I'd really like some clarification on the differences between the Data Access Layer and the Model ...
You're on the right track in identifying that the responsibilities of the Data Access Layer (DAL) and the Model (or Domain Layer) can sometimes become blurred, especially when creating a basic implementation. Let's break down the differences and clarify the roles of these components. ### Data Access Layer (DAL) The D...
20,877
[ { "from": "human", "value": "I have implemented what I thought was a pretty decent representation of MVC in several web applications but since having joined crackoverflow, I'm finding that perhaps my initial definitions were a bit simplistic and thus I'd really like some clarification on the differences bet...
Just to clarify, I'm running Sybase 12.5.3, but I am lead to believe that this holds true for SQL Server 2005 too. Basically, I'm trying to write a query that looks a little like this, I've simplified it as much as possible to highlight the problem: DECLARE @a int, @b int, @c int SELECT @a = huzzah.a ,@b = h...
In Sybase and SQL Server, the error you are encountering arises because you cannot directly assign values to multiple variables in a single SELECT statement while also performing a data retrieval operation using a derived table. While your workaround of inserting into a temporary table works, you can achieve the same ...
26,925
[ { "from": "human", "value": "Just to clarify, I'm running Sybase 12.5.3, but I am lead to believe that this holds true for SQL Server 2005 too. Basically, I'm trying to write a query that looks a little like this, I've simplified it as much as possible to highlight the problem:\nDECLARE @a int, @b int, @c ...
Looking for a toolkit/SDK for general Blackberry development or application toolkits. Anything like an MVC framework?
As of my last knowledge update in October 2023, BlackBerry has transitioned away from its traditional operating systems and development environments, particularly with the decline in popularity of BlackBerry OS and the shift towards Android-based devices. However, if you're still interested in developing applications f...
26,155
[ { "from": "human", "value": "Looking for a toolkit/SDK for general Blackberry development or application toolkits. Anything like an MVC framework?\n" }, { "from": "gpt", "value": "As of my last knowledge update in October 2023, BlackBerry has transitioned away from its traditional operating syst...
I have been running StyleCop over some C# code, and it keeps reporting that my using directives should be inside the namespace. Is there a technical reason for putting the using directives inside instead of outside the namespace?
Yes, there are some technical and stylistic reasons for placing `using` directives inside a namespace in C#. While the C# language allows `using` directives to be placed either at the top of the file (outside any namespace) or within a namespace, placing them inside the namespace can offer several advantages: 1. **Sco...
25,500
[ { "from": "human", "value": "I have been running StyleCop over some C# code, and it keeps reporting that my using directives should be inside the namespace.\nIs there a technical reason for putting the using directives inside instead of outside the namespace?\n" }, { "from": "gpt", "value": "Yes...
Always was interested why are Array.Sort() and Array.IndexOf() methods made static and similar ArrayList.Sort() and ArrayList.IndexOf() are designed as member methods. Thank you for any ideas.
The design choices for the `Array.Sort()` and `Array.IndexOf()` methods being static while their `ArrayList` counterparts are instance (member) methods can be attributed to several factors, primarily related to how the respective data structures are intended to be used, their performance implications, and the design ph...
24,965
[ { "from": "human", "value": "Always was interested why are Array.Sort() and Array.IndexOf() methods made static and similar ArrayList.Sort() and ArrayList.IndexOf() are designed as member methods. Thank you for any ideas.\n" }, { "from": "gpt", "value": "The design choices for the `Array.Sort()`...
So what I'm looking for is a javascript framework I can use that has several UI controls. I have taken a look at jQuery but those controls are very basic compared to ExtJS. Are there any other competitive alternatives? This question exists because it has historical significance, but it is not considered a good, on-top...
If you're looking for a JavaScript framework with a rich set of UI controls similar to ExtJS, there are several modern alternatives you can consider. Here are some popular frameworks and libraries that provide robust UI components: 1. **React with Component Libraries**: - **Material-UI**: A popular React UI framewo...
25,417
[ { "from": "human", "value": "So what I'm looking for is a javascript framework I can use that has several UI controls. I have taken a look at jQuery but those controls are very basic compared to ExtJS. Are there any other competitive alternatives?\n\nThis question exists because it has historical significan...
I'm writing a CESetup.dll for a Windows Mobile app. It must be unmanaged, which I have little experience with. So I'm unsure of whether I should free the memory I allocate and how I do it. Here's the function I've written: Uninstall_Init( HWND hwndParent, LPCTSTR pszInstallDir ) { LPTSTR fold...
Yes, you need to deallocate memory that you allocate with `new` in your `Uninstall_Init` function. In your case, since you're using `new` to allocate memory for `folderPath`, you should use `delete[]` to free the memory before the function exits. Failing to free this memory can lead to memory leaks, which can be a conc...
27,396
[ { "from": "human", "value": "I'm writing a CESetup.dll for a Windows Mobile app. It must be unmanaged, which I have little experience with. So I'm unsure of whether I should free the memory I allocate and how I do it.\nHere's the function I've written:\n Uninstall_Init(\n HWND hwndParent,\n ...
In VB6, I have a DTPicker control on a form. (The DTPicker is the calendar date/time selector, included in Microsoft Windows Common Controls-2 6.0, available from the Components dialog.) While there are many properties to affect the colors of the calendar when it's dropped down, there is no property that allows changin...
In VB6, the DTPicker control does not have a built-in property to directly change the color of the text displayed in the control. However, you can achieve this by using Windows API functions to manipulate the control's appearance. Here's an example that demonstrates how to change the text color of a DTPicker control b...
23,506
[ { "from": "human", "value": "In VB6, I have a DTPicker control on a form. (The DTPicker is the calendar date/time selector, included in Microsoft Windows Common Controls-2 6.0, available from the Components dialog.)\nWhile there are many properties to affect the colors of the calendar when it's dropped down...
Is there a PHP module that you can use to programmatically read a torrent to find out information about it, Seeders for instance?
Yes, there are several PHP libraries and modules that can help you read torrent files programmatically and extract information such as seeders, leechers, and other metadata. Some of the most popular options include: 1. **PHP-Bencode**: This is a simple library to parse and encode bencoded data (the format used in torr...
25,612
[ { "from": "human", "value": "Is there a PHP module that you can use to programmatically read a torrent to find out information about it, Seeders for instance?\n" }, { "from": "gpt", "value": "Yes, there are several PHP libraries and modules that can help you read torrent files programmatically a...
Checking the HTML source of a question I see for instance: <a id="comments-link-xxxxx" class="comments-link">add comment</a><noscript>&nbsp;JavaScript is needed to access comments.</noscript> And then in the javascript source: // Setup our click events.. $().ready(function() { $("a[id^='comments-link-']")....
Dynamically binding click events with JavaScript, as seen in your example, offers several advantages over declaring event handlers directly in the HTML. Here are some key benefits of this approach: 1. **Separation of Concerns**: By keeping JavaScript separate from HTML, the code becomes cleaner and more maintainable. ...
26,705
[ { "from": "human", "value": "Checking the HTML source of a question I see for instance:\n<a id=\"comments-link-xxxxx\" class=\"comments-link\">add comment</a><noscript>&nbsp;JavaScript is needed to access comments.</noscript>\n\nAnd then in the javascript source:\n// Setup our click events..\n$().ready(func...
I am working on the admin section of a new rails app and i'm trying to setup some routes to do things "properly". I have the following controller: class Admin::BlogsController < ApplicationController def index @blogs = Blog.find(:all) end def show @blog = Blog.find(params[:id]) end ... end in route...
The issue you're encountering is due to how you're trying to create the link for deleting a blog in your `index.html.erb` view file. The `admin_blog` method is not correctly defined because it is supposed to be `admin_blog_path` instead. In Rails, when using routing helpers, you need to specify whether you want to use...
27,315
[ { "from": "human", "value": "I am working on the admin section of a new rails app and i'm trying to setup some routes to do things \"properly\". I have the following controller:\nclass Admin::BlogsController < ApplicationController\n def index\n @blogs = Blog.find(:all)\n end\n\n def show\n @blog =...
I've got a file whose format I'm altering via a python script. I have several camel cased strings in this file where I just want to insert a single space before the capital letter - so "WordWordWord" becomes "Word Word Word". My limited regex experience just stalled out on me - can someone think of a decent regex to d...
You can achieve this easily using the `re` module in Python. A regular expression can be used to find occurrences of uppercase letters that are preceded by lowercase letters and insert a space before them. Here’s how you can do it with regex: ```python import re def insert_spaces(camel_case_string): # Use regex t...
25,956
[ { "from": "human", "value": "I've got a file whose format I'm altering via a python script. I have several camel cased strings in this file where I just want to insert a single space before the capital letter - so \"WordWordWord\" becomes \"Word Word Word\".\nMy limited regex experience just stalled out on...
I have to make a newsletter sending utility application which will collect the list of subscriber from our central database and send out the newsletter. I've considered the possibility to be blacklisted due to flooding if I just flush out all emails at once, so I decided to go on a desktop-based softwer which will emai...
When developing a newsletter sending utility application, it’s crucial to consider best practices to avoid being blacklisted or flagged for spam. While there's no hard-and-fast rule universally applicable to all email service providers (ESPs), here are some guidelines that can help you navigate the sending limits: ###...
24,559
[ { "from": "human", "value": "I have to make a newsletter sending utility application which will collect the list of subscriber from our central database and send out the newsletter. I've considered the possibility to be blacklisted due to flooding if I just flush out all emails at once, so I decided to go o...
How can I setup a default value to a property defined as follow: public int MyProperty { get; set; } That is using "prop" [tab][tab] in VS2008 (code snippet). Is it possible without falling back in the "old way"?: private int myProperty = 0; // default value public int MyProperty { get { return myProperty; } s...
In C#, properties defined using the shorthand `prop` snippet (like in Visual Studio) automatically create a backing field for you, and you cannot directly specify a default value for such properties in the same declaration. However, you can set a default value for an auto-implemented property by initializing the proper...
27,126
[ { "from": "human", "value": "How can I setup a default value to a property defined as follow:\npublic int MyProperty { get; set; }\n\nThat is using \"prop\" [tab][tab] in VS2008 (code snippet).\nIs it possible without falling back in the \"old way\"?:\nprivate int myProperty = 0; // default value\npublic in...
I'm pretty sure most of us are familiar with the concept of a project's requirements changing after it starts, this becomes more and more of an issue the less the client knows about how things work and the closer you work with them. How then can I design a system (specifically a website but general advice will probably...
Designing a system that can accommodate changes in requirements over time is a common challenge in software development. Here are some strategies and best practices that can help you build a more flexible and adaptable website: ### 1. **Modular Design**: - **Component-Based Architecture**: Break your website into r...
22,852
[ { "from": "human", "value": "I'm pretty sure most of us are familiar with the concept of a project's requirements changing after it starts, this becomes more and more of an issue the less the client knows about how things work and the closer you work with them.\nHow then can I design a system (specifically ...
I have a WPF app that makes use of a Winforms User Control that I have created using C++/CLI. When my app goes to parse the XAML for my main window, it throws an exception. The information appears to be somewhat abbreviated, but it says: A first chance exception of type 'System.Windows.Markup.XamlParseException' occurr...
The issue you're encountering appears to be related to the interop between your WPF application and the WinForms User Control you've created in C++/CLI. The error message you provided indicates that there is a problem with the loading of the DLL, specifically an "is not a valid Win32 application" message, which suggest...
24,087
[ { "from": "human", "value": "I have a WPF app that makes use of a Winforms User Control that I have created using C++/CLI. When my app goes to parse the XAML for my main window, it throws an exception. The information appears to be somewhat abbreviated, but it says:\nA first chance exception of type 'System...
In traditional Waterfall, requirements were gathered - typically in a MS-Word document - following an esoteric template. In a "strict" waterfall model, this document is frozen after the requirement phase and a Change Control / Change Management process is responsible for introducing controlled changes. (**) [Typically...
Your project of rewriting a legacy VB 6.0 application into an ASP.Net application presents an interesting opportunity to apply Agile principles, especially in light of your constraints around requirements and scope. Here are some thoughts on how to approach this project while maintaining agility: ### Understand the Co...
24,581
[ { "from": "human", "value": "In traditional Waterfall, requirements were gathered - typically in a MS-Word document - following an esoteric template. In a \"strict\" waterfall model, this document is frozen after the requirement phase and a Change Control / Change Management process is responsible for intr...
This is a very simple question with a simple answer, but it is not quite so simple to find the answer on the internet. I have a simple Setup (deployment) project in Visual Studio 2008, and I have the EULA text. What do I need to do in the project to get the EULA into the install wizard?
To include a EULA (End User License Agreement) in your Setup project in Visual Studio 2008, follow these steps: 1. **Open Your Setup Project:** Open your Visual Studio 2008 solution and select your Setup project. 2. **Open the Properties Window:** Right-click on the Setup project in the Solution Explorer and se...
28,808
[ { "from": "human", "value": "This is a very simple question with a simple answer, but it is not quite so simple to find the answer on the internet.\nI have a simple Setup (deployment) project in Visual Studio 2008, and I have the EULA text. What do I need to do in the project to get the EULA into the insta...
I am trying to retrieve an image stored in an oracle blob and place it in a new System.Drawing.Image instance. I know I can write the stream to a temp.bmp file on the disk and read it from there but thats just not l33t enough for me. How do I convert the blob object directly to an image?
You can retrieve an image stored in an Oracle BLOB and convert it directly into a `System.Drawing.Image` instance without writing it to disk by using a `MemoryStream`. Here’s how you can do it: 1. Retrieve the BLOB data from the database. 2. Use a `MemoryStream` to read the byte array from the BLOB. 3. Create an `Imag...
24,876
[ { "from": "human", "value": "I am trying to retrieve an image stored in an oracle blob and place it in a new System.Drawing.Image instance. I know I can write the stream to a temp.bmp file on the disk and read it from there but thats just not l33t enough for me. How do I convert the blob object directly to...
The MSDN page on ConnectionState enumeration says "This value is reserved for future versions of the product", for all values except Open and Closed. What does that mean? Are other values even used? However from this StackOverflow answer appears that ConnectionState.Broken is also used.
The `ConnectionState` enumeration is used in ADO.NET to represent the various states of a database connection. The states typically include: - **Closed**: The connection is closed. - **Open**: The connection is open. - **Broken**: The connection is broken, typically indicating that the connection to the data source ha...
28,876
[ { "from": "human", "value": "The MSDN page on ConnectionState enumeration says \"This value is reserved for future versions of the product\", for all values except Open and Closed. What does that mean? Are other values even used?\nHowever from this StackOverflow answer appears that ConnectionState.Broken is...
We are using Linq To SQL with our own data context logic that executes the one linq query across multiple databases. When we get the results back, we need the database for each of the rows. So... I want to have a property on my class that will return the database name (SQL Server, so DB_NAME()). How can I do this in...
If you want to execute a LINQ to SQL query across multiple databases and retrieve the database name for each row without creating views or modifying the database schema, there are a few approaches you can consider. However, keep in mind that LINQ to SQL doesn't natively support querying across multiple databases direct...
23,336
[ { "from": "human", "value": "We are using Linq To SQL with our own data context logic that executes the one linq query across multiple databases. When we get the results back, we need the database for each of the rows. So...\nI want to have a property on my class that will return the database name (SQL Se...
Like the title says, the error I get is the following: An invalid '/' or '\' was found in the Path parameter for the MapPath method. I'm using ASP classic and basically trying to access a folder on one of our servers. I Googled around and judging from what most people say, I should take off the \ prefix from my server...
In Classic ASP, the `Server.MapPath` method is used to convert a virtual path to a physical path on the server's file system. However, it cannot be used directly with UNC paths (e.g., `\\servername\sharename`). Instead, you need to use the physical path directly without the `Server.MapPath` method when working with net...
28,137
[ { "from": "human", "value": "Like the title says, the error I get is the following:\nAn invalid '/' or '\\' was found in the Path parameter for the MapPath method.\n\nI'm using ASP classic and basically trying to access a folder on one of our servers. I Googled around and judging from what most people say, ...
Autocompletion in the Visual Studio HTML editor inserts double quotes (e.g. <input type="text"). Does anyone know if there's a setting that will change the default to automatically insert single quotes (e.g. <input type='text')? thanks, Michael
In Visual Studio, there is no built-in setting that allows you to change the default behavior of the HTML editor to use single quotes instead of double quotes for attribute values. The HTML standard suggests using double quotes for attributes, which is why the editor defaults to this format. However, you can manually ...
29,772
[ { "from": "human", "value": "Autocompletion in the Visual Studio HTML editor inserts double quotes (e.g. <input type=\"text\").\nDoes anyone know if there's a setting that will change the default to automatically insert single quotes (e.g. <input type='text')? \nthanks, \nMichael \n" }, { "from": ...
I have a .NET UserControl (FFX 3.5). This control contains several child Controls - a Panel, a couple Labels, a couple TextBoxes, and yet another custom Control. I want to handle a right click anywhere on the base Control - so a right click on any child control (or child of a child in the case of the Panel). I'd lik...
To handle right-click events for all child controls in your UserControl, including controls like Labels that do not generate MouseClick events, you can set up a recursive event handler that subscribes to the `MouseDown` event (or `MouseUp`) for all child controls. This approach will ensure that you capture right-clicks...
25,129
[ { "from": "human", "value": "I have a .NET UserControl (FFX 3.5). This control contains several child Controls - a Panel, a couple Labels, a couple TextBoxes, and yet another custom Control. I want to handle a right click anywhere on the base Control - so a right click on any child control (or child of a ...
Is there any utility that will copy the "official" build of a windows forms app from a central network share and launch it (from a client desktop)? I want to make sure users get the latest version when I update the binaries on the central network share. ClickOnce is user un-friendly so I'm looking for something else......
If you're looking for a method to copy and launch the latest version of a Windows Forms application from a central network share, you can use a combination of scripting and task scheduling. Here are a few approaches that you could consider: ### 1. Batch Script with Scheduled Task You can create a simple batch script ...
22,635
[ { "from": "human", "value": "Is there any utility that will copy the \"official\" build of a windows forms app from a central network share and launch it (from a client desktop)? I want to make sure users get the latest version when I update the binaries on the central network share.\nClickOnce is user un-f...
Curious what is recognized as a solid algorithm/approach for judging the strength of a directed acyclic graph - particularly the strength of certain nodes. The main question I have about this can be boiled down to the following two graphs: (if graph doesn't show up, click here or visit this link: http://www.flickr.co...
To evaluate the "strength" of nodes in a Directed Acyclic Graph (DAG), it’s important to define the notion of strength more formally. From your description, it seems you are interested in a measure that reflects how resilient a node is to the removal of connections, particularly in terms of its reachability or influenc...
20,842
[ { "from": "human", "value": "Curious what is recognized as a solid algorithm/approach for judging the strength of a directed acyclic graph - particularly the strength of certain nodes. The main question I have about this can be boiled down to the following two graphs:\n (if graph doesn't show up, click her...
Does anyone know how to scan an image with X++?
In Microsoft Dynamics AX, X++ does not directly support image scanning as it typically interacts with the hardware through high-level abstractions rather than low-level device interactions. However, you can achieve image scanning through a few different approaches. Here are some general strategies: ### 1. Using Extern...
23,717
[ { "from": "human", "value": "Does anyone know how to scan an image with X++?\n" }, { "from": "gpt", "value": "In Microsoft Dynamics AX, X++ does not directly support image scanning as it typically interacts with the hardware through high-level abstractions rather than low-level device interactio...
I learned about Microsoft BizSpark the other day and started the sign up process. Has anyone else heard about it or had success with it?
Yes, many entrepreneurs and startups have heard of Microsoft BizSpark, which was a program designed to provide resources to early-stage startups. It offered access to Microsoft tools, cloud services, technical support, and various networking opportunities to help entrepreneurs grow their businesses. Participants could ...
29,986
[ { "from": "human", "value": "I learned about Microsoft BizSpark the other day and started the sign up process. Has anyone else heard about it or had success with it?\n" }, { "from": "gpt", "value": "Yes, many entrepreneurs and startups have heard of Microsoft BizSpark, which was a program desig...
I have to create a site definition for a client that must contain pre-defined web part pages. I can create the web part pages but am at a loss when it comes to attaching them to the site on creation. I know web part pages created through SharePoint are stored in a Document Library. Do I need to pre-populate a "Web Part...
Creating a site definition in SharePoint that includes pre-defined web part pages is a multi-step process. Below is a comprehensive guide to help you achieve this: ### Step-by-Step Guide 1. **Create the Web Part Pages:** - Create the necessary `.aspx` web part pages in SharePoint Designer or Visual Studio. - Sa...
23,551
[ { "from": "human", "value": "I have to create a site definition for a client that must contain pre-defined web part pages. I can create the web part pages but am at a loss when it comes to attaching them to the site on creation.\nI know web part pages created through SharePoint are stored in a Document Libr...
I am using CGContextShowText to display text, but when rotating it using CGAffineTransformation, the rotation axis is located at the left, not at the center of the drawn text, the code I am using is this: CGContextSaveGState(context); CGContextSelectFont(context, "Helvetica", 20, kCGEncodingMacRoman); CGContextSetChar...
When you want to rotate text around its center in Core Graphics, you need to perform the rotation transformation after saving the graphics state, translating the context to the point where you want to draw the text, applying the rotation, and then translating it back. In your current code, you're applying the rotatio...
25,972
[ { "from": "human", "value": "I am using CGContextShowText to display text, but when rotating it using CGAffineTransformation, the rotation axis is located at the left, not at the center of the drawn text, the code I am using is this:\nCGContextSaveGState(context);\n\nCGContextSelectFont(context, \"Helvetica...
I need to be able to determine if a part of an image (outside of predetermined crop marks) contains any image content. Is there a way with ImageMagick (specifically the php interface) to do this? Scenario: The canvas is 8.5x11 with .5 in margins on the top, left, and bottom edges and a 1 in margin on the right edge. T...
Yes, you can use ImageMagick's PHP interface to determine if there is any image content outside of your predetermined crop marks. In your case, you'll want to create a bounding box for the valid content area based on the margins you provided, and then check the pixels outside of that bounding box to see if any of them ...
22,682
[ { "from": "human", "value": "I need to be able to determine if a part of an image (outside of predetermined crop marks) contains any image content.\nIs there a way with ImageMagick (specifically the php interface) to do this?\nScenario:\nThe canvas is 8.5x11 with .5 in margins on the top, left, and bottom ...
I think there is a wealth of natural language data associated with sites like reddit or digg or news.google.com. I have done a little bit of research with text mining, but can't find how I could use those tools to parse something like reddit. What kind of applications can you come up with?
There are numerous applications you can develop using natural language processing (NLP) and text mining techniques on data from sites like Reddit, Digg, or Google News. Here are some potential applications: 1. **Sentiment Analysis**: - Analyze user comments or posts to gauge public sentiment on various topics, prod...
25,834
[ { "from": "human", "value": "I think there is a wealth of natural language data associated with sites like reddit or digg or news.google.com.\nI have done a little bit of research with text mining, but can't find how I could use those tools to parse something like reddit.\nWhat kind of applications can you ...
I'm trying to get the start element and the end element of a selection and the offset of the selection in each, i do this in firefox as follows: var delselection = window.getSelection(); var startOffset = delselection.anchorOffset; var endOffset = delselection.focusOffset; var startNode = delselection.anchorNode.par...
In Internet Explorer 6, handling text selections is a bit different than in more modern browsers like Firefox. IE uses the `document.selection` object to work with selections. Here’s how you can get the start and end elements of a selection, along with their respective offsets: ```javascript function getSelectionInfo(...
24,213
[ { "from": "human", "value": "I'm trying to get the start element and the end element of a selection and the offset of the selection in each, i do this in firefox as follows:\nvar delselection = window.getSelection();\n\nvar startOffset = delselection.anchorOffset;\n\nvar endOffset = delselection.focusOffset...
In MySQL, how do I get a list of all foreign key constraints pointing to a particular table? a particular column? This is the same thing as this Oracle question, but for MySQL.
In MySQL, you can retrieve information about foreign key constraints that reference a particular table or column using the information schema. The `information_schema` database provides metadata about all databases, tables, and their relationships. ### To find all foreign key constraints pointing to a particular table...
26,774
[ { "from": "human", "value": "In MySQL, how do I get a list of all foreign key constraints pointing to a particular table? a particular column? This is the same thing as this Oracle question, but for MySQL.\n" }, { "from": "gpt", "value": "In MySQL, you can retrieve information about foreign key ...
I am using Visual Studio 2005 to make an install. The application has a dependency on a DLL that was built with MFC 7.1 (from Visual Studio 2003). Are there merge modules for MFC 7.1 or other redistributables like there are for MFC 8? Where could they be found?
Visual Studio 2005 does not provide merge modules for MFC 7.1, as it primarily supports its own version of MFC (MFC 8.0) introduced with Visual Studio 2005. However, if you need to deploy an application that depends on MFC 7.1 (from Visual Studio 2003), you have a few options: 1. **Use the Redistributable Package**: I...
24,607
[ { "from": "human", "value": "I am using Visual Studio 2005 to make an install. The application has a dependency on a DLL that was built with MFC 7.1 (from Visual Studio 2003).\nAre there merge modules for MFC 7.1 or other redistributables like there are for MFC 8? Where could they be found?\n" }, { ...
I'm using CSS Filters to modify images on the fly within the browser. These work perfectly in Internet Explorer, but aren't supported in Firefox. Does anyone know what the CSS Filter equivalent for these is for Firefox? An answer that would work cross browser (Safari, WebKit, Firefox, etc.) would be preferred. <style t...
CSS Filters are indeed supported across modern browsers, including Firefox, Safari, and Chrome, although the specific filters you've mentioned (like `Invert`, `Xray`, `Gray`, and `FlipV`) are not standard CSS filters. Instead, you'll want to use the standard `filter` property with valid filter functions. Here's how yo...
23,606
[ { "from": "human", "value": "I'm using CSS Filters to modify images on the fly within the browser. These work perfectly in Internet Explorer, but aren't supported in Firefox.\nDoes anyone know what the CSS Filter equivalent for these is for Firefox? An answer that would work cross browser (Safari, WebKit, F...
The issue is there is a database with around 20k customer records and I want to make a best effort to avoid duplicate entries. The database is Microsoft SQL Server 2005, the application that maintains that database is Microsoft Dynamics/SL. I am creating an ASP.NET webservice that interacts with that database. My se...
To address the issue of duplicate customer records in your Microsoft SQL Server 2005 database, you can implement a multi-faceted approach to identify potential duplicates before inserting new records. Here’s how you can go about it: ### 1. Define Duplicate Criteria First, determine the criteria that would classify rec...
21,835
[ { "from": "human", "value": "The issue is there is a database with around 20k customer records and I want to make a best effort to avoid duplicate entries. The database is Microsoft SQL Server 2005, the application that maintains that database is Microsoft Dynamics/SL. I am creating an ASP.NET webservice ...
I need a cross platform solution for clearing the console in both Linux and Windows written in C++. Are there any functions in doing this? Also make note that I don't want the end-user programmer to have to change any code in my program to get it to clear for Windows vs Linux (for example if it has to pick between two ...
To create a cross-platform solution for clearing the console in C++, you can use preprocessor directives to determine the platform at compile-time. This way, the end-user programmer doesn't need to change any code, and your program will automatically choose the appropriate function for either Windows or Linux. Here is...
22,503
[ { "from": "human", "value": "I need a cross platform solution for clearing the console in both Linux and Windows written in C++. Are there any functions in doing this? Also make note that I don't want the end-user programmer to have to change any code in my program to get it to clear for Windows vs Linux (f...
I have noticed that regardless of a given script's execution time, every date() call will return the same timestamp regardless of where the function is called within the script. It looks like it just returns the time at which the script first started executing. For logging purposes, it would be extremely useful to be a...
The behavior you're observing with the `date()` function returning the same timestamp throughout the execution of your script is indeed expected. The `date()` function uses the current Unix timestamp, but if you're calling it at a time close to when the script starts, it can often seem like it always returns the same t...
24,625
[ { "from": "human", "value": "I have noticed that regardless of a given script's execution time, every date() call will return the same timestamp regardless of where the function is called within the script. It looks like it just returns the time at which the script first started executing.\nFor logging purp...
I'm using a WPF MediaElement to render HD video in an application. When the size of the MediaElement gets over about 300 units square the video stutters and the computer is nearly totally unresponsive. I need to render the video full screen. Has anybody had success rendering fullscreen video using the WPF MediaElemen...
Rendering HD video in a WPF application can sometimes present performance challenges, especially when using the `MediaElement`. Here are a few considerations and suggestions that might help improve performance and ensure that fullscreen video playback is smooth: ### Performance Considerations 1. **Graphics Hardware**...
24,386
[ { "from": "human", "value": "I'm using a WPF MediaElement to render HD video in an application. When the size of the MediaElement gets over about 300 units square the video stutters and the computer is nearly totally unresponsive. I need to render the video full screen.\nHas anybody had success rendering ...
How can I quickly create a large file on a Linux (Red Hat Linux) system? dd will do the job, but reading from /dev/zero and writing to the drive can take a long time when you need a file several hundreds of GBs in size for testing... If you need to do that repeatedly, the time really adds up. I don't care about the con...
If you need to quickly create a large file that allocates disk space without having to write all zeroes (or other contents) to it, you can use the `fallocate` command. This command is specifically designed to manipulate file space on filesystems that support it (like ext4, xfs, etc.), and it can allocate space quickly....
29,245
[ { "from": "human", "value": "How can I quickly create a large file on a Linux (Red Hat Linux) system?\ndd will do the job, but reading from /dev/zero and writing to the drive can take a long time when you need a file several hundreds of GBs in size for testing... If you need to do that repeatedly, the time ...
Wondering if it would ever be useful to index every possible state of an application using some reference keys... Meaning, say we have a program that starts, has only so many possible outcomes, say 8. but if each outcome is attained through stepping through many more logic states, and in between each branch is consider...
Your idea of indexing every possible state of an application, particularly for scenarios with a finite number of outcomes, is intriguing and has some parallels in various fields, particularly in computer science, simulations, and game development. Here’s a breakdown of the concept along with its potential benefits and ...
22,540
[ { "from": "human", "value": "Wondering if it would ever be useful to index every possible state of an application using some reference keys...\nMeaning, say we have a program that starts, has only so many possible outcomes, say 8.\nbut if each outcome is attained through stepping through many more logic sta...
What's the difference between JavaScript and Java?
JavaScript and Java are two distinct programming languages, each with its own characteristics, syntax, and usage. Here are some key differences: 1. **Origin and Purpose**: - **JavaScript**: Developed by Netscape in the mid-1990s, JavaScript was originally designed for web browsers to make web pages interactive. It ...
25,534
[ { "from": "human", "value": "What's the difference between JavaScript and Java?\n" }, { "from": "gpt", "value": "JavaScript and Java are two distinct programming languages, each with its own characteristics, syntax, and usage. Here are some key differences:\n\n1. **Origin and Purpose**:\n - **...
I'm wondering if PHP has this optimization built in. Normally when you call foreach without using a reference it copies the passed array and operates on it. What happens if the reference count to that array is only 1? Say for example if getData returns some array of data. foreach(getData() as $data) echo $data; ...
PHP does have some optimizations regarding how it handles arrays, particularly with reference counting, but it doesn't necessarily optimize every scenario as you might expect. When you call `foreach` on an array returned by a function, such as `getData()`, PHP evaluates how to handle that array based on its reference ...
24,745
[ { "from": "human", "value": "I'm wondering if PHP has this optimization built in. Normally when you call foreach without using a reference it copies the passed array and operates on it. What happens if the reference count to that array is only 1?\nSay for example if getData returns some array of data.\nfo...
A legacy backend requires the email body with a .tif document, no tif and it fails. So i need to generate a blank .tif, is there a fast way to do this with ghostscript? edit: make once in project installation use when i need it.
Yes, you can use Ghostscript to create a blank TIFF file easily. Ghostscript is a versatile tool for processing and converting various file formats, including image formats like TIFF. Below are the steps to create a blank TIFF file once during project installation, which you can reuse when needed. ### Step 1: Install ...
22,427
[ { "from": "human", "value": "A legacy backend requires the email body with a .tif document, no tif and it fails. So i need to generate a blank .tif, is there a fast way to do this with ghostscript? \n\nedit: make once in project installation use when i need it.\n" }, { "from": "gpt", "value": "Y...
It seems that there has been a recent rising interest in STM (software transactional memory) frameworks and language extensions. Clojure in particular has an excellent implementation which uses MVCC (multi-version concurrency control) rather than a rolling commit log. GHC Haskell also has an extremely elegant STM mon...
Software Transactional Memory (STM) has indeed garnered interest in both academic and practical contexts due to its ability to simplify concurrent programming. While it's still a relatively niche area compared to more mainstream concurrency models like actors, there are instances where STM has been effectively utilized...
21,856
[ { "from": "human", "value": "It seems that there has been a recent rising interest in STM (software transactional memory) frameworks and language extensions. Clojure in particular has an excellent implementation which uses MVCC (multi-version concurrency control) rather than a rolling commit log. GHC Hask...
I have a user account 'member center' that shows all of a customer's subscriptions and memberships that they have with my company. This is at https://secure.1.example/membercenter/. I have another site which is the actual member site. This is at http://www.2.example/. ( each site on a different domain, though it is the...
Your approach to allowing users to log into a membership site from another domain while avoiding the direct exposure of usernames and passwords is creative, but there are some important security considerations and potential vulnerabilities in your current design: 1. **Hash Collision**: Although MD5 is not suitable for...
22,455
[ { "from": "human", "value": "I have a user account 'member center' that shows all of a customer's subscriptions and memberships that they have with my company. This is at https://secure.1.example/membercenter/.\nI have another site which is the actual member site. This is at http://www.2.example/. ( each si...
I provide a web service to my organisation. i was wondering would anyone recommeding the use of apache cactus for setting up a testing framework or has anyone worked with any other web service frameworks that may be useful? Thanks Damien
Apache Cactus was a popular framework for testing server-side Java code, especially for web applications. However, it's important to note that Cactus has not been actively maintained for several years, and there are now more modern and widely adopted alternatives available for testing web services. Here are some recom...
27,805
[ { "from": "human", "value": "I provide a web service to my organisation. i was wondering would anyone recommeding the use of apache cactus for setting up a testing framework or has anyone worked with any other web service frameworks that may be useful?\nThanks\nDamien\n" }, { "from": "gpt", "val...
When is memory allocated in the .NET compact framework? If there is a difference between value and reference types, please detail. Documentation or steps to confirm are appreciated. In particular, consider this scenario... private MyClass item; // here? public void MyMethod() { item = new MyClass(); // or here? ...
In the .NET Compact Framework, memory allocation occurs at different times depending on whether you're dealing with value types or reference types. Let's clarify the distinction and then apply it to your provided code. ### Memory Allocation in .NET 1. **Value Types**: - Value types (like `int`, `float`, `struct`,...
25,082
[ { "from": "human", "value": "When is memory allocated in the .NET compact framework? If there is a difference between value and reference types, please detail. Documentation or steps to confirm are appreciated.\nIn particular, consider this scenario...\nprivate MyClass item; // here?\n\npublic void MyMetho...
It seems like Microsoft had a great idea with the ObservableCollection. They are great for binding, and are super fast on the UI. However, requiring a context switch to the Dispatcher Thread every time you want to tweak it seems like a bit much. Does anyone know the best practices for using them? Is it simply to pop...
You're correct that `ObservableCollection<T>` is a powerful tool for data binding in WPF (Windows Presentation Foundation) applications. It automatically notifies the UI of any changes (like adding or removing items), which makes it an ideal choice for scenarios where the collection will be modified dynamically. Howev...
25,556
[ { "from": "human", "value": "It seems like Microsoft had a great idea with the ObservableCollection. They are great for binding, and are super fast on the UI.\nHowever, requiring a context switch to the Dispatcher Thread every time you want to tweak it seems like a bit much. Does anyone know the best prac...
How do you fix a names mismatch problem, if the client-side names are keywords or reserved words in the server-side language you are using? The DOJO JavaScript toolkit has a QueryReadStore class that you can subclass to submit REST patterned queries to the server. I'm using this in conjunction w/ the FilteringSelect Di...
When facing a names mismatch problem due to reserved keywords or identifiers in your server-side language (PL/SQL in your case), you can implement several strategies to address the issue. Below are some potential solutions and workarounds that you can use to handle the "start" and "count" parameters from the Dojo Query...
23,451
[ { "from": "human", "value": "How do you fix a names mismatch problem, if the client-side names are keywords or reserved words in the server-side language you are using?\nThe DOJO JavaScript toolkit has a QueryReadStore class that you can subclass to submit REST patterned queries to the server. I'm using thi...
I am writing a batch file script using Windows command and want to change each occurrence of some blank space with "," What is the simplest way to do that?
To replace each occurrence of blank spaces with a comma (`,`) in a batch file script on Windows, you can use a simple `for` loop along with string manipulation. Here's a basic example that demonstrates how to achieve this. ### Batch File Script Create a batch file (e.g., `replace_spaces.bat`) with the following code:...
25,628
[ { "from": "human", "value": "I am writing a batch file script using Windows command and want to change each occurrence of some blank space with \",\" What is the simplest way to do that? \n" }, { "from": "gpt", "value": "To replace each occurrence of blank spaces with a comma (`,`) in a batch f...
I want to iterate through a contacts properties and add those that contain the word "Number" to a list with the value, i tries using reflection but it doesn't work. using System; using System.Collections; using System.Collections.Generic; using System.Reflection; using Microsoft.Office.Interop.Outlook; namespace Dupli...
It looks like you're trying to use reflection to iterate through the properties of a `ContactItem` in the Microsoft Office Interop library for Outlook and filter out the properties that contain the word "Number". However, there are a couple of issues with the code that need to be addressed: 1. The use of `info.Value` ...
26,374
[ { "from": "human", "value": "I want to iterate through a contacts properties and add those that contain the word \"Number\" to a list with the value, i tries using reflection but it doesn't work.\nusing System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Reflection;\nusing Mi...
What is the best practice for storing keys, and or passwords for a website. These keys are for various 3rd party web services. Is it best to have them in the Web.config file, or in the database, or encrypted somehow?
Storing keys and passwords securely is critical for maintaining the security and integrity of your web applications. Here are best practices for storing API keys, passwords, and other sensitive information for a website: ### 1. **Environment Variables** - **Description**: Store sensitive information in environment var...
24,279
[ { "from": "human", "value": "What is the best practice for storing keys, and or passwords for a website. These keys are for various 3rd party web services. Is it best to have them in the Web.config file, or in the database, or encrypted somehow? \n" }, { "from": "gpt", "value": "Storing keys an...
(define (square x) (display (* x x))) (define (sum-of-squares a b) (+ (square a) (square b))) I tested it, and the sum-of-squares function does not work. Why?
The issue with your `sum-of-squares` function is that the `square` function is defined to display the result of its computation using the `display` function, but it does not return any value. In Scheme, when a function only uses `display` and doesn't return a value, the return value of that function is unspecified (it ...
29,592
[ { "from": "human", "value": "(define (square x)\n (display (* x x)))\n\n(define (sum-of-squares a b) \n (+ (square a) (square b))) \n\nI tested it, and the sum-of-squares function does not work. Why?\n" }, { "from": "gpt", "value": "The issue with your `sum-of-squares` function is that the `sq...
I have a solution with other 70 projects into it. My question is : How can I know where the project is used? I do not want to open all those 70 projects to verify the References one by one. How can I see which project use one project in particular? Edit I do not want to do 1 by 1 search in XML or in the Reference in VS...
If you want to quickly identify where a specific project is referenced across multiple projects in a solution, you can use several approaches depending on the tools you have available. Here are a few methods that may help: ### 1. **Use Visual Studio's "Find in Files" Feature** Visual Studio has a built-in search funct...
22,583
[ { "from": "human", "value": "I have a solution with other 70 projects into it. My question is : How can I know where the project is used? I do not want to open all those 70 projects to verify the References one by one. How can I see which project use one project in particular?\nEdit\nI do not want to do 1 b...
I have a list of changes to a list - Adds and Deletes. The list could be huge - say 10'000 items. I want to know the state of the list after change 9'000. I could walk the list from the start all the way to change 9'000. That seems a bit long-winded to me. I could keep a list of items and record when they're added and...
To efficiently track the state of your list after a certain number of add/delete operations (in this case, memory allocations and deallocations), you can use an approach that leverages data structures to optimize both space and access time. Here are some strategies that can be effective: ### 1. Use a Stack or List for...
23,061
[ { "from": "human", "value": "I have a list of changes to a list - Adds and Deletes. The list could be huge - say 10'000 items.\nI want to know the state of the list after change 9'000.\nI could walk the list from the start all the way to change 9'000. That seems a bit long-winded to me.\nI could keep a lis...
I'd like to ensure my RAII class is always allocated on the stack. How do I prevent a class from being allocated via the 'new' operator?
In C++, you can prevent a class from being allocated on the heap by deleting the `new` operator and the `new[]` operator. This means that the class cannot be instantiated using `new`, ensuring that objects of this class must be allocated on the stack. Here’s how you can do this: ```cpp class RAII { public: // Con...
21,716
[ { "from": "human", "value": "I'd like to ensure my RAII class is always allocated on the stack.\nHow do I prevent a class from being allocated via the 'new' operator?\n" }, { "from": "gpt", "value": "In C++, you can prevent a class from being allocated on the heap by deleting the `new` operator ...
I am having dependency troubles. I have two classes: Graphic and Image. Each one has its own .cpp and .h files. I am declaring them as the following: Graphic.h: #include "Image.h" class Image; class Graphic { ... }; Image.h: #include "Graphic.h" class Graphic; class Image : p...
The issue you're encountering is due to the circular dependency between the `Graphic` and `Image` classes. Both classes are trying to reference each other in a way that leads to incomplete type errors. To fix this, you need to ensure that each class has a complete definition before it's used. The common approach to re...
27,252
[ { "from": "human", "value": "I am having dependency troubles. I have two classes: Graphic and Image. Each one has its own .cpp and .h files. I am declaring them as the following: \nGraphic.h: \n\n #include \"Image.h\"\n class Image;\n class Graphic {\n ...\n };\n\nImage.h:\n\n #incl...
I am looking for a solution or recommendation to a problem I am having. I have a bunch of ASPX pages that will be localized and have a bunch of text that needs to be supported in 6 languages. The people doing the translation will not have access to Visual Studio and the likely easiest tool is Excel. If we use Excel o...
To streamline the localization process for your ASPX pages using Excel or CSV while easily managing .resx files, you can follow a structured approach that involves exporting to and importing from a format that's compatible with .resx files. Here's a recommended method: ### Steps to Manage .resx Localization with Excel...
22,982
[ { "from": "human", "value": "I am looking for a solution or recommendation to a problem I am having. I have a bunch of ASPX pages that will be localized and have a bunch of text that needs to be supported in 6 languages.\nThe people doing the translation will not have access to Visual Studio and the likely...
I was watching Rob Connerys webcasts on the MVCStoreFront App, and I noticed he was unit testing even the most mundane things, things like: public Decimal DiscountPrice { get { return this.Price - this.Discount; } } Would have a test like: [TestMethod] public void Test_DiscountPrice { Product p = n...
Your concerns about Test-Driven Development (TDD) and unit testing are common, especially in environments where specifications may not be reliable or well-defined. However, there are several points worth considering that highlight the value of TDD and unit testing, even in the face of these challenges. ### 1. **Specif...
25,258
[ { "from": "human", "value": "I was watching Rob Connerys webcasts on the MVCStoreFront App, and I noticed he was unit testing even the most mundane things, things like:\npublic Decimal DiscountPrice\n{\n get\n {\n return this.Price - this.Discount;\n }\n}\n\nWould have a test like:\n[TestMethod]...
Say I have a third party Application that does background work, but prints out all errors and messages to the console. This means, that currently, we have to keep a user logged on to the server, and restart the application (double-click) every time we reboot. Not so very cool. I was kind of sure, that there was an easy...
If you want to create a simple Windows service to run your third-party application in the background and capture stdout and stderr into a log file, you can indeed do it with Python using the `pywin32` package. This allows you to create a service that will run your batch file. Here’s a basic example of how you could ac...
23,547
[ { "from": "human", "value": "Say I have a third party Application that does background work, but prints out all errors and messages to the console. This means, that currently, we have to keep a user logged on to the server, and restart the application (double-click) every time we reboot.\nNot so very cool.\...
I created a simple .NET windows application in Visual Studio 2005 and on just entering the main form load event my threads window is as in the following image: http://img519.imageshack.us/my.php?image=threadshh4.jpg My questions are 1)Why are there so many threads in the first place when I haven't started any(apart fro...
Certainly! Let's address each of your questions about the threads in your .NET Windows application: 1. **Why are there so many threads in the first place when I haven't started any (apart from my application's 'Main Thread')?** When you run a .NET application, the Common Language Runtime (CLR) initializes several ...
24,443
[ { "from": "human", "value": "I created a simple .NET windows application in Visual Studio 2005 and on just entering the main form load event my threads window is as in the following image:\nhttp://img519.imageshack.us/my.php?image=threadshh4.jpg\nMy questions are\n1)Why are there so many threads in the firs...
If I had some XML such as this loaded into an XDocument object: <Root> <GroupA> <Item attrib1="aaa" attrib2="000" /> </GroupA> <GroupB> <Item attrib1="bbb" attrib2="111" /> <Item attrib1="ccc" attrib2="222" /> <Item attrib1="ddd" attrib2="333" /> </GroupB> <GroupC> ...
To retrieve the names of the group nodes from your XML structure using LINQ to XML, you can use the `XDocument` class along with a LINQ query. Here's an example of how you can achieve that: ```csharp using System; using System.Linq; using System.Xml.Linq; class Program { static void Main() { // Load t...
20,726
[ { "from": "human", "value": "If I had some XML such as this loaded into an XDocument object:\n<Root>\n <GroupA>\n <Item attrib1=\"aaa\" attrib2=\"000\" />\n </GroupA>\n <GroupB>\n <Item attrib1=\"bbb\" attrib2=\"111\" />\n <Item attrib1=\"ccc\" attrib2=\"222\" />\n <Item...
I have a ListView containing file names. These file names need to be draggable to a TreeView, which is a drag/drop inside the application and works with the built in drag/drop support of Delphi - no problem. But I must also be able to drag/drop the ListView items to another application, e.g. Windows Explorer. This also...
To achieve the functionality you want in Delphi, you can combine the standard drag-and-drop functionality of the VCL with the Windows API to handle dragging files to external applications like Windows Explorer. Here's a broad outline of how you can implement this: 1. **Handle Mouse Events for Dragging**: You will ne...
21,734
[ { "from": "human", "value": "I have a ListView containing file names. These file names need to be draggable to a TreeView, which is a drag/drop inside the application and works with the built in drag/drop support of Delphi - no problem. But I must also be able to drag/drop the ListView items to another appl...
I'm working on a database in SQL Server 2000 that uses a GUID for each user that uses the app it's tied to. Somehow, two users ended up with the same GUID. I know that microsoft uses an algorithm to generate a random GUID that has an extremely low chance of causing collisons, but is a collision still possible?
Yes, while the probability of a collision when generating GUIDs (Globally Unique Identifiers) is extremely low, it is not entirely impossible. GUIDs in SQL Server are typically generated using the `NEWID()` function, which creates a GUID based on a combination of the MAC address, the current timestamp, and a random com...
28,445
[ { "from": "human", "value": "I'm working on a database in SQL Server 2000 that uses a GUID for each user that uses the app it's tied to. Somehow, two users ended up with the same GUID. I know that microsoft uses an algorithm to generate a random GUID that has an extremely low chance of causing collisons, bu...
Is there a way to display the headerText of the Grid View vertically? http://img371.imageshack.us/img371/4813/testyk6.jpg I hope the above link works Thanks
To display the header text of a GridView vertically in a web application, you can use CSS to rotate the text. Here’s a general approach you can take to achieve this in an ASP.NET GridView: ### Step 1: Define the GridView in ASP.NET Here’s a simple example of how to define a GridView in your ASP.NET code: ```html <as...
23,831
[ { "from": "human", "value": "Is there a way to display the headerText of the Grid View vertically?\nhttp://img371.imageshack.us/img371/4813/testyk6.jpg\nI hope the above link works\nThanks\n" }, { "from": "gpt", "value": "To display the header text of a GridView vertically in a web application, ...
If you want to some code to execute based on two or more conditions which is the best way to format that if statement ? first example:- if(ConditionOne && ConditionTwo && ConditionThree) { Code to execute } Second example:- if(ConditionOne) { if(ConditionTwo ) { if(ConditionThree) { Code to e...
When it comes to readability and maintainability in code, especially when dealing with multiple conditions, the first example is generally the preferred choice. Here's a breakdown of why this is often considered easier to understand and read: ### First Example ```cpp if (ConditionOne && ConditionTwo && ConditionThree...
27,012
[ { "from": "human", "value": "If you want to some code to execute based on two or more conditions which is the best way to format that if statement ?\nfirst example:-\nif(ConditionOne && ConditionTwo && ConditionThree)\n{\n Code to execute\n}\n\nSecond example:-\nif(ConditionOne)\n{\n if(ConditionTwo )\n...