instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
I'm having trouble with redirecting urls using the .htaccess file. This is what my .htaccess file looks like:
Redirect 301 /file-name/example.php http://www.mysite.com/file-name/example-001.php
Redirect 301 /section-name/example.php http://www.my-site.com/section-name/example-002.php
RewriteEngine on
RewriteCond %{HTT... | The issue you are experiencing arises from the ordering and the way the rules in your `.htaccess` file are processed. When a URL is matched by a `Redirect` rule, it will perform that redirection first. However, your `RewriteRule` is being executed afterward because it seems to still process the request in the following... | 37,004 | [
{
"from": "human",
"value": "I'm having trouble with redirecting urls using the .htaccess file. This is what my .htaccess file looks like:\nRedirect 301 /file-name/example.php http://www.mysite.com/file-name/example-001.php\nRedirect 301 /section-name/example.php http://www.my-site.com/section-name/example-... |
trying to mount an smb share on OS X so that the 'www' user can read files from there.
the SMB share is accessible via an Active Directory account. I can mount the share through the Finder (cmd-k ...)
my basic approach is
# 1) create mountpoint
sudo mkdir /Volumes/www_mdisk
# 2) permissions for mountpoint
sudo chown ... | To successfully mount an SMB share on macOS and ensure that the 'www' user can read files from that share, let’s go through the steps more carefully. Your overall approach is correct, but it sounds like there may be issues with the way you're attempting to mount the SMB share. Here are some refined instructions and tro... | 39,081 | [
{
"from": "human",
"value": "trying to mount an smb share on OS X so that the 'www' user can read files from there.\nthe SMB share is accessible via an Active Directory account. I can mount the share through the Finder (cmd-k ...)\nmy basic approach is\n# 1) create mountpoint \nsudo mkdir /Volumes/www_mdisk... |
This question is a follow-up to a question I asked the other day ("Need to find duplicate records but exclude reversed transactions").
I have a Crystal Report which displays customers' fuel transactions. There are occasions when a duplicate transaction will be imported erroneously. If/when this error is discovered, t... | You can achieve the desired outcome in Crystal Reports by using formulas to hide the reversed transactions while still displaying the original transactions. Here’s a step-by-step guide on how to set this up:
### Step 1: Create a Formula Field to Identify Reversed Transactions
1. **Open Crystal Reports** and go to the... | 37,557 | [
{
"from": "human",
"value": "This question is a follow-up to a question I asked the other day (\"Need to find duplicate records but exclude reversed transactions\").\nI have a Crystal Report which displays customers' fuel transactions. There are occasions when a duplicate transaction will be imported erron... |
I have an access database with 3 tables.
People
Gifts
PeopleGifts
Using VS 2008, what is the quickest way to get a page up and running which allows me to run queries against these tables and do basic inserts.
I want to have comboboxs bound to fields in the table so a user can click on a person and click on a gift a... | To create a simple web application in Visual Studio 2008 that allows you to query and insert records into your Access database tables (`People`, `Gifts`, `PeopleGifts`), you can follow these steps. This example assumes you are using an ASP.NET Web Forms application.
### Step 1: Set Up Your Project
1. **Create a New P... | 37,194 | [
{
"from": "human",
"value": "I have an access database with 3 tables.\n\nPeople \nGifts\nPeopleGifts\n\nUsing VS 2008, what is the quickest way to get a page up and running which allows me to run queries against these tables and do basic inserts.\nI want to have comboboxs bound to fields in the table so a ... |
In ruby, is there a way to "undefine" a variable or constant once it's been defined?
In our rails environemnts, we define one of three contants to be true, depending on the environment: TESTING, DEVELOPMENT, or PRODUCTION. Then, in controller code, we use defined? to see if what environment we're in, ie: defined? PROD... | In Ruby, constants cannot be "undefined" in the way that you can remove a variable. However, you can reassign the constant, but this will generate a warning because it goes against the Ruby convention of treating constants as immutable.
To achieve your goal of simulating different environments for testing purposes wit... | 40,460 | [
{
"from": "human",
"value": "In ruby, is there a way to \"undefine\" a variable or constant once it's been defined?\nIn our rails environemnts, we define one of three contants to be true, depending on the environment: TESTING, DEVELOPMENT, or PRODUCTION. Then, in controller code, we use defined? to see if ... |
I control access to some of my static web resources with some PHP logic. Because directory-based authorization through the webserver is not suitable or easily possible.
A combination of things determines whether access is granted or denied. And these rules change from time to time.
In the beginning it was a simple re... | Refactoring your access control logic to make it easier to manage and update is a great idea, especially as the complexity of the conditions increases. Both approaches you mentioned have their merits, but let’s explore them a bit more, along with some additional options and established patterns.
### 1. Strategy Patter... | 30,801 | [
{
"from": "human",
"value": "I control access to some of my static web resources with some PHP logic. Because directory-based authorization through the webserver is not suitable or easily possible.\nA combination of things determines whether access is granted or denied. And these rules change from time to... |
We're running into performance issues with our implementation of Team Foundation Build Server and I'm running out of ideas on how to speed things up. We've already added a few PropertyGroup elements to increase the performance on several steps (SkipClean, SkipLabel, SkipInitializeWorkspace), but I think we need to unde... | It sounds like you’re facing a complex set of challenges with your current build system. Here are some strategies that may help improve performance and alleviate some of the issues you’re encountering with Team Foundation Build Server:
### 1. Optimize Shared Assemblies
To avoid building shared assemblies multiple tim... | 39,678 | [
{
"from": "human",
"value": "We're running into performance issues with our implementation of Team Foundation Build Server and I'm running out of ideas on how to speed things up. We've already added a few PropertyGroup elements to increase the performance on several steps (SkipClean, SkipLabel, SkipInitiali... |
This question is more security related than programming related, sorry if it shouldn't be here.
I'm currently developing a web application and I'm curious as to why most websites don't mind displaying their exact server configuration in HTTP headers, like versions of Apache and PHP, with complete "mod_perl, mod_python,... | You're raising a valid point regarding server configuration visibility in HTTP headers from a security perspective. Here's a breakdown of why it's often considered good practice to hide this information and some other considerations:
### Security Considerations
1. **Attack Surface Reduction**: By revealing your serve... | 40,628 | [
{
"from": "human",
"value": "This question is more security related than programming related, sorry if it shouldn't be here.\nI'm currently developing a web application and I'm curious as to why most websites don't mind displaying their exact server configuration in HTTP headers, like versions of Apache and... |
The XML file I want to parse starts with :
<!DOCTYPE plist PUBLIC "-//...//DTD PLIST 1.0//EN" "http://www.....dtd">
So when I start the SAX praser, it tries to access this DTD online, and I get a java.net.UnknownHostException.
I cannot modify the XML file before feeding it to the SAX parser
I have to run even with n... | To prevent the SAX parser from trying to load the DTD from the internet, you can configure the SAX parser to disable DTD validation and to ignore external DTDs entirely. You can achieve this by setting certain properties on the `SAXParserFactory` and using a custom `EntityResolver`.
Here’s how you can do it:
1. **Dis... | 39,563 | [
{
"from": "human",
"value": "The XML file I want to parse starts with :\n<!DOCTYPE plist PUBLIC \"-//...//DTD PLIST 1.0//EN\" \"http://www.....dtd\">\n\nSo when I start the SAX praser, it tries to access this DTD online, and I get a java.net.UnknownHostException.\n\nI cannot modify the XML file before feed... |
All
I am currently trying implement something along the lines of
dim l_stuff as List(of Stuff)
dim m_stuff as new Stuff
m_stuff.property1 = 1
m_stuff.property2 = "This"
if not l_stuff.exists(m_stuff) then
l_stuff.add(m_stuff)
end if
This fails obviously as the Exist method is looking for a predicate of Stuff... | In order to achieve what you're trying to do—checking if an object is already in a list and avoiding duplicates—you need to ensure that the comparison method for your `Stuff` class is properly defined.
In VB.NET, the `Contains` method checks for equality based on the default equality comparer, which means it checks i... | 38,993 | [
{
"from": "human",
"value": "All \nI am currently trying implement something along the lines of \ndim l_stuff as List(of Stuff)\n\ndim m_stuff as new Stuff\n\nm_stuff.property1 = 1\nm_stuff.property2 = \"This\"\n\nif not l_stuff.exists(m_stuff) then\n l_stuff.add(m_stuff)\nend if\n\nThis fails obviously... |
I have to add either an embed tag for Firefox or an object tag for Internet Explorer with JavaScript to address the appropriate ActiveX / Plugin depending on the browser. The plugin could be missing and needs to get downloaded in this case. The dynamically added embed tag for Firefox works as expected. The dynamically ... | To dynamically add an `<object>` tag for Internet Explorer and an `<embed>` tag for Firefox, you can use JavaScript to detect the browser type and create the appropriate tag. Since you mentioned that the `<embed>` tag works well for Firefox, I’ll focus on the Internet Explorer `<object>` implementation.
Below is a gen... | 37,160 | [
{
"from": "human",
"value": "I have to add either an embed tag for Firefox or an object tag for Internet Explorer with JavaScript to address the appropriate ActiveX / Plugin depending on the browser. The plugin could be missing and needs to get downloaded in this case. The dynamically added embed tag for Fi... |
There's this program, pdftotext, that can convert a pdf file to a text file. To use it directly on the linux console:
pdftotext file.pdf
That will generate a file.txt on the same directory as the pdf file. I was looking for a way to do it from inside a php program, and after some googling I ended with two commands tha... | The error message you're seeing indicates that the `pdftotext` command is unable to find the shared library `libfontconfig.so.1`. This is likely due to the environment in which your PHP script is running not having access to the necessary libraries.
When you run commands from the command line, your shell environment h... | 39,490 | [
{
"from": "human",
"value": "There's this program, pdftotext, that can convert a pdf file to a text file. To use it directly on the linux console:\npdftotext file.pdf\n\nThat will generate a file.txt on the same directory as the pdf file. I was looking for a way to do it from inside a php program, and after... |
I have a program that can have a lot of parameters (we have over +30 differents options).
Example:
myProgram.exe -t alpha 1 -prod 1 2 -sleep 200
This is 3 Commands (from command pattern object at the end) that each contain some parameters. Inside the code we parse all command (start with -) and get a list of string (sp... | To address your need to process command-line parameters efficiently without relying heavily on multiple `if` statements, you can utilize the **Command Pattern** in conjunction with a **Dictionary** for command registration. This approach allows you to map command names to their corresponding command handlers dynamicall... | 38,697 | [
{
"from": "human",
"value": "I have a program that can have a lot of parameters (we have over +30 differents options).\nExample:\nmyProgram.exe -t alpha 1 -prod 1 2 -sleep 200\nThis is 3 Commands (from command pattern object at the end) that each contain some parameters. Inside the code we parse all command... |
How to pack python libs I'm using so I can distribute them with my app and have as few dependencies as possible and also not to conflict with different lib/version that is already on my system.
L.E.: Sorry i forgot to specify. I will be doing this on linux. And I'm not referring in making my app a installable file like... | To package your Python application along with its dependencies and avoid conflicts with system-wide libraries, you can use several approaches. Here's a guideline to help you organize your files and include the libraries you need:
### 1. Use a Virtual Environment
Using a virtual environment is a good practice that all... | 38,662 | [
{
"from": "human",
"value": "How to pack python libs I'm using so I can distribute them with my app and have as few dependencies as possible and also not to conflict with different lib/version that is already on my system.\nL.E.: Sorry i forgot to specify. I will be doing this on linux. And I'm not referrin... |
I am working with Windows Forms Databinding, implementing interfaces like IDataErrorInfo. In order for this to work, the domain(or business) object is allowed to be in an invalid state. In fact, the domain object needs to retain the invalid value as the user entered it for IDataErrorInfo to work properly. As long as... | You’ve raised a crucial distinction in designing a robust application with data binding in Windows Forms, particularly when implementing interfaces like `IDataErrorInfo`. The concepts of constraints and validation serve different purposes in the context of application logic, and understanding their differences can sign... | 38,264 | [
{
"from": "human",
"value": "I am working with Windows Forms Databinding, implementing interfaces like IDataErrorInfo. In order for this to work, the domain(or business) object is allowed to be in an invalid state. In fact, the domain object needs to retain the invalid value as the user entered it for IDa... |
my goal is to get lots of rows from a translation table. I use an ID to get a subset of the table (say 50 rows) then I use another ID to the rows I want from this subset. Using typed datasets I do the following to get the main dataset:
funderTextsDS.tbl_funderTextsDataTable fd =
(funderTextsDS.tbl_funderTextsDataTabl... | It looks like you've made significant progress in optimizing your code by leveraging LINQ and caching the results in a list. Your approach minimizes database calls and improves performance. Here are a few additional suggestions and considerations to further enhance your LINQ performance and maintainability:
1. **Use D... | 37,824 | [
{
"from": "human",
"value": "my goal is to get lots of rows from a translation table. I use an ID to get a subset of the table (say 50 rows) then I use another ID to the rows I want from this subset. Using typed datasets I do the following to get the main dataset: \nfunderTextsDS.tbl_funderTextsDataTable fd... |
I created a vbscript custom action which checks for some registry keys and alters them if neccessary. In case a key could not be written or something like that, the setup should be aborted.
In order to achieve this, I set a property which I tried to use as a condition for the next step within the execute sequence but t... | In WiX or any Windows Installer package, it is common to use custom actions to perform additional checks or configurations during the installation process. However, as you've discovered, a custom action executed in the sequence cannot directly set properties that can be used to control subsequent steps due to the way W... | 39,125 | [
{
"from": "human",
"value": "I created a vbscript custom action which checks for some registry keys and alters them if neccessary. In case a key could not be written or something like that, the setup should be aborted.\nIn order to achieve this, I set a property which I tried to use as a condition for the n... |
I searched all over this site and the web for a good and simple example of autocomplete using jQuery and ASP.NET. I wanted to expose the data used by autocomplete with a webservice (and will probably do that next). In the meantime, I got this working, but it seems a little hacky...
In my page I have a text box:
<input ... | Your current implementation of jQuery autocomplete with an ASP.NET backend does work and achieves the desired functionality. However, there are indeed some improvements that can help you to streamline and enhance your implementation. Below are some suggestions:
### 1. Use a Web Service
Instead of using an `.aspx` pag... | 35,863 | [
{
"from": "human",
"value": "I searched all over this site and the web for a good and simple example of autocomplete using jQuery and ASP.NET. I wanted to expose the data used by autocomplete with a webservice (and will probably do that next). In the meantime, I got this working, but it seems a little hacky... |
What I'm trying to do is run the same SQL select on many Oracle databases (at least a dozen), and display the output in a Gridview.
I've hacked together something that works but unfortunately it's very slow. I think its exacerbated by the fact that at least 1 of the dozen databases will invariably be unreachable or ot... | Your current implementation is indeed running a loop to connect to each Oracle database, which can lead to performance issues, especially if some of those databases are unreachable or slow to respond. Here are some strategies to improve both the performance and the .NET design of your code:
### 1. Asynchronous Program... | 37,275 | [
{
"from": "human",
"value": "What I'm trying to do is run the same SQL select on many Oracle databases (at least a dozen), and display the output in a Gridview.\nI've hacked together something that works but unfortunately it's very slow. I think its exacerbated by the fact that at least 1 of the dozen data... |
I'm using System.Windows.SplashScreen to add a splash screen to my WinForms app (it has a lot of WPF controls, but the 'main window' is still a System.Windows.Forms.Form object). When the splash screen closes the whole app goes as well.
Can I stop it taking the whole app with it?
| When you're using a `System.Windows.SplashScreen` in a WinForms application, it's important to manage the splash screen's lifecycle carefully to ensure it doesn't inadvertently close your entire application when it is dismissed.
Here are a few strategies you can use to prevent the splash screen from closing the entire... | 37,670 | [
{
"from": "human",
"value": "I'm using System.Windows.SplashScreen to add a splash screen to my WinForms app (it has a lot of WPF controls, but the 'main window' is still a System.Windows.Forms.Form object). When the splash screen closes the whole app goes as well.\nCan I stop it taking the whole app with i... |
Does anyone know how to modify the content of the Excel ribbon at runtime with VSTO 2005SE? Not only update labels or dynamic menus, but also add or remove buttons, tabs, groups, drop downs etc. At runtime means not only at my add-in startup, but also during work with Excel.
| In VSTO (Visual Studio Tools for Office) 2005 SE, the customization of the Excel ribbon is somewhat limited compared to later versions of VSTO. However, you can still modify the ribbon content dynamically, though the capabilities for adding or removing controls at runtime are restricted.
### Modifying the Ribbon in VS... | 39,200 | [
{
"from": "human",
"value": "Does anyone know how to modify the content of the Excel ribbon at runtime with VSTO 2005SE? Not only update labels or dynamic menus, but also add or remove buttons, tabs, groups, drop downs etc. At runtime means not only at my add-in startup, but also during work with Excel.\n"
... |
Ok so I've implemented both REST and SOAP services and I like both depending on the context. For me, WS* is great when I want an explicit contract between the server and the client e.g. for sensitive information or for mission critical stuff. REST on the other hand whilst flexible in terms of the schema definition, is ... | You bring up some very valid points regarding the use of REST and SOAP (WS*) in different contexts. Both approaches have their strengths and weaknesses, and the choice between them often comes down to the specific requirements of the application at hand.
### REST vs. SOAP
1. **Flexibility vs. Formality**:
- **REST... | 39,860 | [
{
"from": "human",
"value": "Ok so I've implemented both REST and SOAP services and I like both depending on the context. For me, WS* is great when I want an explicit contract between the server and the client e.g. for sensitive information or for mission critical stuff. REST on the other hand whilst flexib... |
I've written my first C# iterator today. Woohoo.
Interestingly, it has side effects. My iterator filters out invalid files from a directory and returns a sequence of valid files to process. Wheneve it encounters an invlaid file, it moves it to another directory.
I tried implementing it as a LINQ query, but really don't... | It's great to hear that you've written your first C# iterator! Iterators are a powerful feature of the language and can indeed help simplify code when used appropriately. However, your question about having side effects within an iterator is very valid and touches on some important design principles.
### Side Effects ... | 38,493 | [
{
"from": "human",
"value": "I've written my first C# iterator today. Woohoo.\nInterestingly, it has side effects. My iterator filters out invalid files from a directory and returns a sequence of valid files to process. Wheneve it encounters an invlaid file, it moves it to another directory.\nI tried implem... |
I'm not at all familiar with VB.NET or ASP. I need to create a simple page which makes a call to a remote web service. I used the wsdl utility which comes with the DotNet SDK to generate a service proxy and write it to a VB file. Unfortunately I have no idea how to reference this code in either my ASPX file or the code... | Yes, you can absolutely work with ASP.NET and VB.NET without Visual Studio. Since you've already generated a service proxy using the `wsdl` utility, here’s how you can reference it and use it in your ASPX page and code-behind.
### Steps to Integrate the Proxy
1. **Ensure You Have the Proxy File**: Make sure you have ... | 37,725 | [
{
"from": "human",
"value": "I'm not at all familiar with VB.NET or ASP. I need to create a simple page which makes a call to a remote web service. I used the wsdl utility which comes with the DotNet SDK to generate a service proxy and write it to a VB file. Unfortunately I have no idea how to reference thi... |
What is the best way to load-test an application that relies heavily on posts with viewstate (same posts can't be sent twice, so a simple record / replay won't do)?
Can I generate the viewstate to be used in in the posts?
| When load-testing an application that relies heavily on POST requests with viewstate, it's important to understand how viewstate works in ASP.NET applications. Viewstate is used to preserve page and control values between postbacks, and it is typically encoded and tied to the session state of the user.
### Here’s a st... | 38,020 | [
{
"from": "human",
"value": "What is the best way to load-test an application that relies heavily on posts with viewstate (same posts can't be sent twice, so a simple record / replay won't do)?\nCan I generate the viewstate to be used in in the posts? \n"
},
{
"from": "gpt",
"value": "When load... |
I have a C/C++ source file with conditional compilation. Before I ship it to customers I want to remove most of the #if statements, so that my customers do not need to worry about passing the right -D options to the compiler.
I have this implemented and working in Python, but it only handles #ifdef and #ifndef stateme... | For parsing and evaluating `#if` statements in C/C++ code, there are a few open-source libraries and approaches you can consider, especially since you are looking for something suitable for Python. Here are some suggestions:
1. **Pycparser**: While primarily a C parser, Pycparser can be used to parse C code and then y... | 39,029 | [
{
"from": "human",
"value": "I have a C/C++ source file with conditional compilation. Before I ship it to customers I want to remove most of the #if statements, so that my customers do not need to worry about passing the right -D options to the compiler.\nI have this implemented and working in Python, but ... |
On my app i am creating a real time trace (not sure how yet but i am!) and on the sp_trace_create function in SQlServer, i know that the @maxfilesize defaults to 5, but on my app its going to be stopped when the user wants to stop it...any ideas how this can be done?
Because i dont want to have to save the files...im ... | It sounds like you're working on a real-time monitoring tool using SQL Server Profiler traces. I'll try to address your concerns step by step.
### Stopping the Trace
To stop a trace in SQL Server, you can use the `sp_trace_setstatus` stored procedure. This allows you to stop a trace programmatically. Here's an exampl... | 36,587 | [
{
"from": "human",
"value": "On my app i am creating a real time trace (not sure how yet but i am!) and on the sp_trace_create function in SQlServer, i know that the @maxfilesize defaults to 5, but on my app its going to be stopped when the user wants to stop it...any ideas how this can be done?\n\nBecause ... |
There are many editions of Eclipse for Java development. I am trying out MyEclipse and am pretty impressed with the out-of-box experience. Before I get too comfortable with it, I would like to find out if it is the best edition available. Feel free to list free or commercial packages, but for the sake of other reade... | When it comes to Java development IDEs, there are several options available that cater to different preferences and needs. Below, I will detail some popular IDEs, including MyEclipse, along with their features related to your considerations and their costs.
### 1. **MyEclipse**
- **Cost:** Commercial (typically around... | 37,762 | [
{
"from": "human",
"value": "There are many editions of Eclipse for Java development. I am trying out MyEclipse and am pretty impressed with the out-of-box experience. Before I get too comfortable with it, I would like to find out if it is the best edition available. Feel free to list free or commercial ... |
I'm trying to import a large SQL file; created by mysqldump on one server, then converted with iconv; using these commands:
$ mysqldump -uxxx -p xxx > data.sql
$ iconv -f UTF-8 -t ISO-8859-1//TRANSLIT data.sql data.iconv.sql
I noticed that the "\x91" in the database had turned into "\xc3\x82\xc2\x91" in the dump, beca... | The issue you’re experiencing with character encoding during the migration from one MySQL server to another is a common one, especially when dealing with different character sets. Here are some steps and recommendations to help you prevent and troubleshoot this issue:
### 1. Understand the Character Sets
When you exp... | 40,230 | [
{
"from": "human",
"value": "I'm trying to import a large SQL file; created by mysqldump on one server, then converted with iconv; using these commands:\n$ mysqldump -uxxx -p xxx > data.sql\n$ iconv -f UTF-8 -t ISO-8859-1//TRANSLIT data.sql data.iconv.sql\n\nI noticed that the \"\\x91\" in the database had ... |
Can anyone provide an object-oriented type helper class for managing a singleton of the SessionFactory and then also for managing Sessions?
| Certainly! To manage a Singleton instance of `SessionFactory` and provide utility methods to handle `Session` objects in an object-oriented manner, you can create a helper class. Below is a sample implementation using Hibernate as an ORM framework.
This implementation includes:
- A singleton `SessionFactory` instance.... | 37,184 | [
{
"from": "human",
"value": "Can anyone provide an object-oriented type helper class for managing a singleton of the SessionFactory and then also for managing Sessions?\n"
},
{
"from": "gpt",
"value": "Certainly! To manage a Singleton instance of `SessionFactory` and provide utility methods to h... |
Im using a fileupload control for my asp application and it throws a HttpException when the file upload size is bigger than the max request length.
As far i understand the fileupload will open a memory stream to a file once the file browse dialog is closed but there is no way of knowing when the dialog is closed so th... | In an ASP.NET application, the `FileUpload` control does not provide a built-in way to check the file size before the upload begins, as the file is not accessible to the server until the upload process is initiated. However, you can implement a solution that allows you to check the file size on the client-side before t... | 40,046 | [
{
"from": "human",
"value": "Im using a fileupload control for my asp application and it throws a HttpException when the file upload size is bigger than the max request length. \nAs far i understand the fileupload will open a memory stream to a file once the file browse dialog is closed but there is no way ... |
In developing Windows forms based application, are there any standards that should be followed when designing your form's main menu system?
Most windows applications with menu systems will have your standard File | Edit | View | Tools | Help menus. How do you determine placement of any additional top level menu item... | Designing menu systems for Windows Forms applications (or any application) requires adherence to established usability principles and conventions to ensure user familiarity and ease of navigation. Here are guidelines based on best practices, along with references to resources for further reading:
### Standards for Men... | 34,548 | [
{
"from": "human",
"value": "In developing Windows forms based application, are there any standards that should be followed when designing your form's main menu system? \nMost windows applications with menu systems will have your standard File | Edit | View | Tools | Help menus. How do you determine place... |
I have a following object model:
- Book
-- Chapter 1
--- Page 1
---- Image 1
---- Image 2
---- Text 1
--- Page 2
...
Resources are way down at the page level. But, I need to know the full path to resources, from the resources' point of view.
One way, is to have resources be aware of their parents.
So my Image ob... | Your concern about coupling and the parent-child relationship in your object model is valid. While the parent-child approach works, it does introduce tight coupling between your resources and their parent structures. This can make your system harder to maintain and understand. There are alternative approaches to consid... | 38,862 | [
{
"from": "human",
"value": "I have a following object model:\n\n- Book \n-- Chapter 1\n--- Page 1\n---- Image 1 \n---- Image 2\n---- Text 1\n--- Page 2 \n...\n\nResources are way down at the page level. But, I need to know the full path to resources, from the resources' point of view. \nOne way, is to have... |
I have a client who had to rebuild his automated build server. He checked out his project folder from my subversion server but is now no longer able to commit - he gets this error:
Error: Commit failed (details follow):
Error: Cannot write to the prototype revision file of transaction
'551-1' because a
Error: prev... | It looks like you've already found the solution to your problem! For the sake of clarity and to help others who might encounter the same issue, let's summarize what happened and how it was resolved.
### Issue Summary
The client was unable to commit changes to a Subversion (SVN) repository, receiving the error message... | 40,451 | [
{
"from": "human",
"value": "I have a client who had to rebuild his automated build server. He checked out his project folder from my subversion server but is now no longer able to commit - he gets this error:\nError: Commit failed (details follow): \nError: Cannot write to the prototype revision file of t... |
I'm using TNMHTTP in Delphi to retrieve the code from a webpage. The code is relatively simple:
NMHTTP1 := TNMHTTP.Create(Self);
NMHTTP1.InputFileMode := FALSE;
NMHTTP1.OutputFileMode := FALSE;
NMHTTP1.ReportLevel := Status_Basic;
NMHTTP1.TimeOut := 3000;
URL := 'http://www....';
NMHTTP1.Get(URL);
S := NMHTTP1.Body;
... | It looks like you're encountering an issue with `TNMHTTP` where it hangs on redirects, despite having set a timeout. Since you mentioned that you are using Delphi 2009 and are open to using Indy, I recommend switching to `TIdHTTP` from the Indy library. It's more versatile and handles redirects more gracefully.
Here's... | 40,588 | [
{
"from": "human",
"value": "I'm using TNMHTTP in Delphi to retrieve the code from a webpage. The code is relatively simple:\nNMHTTP1 := TNMHTTP.Create(Self);\nNMHTTP1.InputFileMode := FALSE;\nNMHTTP1.OutputFileMode := FALSE;\nNMHTTP1.ReportLevel := Status_Basic;\nNMHTTP1.TimeOut := 3000;\n\nURL := 'http://... |
After creating a translucent window (based on example code by Matt Gemmell) I want to get keyboard events in this window. It seems that there are only keyboard events when my application is the active application while I want keyboard events even when my application isn't active but the window is visible.
Basically I ... | To capture keyboard events globally in your macOS application, even when your application is not the active one, you'll need to use a different approach than just handling standard window events. Specifically, you can utilize the **CGEventTap** API provided by Core Graphics.
Here’s a general guide on how to set up a g... | 38,916 | [
{
"from": "human",
"value": "After creating a translucent window (based on example code by Matt Gemmell) I want to get keyboard events in this window. It seems that there are only keyboard events when my application is the active application while I want keyboard events even when my application isn't activ... |
How can I maintain the scroll position of a treeview control in .NET application? For example, I have a treeview control and go through a process of adding various nodes to it tacking them on to the bottom. During this process, I can scroll through the treeview and view different nodes. The problem is when the process ... | Maintaining the scroll position of a TreeView control in a .NET application can indeed be a challenge, especially when nodes are being added dynamically during a process that might involve expanding nodes. When you call methods like `Expand()`, it can disrupt the current scroll position because the TreeView attempts to... | 39,858 | [
{
"from": "human",
"value": "How can I maintain the scroll position of a treeview control in .NET application? For example, I have a treeview control and go through a process of adding various nodes to it tacking them on to the bottom. During this process, I can scroll through the treeview and view differen... |
I have hit a classic problem of needing to do a string replace on a text field in an sql 2000 database. This could either be an update over a whole column or a single field I'm not fussy.
I have found a few examples of how to use updatetext to achieve it but they tend to be in stored procedures, does anyone know of a s... | It's great to hear that you found a workaround by switching to `varchar(8000)`. However, if you ever encounter a situation where you're still dealing with `text` fields in SQL Server 2000 and need to perform string replacements, you can indeed utilize the `UPDATETEXT` command or write a custom solution.
Since you ment... | 40,360 | [
{
"from": "human",
"value": "I have hit a classic problem of needing to do a string replace on a text field in an sql 2000 database. This could either be an update over a whole column or a single field I'm not fussy.\nI have found a few examples of how to use updatetext to achieve it but they tend to be in ... |
If I have...
class Bunny < ActiveRecord::Base
has_many :carrots
end
...how can I check in the View if @bunny has any carrots? I want to do something like this:
<% if @bunny.carrots? %>
<strong>Yay! Carrots!</strong>
<% for carrot in @bunny.carrots %>
You got a <%=h carrot.color %> carrot!<br />
<% end %>
... | In your case, you want to check if the `@bunny` has any associated `carrots`. Instead of using `@bunny.carrots?`, which does not exist, you can check if the `@bunny.carrots` collection is empty or not. This can be done using the `any?` method or by checking the size.
Here’s how you can modify your view code to properl... | 42,020 | [
{
"from": "human",
"value": "If I have...\nclass Bunny < ActiveRecord::Base\n has_many :carrots\nend\n\n...how can I check in the View if @bunny has any carrots? I want to do something like this:\n<% if @bunny.carrots? %>\n <strong>Yay! Carrots!</strong>\n <% for carrot in @bunny.carrots %>\n You got... |
What is the accepted practice for indenting SQL statements?
How should this example be indented?
SELECT column1, column2
FROM table1
WHERE column3 IN
(
SELECT TOP(1) column4
FROM table2
INNER JOIN table3
ON table2.column1 = table3.column1
)
| Indenting SQL statements enhances readability and helps maintain a clear structure, especially with complex queries. While there are no strict standards universally accepted, several commonly followed practices exist. Here are some general guidelines for indenting SQL statements:
1. **Keywords in Uppercase**: Write SQ... | 40,364 | [
{
"from": "human",
"value": "What is the accepted practice for indenting SQL statements?\nHow should this example be indented?\nSELECT column1, column2\nFROM table1\nWHERE column3 IN\n(\nSELECT TOP(1) column4\nFROM table2\nINNER JOIN table3\nON table2.column1 = table3.column1\n)\n\n"
},
{
"from": "g... |
Can someone show me how to fix the width of a column in a datatable with JSF?
My code currently reads:
<h:column>
<f:facet name="header">
<h:outputText value="Data Field 1" />
</f:facet>
<h:commandLink id="dataLink" action="#{pc_SearchResultsFragment.setField1}">
<h:outputText value="#{(qi.d... | To fix the width of a column in a JSF DataTable, you can use CSS styles. You can directly set the width of a column using the `style` attribute in the `<h:column>` tag.
Here's how you can modify your existing code to include a fixed width for the column:
```xml
<h:column style="width: 200px;"> <!-- Change the width v... | 40,601 | [
{
"from": "human",
"value": "Can someone show me how to fix the width of a column in a datatable with JSF?\nMy code currently reads:\n<h:column>\n <f:facet name=\"header\">\n <h:outputText value=\"Data Field 1\" />\n </f:facet>\n <h:commandLink id=\"dataLink\" action=\"#{pc_SearchResultsFrag... |
StackOverflow user jolson had a very nice piece of code that exemplifies how one can register menthods without using strings, but expression trees here.
Is it possible to have something similar for properties instead of methods? To pass a property (not the name of the property) and inside the method to obtain the prope... | Yes, you can achieve something similar for properties using expression trees in C#. The key is to use an `Expression<Func<T, TProperty>>` where `T` is the type containing the property, and `TProperty` is the type of the property itself. This allows you to capture the property expression and extract its name at runtime ... | 40,410 | [
{
"from": "human",
"value": "StackOverflow user jolson had a very nice piece of code that exemplifies how one can register menthods without using strings, but expression trees here.\nIs it possible to have something similar for properties instead of methods? To pass a property (not the name of the property)... |
How do I compare two images & recognize the pattern in an image irrespective of its size and pattern size, and using .Net C#? Also, which algorithms are used for doing so from Image Processing?
| Comparing two images and recognizing patterns irrespective of size and variations is a common task in image processing. In .NET C#, you can utilize several libraries and algorithms to achieve this. Here are some steps, along with the algorithms that can be employed:
### Step 1: Preprocessing the Images
1. **Resize the... | 34,837 | [
{
"from": "human",
"value": "How do I compare two images & recognize the pattern in an image irrespective of its size and pattern size, and using .Net C#? Also, which algorithms are used for doing so from Image Processing?\n"
},
{
"from": "gpt",
"value": "Comparing two images and recognizing pa... |
I'm new to PHP and before I waste a lot of time doing things the hard way, I wanted to find out if there are shortcuts/techniques to creating PHP web forms apps. All this app will do is display web forms with data from 1 or more tables. In addition to displaying data, the user must be able to update the form and add ... | Creating a PHP web forms app for basic CRUD (Create, Read, Update, Delete) operations can be streamlined using various techniques, especially since you are working within the constraints of core PHP and Oracle. Here are some strategies and tools that might help you save time:
### 1. **Code Generators**
While you may n... | 38,904 | [
{
"from": "human",
"value": "I'm new to PHP and before I waste a lot of time doing things the hard way, I wanted to find out if there are shortcuts/techniques to creating PHP web forms apps. All this app will do is display web forms with data from 1 or more tables. In addition to displaying data, the user... |
Title says it mostly. I want to add a simple extension method to the base Dictionary class in C#. At first I was going to name it Pop(TKey key), kind of like the Stack method, but it accepts a key to use for lookup.
Then I was going to do Take(TKey key), but it coincides with the LINQ method of the same name...and alth... | It's great that you want to add an extension method to the `Dictionary` class in C#! Your idea of naming the method is an important consideration, especially in terms of clarity and intent.
Given your use case of finding and removing an element, "Pop" is indeed a valid option since it conveys the idea of retrieving an... | 39,268 | [
{
"from": "human",
"value": "Title says it mostly. I want to add a simple extension method to the base Dictionary class in C#. At first I was going to name it Pop(TKey key), kind of like the Stack method, but it accepts a key to use for lookup.\nThen I was going to do Take(TKey key), but it coincides with t... |
This SQL query was generated by Microsoft Access 2003, and works fine when run, but fails when trying to run from a Macro. Is there any obvious error within the query, or any reason it would not work?
SELECT tblAuction.article_no, tblAuction.article_name, tblAuction.subtitle, tblAuction.current_bid, tblAuction.start_pr... | There are a few reasons why an SQL query that works directly in Microsoft Access might fail when run from a macro. Here are some potential issues and suggestions to troubleshoot:
1. **Macro Permissions**: Ensure that the macro has the necessary permissions to run SQL queries. In Access, macros may run with different p... | 38,587 | [
{
"from": "human",
"value": "This SQL query was generated by Microsoft Access 2003, and works fine when run, but fails when trying to run from a Macro. Is there any obvious error within the query, or any reason it would not work?\nSELECT tblAuction.article_no, tblAuction.article_name, tblAuction.subtitle, t... |
Using SQLite from .net, Is there a way to access the .dump command or something equivalent from the SQLiteConnection class?
| In SQLite, the `.dump` command is used to generate a text representation of the entire database, essentially producing a set of SQL statements that can recreate the database schema and the data. However, this command is typically used in SQLite's command-line interface rather than programmatically through .NET's `SQLit... | 39,471 | [
{
"from": "human",
"value": "Using SQLite from .net, Is there a way to access the .dump command or something equivalent from the SQLiteConnection class?\n"
},
{
"from": "gpt",
"value": "In SQLite, the `.dump` command is used to generate a text representation of the entire database, essentially p... |
How do I test if two dates are within a certain tolerance in NUnit?
| To test if two dates are within a certain tolerance in NUnit, you can use the `Assert.That()` method combined with a custom condition that checks if the difference between the two dates is within the specified tolerance.
Here’s how you can implement it in your unit tests:
1. Determine the tolerance you want to use (... | 40,394 | [
{
"from": "human",
"value": "How do I test if two dates are within a certain tolerance in NUnit?\n"
},
{
"from": "gpt",
"value": "To test if two dates are within a certain tolerance in NUnit, you can use the `Assert.That()` method combined with a custom condition that checks if the difference be... |
which one of the two is more spread? I want to read out the version number from http://freshmeat.net/projects-xml/mysql/mysql.xml?branch_id=46519 but I want to use the one which more people have.
If you know another way to get the latest stable version number from mysql please tell me ;)
| To determine which version of MySQL is more widely used, you typically want to refer to the official MySQL website or trusted repositories. The version number can often be found directly from:
1. **Official MySQL Website**: You can visit [MySQL's official download page](https://dev.mysql.com/downloads/mysql/) to get t... | 41,009 | [
{
"from": "human",
"value": "which one of the two is more spread? I want to read out the version number from http://freshmeat.net/projects-xml/mysql/mysql.xml?branch_id=46519 but I want to use the one which more people have.\nIf you know another way to get the latest stable version number from mysql please ... |
I have a client which is shipping via UPS, and therefore cannot deliver to Post Office boxes. I would like to be able to validate customer address fields in order to prevent them from entering addresses which include a PO box. It would be best if this were implemented as a regex so that I could use a client-side regex ... | To validate customer addresses and prevent them from entering P.O. Box addresses using regular expressions (regex), you can create a regex pattern that looks for common variations of P.O. Box formats. While it's true that no regex can guarantee 100% accuracy in detecting all P.O. Boxes, a well-constructed regex can fil... | 40,337 | [
{
"from": "human",
"value": "I have a client which is shipping via UPS, and therefore cannot deliver to Post Office boxes. I would like to be able to validate customer address fields in order to prevent them from entering addresses which include a PO box. It would be best if this were implemented as a regex... |
I'm trying to show a custom hint in a TWinControl but I can't figure out how to get it's position.
Using position 0,0 shows the hint on the top of my screen (outside the window) so I guess it must be the position of the control on the screen.
Edit:
I've found the TControl Property ClientOrigin which returns what I've e... | Yes, you're on the right track! In a `TWinControl` or any control derived from it, the `ClientOrigin` property provides the position of the control's client area relative to the parent control's client area. This gives you the correct coordinates to display your hint within the boundaries of the control.
If you want t... | 40,497 | [
{
"from": "human",
"value": "I'm trying to show a custom hint in a TWinControl but I can't figure out how to get it's position.\nUsing position 0,0 shows the hint on the top of my screen (outside the window) so I guess it must be the position of the control on the screen.\nEdit:\nI've found the TControl Pro... |
If I have a char which holds a hex value such has 0x53, (S), how can I display this as "S"?
Code:
char test = 0x53;
cout << test << endl;
Thanks!
| To display the character represented by the hexadecimal value `0x53`, you can use the `char` type directly, as you have already done in your code snippet. However, ensure that you include the necessary headers and that you're using the right syntax for outputting to `std::cout`.
Here’s how you can do it:
```cpp
#incl... | 39,281 | [
{
"from": "human",
"value": "If I have a char which holds a hex value such has 0x53, (S), how can I display this as \"S\"?\nCode:\nchar test = 0x53;\ncout << test << endl;\n\nThanks!\n"
},
{
"from": "gpt",
"value": "To display the character represented by the hexadecimal value `0x53`, you can us... |
Is there any performance gain using a CTE over a derived table?
| Common Table Expressions (CTEs) and derived tables are both used in SQL to manage complex queries and enhance readability. However, their performance characteristics can differ depending on several factors.
### Definitions
- **CTE (Common Table Expression)**: A temporary result set defined within the execution scope o... | 39,894 | [
{
"from": "human",
"value": "Is there any performance gain using a CTE over a derived table?\n"
},
{
"from": "gpt",
"value": "Common Table Expressions (CTEs) and derived tables are both used in SQL to manage complex queries and enhance readability. However, their performance characteristics can ... |
What commands in Emacs can I use to insert into the text buffer of a file the current date and time?
(For example, the equivalent in Notepad is simply pressing F5 which is about the only useful feature for Notepad!)
| In Emacs, you can insert the current date and time into the text buffer using several methods. Here are a few common ones:
1. **Using `insert` and `current-time-string` in `ielm` (Emacs Lisp interaction mode)**:
- You can run the following command to insert the current date and time:
```elisp
(insert (cur... | 36,170 | [
{
"from": "human",
"value": "What commands in Emacs can I use to insert into the text buffer of a file the current date and time?\n(For example, the equivalent in Notepad is simply pressing F5 which is about the only useful feature for Notepad!)\n"
},
{
"from": "gpt",
"value": "In Emacs, you can... |
i am developing a iphone application in a view-based project,(not navigation) however i would like to click on a button in that application and able to link to a website,anyone can give me some hint how to make the view being transistion
| To link to a website from a button in your iPhone application, you'll want to use a `UIButton` to handle the tap action, and then present a `WKWebView` to load the website. Here's how you can achieve this in a view-based project using Swift.
### Steps to Implement a Button to Open a Website in a WKWebView:
1. **Impor... | 36,825 | [
{
"from": "human",
"value": "i am developing a iphone application in a view-based project,(not navigation) however i would like to click on a button in that application and able to link to a website,anyone can give me some hint how to make the view being transistion\n"
},
{
"from": "gpt",
"value... |
I used to be able to right click Folders in my project and click 'refresh' to refresh the files within them, I don't see the option to do this any more, how do I fix it? The same thing has happened at work and at home.. has it always been like this and have I gone insane?
| It sounds like you may be experiencing an issue related to the file explorer or IDE you are using. The ability to refresh a folder or its contents by right-clicking might have changed due to software updates or settings. Here are a few things you can try to resolve the issue:
1. **Check the Context Menu**: Right-click... | 41,279 | [
{
"from": "human",
"value": "I used to be able to right click Folders in my project and click 'refresh' to refresh the files within them, I don't see the option to do this any more, how do I fix it? The same thing has happened at work and at home.. has it always been like this and have I gone insane?\n"
... |
I want to increase the I/O priority of a process. Answers for both .NET and Windows Vista would be nice. processexplorer is ok as well.
| To increase the I/O priority of a process in Windows, you can use different methods depending on the tools and environment available. Below are methods for both .NET programming and manual adjustments in Windows Vista, as well as using Process Explorer.
### Method 1: Adjusting I/O Priority using .NET
If you want to c... | 39,159 | [
{
"from": "human",
"value": "I want to increase the I/O priority of a process. Answers for both .NET and Windows Vista would be nice. processexplorer is ok as well.\n"
},
{
"from": "gpt",
"value": "To increase the I/O priority of a process in Windows, you can use different methods depending on t... |
I am probably doing something wrong -- but cant figure why.
I have a DateTime field in my DB keeping a UTC time
My server is in the US, and the browser is in Europe.
The PageLoad Code is as follow:
DateTime t = DateTime.SpecifyKind((DateTime)rdr["startTime"], DateTimeKind.Utc);
label1.Text = t.ToLocalTime().ToString(... | The issue you're encountering is due to how `DateTime` handling works in .NET. The `ToLocalTime()` method converts the `DateTime` to the server's local time, which in your case is set to a US timezone. Since you want to display the time in the browser's local timezone (Europe), you'll need to approach this differently.... | 40,519 | [
{
"from": "human",
"value": "I am probably doing something wrong -- but cant figure why.\nI have a DateTime field in my DB keeping a UTC time \nMy server is in the US, and the browser is in Europe. \nThe PageLoad Code is as follow:\nDateTime t = DateTime.SpecifyKind((DateTime)rdr[\"startTime\"], DateTimeKin... |
I have a threading issue,
I'm setting the ThreadPool.SetMaxThreads(maxThreads, System.Environment.ProcessorCount) to 10.
But when I check how many are avaliable ThreadPool.GetAvailableThreads() it says there are (maxThreads - 1) so 9, but then goes on to use 10 threads.
Any ideas why this is?
Thanks for the help.
| This behavior is indeed a bit confusing at first glance, but it can be explained by understanding how the .NET ThreadPool and the available threads work.
### Key Points About ThreadPool
1. **Max Threads**: When you call `ThreadPool.SetMaxThreads(maxThreads, System.Environment.ProcessorCount)`, you're specifying the u... | 38,548 | [
{
"from": "human",
"value": "I have a threading issue,\nI'm setting the ThreadPool.SetMaxThreads(maxThreads, System.Environment.ProcessorCount) to 10.\nBut when I check how many are avaliable ThreadPool.GetAvailableThreads() it says there are (maxThreads - 1) so 9, but then goes on to use 10 threads.\nAny i... |
The Lab university I work at is in the process of purchasing a laser scanner for scanning 3D objects. All along from the start we've been trying to find a scanner that is able to capture real RAW normals from the actual scanned surface. It seems that most scanners only capture points and then the software interpolates ... | Capturing true "raw normals" from a laser scanner is quite a nuanced topic. Generally, most laser scanners measure points on a surface and then derive normals from those points based on their spatial relationships. This means the normals are often interpolated from the point cloud data rather than directly captured as ... | 42,123 | [
{
"from": "human",
"value": "The Lab university I work at is in the process of purchasing a laser scanner for scanning 3D objects. All along from the start we've been trying to find a scanner that is able to capture real RAW normals from the actual scanned surface. It seems that most scanners only capture p... |
Can you round a .NET TimeSpan object?
I have a Timespan value of: 00:00:00.6193789
Is there a simple way to keep it a TimeSpan object but round it to something like
00:00:00.62?
| In .NET, the `TimeSpan` structure does not provide a built-in method for rounding directly. However, you can create a function to round the `TimeSpan` to a specified number of decimal places by manipulating its total seconds or total milliseconds.
Here's how you can round a `TimeSpan` to two decimal places and return... | 40,005 | [
{
"from": "human",
"value": "Can you round a .NET TimeSpan object?\nI have a Timespan value of: 00:00:00.6193789\nIs there a simple way to keep it a TimeSpan object but round it to something like\n00:00:00.62?\n"
},
{
"from": "gpt",
"value": "In .NET, the `TimeSpan` structure does not provide a... |
HI,
I have 3 tables: Clips, Books and relationships between ClipBook
Problem is:
i need get book that has bookID=4 with some clips i mean many-to-many
in simple text sql it will be something like this:
select * from Clips where clipID in (select clipID from ClipBook where bookID=4)
Question is:
How can i do this with L... | You can achieve the desired query in LINQ without using the `Join` operator by using the `Where` method with a nested `Any` or `Contains` method. Assuming you have three classes representing your tables: `Clip`, `Book`, and `ClipBook`, you can write your LINQ query like this.
First, let's assume your classes are struc... | 40,339 | [
{
"from": "human",
"value": "HI,\nI have 3 tables: Clips, Books and relationships between ClipBook\nProblem is:\ni need get book that has bookID=4 with some clips i mean many-to-many\nin simple text sql it will be something like this:\nselect * from Clips where clipID in (select clipID from ClipBook where b... |
I understand that using the "===" compares type, so running the following code results in "not equal" because it's comparing a number type to a string type.
var a = 20;
var b = "20";
if (a === b) {
alert("They are equal");
} else {
alert("They are not equal");
}
But I dont understand how using ... | You're correct in your understanding of the difference between `===` and `==` in JavaScript.
1. **Strict Equality (`===`)**: This operator checks both the value and the type. Since `a` is a number (`20`), and `b` is a string (`"20"`), `a === b` evaluates to `false`, leading to the alert "They are not equal".
2. **Loo... | 40,133 | [
{
"from": "human",
"value": "I understand that using the \"===\" compares type, so running the following code results in \"not equal\" because it's comparing a number type to a string type.\nvar a = 20;\nvar b = \"20\";\n if (a === b) {\n alert(\"They are equal\");\n } else {\n alert(\"T... |
I just updated from SVN, and one of my files has now disappeared... of course it wasn't committed because I knew I needed to update+merge first. I think maybe the guy renamed the file which means my SVN client deleted my file.
I'm using VC++ 2008 & Visual SVN.
Help... and for reference how is this kind of thing suppose... | When using Subversion (SVN), it's common to encounter issues related to file renaming, especially if you're in the process of updating and merging changes. Here are steps you can take to recover your missing file and some guidelines to avoid this situation in the future:
### Steps to Recover Your Missing File
1. **Ch... | 38,452 | [
{
"from": "human",
"value": "I just updated from SVN, and one of my files has now disappeared... of course it wasn't committed because I knew I needed to update+merge first. I think maybe the guy renamed the file which means my SVN client deleted my file.\nI'm using VC++ 2008 & Visual SVN.\nHelp... and for ... |
When requesting hardware for a WebLogic server, what hardware would best improve its performance? Should I give it lots of memory, CPU, fast hard drives? The OS is going to be Redhat 4 either Standard or Enterprise.
| When optimizing hardware for a WebLogic Server, several factors contribute to its performance. Here are key hardware components to consider:
1. **Memory (RAM)**:
- **More Memory**: WebLogic Server performance benefits significantly from increased RAM. A larger heap size allows more application data to be stored in ... | 35,274 | [
{
"from": "human",
"value": "When requesting hardware for a WebLogic server, what hardware would best improve its performance? Should I give it lots of memory, CPU, fast hard drives? The OS is going to be Redhat 4 either Standard or Enterprise.\n"
},
{
"from": "gpt",
"value": "When optimizing ha... |
I have an application that uses Ajax.Request and its onSuccess event handler in lots of places.
I need to call a function (that will check the response) before all these onSuccess events fire. I tried using Ajax.Responders.register with onComplete event but it fires after Ajax.Request's onSuccess event. Any suggestion... | To handle the scenario where you want to call a function before the `onSuccess` events of `Ajax.Request`, you can utilize the `onCreate` event provided by the `Ajax.Responders`. This event is triggered right before the request is sent, and it allows you to intercept or manipulate the request before any response is proc... | 40,250 | [
{
"from": "human",
"value": "I have an application that uses Ajax.Request and its onSuccess event handler in lots of places.\nI need to call a function (that will check the response) before all these onSuccess events fire. I tried using Ajax.Responders.register with onComplete event but it fires after Ajax... |
Are there any free online tools out there to make visio kind of diagrams. I would like to practice my flowchart skills. Are there any good sites or books or articles out there that discuss best practices for flowchart diagrams.
| Yes, there are several free online tools you can use to create flowcharts and similar diagrams. Here are some popular ones:
### Free Online Tools for Flowcharts
1. **Lucidchart**:
- Offers a free tier that allows for basic diagramming.
- User-friendly interface with collaboration features.
2. **Draw.io (now ca... | 38,381 | [
{
"from": "human",
"value": "Are there any free online tools out there to make visio kind of diagrams. I would like to practice my flowchart skills. Are there any good sites or books or articles out there that discuss best practices for flowchart diagrams.\n"
},
{
"from": "gpt",
"value": "Yes, t... |
I have a DataGridViewComboBoxColumn in a DataGridView that's based on a lookup table.
The ValueMember and DisplayMember fields are bound to string columns in the DataTable. All rows have a value for both fields - except for a special record where the value field is deliberately set to NULL.
However, when I choose this ... | This is a common issue when using `DataGridViewComboBoxColumn` with `DataTable` bindings in Windows Forms. By default, when you select a value in a combo box that doesn't have a corresponding value in the `ValueMember`, the `DataGridView` will typically store an empty string instead of `DBNull.Value`.
To ensure that t... | 40,304 | [
{
"from": "human",
"value": "I have a DataGridViewComboBoxColumn in a DataGridView that's based on a lookup table.\nThe ValueMember and DisplayMember fields are bound to string columns in the DataTable. All rows have a value for both fields - except for a special record where the value field is deliberately... |
I have a vertical menu in my system which is basically made of HTML ul/li with CSS styling (see image below). However I don't want the li items which are wider than the menu to wrap, I would prefer them to overflow with a horizontal scroll bar at the bottom of the menu. How can I do this in CSS?
| To achieve a horizontal scroll bar for your vertical menu when the `li` items exceed the width of the menu, you can use CSS properties like `overflow-x` and `white-space`. Below is an example of how you can implement this using a simple HTML structure and CSS styles.
### HTML Structure
```html
<div class="menu-contai... | 41,199 | [
{
"from": "human",
"value": "I have a vertical menu in my system which is basically made of HTML ul/li with CSS styling (see image below). However I don't want the li items which are wider than the menu to wrap, I would prefer them to overflow with a horizontal scroll bar at the bottom of the menu. How can ... |
I'm using AspectJ to advice all the public methods which do have an argument of a chosen class. I tried the following:
pointcut permissionCheckMethods(Session sess) :
(execution(public * *(.., Session)) && args(*, sess));
This is working wonderfully for methods with at least 2 arguments:
public void delete(Object... | In AspectJ, the `..` wildcard represents zero or more arguments, but in your pointcut expression, you're using it in a way that could lead to confusion, especially with the `args` specification. The `args` construct in AspectJ matches the method arguments, and you need to ensure that it correctly captures the scenario ... | 40,879 | [
{
"from": "human",
"value": "I'm using AspectJ to advice all the public methods which do have an argument of a chosen class. I tried the following:\npointcut permissionCheckMethods(Session sess) : \n (execution(public * *(.., Session)) && args(*, sess));\n\nThis is working wonderfully for methods with at... |
A client is going to request 1K rows of IDs from the server.
I have to make sure we have 1K ID's with clientID = -1, if not, I have to insert 1K new ID's into the table.
I then have to link those 1K ID's with the clientID
return reserved 1K ID's to the client.
Is it as simple as wrapping all of this into a Transactio... | Yes, wrapping this entire process in a database transaction is a good approach. Transactions ensure that all operations are executed as a single unit of work, maintaining data integrity. Here's a high-level overview of how you could structure this logic using a transaction:
1. **Begin the Transaction**: Start a new tr... | 39,262 | [
{
"from": "human",
"value": "\nA client is going to request 1K rows of IDs from the server.\nI have to make sure we have 1K ID's with clientID = -1, if not, I have to insert 1K new ID's into the table.\nI then have to link those 1K ID's with the clientID\nreturn reserved 1K ID's to the client.\n\nIs it as s... |
Just encountered an interesting problem. I have a CHM file. If I display it using Process.Start it displays correctly.
If however I launch it using the HH API it displays without any icons in the toolbar and treeview; the main content, including graphics, displays correctly. Here's what it looks like - with a few artic... | The issue you're encountering with the CHM file displaying without icons in the toolbar and treeview when using the HH API could be related to several factors. Here are some troubleshooting steps and considerations:
1. **CHM File Corruption**: Ensure that the CHM file is not corrupted. Since it works fine on your coll... | 40,506 | [
{
"from": "human",
"value": "Just encountered an interesting problem. I have a CHM file. If I display it using Process.Start it displays correctly.\nIf however I launch it using the HH API it displays without any icons in the toolbar and treeview; the main content, including graphics, displays correctly. He... |
This isn't working. Can this be done in find? Or do I need to xargs?
find -name 'file_*' -follow -type f -exec zcat {} \| agrep -dEOE 'grep' \;
| The command you're trying to execute is intended to find files matching a pattern, decompress them, and then search for a specific term using `agrep`. The use of `-exec` in `find` is valid, but the syntax you've provided has a few issues.
The main issue here is that `zcat` doesn't read from standard input when used wi... | 42,652 | [
{
"from": "human",
"value": "This isn't working. Can this be done in find? Or do I need to xargs?\nfind -name 'file_*' -follow -type f -exec zcat {} \\| agrep -dEOE 'grep' \\;\n\n"
},
{
"from": "gpt",
"value": "The command you're trying to execute is intended to find files matching a pattern, ... |
Has anyone written a version of .Net's generic Queue that implements INotifyCollectionChanged, or is there one hidden deep in the .Net framework somewhere already?
| As of my last knowledge update in October 2023, there isn't a built-in version of .NET's generic `Queue<T>` that implements `INotifyCollectionChanged`. The standard `Queue<T>` class in the .NET Framework does not provide notifications for changes made to the collection, which is necessary for data binding scenarios, es... | 36,600 | [
{
"from": "human",
"value": "Has anyone written a version of .Net's generic Queue that implements INotifyCollectionChanged, or is there one hidden deep in the .Net framework somewhere already?\n"
},
{
"from": "gpt",
"value": "As of my last knowledge update in October 2023, there isn't a built-in... |
Simple case:
i put a DataTable in Cache
DataTable table = SomeClass.GetTable();
Cache["test"] = table;
then in later calls i use
DataTable table = (DataTable)Cache["test"];
now the question is: should i call table.dispose() on each call, though its stored in the Cache? Means the object is always the same? Or will Cac... | In your scenario, when you store a `DataTable` in the cache using the line `Cache["test"] = table;`, you are storing a reference to that `DataTable` object in the cache. When you later retrieve it using `DataTable table = (DataTable)Cache["test"];`, you are getting the same reference to the same `DataTable` object.
Th... | 40,522 | [
{
"from": "human",
"value": "Simple case:\ni put a DataTable in Cache\nDataTable table = SomeClass.GetTable();\nCache[\"test\"] = table;\n\nthen in later calls i use\nDataTable table = (DataTable)Cache[\"test\"];\n\nnow the question is: should i call table.dispose() on each call, though its stored in the Ca... |
I need to edit /etc/sudoers from a script to add/remove stuff from white lists.
Assuming I have a command that would work on a normal file, how could I apply it to /etc/sudoers?
Can I copy and modify it, then have visudo replace the original with the modified copy? By providing my own script in $EDITOR?
Or can I just u... | Editing the `/etc/sudoers` file directly can be risky, and it's important to do so in a safe manner to avoid corrupting the file, which can lock you out of sudo access. Here are some best practices and considerations when modifying the `/etc/sudoers` file from a script:
### Best Practices for Editing `/etc/sudoers`
1... | 38,804 | [
{
"from": "human",
"value": "I need to edit /etc/sudoers from a script to add/remove stuff from white lists.\nAssuming I have a command that would work on a normal file, how could I apply it to /etc/sudoers?\nCan I copy and modify it, then have visudo replace the original with the modified copy? By providin... |
Does anyone know because all the places I've tried seem to timeout!
| It sounds like you're experiencing issues with websites or services timing out. This could be due to various reasons, such as:
1. **Server Overload:** The website may be experiencing high traffic, leading to slow response times or timeouts.
2. **Internet Connection Issues:** Your internet connection might be unsta... | 40,813 | [
{
"from": "human",
"value": "Does anyone know because all the places I've tried seem to timeout!\n"
},
{
"from": "gpt",
"value": "It sounds like you're experiencing issues with websites or services timing out. This could be due to various reasons, such as:\n\n1. **Server Overload:** The website ... |
I am creating a desktop app in Delphi and plan to use an embedded database. I've started the project using SQlite3 with the DISQLite3 library. It works but documentation seems a bit light. I recently found Firebird (yes I've been out of Windows for a while) and it seems to have some compelling features and support.
W... | When it comes to choosing an embedded database for a Delphi application, both SQLite and Firebird Embedded have their own sets of advantages and disadvantages. Below are some pros and cons for each, as well as insights on their size, support, and resources.
### SQLite3 (using DISQLite3)
#### Pros:
1. **Simplicity**: ... | 36,967 | [
{
"from": "human",
"value": "I am creating a desktop app in Delphi and plan to use an embedded database. I've started the project using SQlite3 with the DISQLite3 library. It works but documentation seems a bit light. I recently found Firebird (yes I've been out of Windows for a while) and it seems to hav... |
Info - for better formatting, I used code-formatting throughout the whole posting.
Hi,
I have a highlighted JXTable. Rows are highlighted, depending on the value
of a specific column (c2). Everytime the value of column c2 changes, the color
is switched from white to grey or from grey to white.
Example
c0 c... | To achieve the desired behavior of re-applying the highlighting to the filtered rows in a `JXTable`, you will need to create a custom renderer or a custom filter that considers the original data for the highlighting logic. Here's how you can implement this:
### Step 1: Custom Table Model
You should extend the default... | 37,680 | [
{
"from": "human",
"value": "Info - for better formatting, I used code-formatting throughout the whole posting.\nHi,\n\nI have a highlighted JXTable. Rows are highlighted, depending on the value \nof a specific column (c2). Everytime the value of column c2 changes, the color \nis switched from white to grey... |
I want to, from JavaScript, access as a variable the file that is loaded as an image in an img tag.
I don't want to access its name, but the actual data.
The reason for this is that I want to be able to copy it to and from variables so that I can , among other things, change the image without reloading it.
Can this be... | Yes, you can access the actual image data in JavaScript using the `<canvas>` element. When you draw an image onto a canvas, you can then read the pixel data from it. Here's a basic approach you can use to achieve this:
### Step-by-Step Guide
1. **Load the Image**: First, you'll need to get the image loaded into your ... | 38,885 | [
{
"from": "human",
"value": "I want to, from JavaScript, access as a variable the file that is loaded as an image in an img tag. \nI don't want to access its name, but the actual data.\nThe reason for this is that I want to be able to copy it to and from variables so that I can , among other things, change ... |
I need to encrypt a small block of data (16 bytes) using 512 bit RSA public key -- quite an easy task for most cryptography libraries known to me, except for MS CSP API, as it seems.
Documentation for CryptEncrypt function states that
The Microsoft Enhanced Cryptographic Provider supports direct encryption with RSA pu... | When using the Microsoft Cryptographic Service Provider (CSP) API for RSA encryption, there are indeed some details to keep in mind, especially concerning padding and data length. Here are some points to consider that might help you troubleshoot the issue with your RSA encryption:
### 1. RSA Key Length and Data Size
... | 37,296 | [
{
"from": "human",
"value": "I need to encrypt a small block of data (16 bytes) using 512 bit RSA public key -- quite an easy task for most cryptography libraries known to me, except for MS CSP API, as it seems.\nDocumentation for CryptEncrypt function states that\n\nThe Microsoft Enhanced Cryptographic Pro... |
C#: How would you cycle through items in a listview using next and previous buttons?
Background:
Let's say you have 10 items in a listview.
Next to the listview there are two buttons titled previos and next.
Problem:
How would you cycle through those listview items after clicking the Next and or Previous button?
| To cycle through items in a `ListView` using "Previous" and "Next" buttons in a C# Windows Forms application, you can follow these steps:
1. **Create a ListView**: You'll need a ListView that displays the items you want to cycle through.
2. **Add Buttons**: Add two buttons to your form, one for "Previous" and one for... | 36,810 | [
{
"from": "human",
"value": "C#: How would you cycle through items in a listview using next and previous buttons?\nBackground:\nLet's say you have 10 items in a listview.\nNext to the listview there are two buttons titled previos and next.\nProblem:\nHow would you cycle through those listview items after cl... |
I have some HTML that includes bolding, italics, small tag, big tag, blockquote tag, bullets, and numbered items. I need to convert it to PDF via PHP. I tried FPDF, but it was entirely too complex. I tried the html2pdf PHP library, which uses FPDF, but it was very buggy and unreliable. What do you recommend?
Note: Imag... | If you're looking for a more straightforward solution to convert HTML to PDF in PHP, you might consider using libraries that are more robust and user-friendly than FPDF and html2pdf. Here are a couple of good options:
### 1. **Dompdf**
Dompdf is a popular HTML to PDF converter that works well with standard HTML and CS... | 37,920 | [
{
"from": "human",
"value": "I have some HTML that includes bolding, italics, small tag, big tag, blockquote tag, bullets, and numbered items. I need to convert it to PDF via PHP. I tried FPDF, but it was entirely too complex. I tried the html2pdf PHP library, which uses FPDF, but it was very buggy and unre... |
I'd like to automate the FTP download of a database backup file using PowerShell. The file name includes the date so I can't just run the same FTP script every day. Is there a clean way to do this built into PowerShell or using the .NET framework?
I want to use a secure FTP session.
| Yes, you can automate the FTP download of a database backup file using PowerShell and the .NET framework, and you can also use secure FTP (SFTP) for better security. The built-in FTP in PowerShell does not support SFTP directly, but you can use a library like `SSH.NET` to facilitate this.
### Steps to Automate SFTP Do... | 37,487 | [
{
"from": "human",
"value": "I'd like to automate the FTP download of a database backup file using PowerShell. The file name includes the date so I can't just run the same FTP script every day. Is there a clean way to do this built into PowerShell or using the .NET framework?\nI want to use a secure FTP s... |
I'm studying assembly language from the book "art of x86 assembly" and I have a question I couldn't figure the answer.
the program goes like this:
"in this exercise you will start a program running that examines and operates on values found in memory. then you will switch to the memory screen and modify values in memo... | The behavior you're experiencing can be explained by how the program is handling the `put` instruction and the flow of execution after the sum has been calculated.
Let's break down the code:
1. **Initialization**:
- The code starts with setting `CX` to 0 and storing it at memory location `1000h`.
2. **Main Loop (... | 40,186 | [
{
"from": "human",
"value": "I'm studying assembly language from the book \"art of x86 assembly\" and I have a question I couldn't figure the answer.\nthe program goes like this:\n\n\"in this exercise you will start a program running that examines and operates on values found in memory. then you will switch... |
For a certain inputform, I'd like to make it possible to do input with the keyboard. I know how to read the keys through KeyPressed and KeyUp, but the problem is that when a control has got the focus and the user presses the Enter key, that control receives the a Click event. Is it possible to prevent that behaviour ... | In most programming environments, including Windows Forms applications in .NET, when a control has focus and the Enter key is pressed, it can trigger a `Click` event on that control (for example, a button). If you want to distinguish between input from the mouse and input from the keyboard (such as the Enter key), you ... | 36,427 | [
{
"from": "human",
"value": "For a certain inputform, I'd like to make it possible to do input with the keyboard. I know how to read the keys through KeyPressed and KeyUp, but the problem is that when a control has got the focus and the user presses the Enter key, that control receives the a Click event. ... |
I'm putting together a small web app that writes to a database (Perl CGI & MySQL). The CGI script takes some info from a form and writes it to a database. I notice, however, that if I hit 'Reload' or 'Back' on the web browser, it'll write the data to the database again. I don't want this.
What is the best way to pr... | To prevent your Perl CGI script from writing data to the database multiple times when a user refreshes or navigates back in their browser, you can implement a couple of common strategies. Here are a few methods you can consider:
### 1. **Redirect After Form Submission (Post/Redirect/Get Pattern)**
The most common app... | 37,749 | [
{
"from": "human",
"value": "I'm putting together a small web app that writes to a database (Perl CGI & MySQL). The CGI script takes some info from a form and writes it to a database. I notice, however, that if I hit 'Reload' or 'Back' on the web browser, it'll write the data to the database again. I don'... |
I've been dipping into SitePoint book concerning CSS.
The thing that struck me about the examples was the use of ID as a CSS selector.
Some bits of CSS design I've done, I've always found it easier and more versatile to use Class as the selector.
Maybe its a .Net thing as we don't always have control of the ID of an el... | When deciding between using classes or IDs as CSS selectors, there are a few key points to consider, especially regarding best practices:
### 1. **Uniqueness**:
- **ID**: An ID must be unique within a document. This means you can only use a specific ID once per page. IDs are represented with a `#` in CSS (e.g., `#m... | 40,639 | [
{
"from": "human",
"value": "I've been dipping into SitePoint book concerning CSS.\nThe thing that struck me about the examples was the use of ID as a CSS selector.\nSome bits of CSS design I've done, I've always found it easier and more versatile to use Class as the selector.\nMaybe its a .Net thing as we ... |
What is the most efficient way to detect duplicates in a 10 column / 50K row table? I'm using MSSQL 8.0
| Detecting duplicates in a large table with multiple columns can be achieved efficiently by using SQL queries. Here’s a step-by-step approach to identifying duplicates in a 10-column, 50,000-row table in SQL Server 2000 (MSSQL 8.0).
### 1. **Identify the Columns for Duplicate Check**
First, you need to decide which col... | 40,038 | [
{
"from": "human",
"value": "What is the most efficient way to detect duplicates in a 10 column / 50K row table? I'm using MSSQL 8.0\n"
},
{
"from": "gpt",
"value": "Detecting duplicates in a large table with multiple columns can be achieved efficiently by using SQL queries. Here’s a step-by-ste... |
What are my options for running Java 6 on OS X?
I have an MacBook Pro Intel Core Duo running Mac OS X 10.4. Do I have any options for running Java 6 on this hardware and OS?
Related questions: Which Macs (either current or forthcoming) support 64-bit computing? Are there any Apple laptops (either current or forthcomin... | Running Java 6 on macOS 10.4 (Tiger) on an Intel Core Duo MacBook Pro can be quite challenging since Java 6 support was officially introduced in macOS 10.5 (Leopard) and later. Here are your options:
### Options for Running Java 6 on OS X 10.4:
1. **Upgrade macOS**: The most straightforward option is to upgrade your ... | 38,947 | [
{
"from": "human",
"value": "What are my options for running Java 6 on OS X? \nI have an MacBook Pro Intel Core Duo running Mac OS X 10.4. Do I have any options for running Java 6 on this hardware and OS?\nRelated questions: Which Macs (either current or forthcoming) support 64-bit computing? Are there any ... |
We have a simple project where we read data from a socket and we want to populate a table with the coming data, but we can't find a way to add rows to a yet created JTable object, we can only find how to add rows at creation time of the table.
Is it possible to add rows dynamically to a JTable, or there is a better alt... | Yes, it is definitely possible to add rows dynamically to a `JTable` in Java. The `JTable` itself does not hold the data; instead, it uses a model to manage the data it displays. The most commonly used model for `JTable` is `DefaultTableModel`, which provides methods to add, remove, and modify rows and columns dynamica... | 39,434 | [
{
"from": "human",
"value": "We have a simple project where we read data from a socket and we want to populate a table with the coming data, but we can't find a way to add rows to a yet created JTable object, we can only find how to add rows at creation time of the table.\nIs it possible to add rows dynamic... |
Given an object on a plain white background, does anybody know if OpenCV provides functionality to easily detect an object from a captured frame?
I'm trying to locate the corner/center points of an object (rectangle). The way I'm currently doing it, is by brute force (scanning the image for the object) and not accur... | Yes, OpenCV provides a number of methods that can help you detect objects effectively from captured frames, especially in a controlled environment like yours, where you have a plain white background and a well-defined object. Since your object is black on a white background, you can utilize contour detection, which is ... | 33,892 | [
{
"from": "human",
"value": "Given an object on a plain white background, does anybody know if OpenCV provides functionality to easily detect an object from a captured frame? \nI'm trying to locate the corner/center points of an object (rectangle). The way I'm currently doing it, is by brute force (scanni... |
Background:
I'm working on a silverlight (1.0) application that dynamically builds a map of the United States with icons and text overlayed at specific locations. The map works great in the browser and now I need to get a static (printable and insertable into documents/powerpoints) copy of a displayed map.
Objective:
I... | It seems you're on the right track with your approach to scaling the Canvas (`MyImage`) for rendering. Below, I'll break down the necessary modifications to ensure the Canvas scales correctly to fit the desired image dimensions while maintaining its aspect ratio.
### Key Concepts
1. **Scaling**: To scale your `MyImage... | 37,457 | [
{
"from": "human",
"value": "Background:\nI'm working on a silverlight (1.0) application that dynamically builds a map of the United States with icons and text overlayed at specific locations. The map works great in the browser and now I need to get a static (printable and insertable into documents/powerpoi... |
I am having problems with text with multiple lines not reformatting properly when I call loadStyleDeclarations. However if I load the same stylesheet TWICE then it correctly refreshes and reformats the text.
So what I want to do is refresh my control to get it to reformat the text. I've tried ValidateNow() and Validate... | It sounds like you're dealing with a specific issue related to the styling and layout of text in a Flex or ActionScript application. If loading the stylesheet multiple times corrects the formatting, it indicates that something in the layout process is not being triggered properly when you only load it once.
Here are s... | 37,174 | [
{
"from": "human",
"value": "I am having problems with text with multiple lines not reformatting properly when I call loadStyleDeclarations. However if I load the same stylesheet TWICE then it correctly refreshes and reformats the text.\nSo what I want to do is refresh my control to get it to reformat the t... |
I'm thinking how to arrange a deployed python application which will have a
Executable script located in /usr/bin/ which will provide a CLI to functionality implemented in
A library installed to wherever the current site-packages directory is.
Now, currently, I have the following directory structure in my sources:
f... | When structuring a Python application that includes both a library and a command-line interface (CLI), there are best practices to follow to ensure clarity and avoid import issues. Here's a more standard approach to organizing your project.
### Suggested Directory Structure
Here's a recommended directory structure fo... | 39,157 | [
{
"from": "human",
"value": "I'm thinking how to arrange a deployed python application which will have a \n\nExecutable script located in /usr/bin/ which will provide a CLI to functionality implemented in\nA library installed to wherever the current site-packages directory is.\n\nNow, currently, I have the ... |
If I have two things which are hex, can I someone how append their binary together to get a value?
In C++,
say I have
unsigned char t = 0xc2; // 11000010
unsigned char q = 0xa3; // 10100011
What I want is somehow,
1100001010100011, is this possible using bit-wise operators?
I want to extract the binary form of t and... | Yes, you can achieve the desired result of appending the binary representations of two `unsigned char` values using bit-wise operations in C++.
To append `t` (0xc2, which is `11000010` in binary) and `q` (0xa3, which is `10100011` in binary), you can follow these steps:
1. Shift the bits of `t` to the left by 8 posi... | 40,727 | [
{
"from": "human",
"value": "If I have two things which are hex, can I someone how append their binary together to get a value?\nIn C++,\nsay I have\nunsigned char t = 0xc2; // 11000010\nunsigned char q = 0xa3; // 10100011\n\nWhat I want is somehow,\n1100001010100011, is this possible using bit-wise opera... |
Is there an open source implementation of Google AdWords, or is the technology protected in some way (such as being patented)?
Edit: To clarify, I'm looking for a 3rd party implementation of an AdWords-like system (that has nothing to to with Google AdWords beyond the concept and superficial similarity).
| There isn't a direct open-source implementation of Google AdWords, as the proprietary algorithms and specific technologies used by Google are protected by patents and other intellectual property rights. However, there are several open-source projects and platforms that aim to provide similar functionalities for managin... | 41,515 | [
{
"from": "human",
"value": "Is there an open source implementation of Google AdWords, or is the technology protected in some way (such as being patented)?\nEdit: To clarify, I'm looking for a 3rd party implementation of an AdWords-like system (that has nothing to to with Google AdWords beyond the concept a... |
Can anybody suggest a good book/paper/website/background reading about universal codes for integers and especially Fibonacci code (in the sense of http://en.wikipedia.org/wiki/Fibonacci_code)? Thanks!
Edit: Thanks for the answers and the useful links so far! I am sorry if I have not made myself completely clear: I am n... | Certainly! If you're interested in universal codes for integers and specifically the Fibonacci code, here are some resources that should help you understand the theory and applications:
### Books:
1. **"Data Compression: The Complete Reference" by David Salomon** - This book provides a comprehensive overview of variou... | 39,811 | [
{
"from": "human",
"value": "Can anybody suggest a good book/paper/website/background reading about universal codes for integers and especially Fibonacci code (in the sense of http://en.wikipedia.org/wiki/Fibonacci_code)? Thanks!\nEdit: Thanks for the answers and the useful links so far! I am sorry if I hav... |
I don't want to include relations in my edmx entity framework, I want to have the foreign key field as a normal property in my entity.
How can I do that?
| If you want to exclude navigation properties (relations) from your Entity Framework model and only include foreign key properties as regular properties, you can achieve this by manually editing the `.edmx` file or by using the Code First approach where you can control the properties explicitly.
Here are the steps to d... | 36,471 | [
{
"from": "human",
"value": "I don't want to include relations in my edmx entity framework, I want to have the foreign key field as a normal property in my entity. \nHow can I do that?\n"
},
{
"from": "gpt",
"value": "If you want to exclude navigation properties (relations) from your Entity Fram... |
Before trying to query the AD server I would like to check if it is alive and kicking.
Looks like a trivial thing, but I haven´t found anything to elucidate this.
How can I do that?
| To check if an Active Directory (AD) server is "alive," you can use a few different methods depending on your environment and preferences. Here are some common approaches:
### 1. **Ping the Server**
This is the simplest method. You can use the `ping` command in your command line interface:
```bash
ping <AD_Server_IP_... | 39,624 | [
{
"from": "human",
"value": "Before trying to query the AD server I would like to check if it is alive and kicking. \nLooks like a trivial thing, but I haven´t found anything to elucidate this.\nHow can I do that?\n"
},
{
"from": "gpt",
"value": "To check if an Active Directory (AD) server is \"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.