instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
I have a table with an XML column. This column is storing some values I keep for configuring my application. I created it to have a more flexible schema.
I can't find a way to update this column directly from the table view in SQL Management Studio. Other (INT or Varchar for example) columns are editable. I know I can ... | To enable direct editing of an XML column in SQL Server Management Studio (SSMS), you can try the following approaches:
1. **Enable XML Editing in Grid**: By default, SSMS does not allow editing XML columns directly in the grid view. However, you can still double-click on the XML cell in the grid. This may open an XML... | 5,541 | [
{
"from": "human",
"value": "I have a table with an XML column. This column is storing some values I keep for configuring my application. I created it to have a more flexible schema.\nI can't find a way to update this column directly from the table view in SQL Management Studio. Other (INT or Varchar for ex... |
Given a HTML file with the structure html -> body -> a bunch of divs what is the correct groovy statement to find all of the divs with a non blank tags attribute?
The following is not working:
def nodes = html.body.div.findAll { it.@tags != null }
because it finds all the nodes.
| To filter for `div` elements that have a non-blank `tags` attribute in Groovy, you need to make sure to check both that the attribute exists and that it is not blank. The expression `it.@tags != null` will return true for all `div` elements that have the `tags` attribute, including those with empty values.
You can mo... | 8,286 | [
{
"from": "human",
"value": "Given a HTML file with the structure html -> body -> a bunch of divs what is the correct groovy statement to find all of the divs with a non blank tags attribute?\nThe following is not working:\ndef nodes = html.body.div.findAll { it.@tags != null }\n\nbecause it finds all the n... |
I see 2 main ways to set events in JavaScript:
Add an event directly inside the tag like this:
<a href="" onclick="doFoo()">do foo</a>
Set them by JavaScript like this:
<a id="bar" href="">do bar</a>
and add an event in a <script> section inside the <head> section or in an external JavaScript file, like that if you'r... | The question of which method is the best for setting events in JavaScript can depend on various factors including readability, maintainability, separation of concerns, and performance. Let’s analyze both approaches and outline the best practices to consider.
### Method 1: Inline Event Handlers
```html
<a href="" oncl... | 3,778 | [
{
"from": "human",
"value": "I see 2 main ways to set events in JavaScript:\n\nAdd an event directly inside the tag like this:\n<a href=\"\" onclick=\"doFoo()\">do foo</a>\nSet them by JavaScript like this:\n<a id=\"bar\" href=\"\">do bar</a>\n\nand add an event in a <script> section inside the <head> secti... |
In interpreted programming languages, such as PHP and JavaScript, what are the repercussions of going with an Object Oriented approach over a Procedural approach?
Specifically what I am looking for is a checklist of things to consider when creating a web application and choosing between Procedural and Object Oriented a... | When deciding between Object-Oriented (OO) and Procedural programming approaches in interpreted languages such as PHP and JavaScript, it's essential to weigh both performance implications and maintainability concerns. Here’s a checklist of considerations that may help inform your decision:
### Checklist for Choosing O... | 2,600 | [
{
"from": "human",
"value": "In interpreted programming languages, such as PHP and JavaScript, what are the repercussions of going with an Object Oriented approach over a Procedural approach?\nSpecifically what I am looking for is a checklist of things to consider when creating a web application and choosin... |
Is anyone using the Obout controls in C# .Net? How would you rate these controls, especially the Grid Control?
| Obout controls are a set of ASP.NET components that provide a variety of UI elements for web applications, including a Grid control. They are designed to facilitate rapid development with a focus on performance and functionality.
### Key Features of Obout Grid Control:
1. **Performance**: The grid control is optimize... | 7,312 | [
{
"from": "human",
"value": "Is anyone using the Obout controls in C# .Net? How would you rate these controls, especially the Grid Control?\n"
},
{
"from": "gpt",
"value": "Obout controls are a set of ASP.NET components that provide a variety of UI elements for web applications, including a Gri... |
How do I get ms-access to connect (through ODBC) to an ms-sql database as a different user than their Active Directory ID?
I don't want to specify an account in the ODBC connection, I want to do it on the ms-access side to hide it from my users. Doing it in the ODBC connection would put me right back in to the origina... | To connect Microsoft Access to a Microsoft SQL Server database using ODBC with a different user than their Active Directory ID without specifying the account in the ODBC connection, you can use a method to authenticate programmatically through VBA in Access.
Here’s a step-by-step guide on how to do this:
### 1. Set U... | 4,661 | [
{
"from": "human",
"value": "How do I get ms-access to connect (through ODBC) to an ms-sql database as a different user than their Active Directory ID? \nI don't want to specify an account in the ODBC connection, I want to do it on the ms-access side to hide it from my users. Doing it in the ODBC connection... |
I am looking to start writing apps for my Windows Mobile 6.1 professional device (Sprint Mogul/HTC Titan).
I use the copy of Visual Studio 2003 that I bought in college for all of my current contracting work, (all of my day job work is done on a company laptop). From what I can tell from MSDN in order to develop using... | Developing for Windows Mobile 6.1 can be a bit challenging due to the age of the platform and the tools available. However, there are some alternatives you can explore that may help you get started without needing to purchase Visual Studio 2005.
### Free Tools
1. **Eclipse with CDT**: You can use Eclipse, which is a ... | 6,292 | [
{
"from": "human",
"value": "I am looking to start writing apps for my Windows Mobile 6.1 professional device (Sprint Mogul/HTC Titan).\nI use the copy of Visual Studio 2003 that I bought in college for all of my current contracting work, (all of my day job work is done on a company laptop). From what I ca... |
I'm not entirely sure if this is possible in Ruby, but hopefully there's an easy way to do this. I want to declare a variable and later find out the name of the variable. That is, for this simple snippet:
foo = ["goo", "baz"]
How can I get the name of the array (here, "foo") back? If it is indeed possible, does this w... | In Ruby, it is not straightforward to retrieve the name of a variable after it has been assigned. This is because variable names in Ruby are simply references to objects, and when you assign a value to a variable, the variable name itself does not become part of the object.
When you perform an operation with a variab... | 5,615 | [
{
"from": "human",
"value": "I'm not entirely sure if this is possible in Ruby, but hopefully there's an easy way to do this. I want to declare a variable and later find out the name of the variable. That is, for this simple snippet:\nfoo = [\"goo\", \"baz\"]\n\nHow can I get the name of the array (here, \"... |
We created a tool which converts a language called P2, a language similar to assembly which I think exists only in Japan, to C#. There are at least a hundred modules written in P2 and we want to verify if the conversion to C# is right? How can we test this?
| Verifying the correctness of a conversion tool, especially from a low-level language like P2 to a higher-level language like C#, requires a structured approach to testing. Here’s a step-by-step guide you can follow:
### 1. **Unit Testing for Individual Modules**
- **Create Test Cases**: For each P2 module, write un... | 5,533 | [
{
"from": "human",
"value": "We created a tool which converts a language called P2, a language similar to assembly which I think exists only in Japan, to C#. There are at least a hundred modules written in P2 and we want to verify if the conversion to C# is right? How can we test this?\n"
},
{
"from... |
I'm running Thunderbird on Windows. I often receive .ics (iCal) attachments - invitations to meetings. Currently I save the attachment to my desktop, open Google Calendar, choose 'Add>Import Calendar', browse to the .ics file, and return to the calendar.
Is there any tool that can speed this up... e.g. I forward the em... | Yes, there are a few ways you can streamline the process of adding .ics files from your emails to Google Calendar without having to manually save and upload each time. Here are a few options:
### 1. **Zapier Integration**
Zapier allows you to create automated workflows between different apps. You can set it up so that... | 6,900 | [
{
"from": "human",
"value": "I'm running Thunderbird on Windows. I often receive .ics (iCal) attachments - invitations to meetings. Currently I save the attachment to my desktop, open Google Calendar, choose 'Add>Import Calendar', browse to the .ics file, and return to the calendar.\nIs there any tool that ... |
Is there anything out there that for .NET that can generate UML diagrams from code. Preferably an addin for Visual Studio. Starting work on a mature project that has little architectural documentation can be painful at first. Eventually you get the ins and outs of the code but helping to see how the code all fits toget... | Yes, there are several tools and add-ins available for Visual Studio that can help you generate UML diagrams from .NET code. Here are some popular options:
1. **Visual Studio Class Designer**: This is built into Visual Studio and allows you to create class diagrams directly from your code. You can drag and drop classe... | 7,647 | [
{
"from": "human",
"value": "Is there anything out there that for .NET that can generate UML diagrams from code. Preferably an addin for Visual Studio. Starting work on a mature project that has little architectural documentation can be painful at first. Eventually you get the ins and outs of the code but h... |
I've got the following in my .css file creating a little image next to each link on my site:
div.post .text a[href^="http:"]
{
background: url(../../pics/remote.gif) right top no-repeat;
padding-right: 10px;
white-space: nowrap;
}
How do I modify this snippet (or add something new) to exclude the link icon... | To modify your CSS so that the icon does not appear next to links that are themselves images, you can use the `:not()` pseudo-class. This allows you to specify that you want to exclude any anchor (`a`) tags that contain an image (`img`) inside them.
Here's how you can update your CSS rule:
```css
div.post .text a[hre... | 8,134 | [
{
"from": "human",
"value": "I've got the following in my .css file creating a little image next to each link on my site:\ndiv.post .text a[href^=\"http:\"]\n{\n background: url(../../pics/remote.gif) right top no-repeat;\n padding-right: 10px;\n white-space: nowrap;\n}\n\nHow do I modify this snip... |
In a C++ app, I have an hWnd pointing to a window running in a third party process. This window contains controls which extend the COM TreeView control. I am interested in obtaining the CheckState of this control.
I use the hWnd to get an HTREEITEM using TreeView_GetRoot(hwnd) from commctrl.h
hwnd points to the window ... | To access the CheckState of a TreeView control in a C# application, especially when dealing with a TreeView control in a third-party process, you can use Platform Invocation Services (P/Invoke) to call the necessary Win32 API functions directly.
Unfortunately, the .NET `System.Windows.Forms.TreeView` control does not ... | 3,726 | [
{
"from": "human",
"value": "In a C++ app, I have an hWnd pointing to a window running in a third party process. This window contains controls which extend the COM TreeView control. I am interested in obtaining the CheckState of this control.\nI use the hWnd to get an HTREEITEM using TreeView_GetRoot(hwnd) ... |
I want to copy the entire contents of a directory from one location to another in C#.
There doesn't appear to be a way to do this using System.IO classes without lots of recursion.
There is a method in VB that we can use if we add a reference to Microsoft.VisualBasic:
new Microsoft.VisualBasic.Devices.Computer().
F... | In C#, you can indeed copy an entire directory and its contents without resorting to recursion, although it typically involves implementing some logic similar to what you would find in the `CopyDirectory` method of the Visual Basic library.
To accomplish this using just `System.IO` classes, you can use the following a... | 6,493 | [
{
"from": "human",
"value": "I want to copy the entire contents of a directory from one location to another in C#.\nThere doesn't appear to be a way to do this using System.IO classes without lots of recursion.\nThere is a method in VB that we can use if we add a reference to Microsoft.VisualBasic:\nnew Mic... |
Ever since moving to Vista some time ago on my development machine, connecting to SQL Servers in our DMZ active directory domain from client tools like SSMS has not worked like it used to. In XP, as long as I had authenticated in some way on the server (for example directing Explorer to \server.dmzdomain\c$ and enteri... | This issue you're encountering with SQL Server Management Studio (SSMS) on Windows Vista, specifically concerning the use of TCP/IP connections to SQL Server in a different Active Directory domain, is a known behavior and can often be attributed to changes in how credential handling and authentication work in Vista com... | 5,352 | [
{
"from": "human",
"value": "Ever since moving to Vista some time ago on my development machine, connecting to SQL Servers in our DMZ active directory domain from client tools like SSMS has not worked like it used to. In XP, as long as I had authenticated in some way on the server (for example directing Ex... |
Where can I find a complete reference of the ncurses C API?
| You can find a complete reference for the ncurses C API in several places:
1. **Official Ncurses Documentation**: The primary source is the official ncurses documentation, which is often included with the ncurses installation. You can usually find it in the `/usr/share/doc/ncurses` directory on Unix-like systems or vi... | 8,072 | [
{
"from": "human",
"value": "Where can I find a complete reference of the ncurses C API?\n"
},
{
"from": "gpt",
"value": "You can find a complete reference for the ncurses C API in several places:\n\n1. **Official Ncurses Documentation**: The primary source is the official ncurses documentation,... |
On Windows I can do:
HANDLE hCurrentProcess = GetCurrentProcess();
SetPriorityClass(hCurrentProcess, ABOVE_NORMAL_PRIORITY_CLASS);
How can I do the same thing on *nix?
| On Unix-like operating systems (including Linux), you can change the priority of a process using the `nice` and `renice` commands in the command line or the `setpriority` function in a C/C++ program.
Here's how you can do this programmatically in C:
1. **Include the Necessary Headers:**
You need to include `<sys/... | 7,069 | [
{
"from": "human",
"value": "On Windows I can do:\nHANDLE hCurrentProcess = GetCurrentProcess();\n\nSetPriorityClass(hCurrentProcess, ABOVE_NORMAL_PRIORITY_CLASS);\n\nHow can I do the same thing on *nix?\n"
},
{
"from": "gpt",
"value": "On Unix-like operating systems (including Linux), you can c... |
My users are having an intermittent error when using a Windows Forms application built in VB.NET 3.5. Apparently when they click on the form and the form re-paints, a red 'X' will be painted over the MenuStrip control and the app will crash with the following error.
Has anyone seen this before? Can someone point me in... | The issue you are encountering with the `System.ArgumentOutOfRangeException` in your Windows Forms application, particularly when interacting with the `MenuStrip`, seems to suggest a problem with the state of the collection that holds the items of the `MenuStrip`. This could be caused by a variety of factors, such as c... | 4,597 | [
{
"from": "human",
"value": "My users are having an intermittent error when using a Windows Forms application built in VB.NET 3.5. Apparently when they click on the form and the form re-paints, a red 'X' will be painted over the MenuStrip control and the app will crash with the following error. \nHas anyone... |
I'm integrating .NET support into our C++ application.
It's an old-school MFC application, with 1 extra file compiled with the "/clr" option that references a CWinFormsControl.
I'm not allowed to remove the linker flag "/NODEFAULTLIB".
(We have our own build management system, not Visual Studio's.)
This means I have to... | Integrating .NET support into an old-school MFC application while adhering to specific constraints can indeed be challenging, especially when dealing with library linking requirements. Given your constraints, here's a breakdown of how you can go about specifying the necessary libraries for your application:
### Librar... | 2,219 | [
{
"from": "human",
"value": "I'm integrating .NET support into our C++ application.\nIt's an old-school MFC application, with 1 extra file compiled with the \"/clr\" option that references a CWinFormsControl.\nI'm not allowed to remove the linker flag \"/NODEFAULTLIB\".\n(We have our own build management sy... |
I am using the webbrowser control in winforms and discovered now that background images which I apply with css are not included in the printouts.
Is there a way to make the webbrowser print the background of the displayed document too?
Edit:
Since I wanted to do this programatically, I opted for this solution:
using Mi... | You're correct that modifying the registry is not an ideal approach for changing print settings, especially since it requires administrative privileges, can lead to unintended side effects, and is dependent on the user having Internet Explorer or a compatible configuration.
Here are some alternative approaches you mig... | 5,608 | [
{
"from": "human",
"value": "I am using the webbrowser control in winforms and discovered now that background images which I apply with css are not included in the printouts.\nIs there a way to make the webbrowser print the background of the displayed document too?\nEdit:\nSince I wanted to do this programa... |
Is it possible to get the x,y coordinates of a Flex app within an HTML page? I know you can use ExternalInterface.ObjecID to get the "id attribute of the object tag in Internet Explorer, or the name attribute of the embed tag in Netscape" but I can't seem to get past that step. It seems like it should be possible to ... | To retrieve the x, y coordinates of a Flex application embedded within an HTML page, you can use JavaScript in conjunction with the `ExternalInterface` class in ActionScript. Here’s a general approach to achieve this:
1. **Embed the Flex Application**: First, ensure your Flex application is properly embedded in your H... | 5,375 | [
{
"from": "human",
"value": "Is it possible to get the x,y coordinates of a Flex app within an HTML page? I know you can use ExternalInterface.ObjecID to get the \"id attribute of the object tag in Internet Explorer, or the name attribute of the embed tag in Netscape\" but I can't seem to get past that ste... |
No, this is not a question about generics.
I have a Factory pattern with several classes with internal constructors (I don't want them being instantiated if not through the factory).
My problem is that CreateInstance fails with a "No parameterless constructor defined for this object" error unless I pass "true" on the n... | In C#, the `Activator.CreateInstance<T>()` method does not allow you to specify the parameter to access non-public constructors directly, which is why you're encountering the issue. By default, this method only works with public constructors.
To resolve this issue while still maintaining a generic factory pattern, you... | 7,450 | [
{
"from": "human",
"value": "No, this is not a question about generics.\nI have a Factory pattern with several classes with internal constructors (I don't want them being instantiated if not through the factory).\nMy problem is that CreateInstance fails with a \"No parameterless constructor defined for this... |
On Mac OS X, you can create a zip archive from the Finder by selecting some files and selecting "Compress" from the contextual menu or the File menu. Unfortunately, the resulting file is not identical to the archive created by the zip command (with the default options).
This distinction matters to at least one service... | To create a zip archive in the correct format that preserves symbolic links like `ditto` does, you can use the `zip` command with the `-y` option. This will ensure that symlinks are preserved in the archive instead of being stored as regular files.
Here's a basic example of how to create a zip archive in a shell scrip... | 8,253 | [
{
"from": "human",
"value": "On Mac OS X, you can create a zip archive from the Finder by selecting some files and selecting \"Compress\" from the contextual menu or the File menu. Unfortunately, the resulting file is not identical to the archive created by the zip command (with the default options).\nThis... |
Here's the scenario. I'm using myopenid for, among other things, StackOverflow. When I initially set up my openid account with myopenid, I decided to try out Cardspace because they had support.
I later wanted to access Stackoverflow from another machine so I chose to back up my card. I gave it a password and a filename... | It sounds like you're encountering issues with using your backed-up CardSpace card on your laptop after transferring it from your desktop. Here are a few troubleshooting steps and considerations that may help resolve the problem:
1. **CardSpace Version Compatibility**: Ensure that the version of CardSpace on your Wind... | 6,665 | [
{
"from": "human",
"value": "Here's the scenario. I'm using myopenid for, among other things, StackOverflow. When I initially set up my openid account with myopenid, I decided to try out Cardspace because they had support.\nI later wanted to access Stackoverflow from another machine so I chose to back up my... |
A while ago, I started on a project where I designed a html-esque XML schema so that authors could write their content (educational course material) in a simplified format which would then be transformed into HTML via XSLT. I played around (struggled) with it for a while and got it to a very basic level but then was to... | The decision between using XSLT and writing your own parser depends on various factors, including your project's specific requirements, your familiarity with both technologies, and your long-term goals. Here are some points to consider for both approaches:
### Sticking with XSLT
**Pros:**
1. **Standardization**: XSLT... | 4,689 | [
{
"from": "human",
"value": "A while ago, I started on a project where I designed a html-esque XML schema so that authors could write their content (educational course material) in a simplified format which would then be transformed into HTML via XSLT. I played around (struggled) with it for a while and got... |
What is the best way to localise a date format descriptor?
As anyone from a culture which does not use the mm/dd/yyyy format knows, it is annoying to have to enter dates in this format. The .NET framework provides some very good localisation support, so it's trivial to parse dates according to the users culture, but yo... | When localizing date format descriptors to ensure clarity and usability for users from different cultures, it's important to present the date format in a way that is intuitive and easy to understand. Here are several strategies to achieve this:
1. **Use Localized Date Format Strings**: Use the .NET framework's built-i... | 3,049 | [
{
"from": "human",
"value": "What is the best way to localise a date format descriptor?\nAs anyone from a culture which does not use the mm/dd/yyyy format knows, it is annoying to have to enter dates in this format. The .NET framework provides some very good localisation support, so it's trivial to parse da... |
OK, this begins to drive me crazy. I have an asp.net webapp. Pretty straightforward, most of the code in the .aspx.vb, and a few classes in App_Code.
The problem, which has begun to occur only today (even though most of the code was already written), is that once in a while, I have this error message :
Error BC30002: ... | The error message you're encountering, `BC30002: Type 'XXX' is not defined`, typically indicates that the ASP.NET compiler cannot find or resolve a type defined in your code. This is often due to issues with the application’s compilation and might be influenced by the way ASP.NET handles dynamic recompilation of the Ap... | 4,657 | [
{
"from": "human",
"value": "OK, this begins to drive me crazy. I have an asp.net webapp. Pretty straightforward, most of the code in the .aspx.vb, and a few classes in App_Code.\nThe problem, which has begun to occur only today (even though most of the code was already written), is that once in a while, I ... |
I have a radio button list on a page that is used to configure products. when the page loads the first time the first list of options is displayed. you select one of them then click a "Next Step" button and the page posts back and shows a new radio button list for step 2. Now if i click a "Previous Step" button i can e... | Yes, what you're observing with the `Page_Load` method running twice on a postback is somewhat typical behavior in ASP.NET, especially when dealing with events like button clicks and the page lifecycle. Let's break down the sequence of events and the implications for your radio button list.
### ASP.NET Page Lifecycle
... | 5,699 | [
{
"from": "human",
"value": "I have a radio button list on a page that is used to configure products. when the page loads the first time the first list of options is displayed. you select one of them then click a \"Next Step\" button and the page posts back and shows a new radio button list for step 2. Now ... |
ValidateEvents is a great ASP.net function, but the Yellow Screen of Death is not so nice. I found a way how to handle the HttpRequestValidationException gracefully here, but that does not work with ASP.net AJAX properly.
Basically, I got an UpdatePanel with a TextBox and a Button, and when the user types in HTML into... | To handle `HttpRequestValidationException` gracefully in an ASP.NET application, particularly with AJAX requests made through an `UpdatePanel`, you can implement a custom error handling mechanism. Here's how to achieve the desired behavior for both standard requests and AJAX requests:
### 1. Global Error Handling with... | 3,750 | [
{
"from": "human",
"value": "ValidateEvents is a great ASP.net function, but the Yellow Screen of Death is not so nice. I found a way how to handle the HttpRequestValidationException gracefully here, but that does not work with ASP.net AJAX properly.\nBasically, I got an UpdatePanel with a TextBox and a Bu... |
I developed a program in a mobile device (Pocket PC 2003) to access a web service, the web service is installed on a Windows XP SP2 PC with IIS, the PC has the IP 192.168.5.2.
The device obtains from the wireless network the IP 192.168.5.118 and the program works OK, it calls the method from the web service and execut... | The issue you're experiencing seems to be related to IP addressing and network routing between different subnets. Let's break down the situation:
1. **Different Subnets**: When you connect to the different access point and obtain an IP address in the `192.168.10.x` subnet while your web service is in the `192.168.5.x`... | 4,178 | [
{
"from": "human",
"value": "I developed a program in a mobile device (Pocket PC 2003) to access a web service, the web service is installed on a Windows XP SP2 PC with IIS, the PC has the IP 192.168.5.2. \nThe device obtains from the wireless network the IP 192.168.5.118 and the program works OK, it calls ... |
I've been asked to create a Delphi compatible dll in C++ to do simple 64bit memory management.
The background is that the system in Delphi needs to allocate a lots of chunks of memory that would go well outside 32bit addressable space. The Delphi developer explained to me that he could not allocate memory with the Delp... | Creating a Delphi-compatible DLL in C++ for memory management can be achieved, even with Visual Studio 2008. Here's a simplified overview of how you can create a DLL that allocates and frees memory in a way that is usable from Delphi.
### Step 1: Create a DLL in Visual Studio
1. **Create a New Project**:
- Open Vi... | 4,296 | [
{
"from": "human",
"value": "I've been asked to create a Delphi compatible dll in C++ to do simple 64bit memory management.\nThe background is that the system in Delphi needs to allocate a lots of chunks of memory that would go well outside 32bit addressable space. The Delphi developer explained to me that ... |
I've not been able to find any information on this, but is a keycode required to be embedded in the CR2008 merge modules for a .NET distribution? They used to require this (which had to be done using ORCA), but I've not found any information on this for CR2008.
| As of Crystal Reports 2008, the requirements for embedding a keycode in the merge modules have changed compared to previous versions. In earlier versions of Crystal Reports, a keycode was indeed required for the distribution of the runtime and merge modules, typically done through a tool like ORCA.
However, for Crysta... | 7,529 | [
{
"from": "human",
"value": "I've not been able to find any information on this, but is a keycode required to be embedded in the CR2008 merge modules for a .NET distribution? They used to require this (which had to be done using ORCA), but I've not found any information on this for CR2008. \n"
},
{
... |
I have two machines, speed and mass. speed has a fast Internet connection and is running a crawler which downloads a lot of files to disk. mass has a lot of disk space. I want to move the files from speed to mass after they're done downloading. Ideally, I'd just run:
$ rsync --remove-source-files speed:/var/crawldir .
... | To safely move files from `speed` to `mass` without the risk of `rsync` unlinking files that haven't finished downloading, you can use a few different strategies:
### 1. Use a Temporary Directory
1. **Download to a Temporary Directory**: Configure your crawler to download files to a temporary directory (e.g., `/var/c... | 6,580 | [
{
"from": "human",
"value": "I have two machines, speed and mass. speed has a fast Internet connection and is running a crawler which downloads a lot of files to disk. mass has a lot of disk space. I want to move the files from speed to mass after they're done downloading. Ideally, I'd just run:\n$ rsync --... |
I'm an experienced client application developer (C++/C#), but need to come up to speed quickly on writing server side code to perform RESTful interactions. Specifically, I need to learn how to exchange data with OpenSocial containers via the RESTful API.
| Getting up to speed on server-side development for RESTful interactions, particularly with OpenSocial containers, involves understanding a few key concepts and technologies. Below is a structured guide to help you transition from client application development to server-side programming.
### 1. Understand RESTful Arch... | 3,761 | [
{
"from": "human",
"value": "I'm an experienced client application developer (C++/C#), but need to come up to speed quickly on writing server side code to perform RESTful interactions. Specifically, I need to learn how to exchange data with OpenSocial containers via the RESTful API.\n"
},
{
"from":... |
I am trying to add a project reference or swc to papervision in FlashDevelop but intellisense isn't picking it up. I've done it before but i forgot how.
Thanks.
| To add a project reference or an SWC library in FlashDevelop so that IntelliSense can pick it up, you can follow these steps:
1. **Locate the SWC File:**
Make sure you have the correct SWC file for Papervision3D. You can usually find it in the Papervision3D package or download it from their website if you don't hav... | 8,339 | [
{
"from": "human",
"value": "I am trying to add a project reference or swc to papervision in FlashDevelop but intellisense isn't picking it up. I've done it before but i forgot how.\nThanks.\n"
},
{
"from": "gpt",
"value": "To add a project reference or an SWC library in FlashDevelop so that Int... |
I'm designing this collection of classes and abstract (MustInherit) classes…
This is the database table where I'm going to store all this…
As far as the Microsoft SQL Server database knows, those are all nullable ("Allow Nulls") columns.
But really, that depends on the class stored there: LinkNode, HtmlPageNode, or C... | Designing a class hierarchy with corresponding database tables while ensuring data integrity and efficient querying can be complex. Based on your requirements, let's tackle your questions systematically.
### Enforcing Data Integrity Rules in SQL Server
If you're using a single-table design to store instances of diffe... | 3,979 | [
{
"from": "human",
"value": "I'm designing this collection of classes and abstract (MustInherit) classes…\n\nThis is the database table where I'm going to store all this…\n\nAs far as the Microsoft SQL Server database knows, those are all nullable (\"Allow Nulls\") columns.\nBut really, that depends on the ... |
I'm trying to create a deployment tool that will install software based on the hardware found on a system. I'd like the tool to be able to determine if the optical drive is a writer (to determine if burning software sould be installed) or can read DVDs (to determine if a player should be installed). I tried uing the fo... | The `Win32_CDROMDrive` WMI class provides information about CD-ROM drives, but it does not directly indicate whether the drive is a writer or a player. The `MediaType` property will typically return "CD-ROM" for drives that can read CDs, and the information about whether the drive can write CDs or DVDs is not as straig... | 6,029 | [
{
"from": "human",
"value": "I'm trying to create a deployment tool that will install software based on the hardware found on a system. I'd like the tool to be able to determine if the optical drive is a writer (to determine if burning software sould be installed) or can read DVDs (to determine if a player ... |
While incremental linking addresses much of the time spent linking, even for very large projects, I find the incremental linker in MSVS to be pretty haphazard. (I'm currently using 2003 atm, would love to hear if 2005/8 addressed any of this.) My list of known triggers include:
changing anything external to the main... | Full links can indeed be a time sink during the build process, especially in large projects. While Visual Studio 2003 had some limitations in its incremental linking capabilities, later versions like 2005 and 2008 did bring improvements, though they may not have resolved all of the issues you're encountering.
### Stra... | 4,769 | [
{
"from": "human",
"value": "While incremental linking addresses much of the time spent linking, even for very large projects, I find the incremental linker in MSVS to be pretty haphazard. (I'm currently using 2003 atm, would love to hear if 2005/8 addressed any of this.) My list of known triggers include... |
I have a panel on an aspx page which contains an UpdatePanel.
This panel is wrapped with both a PopUpControl Extender as well as a DragPanel Extender.
Upon initial show everything works fine, the panel pops up and closes as expected and can be dragged around as well.
There is a linkbutton within the UpdatePanel which t... | It sounds like you are dealing with a common issue when using ASP.NET AJAX UpdatePanels in combination with Extender controls like PopUpControl and DragPanel. The problem usually arises because the UpdatePanel's partial postback can reset or interfere with the JavaScript bindings that were set up for dragging the panel... | 4,301 | [
{
"from": "human",
"value": "I have a panel on an aspx page which contains an UpdatePanel.\nThis panel is wrapped with both a PopUpControl Extender as well as a DragPanel Extender.\nUpon initial show everything works fine, the panel pops up and closes as expected and can be dragged around as well.\nThere is... |
Why does the following code sometimes causes an Exception with the contents "CLIPBRD_E_CANT_OPEN":
Clipboard.SetText(str);
This usually occurs the first time the Clipboard is used in the application and not after that.
| The `CLIPBRD_E_CANT_OPEN` exception typically indicates that the Clipboard cannot be accessed for some reason, which can happen in a few scenarios:
1. **Accessing the Clipboard Too Early**: If your application tries to access the Clipboard before it has been fully initialized (e.g., before the application's message lo... | 4,915 | [
{
"from": "human",
"value": "Why does the following code sometimes causes an Exception with the contents \"CLIPBRD_E_CANT_OPEN\":\nClipboard.SetText(str);\n\nThis usually occurs the first time the Clipboard is used in the application and not after that.\n"
},
{
"from": "gpt",
"value": "The `CLIP... |
I'm toying with the idea of phasing in an ORM into an application I support. The app is not very structured with no unit tests. So any change will be risky. I'm obviously concerned that I've got a good enough reason to change. The idea is that there will be less boiler plate code for data access and there for greater p... | Phasing in an Object-Relational Mapping (ORM) system into an existing application can indeed provide benefits such as reducing boilerplate code, improving productivity, and making the data access layer more maintainable. However, given the context of your application—with a lack of structure and no unit tests—there are... | 4,001 | [
{
"from": "human",
"value": "I'm toying with the idea of phasing in an ORM into an application I support. The app is not very structured with no unit tests. So any change will be risky. I'm obviously concerned that I've got a good enough reason to change. The idea is that there will be less boiler plate cod... |
I've read that Lambda Expressions are an incredibly powerful addition to C#, yet I find myself mystified by them. How can they improve my life or make my code better? Can anyone point to a good resource for learning such expressions?
They seem cool as hell, but how do they relate to my day-to-day life as an asp.net dev... | Lambda expressions in C# are indeed a powerful feature that can significantly improve your coding experience, especially as an ASP.NET developer. Let’s break down what they are, how they can enhance your code, and their applications beyond querying.
### What are Lambda Expressions?
A lambda expression is an anonymous ... | 4,319 | [
{
"from": "human",
"value": "I've read that Lambda Expressions are an incredibly powerful addition to C#, yet I find myself mystified by them. How can they improve my life or make my code better? Can anyone point to a good resource for learning such expressions?\nThey seem cool as hell, but how do they rela... |
Anyone know a good book or post about how to start in EF? I have seen the DnrTV any other place?
| Certainly! If you're looking to get started with Entity Framework (EF), there are several resources you can explore:
### Books
1. **"Entity Framework Core in Action" by Jon P Smith** - This book provides a comprehensive guide to using Entity Framework Core, including practical examples and scenarios.
2. **"Programming... | 5,621 | [
{
"from": "human",
"value": "Anyone know a good book or post about how to start in EF? I have seen the DnrTV any other place?\n"
},
{
"from": "gpt",
"value": "Certainly! If you're looking to get started with Entity Framework (EF), there are several resources you can explore:\n\n### Books\n1. **\... |
How do I get the id of my Java process?
I know there are several platform-dependent hacks, but I would prefer a more generic solution.
| To obtain the process ID (PID) of your Java process in a platform-independent way, you can use the `java.lang.management.ManagementFactory` class. This class provides a management interface for the Java Virtual Machine (JVM), including the ability to retrieve the PID.
Here's a simple way to get the PID of your Java pr... | 8,251 | [
{
"from": "human",
"value": "How do I get the id of my Java process? \nI know there are several platform-dependent hacks, but I would prefer a more generic solution.\n"
},
{
"from": "gpt",
"value": "To obtain the process ID (PID) of your Java process in a platform-independent way, you can use th... |
Has anyone used Jaxer in a production environment, I am curious as to how it holds up compared to something like php, ruby, etc. and if anyone knows of any pitfalls to using it that are well known.
| Jaxer is a server-side JavaScript platform that was developed by the company Aptana. It allows developers to run JavaScript on the server, similar to how PHP or Ruby on Rails operates, enabling developers to create web applications using a single programming language across the entire stack.
**Production Use and Compa... | 5,031 | [
{
"from": "human",
"value": "Has anyone used Jaxer in a production environment, I am curious as to how it holds up compared to something like php, ruby, etc. and if anyone knows of any pitfalls to using it that are well known.\n"
},
{
"from": "gpt",
"value": "Jaxer is a server-side JavaScript pl... |
Does filling out HTML meta description/keyword tags matter for SEO?
| Yes, filling out HTML meta description and keyword tags can influence SEO, but their importance has changed over time.
### Meta Descriptions:
- **Impact on Click-Through Rate (CTR):** Meta descriptions do not directly affect search rankings, but they play a crucial role in improving the click-through rate from search ... | 5,795 | [
{
"from": "human",
"value": "Does filling out HTML meta description/keyword tags matter for SEO?\n"
},
{
"from": "gpt",
"value": "Yes, filling out HTML meta description and keyword tags can influence SEO, but their importance has changed over time.\n\n### Meta Descriptions:\n- **Impact on Click-... |
There are a couple of tricks for getting glass support for .Net forms.
I think the original source for this method is here: http://blogs.msdn.com/tims/archive/2006/04/18/578637.aspx
Basically:
//reference Desktop Windows Manager (DWM API)
[DllImport( "dwmapi.dll" )]
static extern void DwmIsCompositionEnabled( ref bool ... | To address your questions about achieving glass support in .NET Forms applications while ensuring compatibility with both Windows XP and Vista, let's break down the solution into manageable parts.
### 1. Understanding Glass Support in Windows Forms
The DWM (Desktop Window Manager) APIs you referenced allow for the us... | 3,958 | [
{
"from": "human",
"value": "There are a couple of tricks for getting glass support for .Net forms.\nI think the original source for this method is here: http://blogs.msdn.com/tims/archive/2006/04/18/578637.aspx\nBasically:\n//reference Desktop Windows Manager (DWM API)\n[DllImport( \"dwmapi.dll\" )]\nstati... |
What's the "best" (taking both speed and readability into account) way to determine if a list is empty? Even if the list is of type IEnumerable<T> and doesn't have a Count property.
Right now I'm tossing up between this:
if (myList.Count() == 0) { ... }
and this:
if (!myList.Any()) { ... }
My guess is that the second... | You are correct in your analysis regarding the performance and readability of the two methods to check if an `IEnumerable<T>` is empty. Let's break it down:
1. **Using `Count()`**:
```csharp
if (myList.Count() == 0) { ... }
```
- This method will iterate through the entire collection to count the elements... | 6,554 | [
{
"from": "human",
"value": "What's the \"best\" (taking both speed and readability into account) way to determine if a list is empty? Even if the list is of type IEnumerable<T> and doesn't have a Count property.\nRight now I'm tossing up between this:\nif (myList.Count() == 0) { ... }\n\nand this:\nif (!my... |
I have an OWL ontology and I am using Pellet to do reasoning over it. Like most ontologies it starts by including various standard ontologies:
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
... | Yes, you can continue to use Pellet or any other reasoner even when offline or if standard ontologies become unavailable by including the relevant ontologies directly within your own OWL ontology file. This method involves embedding the necessary definitions and classes directly into your ontology.
Here are the steps ... | 7,813 | [
{
"from": "human",
"value": "I have an OWL ontology and I am using Pellet to do reasoning over it. Like most ontologies it starts by including various standard ontologies:\n<rdf:RDF\n xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"\n xmlns:xsd=\"http://www.w3.org/2001/XMLSchema#\"\n xmlns... |
Is there any way to change Firefox system icon (the one on the left top of the window)?
Precision : I want to change the icon of a bundled version of Firefox with apache/php and my application. So manual operation on each computer is not a solution.
I try Resource Hacker and it's the good solution. The add ons one is ... | If you're looking to change the Firefox system icon for a bundled version of Firefox with your application, there are a few methods you can consider:
### 1. Resource Editing
You've already mentioned using Resource Hacker, which is a viable solution. Here’s a step-by-step guide:
- **Backup Your Files**: Always keep a ... | 6,305 | [
{
"from": "human",
"value": "Is there any way to change Firefox system icon (the one on the left top of the window)? \nPrecision : I want to change the icon of a bundled version of Firefox with apache/php and my application. So manual operation on each computer is not a solution.\nI try Resource Hacker and ... |
In unmanaged C/C++ code, what are the best practices to detect memory leaks? And coding guidelines to avoid? (As if it's that simple ;)
We have used a bit of a silly way in the past: having a counter increment for every memory allocation call and decrement while freeing. At the end of the program, the counter value sho... | Detecting and avoiding memory leaks in unmanaged C/C++ code requires a combination of coding practices, careful resource management, and the use of tools designed for memory analysis. Here are some best practices and tools that can help with detecting and preventing memory leaks:
### Best Practices to Avoid Memory Lea... | 2,762 | [
{
"from": "human",
"value": "In unmanaged C/C++ code, what are the best practices to detect memory leaks? And coding guidelines to avoid? (As if it's that simple ;)\nWe have used a bit of a silly way in the past: having a counter increment for every memory allocation call and decrement while freeing. At the... |
Does anyone know where to find good online resources with examples of how to make grammars and parse trees? Preferably introductory materials.
Info that is n00b friendly, haven't found anything good with Google myself.
Edit: I'm thinking about theory, not a specific parser software.
| Absolutely! Here are some beginner-friendly online resources that cover the basics of grammars and parse trees, focusing on the theoretical aspects rather than specific parser implementations:
1. **The Stanford Encyclopedia of Philosophy**:
- **Article on Formal Languages**: This article provides a good introductio... | 3,184 | [
{
"from": "human",
"value": "Does anyone know where to find good online resources with examples of how to make grammars and parse trees? Preferably introductory materials.\nInfo that is n00b friendly, haven't found anything good with Google myself.\nEdit: I'm thinking about theory, not a specific parser sof... |
Suppose you have the following EJB 3 interfaces/classes:
public interface Repository<E>
{
public void delete(E entity);
}
public abstract class AbstractRepository<E> implements Repository<E>
{
public void delete(E entity){
//...
}
}
public interface FooRepository<Foo>
{
//other methods
}
@Local(Fo... | The behavior you're observing is due to the way EJBs handle method calls, particularly in relation to the proxying that occurs for EJBs. In your example, when you call `fooRepository.delete(foo)`, the method resolution is handled at runtime, and in this case, the call is being dispatched to the `delete` method defined ... | 6,004 | [
{
"from": "human",
"value": "Suppose you have the following EJB 3 interfaces/classes:\npublic interface Repository<E>\n{\n public void delete(E entity);\n}\n\npublic abstract class AbstractRepository<E> implements Repository<E>\n{\n public void delete(E entity){\n //...\n }\n}\n\npublic interfac... |
I'm trying to make it so when a user scrolls down a page, click a link, do whatever it is they need to do, and then come back to the pages w/ links, they are at the same (x-y) location in the browser they were before. How do I do that?
I'm a DOM Newbie so I don't know too much about how to do this.
Target Browsers: ... | To achieve the functionality where a user can scroll down a page, navigate away (click a link), and then return to the exact scroll position they were at previously, you can make use of JavaScript and jQuery. Here's a simple way to accomplish this using the browser's `sessionStorage` API to store the scroll position wh... | 6,167 | [
{
"from": "human",
"value": "I'm trying to make it so when a user scrolls down a page, click a link, do whatever it is they need to do, and then come back to the pages w/ links, they are at the same (x-y) location in the browser they were before. How do I do that?\nI'm a DOM Newbie so I don't know too much... |
How can you suppress the Terminated message that comes up after you kill a
process in a bash script?
I tried set +bm, but that doesn't work.
I know another solution involves calling exec 2> /dev/null, but is that
reliable? How do I reset it back so that I can continue to see stderr?
| When you kill a process in a bash script, you might see the "Terminated" message because it's being sent to standard error (stderr). There are a couple of ways to suppress this message and manage the output.
### Suppression of "Terminated" Message
To suppress the "Terminated" message, you can redirect standard error ... | 6,942 | [
{
"from": "human",
"value": "How can you suppress the Terminated message that comes up after you kill a\nprocess in a bash script?\nI tried set +bm, but that doesn't work.\nI know another solution involves calling exec 2> /dev/null, but is that\nreliable? How do I reset it back so that I can continue to see... |
I have a .Net desktop application with a TreeView as one of the UI elements.
I want to be able to multi-select that TreeView, only that isn't supported at all.
So I'm adding check-boxes to the tree, My problem is that only some items are selectable, and those that aren't can't consistently cascade selections.
Is there... | Certainly! To implement checkboxes in a TreeView and have control over which checkboxes are selectable or hidden, you can customize the TreeView's rendering and item states. Here’s a step-by-step guide to achieve this:
1. **Handle the DrawMode of the TreeView:**
Set the `DrawMode` of your TreeView to `OwnerDrawAll`... | 47 | [
{
"from": "human",
"value": "I have a .Net desktop application with a TreeView as one of the UI elements.\nI want to be able to multi-select that TreeView, only that isn't supported at all.\nSo I'm adding check-boxes to the tree, My problem is that only some items are selectable, and those that aren't can't... |
I have a .NET web app that uses CR 2008 for reports. The server it's deployed on is saddled with McAfee, and we want to tell CR to use a temp directory other than the Windows temp dir.
Google found me the following registry key:
SOFTWARE\Business Objects\Suite 12.0\Report Application Server\InprocServer\TempDir.
Addin... | It sounds like you've done quite a bit of troubleshooting already, but the issue you're encountering with Crystal Reports 2008 after changing the temporary directory is a common one, particularly in environments with strict security measures like McAfee.
The "Operation not yet implemented" exception usually indicates ... | 5,636 | [
{
"from": "human",
"value": "I have a .NET web app that uses CR 2008 for reports. The server it's deployed on is saddled with McAfee, and we want to tell CR to use a temp directory other than the Windows temp dir.\nGoogle found me the following registry key:\nSOFTWARE\\Business Objects\\Suite 12.0\\Report ... |
I have a table in my database the records start and stop times for a specific task. Here is a sample of the data:
Start Stop
9/15/2008 5:59:46 PM 9/15/2008 6:26:28 PM
9/15/2008 6:30:45 PM 9/15/2008 6:40:49 PM
9/16/2008 8:30:45 PM 9/15/2008 9:20:29 PM
9/16/2008 12:30:45 PM ... | To calculate the elapsed minutes from your table, taking into account that records with the `Stop` time of `12/31/9999 12:00:00 AM` should be treated as ending at the current date and time, you can use a simple SQL script. Below is an example of how to do this in Transact-SQL (T-SQL).
Assuming your table is named `Tas... | 7,925 | [
{
"from": "human",
"value": "I have a table in my database the records start and stop times for a specific task. Here is a sample of the data:\nStart Stop\n9/15/2008 5:59:46 PM 9/15/2008 6:26:28 PM\n9/15/2008 6:30:45 PM 9/15/2008 6:40:49 PM\n9/16/2008 8:30:45 PM 9... |
In a typical handheld/portable embedded system device Battery life is a major concern in design of H/W, S/W and the features the device can support. From the Software programming perspective, one is aware of MIPS, Memory(Data and Program) optimized code.
I am aware of the H/W Deep sleep mode, Standby mode that are used... | Designing software for embedded systems with an emphasis on low power consumption is a multi-faceted task. Here are various strategies and considerations that can help achieve this goal:
### 1. Efficient Algorithms and Data Structures
- **Choose Algorithms Wisely**: Select algorithms with lower time complexity, as lon... | 3,314 | [
{
"from": "human",
"value": "In a typical handheld/portable embedded system device Battery life is a major concern in design of H/W, S/W and the features the device can support. From the Software programming perspective, one is aware of MIPS, Memory(Data and Program) optimized code.\nI am aware of the H/W D... |
Does anyone know of a good open source plugin for database querying and exploring within Eclipse?
The active Database Exploring plugin within Eclipse is really geared around being associated with a Java project. While I am just trying to run ad-hoc queries and explore the schema. I am effectively looking for a just a ... | If you're looking for a lightweight, open-source database querying and exploring tool within Eclipse that doesn't require the overhead of a full project setup, here are a couple of options you might find useful:
1. **DBeaver**: While not an Eclipse plugin per se, DBeaver is a powerful open-source database management t... | 6,686 | [
{
"from": "human",
"value": "Does anyone know of a good open source plugin for database querying and exploring within Eclipse? \nThe active Database Exploring plugin within Eclipse is really geared around being associated with a Java project. While I am just trying to run ad-hoc queries and explore the sche... |
We're looking for a package to help identify and automatically rotate faxed TIFF images based on a watermark or logo.
We use libtiff for rotation currently, but don't know of any other libraries or packages I can use for detecting this logo and determining how to rotate the images.
I have done some basic work with O... | For your requirement of detecting a watermark or logo in TIFF images and automatically rotating the images based on that detection, OpenCV is indeed a solid choice. It provides robust tools for image processing and computer vision tasks, which includes detecting specific features in images. Here’s how you can approach ... | 4,571 | [
{
"from": "human",
"value": "We're looking for a package to help identify and automatically rotate faxed TIFF images based on a watermark or logo. \nWe use libtiff for rotation currently, but don't know of any other libraries or packages I can use for detecting this logo and determining how to rotate the ... |
I decided to try http://www.screwturn.eu/ wiki as a code snippet storage utility. So far I am very impressed, but what irkes me is that when I copy paste my code that I want to save, '<'s and '[' (http://en.wikipedia.org/wiki/Character_encodings_in_HTML#Character_references) invariably screw up the output as the wiki i... | When using a wiki engine like ScrewTurn that interprets certain characters as markup, it's important to escape those characters so that they don't interfere with your code's presentation. Specifically, you'll want to convert `<`, `>`, and `&` characters to their respective HTML entities. Here are the HTML entities for ... | 6,999 | [
{
"from": "human",
"value": "I decided to try http://www.screwturn.eu/ wiki as a code snippet storage utility. So far I am very impressed, but what irkes me is that when I copy paste my code that I want to save, '<'s and '[' (http://en.wikipedia.org/wiki/Character_encodings_in_HTML#Character_references) inv... |
I have a rather complex page that dynamically builds user controls inside of a repeater. This repeater must be bound during the Init page event before ViewState is initialized or the dynamically created user controls will not retain their state.
This creates an interesting Catch-22 because the object I bind the repeate... | It sounds like you're dealing with a challenging scenario involving dynamic controls and state management in ASP.NET. The use of ViewState, Session, and the Repeater control can indeed create complexities, especially when trying to manage state across postbacks. Here are a few ideas to help you with your situation:
##... | 1,544 | [
{
"from": "human",
"value": "I have a rather complex page that dynamically builds user controls inside of a repeater. This repeater must be bound during the Init page event before ViewState is initialized or the dynamically created user controls will not retain their state.\nThis creates an interesting Catc... |
I woud like to create a cross-platform drawing program. The one requirement for writing my app is that I have pixel level precision over the canvas. For instance, I want to write my own line drawing algorithm rather than rely on someone elses. I do not want any form of anti-aliasing (again, pixel level control is requi... | Creating a cross-platform drawing program with pixel-level precision using Python or Java is definitely feasible. Below are some suggestions, tools, and frameworks you can use to achieve this, as well as considerations for ensuring cross-platform compatibility.
### Python Approach
1. **Framework**:
- **Pygame**: ... | 3,826 | [
{
"from": "human",
"value": "I woud like to create a cross-platform drawing program. The one requirement for writing my app is that I have pixel level precision over the canvas. For instance, I want to write my own line drawing algorithm rather than rely on someone elses. I do not want any form of anti-alia... |
I'm looking for the best way to take a simple input:
echo -n "Enter a string here: "
read -e STRING
and clean it up by removing non-alphanumeric characters, lower(case), and replacing spaces with underscores.
Does order matter? Is tr the best / only way to go about this?
| You can achieve your goal using various command-line tools in a shell script. The order of operations does matter for your specific requirements. Here's a recommended approach using `tr`, `sed`, and `awk` for cleaning up the input string:
1. **Lowercase the string**: Convert all characters to lowercase.
2. **Remove no... | 5,714 | [
{
"from": "human",
"value": "I'm looking for the best way to take a simple input:\necho -n \"Enter a string here: \"\nread -e STRING\n\nand clean it up by removing non-alphanumeric characters, lower(case), and replacing spaces with underscores.\nDoes order matter? Is tr the best / only way to go about this?... |
Is there some way I can use URLs like:
http://www.blog.com/team-spirit/
instead of
http://www.blog.com/?p=122
in a Windows hosted PHP server?
| Yes, you can achieve more user-friendly URLs (also known as "pretty URLs") in a Windows hosted PHP server using URL rewriting. This can typically be done using the Apache module `mod_rewrite` or, in the case of Windows servers running IIS (Internet Information Services), using URL Rewrite feature.
### If you're using ... | 4,170 | [
{
"from": "human",
"value": "Is there some way I can use URLs like: \nhttp://www.blog.com/team-spirit/\ninstead of\nhttp://www.blog.com/?p=122\nin a Windows hosted PHP server?\n"
},
{
"from": "gpt",
"value": "Yes, you can achieve more user-friendly URLs (also known as \"pretty URLs\") in a Windo... |
I've trying to get an ASP.net (v2) app to work in the debugger and keep running into a problem because the value returned by the following code is an empty string:
HttpContext.Current.Request.ServerVariables["APPL_MD_PATH"].ToLower()
I have found out that this "Retrieves the metabase path for the Application for the I... | The `ServerVariables["APPL_MD_PATH"]` value in an ASP.NET application retrieves the path of the application from the IIS metabase. It's a property that provides information about the application's location within the IIS configuration. The value is typically not empty when the application is running in a properly confi... | 6,810 | [
{
"from": "human",
"value": "I've trying to get an ASP.net (v2) app to work in the debugger and keep running into a problem because the value returned by the following code is an empty string:\nHttpContext.Current.Request.ServerVariables[\"APPL_MD_PATH\"].ToLower() \nI have found out that this \"Retrieves t... |
I have a vs.net project, and after some refactoring, have modified the name of the project. How can I easily rename the underlying windows folder name to match this new project name under a TFS controlled project and solution?
Note, I used to be able to do by fiddling with things in the background using SourceSafe ...... | Renaming a project in Visual Studio, especially when it's under TFS (Team Foundation Server) control, requires some careful steps to ensure that both the local workspace and TFS are in sync. Here’s how you can do this safely:
### Steps to Rename Your Project and Folder in TFS:
1. **Check In All Changes**: Ensure that... | 6,787 | [
{
"from": "human",
"value": "I have a vs.net project, and after some refactoring, have modified the name of the project. How can I easily rename the underlying windows folder name to match this new project name under a TFS controlled project and solution?\nNote, I used to be able to do by fiddling with thi... |
I have a non-.Net executable file that is included in my .net assembly as an embedded resource. Is there a way to run this executable that does not involve writing it out to disk and launching it?
This is .Net 2.0.
| Running a non-.NET executable directly from an embedded resource without writing it to disk presents some challenges, primarily because Windows applications typically expect executable files to be present on disk when they are run. However, if you want to avoid writing to disk, one common workaround is to create a memo... | 7,054 | [
{
"from": "human",
"value": "I have a non-.Net executable file that is included in my .net assembly as an embedded resource. Is there a way to run this executable that does not involve writing it out to disk and launching it?\nThis is .Net 2.0.\n"
},
{
"from": "gpt",
"value": "Running a non-.NE... |
Here is the full error: SqlException: A transport-level error has occurred when receiving results from the server. (provider: Shared Memory Provider, error: 1 - I/O Error detected in read/write operation)
I've started seeing this message intermittently for a few of the unit tests in my application (there are over 1100 ... | The error you're encountering, `SqlException: A transport-level error has occurred when receiving results from the server`, typically indicates a problem with the connection between your application and the SQL Server. Given that you're running on a VMWare virtual machine, there are several potential causes and solutio... | 4,260 | [
{
"from": "human",
"value": "Here is the full error: SqlException: A transport-level error has occurred when receiving results from the server. (provider: Shared Memory Provider, error: 1 - I/O Error detected in read/write operation)\nI've started seeing this message intermittently for a few of the unit tes... |
I ran across this situation this afternoon, so I thought I'd ask what you guys do.
We have a randomized password generator for user password resets and while fixing a problem with it, I decided to move the routine into my (slowly growing) test harness.
I want to test that passwords generated conform to the rules we've ... | When testing a password generator, particularly one that produces randomized or pseudo-randomized output, there are a few strategies you can use to ensure the generated passwords conform to your specified rules:
1. **Statistical Sampling**: Generate a large number of passwords (e.g., 10,000 or 100,000) and check that ... | 6,753 | [
{
"from": "human",
"value": "I ran across this situation this afternoon, so I thought I'd ask what you guys do.\nWe have a randomized password generator for user password resets and while fixing a problem with it, I decided to move the routine into my (slowly growing) test harness.\nI want to test that pass... |
I am using Qt Dialogs in one of my application.
I need to hide/delete the help button. But i am not able to locate where exactly I get the handle to his help button. Not sure if its a particular flag on the Qt window.
| In Qt, when you create a dialog using `QDialog`, you can control the visibility of the help button in the dialog's button box by adjusting the dialog's options.
To hide or remove the help button from a dialog, you should use the `setWindowFlags` method or `setStandardButtons` method, depending on how you are creating... | 7,217 | [
{
"from": "human",
"value": "I am using Qt Dialogs in one of my application.\nI need to hide/delete the help button. But i am not able to locate where exactly I get the handle to his help button. Not sure if its a particular flag on the Qt window.\n"
},
{
"from": "gpt",
"value": "In Qt, when you... |
Imagine I have String in C#: "I Don’t see ya.."
I want to remove (replace to nothing or etc.) these "’" symbols.
How do I do this?
| To remove or replace unwanted characters from a string in C#, you can use the `String.Replace` method or use regular expressions if you need more flexibility. In your case, you can replace the unwanted substring directly.
Here's a simple example using `String.Replace`:
```csharp
using System;
class Program
{
sta... | 7,251 | [
{
"from": "human",
"value": "Imagine I have String in C#: \"I Don’t see ya..\"\nI want to remove (replace to nothing or etc.) these \"’\" symbols. \nHow do I do this?\n"
},
{
"from": "gpt",
"value": "To remove or replace unwanted characters from a string in C#, you can use the `Str... |
I'm trying to use Visual Studio 2008's extensibility to write an addin that will create a project folder with various messages in it after parsing an interface. I'm having trouble at the step of creating/adding the folder, however. I've tried using
ProjectItem folder =
item.ProjectItem.Collection.AddFolder(newDirecto... | When working with Visual Studio add-ins and project items, it's essential to understand that the Visual Studio project system maintains an in-memory representation of the project state. Simply deleting a folder in the file system does not update this in-memory representation, which is why you encounter the "folder alre... | 6,464 | [
{
"from": "human",
"value": "I'm trying to use Visual Studio 2008's extensibility to write an addin that will create a project folder with various messages in it after parsing an interface. I'm having trouble at the step of creating/adding the folder, however. I've tried using \nProjectItem folder = \nitem.... |
I'm having an issue with a query that currently uses
LEFT JOIN weblog_data AS pwd
ON (pwd.field_id_41 != ''
AND pwd.field_id_41 LIKE CONCAT('%', ewd.field_id_32, '%'))
However I'm discovering that I need it to only use that if there is no exact match first. What's happening is that the query is double dipping d... | To solve your issue with the `LEFT JOIN` and avoid double-dipping due to the `LIKE` condition, you can use a subquery to first check for an exact match before applying the `LIKE` condition. Here's a structured approach to achieve this:
1. First, perform an initial `LEFT JOIN` to check for an exact match.
2. If there a... | 7,397 | [
{
"from": "human",
"value": "I'm having an issue with a query that currently uses \nLEFT JOIN weblog_data AS pwd \n ON (pwd.field_id_41 != '' \n AND pwd.field_id_41 LIKE CONCAT('%', ewd.field_id_32, '%'))\n\nHowever I'm discovering that I need it to only use that if there is no exact match first. What's h... |
After reading a bit more about how Gnutella and other P2P networks function, I wanted to start my own peer-to-peer system. I went in thinking that I would find plenty of tutorials and language-agnostic guidelines which could be applied, however I was met with a vague simplistic overview.
I could only find very small, ... | Starting your own peer-to-peer (P2P) system can be an exciting and challenging project! While comprehensive tutorials for building something similar to Gnutella may be scarce, I can help you outline the key concepts, components, and a general architecture that you can use to guide your development. Below are the essent... | 3,989 | [
{
"from": "human",
"value": "After reading a bit more about how Gnutella and other P2P networks function, I wanted to start my own peer-to-peer system. I went in thinking that I would find plenty of tutorials and language-agnostic guidelines which could be applied, however I was met with a vague simplistic... |
This should hopefully be a simple one.
I would like to add an extension method to the System.Web.Mvc.ViewPage< T > class.
How should this extension method look?
My first intuitive thought is something like this:
namespace System.Web.Mvc
{
public static class ViewPageExtensions
{
public static string Get... | To create an extension method for the `System.Web.Mvc.ViewPage<T>` class, you need to ensure that the extension method is generic, and you want to enforce that the generic type `T` is a reference type. Here's how you can implement this:
### Step 1: Create the Extension Class
You will define a static class for your ext... | 5,023 | [
{
"from": "human",
"value": "This should hopefully be a simple one.\nI would like to add an extension method to the System.Web.Mvc.ViewPage< T > class.\nHow should this extension method look?\nMy first intuitive thought is something like this:\nnamespace System.Web.Mvc\n{\n public static class ViewPageEx... |
I was reading Andrew Kennedy's blog post series on units of measurement in F# and it makes a lot of sense in a lot of cases. Are there any other languages that have such a system?
Edit: To be more clear, I mean the flexible units of measurement system where you can define your own arbitrarily.
| Yes, there are several programming languages and libraries that offer flexible units of measurement systems, allowing you to define and work with your own custom units. Here are a few notable examples:
1. **Scala**: The **Squants** library in Scala provides a powerful DSL for defining and working with quantities and u... | 7,446 | [
{
"from": "human",
"value": "I was reading Andrew Kennedy's blog post series on units of measurement in F# and it makes a lot of sense in a lot of cases. Are there any other languages that have such a system?\nEdit: To be more clear, I mean the flexible units of measurement system where you can define your... |
I'm trying to get Google AppEngine to work on my Debian box and am getting the following error when I try to access my page:
<type 'exceptions.ImportError'>: No module named core.exceptions
The same app works fine for me when I run it on my other Ubuntu box, so I know it's not a problem with the app itself. However, ... | It sounds like you've identified the root cause of the issue related to the missing `core` directory in your Google App Engine project. When you turned your App Engine app into a CVS project, it likely didn't include all necessary directories and files, which is why you encountered the `ImportError`.
For future refere... | 7,340 | [
{
"from": "human",
"value": "I'm trying to get Google AppEngine to work on my Debian box and am getting the following error when I try to access my page:\n<type 'exceptions.ImportError'>: No module named core.exceptions \n\nThe same app works fine for me when I run it on my other Ubuntu box, so I know it's ... |
Despite my lack of coding knowledge I managed to write a small little app in VB net that a lot of people are now using. Since I made it for free I have no way of knowing how popular it really is and was thinking I could make it ping some sort of online stat counter so I could figure out if I should port it to other la... | To create a simple "ping" in VB.NET that sends a request to a specified URL without opening any windows or requiring a user interface, you can use the `HttpClient` class, which is part of the `System.Net.Http` namespace. This can be accomplished in just a few lines of code.
Here’s a simple example of how you might do ... | 6,261 | [
{
"from": "human",
"value": "Despite my lack of coding knowledge I managed to write a small little app in VB net that a lot of people are now using. Since I made it for free I have no way of knowing how popular it really is and was thinking I could make it ping some sort of online stat counter so I could f... |
Our dev shop currently uses Visual SourceSafe. We all know how that could end up (badly), so we're investigating other systems. First up is Perforce. Does anyone have experience with using it and its integration into Visual Studio (2003/2005/2008)? Is it as good as any other, or is it pretty solid with good features, c... | Perforce (now known as Helix Core) is a version control system that has been widely used in the software development industry, especially for large projects and teams. Here are some key points regarding Perforce, particularly in the context of integration with Visual Studio (2003/2005/2008) and its features compared to... | 5,912 | [
{
"from": "human",
"value": "Our dev shop currently uses Visual SourceSafe. We all know how that could end up (badly), so we're investigating other systems. First up is Perforce. Does anyone have experience with using it and its integration into Visual Studio (2003/2005/2008)? Is it as good as any other, or... |
I've got two Silverlight Controls in my project, both have properties TeamId. I would like to bind these together in XAML in the control hosting both user controls similar to:
<agChat:UserTeams x:Name="oUserTeams" />
<agChat:OnlineUser x:Name="oOnlineUsers" TeamId="{Binding ElementName=oUserTeams, Path... | The error you are encountering suggests that the binding expression is not being recognized when the `OnlineUser` control is being instantiated. This is often due to the order of creation of the controls or the fact that the properties are not fully set up at the time the XAML is being parsed.
In Silverlight, binding ... | 4,268 | [
{
"from": "human",
"value": "I've got two Silverlight Controls in my project, both have properties TeamId. I would like to bind these together in XAML in the control hosting both user controls similar to:\n <agChat:UserTeams x:Name=\"oUserTeams\" />\n <agChat:OnlineUser x:Name=\"oOnlineUsers\... |
I'm working on a spec for a piece of software for my company and as part of the auditing system I think it would be neat if there was a way to grab the current Active Directory user.
Hopefully something like:
Dim strUser as String
strUser = ActiveDirectory.User()
MsgBox "Welcome back, " & strUser
| To retrieve the current Active Directory user in a Windows environment, you can use different methods depending on the programming language and framework you're using. Assuming you're working with VBA (Visual Basic for Applications), you can achieve this by leveraging Windows API calls to get the username of the curren... | 5,658 | [
{
"from": "human",
"value": "I'm working on a spec for a piece of software for my company and as part of the auditing system I think it would be neat if there was a way to grab the current Active Directory user.\nHopefully something like:\nDim strUser as String\nstrUser = ActiveDirectory.User()\nMsgBox \"We... |
I am getting this error now that I hit version number 1.256.0:
Error 4 Invalid product version '1.256.0'. Must be of format '##.##.####'
The installer was fine with 1.255.0 but something with 256 (2^8) it doesn't like. I found this stated on msdn.com:
The Version property must be formatted as N.N.N, where each N r... | The error you're encountering suggests that the installer you are using has specific constraints on the version number format. Although the version number `1.256.0` adheres to the general formatting rules (N.N.N), it appears that the software or installer in question has a more restrictive interpretation of those rules... | 7,103 | [
{
"from": "human",
"value": "I am getting this error now that I hit version number 1.256.0:\nError 4 Invalid product version '1.256.0'. Must be of format '##.##.####'\nThe installer was fine with 1.255.0 but something with 256 (2^8) it doesn't like. I found this stated on msdn.com:\nThe Version propert... |
I'm trying to place this menu on the left hand side of the page:
<div class="left-menu" style="left: 123px; top: 355px">
<ul>
<li> Categories </li>
<li> Weapons </li>
<li> Armor </li>
<li> Manuals </li>
<li> Sustenance </li>
<li> Test </li>
</ul>... | To ensure that your left menu and main content area are positioned correctly regardless of screen size, you can use CSS Flexbox or CSS Grid for layout. Below, I'll provide a Flexbox approach that allows for a responsive design.
### HTML Structure
You can wrap the menu and main content divs in a container:
```html
<d... | 2,899 | [
{
"from": "human",
"value": "I'm trying to place this menu on the left hand side of the page:\n\n\n<div class=\"left-menu\" style=\"left: 123px; top: 355px\"> \n <ul> \n <li> Categories </li> \n <li> Weapons </li> \n <li> Armor </li> \n <li> Manuals </li> \n <li> ... |
I was wondering if anyone tried migrating between TS and SVN/CC.
What I mean by migrating is importing and exporting the repository between source control systems without losing the history.
How good are the tools to migrate to and from VSTS?
I am also interested in knowing any opinion regarding using Team System fro... | Migrating between different source control systems while preserving the commit history is a challenging but achievable task. Below is an overview of some common practices, tools, and considerations for migrating from Subversion (SVN) or Concurrent Versions System (CVS) to Team Foundation Server (TFS) or Azure DevOps (p... | 4,873 | [
{
"from": "human",
"value": "I was wondering if anyone tried migrating between TS and SVN/CC. \nWhat I mean by migrating is importing and exporting the repository between source control systems without losing the history.\nHow good are the tools to migrate to and from VSTS? \nI am also interested in knowing... |
Is there a way of getting all required assemblies (excluding the .net framework) for a .net project into a folder ready to be packaged into an nsis as setup file?
I've tried writing a small console app that uses reflection to get a list of dlls but have got stuck with finding a foolproof way of determining if a dll is ... | To package a .NET project into a setup file with NSIS while excluding .NET Framework assemblies, you can use several methods. Here's a comprehensive approach to collect all required assemblies (excluding .NET Framework ones) into a folder.
### Method 1: Using MSBuild and DotNet CLI
The .NET CLI provides commands to p... | 1,619 | [
{
"from": "human",
"value": "Is there a way of getting all required assemblies (excluding the .net framework) for a .net project into a folder ready to be packaged into an nsis as setup file?\nI've tried writing a small console app that uses reflection to get a list of dlls but have got stuck with finding a... |
Does the VFW (Video For Windows) API support Alpha Channel Transparency? I want to be able to export video with Alpha channel information. How can I do this in VC6?
| The Video for Windows (VFW) API does not natively support alpha channel transparency in the way that modern video frameworks do. VFW was primarily designed for handling standard video formats that do not include an alpha channel. However, there are some workarounds you might consider if you're looking to manage transpa... | 7,732 | [
{
"from": "human",
"value": "Does the VFW (Video For Windows) API support Alpha Channel Transparency? I want to be able to export video with Alpha channel information. How can I do this in VC6?\n"
},
{
"from": "gpt",
"value": "The Video for Windows (VFW) API does not natively support alpha chann... |
got a new blog at wordpress few days ago (http://ghads.wordpress.com) and I want to post some code snippets now or then. Is there anyway to make it look like code without paying for extra plugins?
| Yes, you can definitely format code snippets in your WordPress blog without needing to pay for extra plugins. Here are a few methods you can use:
### 1. Use the Code Block
If you are using the Block Editor (Gutenberg), you can easily add a code block:
1. Click the "+" button to add a new block.
2. Search for "Code" ... | 6,246 | [
{
"from": "human",
"value": "got a new blog at wordpress few days ago (http://ghads.wordpress.com) and I want to post some code snippets now or then. Is there anyway to make it look like code without paying for extra plugins?\n"
},
{
"from": "gpt",
"value": "Yes, you can definitely format code s... |
I've got an application that uses a hibernate(annotations)/mysql combination for ORM. In that application, I got an entity with a Date field. I'm looking for a way to select on that date within a time range (so hh:mm:ss without the date part).
In MySQL there's a function TIME(expression) that can extract the time part... | In Hibernate, you can achieve the desired functionality without resorting to native queries or looping through results in Java. While Hibernate does not provide a direct method for extracting time from a Date field, you can utilize HQL (Hibernate Query Language) to create a condition that effectively extracts the time ... | 6,864 | [
{
"from": "human",
"value": "I've got an application that uses a hibernate(annotations)/mysql combination for ORM. In that application, I got an entity with a Date field. I'm looking for a way to select on that date within a time range (so hh:mm:ss without the date part). \nIn MySQL there's a function TIME(... |
I want to do something like:
MyObject myObj = GetMyObj(); // Create and fill a new object
MyObject newObj = myObj.Clone();
And then make changes to the new object that are not reflected in the original object.
I don't often need this functionality, so when it's been necessary, I've resorted to creating a new object an... | In C#, if you want to create a deep copy or clone of an object, you have several options depending on your requirements and the complexity of the object. Here are some common approaches:
### 1. Implement ICloneable Interface
You can implement the `ICloneable` interface in your class. This allows you to define a `Clone... | 4,483 | [
{
"from": "human",
"value": "I want to do something like:\nMyObject myObj = GetMyObj(); // Create and fill a new object\nMyObject newObj = myObj.Clone();\n\nAnd then make changes to the new object that are not reflected in the original object.\nI don't often need this functionality, so when it's been necess... |
I'm looking for libraries to:
read and write meta data (for example ID3v2 tags in mp3 and all)
convert compressed to to raw audio data and if possible raw audio data to mp3, ogg, aac, ...
digitally process the audio data (energy, timbre, Mel Frequency Cepstral Coefficients - MFCC, FFT, LPC, Autocorrelation, Wavelet, .... | It sounds like you're looking for a comprehensive set of libraries in Java (or compatible languages) that can handle audio metadata, audio conversion, and advanced digital processing. Given your previous experiences, here are some alternatives and suggestions that might meet your needs:
### Libraries for Metadata
1. ... | 3,886 | [
{
"from": "human",
"value": "I'm looking for libraries to:\n\nread and write meta data (for example ID3v2 tags in mp3 and all)\nconvert compressed to to raw audio data and if possible raw audio data to mp3, ogg, aac, ...\ndigitally process the audio data (energy, timbre, Mel Frequency Cepstral Coefficients ... |
SharePoint 2007 (both Moss and Wss) exposes document libraries via web dav, allowing you to create documents via essentially file system level activities (e.g. saving documents to a location).
SharePoint also seems to expose lists via the same web dav interface, as directories but they are usually empty. Is it possibl... | In SharePoint 2007, while WebDAV is primarily designed for document libraries to support operations like creating, uploading, and manipulating documents at a file system level, it does indeed expose lists as directories. However, manipulating list items directly through WebDAV is not straightforward, and the capabiliti... | 7,455 | [
{
"from": "human",
"value": "SharePoint 2007 (both Moss and Wss) exposes document libraries via web dav, allowing you to create documents via essentially file system level activities (e.g. saving documents to a location).\nSharePoint also seems to expose lists via the same web dav interface, as directories ... |
Say you have an entity like a vehicle that you are capturing detailed information about. The car you want to capture is painted red, black and white. The front tires are Bridgestone 275/35-18 and the rear tires are 325/30-19. And sometimes you can have just two tires (yes this would be considered a motorcycle which is ... | Your current approach of creating separate tables for each field that can have multiple values is a common strategy known as normalization. While normalization helps eliminate data redundancy, it can lead to an excessive number of tables, as you pointed out. This complexity can make maintenance, querying, and understan... | 5,063 | [
{
"from": "human",
"value": "Say you have an entity like a vehicle that you are capturing detailed information about. The car you want to capture is painted red, black and white. The front tires are Bridgestone 275/35-18 and the rear tires are 325/30-19. And sometimes you can have just two tires (yes this w... |
I'm using Zend Studio to do remote debugging of my php scripts on a dev server. It works great for web code, but can I make it work with command line scripts?
I have several helper apps to make my application run. It would be really useful to fire up the remote debugger through command line instead of a web browser so ... | Yes, you can indeed set up remote debugging for command-line PHP scripts using Xdebug with Zend Studio. Here's a step-by-step guide to get you started:
### Step 1: Install and Configure Xdebug
1. **Install Xdebug** if you haven't already done so. You can follow the instructions on the [Xdebug installation guide](http... | 4,106 | [
{
"from": "human",
"value": "I'm using Zend Studio to do remote debugging of my php scripts on a dev server. It works great for web code, but can I make it work with command line scripts?\nI have several helper apps to make my application run. It would be really useful to fire up the remote debugger through... |
I'm writing a simple OpenGL application that uses GLUT. I don't want to roll my own font rendering code, instead I want to use the simple bitmap fonts that ship with GLUT. What are the steps to get them working?
| Using the built-in bitmap fonts provided by GLUT in your OpenGL application is a straightforward process. Here's a step-by-step guide on how to set this up:
### 1. Include Necessary Headers
Make sure to include the necessary headers for OpenGL and GLUT in your source file.
```c
#include <GL/glut.h>
```
### 2. Initia... | 2,292 | [
{
"from": "human",
"value": "I'm writing a simple OpenGL application that uses GLUT. I don't want to roll my own font rendering code, instead I want to use the simple bitmap fonts that ship with GLUT. What are the steps to get them working?\n"
},
{
"from": "gpt",
"value": "Using the built-in bit... |
I've got a solution with several different projects in it, some are pure class libraries and some are web app projects. If I want my default types to be available to all projects, where should I put the config file for the container?
| To make your default types (services, configurations, etc.) available to all projects in your solution, you would typically follow one of these common patterns:
### 1. **Create a Shared Library (Class Library) for Dependency Injection Configuration**
1. **Create a New Class Library Project:**
- Add a new class li... | 6,192 | [
{
"from": "human",
"value": "I've got a solution with several different projects in it, some are pure class libraries and some are web app projects. If I want my default types to be available to all projects, where should I put the config file for the container?\n"
},
{
"from": "gpt",
"value": "... |
Does anyone here have any useful code which uses reduce() function in python? Is there any code other than the usual + and * that we see in the examples?
Refer Fate of reduce() in Python 3000 by GvR
| Certainly! The `reduce()` function from the `functools` module in Python is a powerful tool that can be used for various kinds of data processing. It reduces a sequence to a single cumulative value by applying a binary function iteratively. Below are some interesting examples of using `reduce()` beyond just basic addit... | 5,856 | [
{
"from": "human",
"value": "Does anyone here have any useful code which uses reduce() function in python? Is there any code other than the usual + and * that we see in the examples?\nRefer Fate of reduce() in Python 3000 by GvR\n"
},
{
"from": "gpt",
"value": "Certainly! The `reduce()` function... |
In an embedded application, we have a table describing the various address ranges that are valid on our target board. This table is used to set up the MMU.
The RAM address range is marked as cacheable, but other regions are not. Why is that?
| In an embedded application, managing memory effectively is critical for performance and resource utilization. The distinction between cacheable and non-cacheable memory regions in the Memory Management Unit (MMU) setup is usually based on the characteristics and requirements of the various memory regions.
Here are the... | 6,183 | [
{
"from": "human",
"value": "In an embedded application, we have a table describing the various address ranges that are valid on our target board. This table is used to set up the MMU.\nThe RAM address range is marked as cacheable, but other regions are not. Why is that?\n"
},
{
"from": "gpt",
"... |
Is there some way to hide the browser toolbar / statusbar etc in current window via javascript? I know I can do it in a popup with window.open() but I need to do it this way. Is it possible at all?
| No, it is not possible to hide the browser's toolbar, status bar, or any other browser UI elements using JavaScript in a regular web page. Modern web browsers are designed to maintain user security and privacy, and they do not allow web pages to manipulate or hide their user interface elements.
The ability to control ... | 7,755 | [
{
"from": "human",
"value": "Is there some way to hide the browser toolbar / statusbar etc in current window via javascript? I know I can do it in a popup with window.open() but I need to do it this way. Is it possible at all?\n"
},
{
"from": "gpt",
"value": "No, it is not possible to hide the b... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.