instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
I did select the executable correctly, because I can get it to respond to certain things I do. But I can't get ApplicationVerifier to properly detect a handle leak.
Here is an example:
int APIENTRY _tWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
... | Application Verifier is a tool designed to help detect various types of errors, including memory leaks, handle leaks, and other potential issues in applications. However, it may not catch every kind of leak automatically, especially in simple scenarios. In your case, the handle leak occurs when you create a file handle... | 48,707 | [
{
"from": "human",
"value": "I did select the executable correctly, because I can get it to respond to certain things I do. But I can't get ApplicationVerifier to properly detect a handle leak.\nHere is an example:\nint APIENTRY _tWinMain(HINSTANCE hInstance,\n HINSTANCE hPrevInstance,\... |
I have a database table (named Topics) which includes these fields :
topicId
name
parentId
and by using them I wanna populate a TreeView in c#. How can I do that ?
Thanks in advance...
| To populate a TreeView in C# using a database table that has hierarchical data (like your `Topics` table with `topicId`, `name`, and `parentId` fields), you can follow these steps:
1. **Fetch Data from the Database**: You first need to retrieve all records from your `Topics` table.
2. **Build a Hierarchical Structure... | 46,385 | [
{
"from": "human",
"value": "I have a database table (named Topics) which includes these fields :\n\ntopicId \nname\nparentId\n\nand by using them I wanna populate a TreeView in c#. How can I do that ?\nThanks in advance...\n"
},
{
"from": "gpt",
"value": "To populate a TreeView in C# using a da... |
How do I create an asp:Menu that has a horizontal submenu rather then a vertical one while keeping the top menu horizontal?
| To create an `asp:Menu` control that has a horizontal submenu while keeping the top menu horizontal in an ASP.NET Web Forms application, you can use a combination of CSS and the properties of the `asp:Menu` control. Below is a guide on how to achieve this.
### Step 1: Define the `asp:Menu` Control
Here’s an example o... | 48,687 | [
{
"from": "human",
"value": "How do I create an asp:Menu that has a horizontal submenu rather then a vertical one while keeping the top menu horizontal?\n"
},
{
"from": "gpt",
"value": "To create an `asp:Menu` control that has a horizontal submenu while keeping the top menu horizontal in an ASP.... |
We have a Ruby on Rails app that uses some javascript in the views. Since we have good test coverage on the rest of the app, we want to continue that here. The js we use manipulates the DOM to show/hide divs and perform incremental searching for a combobox selecting from a table.
Does anyone know of ways to test DOM ... | Testing DOM manipulation in a Ruby on Rails application that uses JavaScript can be accomplished through several approaches. Here are some common methods and tools you can use to test the JavaScript code that manipulates the DOM:
### 1. **Integration Testing with Capybara**
Capybara is a popular library in Rails for ... | 42,743 | [
{
"from": "human",
"value": "We have a Ruby on Rails app that uses some javascript in the views. Since we have good test coverage on the rest of the app, we want to continue that here. The js we use manipulates the DOM to show/hide divs and perform incremental searching for a combobox selecting from a tab... |
Long time listener, first time caller.
I'm a full time SE during the day and a full time data mining student at night. I've taken the courses, and heard what our professors think. Now, I come to you - the stackoverflowers, to bring out the real truth.
What is your favorite data mining algorithm and why? Are there an... | Welcome, and it's great to have you join the discussion! As a full-time software engineer and data mining student, you have a unique perspective that can contribute to this topic. Here are some popular data mining algorithms and techniques, along with insights on why you might favor them:
### Favorite Data Mining Algo... | 48,742 | [
{
"from": "human",
"value": "Long time listener, first time caller.\nI'm a full time SE during the day and a full time data mining student at night. I've taken the courses, and heard what our professors think. Now, I come to you - the stackoverflowers, to bring out the real truth.\nWhat is your favorite d... |
Is there an easy way to run a MySQL query from the Linux command line and output the results in CSV format?
Here's what I'm doing now:
mysql -u uid -ppwd -D dbname << EOQ | sed -e 's/ /,/g' | tee list.csv
select id, concat("\"",name,"\"") as name
from students
EOQ
It gets messy when there are a lot of columns t... | Yes, there is a more straightforward way to run a MySQL query from the Linux command line and output the results in CSV format without the need for additional text processing. You can use the `--batch` or `-B` option along with the `--execute` flag to directly format the output as CSV.
Here's a simplified command you ... | 47,892 | [
{
"from": "human",
"value": "Is there an easy way to run a MySQL query from the Linux command line and output the results in CSV format?\nHere's what I'm doing now:\nmysql -u uid -ppwd -D dbname << EOQ | sed -e 's/ /,/g' | tee list.csv\nselect id, concat(\"\\\"\",name,\"\\\"\") as name\nfrom students... |
could you please point c++ code example to display videos and images thumbnails in listview?
| Certainly! Below is a simple example of how you can use C++ with the Windows API to create a basic application that displays videos and image thumbnails in a `ListView`. For this example, I'll make use of the `CommCtrl` library for the ListView control and `GDI+` for handling images.
Make sure you have the required li... | 40,037 | [
{
"from": "human",
"value": "could you please point c++ code example to display videos and images thumbnails in listview?\n"
},
{
"from": "gpt",
"value": "Certainly! Below is a simple example of how you can use C++ with the Windows API to create a basic application that displays videos and image... |
EDIT:
I'm told that making you guys read means I get less attention. My apologies. Here's a simpler version:
Bill got $100 dollars worth of items from a store.
He wants to return enough of the items to get exactly $30 dollars back.
The store has a Point of Return system that will help him do this.
Here is the data afte... | Generating every possible combination of items from a list and calculating their total prices to find a specific amount (in this case, $30) can be approached in several ways, but doing this purely with SQL, especially with `GROUP BY`, can be quite complex since SQL is not inherently designed for combinatorial problems.... | 49,968 | [
{
"from": "human",
"value": "EDIT:\nI'm told that making you guys read means I get less attention. My apologies. Here's a simpler version:\nBill got $100 dollars worth of items from a store.\nHe wants to return enough of the items to get exactly $30 dollars back.\nThe store has a Point of Return system that... |
I'd like to display splash screen while the application is loading. However some 3rd party components block main thread during initilization for several seconds, which causes all forms not to update. Is it possible to have splash screen with own thread so it would update also when main thread is busy?
The application i... | In Delphi 2007, to show a splash screen while your application is loading, even when the main thread is busy, you can achieve this by running the splash screen in a separate thread. Below are steps and a sample implementation for you to follow:
1. **Create a new form for the splash screen.** This form should be simple... | 49,270 | [
{
"from": "human",
"value": "I'd like to display splash screen while the application is loading. However some 3rd party components block main thread during initilization for several seconds, which causes all forms not to update. Is it possible to have splash screen with own thread so it would update also wh... |
I want to union, merge in a List that contains both references, so this is my code, how can I define a list ready for this porpouses?
if (e.CommandName == "AddtoSelected")
{
List<DetalleCita> lstAux = new List<DetalleCita>();
foreach (GridViewRow row in this.dgvEstudios.Rows)
{
var GridData = GetVal... | To prepare a list that can be used for both union and merge operations in your code, you'll need to ensure that you are working with the correct data types and that you manage how you add items to your list properly.
In your current code snippet, it seems you want to merge the items in `AftList2` into `lstAux`. The wa... | 47,444 | [
{
"from": "human",
"value": "I want to union, merge in a List that contains both references, so this is my code, how can I define a list ready for this porpouses?\nif (e.CommandName == \"AddtoSelected\")\n{\n List<DetalleCita> lstAux = new List<DetalleCita>();\n foreach (GridViewRow row in this.dgvEst... |
I have a project in which I want to be able to call wp_list_pages() on a page that also uses the Zend Framework to power some complex interfaces manages custom data outside of wordpress.
This page should also redirect the user to the wordpress login screen if they're not already logged in with the appropriate level of ... | Integrating a custom Zend Framework interface within a WordPress environment while maintaining WordPress functionality (like `wp_list_pages()`) and enforcing login requirements can be approached in a systematic way. Here’s a high-level outline of how you can achieve this:
### Step 1: Set Up a Custom Page Template in W... | 48,931 | [
{
"from": "human",
"value": "I have a project in which I want to be able to call wp_list_pages() on a page that also uses the Zend Framework to power some complex interfaces manages custom data outside of wordpress.\nThis page should also redirect the user to the wordpress login screen if they're not alread... |
I have an SSIS package that executes several tasks. I manually added an event handler inside Business Intelligence Studio 2005 at the package level for the OnExecStatusChanged event.
My question is, how can I add a handler for this event inside C#? I have loaded the package as pointed here and I also created a custom c... | In SSIS (SQL Server Integration Services), event handlers can be defined for various events in the package. In your scenario, you want to listen for the `OnExecStatusChanged` event in your custom C# application. While you have successfully loaded the SSIS package and created a class that inherits from `DefaultEvents`, ... | 49,712 | [
{
"from": "human",
"value": "I have an SSIS package that executes several tasks. I manually added an event handler inside Business Intelligence Studio 2005 at the package level for the OnExecStatusChanged event.\nMy question is, how can I add a handler for this event inside C#? I have loaded the package as ... |
Similar to the XP login screen, in Flex 3, how can I display a warning to the user in a textbox that the CAPS LOCK key is enabled?
| To display a warning message when the CAPS LOCK key is enabled in a Flex 3 application, you will need to detect the state of the CAPS LOCK key and update a TextBox accordingly. Below is a basic implementation of how you might do this:
1. **Detecting CAPS LOCK State**: Flex does not provide a direct way to check the st... | 49,335 | [
{
"from": "human",
"value": "Similar to the XP login screen, in Flex 3, how can I display a warning to the user in a textbox that the CAPS LOCK key is enabled?\n"
},
{
"from": "gpt",
"value": "To display a warning message when the CAPS LOCK key is enabled in a Flex 3 application, you will need t... |
I am looking the fastest way to draw thousands of individually calculated pixels directly to the screen in an iPhone application that preforms extremely well.
| Drawing thousands of individually calculated pixels directly to the screen in an iPhone application requires careful consideration of performance to achieve high frame rates. Here are several strategies to optimize this process:
### 1. **Use Metal or OpenGL ES:**
- **Metal:** This is Apple's modern graphics API, op... | 49,708 | [
{
"from": "human",
"value": "I am looking the fastest way to draw thousands of individually calculated pixels directly to the screen in an iPhone application that preforms extremely well.\n"
},
{
"from": "gpt",
"value": "Drawing thousands of individually calculated pixels directly to the screen ... |
When reading from a IO::Socket::INET filehandle it can not be assumed that there will always be data available on the stream. What techniques are available to either peek at the stream to check if data is available or when doing the read take no data without a valid line termination and immediately pass through the rea... | When working with `IO::Socket::INET` in Perl, it is indeed important to handle cases where data may not always be available. Here are some techniques you can use to handle reading from the socket without blocking and to ensure you don't hang on reading when data isn't present or when you don't have a complete line:
##... | 40,758 | [
{
"from": "human",
"value": "When reading from a IO::Socket::INET filehandle it can not be assumed that there will always be data available on the stream. What techniques are available to either peek at the stream to check if data is available or when doing the read take no data without a valid line termina... |
This is my dilema:
My web site done in asp.net 3.5. I have buttons which if the user clicks should show images. The images are located at a third party and accessible via web url. So my app has to login to this third party app and they will return a url to me which i should then do a response.redirect in my website and... | Your scenario requires you to handle authentication with a third-party service, retrieve a URL for images, and then display those images to the user in your ASP.NET application. The challenge here is primarily about managing the HTTP requests and ensuring the user stays authenticated. Here's a structured approach you m... | 46,961 | [
{
"from": "human",
"value": "This is my dilema:\nMy web site done in asp.net 3.5. I have buttons which if the user clicks should show images. The images are located at a third party and accessible via web url. So my app has to login to this third party app and they will return a url to me which i should the... |
I'd like to hear some opinions as to what role, if any, parallel computing approaches, including the potential use of the parallel extensions (June CTP for example), have a in web applications. What scenarios does this approach fit and/or not fit for?
My understanding of how exactly IIS and web browsers thread tasks... | Parallel computing approaches and asynchronous programming can play a significant role in enhancing the performance and responsiveness of web applications, particularly in certain scenarios. Below is an overview of how these approaches fit into web applications, including their strengths, limitations, and how they inte... | 49,381 | [
{
"from": "human",
"value": "I'd like to hear some opinions as to what role, if any, parallel computing approaches, including the potential use of the parallel extensions (June CTP for example), have a in web applications. What scenarios does this approach fit and/or not fit for? \nMy understanding of how... |
Should the model just be data structures? Where do the services (data access, business logic) sit in MVC?
Lets assume I have a view that shows a list of customer orders. I have a controller class that handles the clicks on the view controls (buttons, etc).
Should the controller kick off the data access code? Think bu... | In the MVC (Model-View-Controller) architectural pattern, the structure is designed to separate concerns and improve maintainability and testability of your application. Let's break down how data access and business logic fit into the MVC paradigm and then provide some example code.
### MVC Structure
- **Model**: Rep... | 45,789 | [
{
"from": "human",
"value": "Should the model just be data structures? Where do the services (data access, business logic) sit in MVC?\nLets assume I have a view that shows a list of customer orders. I have a controller class that handles the clicks on the view controls (buttons, etc).\nShould the control... |
Let's say I need to implement domain model for StackOverflow.
If I am doing ORM, how can I define (and map) property for fetching "last comments" and other "last" things?
It looks to me like this should be reflected in the domain model.
Sometimes I might need "all comments" though...
| When implementing a domain model for StackOverflow or similar applications, it's important to balance performance, simplicity, and maintainability. In the context of Object-Relational Mapping (ORM), you can achieve this by modeling your entities thoughtfully, using relationships, and leveraging query capabilities provi... | 39,880 | [
{
"from": "human",
"value": "Let's say I need to implement domain model for StackOverflow. \nIf I am doing ORM, how can I define (and map) property for fetching \"last comments\" and other \"last\" things?\nIt looks to me like this should be reflected in the domain model.\nSometimes I might need \"all comme... |
For example I can point the url '^/accounts/password/reset/$' to django.contrib.auth.views.password_reset with my template filename in the context but I think need to send more context details.
I need to know exactly what context to add for each of the password reset and change views.
| When using Django's built-in authentication views for password reset and password change, you can add additional context to the templates by subclassing the views and overriding the `get_context_data` method. Below are details for both the password reset and password change views, including the default context data and... | 49,406 | [
{
"from": "human",
"value": "For example I can point the url '^/accounts/password/reset/$' to django.contrib.auth.views.password_reset with my template filename in the context but I think need to send more context details.\nI need to know exactly what context to add for each of the password reset and chang... |
In a web application, is there a widely accepted way for handling locked files?
For example, a user has write access to a file so what would be the best way to let all other users access the file but with read only rights only.
Furthermore, if that user closes the file and all handles/resources are then disposed of, ho... | Handling locked files in a web application requires careful design to manage concurrent access and ensure proper file permissions. Here’s a structured approach to addressing your requirements:
### 1. File Locking Mechanism
To manage access to a file, you can implement a locking mechanism. This can be done using a comb... | 47,833 | [
{
"from": "human",
"value": "In a web application, is there a widely accepted way for handling locked files?\nFor example, a user has write access to a file so what would be the best way to let all other users access the file but with read only rights only.\nFurthermore, if that user closes the file and all... |
I want to convert strings to bit-fields.Also,convert them to binary and then use.
Need help with this..help me ..
| To convert strings to bit-fields and then represent them in binary, you can follow these steps in Python:
1. **Convert a string to its ASCII values**.
2. **Convert the ASCII values to binary**.
3. **Represent the binary as a bit-field**.
### Example Code
Here is a Python function that takes a string, converts each c... | 48,513 | [
{
"from": "human",
"value": "I want to convert strings to bit-fields.Also,convert them to binary and then use.\nNeed help with this..help me ..\n"
},
{
"from": "gpt",
"value": "To convert strings to bit-fields and then represent them in binary, you can follow these steps in Python:\n\n1. **Conve... |
I am trying to get the size of an array populated by stdin:
char *myArray;
cin >> myArray
cout << sizeof(myArray);
This returns 4 when I enter a string greater with a length greater than 4 e.g. "40905898"
Where am i going wrong?
| The issue you're experiencing is due to how you are handling the array and memory in C++. When you declare `char *myArray;`, you are only creating a pointer to a character; this pointer does not point to a valid allocated memory location. Consequently, `cin >> myArray;` is attempting to read input into an uninitialized... | 49,020 | [
{
"from": "human",
"value": "I am trying to get the size of an array populated by stdin:\nchar *myArray;\ncin >> myArray\ncout << sizeof(myArray);\n\nThis returns 4 when I enter a string greater with a length greater than 4 e.g. \"40905898\"\nWhere am i going wrong?\n"
},
{
"from": "gpt",
"value... |
I need your expertise once again. I have a java class that searches a directory for xml files (displays the files it finds in the eclipse console window), applies the specified xslt to these and sends the output to a directory.
What I want to do now is create an xml containing the file names and file format types. The ... | To achieve your requirement of creating an XML file containing the filenames and file type of each XML file processed, you will need to make some modifications to your existing Java class. Here’s a basic approach to guide you through the process:
1. **Search for XML Files**: Assuming you already have code that searche... | 47,209 | [
{
"from": "human",
"value": "I need your expertise once again. I have a java class that searches a directory for xml files (displays the files it finds in the eclipse console window), applies the specified xslt to these and sends the output to a directory.\nWhat I want to do now is create an xml containing ... |
I've got a potentially rather large list of objects I'd like to bind to a ListBox in WPF. However, I'd like to have the List load itself incrementally. How can I bind a ListBox to an IEnumerable that loads itself on-demand in such a way that the listbox only tries to enumerate as much as it needs for the display?
| To achieve incremental loading of a `ListBox` in WPF by binding it to an `IEnumerable`, you can implement a virtualized list that loads data on demand as the user scrolls through the list. This can be accomplished using a combination of `VirtualizingPanel`, an `IEnumerable` implementation that supports pagination or lo... | 46,989 | [
{
"from": "human",
"value": "I've got a potentially rather large list of objects I'd like to bind to a ListBox in WPF. However, I'd like to have the List load itself incrementally. How can I bind a ListBox to an IEnumerable that loads itself on-demand in such a way that the listbox only tries to enumerat... |
I have a database table called "Posts" which stores all the information regarding an article submission on a website. There is a column named "Views" which is a value that gets incremented each time that particular post gets viewed.
The process is this:
Get the record from the database
Increment the current by one
S... | Your concern about handling simultaneous updates to the `Views` count in the `Posts` table is valid. This scenario is known as a "race condition", where multiple operations occur concurrently, potentially leading to incorrect or lost updates. There are a few approaches you can take to ensure that updates to the view co... | 47,607 | [
{
"from": "human",
"value": "I have a database table called \"Posts\" which stores all the information regarding an article submission on a website. There is a column named \"Views\" which is a value that gets incremented each time that particular post gets viewed. \nThe process is this:\n\nGet the record f... |
I've got two sizing issue regarding a Window I've got. The basic layout is like this
<Window MaxHeight="{DynamicResource {x:Static SystemParameters.VirtualScreenHeight}}"
MaxWidth="{DynamicResource {x:Static SystemParameters.VirtualScreenWidth}}"
>
<StackPanel>
<DockPanel LastChildFill="Fa... | To address your sizing issues in the WPF Window, we can implement a few adjustments to ensure that the Window does not get smaller than the DockPanel's width and that the ScrollViewer is restricted to the Window's dimensions.
### 1. Preventing the Window from getting smaller than the DockPanel's width
To ensure that... | 49,925 | [
{
"from": "human",
"value": "I've got two sizing issue regarding a Window I've got. The basic layout is like this\n<Window MaxHeight=\"{DynamicResource {x:Static SystemParameters.VirtualScreenHeight}}\"\n MaxWidth=\"{DynamicResource {x:Static SystemParameters.VirtualScreenWidth}}\" \n >\n ... |
I am rendering an OpenGL scene that include some bitmap text. It is my understanding the order I draw things in will determine which items are on top.
However, my bitmap text, even though I draw it last, is not on top!
For instance, I am drawing:
1) Background
2) Buttons
3) Text
All at the same z depth. Buttons are a... | When rendering in OpenGL, the issue you are experiencing with the bitmap text not being visible despite being drawn last may be due to the depth buffer (z-buffer) settings. If the text is drawn at the same z-depth as other objects, and the depth test is enabled, the depth buffer will prevent the text from being rendere... | 48,161 | [
{
"from": "human",
"value": "I am rendering an OpenGL scene that include some bitmap text. It is my understanding the order I draw things in will determine which items are on top.\nHowever, my bitmap text, even though I draw it last, is not on top!\nFor instance, I am drawing:\n1) Background\n2) Buttons\n3... |
I have been writting a keyword search script based on this tutorial:
http://www.hackosis.com/2007/11/06/howto-simple-search-engine-with-php-and-mysql/
Like some of the commenters mentioned, the script only ends up returning results based on the last word in the search terms. So I have also tried to implement one of the... | It looks like you are experiencing issues with the SQL query logic in your keyword search script. From your description and the provided queries, it seems that the logical operators in your SQL queries are not properly grouped, which is causing the search results to not work as intended.
When using a combination of `A... | 49,522 | [
{
"from": "human",
"value": "I have been writting a keyword search script based on this tutorial:\nhttp://www.hackosis.com/2007/11/06/howto-simple-search-engine-with-php-and-mysql/\nLike some of the commenters mentioned, the script only ends up returning results based on the last word in the search terms. S... |
I want to copy a file to a FTP server using wxFTP, but I would like to do this without blocking the UI, and much better, while displaying a progress bar. Can I do this without extra thread?
I'm using wxLua, but I can adapt a solution written in any language as long as it uses a wxWidgets binding.
| Yes, you can achieve this by using asynchronous operations that do not block the UI in your wxLua application. wxWidgets (and thus wxLua) provides facilities to perform long-running tasks like FTP transfers in a non-blocking way. One common approach is to use `wxTimer` to periodically check the status of the FTP transf... | 48,380 | [
{
"from": "human",
"value": "I want to copy a file to a FTP server using wxFTP, but I would like to do this without blocking the UI, and much better, while displaying a progress bar. Can I do this without extra thread?\nI'm using wxLua, but I can adapt a solution written in any language as long as it uses a... |
I find that Resolution Randomizer (http://resolutionrandomizer.pop.us/ecard.aspx) is quite interesting. It has a rolling effect when you click the "Randomize" button.
I'm really new to Silverlight and I wonder how it is implemented. I'd like to add some similar effect to my project. Anyone has some scripts I can refer... | Creating a rolling effect similar to what you see in Resolution Randomizer using Silverlight involves animations and randomization of values. Below, I'll provide a basic example of how to create a simple rolling effect when you click a button in Silverlight.
### Step-by-step Implementation:
1. **Create a Silverlight ... | 49,919 | [
{
"from": "human",
"value": "I find that Resolution Randomizer (http://resolutionrandomizer.pop.us/ecard.aspx) is quite interesting. It has a rolling effect when you click the \"Randomize\" button. \nI'm really new to Silverlight and I wonder how it is implemented. I'd like to add some similar effect to my ... |
Is it possible to write connect and open a SQL Compact 3.5 database from within MS Access 2003? I want to be able to use MS Access 2003 to manipulate data in a SQL Compact 3.5 database. If it is possible, then what statements would be used to open the database?
| Access 2003 does not natively support SQL Server Compact Edition (SQL CE) databases, including SQL Compact 3.5. However, it is possible to connect to a SQL CE database using some workarounds, primarily through Visual Basic for Applications (VBA) code.
To connect to and manipulate a SQL Compact 3.5 database from MS Acc... | 49,496 | [
{
"from": "human",
"value": "Is it possible to write connect and open a SQL Compact 3.5 database from within MS Access 2003? I want to be able to use MS Access 2003 to manipulate data in a SQL Compact 3.5 database. If it is possible, then what statements would be used to open the database?\n"
},
{
... |
I need to use JavaScript in a form for mobile web application.
I need some information about it, related to browser compatibility as well as way to use JavaScript in mobile web applications (syntax).
| Using JavaScript in a mobile web application is essential for creating interactive and dynamic user experiences. Below, you'll find an overview of browser compatibility considerations and basic syntax for using JavaScript in your mobile web application.
### Browser Compatibility
1. **Mobile Browsers**: Most modern mo... | 49,886 | [
{
"from": "human",
"value": "I need to use JavaScript in a form for mobile web application.\nI need some information about it, related to browser compatibility as well as way to use JavaScript in mobile web applications (syntax).\n"
},
{
"from": "gpt",
"value": "Using JavaScript in a mobile web ... |
I'm currently building a Spring MVC application. I was looking to use JSP pages with tag libraries for handling the view layer and formatting of the HTML, but I've come across another group in my company that uses Velocity templates for the same purpose.
From what I can see, it seems to me as if there are a lot of simi... | Both JSP with JSTL (JavaServer Pages with JavaServer Pages Standard Tag Library) and Velocity (Apache Velocity) are popular choices for handling the view layer in Spring MVC applications, and both have their own strengths and weaknesses. Here’s a breakdown of the pros and cons for each approach to help guide your decis... | 47,752 | [
{
"from": "human",
"value": "I'm currently building a Spring MVC application. I was looking to use JSP pages with tag libraries for handling the view layer and formatting of the HTML, but I've come across another group in my company that uses Velocity templates for the same purpose.\nFrom what I can see, it... |
I want to create a report where my report's fields should change according to my input parameter values.
For example, if I select 2 months, there should be 2 fields in result, having month wise calculation. If I select 3 weeks, there should be 3 fields each for each weeks calculation instead of the 2 months field.
Ho... | Creating a dynamic report that adjusts its fields based on input parameter values can be achieved through several approaches, depending on the reporting tool or technology you are using. Here, I’ll outline a general approach that you can adapt according to your specific reporting tool, whether it's SQL-based reporting,... | 47,531 | [
{
"from": "human",
"value": "I want to create a report where my report's fields should change according to my input parameter values. \nFor example, if I select 2 months, there should be 2 fields in result, having month wise calculation. If I select 3 weeks, there should be 3 fields each for each weeks cal... |
Using the Java URL class, I can connect to an external HTTPS server (such as our production site), but using a local URL I get following exception.
"SunCertPathBuilderException: unable to find valid certification path to requested target".
How do I get a valid certification path?
EDIT: I'm not using this URL to dire... | The error `SunCertPathBuilderException: unable to find valid certification path to requested target` typically occurs when the Java application cannot establish a secure connection because it does not recognize the SSL certificate of the server you're trying to connect to. This is common with self-signed certificates o... | 46,829 | [
{
"from": "human",
"value": "Using the Java URL class, I can connect to an external HTTPS server (such as our production site), but using a local URL I get following exception. \n\"SunCertPathBuilderException: unable to find valid certification path to requested target\".\n\nHow do I get a valid certificat... |
We are using Maven for a large build process (> 100 modules). We have been storing our external dependencies in source control, and using that to update a local repo.
However, we are ready to graduate to a local repo that can cache central so that we don't have to proactively download all 3rd parties (but we can still ... | Choosing a repository manager like Nexus or Artifactory for your Maven builds involves evaluating a number of factors. Both Nexus Repository Manager (Nexus) and JFrog Artifactory are popular options, each with its own set of features and strengths. Here are some reasons to consider when deciding between the two, as wel... | 45,084 | [
{
"from": "human",
"value": "We are using Maven for a large build process (> 100 modules). We have been storing our external dependencies in source control, and using that to update a local repo.\nHowever, we are ready to graduate to a local repo that can cache central so that we don't have to proactively d... |
I this post, I've seen this:
class MonitorObjectString: public MonitorObject {
// some other declarations
friend inline bool operator==(/*const*/ MonitorObjectString& lhs,
/*const*/ MonitorObjectString& rhs)
{ return lhs.fVal==rhs.fVal; }
}
Before we can continue, THIS IS... | You're correct in observing that it is unusual to have non-const references as parameters in an equality operator (or comparison operators in general). Typically, comparison operators like `operator==` are expected to compare their arguments without modifying them. This is why they usually take their arguments as `cons... | 47,725 | [
{
"from": "human",
"value": "I this post, I've seen this:\nclass MonitorObjectString: public MonitorObject {\n // some other declarations\n friend inline bool operator==(/*const*/ MonitorObjectString& lhs,\n /*const*/ MonitorObjectString& rhs)\n { return lhs.fVal==r... |
I work on a W3C XML Schema (not written by me). One tool, xmllint,
refuses to use the schema:
traceroute.xsd:658: element element: Schemas parser error : Element
'{http://www.w3.org/2001/XMLSchema}element', attribute 'maxOccurs': The value
'4294967295' is not valid. Expected is '(xs:nonNegativeInteger | unbounded)'.
... | You raise an important point regarding the handling of the `maxOccurs` attribute in XML Schema, particularly concerning the limitations imposed by tools like `xmllint`.
1. **Understanding `maxOccurs`**:
- According to the XML Schema specification, `maxOccurs` can indeed take the value of `unbounded`, which means t... | 48,832 | [
{
"from": "human",
"value": "I work on a W3C XML Schema (not written by me). One tool, xmllint,\nrefuses to use the schema:\ntraceroute.xsd:658: element element: Schemas parser error : Element\n '{http://www.w3.org/2001/XMLSchema}element', attribute 'maxOccurs': The value\n '4294967295' is not valid. Expect... |
I enjoyed the answers and questions about hidden features in sql server
What can you tell us about Oracle?
Hidden tables, inner workings of ..., secret stored procs, package that has good utils...
| Oracle Database, much like SQL Server, has a variety of built-in features, utilities, and hidden aspects that can be quite useful but are not always well-documented. Below are some interesting aspects, hidden tables, packages, and utilities that you might find beneficial:
### Hidden Features and Tables
1. **V$ Views*... | 47,673 | [
{
"from": "human",
"value": "I enjoyed the answers and questions about hidden features in sql server \nWhat can you tell us about Oracle?\nHidden tables, inner workings of ..., secret stored procs, package that has good utils...\n"
},
{
"from": "gpt",
"value": "Oracle Database, much like SQL Ser... |
We are working on a Java EE Web Application, and the people from marketing need some really detailed stats for our site. Something similar to Google Analytics, gathering the user's information, and their navigation through the site (where they come from, what they click, where they go, etc.).
Depending on a third party... | For your Java EE web application, there are several options and libraries you can consider to build your own analytics solution similar to Google Analytics. Below are some recommendations that can help you gather user information and navigation statistics effectively:
### 1. **JavaScript Tracking Libraries**
You ca... | 42,666 | [
{
"from": "human",
"value": "We are working on a Java EE Web Application, and the people from marketing need some really detailed stats for our site. Something similar to Google Analytics, gathering the user's information, and their navigation through the site (where they come from, what they click, where t... |
Sorry for not so discrptive title, if someone wants to change it go ahead. Also note I have already asked a question about this kind of thing but this one is more about how you would attack it because my attack just doesn't seem to feel right.
I am having a problem with building a string up to send to an OLE object in... | It sounds like you're tackling a complex problem with building command strings for an OLE object in a way that maintains usability and extensibility. Let's explore a structured approach to address your challenge.
### 1. Define Command Structures
First, you can start by defining a clear structure for each command type... | 46,760 | [
{
"from": "human",
"value": "Sorry for not so discrptive title, if someone wants to change it go ahead. Also note I have already asked a question about this kind of thing but this one is more about how you would attack it because my attack just doesn't seem to feel right.\nI am having a problem with buildi... |
I have a MFC dialog with 32 CComboBoxes on it that all have the same data in the listbox. Its taking a while to come up, and it looks like part of the delay is the time I need to spend using InsertString() to add all the data to the 32 controls. How can I subclass CComboBox so that the 32 instances share the same dat... | To optimize the performance of your MFC dialog with multiple `CComboBox` controls that share the same data, you can subclass `CComboBox` to create a custom combo box that uses a shared list of strings. This way, you only need to populate the list once and reuse the data for all instances. Below is a step-by-step guide ... | 45,855 | [
{
"from": "human",
"value": "I have a MFC dialog with 32 CComboBoxes on it that all have the same data in the listbox. Its taking a while to come up, and it looks like part of the delay is the time I need to spend using InsertString() to add all the data to the 32 controls. How can I subclass CComboBox so... |
I'm trying to retrive a dataset to a Gridview, but I just don't get any row in my Gridview. What am I doing wrong?
the page code
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
CType(Master, AreaTrabalho).AlteraTitulo = "Projectos"
Using oSQL As New clsSQL(System.Co... | From your provided code, there are a few things you might want to check and adjust to ensure data is displayed correctly in your GridView. Below are some common reasons why data may not show up and how to address them:
### Common Issues and Fixes
1. **Data Binding:** You need to call the `DataBind()` method on the Gr... | 46,407 | [
{
"from": "human",
"value": "I'm trying to retrive a dataset to a Gridview, but I just don't get any row in my Gridview. What am I doing wrong?\nthe page code\nProtected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load\n CType(Master, AreaTrabalho).AlteraTitulo = \"Proje... |
I am sending the echo to mail function via PHP from variable that includes HTML code. The strange thing is, that this
<����}im�
shows up AFTER the string.. but I do not manipulate with it anymore. The charset of mail function (the attachment) is same as charset of HTML code.
| The issue you're experiencing with the unexpected characters appearing in the email could be due to a few potential causes. Here are some steps and tips to troubleshoot and resolve the issue:
### 1. Check for Unintentional Output
Ensure that your PHP script does not produce any unexpected output before you send the em... | 49,538 | [
{
"from": "human",
"value": "I am sending the echo to mail function via PHP from variable that includes HTML code. The strange thing is, that this \n<����}im�\n\nshows up AFTER the string.. but I do not manipulate with it anymore. The charset of mail function (the attachment) is same as charset of HTML code... |
In the footer of my page, I would like to add something like "last updated the xx/xx/200x" with this date being the last time a certain mySQL table has been updated.
What is the best way to do that? Is there a function to retrieve the last updated date? Should I access to the database every time I need this value?
| To display the last updated date of a MySQL table in the footer of your webpage, you have a few options. Here's a structured approach to achieve that:
### 1. Retrieve Last Updated Date from the MySQL Table
MySQL doesn't store the last updated timestamp automatically for tables unless you specifically create a column ... | 47,859 | [
{
"from": "human",
"value": "In the footer of my page, I would like to add something like \"last updated the xx/xx/200x\" with this date being the last time a certain mySQL table has been updated.\nWhat is the best way to do that? Is there a function to retrieve the last updated date? Should I access to th... |
I need to write a .NET application that listens to a SMS message , and then react to it.
I assume i need a SMS gateway to interface between my application and the sender of the SMS.
How could i implement this . Would the listening program need to be a web service or something else ?
Please give me your ideas.
Thanks,
... | Certainly! To implement a .NET application that listens to SMS messages and reacts to them, you'll indeed need to use an SMS gateway, which will act as the intermediary between your application and the SMS sender. Below are the steps and considerations for building this application:
### 1. Choose an SMS Gateway
You c... | 49,354 | [
{
"from": "human",
"value": "I need to write a .NET application that listens to a SMS message , and then react to it.\nI assume i need a SMS gateway to interface between my application and the sender of the SMS.\nHow could i implement this . Would the listening program need to be a web service or something ... |
I need to build a quick feasibility test / proof-of-concept of a remote database for a client, that will be populated with mostly-typical Company and People data (names, addresses, etc); 150K records or so. The sample databases mentioned here were helpful:
Where can I find sample databases with common formatted data ... | Generating sample data for feasibility tests or proofs of concept can be accomplished through a variety of tools and resources that allow you to create realistic datasets for your needs. Here are several recommendations for generating sample data that can be used across multiple database engines:
### 1. **Mockaroo**
... | 48,194 | [
{
"from": "human",
"value": "I need to build a quick feasibility test / proof-of-concept of a remote database for a client, that will be populated with mostly-typical Company and People data (names, addresses, etc); 150K records or so. The sample databases mentioned here were helpful: \nWhere can I find sa... |
I'm playing around with a really simple game for the iPhone based on the CrashLanding example on the developer center. I've extended it a little so that rather than using OpenGL for display all the time I have a plain UIView as the title screen, a UITableView for a high scores screen and an unmodified EAGLView for the... | It sounds like you're experiencing issues with the OpenGL ES context and the rendering loop when transitioning between different views using a `UINavigationController`. Here are some common points to check and potential solutions to help you resolve the problem:
1. **Context Management**: Ensure that the OpenGL ES con... | 41,947 | [
{
"from": "human",
"value": "I'm playing around with a really simple game for the iPhone based on the CrashLanding example on the developer center. I've extended it a little so that rather than using OpenGL for display all the time I have a plain UIView as the title screen, a UITableView for a high scores ... |
I've saved an entire webpage's html to a string, and now I want to grab the "href" values from the links, preferably with the ability to save them to different strings later. What's the best way to do this?
I've tried saving the string as an .xml doc and parsing it using an XPathDocument navigator, but (surprise surpri... | Parsing HTML using regular expressions can be quite error-prone and is generally not recommended due to the complexity and variability of HTML. Instead, it's more efficient and reliable to use an HTML parser that is designed to handle the intricacies of HTML documents.
If you're using a programming language like Pytho... | 49,344 | [
{
"from": "human",
"value": "I've saved an entire webpage's html to a string, and now I want to grab the \"href\" values from the links, preferably with the ability to save them to different strings later. What's the best way to do this?\nI've tried saving the string as an .xml doc and parsing it using an X... |
I have a java object with several members. I want to create a small, quick and dirty editor that allows me to set the value of the members in an easy way. I've created a Panel that contains a TextField for every member. I have a setValues() method that will take the value of the TextFields and set them into the obje... | To enhance your Java panel editor with validation and improve its maintainability without adding excessive boilerplate code, you can consider a few strategies and libraries. Here are some ideas and patterns that can help:
### 1. Use a Validation Framework
Several libraries can help simplify data validation in Java. On... | 46,454 | [
{
"from": "human",
"value": "I have a java object with several members. I want to create a small, quick and dirty editor that allows me to set the value of the members in an easy way. I've created a Panel that contains a TextField for every member. I have a setValues() method that will take the value of ... |
I need to create a trigger in every database on my sql 2005 instance. I'm setting up some auditing ddl triggers.
I create a cursor with all database names and try to execute a USE statement. This doesn't seem to change the database - the CREATE TRIGGER statement just fires in adventureworks repeatedly. The other opt... | Your original script for creating DDL audit triggers across all databases in SQL Server 2005 is close but runs into a couple of issues that are common when attempting to execute dynamic SQL involving the `USE` statement and batch processing. Below, I'll outline the corrections and provide a refined version of the scrip... | 45,359 | [
{
"from": "human",
"value": "I need to create a trigger in every database on my sql 2005 instance. I'm setting up some auditing ddl triggers.\nI create a cursor with all database names and try to execute a USE statement. This doesn't seem to change the database - the CREATE TRIGGER statement just fires in... |
How do I group search results returned by Lucene by fields (similar to SQL Server's)?
| In Apache Lucene, you cannot directly group search results like you would in SQL with the `GROUP BY` clause. However, you can achieve similar functionality through a combination of techniques after performing your search. Here's how you can group results by a field in Lucene:
### Step-by-Step Approach:
1. **Perform a... | 45,408 | [
{
"from": "human",
"value": "How do I group search results returned by Lucene by fields (similar to SQL Server's)?\n"
},
{
"from": "gpt",
"value": "In Apache Lucene, you cannot directly group search results like you would in SQL with the `GROUP BY` clause. However, you can achieve similar functi... |
I'm trying to make some types in Django that map to standard Django types. The custom model field documentation goes into complicated cases; I just want to store a basic Django type from a class with a bunch of handy methods.
For example, if I were storing playing cards, I want something like:
class Card(object):
... | To create a custom field in Django that encapsulates the logic for a playing card while storing its value as an integer in the database, you can create a custom model field. This approach allows you to maintain the functionality of the `Card` class while ensuring that it integrates seamlessly with Django's ORM.
Below ... | 48,416 | [
{
"from": "human",
"value": "I'm trying to make some types in Django that map to standard Django types. The custom model field documentation goes into complicated cases; I just want to store a basic Django type from a class with a bunch of handy methods.\nFor example, if I were storing playing cards, I wan... |
Does anyone know of a good component for .NET that will allow me to create a menu and .iso for a DVD? For each DVD I have several video files and photos that I'd like to turn into a DVD automatically.
| Creating a DVD structure with a menu and packaging video files and photos into an ISO file can be achieved using various libraries in .NET. Here are a few components and libraries you can consider:
1. **DVDStyler**:
- DVDStyler is an open-source DVD authoring application that can be automated. Although it's not a .... | 49,672 | [
{
"from": "human",
"value": "Does anyone know of a good component for .NET that will allow me to create a menu and .iso for a DVD? For each DVD I have several video files and photos that I'd like to turn into a DVD automatically. \n"
},
{
"from": "gpt",
"value": "Creating a DVD structure with a... |
I need to create a screenshot of the page by providing a page URL to the command line tool. I found the following application: Convert HTML To Image. This tool is OK but want a more flexible application. I need to have ability to perform the following:
Go to the following page.
Click button.
Take a screenshot and save... | To create an application that navigates to a URL, interacts with buttons, takes screenshots, and then sends images via email, you can use a combination of tools. A popular choice for web automation and testing is **Selenium**, paired with **Python** for the scripting. Here's a step-by-step guide on how you could accomp... | 46,708 | [
{
"from": "human",
"value": "I need to create a screenshot of the page by providing a page URL to the command line tool. I found the following application: Convert HTML To Image. This tool is OK but want a more flexible application. I need to have ability to perform the following:\n\nGo to the following pag... |
Is there any way that I can Fix the time to start any application like internet Explorer, or any other application. so if I don't miss my schedule of work.
ex: If every day evening I want my explorer to open certain page automatically,
Is it possible ???
| Yes, you can automate the opening of a specific web page in Internet Explorer (or another web browser) at a certain time each day using the Windows Task Scheduler. Here’s how you can set this up:
### Steps to Schedule Internet Explorer to Open a Specific Web Page
1. **Create a Batch File**:
- Open Notepad (or any ... | 48,112 | [
{
"from": "human",
"value": "Is there any way that I can Fix the time to start any application like internet Explorer, or any other application. so if I don't miss my schedule of work. \nex: If every day evening I want my explorer to open certain page automatically, \nIs it possible ???\n"
},
{
"fro... |
I am basically sending a URL to control the tilt and pan of an IP camera, so all I need to do is send the request, I am not worried about receiving anything. Currently I am using:
Dim Request As HttpWebRequest = WebRequest.Create("http://xxx.xxx.xxx.xxx/nphControlCamera?Direction=TiltDown&Resolution=320x240&Quality=Sta... | To avoid locking up your program when sending multiple requests to the IP camera, you should consider running the network request in a separate thread or using asynchronous programming. When you make synchronous web requests on the main thread, it can block the user interface (UI), which may result in your application ... | 49,511 | [
{
"from": "human",
"value": "I am basically sending a URL to control the tilt and pan of an IP camera, so all I need to do is send the request, I am not worried about receiving anything. Currently I am using:\nDim Request As HttpWebRequest = WebRequest.Create(\"http://xxx.xxx.xxx.xxx/nphControlCamera?Direct... |
Using MS Access 2007, I am creating a student management database. I have tables for:
Students
Courses
CourseSection
What I needed is a way to assign students to a course section. So I created a table that links students and sessions:
StudentsInSection (contains foreign key to students and foreign key to course sec... | Creating a form in MS Access 2007 to manage the relationship between students and course sections involves a few steps. Below is a step-by-step guide to help you create this functionality:
### Step 1: Ensure Your Tables Are Set Up Correctly
Make sure your tables are structured properly. Your tables should look someth... | 46,852 | [
{
"from": "human",
"value": "Using MS Access 2007, I am creating a student management database. I have tables for:\n\nStudents \nCourses\nCourseSection\n\nWhat I needed is a way to assign students to a course section. So I created a table that links students and sessions:\n\nStudentsInSection (contains fore... |
In the following code doesn't work as
public void Foo()
{
CompanyDataContext db = new CompanyDataContext();
Client client = (select c from db.Clients ....).Single();
Bar(client);
}
public void Bar(Client client)
{
CompanyDataContext db = new CompanyDataContext();
db.Client.Attach(client);
client.Som... | The error you're encountering arises because you're trying to attach an entity (`client` in this case) that was previously loaded with a different `DataContext` instance. Each `DataContext` instance maintains its own set of tracked entities, and entities loaded from one context cannot be directly attached to another wi... | 47,256 | [
{
"from": "human",
"value": "In the following code doesn't work as \npublic void Foo()\n{\n CompanyDataContext db = new CompanyDataContext();\n Client client = (select c from db.Clients ....).Single();\n Bar(client);\n}\n\npublic void Bar(Client client)\n{\n CompanyDataContext db = new CompanyDataCo... |
I'm working on a multilingual flex application that has to run in 27+ languages, including asian, hebrew and arabic, as well as all european languages.
We work with an embedded font (Myriad Pro) and have plenty of styles in a css that make use of that embedded font. We've tested with a modified version of Myriad includ... | Implementing multilingual support in a Flex application with runtime font loading can be a challenging task, especially when you're dealing with different scripts and languages. Here's a structured approach to help you manage different fonts while maintaining your stylesheet:
### 1. Use Font Embedding Dynamically
Ins... | 48,767 | [
{
"from": "human",
"value": "I'm working on a multilingual flex application that has to run in 27+ languages, including asian, hebrew and arabic, as well as all european languages.\nWe work with an embedded font (Myriad Pro) and have plenty of styles in a css that make use of that embedded font. We've teste... |
I'm trying to use prototype and scriptaculous to hide and display a div element but the function (below) to take advantage of the prototype setStyle property isn't working and I'm not sure what the problem is.
<script type="text/javascript" language="javascript">
function bodyOnload() {
$('content1').se... | It looks like you're using Prototype and Scriptaculous to create an accordion effect, but the initial hiding of the `content1` and `content2` divs is not working as expected. This is likely due to the fact that the `setStyle` method you are attempting to use is not correctly invoked. In the Prototype library, you shoul... | 47,178 | [
{
"from": "human",
"value": "I'm trying to use prototype and scriptaculous to hide and display a div element but the function (below) to take advantage of the prototype setStyle property isn't working and I'm not sure what the problem is.\n<script type=\"text/javascript\" language=\"javascript\">\n funct... |
Are there any wizard type controls in WPF? I need functionality where I can go forward and back and use tabs to select a particular item which will show the details of the nested items. I can use the TabControl control but the tab items are dynamic so I cannot nest the region inside the tab item.
| In WPF, while there is no built-in "wizard" control that directly combines navigation and dynamic tab content, you can achieve a wizard-like functionality using a combination of several WPF controls.
Here's a general approach to implement a wizard with back and forward navigation, along with dynamic tabs that show det... | 48,411 | [
{
"from": "human",
"value": "Are there any wizard type controls in WPF? I need functionality where I can go forward and back and use tabs to select a particular item which will show the details of the nested items. I can use the TabControl control but the tab items are dynamic so I cannot nest the region in... |
When I call CreateProcess in Windows, the new process doesn't seem to inherit the console of the calling process. I made a test program that runs "ruby xtest", xtest being a script that writes "hello" to standard output. I ran this test program from Emacs, and get no output. I also tried the following code calling G... | It seems that you're facing issues with process output not appearing in the parent process's console when using `CreateProcess`. The problem may stem from how the standard handles (stdin, stdout, stderr) are inherited by the child process.
In your case, you have already taken some important steps: you are setting up ... | 46,596 | [
{
"from": "human",
"value": "When I call CreateProcess in Windows, the new process doesn't seem to inherit the console of the calling process. I made a test program that runs \"ruby xtest\", xtest being a script that writes \"hello\" to standard output. I ran this test program from Emacs, and get no outpu... |
I have an application that was developed for Linux x86 32 bits. There are lots of floating-point operations and a lot of tests depending on the results. Now we are porting it to x86_64, but the test results are different in this architecture. We don't want to keep a separate set of results for each architecture.
Accord... | Porting an application with substantial reliance on floating-point operations from x86 (32-bit) to x86_64 (64-bit) while maintaining consistent results can indeed be challenging due to the differences in floating-point handling. Since you've already identified that the default behavior of GCC in x86_64 leads to discrep... | 49,187 | [
{
"from": "human",
"value": "I have an application that was developed for Linux x86 32 bits. There are lots of floating-point operations and a lot of tests depending on the results. Now we are porting it to x86_64, but the test results are different in this architecture. We don't want to keep a separate set... |
I would like to cache my most database heavy actions in my asp.net-mvc site.
In my research I have found
donut caching on Phil's blog
Caching/compressing filters on Kazi's blog
Scott Hansleman's podcast about how they cached things in SO.
But I don't feel I get it yet.
I want to be able to cache my POST request depe... | Caching in ASP.NET MVC can significantly improve the performance of your application, especially when dealing with expensive database queries. Given your scenario, where you want to cache the results of a POST request for a search operation based on various optional parameters encapsulated in a `SearchBag` object, let'... | 48,426 | [
{
"from": "human",
"value": "I would like to cache my most database heavy actions in my asp.net-mvc site.\nIn my research I have found \n\ndonut caching on Phil's blog\nCaching/compressing filters on Kazi's blog\nScott Hansleman's podcast about how they cached things in SO.\n\nBut I don't feel I get it yet.... |
I'm reading in a large text file with 1.4 million lines that is 24 MB in size (average 17 characters a line).
I'm using Delphi 2009 and the file is ANSI but gets converted to Unicode upon reading, so fairly you can say the text once converted is 48 MB in size.
( Edit: I found a much simpler example ... )
I'm loading th... | It sounds like you've made significant progress in addressing the memory overhead issues while working with large text files in Delphi 2009. Here are some key takeaways and additional suggestions that could further enhance your performance and memory efficiency, especially if you encounter similar issues in the future:... | 49,436 | [
{
"from": "human",
"value": "I'm reading in a large text file with 1.4 million lines that is 24 MB in size (average 17 characters a line).\nI'm using Delphi 2009 and the file is ANSI but gets converted to Unicode upon reading, so fairly you can say the text once converted is 48 MB in size.\n( Edit: I found ... |
I'm making a simple tool that will get a string of MySQL commands and run it (on several DB servers sequentially). I trust the users to be sensible, but mistakes happen, and I'm looking for a way to prevent basic typos:
Is there a way to validate, at runtime, (relatively simple) MySQL queries to see if they're syntacti... | To validate MySQL commands for syntactical correctness at runtime, you have several options. While `EXPLAIN` is a good approach for `SELECT` statements, you will need different methods for validating other types of commands.
### 1. Use `EXPLAIN` for SELECT Statements
As you've mentioned, using `EXPLAIN` for `SELECT` ... | 49,243 | [
{
"from": "human",
"value": "I'm making a simple tool that will get a string of MySQL commands and run it (on several DB servers sequentially). I trust the users to be sensible, but mistakes happen, and I'm looking for a way to prevent basic typos:\nIs there a way to validate, at runtime, (relatively simple... |
I started with jetlang and the basic samples are pretty clear.
What I didn't found is a good sample for using the PoolFiber. Anybody played around
with that already? I read also the retlang samples but it seems little bit different there.
Thanks for sharing your thoughts!
Okami
| Certainly! Jetlang is a lightweight, asynchronous programming library for Java that makes it easier to work with fibers (lightweight threads). The `PoolFiber` in Jetlang allows you to manage a pool of fibers, which can help you efficiently manage concurrent tasks.
Here's a simple example to demonstrate how to use `Poo... | 44,498 | [
{
"from": "human",
"value": "I started with jetlang and the basic samples are pretty clear.\nWhat I didn't found is a good sample for using the PoolFiber. Anybody played around\nwith that already? I read also the retlang samples but it seems little bit different there.\nThanks for sharing your thoughts!\nOk... |
I have a process which generates a data vector from a sensor.I'm using Intel Integrated Performance Primitives v5.3 update 3 for Windows on IA-32 to process it further for some calculations.I want to know if there is any c++ library which allows to plot the vector as a histogram/bar chart during data acquisition.I can ... | There are several libraries in C++ that can help you create plots, including histograms and bar charts. Below are some popular options that you can consider for plotting in C++:
1. **Matplotlib with C++ Bindings (matplotlib-cpp)**:
- `matplotlib-cpp` is a lightweight C++ wrapper for the popular Python plotting libr... | 48,204 | [
{
"from": "human",
"value": "I have a process which generates a data vector from a sensor.I'm using Intel Integrated Performance Primitives v5.3 update 3 for Windows on IA-32 to process it further for some calculations.I want to know if there is any c++ library which allows to plot the vector as a histogram... |
I have an XP client that is experiencing an issue. My dev box is Vista Home 64. I start up the debugger on the client machine and when i try to run on the dev box, it says 'Unable to debug. Remote debugger doesn't support this version of windows'.
Looks like I'm sol. is there another way to find out how to debug this?... | It sounds like you're dealing with a frustrating situation! Since you're unable to debug directly using the remote debugger, here are a few alternative approaches you can take to diagnose the .NET runtime error:
1. **Event Viewer**: Since the application is throwing a .NET runtime error (Event ID 5000), you can check ... | 48,881 | [
{
"from": "human",
"value": "I have an XP client that is experiencing an issue. My dev box is Vista Home 64. I start up the debugger on the client machine and when i try to run on the dev box, it says 'Unable to debug. Remote debugger doesn't support this version of windows'. \nLooks like I'm sol. is there ... |
When I call VFSVolumeSize on Palm OS on a Palm Centro with a 6GB SanDisk card inserted, it returns 1810366464 as the size of the card but 2098102272 bytes used. Obviously there's an overflow going on with the card size.
Is there a way to detect this overflow and get the real size of the card?
| The issue you are experiencing with `VFSVolumeSize` on the Palm OS is a common one, particularly with larger SD cards. The function is likely returning a value that is overflowing the 32-bit integer limit (which can represent values up to 2,147,483,647 bytes), resulting in incorrect readings for larger volumes.
In you... | 49,904 | [
{
"from": "human",
"value": "When I call VFSVolumeSize on Palm OS on a Palm Centro with a 6GB SanDisk card inserted, it returns 1810366464 as the size of the card but 2098102272 bytes used. Obviously there's an overflow going on with the card size.\nIs there a way to detect this overflow and get the real s... |
I codded a CLR stored procedure (listed below)
The line of code where the exception is thrown was added just for the
purpose of having the exception logged in EventLog
I deployed the assembly and created the stored proc in database
However when I execute the stored procedure no entry is logged in Windows' EventLog
I... | When working with CLR stored procedures in SQL Server, you may encounter issues with logging to the Windows Event Log. The problem you are experiencing—where the EventLog entry is not being logged when executed from SQL Server—can occur for several reasons. Here are some common issues and solutions:
1. **Permissions**... | 49,995 | [
{
"from": "human",
"value": "I codded a CLR stored procedure (listed below)\nThe line of code where the exception is thrown was added just for the\n purpose of having the exception logged in EventLog \nI deployed the assembly and created the stored proc in database\nHowever when I execute the stored procedu... |
I want the IIS server to return HTTP 304 (Not Modified) when a particular file is accessed.
How can I set this up?
| To configure IIS (Internet Information Services) to return an HTTP 304 (Not Modified) status code for a specific file, you can set up caching rules or utilize the `Last-Modified` and `If-Modified-Since` HTTP headers.
Here’s a basic guide to achieve this:
### Method 1: Use Caching
1. **Open IIS Manager**:
- Press ... | 44,757 | [
{
"from": "human",
"value": "I want the IIS server to return HTTP 304 (Not Modified) when a particular file is accessed. \nHow can I set this up? \n"
},
{
"from": "gpt",
"value": "To configure IIS (Internet Information Services) to return an HTTP 304 (Not Modified) status code for a specific fil... |
I'm trying to use Live Search 2.0 but even a simple example doesn't seem to work. Microsoft only has example code for 1.1 and they're not giving out AppIDs for that version.
Here's what I'm trying with:
<?php
$server = new SoapClient('http://soap.search.msn.com/webservices.asmx?wsdl');
class Search {
public $Reque... | It looks like you're working with the Microsoft Live Search SOAP API, and the error indicates that there is an issue with how you are calling the `Search` method. The error you're seeing is likely due to how the parameters are structured in your SOAP request.
The `Search` method expects the `Search` object as a singl... | 47,974 | [
{
"from": "human",
"value": "I'm trying to use Live Search 2.0 but even a simple example doesn't seem to work. Microsoft only has example code for 1.1 and they're not giving out AppIDs for that version.\nHere's what I'm trying with:\n<?php\n$server = new SoapClient('http://soap.search.msn.com/webservices.as... |
Well.. we've developed a j2ee application using struts2 ajax capabilities. We find that the dojo implementation is quite slow. We did the following things:
1. Custom build of the dojo library. (increased dojo.js from 240kb to 350kb)
2. Took all the static stuff out of the struts jar and kept it outside.
The performance... | Struts2's AJAX capabilities indeed rely heavily on Dojo, which can lead to performance issues, especially if you're using a significant portion of the library that you don't actually need. You've already taken some solid steps to improve performance, but if you're still looking for a lighter implementation, here are so... | 48,180 | [
{
"from": "human",
"value": "Well.. we've developed a j2ee application using struts2 ajax capabilities. We find that the dojo implementation is quite slow. We did the following things:\n1. Custom build of the dojo library. (increased dojo.js from 240kb to 350kb)\n2. Took all the static stuff out of the stru... |
I'm working on a static analysis tool for .NET assembly.
In Java, there is a Descriptor which can be used to represent method or field in a string with specified grammar.
for field:
double d[][][];
will be
[[[D
It's useful especially when doing bytecode analysis. Coz it's easy to describe. If there a similar thing in... | In .NET, while there isn't an exact equivalent to Java's descriptor strings for method or field signatures, there are several alternatives and techniques that you can use for similar purposes, especially in the context of static analysis of .NET assemblies.
### 1. **Reflection and Metadata**
.NET provides reflection a... | 49,984 | [
{
"from": "human",
"value": "I'm working on a static analysis tool for .NET assembly. \nIn Java, there is a Descriptor which can be used to represent method or field in a string with specified grammar. \nfor field:\ndouble d[][][];\nwill be\n[[[D\nIt's useful especially when doing bytecode analysis. Coz it'... |
I have a library consisting of approx 100 source files. I want one of the sources to be always rebuilt if any of the other files have been compiled but I don't want it built every time I run the make/build.
Basically I want this file to have the last build date/time built into it so any application linking to the libra... | You can achieve your goal by using a combination of a timestamp file and conditional builds in your Makefile. This way, you will ensure that a specific source file (let's call it `timestamp.c`) is rebuilt only when any of the other source files change, but it won't be rebuilt every time you invoke `make`.
Here's a ste... | 44,960 | [
{
"from": "human",
"value": "I have a library consisting of approx 100 source files. I want one of the sources to be always rebuilt if any of the other files have been compiled but I don't want it built every time I run the make/build.\nBasically I want this file to have the last build date/time built into ... |
I have a problem and i would like to learn the correct way to solve this.
I have a Data Objeckt
class LinkHolder {
public string Text;
public string Link;
}
I would like to present to the user a RadioButton list that uses the LinkHolder.Text value as descriptive text.
Then on the postback, i would like to do ... | To achieve your goal of displaying a list of `LinkHolder` objects as a radio button list and performing a server transfer based on the selected link, you can follow these steps. This example assumes you are using ASP.NET Web Forms.
### Step 1: Define the LinkHolder class
Make sure you have the `LinkHolder` class defi... | 44,176 | [
{
"from": "human",
"value": "I have a problem and i would like to learn the correct way to solve this. \nI have a Data Objeckt\nclass LinkHolder {\n public string Text;\n public string Link;\n}\n\nI would like to present to the user a RadioButton list that uses the LinkHolder.Text value as descriptive... |
Having programmed for a while now I have noticed that I am becoming more and more reliant on the internet and IntelliSense to do my job. But I was wondering how much that has affected my knowledge over the past year or so. But does this matter?
For example I am more likely now to remember that when I need to program ag... | It's a common concern among developers that reliance on tools like IntelliSense and the internet can impact long-term knowledge retention and understanding of the underlying technologies. Here are a few points to consider regarding your experience and this trend:
### 1. **Tool Dependency vs. Deep Understanding**:
-... | 47,234 | [
{
"from": "human",
"value": "Having programmed for a while now I have noticed that I am becoming more and more reliant on the internet and IntelliSense to do my job. But I was wondering how much that has affected my knowledge over the past year or so. But does this matter?\nFor example I am more likely now ... |
Can anybody tell me when Application_End is triggered in a lifecycle of an application? When all sessions are ended, will Application_End be triggered automatically? + Are there any other reasons why Application_End could be triggered?
| In the context of an ASP.NET application, `Application_End` is a method that is called when the application is shutting down. Here are the main points regarding when `Application_End` is triggered in the application lifecycle:
### When is `Application_End` triggered?
1. **Application Pool Recycle**: The most common r... | 46,088 | [
{
"from": "human",
"value": "Can anybody tell me when Application_End is triggered in a lifecycle of an application? When all sessions are ended, will Application_End be triggered automatically? + Are there any other reasons why Application_End could be triggered?\n"
},
{
"from": "gpt",
"value":... |
I’ve almost 6 years of experience in application development using .net technologies. Over the years I have improved as a better OO programmer but when I see code written by other guys (especially the likes of Jeffrey Richter, Peter Golde, Ayende Rahien, Jeremy Miller etc), I feel there is a generation gap between mine... | Becoming a better object-oriented (OO) programmer involves a combination of several factors, and it's a continuous journey of learning and improvement. Let’s break down your questions:
### 1. **Components of Becoming a Better OO Programmer**
#### a) **Experience**
- Experience plays a crucial role in improving you... | 45,384 | [
{
"from": "human",
"value": "I’ve almost 6 years of experience in application development using .net technologies. Over the years I have improved as a better OO programmer but when I see code written by other guys (especially the likes of Jeffrey Richter, Peter Golde, Ayende Rahien, Jeremy Miller etc), I fe... |
I have a JTable with a custom TableModel called DataTableModel. I initialized the table with a set of column names and no data as follows:
books = new JTable(new DataTableModel(new Vector<Vector<String>>(), title2));
JScrollPane scroll1 = new JScrollPane(books);
scroll1.setEnabled(true);
scroll1.setVisible(true);
JSpli... | Based on the code you provided, the problem with your `JTable` not displaying the updated data could be due to how you're updating the `DataTableModel`. Specifically, it appears that when you instantiate `DataTableModel`, you're not storing the incoming data (`Vector<Vector<String>> v`) in the class variable `values`, ... | 49,729 | [
{
"from": "human",
"value": "I have a JTable with a custom TableModel called DataTableModel. I initialized the table with a set of column names and no data as follows:\nbooks = new JTable(new DataTableModel(new Vector<Vector<String>>(), title2));\nJScrollPane scroll1 = new JScrollPane(books);\nscroll1.setEn... |
In F#, you can generate a set of numbers, just by saying [1..100].
I want to do something similar in C#. This is what I have come up with so far:
public static int[] To(this int start, int end)
{
var result = new List<int>();
for(int i = start; i <= end; i++)
result.Add(i);
return result.ToArray();... | Your revised implementation using `Enumerable.Range` is definitely more concise and efficient than the manual loop with `List<int>`. When it comes to readability, the choice of method name and casing can have an impact, but it's also a matter of style and consistency within your codebase.
### Readability Consideration... | 48,796 | [
{
"from": "human",
"value": "In F#, you can generate a set of numbers, just by saying [1..100].\nI want to do something similar in C#. This is what I have come up with so far:\npublic static int[] To(this int start, int end)\n{\n var result = new List<int>();\n for(int i = start; i <= end; i++)\n ... |
I'm wondering if this is possible in SQL. Say you have two tables A and B, and you do a select on table A and join on table B:
SELECT a.*, b.* FROM TABLE_A a JOIN TABLE_B b USING (some_id);
If table A has columns 'a_id', 'name', and 'some_id', and table B has 'b_id', 'name', and 'some_id', the query will return column... | In SQL, there is no direct way to add a prefix to all columns from a table using a wildcard like `SELECT *`. This is due to the SQL standard not supporting dynamic aliasing of column names. Each column name has to be specified explicitly if you want to change how it appears in the result set.
However, there are some a... | 46,382 | [
{
"from": "human",
"value": "I'm wondering if this is possible in SQL. Say you have two tables A and B, and you do a select on table A and join on table B:\nSELECT a.*, b.* FROM TABLE_A a JOIN TABLE_B b USING (some_id);\n\nIf table A has columns 'a_id', 'name', and 'some_id', and table B has 'b_id', 'name',... |
I'm a big fan of Yahoo's recommendations for speeding up websites. One of the recommendations is to combine images where possible to cut down on size and the number of requests. However, I've noticed that while it can be easy to use CSS sprites for layouts, other image uses aren't as easily combined. The primary exampl... | Combining images and optimizing them for performance while preserving accessibility and semantics is indeed a challenge, particularly when it comes to dynamically generated content like a blog or article list. Let's address your concerns and explore possible solutions.
### 1. **Combining Images Dynamically:**
Using P... | 49,244 | [
{
"from": "human",
"value": "I'm a big fan of Yahoo's recommendations for speeding up websites. One of the recommendations is to combine images where possible to cut down on size and the number of requests. However, I've noticed that while it can be easy to use CSS sprites for layouts, other image uses aren... |
I need to launch a media file from a URL from within my c# .NET application. Is there any way to do this natively in .NET? I don't need an embedded player, I just need the default player to launch. I have tried
System.Diagnostics.Process.Start("File URL");
but it launches the default browser and downloads the file, i... | In .NET, if you want to launch a media file from a URL in the default media player without embedding a player in your application, you can use the `Process.Start` method, but you need to ensure that the URL is properly formatted and recognized as a media file by the operating system.
However, when you pass a URL direc... | 49,505 | [
{
"from": "human",
"value": "I need to launch a media file from a URL from within my c# .NET application. Is there any way to do this natively in .NET? I don't need an embedded player, I just need the default player to launch. I have tried \nSystem.Diagnostics.Process.Start(\"File URL\");\n\nbut it launches... |
I recently asked a question about functional programming, and received (good!) answers that prompted more questions (as seems to be the case with learning, sometimes). Here are a couple examples:
One answer made reference to an advantage of immutable data structures: each thread can have its own copy. Now, to me, this... | You're asking some great questions that get to the heart of functional programming, immutability, and concurrency. Let's break down your queries step by step.
### 1. Merging Changes in Immutable Data Structures
In a functional programming paradigm, immutability means that once a data structure is created, it cannot b... | 49,395 | [
{
"from": "human",
"value": "I recently asked a question about functional programming, and received (good!) answers that prompted more questions (as seems to be the case with learning, sometimes). Here are a couple examples:\n\nOne answer made reference to an advantage of immutable data structures: each thr... |
If a method checks it's input and detects illegal input, what should it do: Raise an exception (or use another error-mechanism) or do nothing/ignoring on the wrong input?
In Java the HashTable-class throws an NullPointerException if given null-references as parameter. This is sometimes annoying, but I think it may have... | This is a common topic of debate in software development, and both approaches have their merits and potential drawbacks. The choice between raising an exception and ignoring illegal input depends on several factors, including the context of the method, the type of application being developed, and the expected behavior ... | 48,494 | [
{
"from": "human",
"value": "If a method checks it's input and detects illegal input, what should it do: Raise an exception (or use another error-mechanism) or do nothing/ignoring on the wrong input?\nIn Java the HashTable-class throws an NullPointerException if given null-references as parameter. This is s... |
I have created a minidump using win32 api
[DllImport("DbgHelp.dll", SetLastError = true)]
private static extern bool MiniDumpWriteDump(
dmp file is successfully created.
i am trying to open this *.dmp file in another visual studio instance to locate the place of the crash,
in visual studio --> FILE--> open proj... | To open and analyze a minidump file (.dmp) in Visual Studio, you need to follow a few specific steps to ensure you can properly load and debug the dump. Here are some potential solutions to your issue:
### Steps to Open a Minidump in Visual Studio
1. **Ensure Symbols are Loaded**: The minidump needs to have the corre... | 49,514 | [
{
"from": "human",
"value": "I have created a minidump using win32 api\n[DllImport(\"DbgHelp.dll\", SetLastError = true)]\n private static extern bool MiniDumpWriteDump(\ndmp file is successfully created.\ni am trying to open this *.dmp file in another visual studio instance to locate the place of th... |
I have a Linux server with multiple ips (so, multiple eth0, eth0:0, eth0:1 etc).
The script I'm trying to start is a php CLI script which is downloading stuff from an another server API, and I would like to change the IP based on different parameters. Once the script is started, I don't need anymore to change the ip OF... | To achieve the goal of binding a PHP CLI script to a specific IP address on a Linux server with multiple IPs, you can use a couple of different approaches. Here are a few options:
### 1. Use `curl` with the `--interface` option
If your PHP script makes HTTP requests (for example, to download content from an API), you... | 48,558 | [
{
"from": "human",
"value": "I have a Linux server with multiple ips (so, multiple eth0, eth0:0, eth0:1 etc).\nThe script I'm trying to start is a php CLI script which is downloading stuff from an another server API, and I would like to change the IP based on different parameters. Once the script is started... |
I want a simple tutorial to show me how to load a yaml file and parse the data. Expat style would be great but any solution that actually shows me the data in some form would be useful.
So far I ran multiple tests in the yaml-0.1.1 source code for C and I either get an error, no output whatsoever, or in the run-emitter... | Certainly! Working with YAML in C can be tricky, especially when you're just starting out. I'll guide you through a simple example using the `libyaml` library, which is a common choice for parsing YAML files in C.
### Step 1: Install libyaml
First, make sure you have `libyaml` installed on your system. You can instal... | 45,322 | [
{
"from": "human",
"value": "I want a simple tutorial to show me how to load a yaml file and parse the data. Expat style would be great but any solution that actually shows me the data in some form would be useful.\nSo far I ran multiple tests in the yaml-0.1.1 source code for C and I either get an error, n... |
I'm working on a java program, and I have several vectors defined and filled (from a file) inside a method. I need to return the contents of all the vectors from the method. I have heard you can put them all in one object to return them. Is that possible, and if so, how? If not, do you have any possible solutions f... | Yes, it is possible to return multiple vectors from a method in Java by encapsulating them in a single object. A common approach is to create a custom class that holds all the vectors as fields. This way, you can return an instance of this custom class containing all the relevant data.
Here’s how you can implement thi... | 44,934 | [
{
"from": "human",
"value": "I'm working on a java program, and I have several vectors defined and filled (from a file) inside a method. I need to return the contents of all the vectors from the method. I have heard you can put them all in one object to return them. Is that possible, and if so, how? If ... |
A recent question came up about using String.Format(). Part of my answer included a suggestion to use StringBuilder.AppendLine(string.Format(...)). Jon Skeet suggested this was a bad example and proposed using a combination of AppendLine and AppendFormat.
It occurred to me I've never really settled myself into a "pref... | When working with `StringBuilder` in C#, it's often best to prioritize readability and performance. Both `AppendFormat` and `AppendLine` have their use cases, but they can also be combined effectively.
### Recommended Approach
Using `AppendFormat` directly followed by `AppendLine()` (as Jon Skeet suggested) is genera... | 48,196 | [
{
"from": "human",
"value": "A recent question came up about using String.Format(). Part of my answer included a suggestion to use StringBuilder.AppendLine(string.Format(...)). Jon Skeet suggested this was a bad example and proposed using a combination of AppendLine and AppendFormat.\nIt occurred to me I'v... |
I have three tables in the many-to-many format. I.e, table A, B, and AB set up as you'd expect.
Given some set of A ids, I need to select only the rows in AB that match all of the ids.
Something like the following won't work:
"SELECT * FROM AB WHERE A_id = 1 AND A_id = 2 AND A_id = 3 AND ... "
As no single row will h... | To achieve this requirement, you can use the SQL `GROUP BY` and `HAVING` clauses. The idea is to count the number of distinct option IDs associated with each person and then filter the results to only include those persons who have all of the desired option IDs.
Here’s how you can write your SQL query:
```sql
SELECT ... | 45,133 | [
{
"from": "human",
"value": "I have three tables in the many-to-many format. I.e, table A, B, and AB set up as you'd expect. \nGiven some set of A ids, I need to select only the rows in AB that match all of the ids. \nSomething like the following won't work:\n\"SELECT * FROM AB WHERE A_id = 1 AND A_id = 2 A... |
I am writing an application which opens USB devices and transfer some data. I am following the UsbSimpleNotificationExample from the Developer Examples. The example adds notifications and assigns callbacks for a unique Vendor ID and Product ID. But for my application I have multiple PIDs and a single VIDs. How can I ad... | When working with USB devices, especially when you want to monitor multiple Product IDs (PIDs) for a single Vendor ID (VID) in your application, using a `CFDictionary` with `kIOProviderClassKey` might not be sufficient, as it doesn’t allow for multiple values for a single key (in your case, the Vendor ID).
Instead of ... | 49,088 | [
{
"from": "human",
"value": "I am writing an application which opens USB devices and transfer some data. I am following the UsbSimpleNotificationExample from the Developer Examples. The example adds notifications and assigns callbacks for a unique Vendor ID and Product ID. But for my application I have mult... |
I frequently find myself with a folder open in Windows, wishing to have a command prompt open with the same working directory.
I am aware of Power Toys "Command Prompt", but that only works as a context menu item on the folder, and not from inside the folder if you are already there. I know you can navigate to the par... | There's indeed a much more efficient way to open a Command Prompt in the current directory in Windows Explorer. Here are a few methods that you can use:
### Method 1: Using Shift + Right-Click
1. Navigate to the folder in Windows Explorer where you want to open the Command Prompt.
2. Hold down the **Shift** key and ri... | 49,858 | [
{
"from": "human",
"value": "I frequently find myself with a folder open in Windows, wishing to have a command prompt open with the same working directory.\nI am aware of Power Toys \"Command Prompt\", but that only works as a context menu item on the folder, and not from inside the folder if you are alread... |
My requirement is to replace a set of words in a given text file with a second set of words, which might be given from the command line or another file. Wanting to use Perl to do this, as the rest of my code is also in Perl.
So, if I have the following:
server name="${server1}" host="abc.com"
server name="${server2}" h... | To perform the desired replacements in Perl, you can use a combination of regular expressions and the `-p` switch to process the input file line by line. Here's how you can achieve the two requirements you've outlined: replacing specific server names with a different set of words, and replacing parts of the server name... | 45,988 | [
{
"from": "human",
"value": "My requirement is to replace a set of words in a given text file with a second set of words, which might be given from the command line or another file. Wanting to use Perl to do this, as the rest of my code is also in Perl.\nSo, if I have the following:\nserver name=\"${server1... |
How would make a news feed "friendly" database design, so that it wouldn't be extremely expensive to get all of the items (query) to put in the news feed? The only way I can think of would involve UNIONing nearly every table (representing groups, notes, friends, etc) and getting the dates and such, that just seems lik... | Designing a "friendly" database for a news feed can indeed be a challenge, especially when considering the need for efficient querying and user-specific data. Here are some strategies to create an efficient news feed database design:
### 1. Use a Denormalized Structure
Denormalization involves combining related table... | 49,934 | [
{
"from": "human",
"value": "How would make a news feed \"friendly\" database design, so that it wouldn't be extremely expensive to get all of the items (query) to put in the news feed? The only way I can think of would involve UNIONing nearly every table (representing groups, notes, friends, etc) and gett... |
The question is simple: I cannot understand the Zipper data structure.
My question is related to its uses with a Tree.
I want to understand how can I change the tree node using zipper. And how not to copy the whole tree (or the most part of it).
Please, clarify if I'm wrong with zipper. Maybe it cannot help with the tr... | The Zipper is a data structure that allows you to navigate and modify tree-like structures without having to copy the entire structure, making it more efficient for certain types of updates. It essentially provides a way to keep track of the current location in the tree while retaining enough context to navigate back t... | 47,059 | [
{
"from": "human",
"value": "The question is simple: I cannot understand the Zipper data structure.\nMy question is related to its uses with a Tree.\nI want to understand how can I change the tree node using zipper. And how not to copy the whole tree (or the most part of it).\nPlease, clarify if I'm wrong w... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.