instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
Which is the best way to store a 2D array in c# in order to optimize performance when performing lots of arithmetic on the elements in the array?
We have large (approx 1.5G) arrays, which for example we want to multiply with each other element by element. Performance is critical. The context in which this is done is in... | To optimize the performance of large 2D arrays in C# for arithmetic operations, there are several strategies and considerations that can improve performance, especially when dealing with large datasets (like your 1.5G arrays). Here are some of the key points to consider:
### 1. **Use a Single-Dimensional Array**
While... | 9,264 | [
{
"from": "human",
"value": "Which is the best way to store a 2D array in c# in order to optimize performance when performing lots of arithmetic on the elements in the array?\nWe have large (approx 1.5G) arrays, which for example we want to multiply with each other element by element. Performance is critica... |
On my journey into the depths of custom ASP.NET control development I am obviously getting my head around the ASP.NET PostBack model and how it affects control development.
I understand that controls have no "lifetime" in ASP.NET, and therefore must be re-initialized on each and every page load. We overcome this by per... | When developing custom ASP.NET controls, understanding the PostBack model is crucial, especially since it impacts how you manage state across page loads. While ViewState is a common solution for persisting control state, you might be looking for alternatives to the PostBack model. Below, I’ll outline a few approaches y... | 7,371 | [
{
"from": "human",
"value": "On my journey into the depths of custom ASP.NET control development I am obviously getting my head around the ASP.NET PostBack model and how it affects control development.\nI understand that controls have no \"lifetime\" in ASP.NET, and therefore must be re-initialized on each ... |
I have a stored procedure which takes as its parameter a varchar which needs to be cast as a datetime for later use:
SET @the_date = CAST(@date_string AS DATETIME)
I'm expecting the date string to be supplied in the format "DD-MON-YYYY", but in an effort to code defensively, if for some reason it can't be cast success... | In Sybase ASE 12.5.3, without the `ISDATE` function or built-in exception handling like in PL/SQL, you can implement a defensive approach to validate your date string before attempting to cast it to a `DATETIME`. Since you are expecting the format "DD-MON-YYYY", you can use string manipulation functions to ensure that ... | 5,642 | [
{
"from": "human",
"value": "I have a stored procedure which takes as its parameter a varchar which needs to be cast as a datetime for later use:\nSET @the_date = CAST(@date_string AS DATETIME)\n\nI'm expecting the date string to be supplied in the format \"DD-MON-YYYY\", but in an effort to code defensivel... |
How do you specify a target framework version for the csc.exe c# compiler via command-line invocation (e.g., no .csproj file and not going thru the MSBUILD engine)?
e.g, using the C# 3.0 csc.exe compiler, how do you compile to IL targeting the 2.0 .net framework?
| When you want to specify a target framework version directly via the command line using the `csc.exe` compiler without involving a `.csproj` file or MSBuild, you can use the `/langversion` option to set the language version. However, this does not change the target framework itself, as `csc.exe` primarily compiles to I... | 11,594 | [
{
"from": "human",
"value": "How do you specify a target framework version for the csc.exe c# compiler via command-line invocation (e.g., no .csproj file and not going thru the MSBUILD engine)?\ne.g, using the C# 3.0 csc.exe compiler, how do you compile to IL targeting the 2.0 .net framework?\n"
},
{
... |
Is there an easy way to programmatically determine the number of lines within a text file?
| Yes, there are several easy ways to programmatically determine the number of lines in a text file, depending on the programming language you're using. Here are a few examples in different languages:
### Python
You can use the following code to count the lines in a text file:
```python
def count_lines(filename):
w... | 12,107 | [
{
"from": "human",
"value": "Is there an easy way to programmatically determine the number of lines within a text file? \n"
},
{
"from": "gpt",
"value": "Yes, there are several easy ways to programmatically determine the number of lines in a text file, depending on the programming language you'r... |
MXML lets you do some really quite powerful data binding such as:
<mx:Button id="myBtn" label="Buy an {itemName}" visible="{itemName!=null}"/>
I've found that the BindingUtils class can bind values to simple properties, but neither of the bindings above do this. Is it possible to do the same in AS3 code, or is Flex si... | In ActionScript 3 (AS3), you can achieve data binding similarly to what MXML provides, but it requires more explicit code because AS3 does not automatically handle data binding like MXML does. When using MXML, the framework generates the necessary code to manage data binding and property updates automatically.
To repl... | 9,901 | [
{
"from": "human",
"value": "MXML lets you do some really quite powerful data binding such as:\n<mx:Button id=\"myBtn\" label=\"Buy an {itemName}\" visible=\"{itemName!=null}\"/>\n\nI've found that the BindingUtils class can bind values to simple properties, but neither of the bindings above do this. Is it ... |
varchar(255), varchar(256), nvarchar(255), nvarchar(256), nvarchar(max), etc?
256 seems like a nice, round, space-efficient number. But I've seen 255 used a lot. Why?
What's the difference between varchar and nvarchar?
| The choice between `varchar(255)` and `varchar(256)` (or any similar lengths for `nvarchar`) often comes down to conventions, historical reasons, and specific use cases in database design. Here’s a breakdown of your questions:
### Why `255` instead of `256`?
1. **Historical Reasons**: In many programming contexts, in... | 11,088 | [
{
"from": "human",
"value": "varchar(255), varchar(256), nvarchar(255), nvarchar(256), nvarchar(max), etc?\n256 seems like a nice, round, space-efficient number. But I've seen 255 used a lot. Why?\nWhat's the difference between varchar and nvarchar?\n"
},
{
"from": "gpt",
"value": "The choice ... |
What I am trying to do is change the background colour of a table cell <td> and then when a user goes to print the page, the changes are now showing.
I am currently using an unobtrusive script to run the following command on a range of cells:
element.style.backgroundColor = "#f00"
This works on screen in IE and FF, ho... | When you apply styles to elements using JavaScript, especially in browsers like Internet Explorer and Firefox, those styles are often not included in the printed version of the page. This is typically due to the default print stylesheets that browsers use. By default, most browsers strip away background colors for prin... | 9,179 | [
{
"from": "human",
"value": "What I am trying to do is change the background colour of a table cell <td> and then when a user goes to print the page, the changes are now showing.\nI am currently using an unobtrusive script to run the following command on a range of cells:\nelement.style.backgroundColor = \"... |
In a stored procedure, I need to get the count of the results of another stored procedure. Specifically, I need to know if it returns any results, or an empty set.
I could create a temp table/table variable, exec the stored procedure into it, and then run a select count on that data. But I really don't care about the ... | If you want to determine whether another stored procedure returns any results without duplicating the logic or copying its contents, you can utilize a temporary table or table variable to capture the results and then count the rows. However, since you're looking for a more efficient approach, you can also execute the s... | 9,324 | [
{
"from": "human",
"value": "In a stored procedure, I need to get the count of the results of another stored procedure. Specifically, I need to know if it returns any results, or an empty set.\nI could create a temp table/table variable, exec the stored procedure into it, and then run a select count on that... |
When trying to run the Flex Builder 3 profiler on any I don't get the profiler dialog window and then after a few seconds I get "Socket timeout" in the console window. Any ideas why it can't connect?
I've got the latest debug version of Flash player and have tried shutting off my firewall.
I'm running it on XP from th... | The "Socket timeout" error you are experiencing while trying to run the Flex Builder 3 profiler may be caused by a few different issues. Here are some steps you can take to troubleshoot and potentially resolve the problem:
1. **Ensure Proper Setup**:
- Make sure that you have set up your Flex Builder 3 project corr... | 8,858 | [
{
"from": "human",
"value": "When trying to run the Flex Builder 3 profiler on any I don't get the profiler dialog window and then after a few seconds I get \"Socket timeout\" in the console window. Any ideas why it can't connect?\nI've got the latest debug version of Flash player and have tried shutting o... |
What is current state of the art for enabling OpenID login in Ruby on Rails applications? This is a community wiki with up-to-date answers to this question.
Authlogic
The most advanced authentication solution seems to be Authlogic. It supports OpenID with Authlogic OpenID plugin. It supports Rails 4 and 3. Rails 2 i... | As of October 2023, the state of the art for enabling OpenID login in Ruby on Rails applications continues to evolve. Below are the most commonly used solutions:
### 1. **Devise**
Devise remains the most popular authentication solution for Rails applications. It provides a comprehensive set of features, including the ... | 7,526 | [
{
"from": "human",
"value": "What is current state of the art for enabling OpenID login in Ruby on Rails applications? This is a community wiki with up-to-date answers to this question.\nAuthlogic\nThe most advanced authentication solution seems to be Authlogic. It supports OpenID with Authlogic OpenID pl... |
I would like to retrieve the ethernet address of the network interface that is used to access a particular website.
How can this be done in Java?
Solution Note that the accepted solution of getHardwareAddress is only available in Java 6. There does not seem to be a solution for Java 5 aside from executing i(f|p)confing... | To retrieve the Ethernet address (MAC address) of the network interface used to access a particular website in Java, you would typically follow these steps:
1. Resolve the IP address of the website.
2. Identify the network interface that is used to reach that IP address.
3. Retrieve the hardware (MAC) address of that ... | 2,997 | [
{
"from": "human",
"value": "I would like to retrieve the ethernet address of the network interface that is used to access a particular website.\nHow can this be done in Java?\nSolution Note that the accepted solution of getHardwareAddress is only available in Java 6. There does not seem to be a solution fo... |
Given the following:
declare @a table
(
pkid int,
value int
)
declare @b table
(
otherID int,
value int
)
insert into @a values (1, 1000)
insert into @a values (1, 1001)
insert into @a values (2, 1000)
insert into @a values (2, 1001)
insert into @a values (2, 1002)
insert into @b values (-1, 1000)
i... | To query for all the values in table `@a` that completely match the values in table `@b`, you can use an approach that involves counting the number of distinct values in each table and then checking if those counts are equal, along with matching the specific values.
Here is a SQL query that achieves this:
```sql
WITH... | 8,648 | [
{
"from": "human",
"value": "Given the following:\ndeclare @a table\n(\n pkid int,\n value int\n)\n\ndeclare @b table\n(\n otherID int,\n value int\n)\n\n\ninsert into @a values (1, 1000)\ninsert into @a values (1, 1001)\ninsert into @a values (2, 1000)\ninsert into @a values (2, 1001)\ninsert i... |
I need to get the value of the 'test' attribute in the xsl:when tag, and the 'name' attribute in the xsl:call-template tag. This xpath gets me pretty close:
..../xsl:template/xsl:choose/xsl:when
But that just returns the 'when' elements, not the exact attribute values I need.
Here is a snippet of my XML:
<xsl:temp... | To get the specific attribute values you're interested in from the `xsl:when` and `xsl:call-template` elements using XPath, you need to refine your XPath expression to directly access the attributes of those elements.
Here’s how you can construct the XPath expressions for each attribute:
1. **To get the value of the ... | 9,771 | [
{
"from": "human",
"value": "I need to get the value of the 'test' attribute in the xsl:when tag, and the 'name' attribute in the xsl:call-template tag. This xpath gets me pretty close: \n..../xsl:template/xsl:choose/xsl:when\n\nBut that just returns the 'when' elements, not the exact attribute values I ... |
I'm working on a project that generates PDFs that can contain fairly complex math and science formulas. The text is rendered in Times New Roman, which has pretty good Unicode coverage, but not complete. We have a system in place to swap in a more Unicode complete font for code points that don't have a glyph in TNR (li... | To programmatically check if a specific Unicode code point (glyph) is present in a TrueType font (TTF) file, you have a few options, especially when working in an ASP.NET environment. Below are some approaches that you might consider:
### 1. Use a Third-Party Library
There are libraries that can handle TTF files and ... | 8,547 | [
{
"from": "human",
"value": "I'm working on a project that generates PDFs that can contain fairly complex math and science formulas. The text is rendered in Times New Roman, which has pretty good Unicode coverage, but not complete. We have a system in place to swap in a more Unicode complete font for code ... |
I have a migration that runs an SQL script to create a new Postgres schema. When creating a new database in Postgres by default it creates a schema called 'public', which is the main schema we use. The migration to create the new database schema seems to be working fine, however the problem occurs after the migration h... | In PostgreSQL, when you create a new schema, it can lead to some confusion in how Rails (specifically ActiveRecord) accesses database objects, particularly the `schema_info` table. By default, Rails expects the `schema_info` table to be found in the `public` schema, which is the default schema for PostgreSQL databases.... | 10,834 | [
{
"from": "human",
"value": "I have a migration that runs an SQL script to create a new Postgres schema. When creating a new database in Postgres by default it creates a schema called 'public', which is the main schema we use. The migration to create the new database schema seems to be working fine, however... |
How can I insert ASCII special characters (e.g. with the ASCII value 0x01) into a string?
I ask because I am using the following:
str.Replace( "<TAG1>", Convert.ToChar(0x01).ToString() );
and I feel that there must be a better way than this. Any Ideas?
Update:
Also If I use this methodology, do I need to worry about u... | Inserting ASCII special characters into a string in C# can be done using the `char` type, as you're already doing. However, if you find your current approach a bit cumbersome, here are a few alternatives and considerations:
### Using `char` Directly
You can construct your new string using string interpolation or `Str... | 7,848 | [
{
"from": "human",
"value": "How can I insert ASCII special characters (e.g. with the ASCII value 0x01) into a string?\nI ask because I am using the following:\nstr.Replace( \"<TAG1>\", Convert.ToChar(0x01).ToString() );\n\nand I feel that there must be a better way than this. Any Ideas?\nUpdate:\nAlso If I... |
How can you determine the performance consequences of your PHP code if you are not familiar with the internals? Are there ways to figure out how your code is being executed (besides simply load testing it)? I am looking for things like memory usage, the execution time for algorithms.
Perhaps Joel would say, "learn C, t... | Understanding the performance of your PHP code without delving into the internals or learning C is entirely possible by using various tools and techniques. Here are some ways to analyze your PHP code's performance:
### 1. Profiling Tools
#### Xdebug
Xdebug is a powerful tool for PHP that offers profiling capabilities... | 7,033 | [
{
"from": "human",
"value": "How can you determine the performance consequences of your PHP code if you are not familiar with the internals? Are there ways to figure out how your code is being executed (besides simply load testing it)? I am looking for things like memory usage, the execution time for algori... |
Probably a very stupid question but I can't figure how to rename an object in PowerPoint.. For example, all my Graphs are called by default "Graph 1" etc.
Could someone help me on that?
Thanks!
| It's not a stupid question at all! Renaming objects in PowerPoint can be a bit tricky because there isn't a direct option to rename them in the way you might expect. However, you can rename them in the Selection Pane. Here’s how to do it:
1. **Open the Selection Pane**: Go to the **Home** tab on the ribbon. In the **D... | 14,210 | [
{
"from": "human",
"value": "Probably a very stupid question but I can't figure how to rename an object in PowerPoint.. For example, all my Graphs are called by default \"Graph 1\" etc. \nCould someone help me on that?\nThanks!\n"
},
{
"from": "gpt",
"value": "It's not a stupid question at all! ... |
I'm looking to get the result of a command as a variable in a Windows batch script (see how to get the result of a command in bash for the bash scripting equivalent). A solution that will work in a .bat file is preferred, but other common windows scripting solutions are also welcome.
| In a Windows batch script (`.bat` file), you can capture the output of a command and store it in a variable by using the `for` command. Here's a basic syntax on how to do this:
### Example:
```batch
@echo off
setlocal
rem Running a command and capturing its output into a variable
for /f "delims=" %%i in ('your_comma... | 9,054 | [
{
"from": "human",
"value": "I'm looking to get the result of a command as a variable in a Windows batch script (see how to get the result of a command in bash for the bash scripting equivalent). A solution that will work in a .bat file is preferred, but other common windows scripting solutions are also we... |
just wondering if anyone knows of a truly restful Put/delete implementation asp.net mvc preview 5 preferably.
| To implement a truly RESTful API in ASP.NET MVC (specifically with ASP.NET MVC 5), you can follow a few guidelines to ensure your PUT and DELETE operations adhere to REST principles. Here is a high-level overview and a simple example of how you could set this up.
### Steps to Implement RESTful PUT/DELETE in ASP.NET MV... | 10,096 | [
{
"from": "human",
"value": "just wondering if anyone knows of a truly restful Put/delete implementation asp.net mvc preview 5 preferably.\n"
},
{
"from": "gpt",
"value": "To implement a truly RESTful API in ASP.NET MVC (specifically with ASP.NET MVC 5), you can follow a few guidelines to ensure... |
I am getting the below error and call stack at the same time everyday after several hours of application use. Can anyone shed some light on what is happening?
System.InvalidOperationException: BufferedGraphicsContext cannot be disposed of because a buffer operation is currently in progress.
at System.Drawing.BufferedG... | The error message you're encountering, `System.InvalidOperationException: BufferedGraphicsContext cannot be disposed of because a buffer operation is currently in progress`, indicates that there is an issue with the management of graphics resources in a Windows Forms application. Specifically, it suggests that the appl... | 8,771 | [
{
"from": "human",
"value": "I am getting the below error and call stack at the same time everyday after several hours of application use. Can anyone shed some light on what is happening?\nSystem.InvalidOperationException: BufferedGraphicsContext cannot be disposed of because a buffer operation is currently... |
In C#, if I need to open an HTTP connection, download XML and get one value from the result, how would I do that?
For consistency, imagine the webservice is at www.webservice.com and that if you pass it the POST argument fXML=1 it gives you back
<xml><somekey>somevalue</somekey></xml>
I'd like it to spit out "someval... | You can accomplish this in C# using the `HttpClient` class to make an HTTP request to the web service, and then you can use `System.Xml` or `System.Xml.Linq` to parse the XML response to retrieve the desired value.
Here's a complete example of how you can open an HTTP connection, download the XML, and extract the valu... | 7,939 | [
{
"from": "human",
"value": "In C#, if I need to open an HTTP connection, download XML and get one value from the result, how would I do that?\nFor consistency, imagine the webservice is at www.webservice.com and that if you pass it the POST argument fXML=1 it gives you back \n<xml><somekey>somevalue</somek... |
I would like to know what's the best technique to do single sign-on in web sites. It means that if you enter in more than one website, you will be authenticated in a "transparent" way. I'm using php + curl to set the cookies for the different sites, but i really would like to know if does exist a standard way to do it.... | Single Sign-On (SSO) is a common feature that allows users to log in once and gain access to multiple applications or services without needing to log in separately to each one. Here are some standard methods and protocols commonly used for implementing SSO on websites:
### 1. **OAuth 2.0**
- **Overview**: OAuth 2.0 i... | 8,663 | [
{
"from": "human",
"value": "I would like to know what's the best technique to do single sign-on in web sites. It means that if you enter in more than one website, you will be authenticated in a \"transparent\" way. I'm using php + curl to set the cookies for the different sites, but i really would like to ... |
I am a neophyte with Ruby on Rails but I've created a couple of small apps. Anyway, I'm really interested in OpenID and I would like to implement OpenID authentication and maybe some Sreg stuff in a Rails app. All of the research that I have done has come up with articles that are out of date or just don't work for me.... | Implementing OpenID authentication in a Ruby on Rails application can be a bit challenging due to the rapid changes in both the Rails framework and the OpenID protocol itself. However, I can guide you through a modern approach to set up OpenID (or OpenID Connect, which is the more current standard) in your Rails applic... | 6,461 | [
{
"from": "human",
"value": "I am a neophyte with Ruby on Rails but I've created a couple of small apps. Anyway, I'm really interested in OpenID and I would like to implement OpenID authentication and maybe some Sreg stuff in a Rails app. All of the research that I have done has come up with articles that a... |
The NetBeans 6.1 editor doesn't seem to like to wrap comments, and the code formatter seems to ignore them. For JavaDoc comments, this behaviour seems inappropriate, as you can end up spending a lot of wasted time manually reflowing paragraphs.
I was wondering if there's some magic setting to get the builtin code form... | In NetBeans 6.1, handling JavaDoc comments can indeed be a bit tricky since the built-in formatter may not automatically reflow them the way you might expect. While there may not be a specific setting to enable automatic wrapping for JavaDoc comments in this version, you can try a few workarounds:
1. **Manual Reflow**... | 12,749 | [
{
"from": "human",
"value": "The NetBeans 6.1 editor doesn't seem to like to wrap comments, and the code formatter seems to ignore them. For JavaDoc comments, this behaviour seems inappropriate, as you can end up spending a lot of wasted time manually reflowing paragraphs.\nI was wondering if there's some ... |
Updating an old ASP/Access site for a client - I need SQL to add a column to an existing table and set a default value. Doesn't work - any ideas?
This works fine
ALTER TABLE documents ADD COLUMN membersOnly NUMBER
I want this to work:
ALTER TABLE documents ADD COLUMN membersOnly NUMBER DEFAULT 0
Have googled and seen... | In Microsoft Access, the SQL syntax for adding a column with a default value is a bit different than in other SQL databases. Specifically, the `DEFAULT` constraint cannot be specified directly in the `ALTER TABLE ... ADD COLUMN` statement. Instead, you have to add the column first and then modify it to set the default ... | 14,549 | [
{
"from": "human",
"value": "Updating an old ASP/Access site for a client - I need SQL to add a column to an existing table and set a default value. Doesn't work - any ideas?\nThis works fine\nALTER TABLE documents ADD COLUMN membersOnly NUMBER\n\nI want this to work:\nALTER TABLE documents ADD COLUMN membe... |
I want to be able to figure out what port a particular program is using. Are there any programs available online or that come with windows that will tell me which processes are using which ports on my computer?
PS - before you downmod this for not being a programming question, I'm looking for the program to test some ... | Yes, there are several built-in tools in Windows that you can use to find out which processes are using which ports. Here are a few methods you can try:
### 1. Command Prompt (netstat)
You can use the `netstat` command in the Command Prompt to check for open ports and the associated processes. Here's how to do it:
1.... | 10,873 | [
{
"from": "human",
"value": "I want to be able to figure out what port a particular program is using. Are there any programs available online or that come with windows that will tell me which processes are using which ports on my computer?\nPS - before you downmod this for not being a programming question,... |
What is the difference in C# between Convert.ToDecimal(string) and Decimal.Parse(string)?
In what scenarios would you use one over the other?
What impact does it have on performance?
What other factors should I be taking into consideration when choosing between the two?
| `Convert.ToDecimal(string)` and `Decimal.Parse(string)` are both methods in C# used to convert a string representation of a number into a `decimal` type. While they serve a similar purpose, there are important differences between the two:
### Differences
1. **Handling Null Values:**
- **Convert.ToDecimal(string):*... | 5,384 | [
{
"from": "human",
"value": "What is the difference in C# between Convert.ToDecimal(string) and Decimal.Parse(string)?\nIn what scenarios would you use one over the other?\nWhat impact does it have on performance?\nWhat other factors should I be taking into consideration when choosing between the two?\n"
... |
How can I add Page transitions effects like IE in Safari for web pages?
| Adding page transition effects in Safari (or any modern web browser) can help create a smooth experience when users navigate between pages. Although Safari may not support the same transition effects as Internet Explorer, you can achieve similar effects using CSS and JavaScript. Here are a few approaches to create page... | 8,294 | [
{
"from": "human",
"value": "How can I add Page transitions effects like IE in Safari for web pages?\n"
},
{
"from": "gpt",
"value": "Adding page transition effects in Safari (or any modern web browser) can help create a smooth experience when users navigate between pages. Although Safari may no... |
We want to store our overridden build targets in an external file and include that targets file in the TFSBuild.proj. We have a core set steps that happens and would like to get those additional steps by simply adding the import line to the TFSBuild.proj created by the wizard.
<Import Project="$(SolutionRoot)/libs/my.... | Working with Team Foundation Server (TFS) and MSBuild can sometimes present challenges when trying to manage build targets and dependencies. Here are a few strategies you can consider for your situation:
### 1. Using a Separate Build Targets Repository
If you are considering moving your build targets outside of the m... | 9,591 | [
{
"from": "human",
"value": "We want to store our overridden build targets in an external file and include that targets file in the TFSBuild.proj. We have a core set steps that happens and would like to get those additional steps by simply adding the import line to the TFSBuild.proj created by the wizard. \... |
I have a Cocoa app that uses a WebView to display an HTML interface. How would I go about calling an Objective-C method from a Javascript function within the HTML interface?
| To call an Objective-C method from JavaScript in a Cocoa application using `WebView`, you can use the `WebScriptObject` class which allows communication between JavaScript and your Objective-C code.
Here's a step-by-step guide on how to set it up:
### 1. Enable JavaScript in Your WebView
Make sure that JavaScript is... | 8,456 | [
{
"from": "human",
"value": "I have a Cocoa app that uses a WebView to display an HTML interface. How would I go about calling an Objective-C method from a Javascript function within the HTML interface?\n"
},
{
"from": "gpt",
"value": "To call an Objective-C method from JavaScript in a Cocoa app... |
I am setting up a project using Hibernate 3.3.1 GA and PostgreSQL 8.3. I've just created a database, the first table, added one row there and now configuring Hibernate.
However, even the simplest query:
Criteria criteria = session.createCriteria(Place.class);
List result = criteria.list();
could not be executed (empty... | It appears that you've run into a problem with Hibernate returning an empty result set even though you have confirmed that the data exists in the database using plain JDBC. The PostgreSQL logs indicate a disconnection or reset of the connection, which could be a sign of misconfiguration or other issues in your Hibernat... | 8,603 | [
{
"from": "human",
"value": "I am setting up a project using Hibernate 3.3.1 GA and PostgreSQL 8.3. I've just created a database, the first table, added one row there and now configuring Hibernate.\nHowever, even the simplest query:\nCriteria criteria = session.createCriteria(Place.class);\nList result = cr... |
This page mentions how to trunc a timestamp to minutes/hours/etc. in Oracle.
How would you trunc a timestamp to seconds in the same manner?
| In Oracle, if you want to truncate a timestamp to seconds, you can use the `TRUNC` function along with the `CAST` function. However, Oracle does not have a direct `TRUNC` function for timestamps to seconds, as it does for dates.
Instead, you can use a combination of `CAST` to convert the timestamp to a date, `TRUNC` ... | 13,722 | [
{
"from": "human",
"value": "This page mentions how to trunc a timestamp to minutes/hours/etc. in Oracle.\nHow would you trunc a timestamp to seconds in the same manner?\n"
},
{
"from": "gpt",
"value": "In Oracle, if you want to truncate a timestamp to seconds, you can use the `TRUNC` function a... |
My model layer is being used by a handful of different projects and I'd like to use a single XML Spring Configuration file for the model regardless of which project is using it.
My question is: Since not all beans are used in all projects am I wasting resources to any significant amount if there not being instantiated?... | Using a single XML Spring Configuration file for your model layer that serves multiple projects is a common approach and can lead to better maintainability and reusability. However, you raise a valid concern about resource utilization, particularly regarding bean instantiation.
### Key Points to Consider
1. **Lazy In... | 10,696 | [
{
"from": "human",
"value": "My model layer is being used by a handful of different projects and I'd like to use a single XML Spring Configuration file for the model regardless of which project is using it.\nMy question is: Since not all beans are used in all projects am I wasting resources to any significa... |
What are the JVM implementations available on Windows Mobile?
Esmertec JBed is the one on my WinMo phone.
Wondering how many other JVM vendors are in this zone. Are there any comparison or benchmarking data available?
| Windows Mobile (WinMo) has historically supported several Java Virtual Machine (JVM) implementations, though the ecosystem has been somewhat limited compared to other platforms like Android. Apart from Esmertec JBed, here are a few other JVMs that have been associated with Windows Mobile:
1. **IBM WebSphere Everyplace... | 7,944 | [
{
"from": "human",
"value": "What are the JVM implementations available on Windows Mobile?\nEsmertec JBed is the one on my WinMo phone.\nWondering how many other JVM vendors are in this zone. Are there any comparison or benchmarking data available?\n"
},
{
"from": "gpt",
"value": "Windows Mobile... |
We have a requirement to increase the functionality of a grid we are using to edit on our webapp, and our manager keeps citing Excel as the perfect example for a data grid :/ He still doesn't really get that a Spreadsheet like control doesn't exist out of the box, but I thought I'd do a bit of searching nonetheless.
I'... | It's a common challenge to create a web-based grid that matches the functionality and flexibility of Excel. Here are a few options to consider for enhancing your grid functionality, particularly with features like copy-paste support and more flexible editing capabilities:
### 1. **Handsontable**
- **Description**: Han... | 4,865 | [
{
"from": "human",
"value": "We have a requirement to increase the functionality of a grid we are using to edit on our webapp, and our manager keeps citing Excel as the perfect example for a data grid :/ He still doesn't really get that a Spreadsheet like control doesn't exist out of the box, but I thought ... |
We are attempting to use a SQL Server 2003 database for our test records and want a quick way to take NUnit and NAnt output and produce SQL schema and data. Is there a simple way to generate SQL Schema using the XSD file describing these XML documents?
| Yes, you can generate SQL schema and data from an XML schema (XSD) file using several approaches. Below are the steps and methods to achieve this:
### Steps to Generate SQL Schema from XSD
1. **Use XML Schema Definition Tool (XSD.exe)**:
- You can use the `xsd.exe` tool which is part of the .NET Framework SDK. Thi... | 11,975 | [
{
"from": "human",
"value": "We are attempting to use a SQL Server 2003 database for our test records and want a quick way to take NUnit and NAnt output and produce SQL schema and data. Is there a simple way to generate SQL Schema using the XSD file describing these XML documents?\n"
},
{
"from": "g... |
C++ seems to be rather grouchy when declaring templates across multiple files. More specifically, when working with templated classes, the linker expect all method definitions for the class in a single compiler object file. When you take into account headers, other declarations, inheritance, etc., things get really mes... | Indeed, C++ templates can be tricky to manage across multiple files due to the way the C++ compilation model works. Unlike regular class and function definitions, template definitions must be visible to the compiler at the point of instantiation. Here are some strategies and best practices to help you organize and mana... | 10,049 | [
{
"from": "human",
"value": "C++ seems to be rather grouchy when declaring templates across multiple files. More specifically, when working with templated classes, the linker expect all method definitions for the class in a single compiler object file. When you take into account headers, other declarations,... |
An array of ints in java is stored as a block of 32-bit values in memory. How is an array of Integer objects stored? i.e.
int[] vs. Integer[]
I'd imagine that each element in the Integer array is a reference to an Integer object, and that the Integer object has object storage overheads, just like any other object.
I'm... | Your understanding is quite accurate regarding how `int[]` and `Integer[]` are stored in Java. Here's a detailed explanation of the differences between the two:
### Storage of `int[]`
An array of primitive integers (`int[]`) is stored as a contiguous block of memory, where each `int` occupies 4 bytes (32 bits). This m... | 9,458 | [
{
"from": "human",
"value": "An array of ints in java is stored as a block of 32-bit values in memory. How is an array of Integer objects stored? i.e.\nint[] vs. Integer[]\n\nI'd imagine that each element in the Integer array is a reference to an Integer object, and that the Integer object has object storag... |
I was using an enum in which the constant was a Class. I needed to invoke a method on the constant but could not introduce a compile time dependency and the enum was not always available at runtime (part of optional install). Therefore, I wanted to use reflection.
This is easy, but I hadn't used reflection with enums... | You can use reflection to invoke methods on an enum constant in Java just like you would with any other object. Below is an example that demonstrates how to invoke the `getValue()` method on a specific enum constant from your `PropertyEnum` enum using reflection.
Here’s how you can do this:
```java
import java.lang.r... | 12,778 | [
{
"from": "human",
"value": "I was using an enum in which the constant was a Class. I needed to invoke a method on the constant but could not introduce a compile time dependency and the enum was not always available at runtime (part of optional install). Therefore, I wanted to use reflection. \nThis is eas... |
I'm working in a team environment where each developer works from their local desktop and deploys to a virtual machine that they own on the network. What I'm trying to do is set up the Visual Studio solution so that when they build the solution each projects deployment is handled in the post-build event to that develo... | Setting up an automated deployment process for individual developers in a team environment can be a great way to streamline workflows and give developers more control over their development environments. Let's break down your questions and provide you with some insights.
### 1. Post-Build Events for Deployment
**Is a... | 7,255 | [
{
"from": "human",
"value": "I'm working in a team environment where each developer works from their local desktop and deploys to a virtual machine that they own on the network. What I'm trying to do is set up the Visual Studio solution so that when they build the solution each projects deployment is handl... |
I'm looking for an answer in MS VC++.
When debugging a large C++ application, which unfortunately has a very extensive usage of C++ exceptions. Sometimes I catch an exception a little later than I actually want.
Example in pseudo code:
FunctionB()
{
...
throw e;
...
}
FunctionA()
{
...
FunctionB()
... | When dealing with exceptions in C++, especially in a large application with extensive use of exceptions, it can be challenging to trace back the exact point where an exception was thrown. Here are several strategies to help you diagnose and understand where exceptions are raised without having to significantly alter yo... | 10,237 | [
{
"from": "human",
"value": "I'm looking for an answer in MS VC++.\nWhen debugging a large C++ application, which unfortunately has a very extensive usage of C++ exceptions. Sometimes I catch an exception a little later than I actually want.\nExample in pseudo code:\nFunctionB()\n{\n ...\n throw e;\n ... |
we're developing a web app to cover all aspects of a printing company from finances, to payroll, to job costing. Its important to be able to control who can access what parts of these applications. Don't want a line employee giving himself a raise, etc...
I've heard of the concept of ACL & ACO, but haven't found a go... | Implementing Access Control Lists (ACL) and Access Control Objects (ACO) is a great approach to managing permissions within your web app, especially in a complex environment like a printing company with multiple roles and responsibilities. Here are some resources and concepts that can help you implement ACL and ACO eff... | 2,282 | [
{
"from": "human",
"value": "we're developing a web app to cover all aspects of a printing company from finances, to payroll, to job costing. Its important to be able to control who can access what parts of these applications. Don't want a line employee giving himself a raise, etc...\nI've heard of the co... |
Is it particularly bad to have a very, very large SQL query with lots of (potentially redundant) WHERE clauses?
For example, here's a query I've generated from my web application with everything turned off, which should be the largest possible query for this program to generate:
SELECT *
FROM 4e_magic_items
INNER JOI... | Having a very large SQL query with many redundant `WHERE` clauses can lead to several potential issues, even if it appears to work fine at lower traffic levels. Here are some aspects to consider regarding performance and maintainability:
### 1. **Readability and Maintainability**
- Large and complex queries can be ... | 9,714 | [
{
"from": "human",
"value": "Is it particularly bad to have a very, very large SQL query with lots of (potentially redundant) WHERE clauses?\nFor example, here's a query I've generated from my web application with everything turned off, which should be the largest possible query for this program to generate... |
The ReSharper reformat code feature is very handy and flexible, particularly with the new code layout templating flexibility JetBrains have added in version 3.0.
Is there a standard set of code style settings for ReSharper which match the rules enforced by Microsoft StyleCop, so that StyleCop compliance can be as easy ... | Yes, there is a way to configure ReSharper to align its code style settings with the rules enforced by Microsoft StyleCop. However, there isn't an official, one-size-fits-all set of settings directly provided by JetBrains that completely matches StyleCop rules. Instead, you can manually adjust ReSharper's settings to m... | 9,370 | [
{
"from": "human",
"value": "The ReSharper reformat code feature is very handy and flexible, particularly with the new code layout templating flexibility JetBrains have added in version 3.0.\nIs there a standard set of code style settings for ReSharper which match the rules enforced by Microsoft StyleCop, s... |
The question posed came about during a 2nd Year Comp Science lecture while discussing the impossibility of generating numbers in a deterministic computational device.
This was the only suggestion which didn't depend on non-commodity-class hardware.
Subsequently nobody would put their reputation on the line to argue def... | The discussion about the impossibility of generating truly random numbers with deterministic computational devices touches on foundational concepts in computer science, randomness, and chaos theory. Deterministic computational devices, such as traditional computers, follow predefined algorithms and rules. Thus, any out... | 10,233 | [
{
"from": "human",
"value": "The question posed came about during a 2nd Year Comp Science lecture while discussing the impossibility of generating numbers in a deterministic computational device.\nThis was the only suggestion which didn't depend on non-commodity-class hardware.\nSubsequently nobody would pu... |
I've created a learning application using Bort, which is a base app that includes Restful Authentication and RSpec. I've got it up and running and added a new object that requires users to be logged in before they can do anything(before_filter :login_required in the controller). [edit: I should also mention that the ... | To test the behavior of your controller actions both for logged-in and not logged-in users in RSpec, you'll want to use `let` to define a method for creating a logged-in user and another method to ensure that the user is logged out. Here's a step-by-step guide on how to structure your tests for both scenarios.
### 1. ... | 10,894 | [
{
"from": "human",
"value": "I've created a learning application using Bort, which is a base app that includes Restful Authentication and RSpec. I've got it up and running and added a new object that requires users to be logged in before they can do anything(before_filter :login_required in the controller)... |
I realize you can script Microsoft Office apps, but I'm looking for something more general that I can apply to other apps, such as Adobe Acrobat, web browsers and other apps with no scripting ability.
I've used AutoIt but it's a bit clunky, especially when trying to debug why a script fails or stalls. Also, getting the... | Yes, there are several automation tools and frameworks that can help you automate interactions with various applications, including those that do not have built-in scripting capabilities. Here are some alternatives to AutoIt that you might find more user-friendly and efficient for your needs:
1. **SikuliX**:
- Siku... | 9,417 | [
{
"from": "human",
"value": "I realize you can script Microsoft Office apps, but I'm looking for something more general that I can apply to other apps, such as Adobe Acrobat, web browsers and other apps with no scripting ability.\nI've used AutoIt but it's a bit clunky, especially when trying to debug why a... |
I have used the Entity Framework to start a fairly simple sample project. In the project, I have created a new Entity Data Model from a SQL Server 2000 database. I am able to query the data using LINQ to Entities and display values on the screen.
I have an Oracle database with an extremely similar schema (I am trying t... | Creating an application that can seamlessly switch between different database providers (like SQL Server and Oracle) using Entity Framework can indeed be tricky due to differences in how these databases handle data types, queries, and relationships. However, it is possible to achieve your goals with some considerations... | 7,863 | [
{
"from": "human",
"value": "I have used the Entity Framework to start a fairly simple sample project. In the project, I have created a new Entity Data Model from a SQL Server 2000 database. I am able to query the data using LINQ to Entities and display values on the screen.\nI have an Oracle database with ... |
Maven spews out far too many lines of output to my taste (I like the Unix way: no news is good news).
I want to get rid of all [INFO] lines, but I couldn't find any mention of an argument or config settings that controls the verbosity of Maven.
Is there no LOG4J-like way to set the log level?
| Maven does not have a built-in logging configuration like Log4J for controlling log levels directly. However, you can control the verbosity of Maven's output using command-line options.
To reduce the output to only show errors and warnings, you can use the `-q` (quiet) option:
```bash
mvn -q clean install
```
This w... | 13,833 | [
{
"from": "human",
"value": "Maven spews out far too many lines of output to my taste (I like the Unix way: no news is good news).\nI want to get rid of all [INFO] lines, but I couldn't find any mention of an argument or config settings that controls the verbosity of Maven.\nIs there no LOG4J-like way to se... |
I've got a stored procedure in my database, that looks like this
ALTER PROCEDURE [dbo].[GetCountingAnalysisResults]
@RespondentFilters varchar
AS
BEGIN
@RespondentFilters = '''8ec94bed-fed6-4627-8d45-21619331d82a, 114c61f2-8935-4755-b4e9-4a598a51cc7f'''
DECLARE @SQL nvarchar(600)
SET @SQL =
'SELECT *
FR... | The issue you're encountering is likely due to the way the `@RespondentFilters` string is constructed and how you're including it in your dynamic SQL. When you construct the `@SQL` statement, the syntax you've used might be incorrect, especially regarding the usage of quotes and the grouping in your `WHERE` clause.
He... | 10,804 | [
{
"from": "human",
"value": "I've got a stored procedure in my database, that looks like this\nALTER PROCEDURE [dbo].[GetCountingAnalysisResults] \n @RespondentFilters varchar\nAS\nBEGIN\n\n@RespondentFilters = '''8ec94bed-fed6-4627-8d45-21619331d82a, 114c61f2-8935-4755-b4e9-4a598a51cc7f'''\n\nDECLARE @S... |
Can anyone recommend a good resource -- book, website, article, etc -- to help me learn SQL Server Analysis services.
I have no knowledge of this technology right now but I do constantly work with SQL server in the traditional sense.
I want to learn about Cubes and Using Reporting Services with it. I want to start fro... | Hi Frank,
It's great to hear that you're interested in learning SQL Server Analysis Services (SSAS)! Given your background with SQL Server, you already have a solid foundation to build upon. Here are some resources, both free and paid, that can help you get started:
### Free Resources
1. **Microsoft Learn**:
- Mi... | 11,059 | [
{
"from": "human",
"value": "Can anyone recommend a good resource -- book, website, article, etc -- to help me learn SQL Server Analysis services.\nI have no knowledge of this technology right now but I do constantly work with SQL server in the traditional sense. \nI want to learn about Cubes and Using Repo... |
How would I go about converting an address or city to a latitude/longitude? Are there commercial outfits I can "rent" this service from? This would be used in a commercial desktop application on a Windows PC with fulltime internet access.
| To convert an address or city to latitude and longitude, you can use a process called geocoding. There are several commercial services that provide APIs for geocoding, allowing you to integrate this functionality into your application. Here’s how to approach it:
### Steps to Convert Address/City to Latitude/Longitude:... | 11,292 | [
{
"from": "human",
"value": "How would I go about converting an address or city to a latitude/longitude? Are there commercial outfits I can \"rent\" this service from? This would be used in a commercial desktop application on a Windows PC with fulltime internet access.\n"
},
{
"from": "gpt",
"va... |
I'd like to be able to determine if a directory such as a '.app' is considered to be a package or bundle from Finder's point of view on the command line. I don't think this would be difficult to do with a small shell program, but I'd rather not re-invent the wheel if I don't have to.
| On macOS, you can determine if a directory is considered a package or bundle using the `file` command in the terminal. Typically, app bundles (like `.app` directories) are special types of directories that contain executable files and resources. The `file` command can help you identify the type of a file or directory.
... | 9,565 | [
{
"from": "human",
"value": "I'd like to be able to determine if a directory such as a '.app' is considered to be a package or bundle from Finder's point of view on the command line. I don't think this would be difficult to do with a small shell program, but I'd rather not re-invent the wheel if I don't ha... |
I'm a little blockheaded right now…
I have a date string in european format dd.mm.yyyy and need to transform it to mm.dd.yyyy with classic ASP. Any quick ideas?
| Certainly! To convert a date string from the European format (dd.mm.yyyy) to the American format (mm.dd.yyyy) in Classic ASP, you can use the following approach:
1. Split the original date string into day, month, and year.
2. Rearrange the components into the desired format.
3. Concatenate them back together.
Here's ... | 12,836 | [
{
"from": "human",
"value": "I'm a little blockheaded right now…\nI have a date string in european format dd.mm.yyyy and need to transform it to mm.dd.yyyy with classic ASP. Any quick ideas?\n"
},
{
"from": "gpt",
"value": "Certainly! To convert a date string from the European format (dd.mm.yyyy... |
If I have an instance of a System.Timers.Timer that has a long interval - say 1 minute, how can I find out if it is started without waiting for the Tick?
| In .NET, if you are using an instance of `System.Timers.Timer`, you can determine whether the timer is started or not by checking its `Enabled` property. The `Enabled` property will return `true` if the timer is running (i.e., it has been started and is currently in a waiting state), and `false` if it is stopped.
Here... | 13,022 | [
{
"from": "human",
"value": "If I have an instance of a System.Timers.Timer that has a long interval - say 1 minute, how can I find out if it is started without waiting for the Tick?\n"
},
{
"from": "gpt",
"value": "In .NET, if you are using an instance of `System.Timers.Timer`, you can determin... |
I'm implementing an Apache 2.0.x module in C, to interface with an existing product we have. I need to handle FORM data, most likely using POST but I want to handle the GET case as well.
Nick Kew's Apache Modules book has a section on handling form data. It provides code examples for POST and GET, which return an apr_h... | Handling form data in an Apache module can indeed be a tedious task, but fortunately, the Apache HTTP Server offers some utilities and helper functions that can streamline the process for you. While you may not find a single function that extracts GET and POST data directly into a structure for you, the Apache framewor... | 9,094 | [
{
"from": "human",
"value": "I'm implementing an Apache 2.0.x module in C, to interface with an existing product we have. I need to handle FORM data, most likely using POST but I want to handle the GET case as well.\nNick Kew's Apache Modules book has a section on handling form data. It provides code exampl... |
I'm looking to have text display vertically, first letter at the bottom, last letter at the top, within a JLabel. Is this possible?
| Yes, it is possible to display text vertically in a JLabel in Java Swing. However, JLabel does not provide built-in support for vertical text rendering directly. You can achieve this by using a custom painting approach.
Here is an example of how to display the text vertically in a JLabel, with the first letter at the ... | 9,372 | [
{
"from": "human",
"value": "I'm looking to have text display vertically, first letter at the bottom, last letter at the top, within a JLabel. Is this possible?\n"
},
{
"from": "gpt",
"value": "Yes, it is possible to display text vertically in a JLabel in Java Swing. However, JLabel does not pr... |
Since the only operations required for a container to be used in a stack are:
back()
push_back()
pop_back()
Why is the default container for it a deque instead of a vector?
Don't deque reallocations give a buffer of elements before front() so that push_front() is an efficient operation? Aren't these elements wasted s... | Your understanding of the differences between `deque` and `vector` for stack and priority queue operations is mostly accurate, and you've already touched on the main points that influence the choice of default containers in C++. Let’s clarify and expand on these points a bit.
### Why `deque` for `stack`?
1. **Amortiz... | 10,285 | [
{
"from": "human",
"value": "Since the only operations required for a container to be used in a stack are:\n\nback()\npush_back()\npop_back()\n\nWhy is the default container for it a deque instead of a vector?\nDon't deque reallocations give a buffer of elements before front() so that push_front() is an eff... |
Do you attach the images?
Use absolute urls?
How do you best avoid getting flagged as spam?
| As a text-based AI, I don't have the capability to attach images or use URLs. However, I can provide guidance on best practices regarding images, URLs, and avoiding spam flags:
### Attaching Images
1. **Use Platforms Designed for Sharing**: If you're sending content that includes images, use platforms (like email or s... | 12,018 | [
{
"from": "human",
"value": "Do you attach the images? \nUse absolute urls? \nHow do you best avoid getting flagged as spam? \n"
},
{
"from": "gpt",
"value": "As a text-based AI, I don't have the capability to attach images or use URLs. However, I can provide guidance on best practices regarding... |
Our subversion repository has been moved to a new host, and we have old applications that connect to that host. We CANNOT add an alias for the new server with the old name, how can we re-connect our checked out clients to the new repository?
| If your Subversion (SVN) repository has been moved to a new host and you cannot create an alias for the new server, you'll need to update the SVN working copies that were checked out from the old repository URL to point to the new repository URL. You can do this using the `svn switch` command.
Here's how to update you... | 11,738 | [
{
"from": "human",
"value": "Our subversion repository has been moved to a new host, and we have old applications that connect to that host. We CANNOT add an alias for the new server with the old name, how can we re-connect our checked out clients to the new repository?\n"
},
{
"from": "gpt",
"... |
My JavaScript is pretty nominal, so when I saw this construction, I was kind of baffled:
var shareProxiesPref = document.getElementById("network.proxy.share_proxy_settings");
shareProxiesPref.disabled = proxyTypePref.value != 1;
Isn't it better to do an if on proxyTypePref.value, and then declare the var inside the re... | The code you provided is indeed a concise way to set the `disabled` property of the `shareProxiesPref` element based on the value of `proxyTypePref.value`. However, you raise a valid point regarding readability and maintainability.
Here's a breakdown of your concerns:
1. **Readability**:
- The one-liner `sharePro... | 8,737 | [
{
"from": "human",
"value": "My JavaScript is pretty nominal, so when I saw this construction, I was kind of baffled:\nvar shareProxiesPref = document.getElementById(\"network.proxy.share_proxy_settings\");\nshareProxiesPref.disabled = proxyTypePref.value != 1;\n\nIsn't it better to do an if on proxyTypePre... |
How can I detect when an Exception has been thrown anywhere in my application?
I'm try to auto-magically send myself an email whenever an exception is thrown anywhere in my Java Desktop Application. I figure this way I can be more proactive.
I know I could just explicitly log and notify myself whenever an exception oc... | Detecting exceptions across an entire Java application can be approached in several ways. Here are a couple of strategies that can help you automatically send notifications, such as emails, whenever an exception occurs:
### 1. Global Exception Handler
One common approach is to set up a global exception handler. In a ... | 6,229 | [
{
"from": "human",
"value": "How can I detect when an Exception has been thrown anywhere in my application?\nI'm try to auto-magically send myself an email whenever an exception is thrown anywhere in my Java Desktop Application. I figure this way I can be more proactive.\nI know I could just explicitly log... |
I'm developing a Java ME app & need pointers to some really good UI libraries. I did see a few such as Java ME Polish. Are there any more out there? For e.g. ebuddy's java ME app has an amazing UI and so is gmail's java ME app. What libraries would they have been using or would have they have developed it on their own?... | When developing a Java ME app, particularly if you're looking for ways to enhance your user interface, you have several libraries and frameworks at your disposal. Here are some noteworthy options:
1. **Java ME Polish**: As you've mentioned, this is a popular framework for building Java ME applications. It provides a s... | 10,131 | [
{
"from": "human",
"value": "I'm developing a Java ME app & need pointers to some really good UI libraries. I did see a few such as Java ME Polish. Are there any more out there? For e.g. ebuddy's java ME app has an amazing UI and so is gmail's java ME app. What libraries would they have been using or would ... |
I have a CometProcessor implementation that is effectively doing a Multicast to a potentially large number of clients. When an event occurs that needs propagated to to all the clients, the CometProcessor will need to loop through the list of clients writing out the response. If writing responses block then there is t... | Your understanding is correct; writing to the output stream in a CometProcessor does block. When you call `r.getOutputStream().write(someInfo)`, it can block if the underlying network connection is slow or if the client's buffer is full. This behavior can indeed lead to a scenario where slow clients adversely affect th... | 10,723 | [
{
"from": "human",
"value": "I have a CometProcessor implementation that is effectively doing a Multicast to a potentially large number of clients. When an event occurs that needs propagated to to all the clients, the CometProcessor will need to loop through the list of clients writing out the response. I... |
Some years ago I was on a panel that was interviewing candidates for a relatively senior embedded C programmer position.
One of the standard questions that I asked was about optimisation techniques. I was quite surprised that some of the candidates didn't have answers.
So, in the interests of putting together a list fo... | Optimizing C programs, especially in the context of embedded systems, involves a variety of techniques and constructs aimed at improving performance (speed) and reducing resource usage (size). Here’s a comprehensive list of optimization techniques that candidates might use or should be aware of:
### General Optimizati... | 7,881 | [
{
"from": "human",
"value": "Some years ago I was on a panel that was interviewing candidates for a relatively senior embedded C programmer position.\nOne of the standard questions that I asked was about optimisation techniques. I was quite surprised that some of the candidates didn't have answers.\nSo, in ... |
I have looked at the ability to use tabs in Vim (with :tabe, :tabnew, etc.) as a replacement for my current practice of having many files open in the same window in hidden buffers.
I would like every distinct file that I have open to always be in its own tab. However, there are some things that get in the way of this. ... | To achieve your goal of having every distinct file in its own tab in Vim, you can customize Vim's behavior in a couple of ways.
### Opening Files in New Tabs with Commands like `gf` and `^]`
1. **Remap `gf` and `^]` to open files in a new tab:** You can create custom mappings for these commands to always open files i... | 10,055 | [
{
"from": "human",
"value": "I have looked at the ability to use tabs in Vim (with :tabe, :tabnew, etc.) as a replacement for my current practice of having many files open in the same window in hidden buffers.\nI would like every distinct file that I have open to always be in its own tab. However, there are... |
So, I have Flex project that loads a Module using the ModuleManager - not the module loader. The problem that I'm having is that to load an external asset (like a video or image) the path to load that asset has to be relative to the Module swf...not relative to the swf that loaded the module.
The question is - How can... | When working with Flex modules, it can indeed be a challenge to load assets relative to the parent SWF rather than the module SWF. Since the default behavior is to resolve paths relative to the module's own location, you’ll need to consider a few potential approaches to address this issue:
### 1. Modify Asset Paths in... | 10,670 | [
{
"from": "human",
"value": "So, I have Flex project that loads a Module using the ModuleManager - not the module loader. The problem that I'm having is that to load an external asset (like a video or image) the path to load that asset has to be relative to the Module swf...not relative to the swf that loa... |
My understanding of the MVC is as follows (incase it's horribly wrong, I am afterall new to it)
Models are the things that interface with the database
Views are the design/layout of the page
Controllers are where everything starts and are essentially the page logic
I'm using CodeIgniter but I would hazard a guess it'... | Your understanding of the MVC (Model-View-Controller) architecture is generally correct. Let's clarify a bit more and address your specific questions regarding CodeIgniter and the organization of your classes.
### MVC Overview
1. **Models**: These handle the data and business logic. They are responsible for interfaci... | 12,003 | [
{
"from": "human",
"value": "My understanding of the MVC is as follows (incase it's horribly wrong, I am afterall new to it)\n\nModels are the things that interface with the database\nViews are the design/layout of the page\nControllers are where everything starts and are essentially the page logic\n\nI'm u... |
I'm convinced from this presentation and other commentary here on the site that I need to learn to Unit Test. I also realize that there have been many questions about what unit testing is here. Each time I go to consider how it should be done in the application I am currently working on, I walk away confused. It is ... | Unit testing can certainly feel challenging, especially in event-driven or procedural contexts like XULRunner applications. However, there are strategies you can employ to make unit testing effective even if your application isn't strictly object-oriented. Let's break it down.
### Understanding Unit Testing
1. **Defi... | 8,390 | [
{
"from": "human",
"value": "I'm convinced from this presentation and other commentary here on the site that I need to learn to Unit Test. I also realize that there have been many questions about what unit testing is here. Each time I go to consider how it should be done in the application I am currently ... |
I've got several Gridviews in my application in which I use a custom PagerTemplate. I'd like to turn this custom template into a UserControl so that I don't need to replicate the same logic in multiple pages. I'm pretty sure that such a thing is possible, but I'm unsure of how exactly to wire the UserControl to the Gri... | Creating a custom UserControl for a GridView pager in ASP.NET 2.0 is a great way to encapsulate your pagination logic and avoid code duplication. Below, I'll provide a step-by-step guide on how to create the UserControl, wire it up with events, and integrate it with the GridView.
### Step 1: Create the UserControl
1.... | 6,552 | [
{
"from": "human",
"value": "I've got several Gridviews in my application in which I use a custom PagerTemplate. I'd like to turn this custom template into a UserControl so that I don't need to replicate the same logic in multiple pages. I'm pretty sure that such a thing is possible, but I'm unsure of how e... |
I'm wondering if there's an integrated solution to have a database with versioned records supported by rails (ala version_fu ar_versioned) and a differ thanks!
| In Rails, there are several gems that can help you implement versioned records, along with support for tracking differences between versions. Below are some suggestions for gems that integrate versioning and provide diff capabilities:
### 1. **PaperTrail**
- **Overview**: PaperTrail is one of the most popular gems fo... | 9,802 | [
{
"from": "human",
"value": "I'm wondering if there's an integrated solution to have a database with versioned records supported by rails (ala version_fu ar_versioned) and a differ thanks!\n"
},
{
"from": "gpt",
"value": "In Rails, there are several gems that can help you implement versioned rec... |
I've got a CAkePHP 1.2 site. I've got three related Models/tables:
A Comment has exactly one Touch, a Touch has exactly one Touchtype.
In each model, I have a belongs to, so I have
Comments belongs to Touch, Touch belongs to Touchtype.
I'm trying to get a list of comments that includes information about the touch store... | In CakePHP 1.2, the default behavior of the `find()` method, including the handling of related models, can indeed present some challenges when you want to fetch associated data from multiple levels of associations. However, you can achieve your goal of retrieving comments along with their associated Touch and TouchType... | 10,179 | [
{
"from": "human",
"value": "I've got a CAkePHP 1.2 site. I've got three related Models/tables:\nA Comment has exactly one Touch, a Touch has exactly one Touchtype.\nIn each model, I have a belongs to, so I have\nComments belongs to Touch, Touch belongs to Touchtype.\nI'm trying to get a list of comments th... |
Basically I’ve heard that certain conditions will cause .NET to blow past the finally block. Does anyone know what those conditions are?
| In .NET, the `finally` block is designed to always execute after a `try` block, regardless of whether an exception was thrown or handled. However, there are specific conditions under which the execution of a `finally` block may be bypassed or interrupted:
1. **Process Termination**: If the process hosting the .NET app... | 13,097 | [
{
"from": "human",
"value": "Basically I’ve heard that certain conditions will cause .NET to blow past the finally block. Does anyone know what those conditions are?\n"
},
{
"from": "gpt",
"value": "In .NET, the `finally` block is designed to always execute after a `try` block, regardless of wh... |
When verbally talking about methods, I'm never sure whether to use the word argument or parameter or something else. Either way the other people know what I mean, but what's correct, and what's the history of the terms?
I'm a C# programmer, but I also wonder whether people use different terms in different languages.
Fo... | The terms "argument" and "parameter" are commonly used in programming, and they refer to related but distinct concepts. Understanding the difference between them can help clarify your communication, especially when discussing methods in any programming language, including C#.
### Definitions:
1. **Parameter**:
- ... | 12,999 | [
{
"from": "human",
"value": "When verbally talking about methods, I'm never sure whether to use the word argument or parameter or something else. Either way the other people know what I mean, but what's correct, and what's the history of the terms?\nI'm a C# programmer, but I also wonder whether people use ... |
In Visual Studio, we've all had "baadf00d", have seen seen "CC" and "CD" when inspecting variables in the debugger in C++ during run-time.
From what I understand, "CC" is in DEBUG mode only to indicate when a memory has been new() or alloc() and unitilialized. While "CD" represents delete'd or free'd memory. I've onl... | In Visual Studio, the patterns used for memory allocation and deallocation in C++ can help identify memory issues such as leaks and buffer overflows. Here’s a breakdown of the recognizable patterns you mentioned, along with when and how they are typically used:
### Memory Patterns
1. **"CC"**:
- This pattern is u... | 10,381 | [
{
"from": "human",
"value": "In Visual Studio, we've all had \"baadf00d\", have seen seen \"CC\" and \"CD\" when inspecting variables in the debugger in C++ during run-time.\nFrom what I understand, \"CC\" is in DEBUG mode only to indicate when a memory has been new() or alloc() and unitilialized. While \"... |
I have a REST Java server implemented with Jersey running on Jetty. It seems that certain browsers (IE7) internally caches all requests made to the server.
What I would like to do is to send a certain HTTP header in the response from the REST server indicating the browser that it shouldn't cache that response, and so ... | To prevent certain browsers, such as Internet Explorer 7, from caching responses from your REST server, you can set specific HTTP headers in the response. These headers instruct the browser not to cache the responses. You can do this in your Jersey application by using filters or directly in your resource classes.
Her... | 10,749 | [
{
"from": "human",
"value": "I have a REST Java server implemented with Jersey running on Jetty. It seems that certain browsers (IE7) internally caches all requests made to the server. \nWhat I would like to do is to send a certain HTTP header in the response from the REST server indicating the browser that... |
Is there some reasonably cross platform way to create a thumbnail image given a URL? I know there are thumbnail web services that will do this, but I want a piece of software or library that will do this locally. I guess in Linux I could always spawn a browser window using a headless X server, but what about Windows or... | Creating a thumbnail image from a URL locally across different platforms (Linux, Windows, and macOS) can be accomplished by using libraries or tools that are capable of rendering web pages and capturing images. Here are some options that can work across these platforms:
### 1. **Puppeteer (Node.js)**
Puppeteer is a N... | 12,080 | [
{
"from": "human",
"value": "Is there some reasonably cross platform way to create a thumbnail image given a URL? I know there are thumbnail web services that will do this, but I want a piece of software or library that will do this locally. I guess in Linux I could always spawn a browser window using a hea... |
I am trying to add some custom build steps to my headless build process for an Eclipse RCP application.
I understand that the recommended way is to provide a customBuildCallbacks.xml file on the plug-in directory, and adding a link to it in the build.properties file.
# This property sets the location of the customb Bu... | When setting up custom build steps for an Eclipse RCP application using the `customBuildCallbacks.xml` file, it's crucial to ensure that everything is correctly configured. Here are some steps and checks you can perform to troubleshoot the issue:
1. **File Location**: Make sure the `customBuildCallbacks.xml` file is l... | 9,752 | [
{
"from": "human",
"value": "I am trying to add some custom build steps to my headless build process for an Eclipse RCP application.\nI understand that the recommended way is to provide a customBuildCallbacks.xml file on the plug-in directory, and adding a link to it in the build.properties file.\n # This p... |
I know this rather goes against the idea of enums, but is it possible to extend enums in C#/Java? I mean "extend" in both the sense of adding new values to an enum, but also in the OO sense of inheriting from an existing enum.
I assume it's not possible in Java, as it only got them fairly recently (Java 5?). C# see... | Enums in both C# and Java are designed to be a fixed set of constants, and both languages do not support extending enums in the traditional sense of inheritance or adding new values at runtime.
### Java
In Java, enums are a special type of class that extends `java.lang.Enum`. You cannot subclass an enum or add new co... | 9,196 | [
{
"from": "human",
"value": "I know this rather goes against the idea of enums, but is it possible to extend enums in C#/Java? I mean \"extend\" in both the sense of adding new values to an enum, but also in the OO sense of inheriting from an existing enum. \nI assume it's not possible in Java, as it only... |
I need to simply go through all the cells in a Excel Spreadsheet and check the values in the cells. The cells may contain text, numbers or be blank. I am not very familiar / comfortable working with the concept of 'Range'. Therefore, any sample codes would be greatly appreciated. (I did try to google it, but the co... | Sure! I can provide you with a simple example of how to loop through all the cells in an Excel spreadsheet using VBA (Visual Basic for Applications). This code will allow you to check the values in the cells, regardless of whether they contain text, numbers, or are blank.
Here's a straightforward code snippet you can ... | 11,387 | [
{
"from": "human",
"value": "I need to simply go through all the cells in a Excel Spreadsheet and check the values in the cells. The cells may contain text, numbers or be blank. I am not very familiar / comfortable working with the concept of 'Range'. Therefore, any sample codes would be greatly apprecia... |
In Java, one can declare a variable parameterised by an "unknown" generic type, which looks like this:
Foo<?> x;
Is there an equivalent construct to this question-mark, in C#?
| Yes, in C#, you can use the `object` type to represent a variable of an unknown type, but if you want to work with generics more effectively, you can use covariance and contravariance with generic type parameters.
In C#, you can define a generic type or method with a type parameter that can accept any type using the `... | 13,072 | [
{
"from": "human",
"value": "In Java, one can declare a variable parameterised by an \"unknown\" generic type, which looks like this:\nFoo<?> x;\n\nIs there an equivalent construct to this question-mark, in C#?\n"
},
{
"from": "gpt",
"value": "Yes, in C#, you can use the `object` type to represe... |
What is a tool or technique that can be used to perform spell checks upon a whole source code base and its associated resource files?
The spell check should be source code aware meaning that it would stick to checking string literals in the code and not the code itself. Bonus points if the spell checker understands co... | For spell-checking across a whole source code base while being aware of source code structures, there are a few tools and techniques you can use. Here are some options, including those that can handle various resource file formats and XML schemas:
### 1. **Spell Checking Tools**
- **CSpell**: CSpell is a spell checke... | 9,039 | [
{
"from": "human",
"value": "What is a tool or technique that can be used to perform spell checks upon a whole source code base and its associated resource files?\nThe spell check should be source code aware meaning that it would stick to checking string literals in the code and not the code itself. Bonus ... |
Not for the first time, I've accidentally done "svn switch" from somewhere below the root of my project. This switches that subdirectory only, but how do I undo this?
If I try switching the subdirectory back to the original branch I get:
"svn: Directory 'subdir\_svn' containing working copy admin area is missing"
Upda... | If you've switched a subdirectory to a different branch or URL with SVN, and you want to revert it back to the original branch while preserving your local changes, you can follow these steps:
1. **Identify the original URL**: You need to know the original repository URL (branch or trunk) that the subdirectory was swit... | 9,895 | [
{
"from": "human",
"value": "Not for the first time, I've accidentally done \"svn switch\" from somewhere below the root of my project. This switches that subdirectory only, but how do I undo this?\nIf I try switching the subdirectory back to the original branch I get:\n\"svn: Directory 'subdir\\_svn' conta... |
I think I know how to handle this case, but I just want to make sure I have it right. Say you have the following C code:
int myInt = 3;
int* myPointer = &myInt;
int** mySecondPointer = &myPointer;
P contains an address that points to a place in memory which has another address. I'd like to modify the second address.... | Let's break down your C code and the corresponding MIPS code to understand if the approach you're taking to modify the address is correct.
### C Code Analysis
Your C code defines:
```c
int myInt = 3;
int* myPointer = &myInt; // myPointer holds the address of myInt
int** mySecondPointer = &myPointer; // mySecondPointer... | 11,759 | [
{
"from": "human",
"value": "I think I know how to handle this case, but I just want to make sure I have it right. Say you have the following C code:\nint myInt = 3;\nint* myPointer = &myInt;\nint** mySecondPointer = &myPointer;\n\nP contains an address that points to a place in memory which has another ad... |
I am working with fixtures on rails and I want one of the fixture fields to be blank.
Example:
two:
name: test
path: - I want this blank but not to act as a group heading.
test: 4
But, I do not know how to leave path: blank without it acting as a group title. Does anybody know how to do that?
| In Rails fixtures, when you want to leave a field blank, you can simply use `null` or an empty string, depending on the database and how your models are set up.
If you want the `path` field to be blank for your fixture without it acting as a group heading, you can do it in the following ways:
1. **Using an empty stri... | 13,933 | [
{
"from": "human",
"value": "I am working with fixtures on rails and I want one of the fixture fields to be blank.\nExample:\ntwo:\nname: test\npath: - I want this blank but not to act as a group heading.\ntest: 4\n\nBut, I do not know how to leave path: blank without it acting as a group title. Does anybo... |
Basically, we have a rule setup to run a script when a code word is detected in the body of an incoming message. The script will append the current subject header with a word in front. For example, Before: "Test Message", After: "Dept - Test Message". Any ideas?
| Certainly! You can accomplish this by setting up a script that triggers when the specific code word is detected in the body of the incoming message. Here’s a general outline of how you might implement this, depending on the email system you are using. The code below is an example for a general scripting approach (pseud... | 9,075 | [
{
"from": "human",
"value": "Basically, we have a rule setup to run a script when a code word is detected in the body of an incoming message. The script will append the current subject header with a word in front. For example, Before: \"Test Message\", After: \"Dept - Test Message\". Any ideas?\n"
},
{
... |
I am using Oracle SQL (in SQLDeveloper, so I don't have access to SQLPLUS commands such as COLUMN) to execute a query that looks something like this:
select assigner_staff_id as staff_id, active_flag, assign_date,
complete_date, mod_date
from work where assigner_staff_id = '2096';
The results it give me look somethi... | In Oracle SQL, particularly when using SQL Developer, you don't have the same formatting options available in SQL*Plus. However, you can achieve a more compact output by using the `RTRIM` function to remove trailing spaces and, if necessary, formatting the date columns using `TO_CHAR`. Here's how you can modify your qu... | 12,169 | [
{
"from": "human",
"value": "I am using Oracle SQL (in SQLDeveloper, so I don't have access to SQLPLUS commands such as COLUMN) to execute a query that looks something like this:\nselect assigner_staff_id as staff_id, active_flag, assign_date,\n complete_date, mod_date\nfrom work where assigner_staff_id = ... |
Version Control with Subversion recommends the following layout for (single-project) repositories (complemented by this question):
/trunk
/tags
/rel.1 (approximately)
...
/branches
/rel1fixes
What are the relative merits of this arrangement when compared with a (perhaps) more process-oriented one?:
/development
... | When considering repository layout in Subversion (SVN) for single-project deployments, the choice between the traditional layout (/trunk, /tags, /branches) and a more process-oriented layout (/development, /qa, /production, /vendor) can significantly affect workflow, collaboration, and management. Here are the relative... | 9,748 | [
{
"from": "human",
"value": "Version Control with Subversion recommends the following layout for (single-project) repositories (complemented by this question):\n/trunk\n/tags\n /rel.1 (approximately)\n ...\n/branches\n /rel1fixes\n\nWhat are the relative merits of this arrangement when compared with a (p... |
We need a good CMS that supports data clustering (managing and storing data on different servers). By "good" , I mean : reliable , minimum bugs , the faster the better. (Oh , and it should make coffee :) )
| Choosing a content management system (CMS) that supports data clustering, reliability, and performance can be a bit challenging, especially with the added whimsical request for it to make coffee! While no CMS can literally make coffee, I can suggest some solid options that fit your criteria:
### 1. **WordPress with Mu... | 8,302 | [
{
"from": "human",
"value": "We need a good CMS that supports data clustering (managing and storing data on different servers). By \"good\" , I mean : reliable , minimum bugs , the faster the better. (Oh , and it should make coffee :) ) \n"
},
{
"from": "gpt",
"value": "Choosing a content manage... |
This question is based on another question of mine(thankfully answered).
So if in a model I have this:
def self.find_extended
person = Person.find(:first)
complete_name = person.firstname + ', ' + person.lastname
return person
end
How can I inject complete name in the person object so in my controller/view... | To inject the `complete_name` into the `person` object so that you can access it using `person.complete_name`, you can define a method in the `Person` model that returns the complete name. Alternatively, you can define a custom attribute using `attr_accessor`.
Here are both approaches:
### Option 1: Define a Method ... | 13,919 | [
{
"from": "human",
"value": "This question is based on another question of mine(thankfully answered).\nSo if in a model I have this:\ndef self.find_extended\n person = Person.find(:first)\n complete_name = person.firstname + ', ' + person.lastname\n return person\nend\n\nHow can I inject complete n... |
I have a public property set in my form of type ListE<T> where:
public class ListE<T> : IList<T>, ICollection<T>, IEnumerable<T>, IList, ICollection, IEnumerable
Yeah, it's a mouthful, but that's what the Designer requires for it to show up as an editable collection in the Properties window. Which it does! So, I click... | It sounds like you're encountering an issue with the designer trying to serialize or manipulate your custom collection (`ListE<T>`) within the Properties window, leading to an overflow exception. This can often happen due to specific implementation details that the designer might not handle gracefully.
Here are a few ... | 8,442 | [
{
"from": "human",
"value": "I have a public property set in my form of type ListE<T> where:\npublic class ListE<T> : IList<T>, ICollection<T>, IEnumerable<T>, IList, ICollection, IEnumerable\n\nYeah, it's a mouthful, but that's what the Designer requires for it to show up as an editable collection in the P... |
Let's say I have two models, Classes and People. A Class might have one or two People as instructors, and twenty people as students. So, I need to have multiple relationships between the models -- one where it's 1->M for instructors, and one where it's 1->M for students.
Edit: Instructors and Students must be the same;... | To model the scenario where you have classes with both instructors and students (who can also interchangeably serve as both), you can use a relational database approach that involves a `Classes`, `People`, and a joining table (often called a junction table or associative entity) to represent the relationship between cl... | 9,253 | [
{
"from": "human",
"value": "Let's say I have two models, Classes and People. A Class might have one or two People as instructors, and twenty people as students. So, I need to have multiple relationships between the models -- one where it's 1->M for instructors, and one where it's 1->M for students.\nEdit: ... |
What should I type on the Mac OS X terminal to run a script as root?
| To run a script as root in macOS, you typically use the `sudo` command. Here's how to do it:
1. Open the Terminal application.
2. Type the following command, replacing `path/to/your/script.sh` with the actual path to your script:
```bash
sudo bash path/to/your/script.sh
```
3. You may be prompted to enter y... | 14,196 | [
{
"from": "human",
"value": "What should I type on the Mac OS X terminal to run a script as root?\n"
},
{
"from": "gpt",
"value": "To run a script as root in macOS, you typically use the `sudo` command. Here's how to do it:\n\n1. Open the Terminal application.\n2. Type the following command, rep... |
i have a page for a small mobile site that has an image that has its src value set via a getImage.aspx method, wherein an image is dynamically built and returned to the image tag. Most of the time it works great. However, there are moments where the image just doesnt load on the first shot. Hitting refresh helps most o... | There are several potential reasons why the image generated by your `getImage.aspx` method sometimes fails to load. Here are some suggestions to help you troubleshoot and improve the reliability of the image loading:
### 1. Caching Issues
Browsers may cache the images, causing them to sometimes not load properly. To e... | 10,303 | [
{
"from": "human",
"value": "i have a page for a small mobile site that has an image that has its src value set via a getImage.aspx method, wherein an image is dynamically built and returned to the image tag. Most of the time it works great. However, there are moments where the image just doesnt load on the... |
I am looking for a solution to export Shared Outlook Calendars (yes, I'm using exchange server and yes I can copy calendar to my local folders, which would allow me to export. However, what if there are more than 50 calendars, which I need to export? Is there a way of automating the process?).
I am interested in using... | Exporting shared Outlook calendars in bulk can indeed be a challenge, especially when dealing with multiple calendars. However, using C# along with the Microsoft Outlook Interop library or the EWS Managed API (Exchange Web Services) can facilitate the process. Below are the steps and a sample code to automate the expor... | 7,147 | [
{
"from": "human",
"value": "I am looking for a solution to export Shared Outlook Calendars (yes, I'm using exchange server and yes I can copy calendar to my local folders, which would allow me to export. However, what if there are more than 50 calendars, which I need to export? Is there a way of automating... |
I'm creating a simple form for a site I manage. I use jQuery for my JavaScript. I noticed a large amount of plugins for jQuery and forms. Does anybody have any favorites that they find especially useful? In particular, plugins to help with validation would be the most useful.
| There are several great jQuery plugins available for form validation and related functionalities. Here are some popular ones that you may find useful:
1. **jQuery Validation Plugin**:
- This is one of the most widely used plugins for form validation. It provides an easy way to apply validation rules to your forms a... | 8,469 | [
{
"from": "human",
"value": "I'm creating a simple form for a site I manage. I use jQuery for my JavaScript. I noticed a large amount of plugins for jQuery and forms. Does anybody have any favorites that they find especially useful? In particular, plugins to help with validation would be the most useful.... |
I'm using code that I found on the CodeProject.com for a low-level keyboard hook. The only problem is it uses external DLL calls that don't work in mono. I was wondering if anyone knew of a way to accomplish the same thing as that code, but will run in both Windows using .net, and Linux using mono?
Edit: Clarifying ... | To create a cross-platform application that captures global keyboard shortcuts in both Windows and Linux, you typically need to handle input events in a way that is compatible with both operating systems. Unfortunately, using low-level keyboard hooks relies on platform-specific APIs (such as `SetWindowsHookEx` in Windo... | 11,240 | [
{
"from": "human",
"value": "I'm using code that I found on the CodeProject.com for a low-level keyboard hook. The only problem is it uses external DLL calls that don't work in mono. I was wondering if anyone knew of a way to accomplish the same thing as that code, but will run in both Windows using .net,... |
If you've worked on a project that stores data for use with the semantic web, do you use RDF or even OWL as the internal data format or do you have your own data model/ontology that you map to RDF for interoperability?
If you use RDF, what are your experiences with implementing various things like cyclical class hiera... | When working on projects that store data for the Semantic Web, the choice between using RDF/OWL or a custom data model often depends on several factors, including project requirements, interoperability needs, and the complexity of the data being modeled.
### Using RDF/OWL
1. **Internal Data Format**: Many projects op... | 11,700 | [
{
"from": "human",
"value": "If you've worked on a project that stores data for use with the semantic web, do you use RDF or even OWL as the internal data format or do you have your own data model/ontology that you map to RDF for interoperability? \nIf you use RDF, what are your experiences with implementin... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.