instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
I need to prepare for my exam and this is the probable question for the test. Given a frustum method such as frustum(-1,1, -0.5, 0.5, 1, 2) how to convert this to a projection matrix? The above example from my textbook but the writers don't define it in detail. If anyone can explain this in detail, I'd appreciate very ... | Certainly! A frustum projection matrix is used to create a perspective projection in 3D graphics. The parameters you're referring to in the `frustum` method define the left, right, bottom, top, near, and far clipping planes of the frustum.
### Parameters of the Frustum Method
For the function `frustum(left, right, bot... | 30,427 | [
{
"from": "human",
"value": "I need to prepare for my exam and this is the probable question for the test. Given a frustum method such as frustum(-1,1, -0.5, 0.5, 1, 2) how to convert this to a projection matrix? The above example from my textbook but the writers don't define it in detail. If anyone can exp... |
Having sorted out an issue with clickonce deployment the client has asked whether we can modify the installation sequences and pretty them up. Can anyone shed any light on how to customise the look and feel of the clickonce initial installer?
| Customizing the look and feel of a ClickOnce installation can be somewhat limited because ClickOnce is designed to provide a consistent and straightforward installation experience. However, you can still make some modifications to improve the visual appearance and user experience.
Here are a few ways to customize Clic... | 38,620 | [
{
"from": "human",
"value": "Having sorted out an issue with clickonce deployment the client has asked whether we can modify the installation sequences and pretty them up. Can anyone shed any light on how to customise the look and feel of the clickonce initial installer?\n"
},
{
"from": "gpt",
"... |
Is there a command-line argument that would force firefox.exe to launch a new process for a particular URL regardless of whether another instance of firefox is already running?
| Yes, you can launch a new instance of Firefox for a particular URL by using the command-line argument `-no-remote`. This argument tells Firefox to start a new process that does not share the profile with any existing instances. Here’s how you can do this:
1. Open your command prompt (cmd) or terminal.
2. Use the follo... | 42,158 | [
{
"from": "human",
"value": "Is there a command-line argument that would force firefox.exe to launch a new process for a particular URL regardless of whether another instance of firefox is already running?\n"
},
{
"from": "gpt",
"value": "Yes, you can launch a new instance of Firefox for a parti... |
How can I compare strings in a case insensitive way in Python?
I would like to encapsulate comparison of a regular strings to a repository string, using simple and Pythonic code. I also would like to have ability to look up values in a dict hashed by strings using regular python strings.
| To compare strings in a case-insensitive way in Python, you can use the `str.lower()` or `str.upper()` methods to normalize the case of the strings before comparison. Alternatively, you can use the `casefold()` method, which is more aggressive in handling different cases (especially useful for some languages).
Here's ... | 37,714 | [
{
"from": "human",
"value": "How can I compare strings in a case insensitive way in Python?\nI would like to encapsulate comparison of a regular strings to a repository string, using simple and Pythonic code. I also would like to have ability to look up values in a dict hashed by strings using regular pytho... |
I know how to include files that are in folders further down the heirachy but I have trouble finding my way back up.
I decided to go with the set_include_path to default all further includes relative to a path 2 levels up but don't have the slightest clue how to write it out.
Is there a guide somewhere that details pat... | In PHP, including files from different directories can be a bit tricky, especially when navigating the directory structure. Here’s a guide on how to set the `include_path` using `set_include_path()`, as well as some general best practices for including files in PHP.
### Understanding Path References
1. **Absolute Pat... | 38,845 | [
{
"from": "human",
"value": "I know how to include files that are in folders further down the heirachy but I have trouble finding my way back up.\nI decided to go with the set_include_path to default all further includes relative to a path 2 levels up but don't have the slightest clue how to write it out.\n... |
Can Unicode characters be encoded and decoded with Base64?
I have attempted to encode the string 'الله', but when I decoded it all I got was '????'.
| Yes, Unicode characters can be encoded and decoded using Base64, but you need to make sure you are correctly handling the character encoding when converting the string to bytes and back. Base64 operates on binary data, so you need to properly encode the string into bytes before encoding it in Base64.
Here’s a step-by-... | 36,735 | [
{
"from": "human",
"value": "Can Unicode characters be encoded and decoded with Base64?\nI have attempted to encode the string 'الله', but when I decoded it all I got was '????'.\n"
},
{
"from": "gpt",
"value": "Yes, Unicode characters can be encoded and decoded using Base64, but you need to mak... |
I am trying to set the innerxml of a xmldoc but get the exception: Reference to undeclared entity
XmlDocument xmldoc = new XmlDocument();
string text = "Hello, I am text α – —"
xmldoc.InnerXml = "<p>" + text + "</p>";
This throws the exception:
Reference to undeclared entity 'alpha'. Line 2,... | The issue you're encountering is due to the fact that the `α`, ` `, and other named entities are not declared in the XML context you're using. In XML, entities need to be defined, and the standard predefined entities in HTML (like `α` or ` `) are not inherently recognized by the XML parser.
To so... | 39,867 | [
{
"from": "human",
"value": "I am trying to set the innerxml of a xmldoc but get the exception: Reference to undeclared entity\nXmlDocument xmldoc = new XmlDocument();\nstring text = \"Hello, I am text α – —\"\nxmldoc.InnerXml = \"<p>\" + text + \"</p>\";\n\nThis throws the exceptio... |
What type of client is likely to support XP (Extreme Programming) practices?
| Clients that are likely to support XP (Extreme Programming) practices typically exhibit the following characteristics:
1. **Emphasis on Collaboration**: Clients who value close collaboration and open communication between development teams and stakeholders are more likely to embrace XP practices. This includes regular... | 40,184 | [
{
"from": "human",
"value": "What type of client is likely to support XP (Extreme Programming) practices?\n"
},
{
"from": "gpt",
"value": "Clients that are likely to support XP (Extreme Programming) practices typically exhibit the following characteristics:\n\n1. **Emphasis on Collaboration**: C... |
I'm trying to understand how you are supposed to add page numbers to the bottom of each page using ActiveReports3.
E.g.
Page 1 of 10.
Thanks,
Mo
| To add page numbers to the bottom of each page in ActiveReports 3, you would typically follow these steps:
1. **Open Your Report**: Start by opening your report in ActiveReports Designer.
2. **Add a Footer Section**: You need to have a footer section where the page numbers will be displayed. If your report doesn't ha... | 39,920 | [
{
"from": "human",
"value": "I'm trying to understand how you are supposed to add page numbers to the bottom of each page using ActiveReports3. \nE.g.\nPage 1 of 10.\nThanks,\nMo\n"
},
{
"from": "gpt",
"value": "To add page numbers to the bottom of each page in ActiveReports 3, you would typical... |
I am looking for the highest key value (a defined by the comparison operator) of a std::map.
Is this guaranteed to be
map.rbegin()->first
?
(I am a bit shaky on reverse iterators, and how much freedom there is in the implementation of std::map)
If not, please advise. I cannot change the data structure.
| In C++, the `std::map` is an ordered associative container that stores elements in key-value pairs. The keys are arranged in a specific order based on the comparison operator provided (which defaults to `std::less<Key>`).
When you want to access the highest key in a `std::map`, you can indeed use reverse iterators. Th... | 40,372 | [
{
"from": "human",
"value": "I am looking for the highest key value (a defined by the comparison operator) of a std::map.\nIs this guaranteed to be \nmap.rbegin()->first\n\n? \n(I am a bit shaky on reverse iterators, and how much freedom there is in the implementation of std::map) \nIf not, please advise. I... |
Is it possible to access the following formatted menu item like any other standard menu item (using the underscore-method, e.g. "_File" would be accessible by pressing "f")? I would like to use "O" as "access key" here.
Unfortunately, <AccessText> does not seem to be usable directly (I imaginged something like
<Access... | To enable access key functionality in WPF for a `MenuItem`, you typically use the underscore method in the `Header` text directly. However, since your header contains more complex formatting (using `TextBlock` and `Span`), you can't directly use the underscore to designate the access key.
A common workaround is to use... | 38,550 | [
{
"from": "human",
"value": "Is it possible to access the following formatted menu item like any other standard menu item (using the underscore-method, e.g. \"_File\" would be accessible by pressing \"f\")? I would like to use \"O\" as \"access key\" here.\nUnfortunately, <AccessText> does not seem to be us... |
I don't understand how GCC works under Linux. In a source file, when I do a:
#include <math.h>
Does the compiler extract the appropriate binary code and insert it into the compiled executable OR does the compiler insert a reference to an external binary file (a-la Windows DLL?)
I guess a generic version of this quest... | Great question! Let's break it down.
### How `#include <math.h>` Works in GCC
When you include a header file like `#include <math.h>` in your C or C++ source code, you're essentially telling the compiler to include the declarations (function prototypes, constants, etc.) defined in that header file. This is not the sa... | 39,647 | [
{
"from": "human",
"value": "I don't understand how GCC works under Linux. In a source file, when I do a:\n#include <math.h>\n\nDoes the compiler extract the appropriate binary code and insert it into the compiled executable OR does the compiler insert a reference to an external binary file (a-la Windows D... |
I have an existing htaccess that works fine:
RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule (.*) /default.php
DirectoryIndex index.php /default.php
I wish to modify this so that all urls that start with /test/ go to /test/default.php.
Example: http://www.x.com/hell... | To modify your existing `.htaccess` file so that URLs starting with `/test/` redirect to `/test/default.php`, while other URLs redirect to `/default.php`, you can update your rewrite rules accordingly. Here’s how you can achieve that:
```apache
RewriteEngine On
# Handle URLs that start with /test/
RewriteCond %{SCRIP... | 39,453 | [
{
"from": "human",
"value": "I have an existing htaccess that works fine:\nRewriteEngine On\nRewriteCond %{SCRIPT_FILENAME} !-f\nRewriteCond %{SCRIPT_FILENAME} !-d\nRewriteRule (.*) /default.php \nDirectoryIndex index.php /default.php \n\nI wish to modify this so that all urls that start with /test/ go to /... |
I have a .jar file that i've placed in my D:\Coldfusion8\wwwroot\web-inf\lib\ directory. The file is abcdef.jar
This is my first time doing this, not sure what the path should be in my createObject().
<cfset abcObj = createObject("java","com.abcdef") />
<cfset result = acbObj.doStuff("123456") />
But when I run it, I... | The error message you're receiving indicates that ColdFusion cannot find the class `com.abcdef` in the specified JAR file `abcdef.jar`. There are several potential reasons for this issue, and I will provide you with steps to troubleshoot and resolve it.
### 1. Verify the Classpath
Ensure that the JAR file is indeed in... | 39,590 | [
{
"from": "human",
"value": "I have a .jar file that i've placed in my D:\\Coldfusion8\\wwwroot\\web-inf\\lib\\ directory. The file is abcdef.jar\nThis is my first time doing this, not sure what the path should be in my createObject().\n<cfset abcObj = createObject(\"java\",\"com.abcdef\") />\n<cfset resul... |
What is the most efficient way to cacluate the closest power of a 2 or 10 to another number? e.g.
3.5 would return 4 for power of 2 and 1 for power of 10
123 would return 128 for power of 2 and 100 for power of 10
0.24 would return 0.25 for power of 2 and 0.1 for power of 10
I'm just looking for the algorithm and don't... | To calculate the closest power of 2 or 10 to a given number, you can use a simple logarithmic approach followed by rounding. Here's a general algorithm for both powers:
### For Power of 2
1. **Calculate the Logarithm**: Compute the logarithm base 2 of the number.
\[
\text{log\_2\_value} = \log_2(x)
\]
2. ... | 37,070 | [
{
"from": "human",
"value": "What is the most efficient way to cacluate the closest power of a 2 or 10 to another number? e.g.\n3.5 would return 4 for power of 2 and 1 for power of 10\n123 would return 128 for power of 2 and 100 for power of 10\n0.24 would return 0.25 for power of 2 and 0.1 for power of 10\... |
I want to, when given a particular model, return all the related models it is associated with. For example:
class Dog < ActiveRecord::Base
has_many :bones
belongs_to :master
end
d = Dog.first
d.associations #<== should return [Bone, Master]
Is there a way to do this already without having to roll my own? Failin... | In ActiveRecord, you can use the `reflect_on_all_associations` method to get a list of all the associations defined in a model. This method returns an array of `ActiveRecord::Reflection` objects, which contain metadata about each association. You can then extract the class names of these associations.
Here's how you c... | 37,813 | [
{
"from": "human",
"value": "I want to, when given a particular model, return all the related models it is associated with. For example:\nclass Dog < ActiveRecord::Base\n has_many :bones\n belongs_to :master\nend\n\nd = Dog.first\nd.associations #<== should return [Bone, Master]\n\nIs there a way to do t... |
I'm trying to use powershell to configure the account credentials, but I need to grant the account "Log on as a service" right in order for it to work. How can I do this in powershell?
| To grant the "Log on as a service" right to an account using PowerShell, you can utilize the `ntrights` command from the Windows Server 2003 Resource Kit Tools. However, since this command is not included by default in modern Windows environments, you may want to use the `secedit` command along with a security template... | 36,493 | [
{
"from": "human",
"value": "I'm trying to use powershell to configure the account credentials, but I need to grant the account \"Log on as a service\" right in order for it to work. How can I do this in powershell?\n"
},
{
"from": "gpt",
"value": "To grant the \"Log on as a service\" right to ... |
I`m using Delphi 2009 and want to operate some XML data. I heard that nativeXML is one of the most convenient ways to do it. so how can I install this library?
| NativeXML is a popular library for handling XML in Delphi, and it's quite straightforward to install and use it in Delphi 2009. Below are the steps to download, install, and use NativeXML:
### Step 1: Download NativeXML
1. **Visit the NativeXML Repository**: Go to the official [NativeXML repository](https://github.co... | 35,534 | [
{
"from": "human",
"value": "I`m using Delphi 2009 and want to operate some XML data. I heard that nativeXML is one of the most convenient ways to do it. so how can I install this library?\n"
},
{
"from": "gpt",
"value": "NativeXML is a popular library for handling XML in Delphi, and it's quite ... |
Can LINQ to SQL query using NOT IN?
e.g., SELECT au_lname, state FROM authors WHERE state NOT IN ('CA', 'IN', 'MD')
| Yes, you can use the `NOT IN` clause in LINQ to SQL queries, but it requires a slightly different syntax compared to SQL. In LINQ, you would typically use the `Contains` method in combination with `!` (not) to achieve the same functionality.
Here’s how you can translate your SQL query into LINQ to SQL:
```csharp
var ... | 41,341 | [
{
"from": "human",
"value": "Can LINQ to SQL query using NOT IN? \ne.g., SELECT au_lname, state FROM authors WHERE state NOT IN ('CA', 'IN', 'MD')\n"
},
{
"from": "gpt",
"value": "Yes, you can use the `NOT IN` clause in LINQ to SQL queries, but it requires a slightly different syntax compared to... |
I have html code that looks roughly like this:
<div id="id1">
<div id="id2">
<p>some html</p>
<span>maybe some more</span>
</div>
<div id="id3">
<p>different text here</p>
<input type="text">
<span>maybe even a form item</span>
</div>
</div>
Obviously there's more to it than that, but that'... | Yes, you can achieve this in JavaScript using the DOM manipulation methods provided by the browser. To swap two nodes in the DOM, you can use the `insertBefore` method along with some reference logic.
Here's a function that takes two element IDs, finds those elements in the DOM, and swaps their positions:
```javascri... | 39,279 | [
{
"from": "human",
"value": "I have html code that looks roughly like this:\n<div id=\"id1\">\n <div id=\"id2\">\n <p>some html</p>\n <span>maybe some more</span>\n </div>\n <div id=\"id3\">\n <p>different text here</p>\n <input type=\"text\">\n <span>maybe even a form item</span>\n </div... |
Given:
CR = %0d = \r
LF = %0a = \n
What does
%3E,
%3C
Mean?
| In URL encoding (also known as percent encoding), certain characters are represented by a percent sign (%) followed by two hexadecimal digits.
- `%3E` represents the character `>`, which is the greater-than sign.
- `%3C` represents the character `<`, which is the less-than sign.
These encodings are often used in web... | 43,562 | [
{
"from": "human",
"value": "Given:\nCR = %0d = \\r\nLF = %0a = \\n\n\nWhat does\n%3E,\n%3C \nMean?\n"
},
{
"from": "gpt",
"value": "In URL encoding (also known as percent encoding), certain characters are represented by a percent sign (%) followed by two hexadecimal digits. \n\n- `%3E` represen... |
I'm not really sure how to google this one . I would like to know how would I add an entry to the right click menu in a Windows system . Something like "Open with ..." or "Archive with ... " . I would preffer a solution that works under Windows XP .
| To add an entry to the right-click context menu in Windows XP, you can modify the Windows Registry. Here are the steps to do this safely:
### Step 1: Open the Registry Editor
1. Click on the **Start** menu.
2. Select **Run**.
3. Type `regedit` and press **Enter**. This opens the Registry Editor.
### Step 2: Navigate... | 40,200 | [
{
"from": "human",
"value": "I'm not really sure how to google this one . I would like to know how would I add an entry to the right click menu in a Windows system . Something like \"Open with ...\" or \"Archive with ... \" . I would preffer a solution that works under Windows XP .\n"
},
{
"from": "... |
I want to use jQuery to parse RSS feeds. Can this be done with the base jQuery library out of the box or will I need to use a plugin?
| Parsing RSS feeds using jQuery directly is not straightforward because of the same-origin policy that restricts cross-origin HTTP requests in web browsers. This policy prevents you from fetching data from another domain using jQuery's `$.ajax()` or `$.get()` methods.
However, there are a couple of common approaches to... | 37,112 | [
{
"from": "human",
"value": "I want to use jQuery to parse RSS feeds. Can this be done with the base jQuery library out of the box or will I need to use a plugin?\n"
},
{
"from": "gpt",
"value": "Parsing RSS feeds using jQuery directly is not straightforward because of the same-origin policy tha... |
<object height="25" width="75" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">
<param value="http://click-here-to-listen.com/players/iaPlay13.swf?x=1058286910FTRZGK" name="movie"/>
<param value="high... | Yes, you’re on the right track! Since Adobe Flash is no longer supported as of December 2020, it's important to replace the legacy markup with modern HTML that does not rely on Flash.
Instead of using the `<object>` and `<embed>` tags, you can consider alternatives like HTML5 audio or other modern technologies. Here’... | 41,005 | [
{
"from": "human",
"value": " <object height=\"25\" width=\"75\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\">\n <param value=\"http://click-here-to-listen.com/players/iaPlay13.swf?x=105828691... |
What is the best way to sync up two lists each of which may contain items not in the other? As shown the lists are not sorted - although if necessary sorting them first would not be an issue.
List 1 = a,b,c,e
List 2 = b,e,c,d
Using the lists above, I'm looking for a solution that will write out to a spreadsheet in tw... | To achieve the desired output format of synchronizing two lists and writing them into a spreadsheet, you can follow these steps:
1. **Merge the Two Lists**: Create a combined set of unique items from both lists.
2. **Sort the Combined List**: Although it's not necessary, sorting the lists will help in aligning the out... | 40,123 | [
{
"from": "human",
"value": "What is the best way to sync up two lists each of which may contain items not in the other? As shown the lists are not sorted - although if necessary sorting them first would not be an issue.\nList 1 = a,b,c,e\nList 2 = b,e,c,d\n\nUsing the lists above, I'm looking for a soluti... |
I have a UITextField where the keyboard that pops up has its Shift key disabled. The keyboard type is set to UIKeyboardTypeNamePhonePad, which seems like it should allow capitals.
If I change the keyboard type to "default" but leave other settings alone, the Shift key is active. The other settings are:
autocapital... | The behavior you are experiencing with the `UIKeyboardTypeNamePhonePad` is expected and is a known limitation. The `UIKeyboardTypeNamePhonePad` is specifically designed for entering phone numbers or names, and it typically does not require capitalization for the input expected in that context (like phone numbers). As a... | 42,205 | [
{
"from": "human",
"value": "I have a UITextField where the keyboard that pops up has its Shift key disabled. The keyboard type is set to UIKeyboardTypeNamePhonePad, which seems like it should allow capitals. \nIf I change the keyboard type to \"default\" but leave other settings alone, the Shift key is a... |
I am developing a JSP application and am being forced to load a COM object. Can such a thing can be done?
If yes, how?
| Using a COM object in a JSP (JavaServer Pages) application can be quite complex due to the differences in technology stacks. COM (Component Object Model) is a Microsoft technology primarily used in Windows environments, while JSP is based on Java and typically runs on a Java application server.
However, it is technica... | 34,399 | [
{
"from": "human",
"value": "I am developing a JSP application and am being forced to load a COM object. Can such a thing can be done?\nIf yes, how?\n"
},
{
"from": "gpt",
"value": "Using a COM object in a JSP (JavaServer Pages) application can be quite complex due to the differences in technolo... |
Consider the following piece of Java code.
int N = 10;
Object obj[] = new Object[N];
for (int i = 0; i < N; i++) {
int capacity = 1000 * i;
obj[i] = new ArrayList(capacity);
}
Because in Java, all objects live on the Heap, the array does not
contain the objects themselves, but references to the objects. Also,
... | To translate the Java code into C++ while keeping the array and the objects on the stack, we can use `std::array` to handle the array and `std::vector` or a custom object directly. C++ does not have a built-in array of objects like Java does, but we can achieve similar functionality with stack-allocated containers.
He... | 38,606 | [
{
"from": "human",
"value": "Consider the following piece of Java code.\nint N = 10;\nObject obj[] = new Object[N];\nfor (int i = 0; i < N; i++) {\n int capacity = 1000 * i;\n obj[i] = new ArrayList(capacity);\n}\n\nBecause in Java, all objects live on the Heap, the array does not\ncontain the objects... |
I'm scouring the internet for a definition of the term "Internal Node." I cannot find a succinct definition. Every source I'm looking at uses the term without defining it, and the usage doesn't yield a proper definition of what an internal node actually is.
Here are the two places I've been mainly looking:
Link assumes... | An **internal node** is a term commonly used in the context of tree data structures, particularly in computer science and mathematics. Here’s a clear definition:
An **internal node** (or **inner node**) is any node in a tree data structure that has at least one child. In contrast, a node that has no children is referr... | 42,059 | [
{
"from": "human",
"value": "I'm scouring the internet for a definition of the term \"Internal Node.\" I cannot find a succinct definition. Every source I'm looking at uses the term without defining it, and the usage doesn't yield a proper definition of what an internal node actually is.\nHere are the two p... |
I need to start messing with a vb.net(vs2008) project file and I'd like a reference to, ideally, it's specification.
Any links would be very helpful
| When working with VB.NET projects in Visual Studio 2008, the project files you'll typically encounter are in the `.vbproj` format. The `.vbproj` file is an XML file that contains various settings and configurations for your VB.NET project.
While there isn't an official "specification" document from Microsoft detailing... | 36,687 | [
{
"from": "human",
"value": "I need to start messing with a vb.net(vs2008) project file and I'd like a reference to, ideally, it's specification.\nAny links would be very helpful\n"
},
{
"from": "gpt",
"value": "When working with VB.NET projects in Visual Studio 2008, the project files you'll ty... |
I am extremely new at php and I was wondering if someone could help me use either a for() or while() loop to create an array of 10 elements.
| Certainly! Below are examples of how to create an array with 10 elements using both a `for` loop and a `while` loop in PHP.
### Using a `for` Loop
You can create an array of 10 elements using a `for` loop as follows:
```php
<?php
$array = array(); // Create an empty array
for ($i = 0; $i < 10; $i++) {
$array[$i... | 40,567 | [
{
"from": "human",
"value": "I am extremely new at php and I was wondering if someone could help me use either a for() or while() loop to create an array of 10 elements.\n"
},
{
"from": "gpt",
"value": "Certainly! Below are examples of how to create an array with 10 elements using both a `for` l... |
We have a few applications that use the same Linq 2 SQL DataContext. One of those Apps wil do massive inserts (it's a convertor from an old system). Is it possible to change the UpdateCheck of the TimeStamp column of each table at runtime ? Only for this one app we'd like to set it to Never, all the other apps shoul... | In LINQ to SQL, you can control how changes to entities are tracked and whether certain columns are included in the update operations through the `UpdateCheck` property of the mapping attributes. However, modifying the mapping at runtime for a `DataContext` is not directly supported because the mappings are typically d... | 39,220 | [
{
"from": "human",
"value": "We have a few applications that use the same Linq 2 SQL DataContext. One of those Apps wil do massive inserts (it's a convertor from an old system). Is it possible to change the UpdateCheck of the TimeStamp column of each table at runtime ? Only for this one app we'd like to ... |
I'm reading through K&R and came to the small section on register variables, and was wondering if people here have some good examples of this put into practice.
From section 4.7 in K&R:
The register declaration looks like
register int x;
register char c;
To be clear, I'm just hoping to see some cool co... | Certainly! The `register` keyword in C is a hint to the compiler that the variable will be heavily used and should be stored in a CPU register for faster access, if possible. Here are some practical code examples demonstrating its use:
### Example 1: Simple Loop with Register Variable
In this example, we use `registe... | 37,563 | [
{
"from": "human",
"value": "I'm reading through K&R and came to the small section on register variables, and was wondering if people here have some good examples of this put into practice.\nFrom section 4.7 in K&R:\n\nThe register declaration looks like\n register int x;\n register char c;\n\n... |
I'm looking for an alternative, since I find emacs difficult to use. I'd rather use an editor that supports all the usual shortcuts I'm used to, such as arrow keys to move the cursor around, CTRL+SHIFT+RightArrow to select the next word, etc.
Basically, I don't want to have to relearn all my familiar shortcuts just so ... | If you find Emacs difficult and want a more traditional editing experience with familiar keyboard shortcuts, there are several alternatives that you might find more comfortable. Here are a few options:
1. **VS Code (Visual Studio Code)**:
- This is a highly popular code editor with a rich ecosystem of extensions. ... | 40,382 | [
{
"from": "human",
"value": "I'm looking for an alternative, since I find emacs difficult to use. I'd rather use an editor that supports all the usual shortcuts I'm used to, such as arrow keys to move the cursor around, CTRL+SHIFT+RightArrow to select the next word, etc.\nBasically, I don't want to have to ... |
I am trying to set one bindable variable to be bound to another. Essentially I want to create an alias. I would give up, but this seems like something that would be good to know.
essentially, I want changes in model.configView to be reflected in view, so that things bound to view.... behave the same as things bound t... | To achieve the binding between your model and view in a way that any changes in `model.configView` are reflected in the view, you need to make sure that the `configView` object implements the `IEventDispatcher` interface. In ActionScript, that typically means your `configView` should be a bindable object that dispatche... | 39,799 | [
{
"from": "human",
"value": "I am trying to set one bindable variable to be bound to another. Essentially I want to create an alias. I would give up, but this seems like something that would be good to know.\nessentially, I want changes in model.configView to be reflected in view, so that things bound to ... |
I am working on a site laid out with divs. I am having trouble with one in particular: the training photo div.
If you go to http://php.wmsgroup.com/eofd6.org/education.html you'll see a photo underneath the left nav that has dropped down. I want it to snap right under that nav box. I have tried several different things... | To address the issue of the training photo div dropping down below the left navigation, you'll want to ensure that its CSS positioning and the layout of the surrounding elements are set correctly. Here are some steps to help you align the training photo div correctly under the left navigation box:
1. **Inspect the Str... | 37,535 | [
{
"from": "human",
"value": "I am working on a site laid out with divs. I am having trouble with one in particular: the training photo div.\nIf you go to http://php.wmsgroup.com/eofd6.org/education.html you'll see a photo underneath the left nav that has dropped down. I want it to snap right under that nav ... |
I'm trying to do some conditional formatting in Excel 2003, what I want to do is have a cell go red if the next cell is "Yes" and go bold if it, itself, contains "Yes". So if both cells are "Yes" the current cell will be red and bold. I want to do this for a group of cells so I haven't used a direct reference to the ce... | In Excel 2003, when applying conditional formatting, you can't use functions like `INDIRECT` or `ADDRESS` that reference the cell you are formatting itself. Excel's conditional formatting works best when it uses direct references to the cells you're checking.
Since you want to format based on the value of the cell its... | 38,627 | [
{
"from": "human",
"value": "I'm trying to do some conditional formatting in Excel 2003, what I want to do is have a cell go red if the next cell is \"Yes\" and go bold if it, itself, contains \"Yes\". So if both cells are \"Yes\" the current cell will be red and bold. I want to do this for a group of cells... |
I've seen some nice screenshot popups around the web, do you know of any library to do that? I could write my own, but... if there's something free I can save time.
Thanks!
| Yes, there are several libraries and tools available that can help you create nice screenshot popups or overlays for your web projects. Here are some popular options:
1. **Lightbox**: Although typically used for images, Lightbox libraries can be adapted to display screenshots in a visually appealing way. Some popular ... | 40,975 | [
{
"from": "human",
"value": "I've seen some nice screenshot popups around the web, do you know of any library to do that? I could write my own, but... if there's something free I can save time.\nThanks!\n"
},
{
"from": "gpt",
"value": "Yes, there are several libraries and tools available that ca... |
Considering a large system with hundreds of assemblies, what is the easiest way to determine which other projects in the large system depend on a specific assembly when there isn't any way to create a single visual studio solution that contains all the projects?
| Determining dependencies across a large system with hundreds of assemblies can be challenging, especially without the ability to consolidate everything into a single Visual Studio solution. Here are several strategies you can use to identify which projects depend on a specific assembly:
### 1. **Static Code Analysis T... | 38,188 | [
{
"from": "human",
"value": "Considering a large system with hundreds of assemblies, what is the easiest way to determine which other projects in the large system depend on a specific assembly when there isn't any way to create a single visual studio solution that contains all the projects?\n"
},
{
... |
Are there any issues which might make MS's T4 Template code-generation system unsuitable for generating C++ code?
| Microsoft's T4 (Text Template Transformation Toolkit) is a powerful code generation system typically used in .NET applications, primarily for generating C# code and other text-based outputs. While T4 can theoretically be used to generate any text, including C++ code, there are several potential issues and limitations t... | 38,416 | [
{
"from": "human",
"value": "Are there any issues which might make MS's T4 Template code-generation system unsuitable for generating C++ code?\n"
},
{
"from": "gpt",
"value": "Microsoft's T4 (Text Template Transformation Toolkit) is a powerful code generation system typically used in .NET applic... |
How can I send a monitor into/out-of a different power state (like sleep)?
| Sending a monitor into or out of different power states (like sleep) can be accomplished through several methods, depending on your operating system and hardware configuration. Here are some common approaches:
### Windows
1. **Using Power Options**:
- Right-click on the desktop and select "Display settings".
- ... | 38,857 | [
{
"from": "human",
"value": "How can I send a monitor into/out-of a different power state (like sleep)?\n"
},
{
"from": "gpt",
"value": "Sending a monitor into or out of different power states (like sleep) can be accomplished through several methods, depending on your operating system and hardwa... |
Is there an elegantish way in Swing to find out if there are any tooltips currently being displayed in my frame?
I'm using custom tooltips, so it would be very easy to set a flag in my createToolTip() method, but I can't see a way to find out when the tooltip is gone.
ToolTipManager has a nice flag for this, tipShowing... | Using reflection to access private fields is generally not recommended, as it can lead to fragile code that breaks with updates to the Java runtime, and it can also violate encapsulation principles.
If you're using custom tooltips, a cleaner approach would be to manage the tooltip visibility state yourself. Here’s an... | 38,742 | [
{
"from": "human",
"value": "Is there an elegantish way in Swing to find out if there are any tooltips currently being displayed in my frame?\nI'm using custom tooltips, so it would be very easy to set a flag in my createToolTip() method, but I can't see a way to find out when the tooltip is gone.\nToolTipM... |
I'm looking for Java code that can be used to generate sound at runtime - NOT playback of existing sound files.
For example, what's the best code for generating a sawtooth waveform at 440 Hz for a duration of 2 milliseconds? Source code appreciated!
I remember my Commodore 128 had a simple Sound command that took as pa... | Generating sound at runtime in Java can be done using the `SourceDataLine` class from the Java Sound API. Below is an example of how to generate a sawtooth waveform at 440 Hz for a duration of 2 milliseconds.
```java
import javax.sound.sampled.*;
public class SoundGenerator {
public static void main(String[] arg... | 39,457 | [
{
"from": "human",
"value": "I'm looking for Java code that can be used to generate sound at runtime - NOT playback of existing sound files.\nFor example, what's the best code for generating a sawtooth waveform at 440 Hz for a duration of 2 milliseconds? Source code appreciated!\nI remember my Commodore 128... |
I have a DataTable that queries out something like below
usergroupid...userid......username
1.............1...........John
1.............2...........Lisa
2.............3...........Nathan
3.............4...........Tim
What I'm trying to do is write a LINQ statement that will return an array of UserGroup instances. The ... | Yes, you can use a single LINQ statement to project your `DataTable` into an array of `UserGroup` instances that contain an array of `User` instances. Below is an example of how you can achieve this in C#.
Assuming you have the `UserGroup` and `User` classes defined as follows:
```csharp
public class User
{
publi... | 37,889 | [
{
"from": "human",
"value": "I have a DataTable that queries out something like below\nusergroupid...userid......username\n1.............1...........John\n1.............2...........Lisa\n2.............3...........Nathan\n3.............4...........Tim\n\nWhat I'm trying to do is write a LINQ statement that w... |
Basic question: How to I create a bidirectional one-to-many map in Fluent NHibernate?
Details:
I have a parent object with many children. In my case, it is meaningless for the child to not have a parent, so in the database, I would like the foreign key to the parent to have NOT NULL constraint. I am auto-generating m... | To create a bidirectional one-to-many association in Fluent NHibernate, you indeed need to include a reference to the parent (`Summary`) in the child (`Detail`) class. This will allow you to set up the relationship correctly and enforce the NOT NULL constraint on the foreign key in your database.
Here's how you can mo... | 37,096 | [
{
"from": "human",
"value": "Basic question: How to I create a bidirectional one-to-many map in Fluent NHibernate?\nDetails:\nI have a parent object with many children. In my case, it is meaningless for the child to not have a parent, so in the database, I would like the foreign key to the parent to have N... |
What is the single best pretty-printing library for Java? I mean a library for printing formatted output with indentation, break hints, etc., not a library for beautifying/re-formatting Java code itself. Ideally, the library would "play nice" with System.out.println and friends.
For an idea of what I'm looking for, see... | For pretty-printing in Java, you may want to consider the following libraries that provide formatting capabilities with indentation, line breaks, and more:
1. **JEP (Java Expression Parser)**: This library is primarily used for parsing and evaluating mathematical expressions, but it includes pretty-printing capabiliti... | 39,286 | [
{
"from": "human",
"value": "What is the single best pretty-printing library for Java? I mean a library for printing formatted output with indentation, break hints, etc., not a library for beautifying/re-formatting Java code itself. Ideally, the library would \"play nice\" with System.out.println and friend... |
Are there any good JavaScript frameworks out there which primary audience is not web programming? Especially frameworks/libraries which improves the object orientation?
The framework should be usable within an desktop application embedding a JavaScript engine (such as Spidermonkey or JavaScriptCore), so no external dep... | Yes, there are several JavaScript frameworks and libraries that focus on improving object-oriented programming (OOP) principles, and they can be used in environments outside of traditional web programming. Here are a few that you might find useful, particularly for embedding in desktop applications:
1. **Class.js**: T... | 37,946 | [
{
"from": "human",
"value": "Are there any good JavaScript frameworks out there which primary audience is not web programming? Especially frameworks/libraries which improves the object orientation?\nThe framework should be usable within an desktop application embedding a JavaScript engine (such as Spidermon... |
I have a FAT12 image file and I have to open it and read it. I would like to view this image file(directories/files with in) so I can have an idea of what outcomes I should be getting. Anyone know of a good software that would let me view this FAT12 image file? Also can someone guide towards the right directions when t... | To view the contents of a FAT12 image file, you have several options for software that can help you explore its directories and files. Here are some recommended tools:
### Software to View FAT12 Image Files:
1. **WinImage** (Windows):
- A powerful disk imaging software that allows you to open and explore FAT12 ima... | 35,956 | [
{
"from": "human",
"value": "I have a FAT12 image file and I have to open it and read it. I would like to view this image file(directories/files with in) so I can have an idea of what outcomes I should be getting. Anyone know of a good software that would let me view this FAT12 image file? Also can someone ... |
I am using Xcode to develop a GUI application. I have a model class and a controller class. I have a NSTextView data member in my controller class. How do I access this variable from the model class?
| In an MVC (Model-View-Controller) architecture, the model should be unaware of the view or controller. The model represents the data and business logic, and should not have direct access to UI components. Instead, the communication between the model and the controller can be handled through delegate patterns, notificat... | 38,799 | [
{
"from": "human",
"value": "I am using Xcode to develop a GUI application. I have a model class and a controller class. I have a NSTextView data member in my controller class. How do I access this variable from the model class?\n"
},
{
"from": "gpt",
"value": "In an MVC (Model-View-Controller) ... |
I have a servlet running in an Oracle OCCAS server. Currently I map some data in a database to an entity class in my application using @Entity annotaion.
I fail to inject the EntityManager (@PersistenceContext) though, and to my understanding that is because it is running in my servlet context and not as a separate Ent... | Using JPA (Java Persistence API) in a servlet environment can be challenging, especially when dealing with `EntityManager` and its lifecycle. The issues you're facing are common when attempting to manage JPA contexts manually in a non-EJB environment. Here are some points to consider:
1. **Using @PersistenceContext**:... | 37,425 | [
{
"from": "human",
"value": "I have a servlet running in an Oracle OCCAS server. Currently I map some data in a database to an entity class in my application using @Entity annotaion.\nI fail to inject the EntityManager (@PersistenceContext) though, and to my understanding that is because it is running in my... |
Normally, in Delphi one would declare a function with a variable number of arguments using the 'array of const' method. However, for compatibility with code written in C, there's an much-unknown 'varargs' directive that can be added to a function declaration (I learned this while reading Rudy's excellent 'Pitfalls of ... | In Delphi, when using the `varargs` directive, you indeed can implement functions that are compatible with C-style variable arguments. However, handling variable arguments in Delphi is not as straightforward as in C, since Delphi does not provide built-in support for accessing these arguments directly in the way C does... | 39,765 | [
{
"from": "human",
"value": "Normally, in Delphi one would declare a function with a variable number of arguments using the 'array of const' method. However, for compatibility with code written in C, there's an much-unknown 'varargs' directive that can be added to a function declaration (I learned this whi... |
I have an OpenGl program in which I am displaying an image using textures. I want to be able to load a new image to be displayed.
In my Init function I call:
Gl.glGenTextures(1, mTextures);
Since only one image will be displayed at time, I am using the same texture name for each image.
Each time a new image is loade... | The issue you're experiencing, where only the first image loads correctly and subsequent images display as all black, is likely related to how you're handling the texture parameters and the pixel format of the texture data. Here are several things to check and potential solutions to consider:
### 1. Texture Format and... | 39,310 | [
{
"from": "human",
"value": "I have an OpenGl program in which I am displaying an image using textures. I want to be able to load a new image to be displayed. \nIn my Init function I call:\nGl.glGenTextures(1, mTextures);\n\nSince only one image will be displayed at time, I am using the same texture name fo... |
I basically created some tables to play around with: I have Two main tables, and a Many-Many join table. Here is the DDL: (I am using HSQLDB)
CREATE TABLE PERSON
(
PERSON_ID INTEGER GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
NAME VARCHAR(50), MAIN_PERSON_ID INTEGER
)
CREATE TABLE JOB
(
JOB_ID INTEGE... | To achieve your goal of deleting a job from the `JOB` table if it is associated with a specific `PERSON` and has no other associated persons, you will need to use a subquery in your DELETE statement. The subquery will help you find jobs that are only associated with the specific `PERSON_ID` you want to check against.
... | 40,065 | [
{
"from": "human",
"value": "I basically created some tables to play around with: I have Two main tables, and a Many-Many join table. Here is the DDL: (I am using HSQLDB)\nCREATE TABLE PERSON\n(\n PERSON_ID INTEGER GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY, \n NAME VARCHAR(50), MAIN_PERSON_ID IN... |
Thanks for going to answer my question. I have the folowing pages.
login.aspx
default.aspx
xxx.aspx
After logging into application default.aspx will be displayed. Now if the user is trying to open http://server/xxx.aspx?Id=1234 by specifying its URL directly in a browser, the login screen is displayed and after succe... | The behavior you're experiencing with the .NET login control is a common scenario when dealing with authentication and redirection in web applications. By default, when a user is not authenticated and attempts to access a protected page, the application will redirect them to the login page. However, once the user succe... | 37,861 | [
{
"from": "human",
"value": "Thanks for going to answer my question. I have the folowing pages.\n\nlogin.aspx\ndefault.aspx\nxxx.aspx\n\nAfter logging into application default.aspx will be displayed. Now if the user is trying to open http://server/xxx.aspx?Id=1234 by specifying its URL directly in a browser... |
I've got an executable file, and I would like to know which version(s) of the Microsoft .NET Framework this file needs to be started.
Is there an easy way to find this information somewhere?
(So far I tried ILDASM and DUMPBIN without any luck.)
| To determine which version(s) of the Microsoft .NET Framework an executable file requires, you can use several methods. Here are some approaches:
### 1. **Use the `corflags` Tool**
The `corflags` utility is part of the .NET Framework SDK and can provide information about the headers of .NET assemblies.
1. Open a Comm... | 38,793 | [
{
"from": "human",
"value": "I've got an executable file, and I would like to know which version(s) of the Microsoft .NET Framework this file needs to be started.\nIs there an easy way to find this information somewhere?\n(So far I tried ILDASM and DUMPBIN without any luck.)\n"
},
{
"from": "gpt",
... |
Why does the SQLite C/C++ API return unsigned char *s for text values as opposed to the more de-facto char * type?
This is somewhat related to the unsigned char question, except that the SQLite API's decision seems opposite of the conventional char * advice given for string-like values.
For example:
const unsigned char... | The decision by SQLite to use `unsigned char*` for text values in its C API, specifically in the function `sqlite3_column_text`, stems from a few key considerations:
1. **Data Representation**: SQLite's internal representation for strings is often binary safe. By using `unsigned char*`, SQLite can accommodate arbitrar... | 38,040 | [
{
"from": "human",
"value": "Why does the SQLite C/C++ API return unsigned char *s for text values as opposed to the more de-facto char * type?\nThis is somewhat related to the unsigned char question, except that the SQLite API's decision seems opposite of the conventional char * advice given for string-lik... |
In C++ you can disable a function in parent's class by declaring it as private in the child class. How can this be done in Python? I.E. How can I hide parent's function from child's public interface?
| In Python, you can't directly change the visibility of inherited methods in the same way as you can in C++ by making them private in the child class. However, you can achieve a similar effect by overriding the method in the child class and raising an exception or simply using a different name that isn't exposed in the ... | 39,738 | [
{
"from": "human",
"value": "In C++ you can disable a function in parent's class by declaring it as private in the child class. How can this be done in Python? I.E. How can I hide parent's function from child's public interface?\n"
},
{
"from": "gpt",
"value": "In Python, you can't directly chan... |
Is there a way to ensure all created subprocess are dead at exit time of a Python program? By subprocess I mean those created with subprocess.Popen().
If not, should I iterate over all of the issuing kills and then kills -9? anything cleaner?
| Yes, you can ensure that all created subprocesses are dead when a Python program exits. Python's `subprocess` module provides mechanisms to handle subprocesses gracefully. Here's a cleaner approach using signal handling and the `atexit` module.
1. **Use `atexit` to register cleanup functions**: This allows you to defi... | 38,374 | [
{
"from": "human",
"value": "Is there a way to ensure all created subprocess are dead at exit time of a Python program? By subprocess I mean those created with subprocess.Popen().\nIf not, should I iterate over all of the issuing kills and then kills -9? anything cleaner?\n"
},
{
"from": "gpt",
... |
I've downloaded Kigg example from codeplex, but it's seems to be outdated.
Is there a version for ASP.NET MVC Beta? Is there someone who try to port it(I've tried but without success because of lack of knowledge)?
| Kigg is an open-source project that was originally built with ASP.NET Web Forms and was designed for creating a social news aggregation site. If you're looking for a version compatible with ASP.NET MVC, you may find that the original Kigg project is outdated, but there are a few options you could consider:
1. **Forks ... | 40,802 | [
{
"from": "human",
"value": "I've downloaded Kigg example from codeplex, but it's seems to be outdated.\nIs there a version for ASP.NET MVC Beta? Is there someone who try to port it(I've tried but without success because of lack of knowledge)?\n"
},
{
"from": "gpt",
"value": "Kigg is an open-sou... |
What is the cast expression equivalent of VB.NET's CType in Visual Basic 6?
| In Visual Basic 6 (VB6), the equivalent of VB.NET's `CType` for type conversion is typically achieved using functions like `CInt`, `CStr`, `CDate`, `CDec`, etc., depending on the target data type. Each of these functions is used to convert a value to a specific data type.
For instance:
- `CInt(expression)` converts an... | 41,232 | [
{
"from": "human",
"value": "What is the cast expression equivalent of VB.NET's CType in Visual Basic 6?\n"
},
{
"from": "gpt",
"value": "In Visual Basic 6 (VB6), the equivalent of VB.NET's `CType` for type conversion is typically achieved using functions like `CInt`, `CStr`, `CDate`, `CDec`, et... |
Can any one help me to find out a code snippet in PHP to read contents in an CSV file and then insert to some tables as well as fetch some data from www(fetch image fom the image url in CSV file)
| Certainly! Below is a PHP code snippet that demonstrates how to read a CSV file, insert its contents into a database, and fetch images from URLs provided in the CSV file. You'll need to adjust the database connection details and the table structure according to your setup.
### Sample CSV Format
Assume you have a CSV f... | 37,495 | [
{
"from": "human",
"value": "Can any one help me to find out a code snippet in PHP to read contents in an CSV file and then insert to some tables as well as fetch some data from www(fetch image fom the image url in CSV file)\n"
},
{
"from": "gpt",
"value": "Certainly! Below is a PHP code snippet... |
We get an abort when a C++ exception is thrown when running code compiled with -pthread.
Platform: AIX 5.3 technical level 8
Compiler: gcc 3.4.6
Linker: AIX linker 1.65.2.4
Test Code:
// exception.cpp
#include <iostream>
class MyException
{
public:
MyException(){}
virtual ~MyException(){};
};
void gTe... | The issue you are encountering with the C++ exception handling while using `-pthread` with GCC 3.4.6 on AIX 5.3 is likely related to how exceptions are handled in a multi-threaded context when using older versions of GCC. In particular, GCC 3.4 has known issues with exceptions and threading, which can lead to undefined... | 37,183 | [
{
"from": "human",
"value": "We get an abort when a C++ exception is thrown when running code compiled with -pthread.\nPlatform: AIX 5.3 technical level 8\nCompiler: gcc 3.4.6\nLinker: AIX linker 1.65.2.4\nTest Code:\n// exception.cpp\n#include <iostream>\n\nclass MyException\n{\npublic:\n MyExceptio... |
As the title suggest...
How can I apply a scrum process to anything that doesn't work on new code and can be estimated to some degree?
How can I apply a scrum process to maintenance and emergency fixes (which can take from 5 minutes to 2 weeks to fix) type of environment when I still would like to plan to do things?
Ba... | Applying Scrum in a maintenance and emergency fixes environment can be challenging, especially given the unpredictability and variability in the nature of tasks. However, it is possible to adapt Scrum principles to better suit this context. Here are some strategies to help you overcome the challenges of unplanned tasks... | 33,284 | [
{
"from": "human",
"value": "As the title suggest...\nHow can I apply a scrum process to anything that doesn't work on new code and can be estimated to some degree?\nHow can I apply a scrum process to maintenance and emergency fixes (which can take from 5 minutes to 2 weeks to fix) type of environment when ... |
For a file containing the given class, SomeCoolClass, what would be the proper or standard filename?
1. somecoolclass.rb
2. some_cool_class.rb
3. some-cool-class.rb
4. SomeCoolClass.rb
or some other variation?
I noticed in the Ruby stdlib, versions 1, 2 and 3 are used.
| In Ruby, the convention for naming files that contain class definitions is to use snake_case. This means that the standard filename for the class `SomeCoolClass` would be:
**`some_cool_class.rb`**
This follows the Ruby community's conventions and keeps file naming consistent and readable.
To summarize:
- **Standard... | 42,987 | [
{
"from": "human",
"value": "For a file containing the given class, SomeCoolClass, what would be the proper or standard filename?\n\n 1. somecoolclass.rb\n 2. some_cool_class.rb\n 3. some-cool-class.rb\n 4. SomeCoolClass.rb\n\nor some other variation?\nI noticed in the Ruby stdlib, versions 1, 2 and 3 are u... |
I realize this perhaps a naive question but still I cant figure out how to call one method from another in a Ruby class.
i.e. In Ruby is it possible to do the following:
class A
def met1
end
def met2
met1 #call to previously defined method1
end
end
Thanks,
RM
| No question is naive, and it's great that you're seeking clarification! In Ruby, it is indeed possible to call one method from another within the same class, just as you've outlined in your example. Your code is correctly structured to do this.
Here's a complete example for clarity:
```ruby
class A
def met1
put... | 40,297 | [
{
"from": "human",
"value": "I realize this perhaps a naive question but still I cant figure out how to call one method from another in a Ruby class.\ni.e. In Ruby is it possible to do the following:\nclass A\n def met1\n end\n def met2\n met1 #call to previously defined method1\n end\nend\n\nT... |
Is there a way to speed up the rendering of Polylines in Google Maps when using Internet Explorer (7)? My map loads quickly in other browsers.
I've encoded the Polylines as described here - http://facstaff.unca.edu/mcmcclur/GoogleMaps/EncodePolyline/ and they are loaded from a static JavaScript file.
| Rendering performance issues with Google Maps in older browsers like Internet Explorer 7 can be challenging due to limitations in the browser's rendering engine and JavaScript performance. Here are some tips to potentially speed up the rendering of polylines:
1. **Reduce Polyline Complexity**:
- Simplify the polyl... | 38,447 | [
{
"from": "human",
"value": "Is there a way to speed up the rendering of Polylines in Google Maps when using Internet Explorer (7)? My map loads quickly in other browsers.\nI've encoded the Polylines as described here - http://facstaff.unca.edu/mcmcclur/GoogleMaps/EncodePolyline/ and they are loaded from a ... |
I have Eclipse PDT with Subclipse installed and currently have a PHP project drawing from a repository on my production server. I have VMWare Workstation installed with Linux and was hoping to use that as a debug server using XDebug. The problem is that when I update files, they are only committed to the repository o... | To effectively manage your PHP project with a development environment using VMware and ensure that you can test changes on your VM before committing them to your production server, consider the following approaches:
### 1. Use Local Development Environment
Instead of trying to commit changes to two repositories, you ... | 39,374 | [
{
"from": "human",
"value": "I have Eclipse PDT with Subclipse installed and currently have a PHP project drawing from a repository on my production server. I have VMWare Workstation installed with Linux and was hoping to use that as a debug server using XDebug. The problem is that when I update files, th... |
I am developing a Java desktop application and would like to have an external configuration.xml.
I am developing the application using Netbeans and tried to add the configuration.xml file in the dist directory so that it resides in the application work folder. But when Netbeans executes its clean operation it deletes t... | To ensure your `configuration.xml` file is included in your Java desktop application's distribution and will not be deleted by NetBeans during the cleaning process, you can follow a few strategies:
### Strategy 1: Include the XML in Your Source Code
1. **Place the Configuration File in the Source Directory:**
- Ad... | 39,111 | [
{
"from": "human",
"value": "I am developing a Java desktop application and would like to have an external configuration.xml.\nI am developing the application using Netbeans and tried to add the configuration.xml file in the dist directory so that it resides in the application work folder. But when Netbeans... |
I need to be able to store a date (year/month/day) with no time component. It's an abstract concept of a date, such as a birthday - I need to represent a date in the year and not a particular instant in time.
I am using Java to parse the date from some input text, and need to store in a MySQL database. No matter what t... | Storing a date that only represents a year, month, and day, without any time component, while ensuring consistency across different time zones, is a common challenge in applications. In your case, you're looking for a solution that avoids potential confusion or errors arising from time zone differences. Here's a solid ... | 37,426 | [
{
"from": "human",
"value": "I need to be able to store a date (year/month/day) with no time component. It's an abstract concept of a date, such as a birthday - I need to represent a date in the year and not a particular instant in time.\nI am using Java to parse the date from some input text, and need to s... |
I'm trying to get a stored procedure to work for a co-worker who is out sick (and thus can't be asked for guidance).
I have a SQL Server 2005 database that has this exact procedure, and I'm trying to make the scripts to convert a test database to match this dev database. My script has several lines like:
CAST(RELATIVE... | The error you're encountering, `CAST or CONVERT: invalid attributes specified for type 'float'`, suggests that the `CAST` function is being used incorrectly in the case of `TRACER_YIELD`. The `FLOAT` data type in SQL Server does not support precision and scale parameters like `FLOAT(10,3)` does. In fact, the `FLOAT` da... | 36,635 | [
{
"from": "human",
"value": "I'm trying to get a stored procedure to work for a co-worker who is out sick (and thus can't be asked for guidance).\nI have a SQL Server 2005 database that has this exact procedure, and I'm trying to make the scripts to convert a test database to match this dev database. My sc... |
I'm writing a function that fishes out the src from the first image tag it finds in an html file. Following the instructions in this thread on here, I got something that seemed to be working:
preg_match_all('#<img[^>]*>#i', $content, $match);
foreach ($match as $value) {
$img = $value[0];
... | It looks like you're encountering issues because the `simplexml_load_string()` function is being used to parse an `<img>` tag, which is not valid XML. Additionally, your regex may not be capturing the `src` attribute correctly, leading to parsing errors.
Instead of using `simplexml_load_string()`, you can use regular ... | 39,495 | [
{
"from": "human",
"value": "I'm writing a function that fishes out the src from the first image tag it finds in an html file. Following the instructions in this thread on here, I got something that seemed to be working:\npreg_match_all('#<img[^>]*>#i', $content, $match); \n\nforeach ($match as $value) {\n... |
What are differences between CallContext and ThreadStatic?
I've understood that in an ASP.NET environment data stored in CallContext could be persisted throughout the request until it ends while ThreadStatic may or may not work since the request may switch threads. I've also learned that the HttpContext is internally s... | You're correct in your understanding of the differences between `CallContext` and `ThreadStatic`. Let's delve a bit deeper into both, including scenarios where their behavior differs and how they work internally.
### Key Differences
1. **Thread Affinity:**
- **ThreadStatic:** Data stored in a `ThreadStatic` field ... | 38,866 | [
{
"from": "human",
"value": "What are differences between CallContext and ThreadStatic?\nI've understood that in an ASP.NET environment data stored in CallContext could be persisted throughout the request until it ends while ThreadStatic may or may not work since the request may switch threads. I've also le... |
I started using a a library which I reference from the GAC during development. I want the dll included in the project bin directory when I promote it to the webserver. I also need my local and the server web.config to be different. Before I started using this library I really enjoyed using the publish website feature o... | When working with a library that you reference from the Global Assembly Cache (GAC), and you want to include that library in your project's `bin` directory for deployment, as well as managing different `web.config` files for local and server environments, there are several steps you can follow.
Here’s how to achieve t... | 37,048 | [
{
"from": "human",
"value": "I started using a a library which I reference from the GAC during development. I want the dll included in the project bin directory when I promote it to the webserver. I also need my local and the server web.config to be different. Before I started using this library I really en... |
I am evaluating datamining packages.
I have find these two so far:
RapidMiner
Weka
Do you have any experience to share with these two products, or any other product to recommend me?
Thanks
| Both RapidMiner and Weka are popular tools in the field of data mining and machine learning, each with its own strengths and use cases. Here’s an overview of both, along with some other recommendations:
### RapidMiner
**Pros:**
- **User-Friendly Interface**: RapidMiner provides a visual workflow designer, which makes ... | 38,760 | [
{
"from": "human",
"value": "I am evaluating datamining packages.\nI have find these two so far:\nRapidMiner\nWeka\nDo you have any experience to share with these two products, or any other product to recommend me?\nThanks\n"
},
{
"from": "gpt",
"value": "Both RapidMiner and Weka are popular too... |
Is there a way to define the timezone for an application in ASP.NET such that all times read from/compared to current server time are implicitly converted, or do I need to put in conversion statements as each and every DateTime.Now call?
| In ASP.NET, there isn't a built-in way to automatically convert all `DateTime.Now` calls to a specific timezone throughout your application. However, you can achieve this through a couple of different approaches. Here are a few strategies you can consider:
### 1. Use a Centralized Time Service
Create a centralized ti... | 38,186 | [
{
"from": "human",
"value": "Is there a way to define the timezone for an application in ASP.NET such that all times read from/compared to current server time are implicitly converted, or do I need to put in conversion statements as each and every DateTime.Now call?\n"
},
{
"from": "gpt",
"value... |
-Edit-
FYI.. I am converting b&w documents scanned in as greyscale or color.
1)The first solution worked, it just reversed black & white (black background, white text). It also took nearly 10 minutes.
2)The JAI solution in the 2nd answer didn't work for me. I tried it before posting here.
Has anyone worked with othe... | To convert a PNG image to a bi-tonal TIFF format in Java, you need to ensure that the image is in a binary format before saving it as TIFF. This means converting the image to a binary (1-bit) representation, which is necessary for certain TIFF compression types, like CCITT T.6.
Here's a revised version of your code, w... | 37,440 | [
{
"from": "human",
"value": "-Edit-\nFYI.. I am converting b&w documents scanned in as greyscale or color. \n1)The first solution worked, it just reversed black & white (black background, white text). It also took nearly 10 minutes.\n2)The JAI solution in the 2nd answer didn't work for me. I tried it befo... |
I am looking for a simple example of Drag-n-drop within a webpage(say dragging a image to a tabel cell), in AIR (using AIR api)
thanks
| Sure! Below is a simple example of how to implement drag-and-drop functionality in an Adobe AIR application. In this example, we'll create a simple interface where users can drag an image and drop it into a table cell.
### Step 1: Setup Your Adobe AIR Project
Create a new AIR project in your preferred IDE (like Flash... | 37,681 | [
{
"from": "human",
"value": "I am looking for a simple example of Drag-n-drop within a webpage(say dragging a image to a tabel cell), in AIR (using AIR api)\nthanks\n"
},
{
"from": "gpt",
"value": "Sure! Below is a simple example of how to implement drag-and-drop functionality in an Adobe AIR ap... |
I've been wondering about how hard it would be to write some Python code to search a string for the index of a substring of the form ${expr}, for example, where expr is meant to be a Python expression or something resembling one. Given such a thing, one could easily imagine going on to check the expression's syntax wi... | It sounds like you have an interesting project on your hands! Extracting Python expressions from strings can be tricky, especially if those expressions can include parentheses or curly braces themselves, which can complicate the parsing.
Here's one possible way to approach the problem using regular expressions, along ... | 31,879 | [
{
"from": "human",
"value": "I've been wondering about how hard it would be to write some Python code to search a string for the index of a substring of the form ${expr}, for example, where expr is meant to be a Python expression or something resembling one. Given such a thing, one could easily imagine goi... |
I am using the jquery tooltip and here is the code for it
Javascript:
this.tooltip = function()
{
var xOffset = -10;
var yOffset = -175;
$("a.tooltip").hover(function(e)
{
this.t = this.title;
this.title = "";
var breakdownDat... | It looks like you're implementing a custom tooltip using jQuery, and you're facing issues with it functioning in Internet Explorer (IE) but working in Firefox. Here are a few suggestions to help you troubleshoot and improve compatibility across browsers:
### 1. Check for Console Errors
Open the developer tools in Inte... | 36,345 | [
{
"from": "human",
"value": "I am using the jquery tooltip and here is the code for it\nJavascript:\nthis.tooltip = function()\n{ \n var xOffset = -10;\n var yOffset = -175; \n\n $(\"a.tooltip\").hover(function(e)\n { \n this.t = this.titl... |
I'm trying to build a video recorder without jailbreaking my iPhone (i've a Developer license).
I began using PhotoLibrary private framework, but i can only reach 2ftp (too slow).
Cycoder app have a fps of 15, i think it uses a different approach.
I tried to create a bitmap from the previewView of the CameraController,... | Building a video recorder on iOS without jailbreaking your device can be challenging, especially when you're looking for performance improvements such as higher frame rates and direct access to video buffers. Here are some suggestions and pointers on how to proceed:
### 1. **Use AVFoundation Framework**
Instead of try... | 39,208 | [
{
"from": "human",
"value": "I'm trying to build a video recorder without jailbreaking my iPhone (i've a Developer license).\nI began using PhotoLibrary private framework, but i can only reach 2ftp (too slow).\nCycoder app have a fps of 15, i think it uses a different approach.\nI tried to create a bitmap f... |
I'm having a problem with the WPF Tab View control that I was hoping someone here might be able to help me with.
I want my tab view control to use rounded corners for the tab headers, because I think rounded tabs look better.
To do this I modified the default control template for the tab by using the "Edit Copy" comman... | To create a WPF TabControl with rounded corners on the tab headers while preserving the default behavior with respect to system themes and high-contrast mode, you will want to follow a few steps to modify the control template without hardcoding literal color values.
### 1. Create a Custom Control Template
You can cre... | 37,238 | [
{
"from": "human",
"value": "I'm having a problem with the WPF Tab View control that I was hoping someone here might be able to help me with.\nI want my tab view control to use rounded corners for the tab headers, because I think rounded tabs look better.\nTo do this I modified the default control template ... |
In the tradition of this question and in light of the documentation, how does one make this function deterministic:
ALTER FUNCTION [udf_DateTimeFromDataDtID]
(
@DATA_DT_ID int -- In form YYYYMMDD
)
RETURNS datetime
WITH SCHEMABINDING
AS
BEGIN
RETURN CONVERT(datetime, CONVERT(varchar, @DATA_DT_ID))
END
Or this ... | To make SQL Server user-defined functions (UDFs) deterministic, you need to ensure that the function returns the same result any time it is called with the same input values, without any dependencies on data that could change, such as the system date or any random number generation.
Let's address your two functions o... | 36,533 | [
{
"from": "human",
"value": "In the tradition of this question and in light of the documentation, how does one make this function deterministic:\nALTER FUNCTION [udf_DateTimeFromDataDtID]\n(\n @DATA_DT_ID int -- In form YYYYMMDD\n)\nRETURNS datetime\nWITH SCHEMABINDING\nAS\nBEGIN\n RETURN CONVERT(date... |
I understand SSO as the one time login for all the applications connected. I would like to know more about SSO and how exactly it is achieved.
| Single Sign-On (SSO) is a user authentication process that allows a user to log in once and gain access to multiple applications or systems without needing to log in again for each one. This is especially useful in environments where users need to access various applications frequently, enhancing user experience and pr... | 36,524 | [
{
"from": "human",
"value": "I understand SSO as the one time login for all the applications connected. I would like to know more about SSO and how exactly it is achieved.\n"
},
{
"from": "gpt",
"value": "Single Sign-On (SSO) is a user authentication process that allows a user to log in once and... |
What is the best way to read and/or set Internet Explorer options from a web page in Javascript? I know that these are in registry settings.
For example, I'm using the JavaScript Diagram Builder to dynamically generate bar charts within a web page. This uses the background color in floating DIVs to generate the bars.... | You're correct in your assessment that web pages cannot directly read or set Internet Explorer settings (or any browser settings) due to security and privacy concerns. Browsers are designed to isolate web content from system settings and the underlying operating system, which includes registry settings, to prevent mali... | 33,573 | [
{
"from": "human",
"value": "What is the best way to read and/or set Internet Explorer options from a web page in Javascript? I know that these are in registry settings.\nFor example, I'm using the JavaScript Diagram Builder to dynamically generate bar charts within a web page. This uses the background co... |
I have a relatively simple site that I'm working up for an intranet environment. The pages have a hook to display a simple bit of text (possibly with a bit of HTML for markup purposes) for help when the user clicks a link on the page. I'm debating whether to put the help snippets in their own XML file or create a secti... | Given your requirements and considerations, it sounds like you've already thought through some important factors when deciding how to store your help snippets. Here are some recommendations and thoughts on potential options:
### 1. Separate XML File
Creating a separate XML file for your help snippets is a good approac... | 39,994 | [
{
"from": "human",
"value": "I have a relatively simple site that I'm working up for an intranet environment. The pages have a hook to display a simple bit of text (possibly with a bit of HTML for markup purposes) for help when the user clicks a link on the page. I'm debating whether to put the help snippet... |
How can I unit test SSIS packages? I want to be able to create and maintain unit tests for various components such as the workflow tasks, data flow tasks, event handlers, etc.
Are there any existing techniques, frameworks, and/or tools that can be used?
| Unit testing SQL Server Integration Services (SSIS) packages can be challenging due to their nature as ETL (Extract, Transform, Load) processes, which often involve multiple data sources, transformations, and outputs. However, there are several techniques, frameworks, and tools that can help you create and maintain uni... | 36,625 | [
{
"from": "human",
"value": "How can I unit test SSIS packages? I want to be able to create and maintain unit tests for various components such as the workflow tasks, data flow tasks, event handlers, etc.\nAre there any existing techniques, frameworks, and/or tools that can be used?\n"
},
{
"from": ... |
I'm using two commercial libraries that are produced by the same vendor, called VendorLibA and VendorLibB. The libraries are distributed as many DLLs that depend on the compiler version (e.g. VC7, VC8). Both libraries depend on a another library, produced by this vendor, called VendorLibUtils and contained in one DLL.
... | Using two commercial libraries that depend on incompatible versions of a shared utility library (like `VendorLibUtils`) in the same process is challenging, especially when you can't modify the libraries or access their source code. Here are some approaches to consider:
### 1. Separate Processes
One of the most straigh... | 38,115 | [
{
"from": "human",
"value": "I'm using two commercial libraries that are produced by the same vendor, called VendorLibA and VendorLibB. The libraries are distributed as many DLLs that depend on the compiler version (e.g. VC7, VC8). Both libraries depend on a another library, produced by this vendor, called ... |
When I discovered boost::lexical_cast I thought to myself "why didn't I know about this sooner!" - I hated having to write code like
stringstream ss;
ss << anIntVal;
mystring = ss.str();
Now I write
mystring = boost::lexical_cast<string>(anIntVal);
Yesterday, on stackoverflow, I came across boost split (another gem... | Boost is a rich library with many useful components that can make C++ programming significantly easier and more efficient. Here are some Boost libraries and functions that many developers find invaluable:
1. **Boost Smart Pointers**:
- `boost::shared_ptr`, `boost::unique_ptr`, and `boost::scoped_ptr` help manage m... | 38,775 | [
{
"from": "human",
"value": "When I discovered boost::lexical_cast I thought to myself \"why didn't I know about this sooner!\" - I hated having to write code like \nstringstream ss;\nss << anIntVal;\nmystring = ss.str();\n\nNow I write\nmystring = boost::lexical_cast<string>(anIntVal);\n\nYesterday, on st... |
I am trying to implement an application by using MySQL/JAVA and I found this tool in netbeans to easily create a new form for an existing table. (edit, insert, delete etc.)
Is there an easy way to modify the code to join another table to display fields from that table.
Example:
I have an employee table that has a forei... | Certainly! If you're using NetBeans to generate a form for your `employee` table, and you want to display the `TitleName` from the `Title` table instead of the `TitleID`, you can achieve this by modifying the code generated by NetBeans. Below are the steps to help you implement this.
### Steps to Join Another Table in... | 38,595 | [
{
"from": "human",
"value": "I am trying to implement an application by using MySQL/JAVA and I found this tool in netbeans to easily create a new form for an existing table. (edit, insert, delete etc.)\nIs there an easy way to modify the code to join another table to display fields from that table.\nExample... |
Does anybody know any resources on this subject?
I'm developing an embedded application for 2x16 LCD display. Ideally I would like to have a general (display independent) framework, that could be used virtually on any display - one or more segment(s) LED, 1x16, 2x16 LCD, etc.
Also would like to learn about general guid... | Developing an embedded application for small displays like 2x16 LCDs involves considerations for user interface (UI) design and framework organization. Here are some resources and guidelines that may help you create a flexible, display-independent framework and effective user interfaces.
### General Resources
1. **Em... | 34,555 | [
{
"from": "human",
"value": "Does anybody know any resources on this subject?\nI'm developing an embedded application for 2x16 LCD display. Ideally I would like to have a general (display independent) framework, that could be used virtually on any display - one or more segment(s) LED, 1x16, 2x16 LCD, etc.\n... |
Has anyone ever used the Bridge pattern in a real world application? If so, how did you use it? Is it me, or is it just the Adapter pattern with a little dependency injection thrown into the mix? Does it really deserve its own pattern?
| Yes, the Bridge pattern has been used in various real-world applications, and it serves a distinct purpose that sets it apart from the Adapter pattern, despite some superficial similarities. Let’s break down the two patterns and their applications to clarify when and why you might use the Bridge pattern.
### Overview ... | 37,947 | [
{
"from": "human",
"value": "Has anyone ever used the Bridge pattern in a real world application? If so, how did you use it? Is it me, or is it just the Adapter pattern with a little dependency injection thrown into the mix? Does it really deserve its own pattern?\n"
},
{
"from": "gpt",
"value":... |
Can I specify interfaces when I declare a member?
After thinking about this question for a while, it occurred to me that a static-duck-typed language might actually work. Why can't predefined classes be bound to an interface at compile time? Example:
public interface IMyInterface
{
public void MyMethod();
}
public c... | The concept you’re discussing involves a form of "structural typing" or "duck typing," where a class is considered to implement an interface if it has methods and properties that match the interface's signature, regardless of explicit declaration. This is different from "nominal typing," where a class must explicitly d... | 38,337 | [
{
"from": "human",
"value": "Can I specify interfaces when I declare a member?\nAfter thinking about this question for a while, it occurred to me that a static-duck-typed language might actually work. Why can't predefined classes be bound to an interface at compile time? Example:\npublic interface IMyInterf... |
I'm having a little problem with a php-gtk app that keeps running into non-utf8 strings, I had found that the problem is in the database connection, even when the database is supposed to be in UTF-8.
I had tried with the "SET CHARACTER SET utf8"(MySQL way) and the "SET NAMES UTF8" and nothing happen (there isn't any in... | When dealing with non-UTF-8 strings in a PHP application that connects to a database, it’s important to ensure that both the database and the connection are properly configured to use UTF-8. Given that you're using SQLite (based on your mention of the lack of "SET CHARACTER SET" and "SET NAMES" commands), here's how yo... | 36,960 | [
{
"from": "human",
"value": "I'm having a little problem with a php-gtk app that keeps running into non-utf8 strings, I had found that the problem is in the database connection, even when the database is supposed to be in UTF-8.\nI had tried with the \"SET CHARACTER SET utf8\"(MySQL way) and the \"SET NAMES... |
EDIT1: Tried to clear the question up by renaming the tables AND their relationships.
EDIT2: Please don't look at the what TYPE of data i'm holding in the three DB tables. They were made up on the fly. They are NOT my real world scenarios (and no, I can't talk about my real world data .. in fact it's 1 parent and 6 chi... | Your proposed database design raises several questions and considerations. Let's address your questions one by one:
### Q1: Does that design seem ok?
Yes, the design you propose is generally acceptable for your use case, assuming that the relationships between the tables are accurately represented. By having `table_U... | 38,137 | [
{
"from": "human",
"value": "EDIT1: Tried to clear the question up by renaming the tables AND their relationships.\nEDIT2: Please don't look at the what TYPE of data i'm holding in the three DB tables. They were made up on the fly. They are NOT my real world scenarios (and no, I can't talk about my real wor... |
I have basically two separate sites, a SharePoint collaboration site, and an ASP.Net application site. The only linkage between the two are the hyperlinks going back and forth, and the user validation on the behalf of the SharePoint site. The user will enter and be authenticated through the SharePoint site and then may... | It sounds like you're looking for a way to create a seamless user experience between your SharePoint collaboration site and your ASP.Net application. Since you've already made progress based on advice from Chris and Andrew Connell, let's explore some approaches to further enhance that integration.
### Options for Inte... | 40,204 | [
{
"from": "human",
"value": "I have basically two separate sites, a SharePoint collaboration site, and an ASP.Net application site. The only linkage between the two are the hyperlinks going back and forth, and the user validation on the behalf of the SharePoint site. The user will enter and be authenticated... |
I'm looking for a good 10 minute introduction to Unobtrusive Javascript using JQuery. I'm completely new to the concept, and I'd like to see how the event binding and such works.
As some background, I'm looking to do a "remove this tag" system similar to what we have here on SO. Looking at the source, I didn't see an... | Unobtrusive JavaScript is a design principle that emphasizes the separation of behavior (JavaScript) from structure (HTML). This means you add JavaScript functionality without directly modifying the HTML attributes, which keeps your markup cleaner and your JavaScript more maintainable.
### Introduction to Unobtrusive ... | 38,347 | [
{
"from": "human",
"value": "I'm looking for a good 10 minute introduction to Unobtrusive Javascript using JQuery. I'm completely new to the concept, and I'd like to see how the event binding and such works.\nAs some background, I'm looking to do a \"remove this tag\" system similar to what we have here on... |
I have a table of the form
CREATE TABLE data
{
pk INT PRIMARY KEY AUTO_INCREMENT,
dt BLOB
};
It has about 160,000 rows and about 2GB of data in the blob column (avg. 14kb per blob). Another table has foreign keys into this table.
Something like 3000 of the blobs are identical. So what I want is a query that wil... | To improve the performance of your query for deduplicating the blobs in the `data` table, you can employ a few strategies that leverage indexing and reduce the number of rows being scanned. Here are some suggestions:
1. **Hashing the BLOBs**: Instead of directly comparing the BLOB data, you could compute a hash (e.g.,... | 38,077 | [
{
"from": "human",
"value": "I have a table of the form \nCREATE TABLE data\n{\n pk INT PRIMARY KEY AUTO_INCREMENT,\n dt BLOB\n};\n\nIt has about 160,000 rows and about 2GB of data in the blob column (avg. 14kb per blob). Another table has foreign keys into this table.\nSomething like 3000 of the blobs ... |
I have this strange issue with my web app. You see, I'm using jQuery with the Forms API and doing $('#MyForm').ajaxSubmit(api parms and callback function goes here).
Randomly when I do this, however, and only on Firefox, the page load icon starts spinning, the page load progress bar runs in the status bar, and the stop... | It seems like you're experiencing an issue with the AJAX form submission and TinyMCE integration in Firefox. This is not an uncommon problem and could be related to how TinyMCE handles events or modifies the DOM. Here are some steps and suggestions to troubleshoot and potentially resolve the issue:
1. **Ensure TinyMCE... | 35,489 | [
{
"from": "human",
"value": "I have this strange issue with my web app. You see, I'm using jQuery with the Forms API and doing $('#MyForm').ajaxSubmit(api parms and callback function goes here).\nRandomly when I do this, however, and only on Firefox, the page load icon starts spinning, the page load progres... |
I've got an NSArrayController, and I'm using KVO to observe the Old/New values of it's selection method.
This works perfectly (triggers when the selection changes, the usual) except that the items in the change dictionary are all null instead of being the old/new selected object. [arrayController selection] still retur... | When you're observing the `selection` property of an `NSArrayController`, it's indeed possible to encounter issues with observing KVO if the selection method returns a proxy object (since `NSArrayController` uses proxies to manage selections). This can lead to the observed old and new values being reported as `null`.
... | 36,538 | [
{
"from": "human",
"value": "I've got an NSArrayController, and I'm using KVO to observe the Old/New values of it's selection method.\nThis works perfectly (triggers when the selection changes, the usual) except that the items in the change dictionary are all null instead of being the old/new selected objec... |
I have a data set that is organized in the following manner:
Timestamp|A0001|A0002|A0003|A0004|B0001|B0002|B0003|B0004 ...
---------+-----+-----+-----+-----+-----+-----+-----+-----
2008-1-1 | 1 | 2 | 10 | 6 | 20 | 35 | 300 | 8
2008-1-2 | 5 | 2 | 9 | 3 | 50 | 38 | 290 | 2
2008-1-4 | 7 | 7 | ... | To achieve your goal in SQL Server 2005, you can indeed use a combination of UNPIVOT and temporary tables or Common Table Expressions (CTEs). Given your requirements for summing values, applying conditions, and organizing your results, let's break down the steps for a clearer approach.
### Step 1: Set Up the Temporary... | 35,718 | [
{
"from": "human",
"value": "I have a data set that is organized in the following manner:\nTimestamp|A0001|A0002|A0003|A0004|B0001|B0002|B0003|B0004 ...\n---------+-----+-----+-----+-----+-----+-----+-----+-----\n2008-1-1 | 1 | 2 | 10 | 6 | 20 | 35 | 300 | 8\n2008-1-2 | 5 | 2 | 9 | 3 | 50... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.