instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
I have a binary field in my database that is hard to describe in a UI using a single "Is XXXX?"-type checkbox. I'd rather use a pair of radio buttons (e.g. "Do it the Foo way" and "Do it the Bar way"), but right now all the other fields on my form are data-bound to a business object. I'd like to data-bind the pair of... | It sounds like you've made some good progress in finding a solution that works for your scenario by modifying your business object. To summarize the solution you devised:
1. **Modify the Business Object**: You added a new property that returns the inverse of the original boolean field (e.g., if your existing property ... | 41,834 | [
{
"from": "human",
"value": "I have a binary field in my database that is hard to describe in a UI using a single \"Is XXXX?\"-type checkbox. I'd rather use a pair of radio buttons (e.g. \"Do it the Foo way\" and \"Do it the Bar way\"), but right now all the other fields on my form are data-bound to a busi... |
We are having some issues getting SharePoint to work as we want it to.
We have an enterprise MOSS configuration on our domain and have the entry http://intranet pointing to it on port 80.
We also have another site collection and have pointed an internet domain name http:/nww.oursector.nhs.uk at it. We have done this to... | To achieve your goal of allowing authenticated access to your SharePoint site collection without enabling anonymous access, you will need to adjust some settings in both SharePoint and possibly your IIS configuration. Here are some steps you can follow to configure this properly:
### Steps to Configure SharePoint for ... | 43,651 | [
{
"from": "human",
"value": "We are having some issues getting SharePoint to work as we want it to.\nWe have an enterprise MOSS configuration on our domain and have the entry http://intranet pointing to it on port 80.\nWe also have another site collection and have pointed an internet domain name http:/nww.o... |
I am looking for a python webserver which is multithreaded instead of being multi-process (as in case of mod_python for apache). I want it to be multithreaded because I want to have an in memory object cache that will be used by various http threads. My webserver does a lot of expensive stuff and computes some large ar... | While `mod_python` is a popular option for embedding Python into Apache, it is indeed primarily a multi-process solution, which can complicate scenarios where you need to share state or cache data in memory across requests.
If you want to leverage a multithreaded environment, there are several options available for P... | 21,336 | [
{
"from": "human",
"value": "I am looking for a python webserver which is multithreaded instead of being multi-process (as in case of mod_python for apache). I want it to be multithreaded because I want to have an in memory object cache that will be used by various http threads. My webserver does a lot of e... |
Hypothetical situation: let's say I have a 3rd party .net assembly being used in the ASP.Net web system that I'm working on that just kinda crashes every now and then. When it does so, all calls to it throw exceptions until the system is rebooted. This is, obviously, a little sub-optimal.
Is there a way to reboot jus... | Rebooting just an assembly within an already loaded application domain is not directly supported in .NET, as assemblies themselves don't have the ability to unload or reboot independently. However, there are some potential workarounds that you can use to mitigate the problem, although they might not provide a perfect s... | 42,850 | [
{
"from": "human",
"value": "Hypothetical situation: let's say I have a 3rd party .net assembly being used in the ASP.Net web system that I'm working on that just kinda crashes every now and then. When it does so, all calls to it throw exceptions until the system is rebooted. This is, obviously, a little ... |
Is there a measurable performance difference between using INT vs. VARCHAR as a primary key in MySQL? I'd like to use VARCHAR as the primary key for reference lists (think US States, Country Codes) and a coworker won't budge on the INT AUTO_INCREMENT as a primary key for all tables.
My argument, as detailed here, is t... | When considering the use of `INT` versus `VARCHAR` as primary keys in MySQL, there are several factors to take into account, including performance, storage, and clarity of the data model. Here are the key points you might want to consider regarding your specific use-case:
### Performance:
1. **Storage Size**:
- `... | 39,400 | [
{
"from": "human",
"value": "Is there a measurable performance difference between using INT vs. VARCHAR as a primary key in MySQL? I'd like to use VARCHAR as the primary key for reference lists (think US States, Country Codes) and a coworker won't budge on the INT AUTO_INCREMENT as a primary key for all tab... |
I was reading up about NTVDM.exe as I build a quick test console app and it crashed on a friends machine complaining about this EXE.
As I understand it all DOS cmd windows (C# console apps included) run as 16bit not 32bit.
Is this true? Does this mean all my works console app back office apps are running as 16bit rath... | There seems to be some confusion regarding how console applications work in Windows, particularly in relation to NTVDM (NT Virtual DOS Machine) and the different bitness of applications.
### Understanding NTVDM and Bitness
1. **NTVDM**: NTVDM (NT Virtual DOS Machine) is a subsystem of Windows that enables 16-bit appl... | 43,978 | [
{
"from": "human",
"value": "I was reading up about NTVDM.exe as I build a quick test console app and it crashed on a friends machine complaining about this EXE.\nAs I understand it all DOS cmd windows (C# console apps included) run as 16bit not 32bit.\nIs this true? Does this mean all my works console app... |
I have no frame of reference in terms of what's considered "fast"; I'd always wondered this but have never found a straight answer...
| It sounds like you're curious about what is considered "fast" in a certain context, but you didn't specify what you're referring to. Are you asking about speed in terms of vehicles (like cars or planes), internet connection speeds, running times, or something else entirely? If you can provide more details, I'd be happy... | 46,452 | [
{
"from": "human",
"value": "I have no frame of reference in terms of what's considered \"fast\"; I'd always wondered this but have never found a straight answer...\n"
},
{
"from": "gpt",
"value": "It sounds like you're curious about what is considered \"fast\" in a certain context, but you didn... |
I know that php has md5(), sha1(), and the hash() functions, but I want to create a hash using the MySQL PASSWORD() function. So far, the only way I can think of is to just query the server, but I want a function (preferably in php or Perl) that will do the same thing without querying MySQL at all.
For example:
MySQL ... | If you want to replicate the MySQL `PASSWORD()` function in PHP without querying the MySQL server, you need to implement the same hashing algorithm that MySQL uses. However, the implementation details for the `PASSWORD()` function can vary between MySQL versions.
### For MySQL versions prior to 5.7
In earlier version... | 43,160 | [
{
"from": "human",
"value": "I know that php has md5(), sha1(), and the hash() functions, but I want to create a hash using the MySQL PASSWORD() function. So far, the only way I can think of is to just query the server, but I want a function (preferably in php or Perl) that will do the same thing without q... |
I'm actual looking for a way to get notified about any changes on a SharePoint group. First I though I would be able to this by attaching a event handler to some kind of group list. But unfortunately there are no such list representing SharePoint groups.
My second attempt was to bind a event handler to the content typ... | Monitoring changes to SharePoint groups can indeed be challenging, especially because there isn't a straightforward event handler for group changes similar to those available for lists or libraries. However, there are a few alternative approaches you could consider:
### 1. **SharePoint Webhooks**
While webhooks in Sha... | 41,218 | [
{
"from": "human",
"value": "I'm actual looking for a way to get notified about any changes on a SharePoint group. First I though I would be able to this by attaching a event handler to some kind of group list. But unfortunately there are no such list representing SharePoint groups. \nMy second attempt was ... |
I'm using NetBeans 6.5 for developing PHP and I have xdebug setup. Is there a way I can tell it not to stop on the first line of the file on every request? JIT mode won't fix this because I don't want it to stop on every exception that I catch.
| Yes, you can configure Xdebug to prevent it from stopping on the first line of your PHP script when debugging in NetBeans. This behavior is often due to the default configuration of Xdebug, which may include settings to stop on the first line or on exceptions.
Here are the steps to configure Xdebug to avoid stopping a... | 43,951 | [
{
"from": "human",
"value": "I'm using NetBeans 6.5 for developing PHP and I have xdebug setup. Is there a way I can tell it not to stop on the first line of the file on every request? JIT mode won't fix this because I don't want it to stop on every exception that I catch.\n"
},
{
"from": "gpt",
... |
I am using a JSP bean and when I do an assignment to a new object, it gets over-written on a submit to the previous object.
<jsp:useBean id="base" class="com.example.StandardBase" scope="session" />
...
//base object id = 396
base = new Base()
//base object id = 1000
and on a resubmit of the page I get
<jsp:useBean i... | In JSP, when you use the `<jsp:useBean>` tag, it checks the specified scope (like session in your case) for an existing bean. If one is found, it uses that bean, and if not, it creates a new instance of the bean. In your example, when you assign `base = new Base()`, you are creating a new local reference to a new objec... | 42,932 | [
{
"from": "human",
"value": "I am using a JSP bean and when I do an assignment to a new object, it gets over-written on a submit to the previous object.\n<jsp:useBean id=\"base\" class=\"com.example.StandardBase\" scope=\"session\" />\n...\n//base object id = 396\nbase = new Base()\n//base object id = 1000... |
How can I add an item to a users calendar programatically through the Exchange 2003 Information Store. I need to know the interface or connector to research. I have full Exchange rights and want to be able to automate assigning appointments without the end users interaction or login. I know this is possible as I have... | To programmatically add an item to a user's calendar in Exchange 2003, you typically have a few different options. Exchange 2003 does not have the same level of API support as later versions, but here are some approaches you can consider:
### 1. **Exchange WebDAV**
Exchange 2003 supports the WebDAV protocol, which all... | 40,286 | [
{
"from": "human",
"value": "How can I add an item to a users calendar programatically through the Exchange 2003 Information Store. I need to know the interface or connector to research. I have full Exchange rights and want to be able to automate assigning appointments without the end users interaction or ... |
I've heard that there are some free applications that will check the vulnerability of a PHP website, but I don't know what to use. I'd like a free program (preferably with a GUI) for Windows that will analyze my site an give me a report.
Anyone know of a solution?
| There are several free applications that can help you check the vulnerabilities of your PHP website. Here are a few options with a graphical user interface (GUI) that you can use on Windows:
1. **OWASP ZAP (Zed Attack Proxy)**:
- OWASP ZAP is a popular open-source web application security scanner. It has a user-fri... | 40,843 | [
{
"from": "human",
"value": "I've heard that there are some free applications that will check the vulnerability of a PHP website, but I don't know what to use. I'd like a free program (preferably with a GUI) for Windows that will analyze my site an give me a report.\nAnyone know of a solution?\n"
},
{
... |
i have a string that looks like
"<input id=a/>"<input id=b/>"<input id=c/>etc.
I need to change it to
"<input id='a'/>"<input id='b'/>"<input id='c'/>etc,
any ideas how?
| You can achieve this by using a regular expression to match the `id` attributes in your string and then replace them with the correctly formatted version. Here’s how you can do this in Python:
```python
import re
# Your original string
input_string = '<input id=a/><input id=b/><input id=c/>'
# Use a regular expressi... | 45,842 | [
{
"from": "human",
"value": "i have a string that looks like\n\"<input id=a/>\"<input id=b/>\"<input id=c/>etc.\n\nI need to change it to\n\"<input id='a'/>\"<input id='b'/>\"<input id='c'/>etc,\n\nany ideas how? \n"
},
{
"from": "gpt",
"value": "You can achieve this by using a regular expressi... |
I installed Aptana Studio plugins for Eclipse and now Eclipse startup is slower than ever because Aptana Studio always checks for updates at startup -- and it's really slow!
How do I turn off auto updates in Aptana?
| To turn off the auto-update feature in Aptana Studio for Eclipse, you can follow these steps:
1. **Open Eclipse**: Start your Eclipse IDE where the Aptana Studio plugins are installed.
2. **Access Aptana Preferences**: Go to the menu bar and click on `Window` (or `Eclipse` on macOS), then select `Preferences`. This w... | 45,850 | [
{
"from": "human",
"value": "I installed Aptana Studio plugins for Eclipse and now Eclipse startup is slower than ever because Aptana Studio always checks for updates at startup -- and it's really slow! \nHow do I turn off auto updates in Aptana? \n"
},
{
"from": "gpt",
"value": "To turn off the... |
Which JavaScript library you recommend to use with Java EE + Struts + iBatis ?
Something like Ext JS, Dojo, frameworks that can be easily integrated with Struts.
| When working with Java EE, Struts, and iBatis, you want a JavaScript library that can easily integrate into your existing architecture, enhances your front-end capabilities, and allows you to create a seamless user experience. Here are a few recommendations:
1. **jQuery**:
- **Pros**: Lightweight, easy to use, and... | 43,593 | [
{
"from": "human",
"value": "Which JavaScript library you recommend to use with Java EE + Struts + iBatis ?\nSomething like Ext JS, Dojo, frameworks that can be easily integrated with Struts.\n"
},
{
"from": "gpt",
"value": "When working with Java EE, Struts, and iBatis, you want a JavaScript li... |
I am looking for layer 2 traffic generator [open source].
Some OSS using winpcap or libpcap.
Thanks a lot.
| There are several open-source layer 2 traffic generators that utilize WinPcap or libpcap. Below are a few options you can consider:
1. **pktgen**:
- **Description**: Pktgen is a packet generator for Linux and is primarily designed to run in the Linux kernel space for high performance. However, it can be configured ... | 44,363 | [
{
"from": "human",
"value": "I am looking for layer 2 traffic generator [open source]. \nSome OSS using winpcap or libpcap.\nThanks a lot.\n"
},
{
"from": "gpt",
"value": "There are several open-source layer 2 traffic generators that utilize WinPcap or libpcap. Below are a few options you can co... |
How do I change the JFileChooser behavior from double-click selection to single-click selection mode?
I'm developing an application to run with either a single-click interface (nothing requires a double-click, just like the KDE interface mode) or a double-click interface (the default Windows interface mode or the regul... | In Java Swing, the `JFileChooser` component does not natively support changing its selection behavior from double-clicking to single-clicking directly through its API. By default, `JFileChooser` requires a double-click to select a file and open it. However, you can achieve single-click selection behavior by listening t... | 42,223 | [
{
"from": "human",
"value": "How do I change the JFileChooser behavior from double-click selection to single-click selection mode?\nI'm developing an application to run with either a single-click interface (nothing requires a double-click, just like the KDE interface mode) or a double-click interface (the d... |
Sounds like a weird question, but say I have something like this:
$.post( "/myajax.php",
{ "param1": value1, "param2": value2 },
function( data, status ) {
if( status == "success" ) {
$("#someid").html( data );
}
}, "html" );
While myajax.php is doing what... | To handle this scenario, you don't necessarily need to change the HTTP status code to manipulate how jQuery interprets the response. Instead, you can modify your PHP script (`myajax.php`) to return a specific value when no changes are necessary, and then handle that in your jQuery code.
Here’s one approach you could t... | 42,808 | [
{
"from": "human",
"value": "Sounds like a weird question, but say I have something like this:\n$.post( \"/myajax.php\",\n { \"param1\": value1, \"param2\": value2 },\n function( data, status ) {\n if( status == \"success\" ) {\n $(\"#someid\").html( data );\n ... |
Does anyone have any good references for equations which can be implemented relatively easily for how to compute the transfer of angular momentum between two rigid bodies?
I've been searching for this sort of thing for a while, and I haven't found any particularly comprehensible explanations of the problem.
To be preci... | To compute the transfer of angular momentum between two rigid bodies that collide and interact in a manner similar to the air hockey scenario you've described, you can apply principles from classical mechanics, particularly the conservation of linear momentum and angular momentum.
### Key Concepts
1. **Conservation o... | 36,222 | [
{
"from": "human",
"value": "Does anyone have any good references for equations which can be implemented relatively easily for how to compute the transfer of angular momentum between two rigid bodies?\nI've been searching for this sort of thing for a while, and I haven't found any particularly comprehensibl... |
I have several databases, one of which contains utility functions called from the other databases. Is there a way in the utility functions to determine which database a function is being called from?
| Yes, in many database systems, you can determine which database a function is being called from, but the method to do so can vary depending on the database management system (DBMS) you're using. Below are some methods for popular databases:
### SQL Server
In SQL Server, you can use the `DB_NAME()` function to get the ... | 43,877 | [
{
"from": "human",
"value": "I have several databases, one of which contains utility functions called from the other databases. Is there a way in the utility functions to determine which database a function is being called from?\n"
},
{
"from": "gpt",
"value": "Yes, in many database systems, yo... |
I am using VB9's inline XML, and I have a need to specify a non-breaking space. Where you would normally use " " in html, using it in inline XML produces the "XML entity references are not supported" error. How do you specify a non-breaking space?
| In VB9 (Visual Basic 2008), when working with inline XML, you cannot directly use HTML entities like ` `, as XML does not support them. Instead, you can represent a non-breaking space using its Unicode character reference.
For a non-breaking space, you can use the Unicode character reference ` ` or the hexad... | 46,548 | [
{
"from": "human",
"value": "I am using VB9's inline XML, and I have a need to specify a non-breaking space. Where you would normally use \" \" in html, using it in inline XML produces the \"XML entity references are not supported\" error. How do you specify a non-breaking space?\n"
},
{
"from"... |
I would guess most people on this site are familiar with tail, if not - it provides a "follow" mode that as text is appended to the file tail will dump those characters out to the terminal.
What I am looking for (and possibly to write myself if necessary) is a version of tail that works on binary files. Basically I hav... | For your requirements, you're looking for a way to monitor a binary file and output any new data that gets appended to it, similar to how the `tail -f` command works for text files.
While `tail` itself is designed for text files, you can indeed achieve what you want with some existing tools, or with a simple custom s... | 42,341 | [
{
"from": "human",
"value": "I would guess most people on this site are familiar with tail, if not - it provides a \"follow\" mode that as text is appended to the file tail will dump those characters out to the terminal.\nWhat I am looking for (and possibly to write myself if necessary) is a version of tail... |
I'm trying to deploy elmah. For inexplicable reasons, I'm getting an error: .axd files are explicitly forbidden. I've already fixed what I can control (my web.config) and solutions requiring collaboration from the system admin are not available (such as editing machine web.config or updating IIS mappings). I also ver... | You're correct that `.ashx` and `.axd` files serve similar purposes as HTTP handlers in ASP.NET, but there are some differences worth noting:
1. **File Extension**:
- `.axd` files are typically used for ASP.NET built-in handlers, like those for web resource handling (e.g., for ASP.NET AJAX).
- `.ashx` files are ... | 44,570 | [
{
"from": "human",
"value": "I'm trying to deploy elmah. For inexplicable reasons, I'm getting an error: .axd files are explicitly forbidden. I've already fixed what I can control (my web.config) and solutions requiring collaboration from the system admin are not available (such as editing machine web.con... |
I have a page, with some code in js and jQuery and it works very well. But unfortunately, all my site is very very old, and uses frames. So when I loaded my page inside a frame, $(document).ready() doesn't fire up.
My frameset looks like:
<frameset rows="79,*" frameBorder="1" frameSpacing="1" bordercolor="#5996BF" nore... | When working with frames, the `$(document).ready()` function should still fire when the page is loaded in the frame. However, if you're experiencing issues with it not firing, here are some steps and considerations to help troubleshoot and resolve the problem:
### 1. Check for Console Errors
Open the browser's develop... | 42,500 | [
{
"from": "human",
"value": "I have a page, with some code in js and jQuery and it works very well. But unfortunately, all my site is very very old, and uses frames. So when I loaded my page inside a frame, $(document).ready() doesn't fire up.\nMy frameset looks like:\n<frameset rows=\"79,*\" frameBorder=\"... |
A SocketException has a SocketErrorCode and NativeErrorCode.
I would like to find a list where these codes (or the common onces)
are listed so I can respond in proper fasion.
Does anybody know where to find such a list?
| You can find the list of `SocketErrorCode` values in the official Microsoft documentation for the .NET framework. Here’s a brief overview of how to access this information:
### 1. Official Microsoft Documentation
- **SocketErrorCode Enum**: This enum contains the various socket error codes you may encounter in .NET a... | 44,152 | [
{
"from": "human",
"value": "A SocketException has a SocketErrorCode and NativeErrorCode.\nI would like to find a list where these codes (or the common onces)\nare listed so I can respond in proper fasion.\nDoes anybody know where to find such a list?\n"
},
{
"from": "gpt",
"value": "You can fin... |
I want to validate a set of credentials against the domain controller. e.g.:
Username: STACKOVERFLOW\joel
Password: splotchy
Method 1. Query Active Directory with Impersonation
A lot of people suggest querying the Active Directory for something. If an exception is thrown, then you know the credentials are not valid - ... | To properly authenticate a set of domain credentials in a managed code context, you should consider using a method that does not require excessive privileges or introduce the drawbacks you've mentioned. A common approach is to use the `PrincipalContext` and `UserPrincipal` classes provided by the `System.DirectoryServi... | 41,804 | [
{
"from": "human",
"value": "I want to validate a set of credentials against the domain controller. e.g.:\nUsername: STACKOVERFLOW\\joel\nPassword: splotchy\n\nMethod 1. Query Active Directory with Impersonation\nA lot of people suggest querying the Active Directory for something. If an exception is thrown,... |
I'm wondering what good ways there would be make assertions about synchronization or something so that I could detect synchronization violations (while testing).
That would be used for example for the case that I'd have a class that is not thread-safe and that isn't going to be thread-safe. With some way I would have s... | To create a mechanism that can detect and assert synchronization violations in a non-thread-safe class, you can use a combination of thread-local storage and assertions. The idea is to keep track of the threads that are currently executing methods of the class and assert that only one thread can be active at a time.
H... | 42,456 | [
{
"from": "human",
"value": "I'm wondering what good ways there would be make assertions about synchronization or something so that I could detect synchronization violations (while testing).\nThat would be used for example for the case that I'd have a class that is not thread-safe and that isn't going to be... |
Slashdot's RSS feed is http://rss.slashdot.org/Slashdot/slashdot. If I download the XML file directly, I only get a few of the posts from today. However, if I subscribe to the feed in Google Reader, and keep scrolling down in their "infinite scroll" interface, it seems like I can get an arbitrary number of Slashdot pos... | Google Reader, like many other RSS aggregation services, has the capability to retrieve an extended number of posts from an RSS feed through a couple of methods that go beyond what you would get from a direct download of the RSS XML file. Here’s an overview of how this works and how you can achieve similar functionalit... | 40,553 | [
{
"from": "human",
"value": "Slashdot's RSS feed is http://rss.slashdot.org/Slashdot/slashdot. If I download the XML file directly, I only get a few of the posts from today. However, if I subscribe to the feed in Google Reader, and keep scrolling down in their \"infinite scroll\" interface, it seems like I ... |
I have a table with N rows, and I wanna select N-1 rows.
Suggestions on how to do this in one query, if it's possible..?
| Yes, you can select N-1 rows from a table with N rows in a single SQL query. The approach can vary depending on the SQL dialect you are using (e.g., MySQL, PostgreSQL, SQL Server, etc.), but here are a couple of general approaches you can consider:
### 1. Using `LIMIT` and `OFFSET` (MySQL, PostgreSQL)
If you want to ... | 40,375 | [
{
"from": "human",
"value": "I have a table with N rows, and I wanna select N-1 rows. \nSuggestions on how to do this in one query, if it's possible..?\n"
},
{
"from": "gpt",
"value": "Yes, you can select N-1 rows from a table with N rows in a single SQL query. The approach can vary depending on... |
I need to handle massive (tens of millions) of MATLAB structs; I needed a dozen or so fields so I reckoned memory won't be an issue until I discovered this ( explanation )
>> s=[];
>> s.first=1;
>> whos
Name Size Bytes Class Attributes
s 1x1 132 struct
>> ... | Handling massive amounts of data efficiently in MATLAB can be challenging, especially when working with structures. Here are some strategies to create lightweight structures while maintaining reasonable performance:
### 1. Preallocate the Structure Array
Instead of dynamically growing the structure, preallocate the st... | 38,576 | [
{
"from": "human",
"value": "I need to handle massive (tens of millions) of MATLAB structs; I needed a dozen or so fields so I reckoned memory won't be an issue until I discovered this ( explanation )\n>> s=[];\n>> s.first=1;\n>> whos\n Name Size Bytes Class Attributes\n\n s 1... |
So in high school math, and probably college, we are taught how to use trig functions, what they do, and what kinds of problems they solve. But they have always been presented to me as a black box. If you need the Sine or Cosine of something, you hit the sin or cos button on your calculator and you're set. Which is fin... | Trigonometric functions such as sine, cosine, and tangent can be implemented in a variety of ways in software and hardware. Here are some common approaches to understand how they can be implemented:
### 1. **Taylor Series Expansion**
One of the classic mathematical ways to compute sine and cosine functions is through... | 41,958 | [
{
"from": "human",
"value": "So in high school math, and probably college, we are taught how to use trig functions, what they do, and what kinds of problems they solve. But they have always been presented to me as a black box. If you need the Sine or Cosine of something, you hit the sin or cos button on you... |
Example C API signature:
void Func(unsigned char* bytes);
In C, when I want to pass a pointer to an array, I can do:
unsigned char* bytes = new unsigned char[1000];
Func(bytes); // call
How do I translate the above API to P/Invoke such that I can pass a pointer to C# byte array?
| To call a C function that takes a pointer to an array of bytes from C# using P/Invoke, you'll need to follow several steps. Here's how you can do it:
1. **Declare the C function in C#:** You'll use the `DllImport` attribute to import the C function into C#. Make sure to specify the calling convention if necessary.
2.... | 38,271 | [
{
"from": "human",
"value": "Example C API signature:\nvoid Func(unsigned char* bytes);\nIn C, when I want to pass a pointer to an array, I can do:\nunsigned char* bytes = new unsigned char[1000];\nFunc(bytes); // call\n\nHow do I translate the above API to P/Invoke such that I can pass a pointer to C# byte... |
[former title: Is there a way to force a relationship structure on a tag-based organizational methodology?]
I have some entities, and they have a series of attributes. Some of the attributes affect what other attributes the entity can have, many of the attributes are organized into groups, and occasionally entities are... | Certainly! What you are describing is a form of a complex entity-attribute model with relationships among attributes that can affect the validity or combinations of those attributes. This is indeed a challenging problem, but it can be approached effectively using a combination of a relational database design and some l... | 42,836 | [
{
"from": "human",
"value": "[former title: Is there a way to force a relationship structure on a tag-based organizational methodology?]\nI have some entities, and they have a series of attributes. Some of the attributes affect what other attributes the entity can have, many of the attributes are organized ... |
It is mentioned fairly often that exceptions are expensive, and various methods in .NET are expensive, too.
What exactly constitutes an expensive method in .NET?
Is it the time taken for the method to process? E.G. I got the response stream of a webpage using the WebClient object (this was not async), and when getting ... | In .NET and software development in general, the term "expensive method" often refers to operations that consume significant computational resources, either in terms of CPU time or memory usage. There are several factors that can contribute to a method being considered "expensive":
### 1. **Execution Time**
- **CPU... | 43,598 | [
{
"from": "human",
"value": "It is mentioned fairly often that exceptions are expensive, and various methods in .NET are expensive, too.\nWhat exactly constitutes an expensive method in .NET?\nIs it the time taken for the method to process? E.G. I got the response stream of a webpage using the WebClient obj... |
I need to write a tool in C++ to determine the changed bits in a file compared against another file for replication. What would be the best method of accomplishing this?
I don't have a specific OS or library in mind, I'm open to suggestions. My primary goal is reducing the amount of network traffic involved in replic... | To create a tool in C++ that determines the changed bits between two files, you'll want to consider a method that minimizes the amount of data that needs to be transmitted over the network. Here’s a step-by-step outline of how you might approach this task, along with suggestions for efficient techniques and libraries t... | 40,594 | [
{
"from": "human",
"value": "I need to write a tool in C++ to determine the changed bits in a file compared against another file for replication. What would be the best method of accomplishing this?\nI don't have a specific OS or library in mind, I'm open to suggestions. My primary goal is reducing the am... |
I stumbled upon this javascript obfuscator called Squash, I want to use it on my ExtJS project to obfuscate my javascript files. I've tried it and the result are totally obfuscated codes. But it seems that I have to obfuscate the ExtJS library too because I got warnings that it couldn't find functions such as Ext.onRea... | Using an obfuscator like Squash with ExtJS can be a bit tricky due to the way ExtJS is structured and how it relies on its own method names and object properties. Here are some steps and best practices you might consider to successfully integrate Squash with your ExtJS project:
### Steps to Use Squash with ExtJS
1. *... | 43,648 | [
{
"from": "human",
"value": "I stumbled upon this javascript obfuscator called Squash, I want to use it on my ExtJS project to obfuscate my javascript files. I've tried it and the result are totally obfuscated codes. But it seems that I have to obfuscate the ExtJS library too because I got warnings that it ... |
My current problem is that I have a JFrame with a 2x2 GridLayout. And inside one of the squares, I have a JPanel that is to display a grid. I am having a field day with the java swing library... take a look
Image
Java is automatically expanding each JLabel to fit the screen. I want it to just be those blue squares (wat... | It sounds like you're having some layout issues with Java Swing and you want to achieve a specific appearance for your `JPanel` and its components. Here are some suggestions to help you with both the `JPanel` size issue and the button size.
### Setting the Size of JPanel
To ensure that the `JPanel` displaying the grid... | 43,898 | [
{
"from": "human",
"value": "My current problem is that I have a JFrame with a 2x2 GridLayout. And inside one of the squares, I have a JPanel that is to display a grid. I am having a field day with the java swing library... take a look\nImage\nJava is automatically expanding each JLabel to fit the screen. I... |
Where does the DirectoryEntry class fetches data from?
| The `DirectoryEntry` class in .NET is part of the `System.DirectoryServices` namespace and is used to interact with Active Directory and other directory services. When you create an instance of the `DirectoryEntry` class, it fetches data from a directory service provider. The most common sources of data are:
1. **Acti... | 46,278 | [
{
"from": "human",
"value": "Where does the DirectoryEntry class fetches data from?\n"
},
{
"from": "gpt",
"value": "The `DirectoryEntry` class in .NET is part of the `System.DirectoryServices` namespace and is used to interact with Active Directory and other directory services. When you create ... |
I'm working with some old PHP code that has a lot of the following:
$someVar =& new SomeClass();
Did the new operator ever return a value, um, not by reference? (That feels strange to type. I feel like I'm losing my mind.)
| In PHP, the `new` operator creates an instance of a class and returns a reference to that instance. However, in PHP prior to version 5, all variables were handled as "copy-on-write," meaning that they were effectively treated as references, but the distinction wasn't as clear.
In PHP 4, you could assign the result of... | 43,881 | [
{
"from": "human",
"value": "I'm working with some old PHP code that has a lot of the following:\n$someVar =& new SomeClass();\n\nDid the new operator ever return a value, um, not by reference? (That feels strange to type. I feel like I'm losing my mind.)\n"
},
{
"from": "gpt",
"value": "In PH... |
What's the best way to consume REST web services from .NET?
| Consuming REST web services in .NET can be accomplished through several methods, and the best approach often depends on the specific requirements of your application, the version of .NET you are using, and your familiarity with different libraries. Here are some of the most common approaches:
### 1. HttpClient
`HttpCl... | 41,773 | [
{
"from": "human",
"value": "What's the best way to consume REST web services from .NET?\n"
},
{
"from": "gpt",
"value": "Consuming REST web services in .NET can be accomplished through several methods, and the best approach often depends on the specific requirements of your application, the ver... |
When I do a cvs status, I see working revision and repository revision numbers.
What is the difference between the two, or rather, what do they mean?
| In CVS (Concurrent Versions System), the `cvs status` command provides information about the state of files in your working directory compared to the repository. When you see both "working revision" and "repository revision," here’s what they mean:
1. **Working Revision**: This is the revision of the file that you cur... | 45,470 | [
{
"from": "human",
"value": "When I do a cvs status, I see working revision and repository revision numbers.\nWhat is the difference between the two, or rather, what do they mean?\n"
},
{
"from": "gpt",
"value": "In CVS (Concurrent Versions System), the `cvs status` command provides information ... |
I'm using a hosting service which allows me to backup my SQL 2008 database and download the BAK file via a web interface only--and I have access to the database via Management Studio. I can execute the backup command from Management Studio,but I don't have rights to the path where the backups are located. Is there any ... | Yes, you can generate a script to recreate your SQL Server 2008 database, including the schema (tables, indexes, etc.) and the data (the few thousand records you mentioned). Here's how you can do it using SQL Server Management Studio (SSMS):
### Step 1: Generate the Schema Script
1. Open SQL Server Management Studio ... | 43,646 | [
{
"from": "human",
"value": "I'm using a hosting service which allows me to backup my SQL 2008 database and download the BAK file via a web interface only--and I have access to the database via Management Studio. I can execute the backup command from Management Studio,but I don't have rights to the path whe... |
I am writing a client-side validation function for CustomValidator and I need to check length of entered string. But before, to counteract cheaters a little, I want to remove all leading and trailing spaces from the string. What is the easiest way to do it in this scenario?
Thank you!
| To remove leading and trailing spaces from a string in JavaScript, you can use the built-in `trim()` method. This method returns a new string with whitespace removed from both ends. Here’s how you can implement it in your client-side validation function for a `CustomValidator`:
```javascript
function validateInput(inp... | 46,006 | [
{
"from": "human",
"value": "I am writing a client-side validation function for CustomValidator and I need to check length of entered string. But before, to counteract cheaters a little, I want to remove all leading and trailing spaces from the string. What is the easiest way to do it in this scenario?\nTha... |
Is this defined by the language? Is there a defined maximum? Is it different in different browsers?
| It seems like you're asking about certain limits or constraints, possibly related to web technologies such as JavaScript, HTML, or CSS. However, your question is quite broad. Here are some common aspects related to your query:
1. **Maximum Length of Inputs**: In HTML, input fields can have a `maxlength` attribute that... | 45,020 | [
{
"from": "human",
"value": "Is this defined by the language? Is there a defined maximum? Is it different in different browsers?\n"
},
{
"from": "gpt",
"value": "It seems like you're asking about certain limits or constraints, possibly related to web technologies such as JavaScript, HTML, or CSS... |
What is the maximum length of a valid email address? Is it defined by any standard?
| Yes, the maximum length of a valid email address is defined by standards. According to the Internet Engineering Task Force (IETF) standards, specifically RFC 5321 and RFC 5322, the maximum length of an email address is 254 characters.
Here’s a breakdown of the relevant points:
- The local part (the part before the "... | 48,593 | [
{
"from": "human",
"value": "What is the maximum length of a valid email address? Is it defined by any standard?\n"
},
{
"from": "gpt",
"value": "Yes, the maximum length of a valid email address is defined by standards. According to the Internet Engineering Task Force (IETF) standards, specifica... |
This is as much a code maintenance issue as a code issue, but I have a WebForm that no longer checks it CustomValidator. It worked when I last touched the code over a year ago, but it no longer works now that the user has requested some changes ...
The WebForm contains a data-bound drop down with a default " - All -" i... | When dealing with a `CustomValidator` not firing in a WebForm, there are several potential issues to investigate. Below are some common suspects and troubleshooting steps to help identify the problem:
1. **Ensure that the `ValidationGroup` property is correctly set:**
Check if your `CustomValidator` and your submit... | 40,971 | [
{
"from": "human",
"value": "This is as much a code maintenance issue as a code issue, but I have a WebForm that no longer checks it CustomValidator. It worked when I last touched the code over a year ago, but it no longer works now that the user has requested some changes ...\nThe WebForm contains a data-b... |
If I have the following setting in my app.config file. It is a setting I need to make sure my WCF client can negotiate the default proxy server.
<system.net>
<defaultProxy enabled="true" useDefaultCredentials="true"></defaultProxy>
</system.net>
Unfortunately, I can't add to the app.config file in my environment.... | If you are unable to modify the `app.config` file directly, you can programmatically configure the default proxy settings in your WCF client at runtime. You can achieve this by creating and configuring an instance of the `WebRequest` class to use the default proxy settings.
Here is how you can do it:
1. **Set the De... | 42,983 | [
{
"from": "human",
"value": "If I have the following setting in my app.config file. It is a setting I need to make sure my WCF client can negotiate the default proxy server.\n<system.net>\n <defaultProxy enabled=\"true\" useDefaultCredentials=\"true\"></defaultProxy>\n</system.net>\n\nUnfortunately, I c... |
I am attempting to use a Stream Result to return an image from a struts2 application. I seem to be having problem with configuring the action. Here is the configuration:
<result name="success" type="stream">
<param name="contentType">image/jpeg</param>
<param name="inputName">inputStream</pa... | It looks like you're trying to return an image using Struts2's StreamResult, but you're encountering an issue with the `inputName` parameter. The error indicates that Struts2 is unable to find an `InputStream` with the name `inputStream`. This typically means that the action class does not have a property or method tha... | 42,307 | [
{
"from": "human",
"value": "I am attempting to use a Stream Result to return an image from a struts2 application. I seem to be having problem with configuring the action. Here is the configuration:\n <result name=\"success\" type=\"stream\">\n <param name=\"contentType\">image/jpeg</param>\n ... |
When I call GetForegroundWindow from c# I am getting the explorer parent process ID (I see this from process explorer) and not the process ID of the app that is in the foreground.
Why is this and how do get the right process ID?
Malcolm
| When you call `GetForegroundWindow()` in C#, you might notice that it sometimes returns a window handle (HWND) that is associated with a parent process like Windows Explorer, especially if the foreground window is a child of another window or is being hosted in a shell environment.
This behavior occurs because Windows... | 44,267 | [
{
"from": "human",
"value": "When I call GetForegroundWindow from c# I am getting the explorer parent process ID (I see this from process explorer) and not the process ID of the app that is in the foreground.\nWhy is this and how do get the right process ID?\nMalcolm\n"
},
{
"from": "gpt",
"valu... |
I have a plain C code for a Image codec.My goal is to develop a efficient C model which will be taken and realized in Hardware using Verilog or some such Hardware description language. What i am trying to find out is:
1.) What modifications need to be done in exisitng C code structures to make it hardware efficient
2.... | Transitioning from a software model written in C to an efficient hardware model realized in a hardware description language (HDL) like Verilog involves several key modifications. Here are the considerations for your goals:
### 1. Modifications for Hardware Efficiency
**Pipeline the Execution:**
- Implement pipelinin... | 38,995 | [
{
"from": "human",
"value": "I have a plain C code for a Image codec.My goal is to develop a efficient C model which will be taken and realized in Hardware using Verilog or some such Hardware description language. What i am trying to find out is:\n1.) What modifications need to be done in exisitng C code s... |
I am trying to put the stuff within parentheses into the value of a src attribute in an img tag:
while(<TOCFILE>)
{
$toc_line = $_;
$toc_line =~ s/<inlineFig.*?(\.\.\/pics\/ch09_inline99_*?\.jpg)*?<\/inlineFig>/<img src="${1}" alt="" \/\>/g;
$new_toc_file .= $toc_line;
}
So I expected to see tags like this... | The issue you're encountering arises from how you're trying to capture the file path in your regex replacement. Specifically, the regex pattern isn't correctly structured to capture the desired string in the `$1` variable. Let’s break down the regex and correct it.
Your current regex is this:
```perl
$toc_line =~ s/<... | 41,334 | [
{
"from": "human",
"value": "I am trying to put the stuff within parentheses into the value of a src attribute in an img tag:\nwhile(<TOCFILE>)\n{\n $toc_line = $_;\n $toc_line =~ s/<inlineFig.*?(\\.\\.\\/pics\\/ch09_inline99_*?\\.jpg)*?<\\/inlineFig>/<img src=\"${1}\" alt=\"\" \\/\\>/g;\n $new_toc... |
I have the following code in an Autofac Module that is used in my Application_Start method:
builder.Register(c => new Configuration().Configure().BuildSessionFactory())
.SingletonScoped();
builder.Register(c => c.Resolve<ISessionFactory>().OpenSession())
.HttpRequestScoped();
builder.Register<NHibernateSomethi... | The issue you're experiencing is related to the way you register the `ISession` and how the lifetime scopes are handled in Autofac. The use of `HttpRequestScoped` and `SingletonScoped` doesn't work quite as you might expect in this situation due to how the resolution of dependencies occurs in Autofac.
In your provided... | 44,265 | [
{
"from": "human",
"value": "I have the following code in an Autofac Module that is used in my Application_Start method:\nbuilder.Register(c => new Configuration().Configure().BuildSessionFactory())\n .SingletonScoped();\nbuilder.Register(c => c.Resolve<ISessionFactory>().OpenSession())\n .HttpRequest... |
In a CF8 form, I'm using a tag such as the following:
<cfinput
type = "Text"
name = "Num"
value = "0"
validate = "range,integer"
range = "0,1000"
validateAt="onBlur,onSubmit"
required = "yes"
message = "Invalid Value"
>
When the field loses focus (onBlur), the input is validate... | It seems like you're encountering an issue with how ColdFusion 8 (CF8) handles client-side validation for multiple conditions in the `validate` parameter. From your description, it appears that the `onBlur` validation is only checking the first validation condition (`range`) and not processing the `integer` condition c... | 43,288 | [
{
"from": "human",
"value": "In a CF8 form, I'm using a tag such as the following:\n<cfinput \n type = \"Text\" \n name = \"Num\" \n value = \"0\" \n validate = \"range,integer\" \n range = \"0,1000\" \n validateAt=\"onBlur,onSubmit\" \n required = \"yes\" \n message = \"Invalid Valu... |
I am writing some new code that will throw a custom exception - I want to include an error string and a status code. Which class should be exception derive from? std::exception? std::runtime_error? Any other 'gotchas' to worry about? I'm thinking of something like the following:
class MyException : public std::exce... | Your approach for defining a custom exception class in C++ is on the right track. Since you want to create a custom exception that includes an error string and a status code, deriving from `std::exception` is indeed a valid choice. However, using `std::runtime_error` as your base class could be more appropriate if you ... | 41,473 | [
{
"from": "human",
"value": "I am writing some new code that will throw a custom exception - I want to include an error string and a status code. Which class should be exception derive from? std::exception? std::runtime_error? Any other 'gotchas' to worry about? I'm thinking of something like the follow... |
I have a XML Structure that looks like this.
<sales>
<item name="Games" sku="MIC28306200" iCat="28"
sTime="11/26/2008 8:41:12 AM"
price="1.00" desc="Item Name" />
<item name="Games" sku="MIC28307100" iCat="28"
sTime="11/26/2008 8:42:12 AM"
price="1.00" desc="Item Name" />
...
</sales>
I am ... | It looks like you've found a solution to sort XML nodes based on the `sTime` attribute while keeping track of the nodes and their attributes. However, I can provide a clearer explanation of the key elements of your approach for anyone looking to do something similar.
### Key Steps in Your Approach
1. **Loading the XM... | 41,541 | [
{
"from": "human",
"value": "I have a XML Structure that looks like this.\n<sales>\n <item name=\"Games\" sku=\"MIC28306200\" iCat=\"28\" \n sTime=\"11/26/2008 8:41:12 AM\" \n price=\"1.00\" desc=\"Item Name\" />\n <item name=\"Games\" sku=\"MIC28307100\" iCat=\"28\" \n sTime=\"11/26/2008 8:42... |
I need to know this since this is a pre-req for .NET 3.5 and if I'm including the .NET bootstrapper, I should also see if Windows Installer 3.1 is needed.
Right now I'm checking for the registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Updates\Windows XP\SP3\KB893803v2
Which will check for Windows Installer 3.1 but ... | To determine the version of Windows Installer installed on a Windows machine, you can check specific registry keys. Here's how you can find the version of Windows Installer, including higher versions.
1. **Registry Key for Windows Installer Version**:
The registry keys that you can check for Windows Installer vers... | 40,849 | [
{
"from": "human",
"value": "I need to know this since this is a pre-req for .NET 3.5 and if I'm including the .NET bootstrapper, I should also see if Windows Installer 3.1 is needed.\nRight now I'm checking for the registry key:\nHKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Updates\\Windows XP\\SP3\\KB893803v2... |
Windows has GetFileTime API which allows getting file time information by open file handle. What I wanted to know is, if it is possible to get this information by file name without opening the file explicitly. And if possible is it also applicable to Windows Mobile platform?
| Yes, on Windows, you can obtain file time information (such as creation time, last access time, and last write time) without explicitly opening a file handle by using the `GetFileAttributesEx` function. This function allows you to retrieve information about a file or directory, including its timestamps, using the file ... | 43,036 | [
{
"from": "human",
"value": "Windows has GetFileTime API which allows getting file time information by open file handle. What I wanted to know is, if it is possible to get this information by file name without opening the file explicitly. And if possible is it also applicable to Windows Mobile platform?\n"
... |
This question has been discussed in two blog posts (http://dow.ngra.de/2008/10/27/when-systemcurrenttimemillis-is-too-slow/, http://dow.ngra.de/2008/10/28/what-do-we-really-know-about-non-blocking-concurrency-in-java/), but I haven't heard a definitive answer yet. If we have one thread that does this:
public class Hear... | In the code you've provided, the interaction between the threads is not guaranteed to be thread-safe. Let's break down the reasoning behind this conclusion.
1. **Thread Safety and Visibility**:
- The variable `counter` in the `HeartBeatThread` is updated in a separate thread. It is a static variable, and its update... | 43,246 | [
{
"from": "human",
"value": "This question has been discussed in two blog posts (http://dow.ngra.de/2008/10/27/when-systemcurrenttimemillis-is-too-slow/, http://dow.ngra.de/2008/10/28/what-do-we-really-know-about-non-blocking-concurrency-in-java/), but I haven't heard a definitive answer yet. If we have one... |
In Firefox a Reload seems to reload everything while on IE the Refresh reloads just the HTML part of the current page. In IE you need to press Ctrl-F5 for a complete reload.
Why this difference and is it somewhere an article explaining this difference more thoroughly?
| The behavior of page reloading in web browsers like Firefox and Internet Explorer (IE) is influenced by various factors, including caching mechanisms, design philosophies, and user interface choices. Here's a breakdown of the differences and why they exist:
### Differences in Reload Behavior
1. **Basic Reload vs. Har... | 44,268 | [
{
"from": "human",
"value": "In Firefox a Reload seems to reload everything while on IE the Refresh reloads just the HTML part of the current page. In IE you need to press Ctrl-F5 for a complete reload. \nWhy this difference and is it somewhere an article explaining this difference more thoroughly?\n"
},
... |
I have a client selling a t shirt. She wants a potential buyer to be able to choose size and color with a quantity option for each.
I have found some code that tallies the order total, but does not have the quantity option.
I have attached the code below. Can anyone steer me in the right direction on what to do with th... | To incorporate quantity selection for each color and size option in your PayPal form, you'll need to slightly modify the existing code to handle quantities individually for each item. This involves creating separate quantity dropdowns for each size and color option, and then updating the total based on the selected qua... | 35,656 | [
{
"from": "human",
"value": "I have a client selling a t shirt. She wants a potential buyer to be able to choose size and color with a quantity option for each.\nI have found some code that tallies the order total, but does not have the quantity option.\nI have attached the code below. Can anyone steer me i... |
If I have several classes with functions that I need but want to store separately for organisation, can I extend a class to have both?
i.e. class a extends b extends c
edit: I know how to extend classes one at a time, but I'm looking for a method to instantly extend a class using multiple base classes - AFAIK you can't... | In PHP, you cannot directly extend multiple classes because PHP does not support multiple inheritance. However, there are several design patterns and techniques you can use to achieve a similar effect. Here are a few options:
### 1. Trait Usage
PHP supports traits, which allow you to reuse methods across different cla... | 43,698 | [
{
"from": "human",
"value": "If I have several classes with functions that I need but want to store separately for organisation, can I extend a class to have both?\ni.e. class a extends b extends c\nedit: I know how to extend classes one at a time, but I'm looking for a method to instantly extend a class us... |
Are there any good Eclipse plugins for creating smarty templates? I am using Europa with PDT on Ubuntu (though I doubt the OS will make a difference for this).
I found SmartyPDT, but it did not seem to install properly and some of the discussions on it seemed to suggest it was for an older version of PDT.
| Creating Smarty templates in Eclipse can be a bit challenging, especially since you're using an older version like Europa. However, there are a few options you can consider for working with Smarty templates in Eclipse.
1. **SmartyPDT**: As you mentioned, SmartyPDT is designed for Smarty template support in Eclipse. It... | 44,426 | [
{
"from": "human",
"value": "Are there any good Eclipse plugins for creating smarty templates? I am using Europa with PDT on Ubuntu (though I doubt the OS will make a difference for this).\nI found SmartyPDT, but it did not seem to install properly and some of the discussions on it seemed to suggest it was ... |
Here's my problem: I have to call a web service with a secure header from a classic ASP page that returns a complex data type. For various reasons concerning a 3rd party tool it has to be classic ASP. We decided that I should create an external dll to do this - which I did (in c#) so it returns a dataset (Something ... | To expose a C# class library as a COM object that can be used in a classic ASP page, you'll need to follow a series of steps. Here's a breakdown of what you need to do:
### Step 1: Modify Your C# Class Library
1. **Class Declaration**: Ensure that the class you want to expose is `public` and not static. The class sho... | 42,072 | [
{
"from": "human",
"value": "Here's my problem: I have to call a web service with a secure header from a classic ASP page that returns a complex data type. For various reasons concerning a 3rd party tool it has to be classic ASP. We decided that I should create an external dll to do this - which I did (i... |
I have a huge file that I must parse line by line. Speed is of the essence.
Example of a line:
Token-1 Here-is-the-Next-Token Last-Token-on-Line
^ ^
Current Position
Position after GetToken
GetToken is called, returning "Here-is-the-Next-Token" ... | To achieve high performance when parsing tokens from a `StringList` in Delphi, you can use manual string manipulation techniques, avoiding any high-level parsing methods that introduce overhead. The following is an example implementation of a `GetToken` function that efficiently retrieves tokens from a `StringList`:
`... | 42,480 | [
{
"from": "human",
"value": "I have a huge file that I must parse line by line. Speed is of the essence. \nExample of a line:\n\nToken-1 Here-is-the-Next-Token Last-Token-on-Line\n ^ ^\n Current Position\n Position after GetToken\n\n\nGetTo... |
This is really two questions, first, do browsers normally cache images on the client by default or does the server have to indicate that they can be cached?
Second, given that I do not have access to IIS what can I do in an ASP application to improve client side caching of images.
| ### Question 1: Do browsers normally cache images on the client by default, or does the server have to indicate that they can be cached?
Browsers do cache images and other static assets by default to improve performance. However, whether and for how long they cache those assets is determined by HTTP headers sent from ... | 39,579 | [
{
"from": "human",
"value": "This is really two questions, first, do browsers normally cache images on the client by default or does the server have to indicate that they can be cached?\nSecond, given that I do not have access to IIS what can I do in an ASP application to improve client side caching of imag... |
I have the following database table created thus:
CREATE TABLE AUCTIONS (
ARTICLE_NO VARCHAR(20),
ARTICLE_NAME VARCHAR(100),
SUBTITLE VARCHAR(20),
CURRENT_BID DECIMAL(5,2),
START_PRICE DECIMAL(5,2),
BID_COUNT VARCHAR(20),
QUANT_TOTAL VARCHAR(20),
QUANT_SOLD VARCHAR(... | The issue you're encountering is likely due to the way the data is being parsed when inserting it into the database. Since you are using a tab-delimited text file, it is crucial that each field aligns correctly with the columns defined in your `AUCTIONS` table.
Here are a few points to consider and steps to troublesho... | 43,462 | [
{
"from": "human",
"value": "I have the following database table created thus:\nCREATE TABLE AUCTIONS (\n ARTICLE_NO VARCHAR(20),\n ARTICLE_NAME VARCHAR(100),\n SUBTITLE VARCHAR(20),\n CURRENT_BID DECIMAL(5,2),\n START_PRICE DECIMAL(5,2),\n BID_COUNT VARCHAR(20),\n QUANT_... |
I'm hopeless at Javascript. This is what I have:
<script type="text/javascript">
function beginrefresh(){
//set the id of the target object
var marquee = document.getElementById("marquee_text");
if(marquee.scrollLeft >= marquee.scrollWidth - parseInt(marquee.style.width)) {
mar... | To create a seamless scrolling marquee effect in JavaScript, you can duplicate the content inside the marquee so that when it reaches the end, it can continue scrolling without any noticeable jump.
Here’s how you can modify your code to achieve a seamless scrolling effect:
```html
<!DOCTYPE html>
<html lang="en">
<h... | 42,688 | [
{
"from": "human",
"value": "I'm hopeless at Javascript. This is what I have:\n<script type=\"text/javascript\">\n function beginrefresh(){\n\n //set the id of the target object\n var marquee = document.getElementById(\"marquee_text\");\n\n if(marquee.scrollLeft >= marquee.scrollWidt... |
I was checking Microsoft's Visual Studio page just now and in the advertisements sidebar I suddenly saw an incredible advertisement:
"Net Express is a COBOL development environment for extending core business processes to the .NET Framework and other distributed platforms."
Of course I followed the link and found a ... | Yes, there are still many organizations using COBOL, especially in sectors like finance, insurance, and government. COBOL has been a foundational programming language for business applications since its inception in the 1950s, and many legacy systems that were built using COBOL continue to operate critical business fun... | 41,944 | [
{
"from": "human",
"value": "I was checking Microsoft's Visual Studio page just now and in the advertisements sidebar I suddenly saw an incredible advertisement:\n\n\"Net Express is a COBOL development environment for extending core business processes to the .NET Framework and other distributed platforms.\"... |
I wrote a small PHP application that I'd like to distribute. I'm looking for best practices so that it can be installed on most webhosts with minimal hassle.
Briefly: It's simple tool that lets people download files once they login with a password.
So my questions are:
1) How should I handle configuration values? I'm n... | Great questions! Let's tackle each one step by step:
### 1) Handling Configuration Values
Using a configuration file is indeed a good approach. You can use a PHP file returning an associative array, which allows for easy syntax validation and comments. For example:
```php
// config.php
return [
'site_name' => 'My... | 35,389 | [
{
"from": "human",
"value": "I wrote a small PHP application that I'd like to distribute. I'm looking for best practices so that it can be installed on most webhosts with minimal hassle.\nBriefly: It's simple tool that lets people download files once they login with a password.\nSo my questions are:\n1) How... |
My friend and I are going to develop a new commercial web project. We have a kind of a document that lists all the things that we want to have and we are wondering what is the best way to actually start coding it. The thing is that we used to develop software either in solo-mode or join some projects that were in the m... | Starting a new project with a distributed team can be challenging, especially when foundational components like database design and essential functionality are critical to the rest of the project. Here are some strategies to help you effectively kick off development in a way that allows for collaboration and efficiency... | 43,225 | [
{
"from": "human",
"value": "My friend and I are going to develop a new commercial web project. We have a kind of a document that lists all the things that we want to have and we are wondering what is the best way to actually start coding it. The thing is that we used to develop software either in solo-mode... |
Any ideas on how I can acheive 'Hierarchical' gridview?
Basically I want when the user clicks on the '+', i "expand" and insert new rows without a full page post back.
Does this sound like a lot of AJAX stuff? Or should I read on ASP.NET MVC
Please point me in right direction
| Creating a hierarchical grid view that expands and collapses rows without a full page post back is a common requirement in web applications. You can achieve this using a combination of client-side JavaScript, AJAX for asynchronous data loading, and a backend framework like ASP.NET MVC. Here are some ideas and steps on ... | 39,331 | [
{
"from": "human",
"value": "Any ideas on how I can acheive 'Hierarchical' gridview?\nBasically I want when the user clicks on the '+', i \"expand\" and insert new rows without a full page post back. \nDoes this sound like a lot of AJAX stuff? Or should I read on ASP.NET MVC\nPlease point me in right direct... |
We're trying to tune an application that accepts messages via TCP and also uses TCP for some of its internal messaging. While load testing, we noticed that response time degrades significantly (and then stops altogether) as more simultaneous requests are made to the system. During this time, we see a lot of TCP conn... | Certainly! Let's break this down into simpler terms and concepts.
### What is TIME_WAIT?
When a TCP connection is closed, the connection enters a state called `TIME_WAIT`. This state lasts for a while (by default, 60 seconds) and serves several purposes:
1. **Ensures Reliability:** It allows time to ensure that any ... | 41,002 | [
{
"from": "human",
"value": "We're trying to tune an application that accepts messages via TCP and also uses TCP for some of its internal messaging. While load testing, we noticed that response time degrades significantly (and then stops altogether) as more simultaneous requests are made to the system. Du... |
I'm trying to find the actual class of a django-model object, when using model-inheritance.
Some code to describe the problem:
class Base(models.model):
def basemethod(self):
...
class Child_1(Base):
pass
class Child_2(Base):
pass
If I create various objects of the two Child classes and the creat... | To determine the actual class of a Django model object, especially when using model inheritance, you can use the built-in `type()` function, or the `isinstance()` function. The `type()` function allows you to get the class of the object directly, while `isinstance()` can check if the object is an instance of a specific... | 45,635 | [
{
"from": "human",
"value": "I'm trying to find the actual class of a django-model object, when using model-inheritance.\nSome code to describe the problem:\nclass Base(models.model):\n def basemethod(self):\n ...\n\nclass Child_1(Base):\n pass\n\nclass Child_2(Base):\n pass\n\nIf I create v... |
This is for .NET. IgnoreCase is set and MultiLine is NOT set.
Usually I'm decent at regex, maybe I'm running low on caffeine...
Users are allowed to enter HTML-encoded entities (<lt;, <amp;, etc.), and to use the following HTML tags:
u, i, b, h3, h4, br, a, img
Self-closing <br/> and <img/> are allowed, with or withou... | It looks like you're aiming to create a regex pattern that filters HTML tags while allowing certain tags and their attributes. Based on your requirements, we'll write a regex that allows the specified tags (`i`, `b`, `u`, `h3`, `h4`, `br`, `a`, `img`) while stripping out others, and also preserves the `href` attribute ... | 42,563 | [
{
"from": "human",
"value": "This is for .NET. IgnoreCase is set and MultiLine is NOT set.\nUsually I'm decent at regex, maybe I'm running low on caffeine...\nUsers are allowed to enter HTML-encoded entities (<lt;, <amp;, etc.), and to use the following HTML tags:\nu, i, b, h3, h4, br, a, img\n\nSelf-closin... |
It seems UITextFields convert all non-breaking spaces (nbsp, U+00A0) to spaces (U+0020). This causes problems for the editing of locale specific numbers. For instance, in the French/France locale, the non-breaking space separates 1 and % to form "1 %". However, since the UITextField converts the separator character ... | UITextField, like other UIKit text inputs, is designed to handle plain text and does not provide built-in support for preserving non-breaking spaces (U+00A0). The behavior you're encountering—where non-breaking spaces are converted to regular spaces—is part of its default text processing.
While there is no property or... | 42,875 | [
{
"from": "human",
"value": "It seems UITextFields convert all non-breaking spaces (nbsp, U+00A0) to spaces (U+0020). This causes problems for the editing of locale specific numbers. For instance, in the French/France locale, the non-breaking space separates 1 and % to form \"1 %\". However, since the UI... |
How can I get the value between quotes with an RegEx
for example I want to find all the parameters from the function test
<html>
test("bla");
print("foo");
test("moo");
</html>
The result must be { "bla", "moo" }
| You can use the following regular expression to match the parameters passed to the `test` function, specifically those enclosed in quotes:
```regex
test\("([^"]*)"\)
```
Here's how this regex works:
- `test\(`: Matches the literal string `test(`. The backslash escapes the parenthesis.
- `"([^"]*)"`: Matches a pair o... | 45,875 | [
{
"from": "human",
"value": "How can I get the value between quotes with an RegEx\nfor example I want to find all the parameters from the function test\n<html>\n test(\"bla\");\n print(\"foo\");\n test(\"moo\");\n</html>\n\nThe result must be { \"bla\", \"moo\" }\n"
},
{
"from": "gpt",
"va... |
I am reading through the Public Review Draft of the Web Beans specification (JSR-299) and I am wondering why it is so 'tightly coupled' to JSF?
Especially the Conversation Context seems only be specified for JSF.
I understand, that it is a goal of WebBeans to integrate JSF and EJB3. But would it not make sense to speci... | Your observations regarding the coupling of the Web Beans specification (JSR-299) to JSF and the way it handles the concept of conversations are valid. The design decisions made in the specification can be attributed to a few key factors:
1. **Initial Focus on JSF**: When JSR-299 was being developed, there was a stron... | 44,666 | [
{
"from": "human",
"value": "I am reading through the Public Review Draft of the Web Beans specification (JSR-299) and I am wondering why it is so 'tightly coupled' to JSF?\nEspecially the Conversation Context seems only be specified for JSF.\nI understand, that it is a goal of WebBeans to integrate JSF and... |
A sample I'm working on calls CoCreateInstance for class Microsoft_Office Excel Worksheet. It fails with HRESULT of 0x80040514 ("Class not registered"). Other Excel classes (Excel.Application) are registered on the system, but not the one for Worksheet .....Is it possible to register this class?
Update: I'm using M... | It sounds like you've already identified the underlying issue and implemented a workaround to successfully interact with the Excel Worksheet object. To summarize and elaborate a bit further:
1. **Understanding COM Registration**: Each COM object is associated with a specific CLSID (Class ID), and these classes need to... | 42,779 | [
{
"from": "human",
"value": "A sample I'm working on calls CoCreateInstance for class Microsoft_Office Excel Worksheet. It fails with HRESULT of 0x80040514 (\"Class not registered\"). Other Excel classes (Excel.Application) are registered on the system, but not the one for Worksheet .....Is it possible t... |
I have a WPF user control I created that is used to show the state of tasks in my UI. I get the odd report back that the control sometimes has a nasty looking border to the left and I cannot reproduce it.
The control looks like this (when working) (grey tick=not run, green=OK,red cross=fail,hourglass=running);
alt text... | It sounds like you're encountering a rendering issue with your WPF user control that manifests under certain conditions. Given that the icons are stacked and visibility toggled, there are a few things to check and try to help you isolate and fix the problem:
### 1. Check the Icons and their Formats
Ensure that the ico... | 39,885 | [
{
"from": "human",
"value": "I have a WPF user control I created that is used to show the state of tasks in my UI. I get the odd report back that the control sometimes has a nasty looking border to the left and I cannot reproduce it.\nThe control looks like this (when working) (grey tick=not run, green=OK,r... |
I need to grab the height of the window and the scrolling offset in jQuery, but I haven't had any luck finding this in the jQuery docs or Google.
I'm 90% certain there's a way to access height and scrollTop for an element (presumably including the window), but I just can't find the specific reference.
| You can easily access the height of the window and the scrolling offset using jQuery. Here are the methods you can use:
1. **Get the height of the window**: You can use `$(window).height()` to get the height of the viewport.
2. **Get the scroll offset**: You can use `$(window).scrollTop()` to get the vertical scroll ... | 47,995 | [
{
"from": "human",
"value": "I need to grab the height of the window and the scrolling offset in jQuery, but I haven't had any luck finding this in the jQuery docs or Google.\nI'm 90% certain there's a way to access height and scrollTop for an element (presumably including the window), but I just can't find... |
I have a form that displays file information in a TabControl, and I'd like the pages to have the file's icon in their tab. How do I get the icon associated with a file type?
I'd prefer solutions that don't involve looking things up in the registry, but if that's the only way then so be it.
| To retrieve the icon associated with a file type in a Windows environment without directly looking it up in the registry, you can use the Windows Shell API. This method allows you to get the file icon based on its extension or a specific file directly. Here's how you can accomplish this in C#:
### Using the Windows AP... | 39,014 | [
{
"from": "human",
"value": "I have a form that displays file information in a TabControl, and I'd like the pages to have the file's icon in their tab. How do I get the icon associated with a file type?\nI'd prefer solutions that don't involve looking things up in the registry, but if that's the only way t... |
I'm writing a mapping application that I am writing in python and I need to get the lat/lon centroid of N points.
Say I have two locations
a.lat = 101
a.lon = 230
b.lat = 146
b.lon = 200
Getting the center of two points is fairly easy using a euclidean formula. I would like
to be able to do it for more then two poin... | To find the geographic centroid (or the average location) of multiple points given their latitude and longitude, you can use the arithmetic mean of their coordinates. This approach is straightforward and works well for points that are not too far apart.
Here's how to calculate the centroid for `N` points:
1. **Sum al... | 42,496 | [
{
"from": "human",
"value": "I'm writing a mapping application that I am writing in python and I need to get the lat/lon centroid of N points.\nSay I have two locations\na.lat = 101\na.lon = 230\n\nb.lat = 146\nb.lon = 200\n\nGetting the center of two points is fairly easy using a euclidean formula. I would... |
I have two tables with the following columns:
table1:
id, agent_name, ticket_id, category, date_logged
table2:
id, agent_name, department, admin_status
What I'm trying to achieve is to Select all rows from table1 where an agents department is equal to that of table2.
I've tried a few different join statements but I'm... | To achieve your goal of selecting all rows from `table1` where an agent's department matches that of `table2`, you can use an `INNER JOIN`. This type of join will return only the rows that have matching values in both tables based on the specified condition.
Since you need to join based on the `agent_name`, here's how... | 46,420 | [
{
"from": "human",
"value": "I have two tables with the following columns:\ntable1:\nid, agent_name, ticket_id, category, date_logged\n\ntable2:\nid, agent_name, department, admin_status\n\nWhat I'm trying to achieve is to Select all rows from table1 where an agents department is equal to that of table2.\nI... |
I can do this:
Dim fso As New FileSystemObject
or I can do this:
Dim fso As Object
Set fso = CreateObject("Scripting.FileSystemObject")
How do I know what string to use for CreateObject? For example, how would I know to use the "Scripting." part of "Scripting.FileSystemObject"? Where do you go to look that up?
| When you're using `CreateObject` in VBA (Visual Basic for Applications), the string you pass (like `"Scripting.FileSystemObject"`) specifies the programmatic identifier (ProgID) of the object you want to create. To find out the correct ProgID for a given object, you can refer to several resources:
### 1. **Documentati... | 42,007 | [
{
"from": "human",
"value": "I can do this:\nDim fso As New FileSystemObject\n\nor I can do this:\nDim fso As Object\nSet fso = CreateObject(\"Scripting.FileSystemObject\")\n\nHow do I know what string to use for CreateObject? For example, how would I know to use the \"Scripting.\" part of \"Scripting.FileS... |
Office 2007 brings a new goodie called as 'content controls'.
I need to evaluate this to see if this serves as a solution for a problem under research.
Due to paucity of time and my general disdain for Office-interop-pains,
can someone summarize the benefits?
Is it possible to define custom content controls?
where do... | Certainly! Content controls in Office 2007, particularly in Word, offer several advantages that make them useful for various applications, especially in scenarios involving document templating and data binding. Here’s a summary of their benefits and capabilities:
### Benefits of Content Controls
1. **Structured Docum... | 42,978 | [
{
"from": "human",
"value": "Office 2007 brings a new goodie called as 'content controls'.\nI need to evaluate this to see if this serves as a solution for a problem under research.\nDue to paucity of time and my general disdain for Office-interop-pains, \n\ncan someone summarize the benefits?\nIs it possib... |
I'm adding C# WPF dialogs to an existing C++ MFC app, using a C++/CLI interface layer. I've got things working, except I'm having a problem with modality. For example:
MFC app shows a WPF dialog using ShowDialog. Works as expected.
That WPF dialog shows a MFC dialog using DoModal. The WPF dialog is hidden behind the b... | The challenge you're facing arises from the way modality is managed between MFC and WPF. In MFC, dialog modality is handled using the concept of parent windows, where showing a dialog modally (using `DoModal`) will disable the parent window. In WPF, the modality is typically handled using `ShowDialog`, and this can lea... | 38,582 | [
{
"from": "human",
"value": "I'm adding C# WPF dialogs to an existing C++ MFC app, using a C++/CLI interface layer. I've got things working, except I'm having a problem with modality. For example:\n\nMFC app shows a WPF dialog using ShowDialog. Works as expected.\nThat WPF dialog shows a MFC dialog using Do... |
How can I receive and send email in python? A 'mail server' of sorts.
I am looking into making an app that listens to see if it receives an email addressed to foo@bar.domain.com, and sends an email to the sender.
Now, am I able to do this all in python, would it be best to use 3rd party libraries?
| Yes, you can certainly create an email server that listens for incoming emails and sends replies using Python. However, implementing a full-fledged email server from scratch can be quite complex. Instead, you can use existing libraries that simplify the process. Here’s a high-level overview of how to achieve this:
###... | 42,426 | [
{
"from": "human",
"value": "How can I receive and send email in python? A 'mail server' of sorts.\nI am looking into making an app that listens to see if it receives an email addressed to foo@bar.domain.com, and sends an email to the sender.\nNow, am I able to do this all in python, would it be best to use... |
Clearly separation of concerns is a desirable trait in our code and the first obvious step most people take is to separate data access from presentation. In my situation, LINQ To SQL is being used within data access objects for the data access.
My question is, where should the use of the entity object stop? To clarify,... | Hi Martin,
You've raised an important point regarding the separation of concerns when dealing with data access and domain layers in your architecture. In a well-structured application, it is crucial to maintain a clear boundary between different layers to ensure that changes in one layer do not adversely affect others... | 42,792 | [
{
"from": "human",
"value": "Clearly separation of concerns is a desirable trait in our code and the first obvious step most people take is to separate data access from presentation. In my situation, LINQ To SQL is being used within data access objects for the data access.\nMy question is, where should the ... |
Scenario:
Let's say I have four very similar applications (i.e. most of the functionality is the same, but they are different enough to justify each being seperate applications).
What is the best way to re-use the common functionality code between them? COM+? Web services?
In general I'd typically just have the code ... | Reusing common functionality across multiple applications can be approached in several ways, each with its own set of trade-offs. Here are some options to consider, along with their advantages and disadvantages:
### 1. **Class Library (DLL)**
**Description**: Create a separate class library project that contains the ... | 42,830 | [
{
"from": "human",
"value": "Scenario:\nLet's say I have four very similar applications (i.e. most of the functionality is the same, but they are different enough to justify each being seperate applications).\nWhat is the best way to re-use the common functionality code between them? COM+? Web services?\n... |
I have an offline paper based form. I need to convert it into a software that people can use on their computers to fill and submit information. Since the form (it is a tax return) requires considerable time in filling, it is not convenient to have it online. I would much rather have a simple exe which gathers informati... | Creating an offline application for filling out a tax return form and generating a structured data file like XML involves several steps. Below is a guide on how to approach this project.
### Step 1: Define Requirements
1. **Form Structure**: Analyze the paper form to determine the fields, data types, validation rules... | 41,686 | [
{
"from": "human",
"value": "I have an offline paper based form. I need to convert it into a software that people can use on their computers to fill and submit information. Since the form (it is a tax return) requires considerable time in filling, it is not convenient to have it online. I would much rather ... |
I've noticed that when you create a web service object (inheriting from SoapHttpClientProtocol) and you use the Async method, it makes the callback on the Windows GUI thread.
Does anyone know how this works?
How can I achieve the same thing.
I figure this will save me having to check for InvokeRequired in my GUI form... | When you use an asynchronous method in a web service object that inherits from `SoapHttpClientProtocol`, the callback methods you define are executed on the same thread that initiated the asynchronous call. In a Windows Forms application, this is typically the GUI thread. This behavior is managed by the .NET Framework,... | 42,950 | [
{
"from": "human",
"value": "I've noticed that when you create a web service object (inheriting from SoapHttpClientProtocol) and you use the Async method, it makes the callback on the Windows GUI thread.\n\nDoes anyone know how this works?\nHow can I achieve the same thing.\n\nI figure this will save me hav... |
I am considering writing a simple database application for my wife, but I'm hung up on good programming practice, and want to have a human readable source for storing the database schema.
Only, I don't know of any tools for the job, and I can't believe that they don't exist---probably I just don't know what to ask goo... | It's great that you're considering good programming practices for your database application, especially when it comes to managing your schema. There are indeed tools and libraries that can help you represent your database schema in human-readable formats and generate the actual database creation code.
### Tools and Li... | 43,328 | [
{
"from": "human",
"value": "I am considering writing a simple database application for my wife, but I'm hung up on good programming practice, and want to have a human readable source for storing the database schema. \nOnly, I don't know of any tools for the job, and I can't believe that they don't exist---... |
I am configure log4net to use a composite RollingFileAppender so that the current file is always named logfile.log and all subsequent files are named logfile-YYYY.MM.dd.seq.log where seq is the sequence number if a log exceeds a certain size within a single day. Unfortunately, I have had very little success in configu... | To configure a `RollingFileAppender` in log4net to achieve the desired naming convention for log files, you'll need to adjust the configuration appropriately. Based on your requirements, where the current log file is named `logfile.log`, and rolled files are named `logfile-YYYY.MM.dd.seq.log`, here's how you can config... | 42,715 | [
{
"from": "human",
"value": "I am configure log4net to use a composite RollingFileAppender so that the current file is always named logfile.log and all subsequent files are named logfile-YYYY.MM.dd.seq.log where seq is the sequence number if a log exceeds a certain size within a single day. Unfortunately, ... |
Why isn't there a bit structure in C#?
| In C#, a `bit` structure does not exist as a primitive type, primarily due to the way the language and its type system are designed. Here are some key points that explain this decision:
1. **Language Design Philosophy**: C# was designed with a focus on type safety and ease of use. Including a `bit` type could complica... | 46,838 | [
{
"from": "human",
"value": "Why isn't there a bit structure in C#?\n"
},
{
"from": "gpt",
"value": "In C#, a `bit` structure does not exist as a primitive type, primarily due to the way the language and its type system are designed. Here are some key points that explain this decision:\n\n1. **L... |
I am developing an online exam using JSP/Servlets which is nearing completion. I'm planning to add timer function for the entire exam that shows elapsed time in minutes. How do I implement this with a fool-proof technique to implement this, because using javascript would mean that the user can turn off the feature in t... | To implement a timer for your online exam that cannot be easily bypassed by users, you'll need to combine both server-side and client-side techniques. The goal is to have the server enforce the time limit while using client-side code to provide a visual timer for the user. Here’s how to implement a robust timer solutio... | 42,299 | [
{
"from": "human",
"value": "I am developing an online exam using JSP/Servlets which is nearing completion. I'm planning to add timer function for the entire exam that shows elapsed time in minutes. How do I implement this with a fool-proof technique to implement this, because using javascript would mean th... |
In vb.net / winforms, how can a hashtable be bound to a drop down list or any other datasource-driven control?
| In VB.NET WinForms, a `Hashtable` can be used as a data source for controls such as a `ComboBox` or `ListBox`, but you'll need to convert the `Hashtable` entries into a format that the control can work with. A `Hashtable` consists of key-value pairs, and you typically want to display either the keys or the values (or b... | 42,736 | [
{
"from": "human",
"value": "In vb.net / winforms, how can a hashtable be bound to a drop down list or any other datasource-driven control?\n"
},
{
"from": "gpt",
"value": "In VB.NET WinForms, a `Hashtable` can be used as a data source for controls such as a `ComboBox` or `ListBox`, but you'll n... |
I have a fairly simple sync problem. I have a table with about 10 columns that I want to keep in sync between a sqlite file on 3 different clients: an Iphone client, a browser client, and a Ruby on Rails client. So I need a simple sycing solution that will work for all 3, i.e. I can easily implement it in Javascript,... | Your approach of using a last synced timestamp combined with a changelog is a good starting point for syncing data across multiple clients. However, there are several aspects you might want to consider to make your solution more robust and handle potential issues like conflicts, duplicates, and data integrity.
### 1. ... | 42,534 | [
{
"from": "human",
"value": "I have a fairly simple sync problem. I have a table with about 10 columns that I want to keep in sync between a sqlite file on 3 different clients: an Iphone client, a browser client, and a Ruby on Rails client. So I need a simple sycing solution that will work for all 3, i.e.... |
I am looking for good tutorials that go through every step of creating an AR application. It would be beneficial if it also covers some of the theory behind optics and such.
| Creating an augmented reality (AR) application can be an exciting endeavor, and there are plenty of resources available that cover both practical tutorials and theoretical concepts. Here are some recommendations:
### Online Courses and Tutorials
1. **Coursera - AR/VR Specialization**:
- Offered by the University o... | 41,261 | [
{
"from": "human",
"value": "I am looking for good tutorials that go through every step of creating an AR application. It would be beneficial if it also covers some of the theory behind optics and such.\n"
},
{
"from": "gpt",
"value": "Creating an augmented reality (AR) application can be an exc... |
I'm getting back into .NET after numerous years in PHP/MySQL
back in 2002 on Microsoft projects we always used Visual SourceSafe and everyone hated it
in all my PHP/MySQL projects we used SVN and everyone loved it
in modern day .NET projects do teams still use Visual SourceSafe, has it improved?
or has (hopefully) SV... | As of now, Visual SourceSafe (VSS) is largely considered obsolete for modern software development, including .NET projects. While it was a popular version control system in the past, it has significant limitations, including poor performance with larger repositories, lack of support for modern development workflows, an... | 45,710 | [
{
"from": "human",
"value": "\nI'm getting back into .NET after numerous years in PHP/MySQL\nback in 2002 on Microsoft projects we always used Visual SourceSafe and everyone hated it\nin all my PHP/MySQL projects we used SVN and everyone loved it\nin modern day .NET projects do teams still use Visual Source... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.