instruction
stringlengths
14
27.6k
completion
stringlengths
3
38.3k
__original_row_idx
int64
0
50k
conversations
listlengths
2
2
After creating a instance of a class, can we invoke the constructor explicitly? For example class A{ A(int a) { } } A instance; instance.A(2); Can we do this?
In most object-oriented programming languages, including Java and C++, constructors cannot be called explicitly after an instance of the class has already been created. Once an instance of a class is created, the constructor is only called once, at the time of object creation. In your example, you are trying to invoke...
36,550
[ { "from": "human", "value": "After creating a instance of a class, can we invoke the constructor explicitly?\nFor example\nclass A{\n A(int a)\n {\n }\n}\n\nA instance;\n\ninstance.A(2);\n\nCan we do this?\n" }, { "from": "gpt", "value": "In most object-oriented programming languages, i...
I've always been using the cookie-based session store, and never even knew about Cookies until now. So is there any situation where I'd need the cookies hash?
Yes, there are several situations where you might need to work with the cookies hash directly, even if you're primarily using a cookie-based session store. Here are a few scenarios: 1. **Custom Data Storage**: If you want to store additional information in cookies beyond what is provided by the session store, you woul...
36,912
[ { "from": "human", "value": "I've always been using the cookie-based session store, and never even knew about Cookies until now. So is there any situation where I'd need the cookies hash?\n" }, { "from": "gpt", "value": "Yes, there are several situations where you might need to work with the coo...
I have a .net transaction with a SQL insert to a SQL Server 2005 database. The table has an identity primary key. When an error occurs within the transaction, Rollback() is called. The row inserts are rolled back correctly, however the next time I insert data to the table, the identity is incremented as if the rollbac...
The behavior you're experiencing with SQL Server's identity columns is by design. When you use an identity column in SQL Server, it generates a unique value for each new row inserted into the table. When a transaction that inserts a row fails and is rolled back, the identity value that was generated during that failed ...
35,667
[ { "from": "human", "value": "I have a .net transaction with a SQL insert to a SQL Server 2005 database. The table has an identity primary key. \nWhen an error occurs within the transaction, Rollback() is called. The row inserts are rolled back correctly, however the next time I insert data to the table, the...
I read about this ages ago but never tried it now I can't remember if this is possible or not. Is it possible to extend a class from two parents on php5 e.g. class_d extends class_c and class_b moreover can you do this if class_c and class_b are themselves extended from class_a ... so you get something like this ...
In PHP 5, you cannot directly extend a class from multiple parents, as PHP does not support multiple inheritance. This means you cannot create a class that inherits from two or more classes simultaneously. In your example, where you want `class_d` to extend both `class_b` and `class_c`, it is not possible. The syntax ...
36,230
[ { "from": "human", "value": "I read about this ages ago but never tried it now I can't remember if this is possible or not. Is it possible to extend a class from two parents on php5 e.g.\nclass_d extends class_c and class_b\nmoreover can you do this if class_c and class_b are themselves extended from class_...
I need a good stemming algorithm for a project I'm working on. It was suggested that I look at the Porter Stemmer. When I checked out the page on the Porter stemmer I found that it is deprecated now in favor of the "Snowball" stemmer. I need a good stemmer, but I can't really spend significant time implementing (or opt...
The Snowball stemmer is indeed a highly regarded option for stemming in natural language processing tasks, and it's often considered a more updated and improved alternative to the original Porter Stemmer. Snowball supports multiple languages and is implemented in various programming languages, making it a versatile cho...
34,864
[ { "from": "human", "value": "I need a good stemming algorithm for a project I'm working on. It was suggested that I look at the Porter Stemmer. When I checked out the page on the Porter stemmer I found that it is deprecated now in favor of the \"Snowball\" stemmer.\nI need a good stemmer, but I can't really...
Few of us would deny the awesomeness of debuggers, but to make it more useful, some tricks can be used. For example in Python, you can use pass to do absolutely nothing except to leave you room to put a break point and allow you to observe the values in the Watch window. In C#, I used to do GC.Collect(), but now I us...
In Python, one playful dummy line I sometimes use is: ```python import pdb; pdb.set_trace() ``` This line sets a breakpoint in the code, allowing you to inspect variables and step through your code interactively at that point. It's a quick and playful way to enter the debugging mode without cluttering your code with ...
38,733
[ { "from": "human", "value": "Few of us would deny the awesomeness of debuggers, but to make it more useful, some tricks can be used. \nFor example in Python, you can use pass to do absolutely nothing except to leave you room to put a break point and allow you to observe the values in the Watch window. \nIn ...
I am trying to set two dynamic nameserver IP addresses in my QNX system. I have been able to use confstr to set up an address by setting a _nameserver=xxx.xxx.xxx.xxx string into _CS_RESOLVE. Then res_search returns the correct IP address for a given name. I actually have two questions: How do I set up two nameser...
In QNX, setting up multiple nameservers can be accomplished by configuring the `_CS_RESOLVE` string. However, it's important to ensure that the format is correct for defining multiple nameserver IP addresses. ### 1. Setting Up Two Nameservers with `setconf` To specify multiple nameservers, you should create a string ...
35,734
[ { "from": "human", "value": "I am trying to set two dynamic nameserver IP addresses in my QNX system. I have been able to use confstr to set up an address by setting a _nameserver=xxx.xxx.xxx.xxx string into _CS_RESOLVE. Then res_search returns the correct IP address for a given name. I actually have tw...
I am writing a script which is likely to be modified by users. Currently I am storing the configuration settings inside the script. It exists in the form of a hash-of-hashes. I would like to guard against people accidentally using lowercase characters in the hash keys, because that will break my script. It would be sim...
To ensure that all the keys in your top-level hash are converted to uppercase, you can iterate through the hash and update the keys accordingly. Below is a simple example of how you could implement this in Perl, which I'm assuming is the language you're working in based on your mention of hashes. Here's an example of ...
36,543
[ { "from": "human", "value": "I am writing a script which is likely to be modified by users. Currently I am storing the configuration settings inside the script. It exists in the form of a hash-of-hashes.\nI would like to guard against people accidentally using lowercase characters in the hash keys, because ...
I have something like the following in an ASP.NET MVC application: IEnumerable<string> list = GetTheValues(); var selectList = new SelectList(list, "SelectedValue"); And even thought the selected value is defined, it is not being selected on the view. I have this feeling I'm missing something here, so if anyone can p...
It sounds like you encountered an issue with the `SelectList` in ASP.NET MVC where the selected value isn't being reflected in the view. In your case, it appears that you're trying to set a selected value from a list of strings, which can be a bit tricky. The constructor for `SelectList` takes the collection of items...
35,167
[ { "from": "human", "value": "I have something like the following in an ASP.NET MVC application:\nIEnumerable<string> list = GetTheValues();\nvar selectList = new SelectList(list, \"SelectedValue\");\n\nAnd even thought the selected value is defined, it is not being selected on the view. I have this feeling...
I have the following code: Using cmd As SqlCommand = Connection.CreateCommand cmd.CommandText = "UPDATE someTable SET Value = @Value" cmd.CommandText &= " WHERE Id = @Id" cmd.Parameters.AddWithValue("@Id", 1234) cmd.Parameters.AddWithValue("@Value", "myValue") cmd.ExecuteNonQuery End Using I wonder...
To retrieve the final SQL statement as a string with the parameter values interpolated, you would need to manually replace the parameters in the command text with their corresponding values. However, it's important to note that this approach should be used cautiously, especially with string values, to avoid SQL injecti...
35,936
[ { "from": "human", "value": "I have the following code:\nUsing cmd As SqlCommand = Connection.CreateCommand\n cmd.CommandText = \"UPDATE someTable SET Value = @Value\"\n cmd.CommandText &= \" WHERE Id = @Id\"\n cmd.Parameters.AddWithValue(\"@Id\", 1234)\n cmd.Parameters.AddWithValue(\"@Value\", ...
I am powering a web search using Sphinx, and am getting the following error message while building the indexes: WARNING: sort_hits: merge_block_size=76 kb too low, increasing mem_limit may improve performance The problem is I can't find any documentation on where this setting is configured. I'm somewhat versed on Sph...
The warning message you're encountering in Sphinx indicates that the `merge_block_size` is set too low, and it suggests increasing the `mem_limit` to improve performance during the indexing process. To configure this setting, you can adjust it in the Sphinx configuration file, typically named `sphinx.conf`. Here are t...
37,452
[ { "from": "human", "value": "I am powering a web search using Sphinx, and am getting the following error message while building the indexes:\n\nWARNING: sort_hits: merge_block_size=76 kb too low, increasing mem_limit may improve performance\n\nThe problem is I can't find any documentation on where this sett...
In the mercurial repo i can see it. I think that mercurial already have this feature with the revision graph. How i've to configure tortoisehg to achieve that? I want to have something like this for the hgweb.
To configure TortoiseHg to visualize the revision graph in a way similar to hgweb, you need to set up your repository and configure certain settings. TortoiseHg provides a built-in graphical user interface for managing Mercurial repositories, which includes visualizing the revision graph. Here are the steps to achieve...
34,973
[ { "from": "human", "value": "In the mercurial repo i can see it.\nI think that mercurial already have this feature with the revision graph.\nHow i've to configure tortoisehg to achieve that?\nI want to have something like this for the hgweb.\n" }, { "from": "gpt", "value": "To configure Tortoise...
In some code I've inherited, I see frequent use of size_t with the std namespace qualifier. For example: std::size_t n = sizeof( long ); It compiles and runs fine, of course. But it seems like bad practice to me (perhaps carried over from C?). Isn't it true that size_t is built into C++ and therefore in the global n...
You're correct in noting that `size_t` is a type that is part of the C and C++ standard libraries, but the way you access it can depend on the context of your code. 1. **Namespace of `size_t`:** In C++, `size_t` is defined in the global namespace, but it is included in various standard headers. In C++, `size_t` is typ...
35,552
[ { "from": "human", "value": "In some code I've inherited, I see frequent use of size_t with the std namespace qualifier. For example:\nstd::size_t n = sizeof( long );\n\nIt compiles and runs fine, of course. But it seems like bad practice to me (perhaps carried over from C?).\nIsn't it true that size_t is...
I want to detect and replace malformed UTF-8 characters with blank space using a Perl script while loading the data using SQL*Loader. How can I do this?
To detect and replace malformed UTF-8 characters with a blank space in a Perl script while loading data with SQL*Loader, you can follow these steps: 1. **Create a Perl script** to process the input data and replace any malformed UTF-8 characters. 2. **Use SQL*Loader** to load the cleaned data into your database. Here...
30,192
[ { "from": "human", "value": "I want to detect and replace malformed UTF-8 characters with blank space using a Perl script while loading the data using SQL*Loader. How can I do this? \n" }, { "from": "gpt", "value": "To detect and replace malformed UTF-8 characters with a blank space in a Perl sc...
I want to be able to check the status of a publication and subscription in SQL Server 2008 T-SQL. I want to be able to determine if its okay, when was the last successful, sync, etc.. Is this possible?
Yes, in SQL Server 2008, you can check the status of publications and subscriptions in replication using several system views and stored procedures. Below are some examples that will help you determine the status of your replication setup, including the last successful sync times and any errors that may have occurred. ...
34,105
[ { "from": "human", "value": "I want to be able to check the status of a publication and subscription in SQL Server 2008 T-SQL. I want to be able to determine if its okay, when was the last successful, sync, etc.. Is this possible?\n" }, { "from": "gpt", "value": "Yes, in SQL Server 2008, you ca...
When SIO_FLUSH socket ioctl is used in a Windows environment (in user space), I am confused as to what happens. Does this: (1) completely discard the data from the TCP/IP send queue into a black hole, or (2) push the queued send data across the connection until the buffer is empty, or (3) something else? Thanks!
In a Windows environment, the `SIO_FLUSH` socket ioctl is used to flush the send buffer of a socket. Specifically, when you invoke this operation, it behaves as follows: 1. **Flush Queued Data**: It does not simply discard data into a black hole. Instead, the `SIO_FLUSH` command attempts to push any queued send data t...
37,590
[ { "from": "human", "value": "When SIO_FLUSH socket ioctl is used in a Windows environment (in user space), I am confused as to what happens. Does this: (1) completely discard the data from the TCP/IP send queue into a black hole, or (2) push the queued send data across the connection until the buffer is em...
It is really annoying. Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new mainForm()); <-- pausing visual studio breaks here. Thanks guys.
It sounds like you're encountering an issue where Visual Studio pauses or stops responding when trying to run your Windows Forms application. Here are some troubleshooting steps you can take to resolve the issue: 1. **Check for Infinite Loops**: Ensure that there's no infinite loop or blocking code in the `mainForm` c...
35,779
[ { "from": "human", "value": "It is really annoying.\nApplication.EnableVisualStyles();\nApplication.SetCompatibleTextRenderingDefault(false);\nApplication.Run(new mainForm()); <-- pausing visual studio breaks here.\n\nThanks guys.\n" }, { "from": "gpt", "value": "It sounds like you're encounteri...
From time to time, I run into communications issue with other programmers, when we talk about NULL. Now NULL could be a NULL pointer the NUL character an empty data element in some sort of database. NUL seems to be the most confusing. It is the ASCII character 0x00. I tend to use '\0' in my code to represent...
When it comes to representing the NUL character (ASCII character 0x00) in code, I recommend using `'\0'` for clarity and readability. Here's why: 1. **Clarity**: Using `'\0'` explicitly indicates that you are working with a character, specifically the NUL character. This is particularly important in contexts like C or...
34,944
[ { "from": "human", "value": "From time to time, I run into communications issue with other programmers, when we talk about NULL. Now NULL could be\n\n a NULL pointer\n the NUL character\n an empty data element in some sort of database.\n NUL seems to be the most confusing. It is the ASCII character 0x0...
A cross join performs a cartesian product on the tuples of the two sets. SELECT * FROM Table1 CROSS JOIN Table2 Which circumstances render such an SQL operation particularly useful?
A cross join, which produces the Cartesian product of two tables, can be particularly useful in several scenarios: 1. **Generating Combinations**: When you need to generate all possible combinations of rows from two tables. For example, if you have a table of products and a table of promotions, a cross join can help y...
32,427
[ { "from": "human", "value": "A cross join performs a cartesian product on the tuples of the two sets.\nSELECT *\nFROM Table1\nCROSS JOIN Table2\n\nWhich circumstances render such an SQL operation particularly useful?\n" }, { "from": "gpt", "value": "A cross join, which produces the Cartesian pro...
Since a few days ago, MySQL server on my Windows machine was not successful on closing itself. I found multiple instance of these lines in the MySQL error log: InnoDB: Operating system error number 32 in a file operation. InnoDB: The error means that another program is using InnoDB's files. InnoDB: This might be a back...
It sounds like you've encountered a common issue where multiple instances of MySQL are trying to access the same InnoDB data files. This can lead to the errors you mentioned in your MySQL error log. Here are a few steps you can take to prevent this issue from happening again in the future: 1. **Check for Multiple Serv...
34,997
[ { "from": "human", "value": "Since a few days ago, MySQL server on my Windows machine was not successful on closing itself. I found multiple instance of these lines in the MySQL error log:\nInnoDB: Operating system error number 32 in a file operation.\nInnoDB: The error means that another program is using I...
I want to do this in Actionscript: typeof(control1) != typeof(control2) to test if two objects are of the same type. This would work just fine in C#, but in Actionscript it doesnt. In fact it returns 'object' for both typeof() expressions because thats the way Actionscript works. I couldn't seem to find an alternative...
In ActionScript, you can check the runtime type of an object using the `getQualifiedClassName` function from the `flash.utils` package. This function returns the fully qualified class name of an object, which can be used to compare the types of two objects. Here’s how you can implement your type checking logic using `...
37,411
[ { "from": "human", "value": "I want to do this in Actionscript:\ntypeof(control1) != typeof(control2)\n\nto test if two objects are of the same type. This would work just fine in C#, but in Actionscript it doesnt. In fact it returns 'object' for both typeof() expressions because thats the way Actionscript w...
Pretty new to css and trying to make the tags on my page smaller on all sides. What are the best settings to modify? Margin doesn't seem to do what I want. .story .content .tags .tag { margin: 10px 5px 10px 5px; background-color: #99FF33; font-weight: 500; color: #330099; font-style: inherit; fo...
To make the tags smaller vertically, you should focus on adjusting the `padding` and possibly the `line-height` properties in your CSS. The `padding` controls the space inside the tag itself, affecting its height, while the `line-height` determines the height of the line that the text occupies. Here's an example of h...
35,976
[ { "from": "human", "value": "Pretty new to css and trying to make the tags on my page smaller on all sides. What are the best settings to modify? Margin doesn't seem to do what I want.\n.story .content .tags .tag\n{\n margin: 10px 5px 10px 5px;\n background-color: #99FF33;\n font-weight: 500;\n ...
I have a server process built in Delphi/C++Builder with RemObjects SDK which claims to support SOAP requests. What's the quickest and easiest way of testing out the SOAP support? I'd prefer not to have to learn a new language/install a new IDE/spend more than a day... To clarify this, I'm already connecting to the serv...
To test the SOAP support of your server process without needing to learn a new language, install new IDEs, or spend more than a day, you can use existing tools that simplify SOAP requests. Here are some straightforward options: ### 1. SoapUI SoapUI is a popular tool for testing SOAP and REST web services. It’s user-fr...
36,275
[ { "from": "human", "value": "I have a server process built in Delphi/C++Builder with RemObjects SDK which claims to support SOAP requests.\nWhat's the quickest and easiest way of testing out the SOAP support? I'd prefer not to have to learn a new language/install a new IDE/spend more than a day...\nTo clari...
I would like to add some icons to my treeview. Is there a way to do it within the XAML? <TreeView Height="200" Name="treeView1" Width="120"> <TreeViewItem Header="Topic1" IsExpanded="True"> <TreeViewItem Header="Subtopic2" /> <TreeViewItem Header="Subtopic3" /> </TreeViewItem...
Yes, you can add icons (or images) to a `TreeView` in XAML by utilizing the `ItemTemplate` property of the `TreeViewItem`. You can use an `Image` control along with a `StackPanel` or any other layout control to arrange the icon and the header text. Here’s an example of how you can modify your `TreeView` to include ico...
33,545
[ { "from": "human", "value": "I would like to add some icons to my treeview. Is there a way to do it within the XAML?\n <TreeView Height=\"200\" Name=\"treeView1\" Width=\"120\">\n <TreeViewItem Header=\"Topic1\" IsExpanded=\"True\">\n <TreeViewItem Header=\"Subtopic2\" />\n <...
In Xcode, I can use CMD-R to run (or CMD-Y to debug), and my app will compile, install on the phone & start-up. (I've already prepped my phone & Xcode so this part works as expected.) What I'd LIKE to do is type CMD-<something else> and have my program compile & install on the phone, but NOT start-up. I realize that I...
In Xcode, there isn't a direct keyboard shortcut that allows you to compile and install the app on the phone without launching it. However, you can accomplish this with a combination of keyboard shortcuts and a small adjustment to your build settings. ### Steps to Achieve This: 1. **Build the App**: Use `CMD-B` to bu...
35,943
[ { "from": "human", "value": "In Xcode, I can use CMD-R to run (or CMD-Y to debug), and my app will compile, install on the phone & start-up. (I've already prepped my phone & Xcode so this part works as expected.)\nWhat I'd LIKE to do is type CMD-<something else> and have my program compile & install on the...
AlertEvent::AlertEvent(const std::string& text) : IMEvent(kIMEventAlert, alertText.c_str()), alertText(text) { //inspection at time of crash shows alertText is a valid string } IMEvent::IMEvent(long eventID, const char* details) { //during construction, details==0xcccccccc } on a related note, the mo...
It looks like you're dealing with an issue related to how memory is being managed in your C++ code, particularly with the `IMEvent` constructor. From your code snippet, it seems that `alertText` is being initialized after you pass its `c_str()` pointer to the `IMEvent` constructor. This means that by the time `IMEvent...
35,641
[ { "from": "human", "value": "AlertEvent::AlertEvent(const std::string& text) :\n IMEvent(kIMEventAlert, alertText.c_str()),\n alertText(text)\n{\n //inspection at time of crash shows alertText is a valid string\n}\n\n\nIMEvent::IMEvent(long eventID, const char* details)\n{\n //during constructio...
I'm binding a hashtable to a detailsview web control in ASP.NET 2.0. I have my edit/delete/insert link buttons on the detailsview, but when clicking new, the mode does not change. Any ideas why?
When working with a `DetailsView` in ASP.NET and binding it to a hashtable, it's important to ensure that the control is set up properly to handle different modes (e.g., read, edit, insert). If your `DetailsView` control is not changing modes when you click the "New" button, here are a few things you should check: ###...
31,472
[ { "from": "human", "value": "I'm binding a hashtable to a detailsview web control in ASP.NET 2.0. I have my edit/delete/insert link buttons on the detailsview, but when clicking new, the mode does not change.\nAny ideas why?\n" }, { "from": "gpt", "value": "When working with a `DetailsView` in A...
I've come across the problem where Excel will not play nice with UTF-8 encoded CSV files. See this related question on Stack Overflow. I've followed the solution of exporting as UTF-16, however it seems that with UTF-16, the comma character doesn't work as a delimiter, only the tab character. However I can't find anywh...
For tab-delimited files, the commonly used file extension is `.txt`. While it's possible to use `.tsv` for tab-separated values, `.txt` is more universally recognized. Regarding the MIME type, the standard for text files is: - **MIME type:** `text/plain` However, if you're specifically working with tab-separated val...
38,175
[ { "from": "human", "value": "I've come across the problem where Excel will not play nice with UTF-8 encoded CSV files. See this related question on Stack Overflow.\nI've followed the solution of exporting as UTF-16, however it seems that with UTF-16, the comma character doesn't work as a delimiter, only the...
If I'm reading a text file in shared access mode and another process truncates it, what is the easiest way to detect that? (I'm excluding the obvious choice of refreshing a FileInfo object periodically to check its size) Is there some convenient way to capture an event? (Filewatcher?)
In .NET, the `FileSystemWatcher` class is indeed a convenient way to monitor changes in the file system, including changes to a specific file. However, it's important to note that `FileSystemWatcher` is not designed specifically for detecting truncation events. It can monitor changes like file creation, deletion, renam...
32,954
[ { "from": "human", "value": "If I'm reading a text file in shared access mode and another process truncates it, what is the easiest way to detect that? (I'm excluding the obvious choice of refreshing a FileInfo object periodically to check its size) Is there some convenient way to capture an event? (File...
We want to throw an exception, if a user calls DataContext.SubmitChanges() and the DataContext is not tracking anything. That is... it is OK to call SubmitChanges if there are no inserts, updates or deletes. But we want to ensure that the developer didn't forget to attach the entity to the DataContext. Even better... i...
To implement an exception when `DataContext.SubmitChanges()` is called without any tracked entities, you can derive a custom `DataContext` class and override the `SubmitChanges` method. In this overridden method, you can check whether the context is tracking any entities before calling the base implementation. If not, ...
33,910
[ { "from": "human", "value": "We want to throw an exception, if a user calls DataContext.SubmitChanges() and the DataContext is not tracking anything.\nThat is... it is OK to call SubmitChanges if there are no inserts, updates or deletes. But we want to ensure that the developer didn't forget to attach the e...
I've seen a confusing behavior regarding the MSI files generated by a VDPROJ file. If I build my MSI in Visual Studio and then right-click and pick "Install" from within Visual Studio, it will automagically uninstall any version that is already installed and then install the new MSI. However, if take the generated MSI...
The behavior you're observing when running the MSI generated from a Visual Studio VDPROJ file is due to how the Windows Installer manages installations and upgrades. ### Visual Studio Behavior When you right-click the MSI file in Visual Studio and choose "Install," it likely uses a specific command line that enables ...
36,320
[ { "from": "human", "value": "I've seen a confusing behavior regarding the MSI files generated by a VDPROJ file. If I build my MSI in Visual Studio and then right-click and pick \"Install\" from within Visual Studio, it will automagically uninstall any version that is already installed and then install the ...
There is a list of projects here, mainly the Facebook Developer Toolkit and Facebook.NET. However, I've seen a lot of negative feedback about the toolkit and it seems like Facebook.NET hasn't been upgraded to the latest facebook API. Are either of these worth using? Any other good libraries out there? Specifically I'm...
When it comes to integrating Facebook functionality into an ASP.NET MVC application, there are a few considerations to keep in mind regarding libraries like Facebook Developer Toolkit and Facebook.NET. ### 1. Facebook Developer Toolkit - **Overview**: The Facebook Developer Toolkit was originally created to simplify F...
28,461
[ { "from": "human", "value": "There is a list of projects here, mainly the Facebook Developer Toolkit and Facebook.NET. However, I've seen a lot of negative feedback about the toolkit and it seems like Facebook.NET hasn't been upgraded to the latest facebook API. \nAre either of these worth using? Any other ...
I recently downloaded PLT Scheme and DrScheme. When I open DrScheme, I am told to choose a language. However, I'm not familiar with any of my options, and the help guides don't really break it down to help me easily choose which choice. So, first - is DrScheme and PLT Scheme really the tools I need to learn Lisp and/or...
Yes, DrScheme (which is now called Racket) and PLT Scheme (now part of Racket) are suitable tools for learning Scheme, which is a dialect of Lisp. They provide a nice development environment and support for a range of programming paradigms. ### Understanding DrScheme/Racket 1. **Racket**: Racket is a descendant of Sc...
35,919
[ { "from": "human", "value": "I recently downloaded PLT Scheme and DrScheme. When I open DrScheme, I am told to choose a language. However, I'm not familiar with any of my options, and the help guides don't really break it down to help me easily choose which choice.\nSo, first - is DrScheme and PLT Scheme re...
I have a bunch of generic interfaces and classes public interface IElement { // omited } class Element implements IElement { // omited } public interface IElementList<E extends IElement> extends Iterable { public Iterator<E> iterator(); } class ElementList implements IElementList<Element> { public Iterator<...
The issue you're encountering arises because the `Iterable` interface you've implemented does not provide type information to the `for-each` loop. In your `ElementList` class, you need to ensure that you're correctly implementing `Iterable<Element>`. The problem is that in the `IElementList` interface, the `Iterable`...
37,082
[ { "from": "human", "value": "I have a bunch of generic interfaces and classes\npublic interface IElement {\n// omited\n}\n\nclass Element implements IElement {\n// omited\n}\n\npublic interface IElementList<E extends IElement> extends Iterable {\n public Iterator<E> iterator();\n}\n\nclass ElementList im...
say I want to find the latest added rows (UPDATE by any user, not necessarily the one which is executing UPDATE) in XX table.
To find the latest added or updated rows in a table (e.g., `XX`), you typically need a way to track the timestamps of when each row was created or last updated. This is commonly done using a `created_at` and `updated_at` timestamp columns. If your table has these columns, you can query the latest rows using SQL. Here'...
37,240
[ { "from": "human", "value": "say I want to find the latest added rows (UPDATE by any user, not necessarily the one which is executing UPDATE) in XX table.\n" }, { "from": "gpt", "value": "To find the latest added or updated rows in a table (e.g., `XX`), you typically need a way to track the tim...
I'm trying to do a global search and replace in all the files in Delphi 2006 project, but am unable to do so. How can I do this?
In Delphi 2006, there isn't a built-in global search and replace feature across all files in a project, but you can achieve this using a couple of different methods: ### Method 1: Using the Built-In Find and Replace Feature 1. **Open the Project**: Launch Delphi 2006 and open your project. 2. **Find and Replace**: ...
32,783
[ { "from": "human", "value": "I'm trying to do a global search and replace in all the files in Delphi 2006 project, but am unable to do so.\nHow can I do this?\n" }, { "from": "gpt", "value": "In Delphi 2006, there isn't a built-in global search and replace feature across all files in a project, ...
I have a group by clause in a sql statement and need to use an aggregate function to minus all the values in each group instead of adding like the Sum() function. i.e. SELECT Sum(A) FROM ( SELECT 2 AS A UNION SELECT 1) AS t1 ..so will evaluate 2+1 and return 3. I need some way of doing 2-1 to return 1. Hop...
In SQL, there is no built-in aggregate function that directly performs subtraction across grouped values. However, you can achieve the desired effect using a combination of other SQL techniques. Here are a couple of approaches: ### Approach 1: Using a Subquery You can utilize a subquery that selects the maximum and m...
33,049
[ { "from": "human", "value": "I have a group by clause in a sql statement and need to use an aggregate function to minus all the values in each group instead of adding like the Sum() function.\ni.e. \nSELECT Sum(A) \nFROM ( \n SELECT 2 AS A\n UNION \n SELECT 1) AS t1\n\n..so will evaluate 2+1 and return...
Alright, quick question. A server is running in Eastern Time. PHP program needs to make date calculations using Central time. At the moment, I am putting this line at the very top of my script: putenv("TZ=US/Central"); Is that the best way to go about that or is there some PHP trick I'm not aware of? Cheers.
Setting the time zone using `putenv("TZ=US/Central");` is one way to adjust the time zone for your PHP script, but it's not the most recommended approach since it affects the entire process and can lead to unexpected behavior, especially if you have other parts of your application or scripts that rely on the server's d...
30,216
[ { "from": "human", "value": "Alright, quick question.\nA server is running in Eastern Time. PHP program needs to make date calculations using Central time.\nAt the moment, I am putting this line at the very top of my script:\nputenv(\"TZ=US/Central\");\n\nIs that the best way to go about that or is there so...
I currently have a 32 bit dll that was created with Visual Studio 2003 in C++ using Managed Extensions. I'm now trying to compile a 64 bit version without having to upgrade to C++/CLI. I've been following the tutorial at this location. I'm getting the following error: fatal error C1197: cannot reference 'c:\windo...
The error you're encountering suggests that your project is configured to reference two different versions of `mscorlib.dll`, which is causing a conflict. Since you're trying to compile a 64-bit version of your DLL, and the original DLL was created with a very old version of Visual Studio and uses Managed Extensions, h...
35,303
[ { "from": "human", "value": "I currently have a 32 bit dll that was created with Visual Studio 2003 in C++ using Managed Extensions. I'm now trying to compile a 64 bit version without having to upgrade to C++/CLI. I've been following the tutorial at this location. I'm getting the following error:\n\n fatal ...
What's the best way (if any) to make an image appear "grayed out" with CSS (i.e., without loading a separate, grayed out version of the image)? My context is that I have rows in a table that all have buttons in the right most cell and some rows need to look lighter than others. So I can make the font lighter easily of ...
To make an image appear "grayed out" using CSS, you can use the `filter` property. Specifically, the `grayscale()` function can be utilized to achieve the desired effect. This method allows you to apply a grayscale filter to the image without needing to load an alternate version of the image. Here’s how you can do it:...
35,665
[ { "from": "human", "value": "What's the best way (if any) to make an image appear \"grayed out\" with CSS (i.e., without loading a separate, grayed out version of the image)?\nMy context is that I have rows in a table that all have buttons in the right most cell and some rows need to look lighter than other...
I saw that __VIEWSTATE field gets rendered even though I have set the EnableViewState="false" at the page level. This field is not rendered if I remove runat="server" tag for the form element. Can somebody please explain this?
The `__VIEWSTATE` field in ASP.NET is used to maintain the state of server-side controls between postbacks. When you set `EnableViewState="false"` at the page level, you are instructing ASP.NET not to maintain the view state for controls on that page. However, there are a few nuances to be aware of regarding how the `_...
34,532
[ { "from": "human", "value": "I saw that __VIEWSTATE field gets rendered even though I have set the EnableViewState=\"false\" at the page level. This field is not rendered if I remove runat=\"server\" tag for the form element. Can somebody please explain this?\n" }, { "from": "gpt", "value": "The...
I have a large table with list of scores like this, one score per user: user,score ------ matt,10 john,20 bill,30 I want to make a query that answers to question: "John, you are faster than xx percent of others" How to make such a query for Microsoft SQLServer 2000 with optimal performance.
To determine the percentage of users that John is faster than based on the scores in your SQL Server 2000 database, you can use the following SQL query: ```sql DECLARE @JohnScore INT; -- Get John's score SELECT @JohnScore = score FROM your_table WHERE user = 'john'; -- Calculate the percentage of users that John is ...
36,306
[ { "from": "human", "value": "I have a large table with list of scores like this, one score per user:\nuser,score\n------\n matt,10\n john,20 \n bill,30\n\nI want to make a query that answers to question:\n \"John, you are faster than xx percent of others\"\nHow to make such a query for Microsoft SQLServer ...
What is the purpose/meaning of the Version property on a FormsAuthenticationTicket?
The `Version` property on a `FormsAuthenticationTicket` in ASP.NET serves to indicate the version of the ticket. It is important for several reasons: 1. **Compatibility**: The versioning allows for backward compatibility as the implementation of forms authentication evolves. If you update the way tickets are created o...
37,197
[ { "from": "human", "value": "What is the purpose/meaning of the Version property on a FormsAuthenticationTicket?\n" }, { "from": "gpt", "value": "The `Version` property on a `FormsAuthenticationTicket` in ASP.NET serves to indicate the version of the ticket. It is important for several reasons:\...
I am trying to create a custom subclass of NSScroller. I have created the class, and set it as the vertical scroller on an NSScrollView in IB. When I run my project, the drawRect: method is called for my subclass, so I know that it is properly connected. Now, How do I change the width of my fancy new NSScroller? No mat...
In macOS development with Cocoa, customizing the size of an `NSScroller` subclass can indeed be a bit tricky because `NSScroller` has a default size that can be difficult to change directly. However, there are a couple of methods to achieve this by overriding the appropriate methods and ensuring your custom scroller re...
35,881
[ { "from": "human", "value": "I am trying to create a custom subclass of NSScroller. I have created the class, and set it as the vertical scroller on an NSScrollView in IB. When I run my project, the drawRect: method is called for my subclass, so I know that it is properly connected.\nNow, How do I change th...
I am using a Flex dataGrid, and need to sort some of my columns numerically. Looking at the sortCompareFunction, it seems like i need to create a different function for each column that i want to sort, because my sort function has to know what field it is sorting on. Is there any way that I can pass the field to be s...
Yes, you can create a single numeric sorting function for your Flex DataGrid columns by utilizing the `sortCompareFunction` and passing the field name dynamically. Here's how you can achieve that. ### Step-by-step Approach 1. **Create a Generic Sorting Function**: This function will accept the field name as a paramet...
35,268
[ { "from": "human", "value": "I am using a Flex dataGrid, and need to sort some of my columns numerically.\nLooking at the sortCompareFunction, it seems like i need to create a different function for each column that i want to sort, because my sort function has to know what field it is sorting on. \nIs ther...
I'm thinking of something smaller than a laptop that i can spend my hours on the way to work doing project euler problems or such. Any ideas?
If you're looking for something smaller than a laptop that you can use for programming and solving problems like Project Euler during your commute, here are several options to consider: 1. **Tablet with Keyboard**: - **iPad with Magic Keyboard or Smart Keyboard**: You can run programming apps or use web-based envi...
35,846
[ { "from": "human", "value": "I'm thinking of something smaller than a laptop that i can spend my hours on the way to work doing project euler problems or such. \nAny ideas?\n" }, { "from": "gpt", "value": "If you're looking for something smaller than a laptop that you can use for programming and...
I'm working with Eclipse Version 3.2.1 Build M20060921-0945 on a MS-Windows 2000 SP4 using a JDK 1.5.0-12. I takes my locale that is es-AR and sets all menu and context in Spanish which I don't like. So I had included in eclipse.ini file one parameter "-nl en". Since that, "References..." feature in both "Search" and c...
It seems like you're encountering issues with Eclipse's language settings and functionality after trying to change the locale. Here are a few steps you can take to troubleshoot and potentially resolve the "References..." feature issue: 1. **Verify Eclipse Configuration**: - Ensure that the `eclipse.ini` file is cor...
35,161
[ { "from": "human", "value": "I'm working with Eclipse Version 3.2.1 Build M20060921-0945 on a MS-Windows 2000 SP4 using a JDK 1.5.0-12.\nI takes my locale that is es-AR and sets all menu and context in Spanish which I don't like. So I had included in eclipse.ini file one parameter \"-nl en\".\nSince that, \...
I know there are libs in other languages that can take a string that contains either a path to a local file or a url and open it as a readable IO stream. Is there an easy way to do this in ruby?
Yes, in Ruby, you can use the built-in libraries to handle both file paths and URLs in a unified way. The `open-uri` library is particularly useful for this purpose, as it extends the `File` class to allow opening URLs just like files. Here’s how you can do it: 1. Require the `open-uri` library. 2. Use the `open` met...
31,896
[ { "from": "human", "value": "I know there are libs in other languages that can take a string that contains either a path to a local file or a url and open it as a readable IO stream. \nIs there an easy way to do this in ruby?\n" }, { "from": "gpt", "value": "Yes, in Ruby, you can use the built-i...
I am writing a Rails app that processes data into a graph (using Scruffy). I am wondering how can I render the graph to a blog/string and then send the blog/string directly to the the browser to be displayed (without saving it to a file)? Or do I need to render it, save it to a file, then display the saved image file...
In your Rails application, if you want to render a graph using Scruffy and send it directly to the browser without saving it to a file, you can use the `send_data` method to send the image data as a response. This allows you to generate the graph on the fly and display it directly in the browser. Here’s a step-by-step...
32,031
[ { "from": "human", "value": "I am writing a Rails app that processes data into a graph (using Scruffy). I am wondering how can I render the graph to a blog/string and then send the blog/string directly to the the browser to be displayed (without saving it to a file)? Or do I need to render it, save it to ...
Hej, assuming I have a code that looks like this: List<User> userList = GetUserByName (u => u.Name == name); DoSomethingWithTheUsers (userList.ToArray ()); Now I want to know the type of the objects in the Array in the method DoSomethingWithTheUsers (object[] myObjects) Simply done by myObjects.First ().GetType () bu...
In C#, when you have an empty array, calling `myObjects.First()` will throw an `InvalidOperationException` because there's no element to return. However, you can still retrieve the type of the elements that are supposed to be in the array by checking the original type of the `userList`. If you have a situation where y...
36,452
[ { "from": "human", "value": "Hej, \nassuming I have a code that looks like this:\nList<User> userList = GetUserByName (u => u.Name == name);\nDoSomethingWithTheUsers (userList.ToArray ());\n\nNow I want to know the type of the objects in the Array in the method DoSomethingWithTheUsers (object[] myObjects)\n...
In C++, what is object slicing and when does it occur?
Object slicing in C++ refers to the phenomenon that occurs when an object of a derived class is assigned to an object of a base class. During this process, only the base class part of the derived class object is copied, effectively "slicing off" the derived class part. As a result, the additional data and behavior defi...
32,379
[ { "from": "human", "value": "In C++, what is object slicing and when does it occur?\n" }, { "from": "gpt", "value": "Object slicing in C++ refers to the phenomenon that occurs when an object of a derived class is assigned to an object of a base class. During this process, only the base class par...
I am trying to get pylons to debug in Eclipse under Ubuntu. Specifically. I am not sure what to use for the 'Main Module' on the Run configurations dialog. (this is a similar question on stackoverflow, but I think it applies to windows as I can't find paster-script.py on my system) Can anyone help?
To debug a Pylons application in Eclipse on Ubuntu, you typically need to set up the run configuration correctly. Since Pylons applications often use `paster` for serving the application, you will need to specify the right entry point in your Run configurations. Here are the steps to set up the Run configuration in Ec...
35,597
[ { "from": "human", "value": "I am trying to get pylons to debug in Eclipse under Ubuntu.\nSpecifically. I am not sure what to use for the 'Main Module' on the Run configurations dialog.\n(this is a similar question on stackoverflow, but I think it applies to windows as I can't find paster-script.py on my sy...
Does using delegates slow down my programs? I've been avoiding them because I really have no clue if they make my programs any slower. I know if I cause a (catch) exception, that uses quite a bit of CPU power but I don't know about Delegates and Events and what .NET does to them.
Using delegates in .NET does have some overhead compared to using direct method calls, but in most cases, this overhead is quite small and typically negligible in the context of the overall performance of an application. Here’s a breakdown of how delegates work and their performance considerations: ### What are Delega...
36,149
[ { "from": "human", "value": "Does using delegates slow down my programs? \nI've been avoiding them because I really have no clue if they make my programs any slower. I know if I cause a (catch) exception, that uses quite a bit of CPU power but I don't know about Delegates and Events and what .NET does to ...
I'm using Python's Imaging Library and I would like to draw some bezier curves. I guess I could calculate pixel by pixel but I'm hoping there is something simpler.
To draw Bezier curves in Python using the Python Imaging Library (PIL), you can use the `ImageDraw` module, which is part of the `Pillow` library (the maintained fork of PIL). While PIL/Pillow does not have built-in support for drawing Bezier curves directly, you can use a library called `numpy` to calculate the points...
29,227
[ { "from": "human", "value": "I'm using Python's Imaging Library and I would like to draw some bezier curves.\nI guess I could calculate pixel by pixel but I'm hoping there is something simpler.\n" }, { "from": "gpt", "value": "To draw Bezier curves in Python using the Python Imaging Library (PIL...
I've been hearing/reading a lot about the new language enhancements for C# 4. I'm a little curious if these same enhancements are also going to be applied to VB as well, or what. Does anyone know where I can get some insight here? With all the new changes happening to C#, it seems like there will very little reason ...
C# 4.0 introduced several enhancements, including dynamic typing (with the `dynamic` keyword), named and optional parameters, covariance and contravariance in generics, and improved COM interoperability. While these features significantly enhanced C#, Visual Basic .NET (VB.NET) has its own set of enhancements and some ...
34,773
[ { "from": "human", "value": "I've been hearing/reading a lot about the new language enhancements for C# 4. I'm a little curious if these same enhancements are also going to be applied to VB as well, or what. Does anyone know where I can get some insight here? With all the new changes happening to C#, it ...
I want to get the name of internet connection type in iPhone? Any help would be appreciated. Regards Uddhalaka
To get the name of the internet connection type on an iPhone, you can check the status through the `Network` framework in Swift. Here’s a general approach to obtain the connection type (e.g., Wi-Fi, Cellular) using the `NWPathMonitor` class from the Network framework. ### Steps to Get the Connection Type: 1. **Import...
36,101
[ { "from": "human", "value": "I want to get the name of internet connection type in iPhone?\nAny help would be appreciated.\nRegards\nUddhalaka\n" }, { "from": "gpt", "value": "To get the name of the internet connection type on an iPhone, you can check the status through the `Network` framework i...
I have a PHP script that processes file uploads. The script tries to organise the files that are uploaded and may create new folders to move the files into if needed. These files will be below the www root directory (ie, a web browser will be able to access them). My question is, what permissions should I set for the f...
When configuring permissions for directories and files in a PHP application that handles file uploads, especially when the files will be stored in a location that is accessible via a web server, you should carefully consider security, functionality, and best practices. Here’s a guide for setting permissions for your fo...
34,827
[ { "from": "human", "value": "I have a PHP script that processes file uploads. The script tries to organise the files that are uploaded and may create new folders to move the files into if needed. These files will be below the www root directory (ie, a web browser will be able to access them).\nMy question i...
If any one can help me with Python code: If I input a letter, How can I print all the words start with that word?
You can achieve this by creating a simple Python program that filters words based on their starting letter. Below is a code example that demonstrates how to do this using a predefined list of words: ```python def words_starting_with_letter(letter, word_list): # Convert the letter to lowercase to ensure case insens...
37,181
[ { "from": "human", "value": "If any one can help me with Python code:\nIf I input a letter, How can I print all the words start with that word?\n" }, { "from": "gpt", "value": "You can achieve this by creating a simple Python program that filters words based on their starting letter. Below is a ...
I've got two branches of code. 1 has a dialog box that the other doesn't, but because of politics the dialog box wasn't moved into the newest branch. Now they want it in... So is it possible to copy a dialog box from one project to another. There apears to be an export and import feature however it's greyed out.
Yes, it is generally possible to copy a dialog box (or dialog resource) from one project to another in a codebase, particularly if you are working with a Visual Studio project that uses MFC (Microsoft Foundation Classes) or a similar framework. Since the export and import features are greyed out, you can manually copy ...
29,862
[ { "from": "human", "value": "I've got two branches of code. 1 has a dialog box that the other doesn't, but because of politics the dialog box wasn't moved into the newest branch. Now they want it in... \nSo is it possible to copy a dialog box from one project to another. \nThere apears to be an export and i...
After using array_unique, an array without the duplicate values is removed. However, it appears that the keys are also removed, which leaves gaps in an array with numerical indexes (although is fine for an associative array). If I iterate using a for loop, I have to account for the missing indexes and just copy the key...
When you use `array_unique()` in PHP, it does indeed remove duplicates from the array, but it also preserves the original keys of the array. If the original array has sequential numerical keys, the result of `array_unique()` may not have those keys in a sequential manner, which can lead to gaps. To handle this scenari...
32,100
[ { "from": "human", "value": "After using array_unique, an array without the duplicate values is removed. However, it appears that the keys are also removed, which leaves gaps in an array with numerical indexes (although is fine for an associative array). If I iterate using a for loop, I have to account for ...
I recently started using Linux as my primary OS. What are the tools that I will need to set up a complete programming environment in Linux for C and C++?
Welcome to the world of Linux! Setting up a complete programming environment for C and C++ is straightforward, and there are several tools and software packages you should consider installing to enhance your development experience. Here’s a list of essential tools and software for C and C++ programming on Linux: ### 1...
34,355
[ { "from": "human", "value": "I recently started using Linux as my primary OS. What are the tools that I will need to set up a complete programming environment in Linux for C and C++?\n" }, { "from": "gpt", "value": "Welcome to the world of Linux! Setting up a complete programming environment for...
I haven't used regular expressions at all, so I'm having difficulty troubleshooting. I want the regex to match only when the contained string is all numbers; but with the two examples below it is matching a string that contains all numbers plus an equals sign like "1234=4321". I'm sure there's a way to change this beha...
To match a string that contains only numbers and nothing else, you need to use a regular expression that asserts that the entire string is composed of digits. The current regex pattern `@"[\d]"` or `"[0-9]"` matches any string that contains at least one digit. That's why your example "1234=4321" is returning true, as...
36,842
[ { "from": "human", "value": "I haven't used regular expressions at all, so I'm having difficulty troubleshooting. I want the regex to match only when the contained string is all numbers; but with the two examples below it is matching a string that contains all numbers plus an equals sign like \"1234=4321\"....
To do the equivalent of Python list comprehensions, I'm doing the following: some_array.select{|x| x % 2 == 0 }.collect{|x| x * 3} Is there a better way to do this...perhaps with one method call?
Yes, you can achieve the equivalent of Python list comprehensions in Ruby using the `map` method combined with `select`. However, there is a more efficient way to do this using the `map` method with a conditional inside it, avoiding the need for two separate method calls. You can use the `filter_map` method (if you'r...
36,820
[ { "from": "human", "value": "To do the equivalent of Python list comprehensions, I'm doing the following:\nsome_array.select{|x| x % 2 == 0 }.collect{|x| x * 3}\n\nIs there a better way to do this...perhaps with one method call?\n" }, { "from": "gpt", "value": "Yes, you can achieve the equivalen...
Evidently hash keys are compared in a case-sensitive manner. $ perl -e '%hash = ( FOO => 1 ); printf "%s\n", ( exists $hash{foo} ) ? "Yes" : "No";' No $ perl -e '%hash = ( FOO => 1 ); printf "%s\n", ( exists $hash{FOO} ) ? "Yes" : "No";' Yes Is there a setting to change that for the current script?
In Perl, hash keys are inherently case-sensitive, and there is no built-in setting to change this behavior globally within a script. However, you can achieve case-insensitive behavior by converting all keys to a consistent case (either all uppercase or all lowercase) when you create or check for keys in the hash. Here...
36,451
[ { "from": "human", "value": "Evidently hash keys are compared in a case-sensitive manner.\n$ perl -e '%hash = ( FOO => 1 ); printf \"%s\\n\", ( exists $hash{foo} ) ? \"Yes\" : \"No\";'\nNo\n\n$ perl -e '%hash = ( FOO => 1 ); printf \"%s\\n\", ( exists $hash{FOO} ) ? \"Yes\" : \"No\";'\nYes\n\nIs there a set...
Is there a good tutorial on working with (programming) threads in Visual Studio 2005? Not MFC related, just native C++ (no .NET).
Yes, there are several resources and tutorials available for working with threads in native C++ (without MFC or .NET) using Visual Studio 2005. Here are some key concepts and examples that you can use to get started with multithreading in native C++: ### Key Concepts 1. **Creating Threads**: You can create threads us...
33,876
[ { "from": "human", "value": "Is there a good tutorial on working with (programming) threads in Visual Studio 2005? Not MFC related, just native C++ (no .NET).\n" }, { "from": "gpt", "value": "Yes, there are several resources and tutorials available for working with threads in native C++ (without...
Is it a measure of anything that a developer or even manager can look at and get meaning from? I know at one time, it was all about the 7, 8, 9, and 10 PageRank. But is it still a valid measure of anything? If so, what can you learn from a PageRank? Note that I'm assuming that you have other measurements that you can a...
PageRank, developed by Larry Page and Sergey Brin while at Stanford University, is an algorithm used by Google Search to rank web pages in its search engine results. While it played a foundational role in the early success of Google and the development of search engines, its relevance has diminished over the years due ...
35,554
[ { "from": "human", "value": "Is it a measure of anything that a developer or even manager can look at and get meaning from? I know at one time, it was all about the 7, 8, 9, and 10 PageRank. But is it still a valid measure of anything? If so, what can you learn from a PageRank?\nNote that I'm assuming that ...
Which are the most advanced frameworks and tools there are available for python for practicing Behavior Driven Development? Especially finding similar tools as rspec and mocha for ruby would be great.
Behavior Driven Development (BDD) is a software development approach that extends Test Driven Development (TDD) by writing tests in a natural language format that can be understood by non-technical stakeholders. In Python, several frameworks and tools facilitate BDD, similar to RSpec and Mocha in Ruby. Here are some of...
34,482
[ { "from": "human", "value": "Which are the most advanced frameworks and tools there are available for python for practicing Behavior Driven Development? Especially finding similar tools as rspec and mocha for ruby would be great.\n" }, { "from": "gpt", "value": "Behavior Driven Development (BDD)...
I want to use PKCS#7 as a container format for some encrypted, signed content and we need to use AES in CBC mode with ISO 10126 based padding. I can't seem to find a concrete reference to an algorithm identifier to use for this combination. I can invent my own but would then lose interoperability with other tools.
When using PKCS#7 as a container format for encrypted and signed content, you typically encounter standard algorithm identifiers for encryption algorithms and modes. However, the combination of AES in CBC mode with ISO 10126 padding is less commonly referenced in widely-used standards. ### Standard Algorithm Identifie...
35,900
[ { "from": "human", "value": "I want to use PKCS#7 as a container format for some encrypted, signed content and we need to use AES in CBC mode with ISO 10126 based padding. I can't seem to find a concrete reference to an algorithm identifier to use for this combination. I can invent my own but would then los...
Does anyone know of shared TODO list plugin for Eclipse that allows users in a a development team to all view and edit the same list of tasks?
Yes, there are several options you can consider for shared TODO list functionality in Eclipse that can help development teams collaborate on tasks: 1. **Eclipse Mylyn**: Mylyn is a task-focused interface that integrates with various issue trackers. It allows you to manage tasks effectively and share task lists with te...
38,182
[ { "from": "human", "value": "Does anyone know of shared TODO list plugin for Eclipse that allows users in a a development team to all view and edit the same list of tasks?\n" }, { "from": "gpt", "value": "Yes, there are several options you can consider for shared TODO list functionality in Eclip...
I'm a c# developer but have a job that involves some jsp code. I've been using notepad++ which does a great job in highlighting but I'm missing the intellisense and find it difficult to find the methods I need. What is a good jsp IDE for someone coming for C# that has intellisense? Update I tried eclipse and idea but ...
I'm glad to hear that NetBeans worked well for your JSP development needs! It indeed provides a solid environment for web development, including JSP, with features like code completion, syntax highlighting, and debugging capabilities. If you ever decide to explore other IDEs or editors in the future, here are a few o...
36,402
[ { "from": "human", "value": "I'm a c# developer but have a job that involves some jsp code. \nI've been using notepad++ which does a great job in highlighting but I'm missing the intellisense and find it difficult to find the methods I need.\nWhat is a good jsp IDE for someone coming for C# that has intelli...
I would like to know if it is possible, to select certain columns from one table, and another column from a second table, which would relate to a non imported column in the first table. I have to obtain this data from access, and do not know if this is possible with Access, or SQL in general.
Yes, it is possible to select specific columns from one table and a column from another table in SQL, including Microsoft Access SQL. You can achieve this by using a SQL `JOIN` statement, which allows you to combine rows from two or more tables based on a related column. Here's a general outline of how you can structu...
34,723
[ { "from": "human", "value": "I would like to know if it is possible, to select certain columns from one table, and another column from a second table, which would relate to a non imported column in the first table. I have to obtain this data from access, and do not know if this is possible with Access, or S...
What does the quote "Level of Indirection solves every Problem" mean in Computer Science?
The quote "Level of Indirection solves every Problem" in computer science reflects the idea that introducing levels of indirection can help manage complexity and improve flexibility in systems. Indirection allows a program or system to interact with other components without having to know their details or implementatio...
34,188
[ { "from": "human", "value": "What does the quote \"Level of Indirection solves every Problem\" mean in Computer Science?\n" }, { "from": "gpt", "value": "The quote \"Level of Indirection solves every Problem\" in computer science reflects the idea that introducing levels of indirection can help ...
Is it necessary for setter methods to have one argument? Usually setter methods accept one argument as the value of a certain property of an Object. What if I want to test first the validity which depends on another argument which is a boolean, if true, validate first, else just set the value. I am getting the values f...
Setter methods are typically designed to accept a single argument that corresponds to a property of an object. However, there's no strict rule that prevents you from implementing them in a way that includes additional parameters or logic. In your case, it makes sense to create a setter that validates the input value ...
36,897
[ { "from": "human", "value": "Is it necessary for setter methods to have one argument? Usually setter methods accept one argument as the value of a certain property of an Object. What if I want to test first the validity which depends on another argument which is a boolean, if true, validate first, else just...
I have an excel sheet full of times. They are formatted so that they look like: 1:00:15 However if I change the format on the cells to text, they change to the underlying numeric representation of the time: 0.041840278 How can I convert the cells to be text cells but still have the time in them ?
To convert your time values in Excel to text while retaining their original time format (like `1:00:15`), you can use the `TEXT` function. Here’s how to do it: 1. **Use the TEXT Function:** - Assuming your time is in cell A1, you would enter the following formula in another cell: ``` =TEXT(A1, "hh:mm:ss")...
37,349
[ { "from": "human", "value": "I have an excel sheet full of times.\nThey are formatted so that they look like: 1:00:15\nHowever if I change the format on the cells to text, they change to the underlying numeric representation of the time: 0.041840278\nHow can I convert the cells to be text cells but still ha...
I need to use a byte array as a profile property in a website. Normally I would declare the type as system.string or system.int32 but I have no idea what the type if for a byte array. EDIT: I need to use this as profile property that is declared in the web.config like below: <profile defaultProvider="ProfileProvider" e...
When defining a byte array as a profile property in your `web.config`, you should use the type `System.Byte[]` instead of `System.Byte()`. The correct syntax for defining a byte array in the profile properties is as follows: ```xml <profile defaultProvider="ProfileProvider" enabled="true"> <properties> <ad...
38,266
[ { "from": "human", "value": "I need to use a byte array as a profile property in a website. Normally I would declare the type as system.string or system.int32 but I have no idea what the type if for a byte array.\nEDIT: I need to use this as profile property that is declared in the web.config like below:\n<...
This is a contrived example, but lets say I have declared objects: CustomObj fooObj; CustomObj barObj; CustomObj bazObj; And I have an string array: string[] stringarray = new string[] {"foo","bar","baz"}; How can I programmatically access and instantiate those objects using the string array, iterating using somethin...
In C#, you cannot directly create variable names dynamically (like `fooObj`, `barObj`, `bazObj`) based on string values in a straightforward manner. However, you can achieve similar functionality using a dictionary, which allows you to map strings to objects. Here's how you can implement this: ```csharp using System; ...
36,608
[ { "from": "human", "value": "This is a contrived example, but lets say I have declared objects:\nCustomObj fooObj;\nCustomObj barObj;\nCustomObj bazObj;\n\nAnd I have an string array:\nstring[] stringarray = new string[] {\"foo\",\"bar\",\"baz\"};\n\nHow can I programmatically access and instantiate those o...
I want to do some pattern matching on lists in Python. For example, in Haskell, I can do something like the following: fun (head : rest) = ... So when I pass in a list, head will be the first element, and rest will be the trailing elements. Likewise, in Python, I can automatically unpack tuples: (var1, var2) = func_th...
Yes, you can achieve similar pattern matching for lists in Python using tuple unpacking directly. You can use the `*` operator to unpack the elements of the list. Here’s how you can do it in one line: ```python ls = my_func() head, *rest = ls ``` In this example: - `head` will be assigned the first element of the lis...
37,636
[ { "from": "human", "value": "I want to do some pattern matching on lists in Python. For example, in Haskell, I can do something like the following:\nfun (head : rest) = ...\n\nSo when I pass in a list, head will be the first element, and rest will be the trailing elements.\nLikewise, in Python, I can automa...
Is it possible to change the destination port of a UDP packet using iptables? I'm trying to get an SNMP agent to send out traps on 1620 instead of 162. Unfortunately so far I've only managed to change the source port: iptables -t nat -A POSTROUTING -p udp --dport 162 -j SNAT --to :1620
Yes, you can change the destination port of a UDP packet using `iptables`, but the approach you currently have isn't quite correct for altering the destination port. Instead of using the `SNAT` target, you'll want to use the `REDIRECT` or `DNAT` target in a different chain. Here’s how you can redirect traffic destine...
35,605
[ { "from": "human", "value": "Is it possible to change the destination port of a UDP packet using iptables?\nI'm trying to get an SNMP agent to send out traps on 1620 instead of 162. Unfortunately so far I've only managed to change the source port:\n\niptables -t nat -A POSTROUTING -p udp\n --dport 162 -j S...
I know FireBug with YSlow has to be by far my personal favourite. I also use IE developer toolbar when forced to test pages in IE. Is there any other jewels out there hiding??
Absolutely! There are several great tools for web development and performance testing that can complement Firebug and the IE Developer Toolbar. Here are some additional gems you might find useful: 1. **Chrome DevTools**: Built into Google Chrome, DevTools offers a powerful suite of features including an inspector, con...
36,014
[ { "from": "human", "value": "I know FireBug with YSlow has to be by far my personal favourite. I also use IE developer toolbar when forced to test pages in IE. Is there any other jewels out there hiding??\n" }, { "from": "gpt", "value": "Absolutely! There are several great tools for web developm...
In ActionScript, how can you test if an object is defined, that is, not null?
In ActionScript, to check if an object is defined (i.e., not `null`), you can simply use a conditional statement to evaluate the object. Here's how you can do that: ```actionscript if (myObject != null) { // The object is defined (not null) trace("The object is defined."); } else { // The object is null ...
37,316
[ { "from": "human", "value": "In ActionScript, how can you test if an object is defined, that is, not null?\n" }, { "from": "gpt", "value": "In ActionScript, to check if an object is defined (i.e., not `null`), you can simply use a conditional statement to evaluate the object. Here's how you can ...
How do I get a platform-independent newline in Java? I can’t use "\n" everywhere.
In Java, you can use `System.lineSeparator()` to obtain the platform-independent newline character. This method returns the line separator string that is appropriate for the operating system on which the Java Virtual Machine (JVM) is running. Here is an example of how to use it: ```java public class Main { publi...
37,962
[ { "from": "human", "value": "How do I get a platform-independent newline in Java? I can’t use \"\\n\" everywhere.\n" }, { "from": "gpt", "value": "In Java, you can use `System.lineSeparator()` to obtain the platform-independent newline character. This method returns the line separator string tha...
ok so basically I am asking the question of their name I want this to be one input rather than Forename and Surname. Now is there any way of splitting this name? and taking just the last word from the "Sentence" e.g. name = "Thomas Winter" print name.split() and what would be output is just "Winter"
Yes, you can achieve this by using the `split()` method to split the input string into individual words, and then accessing the last word from the resulting list. Here's a simple example in Python: ```python name = "Thomas Winter" last_name = name.split()[-1] print(last_name) ``` ### Explanation: 1. `name.split()` sp...
38,709
[ { "from": "human", "value": "ok so basically I am asking the question of their name\nI want this to be one input rather than Forename and Surname.\nNow is there any way of splitting this name? and taking just the last word from the \"Sentence\" e.g.\nname = \"Thomas Winter\"\nprint name.split() \n\nand what...
I have an enum construct like this: public enum EnumDisplayStatus { None = 1, Visible = 2, Hidden = 3, MarkedForDeletion = 4 } In my database, the enumerations are referenced by value. My question is, how can I turn the number representation of the enum back to the string name. For example, given ...
You can convert the numeric value of an enum back to its string representation using the `Enum.ToString()` method combined with a cast to the appropriate enum type. Here's how you can do this in C#: 1. First, you need to cast the integer value to the `EnumDisplayStatus` type. 2. Then, you can call the `ToString()` met...
36,001
[ { "from": "human", "value": "I have an enum construct like this:\npublic enum EnumDisplayStatus\n{\n None = 1,\n Visible = 2,\n Hidden = 3,\n MarkedForDeletion = 4\n}\n\nIn my database, the enumerations are referenced by value. My question is, how can I turn the number representation of the ...
I wish to set a usererror string before leaving a function, depending on the return code and variable in the function. I currently have: Dim RetVal as RetType try ... if ... then RetVal = RetType.FailedParse end try endif ... finally select case RetVal case ... UserStr = ... end se...
In many programming languages, the `finally` block executes after the `try` block, regardless of whether an exception was thrown or a return statement was executed in the `try` block. However, when you execute a return statement in the `try` block, the control flow is usually directed to the point after the entire `try...
36,237
[ { "from": "human", "value": "I wish to set a usererror string before leaving a function, depending on the return code and variable in the function.\nI currently have:\nDim RetVal as RetType\n\ntry\n...\nif ... then\n RetVal = RetType.FailedParse\n end try\nendif\n...\n\nfinally\n select case RetVal...
It seems like v2 of Log4j has been in development for literally years. The Apache Log4J site no longer lists a roadmap, the dev mailing list seems almost entirely about 1.2 (which is appreciated!), use of v1.3 is discouraged, and the 2.0 branch is listed as "experimental". What's a believer to believe?
As of my last update in October 2023, Apache Log4j 2.x has matured significantly since its initial release, and it is now a stable and recommended logging framework for Java applications. Here are some points to consider regarding Log4j 2.x and its development: 1. **Stability**: While Log4j 2.0 was initially labeled a...
35,015
[ { "from": "human", "value": "It seems like v2 of Log4j has been in development for literally years. The Apache Log4J site no longer lists a roadmap, the dev mailing list seems almost entirely about 1.2 (which is appreciated!), use of v1.3 is discouraged, and the 2.0 branch is listed as \"experimental\". W...
I'm using a large open-source control and I can't seem to find the code that handles a double-click event. Could I perhaps have the debugger break when a double-click occurs or otherwise learn what code is associated with that event?
Certainly! If you're working with an open-source project and want to find the code that handles a double-click event, you can use a few different strategies to help you locate it. Here are some common methods: ### 1. **Use the Debugger** You can set a breakpoint on double-click events to see what code is executed when...
31,517
[ { "from": "human", "value": "I'm using a large open-source control and I can't seem to find the code that handles a double-click event. Could I perhaps have the debugger break when a double-click occurs or otherwise learn what code is associated with that event?\n" }, { "from": "gpt", "value": "...
Is there an easy way within C# to check to see if a DateTime instance has been assigned a value or not?
In C#, the `DateTime` struct is a value type and, by default, it is initialized to `DateTime.MinValue` (which is January 1, 0001, at 00:00:00). Because of this, you cannot check if a `DateTime` instance has been assigned a value by checking against `null` (as it cannot be null) or by checking if it is equal to `DateTim...
36,742
[ { "from": "human", "value": "Is there an easy way within C# to check to see if a DateTime instance has been assigned a value or not?\n" }, { "from": "gpt", "value": "In C#, the `DateTime` struct is a value type and, by default, it is initialized to `DateTime.MinValue` (which is January 1, 0001, ...
I thought that if a c pointer pointing to a char array was incremented then it would point to the next element in that array. But when I tried this I found that I had to increment it twice. Trying the increment using sizeof(char) I found that adding the size of a char was too much so it had to be divided by two. #incl...
The confusion arises from a misunderstanding of how pointer arithmetic works in C, particularly with regard to the type of the pointer. Let's clarify how pointer increments operate. In your code: ```c char *pi; pi = argv[1]; ``` `pi` is a pointer to `char`. When you increment `pi` with `pi++`, you are moving the poi...
35,639
[ { "from": "human", "value": "I thought that if a c pointer pointing to a char array was incremented then it would point to the next element in that array. But when I tried this I found that I had to increment it twice. Trying the increment using sizeof(char) I found that adding the size of a char was too mu...
What is a good Scheme IDE for Windows? OK, I'll admit it; I'm not at RMS's level, and don't want to use Emacs or any character-based interface -- I want a graphic IDE with colorization, a REPL, and usable, in-line help for a specific, well-documented dialect of Scheme. I have searched around and PLT Scheme/DrScheme see...
If you're looking for a good Scheme IDE on Windows with a graphical interface, syntax highlighting, REPL support, and inline help, you have a few options beyond PLT Scheme (now known as Racket). Here are some IDEs and environments that you might find suitable: 1. **Racket**: As you mentioned, DrScheme (now called Rack...
36,219
[ { "from": "human", "value": "What is a good Scheme IDE for Windows? OK, I'll admit it; I'm not at RMS's level, and don't want to use Emacs or any character-based interface -- I want a graphic IDE with colorization, a REPL, and usable, in-line help for a specific, well-documented dialect of Scheme. I have se...
Is there a difference between using a makefile and a Makefile?
Yes, there is a subtle distinction between "makefile" and "Makefile," though they both refer to the same concept of a file used by the `make` build automation tool. 1. **Makefile (capital "M")**: This is the conventional name for a makefile. When you run the `make` command without any arguments, it looks for a file na...
37,914
[ { "from": "human", "value": "Is there a difference between using a makefile and a Makefile?\n" }, { "from": "gpt", "value": "Yes, there is a subtle distinction between \"makefile\" and \"Makefile,\" though they both refer to the same concept of a file used by the `make` build automation tool.\n\...
Xcode has these handy time savers in the scripts menu called "Code->Place Accessor Defs on Clipboard" and "Code->Place Accessor Decls on Clipboard". These scripts allow you to automate the generation of getter and setter methods for any highlighted instance variables. Does anyone know of a similar script that outputs ...
Yes, you can create a simple script to generate Objective-C 2.0 property declaration statements for highlighted instance variables in Xcode. Unfortunately, Xcode doesn't have a built-in feature like the accessor scripts you mentioned specifically for properties, but you can easily create a custom script to achieve that...
35,176
[ { "from": "human", "value": "Xcode has these handy time savers in the scripts menu called \"Code->Place Accessor Defs on Clipboard\" and \"Code->Place Accessor Decls on Clipboard\". These scripts allow you to automate the generation of getter and setter methods for any highlighted instance variables. \nDoes...
I'm not looking for the usual answer like Web-services. I'm looking for a light solution to be run in the same machine. Edit: I'm looking for way in Java to call .NET methods
If you are looking for a way to call .NET methods from Java on the same machine without setting up a full web service or a complex framework, you can consider the following approaches: ### 1. JNI (Java Native Interface) You can use JNI to call native methods written in .NET. However, this approach can be quite comple...
35,007
[ { "from": "human", "value": "I'm not looking for the usual answer like Web-services. I'm looking for a light solution to be run in the same machine.\nEdit: I'm looking for way in Java to call .NET methods\n" }, { "from": "gpt", "value": "If you are looking for a way to call .NET methods from Jav...
Since we cannot setup Eclipse's RSE to use at the tool for remote editing, I have installed Unison. But how can I get Eclipse to automatically run unison on every file save? Is there an eclipse plugin available for this? TIA
To set up Eclipse to automatically run Unison on every file save, you can use a combination of Eclipse's built-in features and potentially a custom script. As of my last update, there isn't a direct Eclipse plugin specifically for Unison that automates this process, but you can achieve the desired functionality using a...
30,881
[ { "from": "human", "value": "Since we cannot setup Eclipse's RSE to use at the tool for remote editing, I have installed Unison. But how can I get Eclipse to automatically run unison on every file save? Is there an eclipse plugin available for this?\nTIA\n" }, { "from": "gpt", "value": "To set u...
I have a user control (gallery.ascx) and I want to use the photo.ascx control in the gallery control. I've added this register at the top of gallery.ascx, but it still can't find photo: <%@ Register TagPrefix="ssctrl" TagName="photo" Src="controls/photo.ascx" %> Any ideas?
If you're experiencing issues with the user control registration in ASP.NET, here are a few steps to troubleshoot and ensure that everything is set up correctly: 1. **Correct Path**: Make sure the `Src` attribute's path to `photo.ascx` is correct relative to the `gallery.ascx` control's location. The path should point...
31,874
[ { "from": "human", "value": "I have a user control (gallery.ascx) and I want to use the photo.ascx control in the gallery control. I've added this register at the top of gallery.ascx, but it still can't find photo:\n<%@ Register TagPrefix=\"ssctrl\" TagName=\"photo\" Src=\"controls/photo.ascx\" %>\n\nAny i...
If I have an xmlreader instance how can I use it to read its current node and end up with a xmlElement instance?
To convert a node read using an `XmlReader` instance to an `XmlElement` in C#, you typically need to manually create the `XmlElement` based on the information read from the `XmlReader`. Here's how you can achieve this: 1. **Read the Node**: Use the `XmlReader` to read the current node and its attributes. 2. **Create t...
35,334
[ { "from": "human", "value": "If I have an xmlreader instance how can I use it to read its current node and end up with a xmlElement instance?\n" }, { "from": "gpt", "value": "To convert a node read using an `XmlReader` instance to an `XmlElement` in C#, you typically need to manually create the ...
I want to share an object between my servlets and my webservice (JAX-WS) by storing it as a servlet context attribute. But how can I retrieve the servlet context from a web service?
To share an object between servlets and a JAX-WS web service by storing it as a servlet context attribute, you can access the ServletContext in your web service class. This can typically be achieved through dependency injection or by using the `@WebServiceContext` annotation provided by JAX-WS. Here's how you can do i...
28,072
[ { "from": "human", "value": "I want to share an object between my servlets and my webservice (JAX-WS) by storing it as a servlet context attribute. But how can I retrieve the servlet context from a web service?\n" }, { "from": "gpt", "value": "To share an object between servlets and a JAX-WS web...
I have two lists that are of the same length, is it possible to loop through these two lists at once? I am looking for the correct syntax to do the below foreach itemA, itemB in ListA, ListB { Console.WriteLine(itemA.ToString()+","+itemB.ToString()); } do you think this is possible in C#? And if it is, what is the l...
Yes, in C#, it is indeed possible to loop through two lists of the same length simultaneously. While the syntax you provided (`foreach itemA, itemB in ListA, ListB`) is not valid in C#, you can achieve the desired behavior using various approaches. One common way to loop through two lists is by using a `for` loop: `...
33,565
[ { "from": "human", "value": "I have two lists that are of the same length, is it possible to loop through these two lists at once?\nI am looking for the correct syntax to do the below\nforeach itemA, itemB in ListA, ListB\n{\n Console.WriteLine(itemA.ToString()+\",\"+itemB.ToString());\n}\n\ndo you think t...
My Facebook application contains Javascript that works in Firefox and IE, but aborts in Chrome. In the Javascript console it gives several errors.including: Uncaught TypeError: Object onloadhooks has no method 'replace' There are similar errors complaining about a missing method for 'toLowerCase'. Stop Press Problem n...
It's good to hear that the problem no longer occurs, as it suggests that a recent update to Chrome may have resolved the issue with your Facebook application. However, for future reference or if similar issues arise, here are some steps you can take to troubleshoot JavaScript issues across different browsers, includi...
35,756
[ { "from": "human", "value": "My Facebook application contains Javascript that works in Firefox and IE, but aborts in Chrome.\nIn the Javascript console it gives several errors.including:\nUncaught TypeError: Object onloadhooks has no method 'replace'\n\nThere are similar errors complaining about a missing m...
Given two sets A and B, what is the common algorithm used to find their union, and what is it's running time? My intuition: a = set((1, 2, 3)) b = set((2, 3, 5)) union = set() for el in a: union.add(el) for el in b: union.add(el) Add checks for a collision, which is O(1), and then adds the element, which is ...
Your intuition is on the right track, but let’s clarify a few points regarding the union of two sets and its running time. The algorithm you've described for finding the union of two sets \( A \) and \( B \) can be summarized as follows: 1. Create an empty set, `union`. 2. Iterate through each element in set \( A \) ...
36,090
[ { "from": "human", "value": "Given two sets A and B, what is the common algorithm used to find their union, and what is it's running time?\nMy intuition: \na = set((1, 2, 3))\nb = set((2, 3, 5))\nunion = set()\nfor el in a:\n union.add(el)\n\nfor el in b:\n union.add(el)\n\nAdd checks for a collision,...
How do you combine two jQuery search results? eg: var $allFoos = $('.foo'), $allBars = $('.bar') $allFoosAndBars = $allFoos + $allBars; Obviously, I just made up that last line, but I hope it makes it sorta clear what I mean. To be clear, the example is greatly simplified, and it could be any arbitrary sets i'...
In jQuery, you cannot directly use the `+` operator to combine jQuery objects, as it is not defined for those types. However, you can use the `.add()` method to combine two or more jQuery objects into a single jQuery object. Here’s how you can do it in your example: ```javascript var $allFoos = $('.foo'); var $allBars...
38,803
[ { "from": "human", "value": "How do you combine two jQuery search results? eg:\nvar $allFoos = $('.foo'),\n $allBars = $('.bar')\n $allFoosAndBars = $allFoos + $allBars;\n\nObviously, I just made up that last line, but I hope it makes it sorta clear what I mean. To be clear, the example is greatly sim...