instruction
stringlengths
14
27.6k
completion
stringlengths
3
38.3k
__original_row_idx
int64
0
50k
conversations
listlengths
2
2
I have a generated DataSet with bunch of tables. In one table I have a custom query that I use to select people that are older than 15 years. I would like to change this query during working program, so that the query will look like 'select * from people where age > 17'. Now it looks like 'select * from people where ag...
To change the SQL query in your DataSet at runtime, you typically need to modify the command associated with the `GetNotYoungPeople` query. This process can vary slightly depending on the environment and framework you're using (e.g., ADO.NET, Entity Framework, etc.). However, I can provide a general approach you might ...
41,344
[ { "from": "human", "value": "I have a generated DataSet with bunch of tables. In one table I have a custom query that I use to select people that are older than 15 years. I would like to change this query during working program, so that the query will look like 'select * from people where age > 17'. Now it ...
I'm doing some data analysis in Matlab, and anytime I call the hold function to keep plotting to the current figure, I get an output like this: Current plot held I'd like to avoid this print, since it's just ugly and clutters my output. Unfortunately, placing a ; after the command does not silence it. Is there somethi...
In MATLAB, the message "Current plot held" is a part of the output of the `hold` command, and unfortunately, using a semicolon `;` after the command does not suppress it. However, you can avoid this message by using the `evalc` function, which captures the output of the command as a string instead of printing it to th...
48,849
[ { "from": "human", "value": "I'm doing some data analysis in Matlab, and anytime I call the hold function to keep plotting to the current figure, I get an output like this:\nCurrent plot held\n\nI'd like to avoid this print, since it's just ugly and clutters my output. Unfortunately, placing a ; after the c...
I have a multi-user eclipse (3.4) installation with a shared master configuration area. Users need to override user.name with their full name and the usual method (adding -Duser.name=... to eclipse.ini) is not suitable since the override must be per-user. I've tried setting user.name in config.ini (inside each user's c...
In Eclipse, the `user.name` property is generally set by the Java Virtual Machine (JVM) when it starts, and it reflects the system username. Unfortunately, `user.name` is a special property that does not behave like other properties that can be set in `config.ini`. This means that while you can set custom properties (l...
44,070
[ { "from": "human", "value": "I have a multi-user eclipse (3.4) installation with a shared master configuration area.\nUsers need to override user.name with their full name and the usual method (adding -Duser.name=... to eclipse.ini) is not suitable since the override must be per-user.\nI've tried setting us...
I have a List< int[] > myList, where I know that all the int[] arrays are the same length - for the sake of argument, let us say I have 500 arrays, each is 2048 elements long. I'd like to sum all 500 of these arrays, to give me a single array, 2048 elements long, where each element is the sum of all the same positions...
Yes, you can achieve this using LINQ in a more concise and expressive way. While LINQ doesn't directly provide a method to perform the kind of positional summation you're looking for, you can use `Enumerable.Zip` along with `Aggregate` to accomplish this. Here's how you can do it: ```csharp using System; using System....
44,125
[ { "from": "human", "value": "I have a List< int[] > myList, where I know that all the int[] arrays are the same length - for the sake of argument, let us say I have 500 arrays, each is 2048 elements long. I'd like to sum all 500 of these arrays, to give me a single array, 2048 elements long, where each ele...
I am trying to display a pie chart that shows sales by company. However there are a lot of companies that only have a tiny sales which makes the pie chart look rubbish. Is there a way to group companies like this into a single "Other" category?
Yes, grouping companies with small sales into an "Other" category is a common practice when creating pie charts to enhance clarity and readability. Here's how you can do that: ### Steps to Create a Pie Chart with an "Other" Category: 1. **Set a Threshold**: Decide on a sales threshold below which companies will be gr...
43,452
[ { "from": "human", "value": "I am trying to display a pie chart that shows sales by company. However there are a lot of companies that only have a tiny sales which makes the pie chart look rubbish. \nIs there a way to group companies like this into a single \"Other\" category?\n" }, { "from": "gpt...
i need to convert pointers to long (SendMessage()) and i want to safely check if the variable is correct on the otherside. So i was thinking of doing dynamic_cast but that wont work on classes that are not virtual. Then i thought of doing typeid but that will work until i pass a derived var as its base. Is there any wa...
Yes, you can use `typeid` along with the `std::type_info` class to determine if a pointer is derived from a particular base class. However, the key requirement is that the base class must have at least one virtual function. This is because `typeid` works with polymorphic types—types that have at least one virtual funct...
44,235
[ { "from": "human", "value": "i need to convert pointers to long (SendMessage())\nand i want to safely check if the variable is correct on the otherside. So i was thinking of doing dynamic_cast but that wont work on classes that are not virtual. Then i thought of doing typeid but that will work until i pass ...
I´m sure there´s a clever one-liner using the C++ stl generic algorithms for implementing the dot product of the elements in any ordered container, such as a vector or list. I just don´t seem to remember it! The fancy implementation would be: template <class containerT> typename containerT::value_type dot_product (cons...
Yes, you can indeed implement the dot product in a more concise way using the C++ Standard Library's generic algorithms. Specifically, you can use `std::inner_product` from the `<numeric>` header, which is designed for this purpose. Here’s how you can write your `dot_product` function using `std::inner_product`: ```cp...
48,792
[ { "from": "human", "value": "I´m sure there´s a clever one-liner using the C++ stl generic algorithms for implementing the dot product of the elements in any ordered container, such as a vector or list. I just don´t seem to remember it!\nThe fancy implementation would be:\ntemplate <class containerT>\ntypen...
Basically I'm about to start work on a site and I'd like something that I can add into my .htaccess file (or elsewhere) that'll work like this pseudo code: (my ip will be in place of 127.0.0.1) if (visitors_ip <> 127.0.0.1) redirectmatch ^(.*)$ http://www.example.com/under-construction.html Hopefully that makes se...
You can achieve this functionality using the `.htaccess` file with mod_rewrite in Apache. Here's an example of how to implement your pseudo code using Apache's rewrite rules: ```apache RewriteEngine On # Allow access only for your IP (127.0.0.1) RewriteCond %{REMOTE_ADDR} !^127\.0\.0\.1$ # Redirect all other request...
45,442
[ { "from": "human", "value": "Basically I'm about to start work on a site and I'd like something that I can add into my .htaccess file (or elsewhere) that'll work like this pseudo code: (my ip will be in place of 127.0.0.1)\nif (visitors_ip <> 127.0.0.1)\n redirectmatch ^(.*)$ http://www.example.com/under...
I have a table that has a primary key that's an INT... I have another table, that has a foreignkey relationship to that first table, but it's a NULLABLE INT. This is perfectly ok, and 100% acceptable to SQL... however LINQ to SQL is complaining about mismatched types ("int to Nullable[int]"). Error Message: Cannot crea...
The issue you are encountering with LINQ to SQL is due to the way it handles associations between tables, particularly when it comes to primary keys and foreign keys that involve nullable types. In your case, you have an `INT` primary key and a nullable `INT` foreign key, which LINQ to SQL is interpreting as a type mis...
43,928
[ { "from": "human", "value": "I have a table that has a primary key that's an INT... I have another table, that has a foreignkey relationship to that first table, but it's a NULLABLE INT.\nThis is perfectly ok, and 100% acceptable to SQL... however LINQ to SQL is complaining about mismatched types (\"int to ...
Is it possible to limit export formats only PDF and Excel ?
Yes, it is possible to limit export formats to only PDF and Excel in various applications or systems. The method for doing this depends on the software or platform you are using. Here are some general approaches you can consider: 1. **Web Applications**: If you are developing a web application, you can modify the expo...
46,949
[ { "from": "human", "value": "Is it possible to limit export formats only PDF and Excel ?\n" }, { "from": "gpt", "value": "Yes, it is possible to limit export formats to only PDF and Excel in various applications or systems. The method for doing this depends on the software or platform you are us...
Is there any lib that convert very long numbers to string just copying the data? These one-liners are too slow: def xlong(s): return sum([ord(c) << e*8 for e,c in enumerate(s)]) def xstr(x): return chr(x&255) + xstr(x >> 8) if x else '' print xlong('abcd'*1024) % 666 print xstr(13**666)
If you're looking for a way to handle very long numbers in Python efficiently, there are libraries that can help with that. For working with very large integers and converting them to strings (and vice versa) without significant performance issues, you can use the built-in `int` type in Python, which can handle arbitra...
41,115
[ { "from": "human", "value": "Is there any lib that convert very long numbers to string just copying the data?\nThese one-liners are too slow:\ndef xlong(s):\n return sum([ord(c) << e*8 for e,c in enumerate(s)])\n\ndef xstr(x):\n return chr(x&255) + xstr(x >> 8) if x else ''\n\nprint xlong('abcd'*1024)...
I'm wondering if there is a simple property in the Excel interop that returns the count of used columns--ones containing data--from a given worksheet. In example: If myWorksheet.Columns.Count returns the total number of columns in a given worksheet, is there no equivalent along the lines of: myWorksheet.Columns.UsedCou...
In Excel Interop, there isn't a direct property like `myWorksheet.Columns.UsedCount` to get the count of used columns. However, you can achieve this by utilizing the `UsedRange` property of the worksheet. The `UsedRange` property gives you a range object that represents the area of the worksheet that is currently in us...
46,976
[ { "from": "human", "value": "I'm wondering if there is a simple property in the Excel interop that returns the count of used columns--ones containing data--from a given worksheet.\nIn example:\nIf myWorksheet.Columns.Count returns the total number of columns in a given worksheet, is there no equivalent alon...
How can I assert my Ajax request and test the JSON output from Ruby on Rails functional tests?
Testing Ajax requests and verifying JSON responses in Ruby on Rails can be done using functional tests with the built-in testing framework. Here’s a step-by-step guide on how to assert your Ajax requests and test the JSON output: ### Step 1: Set Up Your Test Environment Make sure you have the required gems for testin...
41,841
[ { "from": "human", "value": "How can I assert my Ajax request and test the JSON output from Ruby on Rails functional tests?\n" }, { "from": "gpt", "value": "Testing Ajax requests and verifying JSON responses in Ruby on Rails can be done using functional tests with the built-in testing framework....
I have been using netbeans as a tool for my java, and i have a problem. I read this tutorial and then i tried to create a table using this SQL: CREATE TABLE CUSTOMERS ( ID INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, FIRST_NAME VARCHAR(20), LAST_NAME VARCHAR(30), ADDRESS VARCHAR(30), CITY VARCHAR(30...
The issue you're encountering is related to the SQL dialect being used in your database system. The `AUTO_INCREMENT` keyword and `ENGINE=INNODB` statement are specific to MySQL. If you are using a different database system (for example, Apache Derby, which is common in Java applications), these features might not be su...
45,142
[ { "from": "human", "value": "I have been using netbeans as a tool for my java, and i have a problem. I read this tutorial and then i tried to create a table using this SQL:\nCREATE TABLE CUSTOMERS (\n ID INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY,\n FIRST_NAME VARCHAR(20),\n LAST_NAME VARCHAR(30),...
I have seen these two approaches for constant declaration which are to be used in the project. Constants in a public module. Constants in a NonInheritable(Sealed) class Does anybody uses any other approach for the constant declartion ? Is there any difference between these approaches, any pros and cons ? Thanks.
Both approaches you've mentioned for declaring constants have their own advantages and disadvantages. Let's break them down and also explore some other approaches. ### 1. Constants in a Public Module In many programming languages, a module can contain constants that can be accessed globally within the application. Thi...
43,902
[ { "from": "human", "value": "I have seen these two approaches for constant declaration which are to be used in the project.\n\nConstants in a public module. \nConstants in a NonInheritable(Sealed) class \n\nDoes anybody uses any other approach for the constant declartion ?\nIs there any difference between t...
On my Centos server Python's mimetypes.guess_type("mobile.3gp") returns (None, None), instead of ('video/3gpp', None). Where does Python get the list of mimetypes from, and is it possible to add a missing type to the list?
In Python, the `mimetypes` module uses a standard database of MIME types that is typically populated from the system's MIME types files (like `/etc/mime.types` on Unix-like systems) as well as some hard-coded defaults in the module itself. If `mimetypes.guess_type("mobile.3gp")` is returning `(None, None)`, it likely m...
44,668
[ { "from": "human", "value": "On my Centos server Python's mimetypes.guess_type(\"mobile.3gp\") returns (None, None), instead of ('video/3gpp', None).\nWhere does Python get the list of mimetypes from, and is it possible to add a missing type to the list?\n" }, { "from": "gpt", "value": "In Pytho...
When creating a string using the following notation: NSString *foo = @"Bar"; Does one need to release foo? Or is foo autoreleased in this case?
In Objective-C, when you create a string using the notation: ```objc NSString *foo = @"Bar"; ``` The string literal `@"Bar"` is a compile-time constant, and it is stored in the application's binary. It is not created on the heap with memory management responsibilities that you would need to release later. Therefore, ...
46,900
[ { "from": "human", "value": "When creating a string using the following notation:\nNSString *foo = @\"Bar\";\n\nDoes one need to release foo? Or is foo autoreleased in this case?\n" }, { "from": "gpt", "value": "In Objective-C, when you create a string using the notation:\n\n```objc\nNSString *f...
I have a list control in Flex that has been data bound to an e4x xml object from an HTTPService. I would now like to have a button that clears the list, how can I do this? I have tried: list.dataProvider = null; which does not seem to work, I have also tried: list.dataProvider = {}; which clears the items but ...
In Flex, if you want to clear the contents of a List control that is data bound to an E4X XML object, setting the `dataProvider` to `null` or an empty object will not work as expected. Instead, you should set the `dataProvider` to an empty array or a new `XMLListCollection`. Here's how you can do it: 1. **Using an Em...
45,680
[ { "from": "human", "value": "I have a list control in Flex that has been data bound to an e4x xml object from an HTTPService. \nI would now like to have a button that clears the list, how can I do this?\nI have tried:\n\n\nlist.dataProvider = null;\n\n\nwhich does not seem to work, I have also tried:\n\n\nl...
I have a visual studio 2005 solution which has a web application and a class library project. The web application has a reference to the library project. I'd like the library project's code documentation XML to output to the web application's bin folder, along with the library's DLL. I can't seem to find any easy wa...
To ensure that the XML documentation file for your class library project is output to the web application's `bin` folder alongside the library's DLL, you can follow these steps in Visual Studio 2005: 1. **Enable XML Documentation Generation**: - Open your class library project in Visual Studio. - Right-click on ...
44,684
[ { "from": "human", "value": "I have a visual studio 2005 solution which has a web application and a class library project. The web application has a reference to the library project. I'd like the library project's code documentation XML to output to the web application's bin folder, along with the library...
Why does switch ([document currentTool]) { case DrawLine: NSBezierPath * testPath = [[NSBezierPath alloc]init]; //...rest of code that uses testPath.... result in error:syntax error before "*" token for testPath?
The syntax error you are encountering (`error: syntax error before "*" token`) typically occurs due to a couple of common reasons in Objective-C, especially within a `switch` statement. Here are a few possibilities and how to resolve them: 1. **Missing Type Declaration Before `switch`**: Ensure that you have correctly...
45,857
[ { "from": "human", "value": "Why does \nswitch ([document currentTool]) {\n case DrawLine:\n NSBezierPath * testPath = [[NSBezierPath alloc]init];\n //...rest of code that uses testPath....\n\nresult in \nerror:syntax error before \"*\" token\nfor testPath?\n" }, { "from": "gpt",...
With Linux/GCC/C++, I'd like to record something to stderr whenever malloc/free/new/delete are called. I'm trying to understand a library's memory allocations, and so I'd like to generate this output while I'm running unit tests. I use valgrind for mem leak detection, but I can't find an option to make it just log al...
To log memory allocation and deallocation calls in C++, especially when you cannot modify the library's code or recompile it, you can use the technique of overriding the standard memory allocation functions. This can be achieved by defining your own versions of `malloc`, `free`, `new`, and `delete`. By using the `LD_PR...
43,781
[ { "from": "human", "value": "With Linux/GCC/C++, I'd like to record something to stderr whenever malloc/free/new/delete are called. I'm trying to understand a library's memory allocations, and so I'd like to generate this output while I'm running unit tests. I use valgrind for mem leak detection, but I ca...
Having a table with a column like: mydate DATETIME ... I have a query such as: SELECT SUM(foo), mydate FROM a_table GROUP BY a_table.mydate; This will group by the full datetime, including hours and minutes. I wish to make the group by, only by the date YYYY/MM/DD not by the YYYY/MM/DD/HH/mm. How to do this?
To group by just the date part (YYYY/MM/DD) in your SQL query, you can use the `DATE()` function (or an equivalent function depending on your SQL database) to extract the date from the `DATETIME` column. Here's how you can modify your query: ```sql SELECT SUM(foo), DATE(mydate) AS mydate FROM a_table GROUP BY DATE(myd...
49,029
[ { "from": "human", "value": "Having a table with a column like: mydate DATETIME ...\nI have a query such as:\nSELECT SUM(foo), mydate FROM a_table GROUP BY a_table.mydate;\n\nThis will group by the full datetime, including hours and minutes. I wish to make the group by, only by the date YYYY/MM/DD not by th...
Monitor.Pulse/All and Monitor.Wait are useful methods, but I'm getting complaints that when using them in large quantities (I have a DSL designer that spits them out by the dozen), the resulting code becomes unreadable. What do you think?
Using `Monitor.Pulse`, `Monitor.PulseAll`, and `Monitor.Wait` in multithreaded programming can indeed lead to code that quickly becomes difficult to read and maintain, especially when they are used in large quantities or nested in complex logic. Here are a few considerations and suggestions for improving readability an...
44,484
[ { "from": "human", "value": "Monitor.Pulse/All and Monitor.Wait are useful methods, but I'm getting complaints that when using them in large quantities (I have a DSL designer that spits them out by the dozen), the resulting code becomes unreadable. What do you think?\n" }, { "from": "gpt", "valu...
I have two tables Institutions and Results and I want to see if there are any results for institutions that way I can exclude the ones that don't have results. Can I get better performance using a JOIN or using EXISTS? Thank you, -Nimesh
When deciding between using a `JOIN` or `EXISTS` for checking if there are results associated with institutions, the performance can depend on several factors, including the database management system you are using, the structure of your tables, and the indexes available. ### Using JOIN A `JOIN` operation retrieves da...
41,079
[ { "from": "human", "value": "I have two tables Institutions and Results and I want to see if there are any results for institutions that way I can exclude the ones that don't have results.\nCan I get better performance using a JOIN or using EXISTS?\nThank you,\n-Nimesh\n" }, { "from": "gpt", "va...
I want to commit a large amount of XML files which have been modified. However, within the directory that I want to recursively search through, there are many folders/files which have been added locally, these I do not want to commit. Is there a way to do this on the command line? Update: I should have included the SVN...
To commit modified XML files in SVN while ignoring other added files in the directory and forcing the commit (including overriding locks), you can use a combination of SVN commands and command-line tools. Since you're using SVN version 1.4.6, the commands will be quite straightforward but might not include some of the ...
44,185
[ { "from": "human", "value": "I want to commit a large amount of XML files which have been modified. However, within the directory that I want to recursively search through, there are many folders/files which have been added locally, these I do not want to commit.\nIs there a way to do this on the command li...
I own a website and I wonder if there is a script that get files for me from other links on the net a load it to my server. Suppose I found a file with a size of 400 mb, I want to host it on my server. The normal way I used is to download the file to my pc then upload it to my server but is there a script or a way to t...
Yes, you can use a server-side script to download files directly from other links to your server, bypassing the need to download them to your local machine first. One common way to achieve this is by using PHP, which is widely supported on web servers. Here’s a simple example of how you might implement this using PHP:...
44,315
[ { "from": "human", "value": "I own a website and I wonder if there is a script that get files for me from other links on the net a load it to my server.\nSuppose I found a file with a size of 400 mb, I want to host it on my server. The normal way I used is to download the file to my pc then upload it to my ...
I have a JSON as follows { columns : [RULE_ID,COUNTRY_CODE], RULE_ID : [1,2,3,7,9,101,102,103,104,105,106,4,5,100,30], COUNTRY_CODE : [US,US,CA,US,FR,GB,GB,UM,AF,AF,AL,CA,US,US,US] } I need to retrive the column names from the columns entry and then use it to search the rest of the entries using jquer...
To achieve this using jQuery, you can loop through the `columns` array and then use each column name to retrieve its corresponding values from the JSON object. Here's a sample implementation based on your requirements: ```javascript $(document).ready(function() { // Sample JSON data var data = { column...
44,165
[ { "from": "human", "value": "I have a JSON as follows\n{\n columns : [RULE_ID,COUNTRY_CODE],\n RULE_ID : [1,2,3,7,9,101,102,103,104,105,106,4,5,100,30], \n COUNTRY_CODE : [US,US,CA,US,FR,GB,GB,UM,AF,AF,AL,CA,US,US,US]\n}\n\nI need to retrive the column names from the columns entry and then use ...
How do you usually convert line breaks in a form textbox or input=text element to html line breaks? Thanks Edit: Is it always \r\n with all browsers?
To convert line breaks from a form textbox or `input` element into HTML line breaks (`<br>`), you would typically take the text input, replace the line break characters with `<br>` tags, and then use that HTML in your output. The line break characters can differ depending on the platform and user input, but typically, ...
45,914
[ { "from": "human", "value": "How do you usually convert line breaks in a form textbox or input=text element to html line breaks?\nThanks\nEdit: Is it always \\r\\n with all browsers?\n" }, { "from": "gpt", "value": "To convert line breaks from a form textbox or `input` element into HTML line bre...
I'm working on a webcam video streaming application utilizing Flash 8 (AS2) and Flash Media Server 3. Streaming the video live is fairly trivial, but I want to give the publisher the ability to pause their stream, effectively giving the people watching a snapshot instead of realtime video. NetStream has a pause() meth...
In Flash Media Server (FMS) 3 with ActionScript 2 (AS2), the `NetStream.pause()` method is indeed used for subscribers to pause the playback of a stream. Unfortunately, the functionality to directly pause a stream on the publisher side doesn't exist in the same way as it does for subscribers. However, you can implemen...
43,437
[ { "from": "human", "value": "I'm working on a webcam video streaming application utilizing Flash 8 (AS2) and Flash Media Server 3. Streaming the video live is fairly trivial, but I want to give the publisher the ability to pause their stream, effectively giving the people watching a snapshot instead of rea...
What I need to do is convert a C# character to an escaped unicode string: So, 'A' - > "\x0041". Is there a better way to do this than: char ch = 'A'; string strOut = String.Format("\\x{0}", Convert.ToUInt16(ch).ToString("x4"));
Yes, there is a simpler and more concise way to achieve the conversion of a character to an escaped Unicode string in C#. You can utilize string interpolation and the `Convert.ToUInt16()` method directly within an interpolated string. Here's an example of how you can do it: ```csharp char ch = 'A'; string strOut = $@"...
46,424
[ { "from": "human", "value": "What I need to do is convert a C# character to an escaped unicode string:\nSo, 'A' - > \"\\x0041\".\nIs there a better way to do this than:\nchar ch = 'A';\nstring strOut = String.Format(\"\\\\x{0}\", Convert.ToUInt16(ch).ToString(\"x4\"));\n\n" }, { "from": "gpt", "...
I set up MbUnit and have been trying to get it to work with VS 2008 using the MbUnit GUI but every time I run a test it closes and I get a this program needs to close error. I had a similar problem with Gallio where I got a runner exception every time I ran a test. Do I need an addin for VS like testDriven.Net to get t...
When using MbUnit (part of the Gallio test framework) with Visual Studio 2008, you might encounter some compatibility issues, especially if you are experiencing crashes or runner exceptions. Here are a few steps you can take to troubleshoot and resolve these issues: 1. **Update Gallio and MbUnit**: Ensure you are usin...
45,046
[ { "from": "human", "value": "I set up MbUnit and have been trying to get it to work with VS 2008 using the MbUnit GUI but every time I run a test it closes and I get a this program needs to close error.\nI had a similar problem with Gallio where I got a runner exception every time I ran a test.\nDo I need a...
Aloha I have a VS2008 solution to which I want to add a webservice reference. I enter an url like 'http://192.168.100.87:7001/wsdl/IMySOAPWebService'. The Add Web Reference dialog starts looking then throws me this error: There was an error downloading 'http://192.168.100.87:7001/wsdl/IMySOAPWebService/$metadata'. ...
The issue you're facing while adding a web service reference in Visual Studio 2008 may be related to a few different factors, especially since it works fine in Visual Studio 2005. Here are some potential solutions and troubleshooting steps to resolve the issue: 1. **Check the WSDL URL**: Ensure that the URL you're usi...
44,719
[ { "from": "human", "value": "Aloha\nI have a VS2008 solution to which I want to add a webservice reference. I enter an url like 'http://192.168.100.87:7001/wsdl/IMySOAPWebService'. The Add Web Reference dialog starts looking then throws me this error: \n\nThere was an error downloading\n 'http://192.168.10...
I have something like this: public interface IDeviceMonitor { int DeviceId { get; } event DeviceUpdatedHandler NewValueRecieved; void Start(); void Stop(); } public class DeviceInactivityDetector { ... public virtual void DeviceUpdated(IDeviceMonitor device, DeviceUpdatedArgs args) { ......
Yes, it's possible to wire events like the `NewValueReceived` event in your Castle Windsor configuration file. However, XML configuration in Castle Windsor does not directly support event wiring. You typically handle such event wiring in your code. Nevertheless, you can configure your components, and after resolving ...
44,508
[ { "from": "human", "value": "I have something like this:\npublic interface IDeviceMonitor {\n int DeviceId { get; }\n event DeviceUpdatedHandler NewValueRecieved;\n void Start();\n void Stop();\n}\npublic class DeviceInactivityDetector {\n ...\n public virtual void DeviceUpdated(IDeviceMon...
I would like to do something like the following: def add(a, b): #some code def subtract(a, b): #some code operations = [add, subtract] operations[0]( 5,3) operations[1](5,3) In python, is it possible to assign something like a function pointer?
Yes, in Python, you can assign functions to variables and store them in lists, which is similar to using function pointers in languages like C or C++. In your example, you're already doing it correctly. Here's how it works: 1. You define the functions `add` and `subtract`. 2. You create a list called `operations` that...
48,106
[ { "from": "human", "value": "I would like to do something like the following:\ndef add(a, b):\n #some code\n\ndef subtract(a, b):\n #some code\n\noperations = [add, subtract]\noperations[0]( 5,3)\noperations[1](5,3)\n\nIn python, is it possible to assign something like a function pointer?\n" }, { ...
char *values = " 3 1 4 15"; vector<int> array; I want to populate the array with the values, 3,1,4,15 Is there a slick way to do it with the stl copy algorithm?
Yes, you can use the STL algorithms in C++ to populate the `array` with the integers from the `values` string. Here's one way to do this using `std::stringstream` along with `std::copy` and `std::istream_iterator`: ```cpp #include <iostream> #include <vector> #include <sstream> #include <iterator> int main() { ch...
45,951
[ { "from": "human", "value": "char *values = \" 3 1 4 15\";\n\nvector<int> array;\n\nI want to populate the array with the values,\n3,1,4,15\nIs there a slick way to do it with the stl copy algorithm?\n" }, { "from": "gpt", "value": "Yes, you can use the STL algorithms in C++ to populate th...
I need to increment a String in java from "aaaaaaaa" to "aaaaaab" to "aaaaaac" up through the alphabet, then eventually to "aaaaaaba" to "aaaaaabb" etc. etc. Is there a trick for this?
Yes, you can implement a method in Java to increment a string similar to how you would increment a number, with the characters being treated like digits. This can be accomplished by treating the string as a base-26 number where 'a' = 0, 'b' = 1, ..., 'z' = 25, and after 'z' rolls over to 'a' in the next position to the...
45,226
[ { "from": "human", "value": "I need to increment a String in java from \"aaaaaaaa\" to \"aaaaaab\" to \"aaaaaac\" up through the alphabet, then eventually to \"aaaaaaba\" to \"aaaaaabb\" etc. etc.\nIs there a trick for this?\n" }, { "from": "gpt", "value": "Yes, you can implement a method in Jav...
What datatype would be used for storing video files in sql server2000?
In SQL Server 2000, the appropriate datatype for storing video files is `IMAGE`. The `IMAGE` datatype is designed for storing large binary data, which includes images, audio, and video files. However, it's worth noting that the `IMAGE` datatype is considered deprecated in later versions of SQL Server, and it's generall...
47,505
[ { "from": "human", "value": "What datatype would be used for storing video files in sql server2000?\n" }, { "from": "gpt", "value": "In SQL Server 2000, the appropriate datatype for storing video files is `IMAGE`. The `IMAGE` datatype is designed for storing large binary data, which includes ima...
The only documentation I've found for the components of the Castle project I've found here in the form of online HTML files. Does anyone know of anything that is more off-line friendly or printable (e.g. PDF). I've got quite the long train commute and I'd like to put something on my laptop. :-)
While the Castle Project documentation is primarily available online, you have a few options to make it more offline-friendly: 1. **HTML to PDF Conversion**: You can use tools like web browsers (e.g., Chrome or Firefox) to print the HTML pages to PDF. Simply open the documentation page, then use the print function (us...
47,366
[ { "from": "human", "value": "The only documentation I've found for the components of the Castle project I've found here in the form of online HTML files. Does anyone know of anything that is more off-line friendly or printable (e.g. PDF). I've got quite the long train commute and I'd like to put something...
Is there any other way to get a list of file names via T-SQL other than INSERT INTO @backups(filename) EXEC master.sys.xp_cmdshell 'DIR /b c:\some folder with sql backups in it I am attempting to get a list of SQL backup files from a folder to restore and I do NOT want to use the xp_cmdshell for obvious security reas...
Yes, if you want to retrieve a list of SQL backup files from a folder without using `xp_cmdshell`, you can utilize SQL Server's ability to read from file system objects by using SQL CLR (Common Language Runtime) or SQL Server's built-in functions if you have access to SQL Server Agent. **Option 1: Using SQL CLR** You...
43,981
[ { "from": "human", "value": "Is there any other way to get a list of file names via T-SQL other than \nINSERT INTO @backups(filename)\nEXEC master.sys.xp_cmdshell 'DIR /b c:\\some folder with sql backups in it\n\nI am attempting to get a list of SQL backup files from a folder to restore and I do NOT want to...
Is yield return a shortcut for implementing IEnumerable and IEnumerator?
Yes, using `yield return` in C# is a convenient feature that simplifies the implementation of the `IEnumerable` and `IEnumerator` interfaces. When you use `yield return`, the compiler automatically generates the necessary state machine to manage the iteration state, which reduces the boilerplate code typically required...
36,104
[ { "from": "human", "value": "Is yield return a shortcut for implementing IEnumerable and IEnumerator?\n" }, { "from": "gpt", "value": "Yes, using `yield return` in C# is a convenient feature that simplifies the implementation of the `IEnumerable` and `IEnumerator` interfaces. When you use `yield...
Which programming language(s) were used to code Windows Vista?
Windows Vista, like many other versions of the Windows operating system, was developed using a combination of programming languages. The primary languages used in its development included: 1. **C**: This language was widely used for system-level programming, including the core operating system components. 2. **C++**: ...
47,434
[ { "from": "human", "value": "Which programming language(s) were used to code Windows Vista?\n" }, { "from": "gpt", "value": "Windows Vista, like many other versions of the Windows operating system, was developed using a combination of programming languages. The primary languages used in its deve...
I need to change an element's ID using jQuery. Apparently these don't work: jQuery(this).prev("li").attr("id")="newid" jQuery(this).prev("li")="newid" I found out that I can make it happen with the following code: jQuery(this).prev("li")show(function() { this.id="newid"; }); But that doesn't seem right to me. T...
You're on the right track in your attempts to change the ID of an element using jQuery. However, the way you're using the `attr()` method is not correct in your first examples, and using `show()` just to change an ID is indeed unnecessary. You can change the ID of an element directly using jQuery's `attr()` method wi...
44,809
[ { "from": "human", "value": "I need to change an element's ID using jQuery. \nApparently these don't work:\njQuery(this).prev(\"li\").attr(\"id\")=\"newid\"\njQuery(this).prev(\"li\")=\"newid\"\n\nI found out that I can make it happen with the following code:\njQuery(this).prev(\"li\")show(function() {\n ...
Is there a way to get Visual Studio to display strings as verbatim strings (prefixed with '@')? I'd like to easily cut strings containing file paths from Visual Studio into Explorer or other apps. Clarification: when VS displays a string in the auto, watch, immediate, etc. window, I'd like it to be formatted as as verb...
Visual Studio does not natively provide an option to display string values as verbatim strings (with an '@' prefix) in the debugging windows (Auto, Watch, Immediate) directly. However, you can achieve this through a few different methods to ease the process of copying file paths as verbatim strings. Here are a couple o...
45,631
[ { "from": "human", "value": "Is there a way to get Visual Studio to display strings as verbatim strings (prefixed with '@')? I'd like to easily cut strings containing file paths from Visual Studio into Explorer or other apps.\nClarification: when VS displays a string in the auto, watch, immediate, etc. wind...
Should the representation(html, xml, json) returned by a RESTful web service be determined by the url or by the Accept HTTP header?
In a RESTful web service, the representation (such as HTML, XML, or JSON) returned by the service should ideally be determined by the `Accept` HTTP header. This approach follows the principles of content negotiation, which allows the client to specify the type of representation it prefers to receive in the response. #...
47,920
[ { "from": "human", "value": "Should the representation(html, xml, json) returned by a RESTful web service be determined by the url or by the Accept HTTP header?\n" }, { "from": "gpt", "value": "In a RESTful web service, the representation (such as HTML, XML, or JSON) returned by the service shou...
How do I append an object (such as a string or number) to an array in JavaScript?
In JavaScript, you can append an object, such as a string or number, to an array using the `push()` method. This method adds one or more elements to the end of an array and returns the new length of the array. Here’s how you can do it: ### Example ```javascript // Creating an array let myArray = [1, 2, 3]; // Append...
44,985
[ { "from": "human", "value": "How do I append an object (such as a string or number) to an array in JavaScript? \n" }, { "from": "gpt", "value": "In JavaScript, you can append an object, such as a string or number, to an array using the `push()` method. This method adds one or more eleme...
I want to read an specific xml node and its value for example <customers> <name>John</name> <lastname>fetcher</lastname> </customer> and my code behind should be some thing like this (I don't know how it should be though): Response.Write(xml.Node["name"].Value) As I said it is just an example because I don't know ho...
To read specific XML nodes and their values in .NET (for example, using C#), you can use the `System.Xml` namespace, which provides various classes for working with XML data. Below is a simple example demonstrating how to load an XML string, navigate to a specific node, and read its value. Here's a complete example fo...
44,681
[ { "from": "human", "value": "I want to read an specific xml node and its value for example\n<customers>\n<name>John</name>\n<lastname>fetcher</lastname>\n</customer>\n\nand my code behind should be some thing like this (I don't know how it should be though):\nResponse.Write(xml.Node[\"name\"].Value) \n\nAs ...
Which version of JavaScript does Google Chrome support in relation to Mozilla Firefox? In other words, does Chrome support JavaScript 1.6, 1.7, or 1.8 which Firefox also supports or some combination of them?
Google Chrome and Mozilla Firefox both support ECMAScript standards, which are the specifications that define JavaScript. Over the years, the versions of JavaScript (such as 1.6, 1.7, and 1.8) have been largely superseded by the ECMAScript standards (like ES5, ES6/ES2015, and so on). JavaScript 1.6, 1.7, and 1.8 were ...
48,655
[ { "from": "human", "value": "Which version of JavaScript does Google Chrome support in relation to Mozilla Firefox? In other words, does Chrome support JavaScript 1.6, 1.7, or 1.8 which Firefox also supports or some combination of them?\n" }, { "from": "gpt", "value": "Google Chrome and Mozilla...
For what I can read, it is used to dispatch a new thread in a swing app to perform some "background" work, but what's the benefit from using this rather than a "normal" thread? Is not the same using a new Thread and when it finish invoke some GUI method using SwingUtilities.invokeLater?... What am I missing here? http...
You're correct that both `SwingWorker` and a plain `Thread` can be used to perform background tasks in a Swing application, but `SwingWorker` provides some additional functionality that simplifies certain tasks and makes it more suitable for use with Swing's single-threaded GUI model. Here are some of the key benefits...
40,549
[ { "from": "human", "value": "For what I can read, it is used to dispatch a new thread in a swing app to perform some \"background\" work, but what's the benefit from using this rather than a \"normal\" thread?\nIs not the same using a new Thread and when it finish invoke some GUI method using SwingUtilities...
Please point me to a toolkit i can use to build Near Field Communication apps. thanks
To build Near Field Communication (NFC) applications, you can use various toolkits and platforms depending on your target device and development environment. Here are some popular options: 1. **Android NFC API**: - If you're developing for Android, the built-in NFC API allows you to create applications that can rea...
44,336
[ { "from": "human", "value": "Please point me to a toolkit i can use to build Near Field Communication apps.\nthanks\n" }, { "from": "gpt", "value": "To build Near Field Communication (NFC) applications, you can use various toolkits and platforms depending on your target device and development en...
I want to explicitly call a view from my controller. Right now I have: def some_action .. do something ... respond_to do |format| format.xml end end ... then it calls my some_action.xml.builder view. How can I call some other view? Is there a parameter in respond_to I'm missing? Thanks, JP
In a Ruby on Rails controller, the `respond_to` block is used to respond to different formats, such as HTML, XML, JSON, etc. If you want to explicitly call a different view from within your action, you can use the `render` method instead of relying on the default behavior determined by the `respond_to` block. Here's h...
44,043
[ { "from": "human", "value": "I want to explicitly call a view from my controller.\nRight now I have:\ndef some_action\n .. do something ...\n respond_to do |format|\n format.xml\n end\nend\n\n... then it calls my some_action.xml.builder view. How can I call some other view? Is there a parameter in r...
I have a class Application that my global.asax inherits from. The class has this method: protected void Application_Start(object sender, EventArgs e) { // ... } In my understanding this is basically an event handler that is automatically added to an event (based on the method name [*]). I tried to find out what ev...
The `System.Web.HttpApplicationFactory` class is part of the internal implementation of ASP.NET and is not directly exposed in the public API, which is likely why you are unable to find it in the Object Browser or the MSDN library. The `HttpApplicationFactory` class is used by the ASP.NET infrastructure to create insta...
47,475
[ { "from": "human", "value": "I have a class Application that my global.asax inherits from. The class has this method:\nprotected void Application_Start(object sender, EventArgs e)\n{\n // ...\n}\n\nIn my understanding this is basically an event handler that is automatically added to an event (based on th...
If I want to display an underlined value in a TextBlock, I have to use a Run element. (If there's a better/easier way, I'd love to hear about it.) <TextBlock> <Run TextDecorations="Underline" Text="MyText" /> </TextBlock> Ideally, to implement this within a DataTemplate, it would look something like this: <DataTempl...
To underline text within a `TextBlock` using data binding in WPF, you can use the `TextBlock.Inlines` collection, which allows you to add `Run` elements dynamically while still being able to bind to your data. Here's how you can achieve that: 1. Create a `TextBlock` and bind its `Inlines` property using a converter th...
44,382
[ { "from": "human", "value": "If I want to display an underlined value in a TextBlock, I have to use a Run element. (If there's a better/easier way, I'd love to hear about it.)\n<TextBlock>\n <Run TextDecorations=\"Underline\" Text=\"MyText\" />\n</TextBlock>\n\nIdeally, to implement this within a DataTempl...
I have a hidden field that i want to bind to either a function on the page's code behind. I don't quite recall the exact syntax and i can't find the answer via Google. Is the code below correct? Thank. print("<asp:HiddenField ID="dummy" Value='<%#Getdummy() %>' runat="server" />");
The syntax you've provided is almost correct, but there are a couple of issues that need to be addressed to make it work properly in an ASP.NET Web Forms page. 1. When using `<%# %>` for data binding, it should be used inside a data-bound control (like `GridView`, `Repeater`, etc.) or you need to call the `DataBind()...
46,164
[ { "from": "human", "value": "I have a hidden field that i want to bind to either a function on the page's code behind. I don't quite recall the exact syntax and i can't find the answer via Google. Is the code below correct? Thank.\nprint(\"<asp:HiddenField ID=\"dummy\" Value='<%#Getdummy() %>' runat=\"serve...
I run a site using the MODx Content Management System. What I'd like to do is set up a news feed on the front page, with a blog-style backend that supports the usual things (tags, categories, archives basically). I've looked into the MODx plugins which provide this functionality (the deprecated NewsPublisher - which we...
If you're looking for a lightweight, customizable PHP blog or news framework with a decent API that integrates well with MODx, here are a few options you might consider: 1. **MicroMVC**: This is a lightweight MVC framework that allows you to build your own application quickly. You could create a simple blog or news fe...
41,716
[ { "from": "human", "value": "I run a site using the MODx Content Management System. What I'd like to do is set up a news feed on the front page, with a blog-style backend that supports the usual things (tags, categories, archives basically).\nI've looked into the MODx plugins which provide this functionalit...
I need to all of timestamps in a column the same amount. I want to write an sql statement like: update sometable set timecol = timecol + <4 months>;
To update all timestamps in a column by adding 4 months in SQL, you can use the `INTERVAL` keyword (if your database supports it). The exact syntax can vary depending on the SQL database you are using (e.g., MySQL, PostgreSQL, SQL Server, Oracle). Below are examples for some popular SQL databases. ### MySQL ```sql UPD...
47,812
[ { "from": "human", "value": "I need to all of timestamps in a column the same amount.\nI want to write an sql statement like:\nupdate sometable set timecol = timecol + <4 months>;\n" }, { "from": "gpt", "value": "To update all timestamps in a column by adding 4 months in SQL, you can use the `IN...
I've got a large amount of data (a couple gigs) I need to write to a zip file in Python. I can't load it all into memory at once to pass to the .writestr method of ZipFile, and I really don't want to feed it all out to disk using temporary files and then read it back. Is there a way to feed a generator or a file-like ...
Yes, you can indeed write a large amount of data to a zip file in Python without loading it all into memory or using temporary files. The `zipfile` module in Python allows you to write files from a file-like object or a generator by using the `ZipFile.writestr` method in conjunction with a streaming approach. One comm...
41,669
[ { "from": "human", "value": "I've got a large amount of data (a couple gigs) I need to write to a zip file in Python. I can't load it all into memory at once to pass to the .writestr method of ZipFile, and I really don't want to feed it all out to disk using temporary files and then read it back.\nIs there...
I need to start and stop SQL Server from the command line. I am willing to write a small C# program if necessary, but I suspect that there's something (PowerShell, maybe?) that currently exists that does this gracefully. Thank you.
You can indeed start and stop SQL Server from the command line or using PowerShell without having to write a C# program. Below are a couple of options for both Command Prompt and PowerShell. ### Option 1: Using Command Prompt You can use the `net` command to start and stop SQL Server services directly from the Comman...
45,556
[ { "from": "human", "value": "I need to start and stop SQL Server from the command line. I am willing to write a small C# program if necessary, but I suspect that there's something (PowerShell, maybe?) that currently exists that does this gracefully.\nThank you.\n" }, { "from": "gpt", "value": "Y...
In C# if I want to convert a double (1.71472) to an int then I get the answer 2. If I do this in Java using intValue() method, I get 1 as the answer. Does Java round down on conversions? Why do the Java API docs have such scant information about their classes i.e. Returns the value of the specified number as an in...
In Java, when you convert a `double` to an `int`, it does not round the value; instead, it truncates it, meaning it simply removes the decimal portion of the number. Therefore, when you convert `1.71472` to an `int`, it will become `1`, as the fractional part `.71472` is discarded. Here’s a code example in Java: ```j...
47,553
[ { "from": "human", "value": "In C# if I want to convert a double (1.71472) to an int then I get the answer 2. If I do this in Java using intValue() method, I get 1 as the answer.\nDoes Java round down on conversions?\nWhy do the Java API docs have such scant information about their classes i.e. \n\nReturns...
What do you recommend as minimum specs for a Windows laptop running Vista, an IDE, and Apache, MySQL, and PHP?
When considering a minimum specification for a Windows laptop running Windows Vista, along with an IDE, Apache, MySQL, and PHP, it's important to keep in mind the demands of each of these components. Although Windows Vista is quite dated, here are some recommended minimum specifications: ### Minimum Specs 1. **Proces...
44,541
[ { "from": "human", "value": "What do you recommend as minimum specs for a Windows laptop running Vista, an IDE, and Apache, MySQL, and PHP?\n" }, { "from": "gpt", "value": "When considering a minimum specification for a Windows laptop running Windows Vista, along with an IDE, Apache, MySQL, and ...
How are the java API thread priorities (1-10) gets translated to the OS level priorities since most OS don't have thread priority levels (in terms of number) which match this. So keeping in mind , can there be a scenario when two or more threads with different priorities eventually get the same priority at OS level. Pl...
Your understanding touches on an important aspect of how thread management works in Java and how it interacts with the underlying operating system (OS). ### Java Thread Priorities Java provides a mechanism for setting thread priorities using the `Thread` class, with constants ranging from `Thread.MIN_PRIORITY` (1) to...
43,964
[ { "from": "human", "value": "How are the java API thread priorities (1-10) gets translated to the OS level priorities since most OS don't have thread priority levels (in terms of number) which match this.\nSo keeping in mind , can there be a scenario when two or more threads with different priorities eventu...
Let's say that I'm writing a library in C# and I don't know who is going to consume it. The public interface of the library has some unsigned types - uint, ushort. Apparently those types are not CLS-compliant and, theoretically speaking, there may be languages that will not be able to consume them. Are there in realit...
When you are developing a library in C# and want to ensure that it can be consumed by a wide range of .NET languages, you need to consider the Common Language Specification (CLS). The CLS defines a subset of features that all .NET languages must support, ensuring interoperability between them. As you've pointed out, u...
45,213
[ { "from": "human", "value": "Let's say that I'm writing a library in C# and I don't know who is going to consume it. \nThe public interface of the library has some unsigned types - uint, ushort. Apparently those types are not CLS-compliant and, theoretically speaking, there may be languages that will not be...
I have read several documentations about building custom ErrorHandler (by inheriting from IErrorHandler). Unfortunately, I have several doubts about how doing it. The problem is that I don't exactly understand the meaning of the two methods of IErorrHandler (i.e. ProvideFault and HandleError). For me, the HandleError i...
You're on the right track with your understanding of the `IErrorHandler` interface in WCF (Windows Communication Foundation). Let's break down the two methods: `HandleError` and `ProvideFault`. ### 1. HandleError Method The `HandleError` method is called whenever an unhandled exception occurs during the processing of...
39,352
[ { "from": "human", "value": "I have read several documentations about building custom ErrorHandler (by inheriting from IErrorHandler). Unfortunately, I have several doubts about how doing it.\nThe problem is that I don't exactly understand the meaning of the two methods of IErorrHandler (i.e. ProvideFault a...
I am tring to open several instance of IE with the start command in a batch file. For example I want to open www.google.com and www.yahoo.com at the same time in separate windows. Any help would be appreciated. Regards, Aaron
Certainly! You can use a batch file to open multiple instances of Internet Explorer (IE) with different URLs. Below is a simple example of how to do this using the `start` command. 1. Open Notepad (or any text editor of your choice). 2. Copy and paste the following code into the text editor: ```batch @echo off start ...
45,201
[ { "from": "human", "value": "I am tring to open several instance of IE with the start command in a batch file. For example I want to open www.google.com and www.yahoo.com at the same time in separate windows.\nAny help would be appreciated.\nRegards,\nAaron\n" }, { "from": "gpt", "value": "Certa...
I'm using JSLint to go through JavaScript, and it's returning many suggestions to replace == (two equals signs) with === (three equals signs) when doing things like comparing idSele_UNVEHtype.value.length == 0 inside of an if statement. Is there a performance benefit to replacing == with ===? Any performance improveme...
The suggestion from JSLint to replace `==` with `===` is primarily about ensuring type safety and preventing unintended behavior due to type coercion, rather than performance. Here's a breakdown of the differences and implications: ### Key Differences Between `==` and `===` - **`==` (Equality Operator)**: This operat...
44,168
[ { "from": "human", "value": "I'm using JSLint to go through JavaScript, and it's returning many suggestions to replace == (two equals signs) with === (three equals signs) when doing things like comparing idSele_UNVEHtype.value.length == 0 inside of an if statement.\nIs there a performance benefit to replaci...
In my app users need to be able to enter numeric values with decimal places. The iPhone doesn't provides a keyboard that's specific for this purpose - only a number pad and a keyboard with numbers and symbols. Is there an easy way to use the latter and prevent any non-numeric input from being entered without having to ...
Yes, you can allow users to input numeric values with decimal places while using a keyboard that includes numbers and symbols by implementing input validation in your app. One common approach is to use a `UITextField` and set its delegate to handle the input validation. Here’s a simple implementation in Swift that all...
47,692
[ { "from": "human", "value": "In my app users need to be able to enter numeric values with decimal places. The iPhone doesn't provides a keyboard that's specific for this purpose - only a number pad and a keyboard with numbers and symbols.\nIs there an easy way to use the latter and prevent any non-numeric i...
In Ruby, Dir.glob("**/*.rb") (for instance) doesn't traverse symlinked directories. Is it possible to get the ** to traverse symlinks? I'm using two gems which find files this way, but I need them to see files within a symlinked directory.
In Ruby, the `Dir.glob` method does not follow symlinks by default when using the `**` pattern to match directories. However, you can achieve your goal by using the `Find` module, which provides a way to traverse directories, including following symlinks if you set it up properly. Here's how you can use the `Find` mod...
45,089
[ { "from": "human", "value": "In Ruby, Dir.glob(\"**/*.rb\") (for instance) doesn't traverse symlinked directories. Is it possible to get the ** to traverse symlinks?\nI'm using two gems which find files this way, but I need them to see files within a symlinked directory.\n" }, { "from": "gpt", ...
I want to decode a string that has been encoded using the java.net.URLEncoder.encode() method. I tried using the unescape() function in javascript, but a problem occurs for blank spaces because java.net.URLEncoder.encode() converts a blank space to '+' but unescape() won't convert '+' to a blank space.
To decode a string that has been encoded using `java.net.URLEncoder.encode()`, you can use the `decodeURIComponent()` function in JavaScript, which correctly handles the `+` symbol as a space. Here's a step-by-step approach to decode the string: 1. **Use `decodeURIComponent()` to decode the URL-encoded string**. 2. *...
44,831
[ { "from": "human", "value": "I want to decode a string that has been encoded using the java.net.URLEncoder.encode() method.\nI tried using the unescape() function in javascript, but a problem occurs for blank spaces because java.net.URLEncoder.encode() converts a blank space \nto '+' but unescape() won't co...
I have snippets of Html stored in a table. Not entire pages, no tags or the like, just basic formatting. I would like to be able to display that Html as text only, no formatting, on a given page (actually just the first 30 - 50 characters but that's the easy bit). How do I place the "text" within that Html into a stri...
To extract plain text from HTML snippets and strip away all HTML tags, you can use a variety of methods depending on the programming language you're using. Below are some examples in JavaScript, Python, and PHP. ### JavaScript You can use the browser's DOM to parse HTML and extract text content. Here’s a simple examp...
43,997
[ { "from": "human", "value": "I have snippets of Html stored in a table. Not entire pages, no tags or the like, just basic formatting.\nI would like to be able to display that Html as text only, no formatting, on a given page (actually just the first 30 - 50 characters but that's the easy bit).\nHow do I pl...
The Oracle community has a several support sites (here and here) that have lists of errors. The first site even has suggestions for how to fix them. Does anyone know of an equivalent list for Microsoft COM, preferably with Office Interop issues?
Yes, while there isn't a central repository specifically for Microsoft COM errors like there is for Oracle, there are several resources where you can find information related to Microsoft Office Interop issues and COM-related errors: 1. **Microsoft Documentation**: The official Microsoft documentation for Office Inter...
45,167
[ { "from": "human", "value": "The Oracle community has a several support sites (here and here) that have lists of errors. The first site even has suggestions for how to fix them.\nDoes anyone know of an equivalent list for Microsoft COM, preferably with Office Interop issues?\n" }, { "from": "gpt", ...
How do I take a string in Perl and split it up into an array with entries two characters long each? I attempted this: @array = split(/../, $string); but did not get the expected results. Ultimately I want to turn something like this F53CBBA476 in to an array containing F5 3C BB A4 76
To split a string into an array where each entry is two characters long, you can use a regular expression with the `split` function in Perl. However, the regular expression you attempted is incorrect for your specific use case because it splits the string based on every two characters, but it also leaves an empty strin...
45,892
[ { "from": "human", "value": "How do I take a string in Perl and split it up into an array with entries two characters long each?\nI attempted this:\n@array = split(/../, $string);\n\nbut did not get the expected results.\nUltimately I want to turn something like this\nF53CBBA476\n\nin to an array containing...
I have an NHibernate Dao..lets call it MyClassDao for want of a better name. I am writing the following code. MyClassDao myDao = new MyClassDao(); var values = myDao.GetByCriteria(Restrictions.Eq("Status", someStatusValue)); I am using this in a Unit Test to pull back values from the database. However, it is taking o...
Yes, you can limit the result set in NHibernate using the `SetMaxResults` method. This allows you to specify the maximum number of rows you want to retrieve. If you're using criteria queries, you can modify your code like this: ```csharp using NHibernate.Criterion; // Create the DAO instance MyClassDao myDao = new ...
47,283
[ { "from": "human", "value": "I have an NHibernate Dao..lets call it MyClassDao for want of a better name.\nI am writing the following code.\nMyClassDao myDao = new MyClassDao();\n\nvar values = myDao.GetByCriteria(Restrictions.Eq(\"Status\", someStatusValue));\n\nI am using this in a Unit Test to pull back ...
I need to compile a wmi vbscript to executable (to automate configuration in several computers). Any free vbscript compiler or any other suggestions?
Compiling VBScript directly into an executable file is not as straightforward as with some other programming languages, as VBScript is interpreted rather than compiled. However, there are some approaches you can consider to achieve your goal of distributing a script as an executable. ### Options to Compile or Convert ...
43,885
[ { "from": "human", "value": "I need to compile a wmi vbscript to executable (to automate configuration in several computers). Any free vbscript compiler or any other suggestions?\n" }, { "from": "gpt", "value": "Compiling VBScript directly into an executable file is not as straightforward as wit...
i did this in msvc 2005. typedef void (*cleanup_t)(); void func(cleanup_t clean) { cleanup_t(); } Why does this compile? and not give me a warning? ok, it gave me a unreferenced formal parameter warning but originally i did this when clean was in a class no there was no unreferenced formal parameter when this cod...
In your provided code snippet: ```cpp typedef void (*cleanup_t)(); void func(cleanup_t clean) { cleanup_t(); } ``` ### Explanation of the Code 1. **typedef**: The line `typedef void (*cleanup_t)();` defines `cleanup_t` as a type for a pointer to a function that takes no parameters and returns `void`. 2. **Func...
42,967
[ { "from": "human", "value": "i did this in msvc 2005.\ntypedef void (*cleanup_t)();\n\nvoid func(cleanup_t clean)\n{\n cleanup_t();\n}\n\nWhy does this compile? and not give me a warning? ok, it gave me a unreferenced formal parameter warning but originally i did this when clean was in a class no there w...
I use jQuery to make an AJAX POST request to my server, which can return HTTP response with status 302. Then JavaScript just sends GET request to this URL, while I'd like to redirect user to URL in this response. Is this possible?
Yes, it is possible to handle a 302 redirect response in an AJAX POST request using jQuery. By default, when you make an AJAX request, jQuery follows HTTP redirects automatically, which means it won’t return the original 302 status but rather the final result of the redirect. If you want to capture the 302 response an...
46,441
[ { "from": "human", "value": "I use jQuery to make an AJAX POST request to my server, which can return HTTP response with status 302. Then JavaScript just sends GET request to this URL, while I'd like to redirect user to URL in this response. Is this possible?\n" }, { "from": "gpt", "value": "Yes...
Is there a public, free web service that generates tag clouds? I'm looking for something like Google Chart--URL in, image out.
Yes, there are several free web services that can generate tag clouds based on input text. Here are a few options you might consider: 1. **WordArt (formerly Tagul)**: This is a user-friendly service that allows you to create customizable word clouds. You can input your text and choose various shapes, fonts, and colors...
40,657
[ { "from": "human", "value": "Is there a public, free web service that generates tag clouds? I'm looking for something like Google Chart--URL in, image out.\n" }, { "from": "gpt", "value": "Yes, there are several free web services that can generate tag clouds based on input text. Here are a few o...
How do I convert an SQL Server SMALLDATETIME to Unix Timestamp? date was stored as CAST(0x96040474 AS SmallDateTime) in MS Access DB. Data was dumped to SQL and I'm looking to convert those times to Unix Timestamps for MySQL. Thanks AO
To convert a `SMALLDATETIME` value from SQL Server to a Unix timestamp in MySQL, you can follow these steps: 1. **Understand the Format**: A `SMALLDATETIME` in SQL Server has a range from January 1, 1900, to June 6, 2079, and it stores time down to the minute. 2. **Extract the `SMALLDATETIME` Value**: First, you need...
46,264
[ { "from": "human", "value": "How do I convert an SQL Server SMALLDATETIME to Unix Timestamp? \ndate was stored as CAST(0x96040474 AS SmallDateTime) in MS Access DB. Data was dumped to SQL and I'm looking to convert those times to Unix Timestamps for MySQL.\nThanks\nAO\n" }, { "from": "gpt", "v...
I work with a number of new tech support folks. Sometimes, they like to fix small issues which may not be a high priority for our developers. This requires teaching SVN basics to non-programmers, which I've found can get a little tricky. What resources have you found useful? Are there diagrams you typically utilize...
Teaching SVN (Subversion) to non-programmers can indeed be a bit challenging, especially if they are not familiar with version control concepts. Here are some resources and strategies that may help you effectively teach SVN basics: ### Resources 1. **Official SVN Documentation**: - The [Apache Subversion Book](htt...
43,489
[ { "from": "human", "value": "I work with a number of new tech support folks. Sometimes, they like to fix small issues which may not be a high priority for our developers. This requires teaching SVN basics to non-programmers, which I've found can get a little tricky.\nWhat resources have you found useful?...
Is it acceptable to add types to the std namespace. For example, I want a TCHAR-friendly string, so is the following acceptable? #include <string> namespace std { typedef basic_string<TCHAR> tstring; } Or should I use my own namespace?
It is generally not acceptable to add types or modify the `std` namespace in C++. The C++ Standard Library is designed to be a stable and portable interface, and modifying it can lead to undefined behavior, conflicts, or incompatibility with other libraries and code that expects the standard library to remain unchanged...
46,716
[ { "from": "human", "value": "Is it acceptable to add types to the std namespace. For example, I want a TCHAR-friendly string, so is the following acceptable?\n#include <string>\n\nnamespace std\n{\n typedef basic_string<TCHAR> tstring;\n}\n\nOr should I use my own namespace?\n" }, { "from": "gpt...
I am using Rob Connery's excellent MVC Storefront as a loose basis for my new MVC Web App but I'm having trouble porting the LazyList code to VB.NET (don't ask). It seems that VB doesn't allow the GetEnumerator function to be specified twice with only differing return types. Does anyone know how I might get around this...
In VB.NET, you cannot have two methods with the same name and parameter types, even if their return types differ. Since the `GetEnumerator` method is being implemented from two different interfaces (`IEnumerable(Of T)` and `IList(Of T)`), you need to work around this limitation using explicit interface implementation. ...
44,625
[ { "from": "human", "value": "I am using Rob Connery's excellent MVC Storefront as a loose basis for my new MVC Web App but I'm having trouble porting the LazyList code to VB.NET (don't ask).\nIt seems that VB doesn't allow the GetEnumerator function to be specified twice with only differing return types. Do...
If we are going to develop a community website for non geeks, is it ok if we implement openid registration. How much openid is acceptable in non geek community. Anybody having any idea about this.
Implementing OpenID registration for a community website aimed at non-geeks can be a double-edged sword. Here are a few considerations to help you decide if OpenID is suitable for your target audience: ### Pros: 1. **User Convenience**: OpenID allows users to log in with an existing account (like Google or Facebook), ...
46,357
[ { "from": "human", "value": "If we are going to develop a community website for non geeks, is it ok if we implement openid registration. How much openid is acceptable in non geek community. Anybody having any idea about this. \n" }, { "from": "gpt", "value": "Implementing OpenID registration for...
Is there a way to aid gmail in making threads? We are currently using same Subjects to do this, but that really uglyfies the subject a lot.
Gmail automatically groups emails into threads based on the subject line, the participants involved in the email conversation, and the time of the response. If you're looking to improve how Gmail threads emails without cluttering your subject lines, here are some tips: 1. **Use Consistent Subject Lines**: While you wa...
45,950
[ { "from": "human", "value": "Is there a way to aid gmail in making threads? We are currently using same Subjects to do this, but that really uglyfies the subject a lot.\n" }, { "from": "gpt", "value": "Gmail automatically groups emails into threads based on the subject line, the participants in...
I like Nant very much. I do a lot of scripting with NAnt. It is a great little tool. Since NAnt is pre 1.0, when problems occur, I often think if that it is a problem with NAnt itself, but this is not always the case. One funny example: After running the oracle scripts I parsed the log output to make sure there was no ...
It's great to hear that you're enjoying using NAnt for your scripting needs! NAnt is indeed a powerful tool for automating build processes, especially in .NET environments. As for the status of NAnt being pre-1.0 for an extended period, there are several reasons why some projects may remain in a pre-1.0 state for a l...
44,105
[ { "from": "human", "value": "I like Nant very much. I do a lot of scripting with NAnt. It is a great little tool.\nSince NAnt is pre 1.0, when problems occur, I often think if that it is a problem with NAnt itself, but this is not always the case.\nOne funny example: After running the oracle scripts I parse...
I've been Googling around for .htaccess redirection information, but nothing I find is quite what I'm looking for. Basically, I want a solution that will take a site example.com and allow you to enter URL's like: 123.example.com ksdfkjds.example.com dsf38jif348.example.com and this would redirect them to: example....
To achieve the desired functionality of redirecting subdomains to corresponding paths in your main domain using an `.htaccess` file, you can use mod_rewrite, which allows you to define rules for URL rewriting and redirection. Here's a step-by-step guide to set this up: 1. **Enable mod_rewrite**: Ensure that the Apach...
40,422
[ { "from": "human", "value": "I've been Googling around for .htaccess redirection information, but nothing I find is quite what I'm looking for.\nBasically, I want a solution that will take a site example.com and allow you to enter URL's like:\n 123.example.com\n ksdfkjds.example.com\n dsf38jif348.example.co...
In SQL Server (in my case, 2005) how can I add the identity property to an existing table column using T-SQL? Something like: alter table tblFoo alter column bar identity(1,1)
In SQL Server, you cannot directly add the `IDENTITY` property to an existing column using the `ALTER TABLE` statement. Instead, you typically need to create a new column with the `IDENTITY` property, copy the data over, and then drop the old column. Here’s how you can do that step-by-step: 1. **Create a new column wi...
44,954
[ { "from": "human", "value": "In SQL Server (in my case, 2005) how can I add the identity property to an existing table column using T-SQL?\nSomething like:\nalter table tblFoo \n alter column bar identity(1,1)\n\n" }, { "from": "gpt", "value": "In SQL Server, you cannot directly add the `IDEN...
I'm looking for a server which is: Lightweight, Non-buggy, Supports .NET, Runs on client for testing, Runs on Windows Cassinni is too buggy, IIS is too expensive, Apache is hard to setup, XSP is linux only Visual Web Developer's is cutting it.
It sounds like you're looking for a lightweight and reliable web server for .NET development and testing on a Windows environment. While Cassini and IIS may not fit your needs, here are a few alternatives you might consider: 1. **Kestrel**: - Kestrel is a cross-platform web server for ASP.NET Core applications. It...
44,343
[ { "from": "human", "value": "I'm looking for a server which is:\nLightweight,\nNon-buggy,\nSupports .NET,\nRuns on client for testing,\nRuns on Windows\n\nCassinni is too buggy, IIS is too expensive, Apache is hard to setup, XSP is linux only\n\nVisual Web Developer's is cutting it.\n" }, { "from": ...
Is there a way to find the application name of the current active window at a given time on Mac OS X using Python?
Yes, you can find the application name of the currently active window on macOS using Python. One way to accomplish this is by using the `pyobjc` library, which provides a bridge between Python and Objective-C, allowing you to interact with macOS's Cocoa framework. Here's a step-by-step guide to achieving this: 1. **...
46,402
[ { "from": "human", "value": "Is there a way to find the application name of the current active window at a given time on Mac OS X using Python?\n" }, { "from": "gpt", "value": "Yes, you can find the application name of the currently active window on macOS using Python. One way to accomplish this...
Sounds easy, but I can't find where this built in class and others exists in the documentation. I use functions but want to know what there is on the OO side.
It sounds like you're looking for information on built-in classes in a particular programming language. Since you didn't specify which language you're referring to, I'll provide a brief overview for a few common programming languages. If you have a specific language in mind, please let me know! ### Python In Python, b...
44,143
[ { "from": "human", "value": "Sounds easy, but I can't find where this built in class and others exists in the documentation. I use functions but want to know what there is on the OO side.\n" }, { "from": "gpt", "value": "It sounds like you're looking for information on built-in classes in a part...
anyone able to tell me how often a materialized view is set to refresh with the following setting plz? REFRESH FORCE ON DEMAND START WITH sysdate+0 NEXT (round(sysdate) + 1/24) + 1 i think i read it as every hour but i'm not sure
The `REFRESH FORCE ON DEMAND START WITH` and `NEXT` clauses define how often a materialized view will refresh in Oracle. Let's break down the setting you provided: - **START WITH sysdate + 0**: This means that the materialized view will start the first refresh immediately (at the current time). - **NEXT (round(sysda...
47,250
[ { "from": "human", "value": "anyone able to tell me how often a materialized view is set to refresh with the following setting plz?\nREFRESH FORCE ON DEMAND START WITH sysdate+0 NEXT (round(sysdate) + 1/24) + 1\ni think i read it as every hour but i'm not sure\n" }, { "from": "gpt", "value": "Th...
I would like to use [Authorize] for every action in my admin controller except the Login action. [Authorize (Roles = "Administrator")] public class AdminController : Controller { // what can I place here to disable authorize? public ActionResult Login() { return View(); } }
To apply the `[Authorize]` attribute to all actions in your `AdminController` while excluding a specific action (like the `Login` action), you can use the `[AllowAnonymous]` attribute on the action you want to exclude from authorization. Here's how you can implement this: ```csharp [Authorize(Roles = "Administrator")...
42,696
[ { "from": "human", "value": "I would like to use [Authorize] for every action in my admin controller except the Login action. \n[Authorize (Roles = \"Administrator\")]\npublic class AdminController : Controller\n{\n // what can I place here to disable authorize?\n public ActionResult Login()\n {\n ...
Should I have background color for a form input? Or this is really a subjective matter? For me personally I thought having background color for a form, kind of makes it more organized and clean. What are your views on this?
The choice of whether to use a background color for form inputs is indeed somewhat subjective, but it can also be informed by principles of usability and design best practices. ### Benefits of Using Background Color for Form Inputs 1. **Clarity and Focus**: A distinct background color can help users easily identify w...
44,161
[ { "from": "human", "value": "Should I have background color for a form input? Or this is really a subjective matter?\nFor me personally I thought having background color for a form, kind of makes it more organized and clean.\nWhat are your views on this?\n" }, { "from": "gpt", "value": "The choi...
How can I find out which row in a JTable the user just clicked?
In a Java Swing application, you can determine which row in a `JTable` the user just clicked by adding a mouse listener to the table. You can use the `MouseEvent` to get the row index from the point where the mouse was clicked. Here's a step-by-step guide on how to do this: ### Step 1: Create a Mouse Listener You can...
42,576
[ { "from": "human", "value": "How can I find out which row in a JTable the user just clicked?\n" }, { "from": "gpt", "value": "In a Java Swing application, you can determine which row in a `JTable` the user just clicked by adding a mouse listener to the table. You can use the `MouseEvent` to get ...
I read through the Wikipedia article Existential types. I gathered that they're called existential types because of the existential operator (∃). I'm not sure what the point of it is, though. What's the difference between T = ∃X { X a; int f(X); } and T = ∀x { X a; int f(X); } ?
The distinction between existential types (∃) and universal types (∀) is fundamental in type theory and programming languages, particularly when dealing with polymorphism. 1. **Existential Types (∃)**: The type `T = ∃X { X a; int f(X); }` signifies that there exists some type `X` such that `X` has a value `a`, and ...
44,465
[ { "from": "human", "value": "I read through the Wikipedia article Existential types. I gathered that they're called existential types because of the existential operator (∃). I'm not sure what the point of it is, though. What's the difference between \nT = ∃X { X a; int f(X); }\n\nand\nT = ∀x { X a; int f(X...
How can I do for inserting a Default Value into a column of a table in Access? I use this instruction: ALTER TABLE Tabella ADD Campo Double DEFAULT 0 ALTER TABLE Tabella ADD Campo Double DEFAULT (0) ALTER TABLE Tabella ADD Campo DEFAULT 0 ALTER TABLE Tabella ADD Campo DEFAULT (0) ALTER TABLE Tabella ADD Campo SET DEFAU...
In Microsoft Access, the `ALTER TABLE` statement does not allow you to directly add a new column with a default value in one command. Instead, you need to take two steps: first, add the column, and then modify it to set the default value. Here’s how you can do that: ### Step 1: Add the new column You first need to ad...
48,159
[ { "from": "human", "value": "How can I do for inserting a Default Value into a column of a table in Access?\nI use this instruction:\nALTER TABLE Tabella ADD Campo Double DEFAULT 0\nALTER TABLE Tabella ADD Campo Double DEFAULT (0)\nALTER TABLE Tabella ADD Campo DEFAULT 0\nALTER TABLE Tabella ADD Campo DEFAU...
I have a query to the effect of SELECT t3.id, a,bunch,of,other,stuff FROM t1, t2, t3 WHERE (associate t1,t2, and t3 with each other) GROUP BY t3.id LIMIT 10,20 I want to know to many total rows this query would return without the LIMIT (so I can show pagination information). Normally, I would use this query: SELECT...
In SQL, when you use a `GROUP BY` clause, it aggregates rows into groups based on the specified columns, which can lead to confusion when counting rows. If you want to count the total number of unique groups that would be returned by your original query (before applying the `LIMIT`), you can use a subquery to achieve t...
45,119
[ { "from": "human", "value": "I have a query to the effect of\nSELECT t3.id, a,bunch,of,other,stuff FROM t1, t2, t3 \nWHERE (associate t1,t2, and t3 with each other) \nGROUP BY t3.id \nLIMIT 10,20\n\nI want to know to many total rows this query would return without the LIMIT (so I can show pagination informa...
class Trial { static int i; int getI() { return i;} void setI(int value) { i = value;} } public class ttest { public static void main(String args[]) { Trial t1 = new Trial(); t1.setI(10); System.out.println(t1.getI()); Trial t2 = new Trial(); ...
Yes, the way you are accessing the static variable `i` from the `Trial` class in the static `main` method of the `ttest` class is correct. In Java, static variables belong to the class itself rather than any specific instance of the class. This means that you can access the static variable `i` directly through any ins...
45,953
[ { "from": "human", "value": "class Trial \n{ static int i; \n int getI() \n { return i;} \n void setI(int value) \n { i = value;} \n} \npublic class ttest \n{ public static void main(String args[]) \n { Trial t1 = new Trial(); \n t1.setI(10); \n System.out.print...
I am trying to use the actual numerical value for the month on a sql query to pull results. Is there any way to do this without having a function to change the numbers to actual month names, then back to month numbers? The following code works for Names, what works for numbers? datename(month,(convert(datetime,DTSTA...
Yes, you can use numerical values directly in your SQL query without needing to convert back and forth between month names and numbers. If you're looking to pull results based on a specific month, you can use the `MONTH()` function to extract the month as a number from your date column. Here’s how you can do it: ```...
48,711
[ { "from": "human", "value": "I am trying to use the actual numerical value for the month on a sql query to pull results. Is there any way to do this without having a function to change the numbers to actual month names, then back to month numbers? The following code works for Names, what works for numbers...
I need to detect Image format to save a image like image1.jpg, image2.gif, but i only have a stream, and i do not know the image format(gif, jpeg, png, etc) Is there a way to detect imageformat from a stream?
Yes, you can detect the image format from a stream by reading the initial bytes of the stream and checking for specific magic numbers or signatures associated with common image formats. Here’s how you can do it in Python using the `PIL` (Pillow) library or just by reading the stream directly: ### Method 1: Using Pillo...
41,400
[ { "from": "human", "value": "I need to detect Image format to save a image like image1.jpg, image2.gif, but i only have a stream, and i do not know the image format(gif, jpeg, png, etc)\nIs there a way to detect imageformat from a stream?\n" }, { "from": "gpt", "value": "Yes, you can detect the ...
In postgres I am fairly sure you can do something like this SELECT authors.stage_name, count(select id from books where books.author_id = authors.id) FROM authors, books; Essentially, in this example I would like to return a list of authors and how many books each has written.... in the same query. Is this ...
Yes, your initial approach can be simplified and corrected for SQL syntax. You can achieve what you want using a `JOIN` combined with the `COUNT` function and a `GROUP BY` clause. The query would look something like this: ```sql SELECT authors.stage_name, COUNT(books.id) AS book_count FROM authors LEFT JOIN b...
46,063
[ { "from": "human", "value": "In postgres I am fairly sure you can do something like this\nSELECT\n authors.stage_name, \n count(select id from books where books.author_id = authors.id) \nFROM\n authors,\n books;\n\nEssentially, in this example I would like to return a list of authors and how many books...
How to calculate minute difference between two date-times in PHP?
In PHP, you can calculate the minute difference between two date-time objects using the `DateTime` class along with the `DateInterval` class. Here's a step-by-step guide on how to do it: ### Step 1: Create DateTime Objects You can create `DateTime` objects from your date-time strings. ### Step 2: Calculate the Differ...
45,341
[ { "from": "human", "value": "How to calculate minute difference between two date-times in PHP?\n" }, { "from": "gpt", "value": "In PHP, you can calculate the minute difference between two date-time objects using the `DateTime` class along with the `DateInterval` class. Here's a step-by-step guid...
There used to be a great one at this blog: http://www.hanneyetc.co.uk/ but it is offline now.
It looks like the blog you mentioned is no longer available. Unfortunately, websites can go offline for various reasons, including domain issues, hosting problems, or the owner deciding to shut it down. If you're looking for specific content that was on that blog, you might try: 1. **Wayback Machine**: Visit the Inter...
48,839
[ { "from": "human", "value": "There used to be a great one at this blog: http://www.hanneyetc.co.uk/ but it is offline now.\n" }, { "from": "gpt", "value": "It looks like the blog you mentioned is no longer available. Unfortunately, websites can go offline for various reasons, including domain is...