instruction
stringlengths
14
27.6k
completion
stringlengths
3
38.3k
__original_row_idx
int64
0
50k
conversations
listlengths
2
2
Possible Duplicate: Standard way to detect mobile browsers in a web application based on the http request I have 3 mobile versions of a website and would like to present each to different handset models according to what they support. One version is monochromatic WML, another is color WML and another is XHTML for mo...
To identify the device and serve the appropriate version of your website based on device capabilities, you can follow these steps: ### 1. **User Agent Detection**: Most mobile browsers send a User-Agent string that includes information about the device and its capabilities. You can analyze this string to determine whi...
41,142
[ { "from": "human", "value": "\nPossible Duplicate:\nStandard way to detect mobile browsers in a web application based on the http request \n\nI have 3 mobile versions of a website and would like to present each to different handset models according to what they support. One version is monochromatic WML, ano...
I'm working with some schema which defines an abstract complex type, eg. <xs:complexType name="MyComplexType" abstract="true"> This type is then referenced by another complex type in the schema: <xs:complexType name="AnotherType"> <xs:sequence> <xs:element name="Data" type="MyComplexType" maxOccurs="unbounded"/>...
The error you're encountering when trying to generate code from your XML schema (XSD) is due to the fact that `xsd.exe` cannot instantiate abstract complex types. In your schema, `MyComplexType` is declared as abstract, which means it cannot be directly instantiated or used in the way you are attempting in `AnotherType...
38,300
[ { "from": "human", "value": "I'm working with some schema which defines an abstract complex type, eg.\n<xs:complexType name=\"MyComplexType\" abstract=\"true\">\n\nThis type is then referenced by another complex type in the schema:\n<xs:complexType name=\"AnotherType\">\n <xs:sequence>\n <xs:element nam...
I'm looking for a small and fast library implementing an HTTP server in .NET My general requirements are: Supports multiple simultaneous connections Only needs to support static content (no server side processing) HTTP only, HTTPS not needed Preferably be able to serve a page from an in memory source. I want to integr...
For your requirements, a few lightweight and simple HTTP server libraries in .NET could fit your needs. Here are some recommendations: ### 1. **HttpListener (Built-in)** While not a library per se, the `HttpListener` class in .NET can serve static content and can be used to host simple HTTP servers quite easily. You ...
38,299
[ { "from": "human", "value": "I'm looking for a small and fast library implementing an HTTP server in .NET\nMy general requirements are:\n\nSupports multiple simultaneous connections\nOnly needs to support static content (no server side processing)\nHTTP only, HTTPS not needed\nPreferably be able to serve a ...
For example I want to add two expressions e1 and e2 toString (Plus e1 e)= ?? I am guessing it would be something like toString (Plus e1 e)= ((toString e1) ++ "+" ++ (toString e2))
Your approach is close, but there’s a small mistake in the variable you’re using in the `toString` function for the second expression. If you're adding `e1` and `e2`, then you should be using `e2` in the output string. Here’s how you can define the `toString` function for the `Plus` expression correctly: ```haskell to...
42,129
[ { "from": "human", "value": "For example I want to add two expressions e1 and e2\ntoString (Plus e1 e)= ??\n\nI am guessing it would be something like \ntoString (Plus e1 e)= ((toString e1) ++ \"+\" ++ (toString e2))\n\n" }, { "from": "gpt", "value": "Your approach is close, but there’s a small ...
I want to set up an ASP.NET custom control such that it has a custom name, specifically, with a hyphen within it, so it might look like this in markup: <rp:do-something runat="server" id="doSomething1" /> I don't mind if this syntax requires setting up a tag mapping in web.config or something to that effect, but the ta...
Creating an ASP.NET custom control with a hyphen in its name can be challenging because the standard ASP.NET syntax for custom controls does not support hyphens in the names. However, you can achieve a similar effect by using a workaround with a custom tag prefix and a mapping in the `web.config` file. Here’s how to s...
39,956
[ { "from": "human", "value": "I want to set up an ASP.NET custom control such that it has a custom name, specifically, with a hyphen within it, so it might look like this in markup:\n<rp:do-something runat=\"server\" id=\"doSomething1\" />\nI don't mind if this syntax requires setting up a tag mapping in web...
I am working on a form, which I would like to validation features like This. Should this all be done on clientside? or server side? I am aware of using some of MS ajax controld, however, at what point do I display the message at the top? I hope I explained myself.
When implementing form validation, it's essential to consider both client-side and server-side validation. Each serves a different purpose and can enhance user experience and security. ### Client-side Validation: - **Purpose**: To provide immediate feedback to users, enhance user experience, and reduce unnecessary ser...
38,580
[ { "from": "human", "value": "I am working on a form, which I would like to validation features like This. Should this all be done on clientside? or server side? I am aware of using some of MS ajax controld, however, at what point do I display the message at the top?\nI hope I explained myself.\n" }, { ...
I have a very simple html. The red div is inside the blue div and has a 10 px top margin. On non-ie browsers, the blue box is 10 px apart from the top of viewport and the red div is at the very top of the blue div. What I expect is the ie behavior: red div must be 10 px apart from the top of the blue div. Why does non-...
The behavior you're observing is a result of the box model and margin collapsing in CSS. ### Explanation of Behavior: 1. **Margin Collapsing**: In CSS, when vertical margins of block-level elements meet (like in your case with the `.inner` and `.outer` divs), the larger margin takes effect, and the smaller one colla...
40,893
[ { "from": "human", "value": "I have a very simple html. The red div is inside the blue div and has a 10 px top margin. On non-ie browsers, the blue box is 10 px apart from the top of viewport and the red div is at the very top of the blue div. What I expect is the ie behavior: red div must be 10 px apart fr...
Many web sites support folksonomy tags. You may have heard of rel-tag, where it says that "The last path component of the URL is the text of the tag". I am looking for a bookmarklet or greasemonkey script (javascript) to get the "last path component" for the URL currently being viewed in the browser, add that tag into...
Certainly! Below is a simple Greasemonkey script that retrieves the last path component of the current URL, formats it into a tag, and then opens a new URL with that tag. ### Greasemonkey Script 1. **Install Greasemonkey**: First, make sure you have the Greasemonkey extension installed in your browser. 2. **Create a ...
39,221
[ { "from": "human", "value": "Many web sites support folksonomy tags. You may have heard of rel-tag, where it says that \"The last path component of the URL is the text of the tag\".\nI am looking for a bookmarklet or greasemonkey script (javascript) to get the \"last path component\" for the URL currently ...
I'm having a bit of a problem with converting the result of a MySQL query to a Java class when using SUM. When performing a simple SUM in MySQL SELECT SUM(price) FROM cakes WHERE ingredient = 'chocolate'; with price being an integer, it appears that the SUM sometimes returns a string and sometimes an integer, dependin...
To handle the variability in data types returned by a MySQL `SUM` function in a Java application, particularly when using JDBC, you can follow a few strategies to ensure that you consistently receive a predictable data type. ### 1. Use a CAST in Your Query One way to ensure that the result type is always the same is ...
37,929
[ { "from": "human", "value": "I'm having a bit of a problem with converting the result of a MySQL query to a Java class when using SUM.\nWhen performing a simple SUM in MySQL\nSELECT SUM(price) FROM cakes WHERE ingredient = 'chocolate';\n\nwith price being an integer, it appears that the SUM sometimes return...
I've been reading up on branching/merging with Subversion 1.5 using the excellent and free Version Control with Subversion book. I think that I understand how to use the Subversion command line client to perform the actions that I need most often, which are: Update Branch with Changes from Trunk From the branch's work...
You're correct in your observations regarding TortoiseSVN and the corresponding Subversion command-line operations. Here's a breakdown of how to use TortoiseSVN 1.5 for the operations you're interested in: ### Merging Changes from the Trunk to a Branch To merge changes from the trunk to a branch in TortoiseSVN, follo...
39,180
[ { "from": "human", "value": "I've been reading up on branching/merging with Subversion 1.5 using the excellent and free Version Control with Subversion book. I think that I understand how to use the Subversion command line client to perform the actions that I need most often, which are:\nUpdate Branch with...
I want to add a file type extension to the Open Dialog of Excel (2003, 2007 if possible, 2007 only, if necessary). When the user opens my type of file (i.e. myfile.myx), I want my application to read the file and paste the file into Excel in my own defined manner (by using Interop)
To add a custom file type extension to the Open dialog in Excel (specifically for Excel 2003 and 2007), and handle the opening of a file with your application, you can follow these general steps. The approach involves two main components: 1. **Registry Modification**: You will need to update the Windows Registry to as...
35,778
[ { "from": "human", "value": "I want to add a file type extension to the Open Dialog of Excel (2003, 2007 if possible, 2007 only, if necessary).\nWhen the user opens my type of file (i.e. myfile.myx), I want my application to read the file and paste the file into Excel in my own defined manner (by using Inte...
I have checked in a huge Eclipse project from my desktop computer to the SVN server. I did it using the command line. However, by mistake I committed all the compiled classes also in the server. For every plug-in, there is a directory /bin/ that contains the compiled classes. Is there a way to quickly delete in the s...
Yes, you can delete the `bin` directories from your SVN repository using the command line. You will need to use the `svn delete` command. Below is a general approach to help you with both tasks: ### 1. Delete `/bin/` Directories from SVN To delete all `bin` directories from your SVN repository, follow these steps: 1...
39,577
[ { "from": "human", "value": "I have checked in a huge Eclipse project from my desktop computer to the SVN server. I did it using the command line. However, by mistake I committed all the compiled classes also in the server.\nFor every plug-in, there is a directory /bin/ that contains the compiled classes....
I'm looking for the BEST asp.net calendar/schedule component that it out there. I like the look of google calendar, and it absolutely needs to be a native .net component, which can be customized. I don't mind if it is part of a bigger framework (like telerik, for example). Links to samples would be great.
When searching for a high-quality ASP.NET calendar or scheduling component that closely resembles Google Calendar and is customizable, there are several excellent options to consider. Below are some of the best components, along with links to samples and documentation. ### 1. **Telerik UI for ASP.NET Core / ASP.NET AJ...
39,363
[ { "from": "human", "value": "I'm looking for the BEST asp.net calendar/schedule component that it out there.\nI like the look of google calendar, and it absolutely needs to be a native .net component, which can be customized.\nI don't mind if it is part of a bigger framework (like telerik, for example).\nLi...
I know there is a similar problem on this forum, but the solutions did not really work for me. I am populating form controls with fields from a few different data sources, and the data shows up great. I have an ImageButton control, which has an OnClick Event set to grab all of the data from the form. Unfortunately, w...
It sounds like you're experiencing a common issue related to the ASP.NET page lifecycle and how controls interact with data binding. When you populate form controls with data from a data source, you need to ensure that this binding occurs at the correct time in the page lifecycle. Here's a breakdown of what you might w...
39,691
[ { "from": "human", "value": "I know there is a similar problem on this forum, but the solutions did not really work for me. I am populating form controls with fields from a few different data sources, and the data shows up great.\nI have an ImageButton control, which has an OnClick Event set to grab all of...
I want to parse an Apache access.log file with a python program in a certain way, and though I am completely new to object-oriented programming, I want to start doing it now. I am going to create a class ApacheAccessLog, and the only thing I can imagine now, it will be doing is 'readline' method. Is it conventionally c...
It's great that you want to start using object-oriented programming (OOP) with Python! Creating a class to handle Apache access logs is a practical use case. Inheriting from the built-in file class (`io.TextIOWrapper`, in Python 3, which is the actual type for files opened in text mode) is one way to approach this, b...
34,863
[ { "from": "human", "value": "I want to parse an Apache access.log file with a python program in a certain way, and though I am completely new to object-oriented programming, I want to start doing it now.\nI am going to create a class ApacheAccessLog, and the only thing I can imagine now, it will be doing is...
I have a stored procedure that needs to convert hexadecimal numbers to their decimal equivalent. I've read the documentation for the UNHEX() function, but it is returning a binary value. What I'm wanting to do is something like this: CREATE PROCEDURE foo( hex_val VARCHAR(10) ) BEGIN DECLARE dec_val INTEGER; ...
In MySQL, the `UNHEX()` function converts a hexadecimal string into a binary string, but it doesn't directly convert it to a decimal integer. To convert a hexadecimal number to its decimal equivalent, you'll need to use the `CONV()` function, which can convert numbers between different bases. Here's how you can modify...
43,319
[ { "from": "human", "value": "I have a stored procedure that needs to convert hexadecimal numbers to their decimal equivalent. I've read the documentation for the UNHEX() function, but it is returning a binary value. What I'm wanting to do is something like this:\nCREATE PROCEDURE foo( hex_val VARCHAR(10) ...
There are enough books on how to do unit testing. Do you know any good books (or other good resources) on integration testing? What I am particularly interested in is Define scope (unit testing < integration testing < automated func. testing What is a good and bad integration test Data access Service layers Configur...
Integration testing is indeed a critical part of the software testing lifecycle, and while there are many resources on unit testing, it's essential to have good materials that focus specifically on integration testing. Here are some recommended books and resources that cover various aspects of integration testing, incl...
37,270
[ { "from": "human", "value": "There are enough books on how to do unit testing.\nDo you know any good books (or other good resources) on integration testing?\nWhat I am particularly interested in is\n\nDefine scope (unit testing < integration testing < automated func. testing \nWhat is a good and bad integr...
I have two Django projects and applications running on the same Apache installation. Both projects and both applications have the same name, for example myproject.myapplication. They are each in separately named directories so it looks like .../dir1/myproject/myapplication and .../dir2/myproject/myapplication. Eve...
The issue you’re encountering with Django's admin interface is due to the fact that both projects have the same session cookie name. By default, Django uses a session cookie with the name `sessionid` for user sessions. When you log into one admin site, it sets a session cookie with that name. When you switch to the oth...
42,607
[ { "from": "human", "value": "I have two Django projects and applications running on the same Apache installation. Both projects and both applications have the same name, for example myproject.myapplication. They are each in separately named directories so it looks like .../dir1/myproject/myapplication and...
I'm writing an ASP.NET webforms app, and I'm using jQuery for my AJAX calls. This is working well, but on some occasions, the $.getJSON call is causing a full page postback. I am not using the ASP.NET AJAX library anywhere in the app. I can't reproduce the problem on a consistent basis, and am not sure what is causing ...
The issue you're experiencing with your `$.getJSON` call causing full page postbacks in an ASP.NET Web Forms application is a bit unusual, but it can happen under certain conditions. Here are several suggestions and considerations to help troubleshoot and resolve this issue: ### 1. Prevent Default Behavior If the `ge...
32,657
[ { "from": "human", "value": "I'm writing an ASP.NET webforms app, and I'm using jQuery for my AJAX calls. This is working well, but on some occasions, the $.getJSON call is causing a full page postback. I am not using the ASP.NET AJAX library anywhere in the app. I can't reproduce the problem on a consisten...
Is it possible to change java lookandfeel without modifying the program in a real-world environment? I know that theoretically the answer is yes. I also created demo applications and changed the lookandfeel even at runtime and it worked. But when I created a real application with lots of controls lookandfeel change was...
Your experience highlights a common challenge when working with Java Swing applications and their Look and Feel (L&F) systems. Although changing the L&F of a Swing application should theoretically be straightforward, in practice, it can often lead to various issues as you described. Below are some insights and strategi...
39,764
[ { "from": "human", "value": "Is it possible to change java lookandfeel without modifying the program in a real-world environment?\nI know that theoretically the answer is yes. I also created demo applications and changed the lookandfeel even at runtime and it worked. But when I created a real application wi...
Joomla has a built-in function on its login screen "I've forgotten my user name", so that you can type in your email address and the username is sent to you via email. I was thinking of changing it so that the username was displayed on screen immediately, without any form of authentication. This would greatly reduce th...
Changing the behavior of the "I've forgotten my username" feature in Joomla (or any content management system) to display usernames directly on screen without any form of authentication presents several security risks and considerations: ### Security Risks: 1. **Username Enumeration**: Allowing users to see usernames...
36,794
[ { "from": "human", "value": "Joomla has a built-in function on its login screen \"I've forgotten my user name\", so that you can type in your email address and the username is sent to you via email.\nI was thinking of changing it so that the username was displayed on screen immediately, without any form of ...
I have a system which sits on a web server and generates files on the fly in response to HTTP requests. This is currently implemented as an HTTPHandler. Once the files are generated, they don't change very often, so I'd like to implement a cache. Ideally, I'd like the web server to look at the cache folder and serve th...
To achieve your goal of caching generated files and handling "file not found" requests in a lightweight manner, you can consider using a combination of HTTP features and server configuration options. Below is a general approach that can be adapted based on the web server technology you are using (e.g., IIS, Apache, Ngi...
37,304
[ { "from": "human", "value": "I have a system which sits on a web server and generates files on the fly in response to HTTP requests. This is currently implemented as an HTTPHandler.\nOnce the files are generated, they don't change very often, so I'd like to implement a cache.\nIdeally, I'd like the web serv...
When interviewing for a programming position, did you ever get an answer to your question that you didn't quite expect? The answer could've been quite smart that you didn't even know or it could've been a dumbest answer you never expected. I'm expecting technical type of questions but anything interesting is fine.
As an AI, I don't have personal experiences, but I can share some interesting examples of unexpected answers that candidates might give during programming interviews. 1. **Overly Simplistic Answers:** A candidate might respond to a complex algorithm question with a very basic solution, such as suggesting a brute-force...
39,356
[ { "from": "human", "value": "When interviewing for a programming position, did you ever get an answer to your question that you didn't quite expect? The answer could've been quite smart that you didn't even know or it could've been a dumbest answer you never expected. I'm expecting technical type of questio...
I'm in the process of setting up a php project, but am not very familiar with how to properly use php's include/require commands. My layout currently looks like this: /public --apache points into this directory /public/index.php /public/blah/page.php /utils/util1.php -- useful classes/code are stored in ...
Your understanding of PHP's `include` and `require` commands and the behavior of relative paths is correct. The issue arises because each file uses its own current working directory to resolve paths, leading to the confusion you're experiencing. Using `dirname(__FILE__)` or `__DIR__` (if you're using PHP 5.3 or later)...
40,477
[ { "from": "human", "value": "I'm in the process of setting up a php project, but am not very familiar with how to properly use php's include/require commands. My layout currently looks like this:\n/public --apache points into this directory \n/public/index.php \n/public/blah/page.php \n/utils/util1.ph...
I need the perfect algorithm or C# function to calculate the difference (distance) between 2 decimal numbers. For example the difference between: 100 and 25 is 75 100 and -25 is 125 -100 and -115 is 15 -500 and 100 is 600 Is there a C# function or a very elegant algorithm to calculate this or I have to go and handle ev...
To calculate the absolute difference between two decimal numbers in C#, you can use the `Math.Abs` method, which is designed to return the absolute value of a given number. This means you don't need to handle each case separately with if statements. Here's a simple and elegant C# function that calculates the differenc...
43,778
[ { "from": "human", "value": "I need the perfect algorithm or C# function to calculate the difference (distance) between 2 decimal numbers.\nFor example the difference between:\n100 and 25 is 75\n100 and -25 is 125\n-100 and -115 is 15\n-500 and 100 is 600\nIs there a C# function or a very elegant algorithm ...
I'm having a problem with a administrative app I'm working on. I'm build an interface for stopping, starting and querying various services across 40 or so servers. I'm looking at service.controller and have been successful in stopping and starting various services with button events but now I'm trying to figure out ...
It sounds like you're on the right track with your administrative app! To return the service status to a text box and implement a polling mechanism to query for service status every 10 seconds, you can follow these steps. I'll assume you're using a programming language like C# with Windows Forms, but the general princi...
35,055
[ { "from": "human", "value": "I'm having a problem with a administrative app I'm working on. I'm build an interface for stopping, starting and querying various services across 40 or so servers. \nI'm looking at service.controller and have been successful in stopping and starting various services with butto...
I want to do something like select * from tvfHello(@param) where @param in (Select ID from Users)
It looks like you're trying to use a table-valued function (TVF) in a SQL query while filtering the results based on a list of user IDs. However, the syntax you provided has an issue because you cannot use a parameter directly in the `WHERE` clause like that when calling the TVF. In SQL, you typically would need to ei...
40,152
[ { "from": "human", "value": "I want to do something like\nselect * from tvfHello(@param) where @param in (Select ID from Users)\n\n" }, { "from": "gpt", "value": "It looks like you're trying to use a table-valued function (TVF) in a SQL query while filtering the results based on a list of user I...
I know that OpenCV was ported to Mac OS X, however I did not find any info about a port to the iPhone. I am not a Mac developer, so that I do not know whether a Mac OS X port is enough for the iPhone. Does anyone know better than me?
Yes, OpenCV can be used on iOS devices, including the iPhone. While OpenCV has a port for macOS, using it directly on iOS requires some additional considerations because iOS has a different architecture and set of APIs compared to macOS. Here’s how you can get started with OpenCV on iOS: 1. **OpenCV for iOS**: OpenCV...
41,361
[ { "from": "human", "value": "I know that OpenCV was ported to Mac OS X, however I did not find any info about a port to the iPhone.\nI am not a Mac developer, so that I do not know whether a Mac OS X port is enough for the iPhone.\nDoes anyone know better than me? \n" }, { "from": "gpt", "value...
We are building an enterprise application in which we will incorporate multiple platforms for user interfaces (i.e. ASP.net webapp, Windows Application, and someday, Mobile Apps) and multiple platforms for back-end databases (i.e. SQL Server, XML, Oracle). An additional neccesity is that these back-end DBs either be c...
Building a flexible enterprise application that can support multiple user interface (UI) and back-end database (DB) platforms requires a robust architecture that emphasizes abstraction, modularity, and configuration management. Here are some guidelines to help you achieve this: ### 1. Architecture Pattern Consider imp...
24,117
[ { "from": "human", "value": "We are building an enterprise application in which we will incorporate multiple platforms for user interfaces (i.e. ASP.net webapp, Windows Application, and someday, Mobile Apps) and multiple platforms for back-end databases (i.e. SQL Server, XML, Oracle). An additional neccesi...
Suppose to have a code like this: <div class="notSelected"> <label>Name <input type="text" name="name" id="name" /> </label> <div class="description"> Tell us what's your name to make us able to fake to be your friend when sending you an email. </div> </div> Now ...
You can achieve the desired functionality using plain JavaScript or a framework like jQuery. However, if you're open to using MooTools, I'll provide a solution using both vanilla JavaScript and jQuery, which is widely used and straightforward. ### Using Vanilla JavaScript Here’s how you can implement the functionalit...
33,965
[ { "from": "human", "value": "Suppose to have a code like this:\n<div class=\"notSelected\">\n <label>Name\n <input type=\"text\" name=\"name\" id=\"name\" />\n </label> \n <div class=\"description\">\n Tell us what's your name to make us able to fake to be your friend \n ...
I'm having quite a bit of pain inserting and deleting UITableViewCells from the same UITableView! I don't normally post code, but I thought this was the best way of showing where I'm having the problem: - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 5; } - (NSInteger)tableView:(UITabl...
From your description and the provided code, it looks like the issue might stem from how you are managing the rows in your UITableView and the data source. Specifically, there are a few things to note and adjust: 1. **Understanding the Number of Rows**: Your `numberOfRowsInSection` method indicates that there will alw...
39,127
[ { "from": "human", "value": "I'm having quite a bit of pain inserting and deleting UITableViewCells from the same UITableView!\nI don't normally post code, but I thought this was the best way of showing where I'm having the problem:\n\n- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {\n ...
Given numbers like 499, 73433, 2348 what VBA can I use to round to the nearest 5 or 10? or an arbitrary number? By 5: 499 -> 500 2348 -> 2350 7343 -> 7345 By 10: 499 -> 500 2348 -> 2350 7343 -> 7340 etc.
You can create a simple VBA function to round numbers to the nearest specified multiple (like 5, 10, or any arbitrary number). Below is an example of how to achieve this in Excel VBA. ### VBA Code Here's how to create the function: 1. Open Excel. 2. Press `ALT + F11` to open the VBA editor. 3. Go to `Insert > Module...
40,746
[ { "from": "human", "value": "Given numbers like 499, 73433, 2348 what VBA can I use to round to the nearest 5 or 10? or an arbitrary number?\nBy 5:\n 499 -> 500\n2348 -> 2350\n7343 -> 7345\n\nBy 10:\n 499 -> 500\n2348 -> 2350\n7343 -> 7340\n\netc.\n" }, { "from": "gpt", "value": "You can creat...
So with ruby being ushered in as the new programming messiah, I'm wondering if anyone has preferences based upon ease of use, resources needed to run, usability and ease of customization. is there a better of the two?
When considering Ruby and other programming languages or frameworks, the choice often depends on the specific use case and your personal preferences. Ruby, particularly with the Ruby on Rails framework, has garnered a lot of attention for its simplicity and productivity in web development. Here’s a breakdown based on t...
39,404
[ { "from": "human", "value": "So with ruby being ushered in as the new programming messiah, I'm wondering if anyone has preferences based upon ease of use, resources needed to run, usability and ease of customization.\nis there a better of the two?\n" }, { "from": "gpt", "value": "When considerin...
My colleague here argues that new programmers must learn ASP first, before they learn ASP.Net. I seem to agree with him as most new programmers who start with ASP.Net do not understand web get, post and state management :( Which is best to learn web programming Classic ASP or ASP.Net?
The debate between learning Classic ASP and ASP.NET for new programmers often centers on the relevance, ease of learning, and the technologies' capabilities in modern web development. ### Classic ASP: 1. **Historical Context**: Classic ASP (Active Server Pages) was released in 1996 and is a server-side scripting envir...
40,936
[ { "from": "human", "value": "My colleague here argues that new programmers must learn ASP first, before they learn ASP.Net. \nI seem to agree with him as most new programmers who start with ASP.Net do not understand web get, post and state management :(\nWhich is best to learn web programming Classic ASP or...
If I just want to know if a domain name is reserved; is it sufficient to use this command and see if any domain name servers turn up, in which case it's reserved? host -t NS example.com It's a lot faster than visiting http://www.internic.net/whois.html and typing example.com to get much more detailed results, which I'...
Using the command `host -t NS example.com` can give you a quick indication of whether a domain is reserved based on the presence of name servers. If you receive a response with name servers listed, it typically means that the domain is indeed registered. However, keep in mind that: 1. Some registered domains might n...
43,550
[ { "from": "human", "value": "If I just want to know if a domain name is reserved; is it sufficient to use this command and see if any domain name servers turn up, in which case it's reserved?\nhost -t NS example.com\n\nIt's a lot faster than visiting http://www.internic.net/whois.html and typing example.com...
Total newbie question but this is driving me mad! I'm trying this: myInt = [myFloat integerValue]; but I get an error saying essentially integerValue doesn't work on floats. How do I do it?
The error you're encountering is likely because `integerValue` is not a method available for `float` types. If you're using Objective-C, you might want to convert a `float` to an `NSInteger` (or `int`). Here's how you can do it: 1. If `myFloat` is a floating-point number (of type `float` or `double`), you can simply c...
42,656
[ { "from": "human", "value": "Total newbie question but this is driving me mad! \nI'm trying this:\nmyInt = [myFloat integerValue]; \n\nbut I get an error saying essentially integerValue doesn't work on floats. \nHow do I do it?\n" }, { "from": "gpt", "value": "The error you're encountering is l...
Does anyone know a good C++ class to read (and possibly also write) INI files on Windows Mobile? Ideally this class sould work on Windows mobile 2003, 5 and 6 and be public domain but other alternatives may be interesting.
For reading and writing INI files in C++ on Windows Mobile, you can consider using the Windows API directly. Windows provides built-in functions for handling INI files through `GetPrivateProfileString`, `WritePrivateProfileString`, and other similar functions. Here’s a simple class example that encapsulates this functi...
41,810
[ { "from": "human", "value": "Does anyone know a good C++ class to read (and possibly also write) INI files on Windows Mobile? Ideally this class sould work on Windows mobile 2003, 5 and 6 and be public domain but other alternatives may be interesting.\n" }, { "from": "gpt", "value": "For reading...
This code is not working on IE8 at all. FF3 is executing but the page is blank and seems loading not ending. My code is: $("#leaderBoard").html("<script2 language=\"javascript2\"> document.write('<scr'+'ipt language=\"javascript21.1\">alert(1)</scri'+'pt>'); </script2>".replace(/script2/gi, "script")); I want to let p...
The code you're trying to execute is using some deprecated features and methods that are not compatible with older browsers like Internet Explorer 8 (IE8). Additionally, the use of `document.write` within dynamically generated `<script>` tags can lead to issues, especially when scripts are being executed in a manner th...
42,000
[ { "from": "human", "value": "This code is not working on IE8 at all. FF3 is executing but the page is blank and seems loading not ending.\nMy code is:\n$(\"#leaderBoard\").html(\"<script2 language=\\\"javascript2\\\"> document.write('<scr'+'ipt language=\\\"javascript21.1\\\">alert(1)</scri'+'pt>'); </scrip...
In C#, I am using a library that defines an enum. I would like to allow consumers of my code (in a different assembly) to pass in an enum value as a parameter to one of my functions without having to reference the underlying library themselves. Is there a way for me to expose the library's enumeration to my consumers?...
Yes, you can expose the underlying enumeration to consumers of your code without requiring them to reference the underlying library directly. This can be achieved by creating your own wrapper enum in your assembly that maps to the values of the library's enum. Here's how you can do it: ### Step 1: Define a Wrapper Enu...
36,405
[ { "from": "human", "value": "In C#, I am using a library that defines an enum. I would like to allow consumers of my code (in a different assembly) to pass in an enum value as a parameter to one of my functions without having to reference the underlying library themselves.\nIs there a way for me to expose ...
How exactly do you make an auto-refreshing div with JavaScript (specifically, jQuery)? I know about the setTimeout method, but is it really a good practice ? Is there a better method? function update() { $.get("response.php", function(data) { $("#some_div").html(data); }); window.setTimeout("update(...
Using `setTimeout` for auto-refreshing content in a `<div>` is a common approach, but it's not the most efficient or cleanest way to achieve this. The reason for this is that `setTimeout` can lead to overlapping calls if the data refresh takes longer than the interval you set, which can create issues, especially if you...
38,346
[ { "from": "human", "value": "How exactly do you make an auto-refreshing div with JavaScript (specifically, jQuery)?\nI know about the setTimeout method, but is it really a good practice ? Is there a better method?\nfunction update() {\n $.get(\"response.php\", function(data) {\n $(\"#some_div\").h...
I'd like to develop a few applications for a device I own which has Windows Mobile 2003 on it, but I don't care to hunt down a copy of Visual Studio 2003 to do so. I'd like to know if the Mobile 6 SDK can be used for this purpose. There's no upgrade path to newer versions of Windows Mobile for this device, and I doubt ...
Developing applications for a device running Windows Mobile 2003 can be a bit challenging, especially since you don't want to use Visual Studio 2003. Unfortunately, the Windows Mobile 6 SDK is not compatible with Windows Mobile 2003. The SDKs are typically version-specific, and the Windows Mobile 6 SDK is designed for ...
42,168
[ { "from": "human", "value": "I'd like to develop a few applications for a device I own which has Windows Mobile 2003 on it, but I don't care to hunt down a copy of Visual Studio 2003 to do so. I'd like to know if the Mobile 6 SDK can be used for this purpose.\nThere's no upgrade path to newer versions of Wi...
I'm using jQuery and wanting to target the nth <li> in a list after clicking the nth link. <ul id="targetedArea"> <li></li> <li></li> <li></li> <li></li> </ul> <div id="clickedItems"> <a></a> <a></a> <a></a> <a></a> </div> I can target them individually, but I know there must be a faster way by passing...
Hi Steve, You can achieve what you're looking for by utilizing the `index()` function to determine the index of the clicked `<a>` element. Then, you can use that index to target the corresponding `<li>` in the `<ul>`. Here's a cleaner way to do it: ```javascript $("#clickedItems a").click(function() { // Get the in...
43,102
[ { "from": "human", "value": "I'm using jQuery and wanting to target the nth <li> in a list after clicking the nth link.\n<ul id=\"targetedArea\">\n <li></li>\n <li></li>\n <li></li>\n <li></li>\n</ul>\n<div id=\"clickedItems\">\n <a></a>\n <a></a>\n <a></a>\n <a></a>\n</div>\n\nI can target them ind...
tldr: Can someone show me how to properly format this Python iMAP example so it works? from https://docs.python.org/2.4/lib/imap4-example.html import getpass, imaplib M = imaplib.IMAP4() M.login(getpass.getuser(), getpass.getpass()) M.select() typ, data = M.search(None, 'ALL') for num in data[0].split(): typ, d...
The code you are trying to use is from an older version of Python (2.4) and is also missing some important aspects required for connecting to an IMAP server, such as the server address and the proper handling of SSL/TLS. Also, you need to provide your email and password directly to the `login` method. Here is a correc...
38,818
[ { "from": "human", "value": "tldr: Can someone show me how to properly format this Python iMAP example so it works?\nfrom \nhttps://docs.python.org/2.4/lib/imap4-example.html\n\nimport getpass, imaplib\n\nM = imaplib.IMAP4()\nM.login(getpass.getuser(), getpass.getpass())\nM.select()\ntyp, data = M.search(N...
I want to use the nltk libraries in c++. Is there a glue language/mechanism I can use to do this? Reason: I havent done any serious programming in c++ for a while and want to revise NLP concepts at the same time. Thanks
To use NLTK (Natural Language Toolkit), which is a Python library, in C++, you would need to utilize some form of interoperability between C++ and Python. Here are a few mechanisms you can consider to bridge the two languages: ### 1. **Python/C++ Integration Using `pybind11`:** `pybind11` is a lightweight header-only ...
39,870
[ { "from": "human", "value": "I want to use the nltk libraries in c++. \nIs there a glue language/mechanism I can use to do this? \nReason:\nI havent done any serious programming in c++ for a while and want to revise NLP concepts at the same time.\nThanks\n" }, { "from": "gpt", "value": "To use ...
It seems like the classical way to handle transactions with JDBC is to set auto-commit to false. This creates a new transaction, and each call to commit marks the beginning the next transactions. On multithreading app, I understand that it is common practice to open a new connection for each thread. I am writing a RMI ...
In a multi-threaded application that involves handling transactions with a relational database via JDBC, managing connections efficiently is crucial for performance and scalability. Here are some considerations and best practices regarding your scenario: ### 1. Connection Management Creating a new database connection...
37,978
[ { "from": "human", "value": "It seems like the classical way to handle transactions with JDBC is to set auto-commit to false. This creates a new transaction, and each call to commit marks the beginning the next transactions.\nOn multithreading app, I understand that it is common practice to open a new conne...
I noticed a number of cases where an application or database stored collections of files/blobs using a has to determine the path and filename. I believe the intended outcome is a situation where the path never gets too deep, or the folders ever get too full - too many files (or folders) in a folder making for slower ac...
The technique you're referring to is often called **hash-based sharding** or **hash-based file storage**, and it's used to efficiently distribute and organize files (or blobs) in a storage system. By generating a path from a hash of the file's identifier (such as a UUID or content hash), the application can create a st...
40,170
[ { "from": "human", "value": "I noticed a number of cases where an application or database stored collections of files/blobs using a has to determine the path and filename. I believe the intended outcome is a situation where the path never gets too deep, or the folders ever get too full - too many files (or ...
Is user-friendliness an important aspect of the quality of software? For example most of the Microsoft products are quite user friendly, but does that necessarily imply that their quality is superior too.
User-friendliness is indeed an important aspect of software quality, but it is not the sole determinant of overall quality. Quality in software encompasses various factors, including: 1. **Usability**: This involves how easy and intuitive the software is for users. A user-friendly interface can significantly enhance u...
41,872
[ { "from": "human", "value": "Is user-friendliness an important aspect of the quality of software? For example most of the Microsoft products are quite user friendly, but does that necessarily imply that their quality is superior too.\n" }, { "from": "gpt", "value": "User-friendliness is indeed a...
Is it okay to run Hibernate applications configured with hbm2ddl.auto=update to update the database schema in a production environment?
Using Hibernate's `hbm2ddl.auto` setting with the value `update` in a production environment is generally not recommended. While this setting allows Hibernate to automatically adjust the database schema to match the current model defined in your application, there are several risks and considerations that make it less ...
43,126
[ { "from": "human", "value": "Is it okay to run Hibernate applications configured with hbm2ddl.auto=update to update the database schema in a production environment?\n" }, { "from": "gpt", "value": "Using Hibernate's `hbm2ddl.auto` setting with the value `update` in a production environment is ge...
Is there any way to decode a PICS Rules File? Contains settings and preferences used by the Windows operating system. The file is given by: Q:F]9y3n5|dp:n4hU)qbs;!&-bzh
A PICS (Platform for Internet Content Selection) Rules File is often used for filtering and controlling access to internet content, and it's not typically associated with Windows operating system settings or preferences. The string you've provided appears to be encoded or encrypted, rather than a standard rules file fo...
42,065
[ { "from": "human", "value": "Is there any way to decode a PICS Rules File?\nContains settings and preferences used by the Windows operating system.\nThe file is given by:\nQ:F]9y3n5|dp:n4hU)qbs;!&-bzh\n" }, { "from": "gpt", "value": "A PICS (Platform for Internet Content Selection) Rules File is...
I'm trying to come up with a reusable JS or jQuery function that would allow me to test if one object is a DOM descendant of another. I've seen a model of testing for $b.parents('nodename').length>0 Which is fantastic when you only need to check if an element is a child of any node by that name. But what about a spe...
To check if one DOM element is a descendant of another specific DOM element using jQuery, you can use the `is()` method combined with a simple selector that utilizes the `:scope` pseudo-class. Here's a reusable function that checks if a specific element is a descendant of another element: ```javascript function isDe...
42,894
[ { "from": "human", "value": "I'm trying to come up with a reusable JS or jQuery function that would allow me to test if one object is a DOM descendant of another. \nI've seen a model of testing for \n$b.parents('nodename').length>0\n\nWhich is fantastic when you only need to check if an element is a child o...
I have been using git for several months in a project developed only by myself. I have a local repository and push it regularly to github for backup purposes. I want to add another developer to this project, however I will have the responsibility of integrating the whole project. What is the recommended workflow? Do w...
To effectively collaborate with another developer in your project while maintaining control over the integration process, you can follow a workflow that emphasizes clarity and control. Here's a recommended approach: ### Recommended Workflow 1. **Single Remote Repository**: Use a single remote repository on GitHub for...
39,251
[ { "from": "human", "value": "I have been using git for several months in a project developed only by myself. I have a local repository and push it regularly to github for backup purposes.\nI want to add another developer to this project, however I will have the responsibility of integrating the whole projec...
I need to have some information about the scoping in JavaScript. I know that it supports lexical (static) scoping, but, does not it support dynamic scoping as well?
JavaScript primarily uses **lexical (static) scoping**, which means that the scope of a variable is determined by its position in the source code and is defined at the time of writing the code. This means that nested functions have access to variables defined in their outer (enclosing) functions, even if those outer fu...
43,533
[ { "from": "human", "value": "I need to have some information about the scoping in JavaScript. I know that it supports lexical (static) scoping, but, does not it support dynamic scoping as well?\n" }, { "from": "gpt", "value": "JavaScript primarily uses **lexical (static) scoping**, which means t...
There is a need from a customer to log every data change to a logging table with the actual user who made the modification. The application is using one SQL user to access the database, but we need to log the "real" user id. We can do this in t-sql by writing triggers for every table insert and update, and using contex...
To achieve logging of data changes along with the real user ID in a SQL Server 2000 environment using Entity Framework (EF), you can follow a multi-step approach that combines context initialization and event handling effectively. Given the limitations of SQL Server 2000, we need to get creative to bridge the gap betwe...
39,503
[ { "from": "human", "value": "There is a need from a customer to log every data change to a logging table with the actual user who made the modification. The application is using one SQL user to access the database, but we need to log the \"real\" user id.\nWe can do this in t-sql by writing triggers for eve...
I am currently working on a JS menu for a web app. It consists of two bars, the fixed main one and the submenu which is activated (display:block from display:none) by Javascript function. The selected options of the main menu as well as the submenu are also highlighted by adding a class="main_on" and class="sub_on" by ...
Yes, you can achieve this by using the `localStorage` feature of the Web Storage API. `localStorage` allows you to store key-value pairs in a web browser, and the data persists even after the browser is closed or the page is refreshed (unlike `sessionStorage`, which only lasts for the duration of the page session). He...
34,883
[ { "from": "human", "value": "I am currently working on a JS menu for a web app. It consists of two bars, the fixed main one and the submenu which is activated (display:block from display:none) by Javascript function. The selected options of the main menu as well as the submenu are also highlighted by adding...
I have a TabControl within a TabControl. I want the outer TabControl to show its tabs on the left. However, with Visual Styles enabled, left-aligned TabControls don't display properly. Can I disable Visual Styles for just the outer TabControl? I'm aware of the third-party TabControl replacements - that's not what I'...
Yes, you can disable Visual Styles for just the outer `TabControl` while still allowing other controls in your application to use Visual Styles. You can do this by calling `Application.EnableVisualStyles()` to enable visual styles for the application as a whole, but then explicitly turning off visual styles for the out...
39,824
[ { "from": "human", "value": "I have a TabControl within a TabControl. I want the outer TabControl to show its tabs on the left. However, with Visual Styles enabled, left-aligned TabControls don't display properly. Can I disable Visual Styles for just the outer TabControl?\nI'm aware of the third-party Ta...
Surely there is some kind of abstraction that allows for this? This is essentially the command cmd = self._ghostscriptPath + 'gswin32c -q -dNOPAUSE -dBATCH -sDEVICE=tiffg4 -r196X204 -sPAPERSIZE=a4 -sOutputFile="' + tifDest + " " + pdfSource + '"' os.popen(cmd) this way looks really dirty to me, there must be s...
Yes, using `os.popen()` to execute commands is often considered less than ideal in Python, as it can lead to security issues (like shell injection) and is generally less readable. Instead, you can use the `subprocess` module, which is more powerful and provides a more flexible way to run external commands. Here’s how ...
41,582
[ { "from": "human", "value": "Surely there is some kind of abstraction that allows for this?\nThis is essentially the command\ncmd = self._ghostscriptPath + 'gswin32c -q -dNOPAUSE -dBATCH -sDEVICE=tiffg4 \n -r196X204 -sPAPERSIZE=a4 -sOutputFile=\"' + tifDest + \" \" + pdfSource + '\"'\n\nos.popen(cmd)\n...
We're doing windows mobile development using the WM6 Professional emulator through visual studio 2008 for now. My question is, can you get the emulator image to simulate having a storage card? We run our SQLCE 3.5 database off the removable storage card in our devices and it'd be slick to just have the emulator simulat...
The Windows Mobile 6 (WM6) emulator in Visual Studio 2008 does not natively support simulating a removable storage card like actual devices do. However, there are a few workarounds you can use to mimic this functionality for development and testing purposes: 1. **Using Emulated Storage**: The emulator has a fixed amou...
41,087
[ { "from": "human", "value": "We're doing windows mobile development using the WM6 Professional emulator through visual studio 2008 for now. My question is, can you get the emulator image to simulate having a storage card? We run our SQLCE 3.5 database off the removable storage card in our devices and it'd b...
i'm wanting to generate a random salt value and put it into the Application state. Now, i'm using a web farm, so the Application state will be different per machine. I don't want to purchase distributed state farm apps, either. So .. what are some solutions for this? I thought i could hard-code it in the code OR the we...
When working with a web farm environment, managing application state consistently across multiple machines can be tricky, especially when you want a unique value such as a salt that remains the same across all instances. Here are a few approaches to consider: ### 1. Use a Configuration Management Tool If you're alread...
40,608
[ { "from": "human", "value": "i'm wanting to generate a random salt value and put it into the Application state.\nNow, i'm using a web farm, so the Application state will be different per machine. I don't want to purchase distributed state farm apps, either.\nSo .. what are some solutions for this? I thought...
I have a GridView populated from an ObjectDataSource with two items in its DataKeyNames field. One is the primary key, ID, the other is a category field (the category field is used to add header rows to delineate categories). Displaying works fine, but I'm trying to create a Delete action. The object's delete method ...
When working with `ObjectDataSource` and `GridView` in ASP.NET, it can be a bit tricky to handle scenarios where you want to pass a specific parameter to your delete method while your `DataKeyNames` contains multiple fields. Fortunately, there is a way to achieve this without having to define an unused parameter in you...
40,050
[ { "from": "human", "value": "I have a GridView populated from an ObjectDataSource with two items in its DataKeyNames field. One is the primary key, ID, the other is a category field (the category field is used to add header rows to delineate categories).\nDisplaying works fine, but I'm trying to create a D...
I am currently stuck on an ASP.NET error when trying to access a .aspx page through localhost. This is the error: OCIEnvCreate failed with return code -1 but error message text was not available. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace ...
The error message "OCIEnvCreate failed with return code -1 but error message text was not available" typically indicates that there is an issue related to the Oracle client library being used by your application. Since you mentioned that you had Oracle 8i Client installed before switching to Oracle 10g Express, there m...
37,752
[ { "from": "human", "value": "I am currently stuck on an ASP.NET error when trying to access a .aspx page through localhost. This is the error:\nOCIEnvCreate failed with return code -1 but error message text was not available.\nDescription: An unhandled exception occurred during the execution of the current ...
I'm using ASP.NET Membership and noticed there isn't a method in the Roles class to modify a role (its name for instance), only to create and delete them. Is it possible or it's not supported? EDIT: @CheGueVerra: Yes, nice workaround. Do you know (for extra credit :) ) why it's not possible?
In ASP.NET Membership, the `Roles` class indeed does not provide a direct method to rename an existing role. This limitation is primarily due to the design of the Membership system itself. Here are a few reasons why this functionality might not be supported directly: 1. **Database Schema Design**: The underlying datab...
40,795
[ { "from": "human", "value": "I'm using ASP.NET Membership and noticed there isn't a method in the Roles class to modify a role (its name for instance), only to create and delete them.\nIs it possible or it's not supported?\nEDIT: @CheGueVerra: Yes, nice workaround. \nDo you know (for extra credit :) ) why i...
Are there any good SUSE help sites?t
Yes, there are several good resources for getting help with SUSE Linux. Here are some recommended sites: 1. **SUSE Official Documentation**: The official documentation is a comprehensive resource for installation, administration, and troubleshooting. You can find it at: - [SUSE Documentation](https://documentation....
40,555
[ { "from": "human", "value": "Are there any good SUSE help sites?t\n" }, { "from": "gpt", "value": "Yes, there are several good resources for getting help with SUSE Linux. Here are some recommended sites:\n\n1. **SUSE Official Documentation**: The official documentation is a comprehensive resourc...
I have a lot of assignments where I have to continually update a Makefile as I add more subsequently numbered C programs. Is there a way to do this with a loop which iterates over the values 1.1, 1.2, 1.3, etc.? all: 1.1 1.2 1.3 1.4 1.5 1.6 1.7. 1.8 1.9 1.1: 1.1.o gcc -o 1.1 $(FLAGS) 1.1.o 1.1.o: 1.1.c gcc -c...
You can simplify your Makefile and make it more maintainable by using pattern rules and a loop to automatically generate the necessary rules for your C programs. Here's an improved version of your Makefile using these techniques: ```makefile FLAGS = -Wall -g # List of all programs to build PROGS = 1.1 1.2 1.3 1.4 1.5...
41,017
[ { "from": "human", "value": "I have a lot of assignments where I have to continually update a Makefile as I add more subsequently numbered C programs. Is there a way to do this with a loop which iterates over the values 1.1, 1.2, 1.3, etc.?\nall: 1.1 1.2 1.3 1.4 1.5 1.6 1.7. 1.8 1.9\n\n1.1: 1.1.o\n gcc ...
I have a function that resembles the one below. I'm not sure how to use the os module to get back to my original working directory at the conclusion of the jar's execution. def run(): owd = os.getcwd() #first change dir to build_dir path os.chdir(testDir) #run jar from test directory os.system(cmd...
Your code appears to be on the right track, but you need to ensure that you are properly using the `os` module to change back to your original working directory after executing the command. Here is a revised version of your function that includes the necessary steps and handles possible exceptions to ensure that the wo...
41,745
[ { "from": "human", "value": "I have a function that resembles the one below. I'm not sure how to use the os module to get back to my original working directory at the conclusion of the jar's execution. \ndef run(): \n owd = os.getcwd()\n #first change dir to build_dir path\n os.chdir(testDir)\n ...
My SQL is rusty -- I have a simple requirement to calculate the sum of the greater of two column values: CREATE TABLE [dbo].[Test] ( column1 int NOT NULL, column2 int NOT NULL ); insert into Test (column1, column2) values (2,3) insert into Test (column1, column2) values (6,3) insert into Test (column1, column...
In SQL Server, to calculate the sum of the greater values between two columns without using the `GREATEST` function (which doesn't exist in SQL Server), you can use a `CASE` statement. Instead of using subqueries and unions, you can achieve this directly in your `SELECT` statement. Here's how you can compute the sum ...
41,240
[ { "from": "human", "value": "My SQL is rusty -- I have a simple requirement to calculate the sum of the greater of two column values:\nCREATE TABLE [dbo].[Test]\n(\n column1 int NOT NULL, \n column2 int NOT NULL\n);\n\ninsert into Test (column1, column2) values (2,3)\ninsert into Test (column1, column...
I have a list of numbers, say {2,4,5,6,7} I have a table, foos, with foos.ID, including say, {1,2,3,4,8,9} Id like to take my list of numbers, and find those without a counterpart in the ID field of my table. One way to achieve this would be to create a table bars, loaded with {2,4,5,6,7} in the ID field. Then, I would...
You can achieve this without creating a temporary table by using a Common Table Expression (CTE) or by using a subquery. Here's how you can do it using both methods: ### Method 1: Using a Common Table Expression (CTE) ```sql WITH bars AS ( SELECT 2 AS ID UNION ALL SELECT 4 UNION ALL SELECT 5 UNION ALL ...
43,198
[ { "from": "human", "value": "I have a list of numbers, say {2,4,5,6,7}\nI have a table, foos, with foos.ID, including say, {1,2,3,4,8,9}\nId like to take my list of numbers, and find those without a counterpart in the ID field of my table.\nOne way to achieve this would be to create a table bars, loaded wit...
I've tried this both with and without the 'ExceptionType' parameter. I have an Error.aspx page in both the Views/Shared folder and the Views/thisController folder. But everytime I run this I get a "Server Error in '/' Application." error page, rather than the nice one in Views/Shared. Any idea what could be going wrong...
It looks like you're trying to use the `[HandleError]` attribute to handle exceptions and display a custom error view in your ASP.NET MVC application. However, there are a few potential reasons why you're encountering the default "Server Error in '/' Application" error page instead of your custom `Error.aspx` page. He...
40,087
[ { "from": "human", "value": "I've tried this both with and without the 'ExceptionType' parameter. I have an Error.aspx page in both the Views/Shared folder and the Views/thisController folder. But everytime I run this I get a \"Server Error in '/' Application.\" error page, rather than the nice one in Views...
for some reason, templatetags do not render in templates for django admin. with this snippet from: http://docs.djangoproject.com/en/dev/ref/templates/api/?from=olddocs#shortcut-for-simple-tags {% if is_logged_in %}Thanks for logging in!{% else %}Please log in.{% endif %} when placed in admin index.html, if a user is l...
When working with Django's admin interface, it’s important to note that the templates used in the admin can behave differently compared to regular templates in your application. Here are a few things to check when you find that template tags or variables are not rendering as expected in Django admin: ### 1. Ensure the...
34,365
[ { "from": "human", "value": "for some reason, templatetags do not render in templates for django admin.\nwith this snippet from:\nhttp://docs.djangoproject.com/en/dev/ref/templates/api/?from=olddocs#shortcut-for-simple-tags\n{% if is_logged_in %}Thanks for logging in!{% else %}Please log in.{% endif %}\n\nw...
This problem has several of us stumped in the office. We are all new to deploying ASP.NET apps to a web farm, and I am fresh out of ideas. We have a web farm, and the application is copied on to all of them. However, we are having a problem.. An exception is being thrown when trying to get settings from appSettings. Up...
Hi Rob, It sounds like you're facing an issue with your ASP.NET application not correctly reading the `web.config` file from the application's directory. Here are some steps to help you troubleshoot and potentially resolve the issue: 1. **Check Application Pool Settings**: Ensure that your web application is running ...
38,770
[ { "from": "human", "value": "This problem has several of us stumped in the office. We are all new to deploying ASP.NET apps to a web farm, and I am fresh out of ideas.\nWe have a web farm, and the application is copied on to all of them.\nHowever, we are having a problem..\nAn exception is being thrown when...
How do i check in C++ if a file is a regular file (and is not a directory, a pipe, etc.)? I need a function isFile(). DIR *dp; struct dirent *dirp; while ((dirp = readdir(dp)) != NULL) { if ( isFile(dirp)) { cout << "IS A FILE!" << endl; i++; } I've tried comparing dirp->d_type with (unsigned char)0x8, but it s...
To check if a file is a regular file in C++, you can use the `stat` system call, which is a more portable method than relying on `dirent` and `d_type`. The `stat` function retrieves information about the file associated with a file descriptor or filename and fills in a `stat` structure. This structure contains various ...
41,094
[ { "from": "human", "value": "How do i check in C++ if a file is a regular file (and is not a directory, a pipe, etc.)? I need a function isFile(). \nDIR *dp;\nstruct dirent *dirp;\n\nwhile ((dirp = readdir(dp)) != NULL) {\nif ( isFile(dirp)) {\n cout << \"IS A FILE!\" << endl;\ni++;\n}\n\nI've tried com...
I am writing unit tests for a class, which has a static final variable. However, since the state of the static final var is modified in each test, I need some way to reinitialize it. How would this be possible? Would i need to use some sort of a custom classloader? The variable is initialized as - static final Co...
In Java, `static final` variables are constants, and while you can change the state of an object referenced by such a variable (if it's mutable), you cannot reassign the variable itself. This can create issues in unit tests when you want to reset the state between tests. If you want to reset the state of a `static fin...
40,366
[ { "from": "human", "value": "I am writing unit tests for a class, which has a static final variable.\nHowever, since the state of the static final var is modified in each test, I need some way to reinitialize it.\n\nHow would this be possible? Would i need to use some sort of a custom classloader? \n\nThe v...
I've created a DLL project in VS 2005 for native Win32/unmanaged C++, call it myProj.dll. It depends on a 3rd-party commercial DLL that in turn depends on msvcr90.dll (I assume it was built from a VS 2008 project). I'll call it thirdParty.dll. My DLL project builds just fine in VS2005. I've built a test app (again, ...
It sounds like you're facing a common issue with dependency resolution in C++ applications when using DLLs, especially across different versions of Visual Studio. Let’s break down the problem and how to resolve it. ### Problem Summary 1. **Your application (test app)** is built using Visual Studio 2005 (VS2005). 2. **...
39,497
[ { "from": "human", "value": "I've created a DLL project in VS 2005 for native Win32/unmanaged C++, call it myProj.dll. It depends on a 3rd-party commercial DLL that in turn depends on msvcr90.dll (I assume it was built from a VS 2008 project). I'll call it thirdParty.dll.\nMy DLL project builds just fine ...
Let's say I've got a setup that look something like phd/code/ phd/figures/ phd/thesis/ For historical reasons, these all have their own git repositories. But I'd like to combine them into a single one to simplify things a little. For example, right now I might make two sets of changes and have to do something like cd ...
If you want to combine multiple existing Git repositories into a single repository while retaining the history of those repositories, you can use the following approach: 1. **Create a new directory for your combined repository** (or you can convert your `phd` directory if you're okay with that): ```bash mkdir ph...
42,658
[ { "from": "human", "value": "Let's say I've got a setup that look something like\nphd/code/\nphd/figures/\nphd/thesis/\n\nFor historical reasons, these all have their own git repositories. But I'd like to combine them into a single one to simplify things a little. For example, right now I might make two set...
I want to create a history table to track field changes across a number of tables in DB2. I know history is usually done with copying an entire table's structure and giving it a suffixed name (e.g. user --> user_history). Then you can use a pretty simple trigger to copy the old record into the history table on an UPDA...
Your approach to creating a history table that tracks individual field changes is a valid alternative to creating a separate history table for each main table, especially when dealing with a large number of records and fields that don’t change frequently. However, implementing a trigger that automatically tracks change...
36,485
[ { "from": "human", "value": "I want to create a history table to track field changes across a number of tables in DB2. \nI know history is usually done with copying an entire table's structure and giving it a suffixed name (e.g. user --> user_history). Then you can use a pretty simple trigger to copy the ol...
Let's say I have a table that represents a super class, students. And then I have N tables that represent subclasses of that object (athletes, musicians, etc). How can I express a constraint such that a student must be modeled in one (not more, not less) subclass? Clarifications regarding comments: This is being maint...
To enforce the constraint that each student must be represented in exactly one subclass (like athletes, musicians, etc.) while allowing the possibility for students not to belong to any subclass, you can use a couple of strategies. However, keep in mind that SQL does not provide native support for enforcing this kind o...
39,689
[ { "from": "human", "value": "Let's say I have a table that represents a super class, students. And then I have N tables that represent subclasses of that object (athletes, musicians, etc). How can I express a constraint such that a student must be modeled in one (not more, not less) subclass?\nClarification...
I'm using a VB6 PictureBox on my User Control. I set the PictureBox's picture, I set the BorderStyle to 0, and I set the BackColor to the User Control's BackColor. The idea is that I want a "floating" icon. However, I want that icon to appear clickable when the mouse hovers over it. Two questions: Which events do...
To create a "floating" icon in a VB6 User Control that appears clickable when the mouse hovers over it, you'll indeed want to use the `MouseMove` event to detect when the mouse is over the PictureBox. As for creating a visual indication that the icon is clickable, you can modify the appearance of the PictureBox, such a...
40,130
[ { "from": "human", "value": "I'm using a VB6 PictureBox on my User Control. I set the PictureBox's picture, I set the BorderStyle to 0, and I set the BackColor to the User Control's BackColor. The idea is that I want a \"floating\" icon. However, I want that icon to appear clickable when the mouse hovers...
I have a Java SOAP data service which sits on top of a Sybase database which, for reasons out of my control, has unreliable performance. The database is part of a vendor package which has been modified by an internal team and most of the issues are caused by slow response times at certain times of the day. The SOAP se...
To improve the performance and reliability of your Java SOAP data service in the face of an unreliable Sybase database, you can consider several strategies that focus on caching, asynchronous processing, load balancing, and database optimization. Below are some potential approaches to help you achieve faster and more c...
39,413
[ { "from": "human", "value": "I have a Java SOAP data service which sits on top of a Sybase database which, for reasons out of my control, has unreliable performance. The database is part of a vendor package which has been modified by an internal team and most of the issues are caused by slow response times ...
Well I testing my jython program, that does some neat [".xls", ".doc", ".rtf", ".tif", ".tiff", ".pdf" files] -> pdf (intermediary file) -> tif (final output) conversion using Open Office. We moved away from MS Office due to the problems we had with automation. Now it seems we have knocked down many bottles related t...
You are dealing with an OpenOffice (OO) integration issue where the process may hang when you attempt to load a document for conversion. Here are the responses to your questions, along with some general suggestions for code quality and optimizations: ### 1. Handling a Stalled OpenOffice Instance To handle a stalled O...
38,801
[ { "from": "human", "value": "Well I testing my jython program, that does some neat [\".xls\", \".doc\", \".rtf\", \".tif\", \".tiff\", \".pdf\" files] -> pdf (intermediary file) -> tif (final output) conversion using Open Office. We moved away from MS Office due to the problems we had with automation. Now ...
I have noticed a common technique is to place a generic container div in the root of the body tag: <html> <head> ... </head> <body> <div id="container"> ... </div> </body> </html> Is there a valid reason for doing this? Why can't the CSS just reference the body tag?
Placing a generic container `<div>` in the root of the body tag, as in your example, is a common practice in web development, and there are several reasons why developers might choose to do this instead of directly styling the `<body>` tag. Here are some key reasons: 1. **Separation of Concerns**: By using a container...
43,506
[ { "from": "human", "value": "I have noticed a common technique is to place a generic container div in the root of the body tag:\n<html>\n <head>\n ...\n </head>\n <body>\n <div id=\"container\">\n ...\n </div>\n </body>\n</html>\n\nIs there a valid reason for doing this? Why can't the CSS ...
I want to run program on background . pref C# I want put icon in the tray. On specified time it’s synchronizes folders (I know how to sync folders) . How to run it on background and start sync ( for example at 2am)?
To run a program in the background and have it synchronize folders at a specified time (e.g., 2 AM) in C#, you can follow these steps: 1. **Create a Windows Forms Application**: This will allow you to use a system tray icon. 2. **Add a NotifyIcon**: This is the icon that will appear in the system tray. 3. **Use a Ti...
36,387
[ { "from": "human", "value": "I want to run program on background . pref C#\nI want put icon in the tray.\nOn specified time it’s synchronizes folders (I know how to sync folders) . \nHow to run it on background and start sync ( for example at 2am)?\n" }, { "from": "gpt", "value": "To run a p...
I have a Visual Studio 2008 solution with several projects in it - some of which are web applications / sites. Whenever I go "Debug > Start new instance" for a specific web application and VS launches the ASP.net Development Server (WebDev.WebServer.EXE) for that application, VS also launches 3 additional such process...
The issue you're experiencing with Visual Studio 2008 launching additional instances of the ASP.NET Development Server (WebDev.WebServer.EXE) is likely due to the configuration of your solution and projects. Here's how you can adjust your settings so that only the specific web application you're debugging launches its ...
41,013
[ { "from": "human", "value": "I have a Visual Studio 2008 solution with several projects in it - some of which are web applications / sites. \nWhenever I go \"Debug > Start new instance\" for a specific web application and VS launches the ASP.net Development Server (WebDev.WebServer.EXE) for that application...
In MySql's interpreter, it's very easy to dump a table to the screen along with its field names. There seems to be no simple way to export a table to a tab-delimted or CSV outfile including its column headers. I'm trying to do this using only SQL or the Linux command line, without writing a program in another language...
You can export a MySQL table to a CSV file with headers using a simple SQL query and the `SELECT ... INTO OUTFILE` syntax. Below are the steps and the example to achieve this: ### Using MySQL's `SELECT ... INTO OUTFILE` 1. **Login to MySQL**: Start by logging into your MySQL database from the command line: ```bas...
36,132
[ { "from": "human", "value": "In MySql's interpreter, it's very easy to dump a table to the screen along with its field names. \nThere seems to be no simple way to export a table to a tab-delimted or CSV outfile including its column headers.\nI'm trying to do this using only SQL or the Linux command line, wi...
I have this application installed on my Macbook Pro that allows me to disable a core on my CPU. It got me wondering: How does disabling a core affect the running processes? I am also interested if disabling a core has an affect on the following Battery Life Heat generation Increased performance when the processor woul...
Disabling a core on your MacBook Pro's CPU can impact running processes and the overall performance of your system in several ways. Here’s how it affects various aspects: ### 1. Impact on Running Processes - **Process Scheduling**: The operating system manages processes and distributes them across available CPU cores....
40,016
[ { "from": "human", "value": "I have this application installed on my Macbook Pro that allows me to disable a core on my CPU. It got me wondering: How does disabling a core affect the running processes?\nI am also interested if disabling a core has an affect on the following\n\nBattery Life\nHeat generation\...
What is the difference between using #include<filename> and #include<filename.h> in C++? Which of the two is used and why is it is used?
In C++, the `#include` directive is used to include the contents of a file (typically a header file) into your program. The syntax `#include <filename>` and `#include "filename.h"` serves similar purposes, but there are some differences in how the compiler locates the files. ### Key Differences 1. **File Location**: ...
42,096
[ { "from": "human", "value": "What is the difference between using #include<filename> and #include<filename.h> in C++? Which of the two is used and why is it is used?\n" }, { "from": "gpt", "value": "In C++, the `#include` directive is used to include the contents of a file (typically a header fi...
Sorry if this is basic but I was trying to pick up on .Net 3.5. Question: Is there anything great about Func<> and it's 5 overloads? From the looks of it, I can still create a similar delgate on my own say, MyFunc<> with the exact 5 overloads and even more. eg: public delegate TResult MyFunc<TResult>() and a combo of v...
You're correct that `Func<>` in .NET is a powerful and flexible mechanism for defining delegates with different signatures, and it can indeed seem like you can simply create your own delegate types to accomplish similar functionality. However, there are a few key benefits to using `Func<>` and its built-in overloads th...
38,039
[ { "from": "human", "value": "Sorry if this is basic but I was trying to pick up on .Net 3.5.\nQuestion: Is there anything great about Func<> and it's 5 overloads? From the looks of it, I can still create a similar delgate on my own say, MyFunc<> with the exact 5 overloads and even more.\neg: public delegate...
In the past I have used nexo.com to share documents with sales, marketing, PR, and technical people for a small startup. But I wonder if there is a better solution to allow different types of geo-graphically dispersed workers to get to a variety of uploaded documents. I don't want to have to build or host this myself, ...
If you're looking for simple, access-controlled cloud storage solutions without the complexities of larger platforms like Confluence, there are several options you can consider that are both affordable and user-friendly: 1. **Google Drive**: - Offers easy sharing and access controls. - You can create folders and...
41,901
[ { "from": "human", "value": "In the past I have used nexo.com to share documents with sales, marketing, PR, and technical people for a small startup. But I wonder if there is a better solution to allow different types of geo-graphically dispersed workers to get to a variety of uploaded documents. I don't wa...
I have a .net 3.5 WinForms application that runs fine on my machine, but on another machine it immediately crashes with a system.io.fileloadexception. Unfortunately, there are absolutely no details on which file failed to load, so I do not know where the problem actually is. I believe I know which one it could be (SQL ...
When encountering a `System.IO.FileLoadException` in a .NET WinForms application, particularly when the error message does not provide clear information on what file could not be loaded, you have several troubleshooting approaches you can take: 1. **Check the Inner Exception**: The `FileLoadException` can sometimes ha...
39,396
[ { "from": "human", "value": "I have a .net 3.5 WinForms application that runs fine on my machine, but on another machine it immediately crashes with a system.io.fileloadexception. Unfortunately, there are absolutely no details on which file failed to load, so I do not know where the problem actually is.\nI ...
Ok so I just did something boneheaded. I'm setting up a subversion server for the first time ever that will be used by contractors. I did the 1 click setup, created my project and did my first check in of our application thinking that I'll go through later and remove the password information in the connection string i...
No worries! Deleting a project (or a "repository" in Subversion terminology) is relatively straightforward. However, Subversion doesn't allow you to delete a repository through `svnadmin` directly. Instead, you typically just remove the project directory from the file system where the repository is stored. Here’s how ...
41,316
[ { "from": "human", "value": "Ok so I just did something boneheaded.\nI'm setting up a subversion server for the first time ever that will be used by contractors. I did the 1 click setup, created my project and did my first check in of our application thinking that I'll go through later and remove the passw...
I'm trying to find out the most efficient (best performance) way to check date field for current date. Currently we are using: SELECT COUNT(Job) AS Jobs FROM dbo.Job WHERE (Received BETWEEN DATEADD(d, DATEDIFF(d, 0, GETDATE()), 0) AND DATEADD(d, DATEDIFF(d, 0, GETDATE()), 1))
To check for records with a date field that matches the current date, you can optimize your query in several ways. Your current query uses the `BETWEEN` operator with `DATEADD` and `DATEDIFF`, which calculates the start and end of the current day. There are alternative methods to achieve this that can improve performan...
38,644
[ { "from": "human", "value": "I'm trying to find out the most efficient (best performance) way to check date field for current date. Currently we are using:\nSELECT COUNT(Job) AS Jobs\nFROM dbo.Job\nWHERE (Received BETWEEN DATEADD(d, DATEDIFF(d, 0, GETDATE()), 0)\n AND...
I have a php script which accesses a MSSQL2005 database, reads some data from it and sends the results in a mail. There are special characters in both some column names and in the fields itself. When I access the script through my browser (webserver iis), the query is executed correctly and the contents of the mail a...
When you run a PHP script through a web server (like IIS), it typically uses the web server’s configuration for encoding and character set, which can be different from the default settings when running PHP from the console (CLI). Here are some points to consider to address the issues you're experiencing: ### Differenc...
40,199
[ { "from": "human", "value": "I have a php script which accesses a MSSQL2005 database, reads some data from it and sends the results in a mail. \nThere are special characters in both some column names and in the fields itself. \nWhen I access the script through my browser (webserver iis), the query is execut...
I have the following Python code: import xml.dom.minidom import xml.parsers.expat try: domTree = ml.dom.minidom.parse(myXMLFileName) except xml.parsers.expat.ExpatError, e: return e.args[0] which I am using to parse an XML file. Although it quite happily spots simple XML errors like mismatched tags, it comp...
The `xml.dom.minidom` module in Python does not provide support for validating XML against a DTD (Document Type Definition). If you want to perform DTD validation in Python, you can use the `lxml` library, which has support for XML validation against DTDs. Here's how you can modify your code to use `lxml` for XML pars...
41,943
[ { "from": "human", "value": "I have the following Python code: \nimport xml.dom.minidom\nimport xml.parsers.expat\n\ntry:\n domTree = ml.dom.minidom.parse(myXMLFileName)\nexcept xml.parsers.expat.ExpatError, e:\n return e.args[0]\n\nwhich I am using to parse an XML file. Although it quite happily spo...
Following on from my question on using frozen Capistrano a couple of days back I'm still having issues running Capistrano frozen in my vendor folder. When I try and run my frozen version of cap ruby -r rubygems ./vendor/gems/capistrano-2.5.2/bin/cap deploy-with-migrations I get an error ... RubyGem version error: net...
It looks like you're facing an issue with gem dependencies and versions when using a frozen version of Capistrano. The error you're seeing indicates that the version of `net-ssh` required by Capistrano is not met by the version you have. Here’s a step-by-step approach to resolve this issue: 1. **Check Dependencies**:...
40,845
[ { "from": "human", "value": "Following on from my question on using frozen Capistrano a couple of days back I'm still having issues running Capistrano frozen in my vendor folder.\nWhen I try and run my frozen version of cap \nruby -r rubygems ./vendor/gems/capistrano-2.5.2/bin/cap deploy-with-migrations\n\n...
I'm using System.Windows.Media.MediaPlayer to play some sounds, and I would like to load these sounds from a ZIP file. It would be nice to be able to load these files as a stream directly from the zip file instead of having to unzip to a temp directory. However, MediaPlayer.open only accepts an URI. So, is there a way...
In the context of `System.Windows.Media.MediaPlayer`, unfortunately, you can't directly create a URI that points to a stream. The `MediaPlayer` class requires a URI that points to a file, and it does not support loading audio data from a `Stream` directly. However, you can work around this limitation by following thes...
37,263
[ { "from": "human", "value": "I'm using System.Windows.Media.MediaPlayer to play some sounds, and I would like to load these sounds from a ZIP file. It would be nice to be able to load these files as a stream directly from the zip file instead of having to unzip to a temp directory. However, MediaPlayer.open...
I'm creating a small app in ASP.NET MVC that generates ics (iCal) files based on certain criterias. The generated files are accessible through a permanent URL (http://myserver/some/criterias.ics). I am looking for a way to display the calendar data on the page to give the user a preview of the generated file. Ideally, ...
To display iCalendar (.ics) data on your web page, you have a few options for libraries and services that can help you create a calendar interface, similar to Google Calendar. Here are some recommendations: ### 1. **FullCalendar** [FullCalendar](https://fullcalendar.io/) is a popular JavaScript library that allows you...
36,057
[ { "from": "human", "value": "I'm creating a small app in ASP.NET MVC that generates ics (iCal) files based on certain criterias. The generated files are accessible through a permanent URL (http://myserver/some/criterias.ics).\nI am looking for a way to display the calendar data on the page to give the user ...
When issuing an HTTP DELETE request, the request URI should completely identify the resource to delete. However, is it allowable to add extra meta-data as part of the entity body of the request?
In general, the HTTP/1.1 specification (RFC 7231) does not explicitly prohibit including an entity body with a DELETE request. However, the behavior of the server in response to such an inclusion is not guaranteed and can vary depending on the implementation. 1. **Standard Behavior**: The URI in a DELETE request shoul...
43,459
[ { "from": "human", "value": "When issuing an HTTP DELETE request, the request URI should completely identify the resource to delete. However, is it allowable to add extra meta-data as part of the entity body of the request?\n" }, { "from": "gpt", "value": "In general, the HTTP/1.1 specification ...
I've been developing an application for a second generation Workabout Pro from PSION Teklogix. Recently my company underwent an upgrade re: operating systems and Visual Studio versions, so I'm stuck with Windows Vista (and Visual Studio 2008). I've connected the same Workabout Pro unit I've always used for development,...
To resolve the issue you're facing with deploying your application to the second generation Workabout Pro while using Windows Vista and Visual Studio 2008, follow these steps: ### 1. Use Windows Mobile Device Center Windows Vista does not support ActiveSync, but instead uses Windows Mobile Device Center (WMDC). Here’s...
38,810
[ { "from": "human", "value": "I've been developing an application for a second generation Workabout Pro from PSION Teklogix.\nRecently my company underwent an upgrade re: operating systems and Visual Studio versions, so I'm stuck with Windows Vista (and Visual Studio 2008).\nI've connected the same Workabout...
I know this question had been asked more than a few times, but so far I haven't been able to find a good solution for it. I've got a panel with other control on it. I want to draw a line on it and on top of all the controls in the panel I came across 3 types of solutions (non of them worked the way I wanted) : Get the...
To draw a line (or any other graphic) on top of all controls in a panel while ensuring the line is rendered on top of everything else, you can follow a combination of strategies. Here's a recommended approach using a dedicated overlay control that you can place on top of the panel, which can handle custom drawing: ###...
39,659
[ { "from": "human", "value": "I know this question had been asked more than a few times, but so far I haven't been able to find a good solution for it.\nI've got a panel with other control on it.\nI want to draw a line on it and on top of all the controls in the panel\nI came across 3 types of solutions (non...
The database type is PostGres 8.3. If I wrote: SELECT field1, field2, field3, count(*) FROM table1 GROUP BY field1, field2, field3 having count(*) > 1; I have some rows that have a count over 1. How can I take out the duplicate (I do still want 1 row for each of them instead of +1 row... I do not want to delete them...
You can achieve your desired output of deduplicating rows without using a hash column by using a Common Table Expression (CTE) or a subquery to first identify the duplicates and then select distinct values based on the specified columns. Here's a straightforward way to do it using a CTE: ```sql WITH DuplicateRows AS (...
42,603
[ { "from": "human", "value": "The database type is PostGres 8.3.\nIf I wrote: \nSELECT field1, field2, field3, count(*) \nFROM table1\nGROUP BY field1, field2, field3 having count(*) > 1;\n\nI have some rows that have a count over 1. How can I take out the duplicate (I do still want 1 row for each of them in...
I'm using BizUnit to unit-tests my Biztalk orchestrations, but some orchestrations consume a WebService,and testing these seems more like integration testing than unit testing. I'm familiar with using a mocking framework to mock the generated proxy objects, in order to test a web service from a Windows Forms applicatio...
You're right to identify the difference between unit testing and integration testing, especially in the context of BizTalk orchestrations that consume web services. In your case, where you want to unit test the orchestrations in a more integrated way, you can adopt a few strategies. Here are some approaches to consider...
38,463
[ { "from": "human", "value": "I'm using BizUnit to unit-tests my Biztalk orchestrations, but some orchestrations consume a WebService,and testing these seems more like integration testing than unit testing.\nI'm familiar with using a mocking framework to mock the generated proxy objects, in order to test a w...
When I am stuck with a problem: I search Google for code snippets. I look at isolating the problem, so that I can better explain it to others in order to get answers. What search techniques do you use to find the solution to your problem? I started asking questions in Stack Overflow. What other techniques or methods ...
When faced with a programming or technical problem, here are some effective techniques and methods to expedite finding a solution: 1. **Keywords and Search Operators**: Use specific keywords related to your issue. Utilize search operators in Google, like quotes for exact phrases, and `-` to exclude terms that may not ...
40,738
[ { "from": "human", "value": "When I am stuck with a problem:\n\nI search Google for code snippets.\nI look at isolating the problem, so that I can better explain it to others in order to get answers.\n\nWhat search techniques do you use to find the solution to your problem?\nI started asking questions in St...