instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
I'm trying to animate Visio objects with a loop, such as:
For reposition = 2 To 6
xpos = reposition
ypos = reposition
sh1.SetCenter xpos, ypos
Sleep 1000
Next reposition
While this DOES move the object from the starting position to the ending, the intermediate steps are not visible. After a delay on... | To make the intermediate steps of your animation visible in Visio without requiring user interaction (such as clicking a message box), you need to ensure that Visio's display is refreshed after each position update. This will allow the changes to be rendered visually on the screen. You can achieve this by using the `Do... | 31,431 | [
{
"from": "human",
"value": "I'm trying to animate Visio objects with a loop, such as:\nFor reposition = 2 To 6\n xpos = reposition\n ypos = reposition\n\n sh1.SetCenter xpos, ypos\n\n Sleep 1000\n\nNext reposition\n\nWhile this DOES move the object from the starting position to the ending, the ... |
My HTML is as follows:
<ul id="nav">
<li><a href="./">Home</a></li>
<li><a href="/About">About</a></li>
<li><a href="/Contact">Contact</a></li>
</ul>
And my css:
#nav {
display: inline;
}
However the whitespace between the li's shows up. I can remove the whitespace by collapsing them like so:
<ul id="... | Certainly! If you want to maintain readable HTML without manually collapsing the list items to eliminate whitespace, there are a few approaches you can take to handle the spacing between your `<li>` elements using CSS.
### Method 1: Set `display` Property to `inline` or `inline-block`
Using `display: inline` on your ... | 29,942 | [
{
"from": "human",
"value": "My HTML is as follows:\n<ul id=\"nav\">\n <li><a href=\"./\">Home</a></li>\n <li><a href=\"/About\">About</a></li>\n <li><a href=\"/Contact\">Contact</a></li>\n</ul>\n\nAnd my css:\n#nav {\n display: inline;\n}\n\nHowever the whitespace between the li's shows up. I c... |
Very basic question: how do I write a short literal in C++?
I know the following:
2 is an int
2U is an unsigned int
2L is a long
2LL is a long long
2.0f is a float
2.0 is a double
'\2' is a char.
But how would I write a short literal? I tried 2S but that gives a compiler warning.
| In C++, there is no specific suffix for short literals like there is for types such as `int`, `long`, or `float`. The `short` type is typically inferred from the context or explicitly cast from other integer literals.
If you want to ensure that a literal is treated as a `short`, you can simply use a cast. For example:... | 32,539 | [
{
"from": "human",
"value": "Very basic question: how do I write a short literal in C++?\nI know the following:\n\n2 is an int\n2U is an unsigned int\n2L is a long\n2LL is a long long\n2.0f is a float\n2.0 is a double\n'\\2' is a char.\n\nBut how would I write a short literal? I tried 2S but that gives a c... |
Is it possible to replace the standard broken image via CSS or using another technique? All my images are the same size and my have transparency.
I've tried to wrap all images with a div's background:
<div class="no_broken">
<img src="http://www.web.com/found.gif"/>
</div>
<div class="no_broken">
<img src="http://... | Yes, you can replace standard broken images using CSS or JavaScript, and there are a few methods to achieve this without stacking images on top of each other.
### Method 1: Use CSS with `::after` Pseudo-element
You can use the `::after` pseudo-element to overlay a fallback image when the original image fails to load.... | 27,433 | [
{
"from": "human",
"value": "Is it possible to replace the standard broken image via CSS or using another technique? All my images are the same size and my have transparency.\nI've tried to wrap all images with a div's background:\n<div class=\"no_broken\">\n <img src=\"http://www.web.com/found.gif\"/>\n</... |
I would like to access a class everywhere in my application, how can I do this?
To make it more clear, I have a class somewhere that use some code. I have an other class that use the same code. I do not want to duplicate so I would like to call the same code in both place by using something. In php I would just include... | To access a class globally in your application without duplicating code or creating an object every time, you can use the Singleton design pattern or a static method approach in PHP. Here’s how you can implement both:
### Using Singleton Pattern
The Singleton pattern ensures that a class has only one instance and pro... | 31,541 | [
{
"from": "human",
"value": "I would like to access a class everywhere in my application, how can I do this?\nTo make it more clear, I have a class somewhere that use some code. I have an other class that use the same code. I do not want to duplicate so I would like to call the same code in both place by us... |
How can I find the largest increasing (non-contiguous) subset of an array? For example, if A= array(50,1,4,9,2,18,6,3,7,10) the largest increasing non-contiguous subset is either (1,4,6,7,10) or (1,2,6,7,10). I can intuitively see how to find the subset, but I don't know how to design the algorithm.
| To find the largest increasing non-contiguous subset (also known as the Longest Increasing Subsequence, or LIS) of an array, you can use dynamic programming. Here's a detailed explanation of how to approach this problem, along with a sample algorithm.
### Dynamic Programming Approach
1. **Define the Problem**:
Le... | 26,519 | [
{
"from": "human",
"value": "How can I find the largest increasing (non-contiguous) subset of an array? For example, if A= array(50,1,4,9,2,18,6,3,7,10) the largest increasing non-contiguous subset is either (1,4,6,7,10) or (1,2,6,7,10). I can intuitively see how to find the subset, but I don't know how to ... |
What's the easiest way to checkout a file from our TFS with MSBUILD.
From what I can see it's to shell out to TF.EXE and manually call the checkout command. Is there really no built in command?!
| When working with TFS (Team Foundation Server) and MSBuild, there isn't a built-in MSBuild task specifically designed for checking out files directly. However, you can achieve this by using a custom MSBuild task that calls `tf.exe` to perform the checkout.
Here’s a simplified way to do this using the `<Exec>` task in ... | 29,405 | [
{
"from": "human",
"value": "What's the easiest way to checkout a file from our TFS with MSBUILD. \nFrom what I can see it's to shell out to TF.EXE and manually call the checkout command. Is there really no built in command?!\n"
},
{
"from": "gpt",
"value": "When working with TFS (Team Foundatio... |
Looking at System.Collections.Generic.Dictionary<TKey, TValue>, it clearly implements ICollection<KeyValuePair<TKey, TValue>>, but doesn't have the required "void Add(KeyValuePair<TKey, TValue> item)" function.
This can also be seen when trying to initialize a Dictionary like this:
private const Dictionary<string, int>... | The `Dictionary<TKey, TValue>` class in C# indeed implements the `ICollection<KeyValuePair<TKey, TValue>>` interface, which includes the `Add(KeyValuePair<TKey, TValue> item)` method. However, it's important to understand how the `Dictionary<TKey, TValue>` works in the context of object initialization.
When you try to... | 32,879 | [
{
"from": "human",
"value": "Looking at System.Collections.Generic.Dictionary<TKey, TValue>, it clearly implements ICollection<KeyValuePair<TKey, TValue>>, but doesn't have the required \"void Add(KeyValuePair<TKey, TValue> item)\" function.\nThis can also be seen when trying to initialize a Dictionary like... |
I just realized that in some place in my code I have the return statement inside the lock and sometime outside. Which one is the best?
1)
void example()
{
lock (mutex)
{
//...
}
return myData;
}
2)
void example()
{
lock (mutex)
{
//...
return myData;
}
}
Which one should I use... | The choice between placing the `return` statement inside or outside the `lock` block depends on what you're trying to achieve, specifically regarding the scope of the lock and the data you are working with.
1. **Return Outside the Lock:**
```csharp
void example()
{
lock (mutex)
{
//..... | 32,179 | [
{
"from": "human",
"value": "I just realized that in some place in my code I have the return statement inside the lock and sometime outside. Which one is the best?\n1)\nvoid example()\n{\n lock (mutex)\n {\n //...\n }\n return myData;\n}\n\n2)\nvoid example()\n{\n lock (mutex)\n {\n ... |
Is there any way to get the handle to the control that has focus?
I am looking for a way to get the ID of control on focus in my app.
After that it would be easy to get the id with GetDlgCtrlID.
CWnd *pwnd = GetWindowOnFocus();
int wID = pwnd->GetDlgCtrlID();
It's the GetWindowOnFocus part that I am missing!
| To get the handle of the control that currently has focus in a Windows application, you can use the `GetFocus()` function. This function retrieves a handle to the window (control) that has the keyboard focus. You can then use this handle to retrieve the control ID using `GetDlgCtrlID()`. Here is how you can implement t... | 31,458 | [
{
"from": "human",
"value": "Is there any way to get the handle to the control that has focus?\nI am looking for a way to get the ID of control on focus in my app. \nAfter that it would be easy to get the id with GetDlgCtrlID.\nCWnd *pwnd = GetWindowOnFocus(); \nint wID = pwnd->GetDlgCtrlID();\n\nIt's the G... |
Suppose you have:
A-B-C
Now your build/test fails. The fix should be merged in A.
My current work-flow is like this:
$ git commit -m "fixA"
A-B-C-fixA
$ git rebase -i A~1
And squash fixA in A, result in:
A'-B-C
Is there a command to do something like:
A-B-C + (index with fix for A)
$ git commit -supperdupper A ... | In Git, there isn't a direct command that works exactly like the hypothetical `git commit -supperdupper A` you've described, but you can achieve the result you want using a combination of Git commands in a streamlined way.
If you want to create a commit based on `A`, apply your fix, and then squash it into `A` without... | 32,069 | [
{
"from": "human",
"value": "Suppose you have:\nA-B-C\n\nNow your build/test fails. The fix should be merged in A. \nMy current work-flow is like this:\n$ git commit -m \"fixA\"\n\nA-B-C-fixA\n\n$ git rebase -i A~1\n\nAnd squash fixA in A, result in: \nA'-B-C\n\nIs there a command to do something like:\nA-B... |
Can someone explain how PHP implements associative arrays? What underlying data structure does PHP use? Does PHP hash the key and store it in some kind of hash map? I am curious because I was wondering what the performance of associative arrays where when inserting and searching for keys.
| In PHP, associative arrays are a key feature that allows you to use named keys (strings) rather than just numeric indexes. Under the hood, PHP implements associative arrays using a data structure called a hash table. Here's a brief overview of how this works and its implications for performance:
### Underlying Data St... | 30,531 | [
{
"from": "human",
"value": "Can someone explain how PHP implements associative arrays? What underlying data structure does PHP use? Does PHP hash the key and store it in some kind of hash map? I am curious because I was wondering what the performance of associative arrays where when inserting and searching... |
I'm looking for a KDTree implementation in Java.
I've done a google search and the results seem pretty haphazard. There are actually lots of results, but they're mostly just little one-off implementations, and I'd rather find something with a little more "production value". Something like apache collections or the exce... | If you're looking for a well-structured and maintained KD-Tree implementation in Java, along with a more extensive API for spatial data structures, consider the following libraries:
1. **Apache Commons Math**:
- Apache Commons Math includes a variety of mathematical and statistical tools, including a KDTree impleme... | 27,871 | [
{
"from": "human",
"value": "I'm looking for a KDTree implementation in Java.\nI've done a google search and the results seem pretty haphazard. There are actually lots of results, but they're mostly just little one-off implementations, and I'd rather find something with a little more \"production value\". S... |
I am trying to use JMockit's code coverage abilities. Using the JVM parameter
-javaagent:jmockit.jar=coverage=.*MyClass.java:html::
I am able to run my tests (jmockit.jar and coverage.jar are on the classpath), unfortunately my log file says:
Loaded external tool: mockit.coverage.CodeCoverage=.*MyClass.java:html::
Loa... | It looks like you were able to resolve the issue with JMockit coverage by switching from JUnit 3 to JUnit 4. That's a common requirement for tools like JMockit that rely on features introduced in JUnit 4.
To summarize for others who might encounter similar issues:
1. **Ensure Correct JUnit Version**: If you are using... | 32,310 | [
{
"from": "human",
"value": "I am trying to use JMockit's code coverage abilities. Using the JVM parameter\n-javaagent:jmockit.jar=coverage=.*MyClass.java:html::\n\nI am able to run my tests (jmockit.jar and coverage.jar are on the classpath), unfortunately my log file says:\nLoaded external tool: mockit.co... |
When implementing the DataMapper pattern, should the class model that I implement in the DataMapper package more closely resemble the domain model or the data model?
| When implementing the DataMapper pattern, the class model in the DataMapper package should more closely resemble the **domain model** rather than the data model.
Here are some key points to consider:
1. **Separation of Concerns**: The DataMapper pattern is designed to separate the in-memory object representation (do... | 32,611 | [
{
"from": "human",
"value": "When implementing the DataMapper pattern, should the class model that I implement in the DataMapper package more closely resemble the domain model or the data model?\n"
},
{
"from": "gpt",
"value": "When implementing the DataMapper pattern, the class model in the Dat... |
I've found a CTP for such integration from Microsoft,
but it seems it never was officially released and supported.
Also - Do you know a list of WWF to BPEL activities mapping?
Thanks
| It sounds like you're working with Windows Workflow Foundation (WWF) and Business Process Execution Language (BPEL). While Microsoft has provided various tools and integrations over the years, the CTP (Community Technology Preview) you mentioned may not have received official support or release, which is not uncommon f... | 26,937 | [
{
"from": "human",
"value": "I've found a CTP for such integration from Microsoft,\nbut it seems it never was officially released and supported.\nAlso - Do you know a list of WWF to BPEL activities mapping?\nThanks\n"
},
{
"from": "gpt",
"value": "It sounds like you're working with Windows Workf... |
I have a string in a watch window in VS2008 and want to see the hex representation of each character. If I right click there's a hexadecimal option but this doesn't appear to do anything. Anybody know how to view the string as a series of hex values?
| In Visual Studio 2008, you can view the hex representation of a string by using the Memory Window. Here are the steps to achieve that:
1. **Add a Watch**: In your code, add a watch for the string variable you want to inspect.
2. **Note the Address**: Once you have the watch set up, look for the memory address of the ... | 31,080 | [
{
"from": "human",
"value": "I have a string in a watch window in VS2008 and want to see the hex representation of each character. If I right click there's a hexadecimal option but this doesn't appear to do anything. Anybody know how to view the string as a series of hex values?\n"
},
{
"from": "gpt... |
What is the best way to delete a database record using LINQ when I have the primary key?
| To delete a database record using LINQ when you have the primary key, you can follow these steps, which typically involve using Entity Framework or LINQ to SQL. Here’s a general approach for each method.
### Using Entity Framework:
1. **Get the DbContext**: Ensure you have your DbContext set up to interact with the d... | 28,692 | [
{
"from": "human",
"value": "What is the best way to delete a database record using LINQ when I have the primary key? \n"
},
{
"from": "gpt",
"value": "To delete a database record using LINQ when you have the primary key, you can follow these steps, which typically involve using Entity Framework... |
Say I want to get the HTML of
http://www.google.com
as a String using some built-in classes of the Cocoa Touch framework.
What is the least amount of code I need to write?
I've gotten this far, but can't figure out how to progress. There must be an easier way.
CFHTTPMessageRef req;
NSURL *url = [NSURL URLWithString:@"h... | You can achieve this using `NSURLSession`, which is the modern way to perform network requests in Cocoa Touch. It significantly simplifies the process of fetching data from a URL. Here's a minimal example of how to get the HTML content of a webpage as a string:
```objc
#import <Foundation/Foundation.h>
int main(int a... | 31,086 | [
{
"from": "human",
"value": "Say I want to get the HTML of\nhttp://www.google.com\nas a String using some built-in classes of the Cocoa Touch framework.\nWhat is the least amount of code I need to write?\nI've gotten this far, but can't figure out how to progress. There must be an easier way.\nCFHTTPMessage... |
how can i figure out the last modified date of a html file im importing into my web app?
The html file is on another server and different users can make updates, when i retrieve the page i want to be able see when it was last updated so i can label the updated date on my homepage. I
| To determine the last modified date of an HTML file located on another server, you have a few options. The most common approach is to use HTTP headers. Here's how you can do that:
### 1. Use the `Last-Modified` Header
When a web server serves a file, it can include a `Last-Modified` HTTP header that indicates when th... | 28,926 | [
{
"from": "human",
"value": "how can i figure out the last modified date of a html file im importing into my web app?\nThe html file is on another server and different users can make updates, when i retrieve the page i want to be able see when it was last updated so i can label the updated date on my homepa... |
I am attempting to return a collection of departments from a .NET assembly to be consumed by ASP via COM Interop. Using .NET I would just return a generic collection, e.g. List<Department>, but it seems that generics don't work well with COM Interop. So, what are my options?
I would like to both iterate over the list a... | When working with COM Interop in .NET, generics, including `List<T>`, do not translate well into COM types, which can create challenges for ASP applications that need to interact with your .NET classes. As you noted, ASP expects collections to support iteration and indexed access in a way that is compatible with COM.
... | 29,339 | [
{
"from": "human",
"value": "I am attempting to return a collection of departments from a .NET assembly to be consumed by ASP via COM Interop. Using .NET I would just return a generic collection, e.g. List<Department>, but it seems that generics don't work well with COM Interop. So, what are my options?\nI ... |
There is a standard two-pass algorithm mentioned in RFC 1942: http://www.ietf.org/rfc/rfc1942.txt however I haven't seen any good real-world implementations. Anyone know of any? I haven't been able to find anything useful in the Mozilla or WebKit code bases, but I am not entirely sure where to look.
I guess this might ... | The two-pass algorithm described in RFC 1942 is primarily designed for rendering tables in a way that ensures proper alignment of cells and rows, especially when dealing with variable-width content. While it is more often discussed in theoretical terms, you can find practical implementations in libraries and frameworks... | 27,836 | [
{
"from": "human",
"value": "There is a standard two-pass algorithm mentioned in RFC 1942: http://www.ietf.org/rfc/rfc1942.txt however I haven't seen any good real-world implementations. Anyone know of any? I haven't been able to find anything useful in the Mozilla or WebKit code bases, but I am not entirel... |
I have a window which contains an NSBox control. In that NSBox are several other controls, (popups, text fields, etc...)
I have two other NSBox's in the same NIB file that are filled with controls that I would like to swap out with the first under certain conditions. I would like this to happen with a nice cross fade e... | It sounds like you're encountering issues with controls disappearing in layer-backed views when using Core Animation for view transitions in your macOS application. This behavior is not uncommon when working with layer-backed views, especially with controls like `NSPopUpButton`.
Here are some suggestions to address th... | 28,512 | [
{
"from": "human",
"value": "I have a window which contains an NSBox control. In that NSBox are several other controls, (popups, text fields, etc...)\nI have two other NSBox's in the same NIB file that are filled with controls that I would like to swap out with the first under certain conditions. I would li... |
I'm preparing a class on Visual Basic 2005 targeting Visual Basic 6 programmers migrating to the .NET platform.
My primary concern is to teach my students the best practices for developing in .NET, and I am wondering about whether to consider the use of the VB runtime functions VB.NET legitimate or not.
I have read tha... | When teaching Visual Basic 2005 to programmers migrating from Visual Basic 6, it's essential to strike a balance between leveraging familiar VB runtime functions and promoting best practices in .NET development. Here are some key points to consider:
1. **Understanding the Transition**: Many VB6 developers will appreci... | 30,845 | [
{
"from": "human",
"value": "I'm preparing a class on Visual Basic 2005 targeting Visual Basic 6 programmers migrating to the .NET platform.\nMy primary concern is to teach my students the best practices for developing in .NET, and I am wondering about whether to consider the use of the VB runtime functions... |
How would you implement a GUI similar to the "My Computer" view in Windows Explorer?
In particular the "Icons" view mode. Including the grouping of different item types (as Files Stored on This Computer/Hard Disk Drives/Devices with Removable Storage groups in Windows Explorer)
In WinForms I would use a ListView for th... | Implementing a GUI similar to the "My Computer" view in Windows Explorer using WPF can indeed be achieved efficiently without the complexity of custom ControlTemplates if you utilize the `TreeView` and `ListView` controls effectively. You can achieve the grouping and "Icons" view mode by using a combination of these co... | 24,946 | [
{
"from": "human",
"value": "How would you implement a GUI similar to the \"My Computer\" view in Windows Explorer?\nIn particular the \"Icons\" view mode. Including the grouping of different item types (as Files Stored on This Computer/Hard Disk Drives/Devices with Removable Storage groups in Windows Explo... |
In my question As a “mockist” TDD practitioner, should I mock other methods in the same class as the method under test?, Avdi answered "Personally I think that mocking on self is almost always a code smell. It's testing the implementation rather than the behavior." He may be right, but often I can't distinguish betwee... | Your question raises an important aspect of unit testing, especially within the context of Test-Driven Development (TDD) and the practices of mocking and dependency isolation. Let's break down how to approach testing the methods in your `Consumer` class while adhering to good testing principles.
### General Principles... | 24,259 | [
{
"from": "human",
"value": "In my question As a “mockist” TDD practitioner, should I mock other methods in the same class as the method under test?, Avdi answered \"Personally I think that mocking on self is almost always a code smell. It's testing the implementation rather than the behavior.\" He may be ... |
We're looking for a way to log any call to stored procedures in Oracle, and see what parameter values were used for the call.
We're using Oracle 10.2.0.1
We can log SQL statements and see the bound variables, but when we track stored procedures we see bind variables B1, B2, etc. but no values.
We'd like to see the same... | Logging calls to stored procedures in Oracle, along with their parameter values, can be a bit challenging since Oracle's default logging mechanisms often do not provide the same level of detail as MS SQL Server Profiler. However, there are several approaches you can take to achieve this. Here are some options:
### 1. ... | 28,143 | [
{
"from": "human",
"value": "We're looking for a way to log any call to stored procedures in Oracle, and see what parameter values were used for the call.\nWe're using Oracle 10.2.0.1\nWe can log SQL statements and see the bound variables, but when we track stored procedures we see bind variables B1, B2, et... |
Given a filename, I need to be able to access certain metadata in an image for a (closed source) project I'm currently developing, without regard to how the metadata is stored (that is, Exif, IPTC, or XMP). In particular, I want to access geotagging data.
Is there a way of doing this without requiring any third party a... | Accessing metadata from image files in .NET without third-party libraries or assemblies can be challenging, especially since the built-in capabilities of .NET for reading image metadata are somewhat limited. While .NET provides classes for basic image processing, it does not natively support reading advanced metadata f... | 28,104 | [
{
"from": "human",
"value": "Given a filename, I need to be able to access certain metadata in an image for a (closed source) project I'm currently developing, without regard to how the metadata is stored (that is, Exif, IPTC, or XMP). In particular, I want to access geotagging data.\nIs there a way of doin... |
Let's say you already "know" what your client wants from you (i.e. you already did some analysis and have some clue about what are you supposed to deliver). What are the next steps you usually go through after this phase? In other words, what are the steps (in terms of preparation of the framework, plugins, repository,... | Once you have a clear understanding of what your client wants after your initial analysis, the next steps involve setting up the foundation for your Ruby on Rails (RoR) application. Here’s a comprehensive list of the typical steps you would take to prepare the framework and development environment for a new RoR project... | 21,973 | [
{
"from": "human",
"value": "Let's say you already \"know\" what your client wants from you (i.e. you already did some analysis and have some clue about what are you supposed to deliver). What are the next steps you usually go through after this phase? In other words, what are the steps (in terms of prepara... |
I am looking at starting a hosted CMS-like service for customers.
As it would, it would require the customer to input text which would be served up to anyone that comes to visit their site. I am planning on using Markdown, possibly in combination with WMD (the live markdown preview that SO uses) for the big blocks of t... | When considering a hosted CMS-like service where customers can input text that will be publicly displayed, it's essential to think carefully about sanitizing user inputs, especially if you plan to allow custom HTML, CSS, and JavaScript. Here are some factors to consider:
### Security Concerns
1. **Cross-Site Scripting... | 25,276 | [
{
"from": "human",
"value": "I am looking at starting a hosted CMS-like service for customers.\nAs it would, it would require the customer to input text which would be served up to anyone that comes to visit their site. I am planning on using Markdown, possibly in combination with WMD (the live markdown pre... |
Because I need to display a huge number of labels that move independently, I need to render a label in pyglet to a texture (otherwise updating the vertex list for each glyph is too slow).
I have a solution to do this, but my problem is that the texture that contains the glyphs is black, but I'd like it to be red. See t... | To color the texture red in your Pyglet code, you can modify the way you generate the texture with the glyphs. Specifically, after creating the texture from the glyphs' images, you can manipulate the pixel data in the texture to change the color of the glyphs from black to red. Here's a modified version of your `label2... | 25,510 | [
{
"from": "human",
"value": "Because I need to display a huge number of labels that move independently, I need to render a label in pyglet to a texture (otherwise updating the vertex list for each glyph is too slow).\nI have a solution to do this, but my problem is that the texture that contains the glyphs ... |
$fp_src=fopen('file','r');
$filter = stream_filter_prepend($fp_src, 'convert.iconv.ISO-8859-1/UTF-8');
while(fread($fp_src,4096)){
++$count;
if($count%1000==0) print ftell($fp_src)."\n";
}
When I run this the script ends up consuming ~ 200 MB of RAM after going through just 35MB of the file.
Running it wi... | The memory consumption you're experiencing when using the `stream_filter_prepend` function with `convert.iconv.ISO-8859-1/UTF-8` is likely due to how the iconv filtering operates in conjunction with the way you're reading the file.
Here are a few potential reasons and suggestions for the high memory usage:
1. **Buffe... | 30,586 | [
{
"from": "human",
"value": "$fp_src=fopen('file','r');\n\n$filter = stream_filter_prepend($fp_src, 'convert.iconv.ISO-8859-1/UTF-8');\n\nwhile(fread($fp_src,4096)){\n ++$count;\n if($count%1000==0) print ftell($fp_src).\"\\n\";\n} \n\nWhen I run this the script ends up consuming ~ 200 MB of RAM after... |
I try to find something similar to nokia's python for windows mobile based devices - a script interpreter [in this case also able to create standalone apps] with easy access to all phone interfaces - ability to make a phone call, send SMS, make a photo, send a file over GPRS, etc...
While there is 2.5 pythonce availabl... | Finding a direct equivalent to Nokia's Python for Windows Mobile can be challenging, as the development environment for Windows Mobile is quite different from that of Nokia devices. However, there are a few approaches you can consider:
1. **Python for .NET**: Although you mentioned you don't want to use .NET Compact F... | 32,761 | [
{
"from": "human",
"value": "I try to find something similar to nokia's python for windows mobile based devices - a script interpreter [in this case also able to create standalone apps] with easy access to all phone interfaces - ability to make a phone call, send SMS, make a photo, send a file over GPRS, et... |
In a PHP script I am writing, I need to send a control+z character down a network socket I have previously created. I understand the ctrl+z character to be chr(26), so at the end of the string I am sending I have added a new line (\r\n) and then the chr(26) as follows:
$socket=fsockopen($host['host'],$host['port']);
fp... | Sending a Control+Z (ASCII character 26) through a network socket in PHP using `fputs` is generally correct as you've already done it. However, there are a few potential issues you might want to check to ensure that the character is being sent properly and interpreted correctly on the other end.
### Here are some thin... | 29,885 | [
{
"from": "human",
"value": "In a PHP script I am writing, I need to send a control+z character down a network socket I have previously created. I understand the ctrl+z character to be chr(26), so at the end of the string I am sending I have added a new line (\\r\\n) and then the chr(26) as follows:\n$socke... |
I have a web application that comprises the following:
A web project (with a web.config file containing a connection string - but no data access code in the web project)
A data access project that uses LINQ-SQL classes to provide entities to the web project UI (this project has a settings file and an app.config - both... | It sounds like you're dealing with a common issue in .NET applications where multiple configuration files lead to confusion regarding connection strings. To streamline your configuration and ensure that there's only one connection string being used throughout your application, you can follow these steps:
### 1. Consol... | 29,442 | [
{
"from": "human",
"value": "I have a web application that comprises the following:\n\nA web project (with a web.config file containing a connection string - but no data access code in the web project)\nA data access project that uses LINQ-SQL classes to provide entities to the web project UI (this project ... |
I have a client who is in need of a file based encryption / decryption application to be used between Linux / Windows 2003 Server. The goal is to have a single file compressed nightly on a linux platform and secured using a script, transmitted over FTP, decrypted on the Windows 2003 server and available for other impo... | For your client's requirements, you can create a simple and effective file-based encryption and decryption solution that can be used between Linux and Windows. Here’s a straightforward approach utilizing GnuPG (GPG) for encryption and decryption, along with the `zip` utility for compression. This method will ensure tha... | 28,906 | [
{
"from": "human",
"value": "I have a client who is in need of a file based encryption / decryption application to be used between Linux / Windows 2003 Server. The goal is to have a single file compressed nightly on a linux platform and secured using a script, transmitted over FTP, decrypted on the Windows... |
We have a character LCD (www.cloverlcd.com/pdf/S6A0069.pdf) that we got to work in 8 bit mode. However, now we are trying to get it to work in 4 bit mode but it doesn't seem to be displaying anything. I think the function set instruction isn't been written. Can somebody please check if I am approaching this the righ... | When switching from 8-bit mode to 4-bit mode on a character LCD, there are specific steps and timings you need to follow to properly initialize the display. Here are the steps you should take for 4-bit mode initialization, along with a review of your current code.
### 4-bit Mode Initialization Steps
1. **Set the inte... | 26,063 | [
{
"from": "human",
"value": "We have a character LCD (www.cloverlcd.com/pdf/S6A0069.pdf) that we got to work in 8 bit mode. However, now we are trying to get it to work in 4 bit mode but it doesn't seem to be displaying anything. I think the function set instruction isn't been written. Can somebody pleas... |
I need specifically to load a JPG image that was saved as a blob. GDI+ makes it very easy to retrieve images from files but not from databases...
| To load a JPG image stored as a BLOB in a database using GDI+ in a .NET application, you can follow these steps. The example will use C# and assume you are using a SQL Server database.
### Step-by-Step Guide
1. **Retrieve the BLOB from the Database**:
First, you need to retrieve the BLOB data from your database us... | 23,738 | [
{
"from": "human",
"value": "I need specifically to load a JPG image that was saved as a blob. GDI+ makes it very easy to retrieve images from files but not from databases...\n"
},
{
"from": "gpt",
"value": "To load a JPG image stored as a BLOB in a database using GDI+ in a .NET application, you... |
(Bear with me, I promise this gets to shebang and windows.)
I have about the simplest of WEBRick servers put together:
require 'webrick'
include WEBrick
s = HTTPServer.new(:Port=>2000, :DocumentRoot=>Dir::pwd)
s.start
Couldn't be simpler. This basic server does accept http connections (firefox, internet exploder, wg... | The issue you're encountering with the shebang (`#!`) line in your CGI script on Windows stems from the way that the operating system handles it. Unlike Unix-based systems, Windows does not use shebang lines to determine the interpreter for executing scripts. Instead, it relies on file associations and other mechanisms... | 28,827 | [
{
"from": "human",
"value": "(Bear with me, I promise this gets to shebang and windows.)\nI have about the simplest of WEBRick servers put together:\nrequire 'webrick'\ninclude WEBrick\n\ns = HTTPServer.new(:Port=>2000, :DocumentRoot=>Dir::pwd)\ns.start\n\nCouldn't be simpler. This basic server does accept... |
Can someone please point me to the easiest way to have a timer in a Win32 service?
I suppose I could create a dummy window for this purpose or have a second thread do tick counts, but what's best? Is there a more elegant way?
Thanks in advance.
| Creating a timer in a Win32 service can indeed be a bit tricky since services typically run in a different context than regular applications. While using a dummy window or a separate thread are common approaches, there are more streamlined options that may suit your needs. Below are a couple of options, along with an e... | 24,694 | [
{
"from": "human",
"value": "Can someone please point me to the easiest way to have a timer in a Win32 service?\nI suppose I could create a dummy window for this purpose or have a second thread do tick counts, but what's best? Is there a more elegant way?\nThanks in advance.\n"
},
{
"from": "gpt",
... |
in a C program I have an long* that I want to serialize (thus converting to chars). A long doesn't fit in a single char, and the size varies depending of the processor (can be 4 bytes or 8 bytes).
Theres a good way to make the serialization and de-serialization?
| To serialize and deserialize a `long*` in C, you can use the `memcpy` function to convert between the `long` value and a character array. Since the size of `long` can vary depending on the architecture (4 bytes on some systems, 8 bytes on others), it's important to account for the size dynamically.
Here’s a simple app... | 27,752 | [
{
"from": "human",
"value": "in a C program I have an long* that I want to serialize (thus converting to chars). A long doesn't fit in a single char, and the size varies depending of the processor (can be 4 bytes or 8 bytes).\nTheres a good way to make the serialization and de-serialization? \n"
},
{
... |
What are some good algorithms for automatically labeling text with the city / region or origin? That is, if a blog is about New York, how can I tell programatically. Are there packages / papers that claim to do this with any degree of certainty?
I have looked at some tfidf based approaches, proper noun intersectio... | Automatically labeling text with its city or region of origin can be a challenging task, but there are several approaches you can try. Here are some methods, tools, and ideas that might help you achieve better results:
### 1. **Keyword Matching**
- **Keyword Lists**: Create lists of cities, regions, or related term... | 26,770 | [
{
"from": "human",
"value": "What are some good algorithms for automatically labeling text with the city / region or origin? That is, if a blog is about New York, how can I tell programatically. Are there packages / papers that claim to do this with any degree of certainty? \nI have looked at some tfidf... |
We use GUIDs for primary key, which you know is clustered by default.
When inserting a new row into a table it is inserted at a random page in the table (because GUIDs are random). This has a measurable performance impact because the DB will split data pages all the time (fragmentation). But the main reason I what a se... | In .NET, there isn't a built-in method equivalent to SQL Server's `NEWSEQUENTIALID()` that generates sequential GUIDs directly in the application code. However, you can implement a similar concept by creating your own mechanism to generate sequential GUIDs.
One popular approach is to use a "comb GUID" pattern, which c... | 31,680 | [
{
"from": "human",
"value": "We use GUIDs for primary key, which you know is clustered by default.\nWhen inserting a new row into a table it is inserted at a random page in the table (because GUIDs are random). This has a measurable performance impact because the DB will split data pages all the time (fragm... |
I'm trying to write a log file from an ASP.NET application under IIS7, but keep getting the following exception:
UnauthorizedAccessException
"Access to the path 'C:\Users\Brady\Exports' is denied."
I have given write access to the iis_iusrs, iis_wpg, and aspnet users, based on various advices found by Google, but s... | The `UnauthorizedAccessException` you're encountering indicates that the ASP.NET application running under IIS does not have the necessary permissions to write to the specified directory (`C:\Users\Brady\Exports`). Here's how to resolve this issue:
### 1. Verify IIS Application Pool Identity
By default, ASP.NET appli... | 30,667 | [
{
"from": "human",
"value": "I'm trying to write a log file from an ASP.NET application under IIS7, but keep getting the following exception:\n\nUnauthorizedAccessException\n \"Access to the path 'C:\\Users\\Brady\\Exports' is denied.\"\n\nI have given write access to the iis_iusrs, iis_wpg, and aspnet use... |
I have databases with different collations. I want to be able to script out tables from one database and create them in another. However, when I script out the tables, it includes the collation in the column definitions.
Is there a way to exclude the collations from the generated table creation scripts?
| When generating scripts for tables in SQL Server, you can customize the scripting options to exclude the collation information for text-based columns. However, you need to keep in mind that doing this may lead to compatibility issues later on, especially if the default collation of the new database differs from that of... | 29,335 | [
{
"from": "human",
"value": "I have databases with different collations. I want to be able to script out tables from one database and create them in another. However, when I script out the tables, it includes the collation in the column definitions.\nIs there a way to exclude the collations from the gener... |
I have the Profile, CCK, and Views2 modules installed on a Drupal 6 site. I added a string field to the user profile. I can filter easily on preset values, thru the Views GUI builder, really nicely. However, I'd like the filter criteria to be dynamically set based on other environment variables (namely the $_SERVER[... | Creating a custom filter in Views for Drupal 6 can be a bit complex, especially if you're not familiar with module development in Drupal. However, I can guide you through the basic steps to create a custom filter that dynamically filters based on the server name.
### Steps to Create a Custom Views Filter in Drupal 6
... | 30,499 | [
{
"from": "human",
"value": "I have the Profile, CCK, and Views2 modules installed on a Drupal 6 site. I added a string field to the user profile. I can filter easily on preset values, thru the Views GUI builder, really nicely. However, I'd like the filter criteria to be dynamically set based on other en... |
I am unsure if this is even possible, but I thought I would ask. First off, for my purposes, I require this to work in the C# portion and not the XAML part. This is what I have and it works:
public partial class MyClass1 : Window
{
public MyClass2 MyClass2Object { get; set; }
public MyClass1()
{
... | Yes, it's possible to bind a property in WPF dynamically based on a string input, but you'll need to employ reflection to achieve this. Reflection allows you to access properties and objects at runtime based on their names as strings.
Here's how you can modify your code to achieve the desired functionality:
1. Split ... | 31,095 | [
{
"from": "human",
"value": "I am unsure if this is even possible, but I thought I would ask. First off, for my purposes, I require this to work in the C# portion and not the XAML part. This is what I have and it works:\npublic partial class MyClass1 : Window\n{\n public MyClass2 MyClass2Object { get; s... |
On Linux (or Solaris) is there a better way than hand parsing /proc/self/maps repeatedly to figure out whether or not you can read, write or execute whatever is stored at one or more addresses in memory?
For instance, in Windows you have VirtualQuery.
In Linux, I can mprotect to change those values, but I can't read t... | In Linux, there isn't a direct equivalent to Windows' `VirtualQuery` that allows you to query memory protection for a specific address without parsing `/proc/self/maps`. However, there are some approaches you can consider to make this process more efficient and robust:
### 1. **Using `mincore`**
The `mincore` system c... | 29,158 | [
{
"from": "human",
"value": "On Linux (or Solaris) is there a better way than hand parsing /proc/self/maps repeatedly to figure out whether or not you can read, write or execute whatever is stored at one or more addresses in memory?\nFor instance, in Windows you have VirtualQuery. \nIn Linux, I can mprotect... |
I have a large collection of static 'Utility' classes that contain very generic static methods. For example, I have a CollectionUtility class that has useful methods like:
public static void RemoveDuplicates(ICollection collection)... etc
With C# 3.0 I've been converting these to extension methods.
Now, I've heard some... | The use of utility classes and static methods in enterprise-level applications can be a topic of debate among developers. Here are some considerations, based on common practices in the industry:
### Pros of Using Utility Classes
1. **Convenience**: Utility classes can provide commonly used functions that make the cod... | 30,977 | [
{
"from": "human",
"value": "I have a large collection of static 'Utility' classes that contain very generic static methods. For example, I have a CollectionUtility class that has useful methods like:\npublic static void RemoveDuplicates(ICollection collection)... etc\nWith C# 3.0 I've been converting these... |
Is it possible to grab activedirectory credentials for the user on a client machine from within a web application?
To clarify, I am designing a web application which will be hosted on a client's intranet.
There is a requirement that the a user of the application not be prompted for credentials when accessing the appl... | Accessing Active Directory credentials from a web application without user interaction raises significant security and privacy concerns. Here are some important points to consider regarding your scenario:
### Technical Limitations
1. **Security Restrictions**: Modern web browsers implement strict security measures tha... | 23,799 | [
{
"from": "human",
"value": "Is it possible to grab activedirectory credentials for the user on a client machine from within a web application?\nTo clarify, I am designing a web application which will be hosted on a client's intranet. \nThere is a requirement that the a user of the application not be promp... |
.NET newbie here... I'd like to make a button in a Windows form that displays a progress or "cooldown" effect. That is, when the button is pressed, it becomes disabled. As some event or timer is progressing, the button shows the progress graphically. When the progress is finished, the graphic completes and the butto... | Creating a progress or cooldown effect on a button in a Windows Forms application can indeed be done using the built-in Button class, but it often requires custom drawing. However, a simpler approach is to create a custom button control by deriving from the `Button` class and then using a Timer to handle the progress e... | 24,426 | [
{
"from": "human",
"value": ".NET newbie here... I'd like to make a button in a Windows form that displays a progress or \"cooldown\" effect. That is, when the button is pressed, it becomes disabled. As some event or timer is progressing, the button shows the progress graphically. When the progress is fi... |
I'm developing an operating system and rather than programming the kernel, I'm designing the kernel. This operating system is targeted at the x86 architecture and my target is for modern computers. The estimated number of required RAM is 256Mb or more.
What is a good size to make the stack for each thread run on the sy... | Designing an operating system kernel is an ambitious and complex task, and deciding on the stack size for threads is indeed an important aspect. Let’s address the considerations you've brought up regarding stack size, automatic expansion, and related topics.
### Stack Size Considerations
1. **Default Stack Size**:
... | 28,340 | [
{
"from": "human",
"value": "I'm developing an operating system and rather than programming the kernel, I'm designing the kernel. This operating system is targeted at the x86 architecture and my target is for modern computers. The estimated number of required RAM is 256Mb or more.\nWhat is a good size to ma... |
I need a timer tick with 1ms resolution under linux. It is used to increment a timer value that in turn is used to see if various Events should be triggered. The POSIX timerfd_create is not an option because of the glibc requirement. I tried timer_create and timer_settimer, but the best I get from them is a 10ms resolu... | Given your requirements for a timer with a resolution of 1ms on a Linux system with kernel version 2.6.26, you face inherent limitations due to the timer resolution provided by the standard APIs and the kernel's configuration. As you noted, the default kernel clock settings may limit the resolution to 10ms or higher, a... | 27,157 | [
{
"from": "human",
"value": "I need a timer tick with 1ms resolution under linux. It is used to increment a timer value that in turn is used to see if various Events should be triggered. The POSIX timerfd_create is not an option because of the glibc requirement. I tried timer_create and timer_settimer, but ... |
This is an important addition especially to solve performance issues while being able to write efficient dynamic HQL queries.
But, how do we modify the HQL transformer in case of loading a specific parent or another mapped entity property?
The following code:
session.createQuery(
"select st.stNumber as stNumber, s... | To modify the HQL query to include properties from a parent entity while still using a result transformer, you need to ensure that the result is correctly mapped to the appropriate classes.
In your case, if you want to access properties of the `SomeParent` entity alongside properties from `SomeTable`, you have two ma... | 26,880 | [
{
"from": "human",
"value": "This is an important addition especially to solve performance issues while being able to write efficient dynamic HQL queries. \nBut, how do we modify the HQL transformer in case of loading a specific parent or another mapped entity property?\nThe following code:\nsession.createQ... |
I'm interested in compilers, interpreters and languages.
What is the most interesting, but forgotten or unknown, language you know about? And more importantly, why?
I'm interested both in compiled, interpreted and VM languages, but not esoteric languages like Whitespace or BF. Open source would be a plus, of course, s... | One interesting but relatively forgotten programming language that you might find intriguing is **Icon**. Developed in the 1970s and 1980s by Ralph Griswold and his team at the University of Arizona, Icon is a high-level programming language designed for tasks involving complex data structures, particularly string proc... | 28,956 | [
{
"from": "human",
"value": "I'm interested in compilers, interpreters and languages.\nWhat is the most interesting, but forgotten or unknown, language you know about? And more importantly, why? \nI'm interested both in compiled, interpreted and VM languages, but not esoteric languages like Whitespace or BF... |
Here is the question:
Can TortoiseSvn work on Windows 2008 without turning off User Account Control?
Here is the story:
I just moved my test server to Windows 2008 and I am having problems with TortoiseSvn. I am logged on as an administrator, but when I go to update some code from the Subversion repository, I get a m... | Yes, TortoiseSVN can work on Windows Server 2008 without turning off User Account Control (UAC), but it requires a few adjustments since UAC can cause permission issues for applications that need elevated privileges.
Here are some suggestions to resolve the issue without disabling UAC:
1. **Run TortoiseSVN as Adminis... | 31,168 | [
{
"from": "human",
"value": "Here is the question:\nCan TortoiseSvn work on Windows 2008 without turning off User Account Control? \nHere is the story:\nI just moved my test server to Windows 2008 and I am having problems with TortoiseSvn. I am logged on as an administrator, but when I go to update some co... |
I have a DataGrid with 5 template columns,
However when I try and add some dynamically created controls into the grid, it fails, as there are no rows.
-Can i add a blank row in and use that? and how?
-Or any other way?
| Yes, you can add a blank row to a DataGrid in order to create a placeholder for dynamically created controls. The specific approach to do this depends on the type of application you're building (e.g., WPF, WinForms, ASP.NET) and how your DataGrid is set up. Below, I’ll provide a general approach suitable for WPF, but y... | 29,187 | [
{
"from": "human",
"value": "I have a DataGrid with 5 template columns,\nHowever when I try and add some dynamically created controls into the grid, it fails, as there are no rows.\n-Can i add a blank row in and use that? and how?\n-Or any other way?\n"
},
{
"from": "gpt",
"value": "Yes, you can... |
I just learned about ngrep, a cool program that lets you easily sniff packets that match a particular string.
The only problem is that it can be hard to see the match in the big blob of output. I'd like to write a wrapper script to highlight these matches -- it could use ANSI escape sequences:
echo -e 'This is \e[31mRE... | To create a wrapper script that highlights matches from the output of `ngrep`, you can read from the input stream line by line, allowing you to process the output without waiting for a newline character. The key here is to make sure to process the input character by character, which allows us to identify the hash marks... | 28,992 | [
{
"from": "human",
"value": "I just learned about ngrep, a cool program that lets you easily sniff packets that match a particular string.\nThe only problem is that it can be hard to see the match in the big blob of output. I'd like to write a wrapper script to highlight these matches -- it could use ANSI e... |
Duplicate of: When/Why to use Cascading in SQL Server?
I've always been too scared to use DELETE CASCADE, but as I get more confident (lazy :D), I'm thinking how bad can it be, is it best practise to use it or should I avoid it and clean up my foreign keys etc the old fashioned way (with stored procedures)?
| Using `DELETE CASCADE` in SQL Server can be both beneficial and risky, depending on your use case. Here are some considerations to help you determine when to use it and when to avoid it:
### When to Use `DELETE CASCADE`:
1. **Data Integrity**: If your application heavily relies on maintaining data integrity and you w... | 30,359 | [
{
"from": "human",
"value": "\nDuplicate of: When/Why to use Cascading in SQL Server?\n\nI've always been too scared to use DELETE CASCADE, but as I get more confident (lazy :D), I'm thinking how bad can it be, is it best practise to use it or should I avoid it and clean up my foreign keys etc the old fashi... |
I've been using the macro from this blog entry for attaching the Visual Studio debugger to an already running instance of the Web Application I'm currently working on. However, if I have more than one instance of the Visual Studio web server running it's pot luck which one it'll attach to.
Is there a way to determine w... | To programmatically determine the configured port number for a web project in Visual Studio, you can use the DTE (Development Tools Environment) object model, which allows you to access various properties of the solution, including web project configurations.
Here's a step-by-step guide on how to do this in a macro or... | 27,128 | [
{
"from": "human",
"value": "I've been using the macro from this blog entry for attaching the Visual Studio debugger to an already running instance of the Web Application I'm currently working on. However, if I have more than one instance of the Visual Studio web server running it's pot luck which one it'll... |
The one thing that LINQ seems to be missing for me is a way to reference columns by text string. For example, I have a typical GridView set up with sorting like this (the DataSource is bound to a LINQ query in the code-behind):
<asp:GridView ID="MyGridView" runat="server" AllowSorting="True">
<Columns>
<asp... | You're correct that handling sorting with LINQ based on string field names can be cumbersome, especially when you have many fields. However, you can simplify this using reflection and the `System.Linq.Expressions` namespace.
Here’s an approach that allows you to build a sorting expression dynamically based on the sor... | 30,944 | [
{
"from": "human",
"value": "The one thing that LINQ seems to be missing for me is a way to reference columns by text string. For example, I have a typical GridView set up with sorting like this (the DataSource is bound to a LINQ query in the code-behind):\n<asp:GridView ID=\"MyGridView\" runat=\"server\" A... |
If I notice that a hash table (or any other data structure built on a hash table) is filling up, at what point should you build a new table with more buckets. And given n items in the table so far, how do you figure out how many buckets to use in the new one?
So let's say I have 100 buckets. Should I reorganize it when... | When working with hash tables, there are several key considerations regarding when to resize the table and how to calculate the number of buckets needed. Here are some general guidelines to follow:
### When to Resize the Hash Table
1. **Load Factor**: The load factor is defined as the ratio of the number of elements ... | 30,448 | [
{
"from": "human",
"value": "If I notice that a hash table (or any other data structure built on a hash table) is filling up, at what point should you build a new table with more buckets. And given n items in the table so far, how do you figure out how many buckets to use in the new one?\nSo let's say I hav... |
Scenario is that we send out thousands of emails through SMTP server. Content is created in advance and picked up when sent.
The thing is we want to find where our bottlenecks are in production environment and where work needs to be done. Goal is to be able to send half a million emails in ten minutes*.
Should we c... | To effectively identify bottlenecks in your email sending process and ensure that you can achieve your goal of sending half a million emails in ten minutes, it’s essential to take a strategic approach. Here are some steps and considerations for testing and optimizing your SMTP email delivery system:
### 1. **Understan... | 27,106 | [
{
"from": "human",
"value": "Scenario is that we send out thousands of emails through SMTP server. Content is created in advance and picked up when sent.\nThe thing is we want to find where our bottlenecks are in production environment and where work needs to be done. Goal is to be able to send half a mil... |
I have a page where search resuts are shown both in a grid and on a map (using KML generated on the fly, overlaid on an embedded Google map). I've wired this up to work as the user types; here's the skeleton of my code, which works:
$(function() {
// Wire up search textbox
$('input.Search').bind("keyup", update... | To introduce a delay before executing your `update` function after the user stops typing, you can use a technique called debouncing. Debouncing will ensure that the `update` function is called only after the user has stopped typing for a specified amount of time (in this case, N seconds).
Here’s how you can implement... | 31,033 | [
{
"from": "human",
"value": "I have a page where search resuts are shown both in a grid and on a map (using KML generated on the fly, overlaid on an embedded Google map). I've wired this up to work as the user types; here's the skeleton of my code, which works:\n$(function() {\n // Wire up search textbox... |
I was using Spring.NET to create a message listener at application startup. I now need the ability to create 0-n listeners, some of which could be listening to different queues. I will need to be able to create/destroy them at run-time. What would be the best way to go about doing this? My previous spring configura... | To create a flexible system where you can dynamically create and destroy message listeners for different queues at runtime, there are several approaches you could take using Spring.NET, including a mix of programmatic configuration and Spring's IoC features.
### Recommended Approach
1. **Programmatic Configuration**:... | 15,294 | [
{
"from": "human",
"value": "I was using Spring.NET to create a message listener at application startup. I now need the ability to create 0-n listeners, some of which could be listening to different queues. I will need to be able to create/destroy them at run-time. What would be the best way to go about ... |
I've got an MSI based install that I've wrapped in an EXE file as per my installation packaging software (which is Wise Package Studio 7.0 SP2).
I've made many changes to the install, and every time I've tested them, they've worked just fine... up until now.
I changed some text on a dialog box for when the installation... | When encountering issues with an MSI-based installation where it appears to be using an older version or "cached" version of the installer, there are a few steps you can take to troubleshoot and resolve the issue:
1. **Check the MSI Cache**:
Windows Installer caches a copy of every installed MSI file in a folder ca... | 29,529 | [
{
"from": "human",
"value": "I've got an MSI based install that I've wrapped in an EXE file as per my installation packaging software (which is Wise Package Studio 7.0 SP2).\nI've made many changes to the install, and every time I've tested them, they've worked just fine... up until now.\nI changed some tex... |
When you link to an unmanaged library (say 'A.dll') which in turn links to another library ('B.dll'), and B.dll is missing, you will get a run-time error message about failing to load 'B.dll'.
But when you P/Invoke into 'A.dll' from managed code, you'll get a general exception of this form:
Unhandled Exception: System.... | When you P/Invoke into an unmanaged library from managed code and you encounter a `DllNotFoundException`, it can indeed be difficult to know exactly what went wrong if the issue is that a dependent library could not be found (like in your case with `B.dll`). However, there are a few approaches you can take to better di... | 28,948 | [
{
"from": "human",
"value": "When you link to an unmanaged library (say 'A.dll') which in turn links to another library ('B.dll'), and B.dll is missing, you will get a run-time error message about failing to load 'B.dll'.\nBut when you P/Invoke into 'A.dll' from managed code, you'll get a general exception ... |
I have an XML that needs to be databound to a WPF TreeView. Here the XML can have different structure. The TreeView should be databound generic enough to load any permutation of hierarchy. However an XAttribute on the nodes (called Title) should be databound to the TreeViewItem's header text and not the nodename.
XML t... | To bind the `Title` attribute of each XML element to the `Header` of the `TreeViewItem` in your WPF application, you'll need to adjust your XAML and potentially the way you set up your data binding.
Since WPF's data binding does not support XPath directly, you'll need to create a simple class structure that represents... | 24,218 | [
{
"from": "human",
"value": "I have an XML that needs to be databound to a WPF TreeView. Here the XML can have different structure. The TreeView should be databound generic enough to load any permutation of hierarchy. However an XAttribute on the nodes (called Title) should be databound to the TreeViewItem'... |
I recently got a notification from a McAfee service (what used to be called HackerSafe) that my website is using SSLv2 and it should be using SSLv3. I don't know anything about the versions of SSL. My site is using IIS 6.0, is there a setting somewhere to turn on SSLv3 or do I need to install something to make this hap... | Using outdated protocols like SSLv2 and even SSLv3 poses significant security risks, as they contain vulnerabilities that can be exploited by attackers. Here’s a breakdown of your questions regarding SSL protocols, IIS 6.0, and recommendations for securing your site.
### Understanding SSL Versions
1. **SSLv2**: This ... | 30,026 | [
{
"from": "human",
"value": "I recently got a notification from a McAfee service (what used to be called HackerSafe) that my website is using SSLv2 and it should be using SSLv3. I don't know anything about the versions of SSL. My site is using IIS 6.0, is there a setting somewhere to turn on SSLv3 or do I n... |
I want to get user input in one page, store that in a php variable and use it in another php page. I have tried using 'sessions' but it doesn't seem to be working. Is there another safe alternative? This information is likely to be usernames and passwords.
| If you're trying to handle sensitive information such as usernames and passwords, using sessions is actually one of the safest and most common methods in PHP. However, if you're having trouble with sessions, here’s a basic rundown of how to do it properly, along with an alternative method using PHP's `$_POST` data and ... | 27,773 | [
{
"from": "human",
"value": "I want to get user input in one page, store that in a php variable and use it in another php page. I have tried using 'sessions' but it doesn't seem to be working. Is there another safe alternative? This information is likely to be usernames and passwords.\n"
},
{
"from"... |
I have created an item swapper control consisting in two listboxes and some buttons that allow me to swap items between the two lists. The swapping is done using javascript. I also move items up and down in the list. Basically when I move the items to the list box on the right I store the datakeys of the elements (GUI... | The error you are encountering is related to ASP.NET's event validation mechanism, which is designed to ensure that the state of controls on a page has not been tampered with between the time the page is rendered and the time it is posted back. The exception you're seeing indicates that the data being posted back does ... | 20,888 | [
{
"from": "human",
"value": "I have created an item swapper control consisting in two listboxes and some buttons that allow me to swap items between the two lists. The swapping is done using javascript. I also move items up and down in the list. Basically when I move the items to the list box on the right ... |
I did it using the commands as described here and it works but I want to do it using the SQL Management Studio.
SQL Server 2008 Books Online says this:
To create a full-text catalog:
In Object Explorer, expand the server,
expand Databases, and expand the
database in which you want to create
the full-text catalo... | In SQL Server Management Studio (SSMS), the way to create a full-text catalog can vary slightly depending on the version and the specific configuration of your environment. If you're using SQL Server Management Studio to create a full-text catalog and you don't see the "Storage" option, it may be due to a few reasons. ... | 28,495 | [
{
"from": "human",
"value": "I did it using the commands as described here and it works but I want to do it using the SQL Management Studio.\nSQL Server 2008 Books Online says this:\n\nTo create a full-text catalog:\n\nIn Object Explorer, expand the server,\n expand Databases, and expand the\n database in... |
I have some auto-generated code which effectively writes out the following in a bunch of different places in some code:
no warnings 'uninitialized';
local %ENV = %ENV;
local $/ = $/;
local @INC = @INC;
local %INC = %INC;
local $_ = $_;
local $| = $|;
local %SIG = %SIG;
use warnings 'uninitialized';
When auto-gen... | In Perl, when you localize a variable using `local`, it affects only the current scope where it's called, including any called subroutines. Unfortunately, you cannot directly localize variables in a higher stack frame because `local` only affects the currently executing block or subroutine. However, you can work around... | 28,035 | [
{
"from": "human",
"value": "I have some auto-generated code which effectively writes out the following in a bunch of different places in some code:\nno warnings 'uninitialized';\nlocal %ENV = %ENV;\nlocal $/ = $/;\nlocal @INC = @INC;\nlocal %INC = %INC;\nlocal $_ = $_;\nlocal $| = $|;\nlocal %SIG = %... |
I need to create a self signed SSL certificate and the install the same certificate on two different web servers. For this specific scenario I have two web servers (Win2K3 w/ II6) in a network load balanced configuration.
I have installed the IIS resource tool kit and can use the SelfSSL tool to make a certificate. Ho... | You can create a self-signed SSL certificate using the SelfSSL tool and export it for use on your other web server. Here’s a step-by-step guide on how to do this:
### Step 1: Create a Self-Signed SSL Certificate with SelfSSL
1. **Open Command Prompt as Administrator** on the server where you want to generate the cert... | 25,216 | [
{
"from": "human",
"value": "I need to create a self signed SSL certificate and the install the same certificate on two different web servers. For this specific scenario I have two web servers (Win2K3 w/ II6) in a network load balanced configuration. \nI have installed the IIS resource tool kit and can use ... |
What implementations of the Prototype Pattern exist on the Java platform?
A prototype pattern is a creational design pattern used in software development when the type of objects to create is determined by a prototypical instance, which is cloned to produce new objects.
Prototype based programming:
Prototype-based ... | The Prototype Pattern is a creational design pattern that allows you to create new objects by copying an existing object (the prototype). This can be especially useful in scenarios where the cost of creating a new instance of an object is more expensive than cloning an existing instance. Below are various implementatio... | 22,866 | [
{
"from": "human",
"value": "What implementations of the Prototype Pattern exist on the Java platform?\n\nA prototype pattern is a creational design pattern used in software development when the type of objects to create is determined by a prototypical instance, which is cloned to produce new objects. \n\nP... |
I'm working with logging in PHP with Pear, and I get into a standard problem: can I use file-based logging when the DB is not available? I don't mind if it's slow due to concurrency issues, but it cannot fail to work due to multiple, simultaneous hits.
I'm asking this question in general (for other web technologies) a... | Yes, you can certainly implement file-based logging in PHP using PEAR (PHP Extension and Application Repository) even when the database is not available. This is a common approach in web applications to ensure that logs are captured regardless of the database status. Here are some considerations and steps for doing thi... | 29,173 | [
{
"from": "human",
"value": "I'm working with logging in PHP with Pear, and I get into a standard problem: can I use file-based logging when the DB is not available? I don't mind if it's slow due to concurrency issues, but it cannot fail to work due to multiple, simultaneous hits. \nI'm asking this question... |
When implementing Quicksort, one of the things you have to do is to choose a pivot. But when I look at pseudocode like the one below, it is not clear how I should choose the pivot. First element of list? Something else?
function quicksort(array)
var list less, greater
if length(array) ≤ 1
return a... | Choosing a pivot in the Quicksort algorithm is indeed a crucial step, and there are various strategies to select it. The choice of pivot can significantly affect the performance of the algorithm, especially regarding the average and worst-case time complexities. Here are some common strategies for selecting a pivot:
1... | 28,273 | [
{
"from": "human",
"value": "When implementing Quicksort, one of the things you have to do is to choose a pivot. But when I look at pseudocode like the one below, it is not clear how I should choose the pivot. First element of list? Something else?\n function quicksort(array)\n var list less, greater\n ... |
We have a new installation of Microsoft Search Server 2008 Express Edition on one server and it's nicely indexing our intranet (on another server) which we can search from the provided search form on the search server.
I'd like to customise the search results so that they actually look like our intranet has generated t... | Microsoft Search Server 2008 Express Edition does indeed provide a way for you to perform search queries programmatically and retrieve results in a format that you can customize. However, it doesn't directly offer a simple URL-based query interface like some other search solutions do (such as Google Mini).
To achieve ... | 27,317 | [
{
"from": "human",
"value": "We have a new installation of Microsoft Search Server 2008 Express Edition on one server and it's nicely indexing our intranet (on another server) which we can search from the provided search form on the search server.\nI'd like to customise the search results so that they actua... |
What are good ways of achieving this DB agnosticism without actually coding two DAL's? I've heard that the Data Access Application Block is suitable for this.
| Achieving database (DB) agnosticism while avoiding the need to implement two separate Data Access Layers (DALs) can be a challenging task, but there are several strategies and best practices you can employ. Here are some effective ways to achieve DB agnosticism:
### 1. Use an Object-Relational Mapping (ORM) Framework
... | 28,984 | [
{
"from": "human",
"value": "What are good ways of achieving this DB agnosticism without actually coding two DAL's? I've heard that the Data Access Application Block is suitable for this.\n"
},
{
"from": "gpt",
"value": "Achieving database (DB) agnosticism while avoiding the need to implement t... |
What solutions have people come up with to develop their web applications offline when they made the decision to use OpenId for site membership?
Couple of ideas:
Create two login pages one for OpenId and one for ASP.NET Membership
Create local OpenId provider with test accounts
Any thoughts?
| Developing web applications that use OpenID for authentication can pose challenges when working offline, particularly because OpenID typically requires network access to authenticate users. However, there are several strategies that developers have employed to facilitate offline development while still maintaining the ... | 30,526 | [
{
"from": "human",
"value": "What solutions have people come up with to develop their web applications offline when they made the decision to use OpenId for site membership?\nCouple of ideas:\n\nCreate two login pages one for OpenId and one for ASP.NET Membership\nCreate local OpenId provider with test acco... |
I have a web application that makes heavy use of the Session state to store information about the current user, their personal settings, record their session history and so on.
I have found myself retrieving this session information in my business layer, like so:
((UserSession)HttpContext.Current.Session["UserSession"... | You're facing a common challenge when building applications that need to share state across different platforms. The goal is to decouple your session management from the specific implementation, allowing for flexibility in how sessions are managed (whether in a web application or a desktop application). Here's a struct... | 28,940 | [
{
"from": "human",
"value": "I have a web application that makes heavy use of the Session state to store information about the current user, their personal settings, record their session history and so on. \nI have found myself retrieving this session information in my business layer, like so:\n((UserSessio... |
How does one go about changing the version information in a built binary?
Specifically I have a .exe which is built with VS6 but doesn't seem to include up any of the company information or version information strings. I'm not really even sure how they get in there in the first place, actually. Is there a command l... | To change the version information in a built binary, specifically for a Windows executable (.exe) built with Visual Studio 6 (VS6), you'll need to understand how version resources work in Windows applications. Version information is typically embedded as a resource in the executable file.
### Step 1: Understand Versio... | 25,493 | [
{
"from": "human",
"value": "How does one go about changing the version information in a built binary? \nSpecifically I have a .exe which is built with VS6 but doesn't seem to include up any of the company information or version information strings. I'm not really even sure how they get in there in the fi... |
Let's say I have an array of lots of values (C++ syntax, sorry):
vector<double> x(100000);
This array is sorted such that x[n] > x[n-1].
I would like a function to retrieve an array of all values in the range [a, b] (that's inclusive). Some interface like:
void subarray(const double a, const double b, vector<double> &... | Certainly! Given that the array is sorted, you can use binary search to efficiently find the lower and upper bounds for the values that fall within the range [a, b]. Here's how you can implement this in C++:
```cpp
#include <vector>
#include <algorithm>
void subarray(const std::vector<double>& data, const double a, c... | 28,019 | [
{
"from": "human",
"value": "Let's say I have an array of lots of values (C++ syntax, sorry):\nvector<double> x(100000);\n\nThis array is sorted such that x[n] > x[n-1].\nI would like a function to retrieve an array of all values in the range [a, b] (that's inclusive). Some interface like:\nvoid subarray(co... |
A client of our has recently upgraded a ASP.NET 1.1 web application to ASP.NET that uses COM+ transaction processing and received the following exception while trying to process a transaction:
Exception Type:
System.Transactions.TransactionManagerCommunicationException
Message: Communication with the
underlying... | The `TransactionManagerCommunicationException` you're encountering typically suggests that there is a communication issue between the Distributed Transaction Coordinator (DTC) services on your Windows XP SP3 workstation and the Windows Server 2003 machine. Here are some steps you can take to resolve the issue:
### 1. ... | 30,010 | [
{
"from": "human",
"value": "A client of our has recently upgraded a ASP.NET 1.1 web application to ASP.NET that uses COM+ transaction processing and received the following exception while trying to process a transaction:\n\nException Type: \n System.Transactions.TransactionManagerCommunicationException\n ... |
In my views I use a helper that takes arbitrary HTML as a block:
<% some_block_helper do %>
Some arbitrary HTML and ERB variables here.
More HTML here.
<% end %>
My helper does a bunch of things to the passed block of HTML before rendering it back to the view (Markdown and other formatting). I would like to know w... | Testing a Rails helper that takes a block of HTML can indeed be a bit tricky, especially when you're looking for clean and maintainable tests. In RSpec, you can test the output of your helper in a way that avoids accessing private methods directly. Here are some approaches you can consider:
### 1. Use `render` to capt... | 19,466 | [
{
"from": "human",
"value": "In my views I use a helper that takes arbitrary HTML as a block:\n<% some_block_helper do %>\n Some arbitrary HTML and ERB variables here.\n More HTML here.\n<% end %>\n\nMy helper does a bunch of things to the passed block of HTML before rendering it back to the view (Markdow... |
I'm copying a file from folder A to folder B and then trying to copy the file permissions. Here are the basic steps I'm using:
CopyFile(source, target)
GetNamedSecurityInfo(source, GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION)
Print source SD using ConvertSecurityDescriptorToStringSecurityDescriptor
SetNamed... | The issue you're experiencing with the security descriptors (SDs) of the source and target files not matching, even after successfully calling `SetNamedSecurityInfo`, can stem from a few potential areas to investigate:
### 1. **Inheritance of Permissions:**
The target file may be inheriting permissions from its par... | 26,670 | [
{
"from": "human",
"value": "I'm copying a file from folder A to folder B and then trying to copy the file permissions. Here are the basic steps I'm using:\n\nCopyFile(source, target)\nGetNamedSecurityInfo(source, GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION)\nPrint source SD using ConvertSecurity... |
I've always been curious to see if I can show, hide or change a NotifyIcon created by another application via a C# application.
Could someone please post an example on how to do this? :)
| Interacting with the `NotifyIcon` of another application in C# is quite tricky, as it generally involves inter-process communication and Windows API calls. Below, I’ll provide a simple example demonstrating how you can show, hide, or change the tooltip text of a `NotifyIcon` from another application.
To manipulate the... | 26,450 | [
{
"from": "human",
"value": "I've always been curious to see if I can show, hide or change a NotifyIcon created by another application via a C# application.\nCould someone please post an example on how to do this? :)\n"
},
{
"from": "gpt",
"value": "Interacting with the `NotifyIcon` of another a... |
I'm trying to export a Crystal Report to a text file, while preserving any Unicode characters that are found within. By default, Crystal Reports seems to export to an ANSI text file.
Here is a highly simplified version of what I'm doing:
Dim objCRReport As CRAXDRT.Report
[...]
objCRReport.ExportOptions.FormatType = 8 '... | To export a Crystal Report to a text file while preserving Unicode characters, you typically need to specify a Unicode text file format during the export process. However, in the version of Crystal Reports you're using (Crystal Reports 9), the support for exporting to Unicode may be limited.
While there is no direct ... | 27,846 | [
{
"from": "human",
"value": "I'm trying to export a Crystal Report to a text file, while preserving any Unicode characters that are found within. By default, Crystal Reports seems to export to an ANSI text file.\nHere is a highly simplified version of what I'm doing:\nDim objCRReport As CRAXDRT.Report\n[...... |
I am looking for a way to change the password of a local user account (local Administrator) on a Windows (XP in this case) machine. I have read the CodeProject article about one way to do this, but this just doesn't seem 'clean'.
I can see that this is possible to do with WMI, so that might be the answer, but I can't ... | You're on the right track using the `DirectoryEntry` class to change the password for a local user account. The method you've provided looks good and is indeed a cleaner way to handle the password change compared to using WMI directly.
Here's a recap of your updated solution along with additional error handling for r... | 24,081 | [
{
"from": "human",
"value": "I am looking for a way to change the password of a local user account (local Administrator) on a Windows (XP in this case) machine. I have read the CodeProject article about one way to do this, but this just doesn't seem 'clean'. \nI can see that this is possible to do with WMI,... |
I am writing an application and I would like to be able to display another application inside it. (Think like a windows form with a small box, or a tab that is displaying a totally seperate application.)
Is that something that can be done? If so, can anyone give some direction on how to go about doing it?
I am lookin... | Yes, you can embed another application inside your own application, but it can be a bit tricky and may not always be straightforward due to limitations and considerations regarding the Windows operating system and the applications you're trying to host. Here are a few methods to accomplish this in C# or VB.NET:
### 1.... | 28,934 | [
{
"from": "human",
"value": "I am writing an application and I would like to be able to display another application inside it. (Think like a windows form with a small box, or a tab that is displaying a totally seperate application.)\nIs that something that can be done? If so, can anyone give some direction... |
I'm wondering how people handle a situation like this, when you have a validation event, and you need to show the user a dialog box asking him whether to continue or cancel.
The problem is that when showing that dialog box, it causes another validation event because it's considered losing focus on the control again, an... | The situation you're describing, where a validation event leads to a user dialog that triggers further validation events, is a common problem in UI programming. Your current solution using a flag is a practical approach, but here are a few alternative strategies that could help simplify or make your implementation more... | 29,903 | [
{
"from": "human",
"value": "I'm wondering how people handle a situation like this, when you have a validation event, and you need to show the user a dialog box asking him whether to continue or cancel.\nThe problem is that when showing that dialog box, it causes another validation event because it's consid... |
The calculations in my code are well-tested, but because there is so much GUI code, my overall code coverage is lower than I'd like. Are there any guidelines on unit-testing GUI code? Does it even make sense?
For example, there are graphs in my app. I haven't been able to figure out how to automate the testing of the g... | Unit testing GUI code can indeed be challenging, but it's certainly possible and can be worthwhile. Here are some guidelines and strategies for unit testing GUI code, particularly with a Java Swing application:
### Guidelines for Unit Testing GUI Code
1. **Separate Logic from Presentation**:
- Aim to separate you... | 30,050 | [
{
"from": "human",
"value": "The calculations in my code are well-tested, but because there is so much GUI code, my overall code coverage is lower than I'd like. Are there any guidelines on unit-testing GUI code? Does it even make sense?\nFor example, there are graphs in my app. I haven't been able to figur... |
I'm currently maintaining a CVS repository for source control. There is a push afoot to move to StarTeam. It has already been purchased and is a corporate standard for most projects. I was told by the corporate owners of the StarTeam servers that there is no known way to do a complete migration of our current CVS re... | Migrating from CVS to StarTeam while preserving your version history can be a complex task, but it is feasible with the right approach. Since Borland has indicated that a migration is possible (though not with the boxed software), you have a few options to consider:
### 1. **Explore Borland's Migration Services**
Sinc... | 30,154 | [
{
"from": "human",
"value": "I'm currently maintaining a CVS repository for source control. There is a push afoot to move to StarTeam. It has already been purchased and is a corporate standard for most projects. I was told by the corporate owners of the StarTeam servers that there is no known way to do a... |
I am currently using JUnit 4 and have a need to divide my tests into groups that can be run selectively in any combination. I know TestNG has a feature to annotate tests to assign them to groups, but I can't migrate to TestNG right now. It seems this could easily be accomplished in JUnit with some custom annotations an... | JUnit 4 does not provide built-in support for grouping tests like TestNG does, but you can achieve similar functionality using custom annotations and a custom Test Runner. Below, I'll guide you on how to implement a basic solution for grouping tests with custom annotations.
### Step 1: Create a Custom Annotation
Firs... | 27,909 | [
{
"from": "human",
"value": "I am currently using JUnit 4 and have a need to divide my tests into groups that can be run selectively in any combination. I know TestNG has a feature to annotate tests to assign them to groups, but I can't migrate to TestNG right now. It seems this could easily be accomplished... |
It took me 2 days (and a lot of head/wall pounding) to finally discover that the reason ad-hoc distribution wasn't working for me was because my app-name had UTF-8 characters. I'm still boggling over how such a widely international platform like the Apple iPhone can prohibit this.
i.e., if my app were a Chinese game o... | Your observations about UTF-8 characters and app names in the iOS ecosystem are quite valid. Let's break down your questions and provide some clarity:
1. **Is this an actual limitation, or a bug in the ad-hoc process?**
- This behavior is more of a limitation rather than a bug. The ad-hoc distribution process may h... | 31,929 | [
{
"from": "human",
"value": "It took me 2 days (and a lot of head/wall pounding) to finally discover that the reason ad-hoc distribution wasn't working for me was because my app-name had UTF-8 characters. I'm still boggling over how such a widely international platform like the Apple iPhone can prohibit th... |
One of the feature requests I've got for the program I'm working on is to be able to save the list of credentials users enter in, so they can be shared around. The specific use case that inspired this request was using our program on a large corporate network, made up of fairly good LANs connected by a flaky WAN. The i... | The idea of saving credentials is always a delicate matter, especially in corporate environments where security policies are stringent. Storing sensitive information such as passwords comes with risks, and you should consider these risks carefully before implementing a feature like this.
### Saving and Encrypting Secu... | 14,583 | [
{
"from": "human",
"value": "One of the feature requests I've got for the program I'm working on is to be able to save the list of credentials users enter in, so they can be shared around. The specific use case that inspired this request was using our program on a large corporate network, made up of fairly ... |
I've create a WinForms control that inherits from System.Windows.Forms.UserControl...I've got some custom events on the control that I would like the consumer of my control to be able to see. I'm unable to actually get my events to show up in the Events tab of the Properties window during design time. This means the on... | To ensure that your custom events appear in the Events tab of the Properties window in Visual Studio when using a WinForms control that inherits from `System.Windows.Forms.UserControl`, you need to make sure that your events are properly declared and marked with the appropriate attributes. Here's how you can do that:
... | 22,562 | [
{
"from": "human",
"value": "I've create a WinForms control that inherits from System.Windows.Forms.UserControl...I've got some custom events on the control that I would like the consumer of my control to be able to see. I'm unable to actually get my events to show up in the Events tab of the Properties win... |
On the client machine I need to be able to somehow detect which sites the current user are looking at right now.
I know the base URL of the sharepoint app, say sharepoint.thecompany.net but how the hack do I get the last requested url from the server?
I have hit a dead stop when trying to iterate the current processes ... | Detecting the URLs that a user is currently visiting can be a complex task, particularly due to privacy and security restrictions in modern operating systems and browsers. However, if you need to track which sites a user is currently visiting in Internet Explorer (IE), here are some approaches you can consider, while k... | 22,933 | [
{
"from": "human",
"value": "On the client machine I need to be able to somehow detect which sites the current user are looking at right now.\nI know the base URL of the sharepoint app, say sharepoint.thecompany.net but how the hack do I get the last requested url from the server?\nI have hit a dead stop wh... |
I work on a desktop sales app that is run off a tablet and was wondering if this and other "traditional" desktop tablet applications could be viable as a offline web application. The main difference with tablet applications being the inking support. I think a web app can get close with browser gestures.
| Yes, traditional desktop applications can indeed be transitioned into offline web applications, and many of the functionalities can be effectively replicated using modern web technologies. Here are some considerations and approaches for this transition, particularly for a sales application that may require inking suppo... | 26,438 | [
{
"from": "human",
"value": "I work on a desktop sales app that is run off a tablet and was wondering if this and other \"traditional\" desktop tablet applications could be viable as a offline web application. The main difference with tablet applications being the inking support. I think a web app can get ... |
I've got a UserControl that contains an UpdatePanel. When I put that on a page, it throws the following error:
Cannot unregister UpdatePanel with ID
'ReviewContentUpdatePanel' since it
was not registered with the
ScriptManager. This might occur if the
UpdatePanel was removed from the
control tree and later ... | The error message you are encountering usually indicates that the `UpdatePanel` you are trying to use has gone through a lifecycle issue where it has been removed from the control tree and later added again, or it is not properly registered with the `ScriptManager`. Here are some steps to troubleshoot and resolve this ... | 26,794 | [
{
"from": "human",
"value": "I've got a UserControl that contains an UpdatePanel. When I put that on a page, it throws the following error:\n\nCannot unregister UpdatePanel with ID\n 'ReviewContentUpdatePanel' since it\n was not registered with the\n ScriptManager. This might occur if the\n UpdatePanel... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.