instruction stringlengths 14 27.6k | completion stringlengths 3 38.3k | __original_row_idx int64 0 50k | conversations listlengths 2 2 |
|---|---|---|---|
Using instance methods as callbacks for event handlers changes the scope of this from "My instance" to "Whatever just called the callback". So my code looks like this
function MyObject() {
this.doSomething = function() {
...
}
var self = this
$('#foobar').bind('click', function(){
self.doSomethng()
... | You're correct in your observation that using instance methods as callbacks can lead to scope issues with `this`. When you use a regular function as a callback, `this` will refer to the context from which the function was called, not the instance of `MyObject`.
Your solution of storing a reference to `this` in the var... | 47,792 | [
{
"from": "human",
"value": "Using instance methods as callbacks for event handlers changes the scope of this from \"My instance\" to \"Whatever just called the callback\". So my code looks like this\nfunction MyObject() {\n this.doSomething = function() {\n ...\n }\n\n var self = this\n $('#foobar')... |
The regular code snippet of syncing data with sync framework is this:
LocalDBSyncAgent syncAgent = new LocalDBSyncAgent();
Microsoft.Synchronization.Data.SyncStatistics syncStats = syncAgent.Synchronize();
Do anynody knows a way to sync a subset of my tables.
Note not the data inside each table but the decide which ta... | In the Sync Framework, you can control which tables are included in the synchronization process by creating a custom `SyncProvider` for each table you want to sync or by using a `SyncOrchestrator` that includes only the tables you want to synchronize. Here are a couple of approaches you can use:
### Approach 1: Custom... | 48,263 | [
{
"from": "human",
"value": "The regular code snippet of syncing data with sync framework is this:\nLocalDBSyncAgent syncAgent = new LocalDBSyncAgent();\nMicrosoft.Synchronization.Data.SyncStatistics syncStats = syncAgent.Synchronize();\n\nDo anynody knows a way to sync a subset of my tables.\nNote not the ... |
can anyome help me find an elegant design for splitting, traversing and tracking objects.
The diagram below shows an object with an initial size of 100 which is spilt into two (50, 75) then one of the child objects (75) is subsequently split into three (25, 25 ,25).
My question is can anyone think of an elegant design ... | To achieve the functionality you desire — namely, being able to traverse back to the root parent of any child object in your tree structure — your current design is almost there, but you may need to tweak it slightly to ensure all properties are being properly initialized and to improve clarity and functionality.
Her... | 41,245 | [
{
"from": "human",
"value": "can anyome help me find an elegant design for splitting, traversing and tracking objects.\nThe diagram below shows an object with an initial size of 100 which is spilt into two (50, 75) then one of the child objects (75) is subsequently split into three (25, 25 ,25).\nMy questio... |
I am creating a custom WPF control that let's say for simplicity sake has a vertical stack panel with a "title" TextBlock, followed by a ContentPresenter. I want the font size for the "title" to be 5 Points LARGER than the size used in the content, which is inherited by whatever container the user places this control i... | In WPF, if you want to set a `TextBlock`'s font size relative to the inherited font size (for example, adding 5 points to it), you can achieve this using a `DynamicResource` for the font size along with a `Binding` to the inherited font size.
You can bind the `FontSize` of the `TextBlock` for the title to the `FontSiz... | 44,192 | [
{
"from": "human",
"value": "I am creating a custom WPF control that let's say for simplicity sake has a vertical stack panel with a \"title\" TextBlock, followed by a ContentPresenter. I want the font size for the \"title\" to be 5 Points LARGER than the size used in the content, which is inherited by what... |
What is the best way to construct a bit mask in C with m set bits preceded by k unset bits, and followed by n unset bits:
00..0 11..1 00..0
k m n
For example, k=1, m=4, n=3 would result in the bit mask:
01111000
| To construct a bit mask in C with `m` set bits preceded by `k` unset bits and followed by `n` unset bits, you can use a combination of bitwise operations and shifting.
Here's how you can create such a bit mask:
1. First, create a mask with `m` set bits (1s).
2. Shift this mask left by `k` positions to account for the... | 43,939 | [
{
"from": "human",
"value": "What is the best way to construct a bit mask in C with m set bits preceded by k unset bits, and followed by n unset bits:\n00..0 11..1 00..0\n k m n\n\nFor example, k=1, m=4, n=3 would result in the bit mask:\n01111000\n\n"
},
{
"from": "gpt",
"value": "To c... |
For quite a while, I thought that Free Software was Open Source Software. I've found out that this view is incorrect, and that Open Source Software is not necessarily Free Software. I honestly can't see any differences.
What am I missing here? What are the distinguishing traits of both parties?
| The concepts of Free Software and Open Source Software are closely related, but they stem from different philosophies and emphases. Here are the distinguishing traits of both movements:
### Free Software
1. **Philosophical Foundation**: The Free Software movement is primarily rooted in ethical considerations. It advo... | 42,246 | [
{
"from": "human",
"value": "For quite a while, I thought that Free Software was Open Source Software. I've found out that this view is incorrect, and that Open Source Software is not necessarily Free Software. I honestly can't see any differences.\nWhat am I missing here? What are the distinguishing tra... |
I have a TextBlock that I need to autosize to the width of a TreeView. The TreeView and the TextBlock are both contained in a StackPanel. The StackPanel is inside an Expander. The width of the TreeView should drive the width of the other objects and I need the height of the TextBlock to change to display the full te... | To make the `TextBlock` autosize its width to match the `TreeView`, you can modify the binding of the `Width` property of the `StackPanel` to be the same as the `TreeView`. You may also want to set the `TextBlock` width to `Auto` or omit the `Width` property so that it can properly adjust based on the StackPanel's widt... | 47,883 | [
{
"from": "human",
"value": "I have a TextBlock that I need to autosize to the width of a TreeView. The TreeView and the TextBlock are both contained in a StackPanel. The StackPanel is inside an Expander. The width of the TreeView should drive the width of the other objects and I need the height of the T... |
I would like to capture high resolution image with Windows Mobile device. I've tried the example from WM SDK, but it captures just a single frame of video camera and the resolution is poor.
Has anyone any experience with image capturing on Pocket PC with C++?
Thanks
| Capturing high-resolution images on a Windows Mobile device can be tricky, especially when dealing with the limitations of the hardware and SDK. Here's a general approach you can take to improve your image capturing experience in C++:
1. **Check Camera Capabilities**: Before capturing images, ensure that your device s... | 43,844 | [
{
"from": "human",
"value": "I would like to capture high resolution image with Windows Mobile device. I've tried the example from WM SDK, but it captures just a single frame of video camera and the resolution is poor.\nHas anyone any experience with image capturing on Pocket PC with C++?\nThanks\n"
},
... |
I'm trying to use wxFTP on wxLua to upload several files. It works with the 1st file, but I do not understand why I cannot send a 2nd file. Here is a sample that fails :
local ftp = wx.wxFTP()
local ftpAddress = wx.wxIPV4address()
ftpAddress:Service( "ftp" )
ftpAddress:Hostname( "ftp.example.com" )
ftp:Connect( ftpAddr... | The issue you're encountering is likely due to the FTP connection not being in the right state to upload the second file after uploading the first one. The `GetOutputStream` method is used to obtain an output stream for uploading files, but if the state of the FTP connection changes (like after a file upload), you migh... | 48,722 | [
{
"from": "human",
"value": "I'm trying to use wxFTP on wxLua to upload several files. It works with the 1st file, but I do not understand why I cannot send a 2nd file. Here is a sample that fails :\nlocal ftp = wx.wxFTP()\nlocal ftpAddress = wx.wxIPV4address()\nftpAddress:Service( \"ftp\" )\nftpAddress:Hos... |
Is it possible to create an inline delegate in vb.net like you can in c#?
For example, I would like to be able to do something inline like this:
myObjects.RemoveAll(delegate (MyObject m) { return m.X >= 10; });
only in VB and without having to do something like this
myObjects.RemoveAll(AddressOf GreaterOrEqaulToTen)
... | In VB.NET 2.0, you don't have access to lambda expressions, which would allow for inline delegate creation similar to what you can do in C#. However, you can create an inline delegate using the `AddressOf` operator combined with an anonymous method. Unfortunately, since VB.NET 2.0 doesn't support anonymous methods eith... | 46,049 | [
{
"from": "human",
"value": "Is it possible to create an inline delegate in vb.net like you can in c#?\nFor example, I would like to be able to do something inline like this:\nmyObjects.RemoveAll(delegate (MyObject m) { return m.X >= 10; });\n\nonly in VB and without having to do something like this\nmyObje... |
Being relatively new to functional programming, I expend lots of energy wondering “is this the functional way to do things?” Obviously recursion vs. iteration is pretty straightforward and it’s obvious that recursion is the functional way of doing things. But take closures for instance.
I’ve learned about closures usi... | Your questions touch on some fundamental concepts in functional programming, especially regarding the nature of state, side effects, and closures. Let’s break down your concerns.
### Understanding Closures
A closure is indeed a combination of a function and its environment (the variables that are in scope at the time... | 48,495 | [
{
"from": "human",
"value": "Being relatively new to functional programming, I expend lots of energy wondering “is this the functional way to do things?” Obviously recursion vs. iteration is pretty straightforward and it’s obvious that recursion is the functional way of doing things. But take closures for i... |
I need a way to stash some data that is global to the browser. If I open a new window with a URL from my app, e.g. via a bookmark, I need to access some data that was created in another window and never sent to the server.
As far as I can tell the only thing that is global to the browser and not just a window, (like w... | You're correct that cookies are sent with every request to the server, and that makes them unsuitable for your use case if you want to store data that should never be sent to the server.
There are a few alternative methods to achieve browser-global storage that won’t send data to the server. Here are some options:
##... | 44,886 | [
{
"from": "human",
"value": "I need a way to stash some data that is global to the browser. If I open a new window with a URL from my app, e.g. via a bookmark, I need to access some data that was created in another window and never sent to the server. \nAs far as I can tell the only thing that is global to ... |
For a certain Hibernate entity we have a requirement to store its creation time and the last time it was updated. How would you design this?
What data types would you use in the database (assuming MySQL, possibly in a different timezone that the JVM)? Will the data types be timezone-aware?
What data types would you ... | To design a Hibernate entity that can efficiently handle the creation and last updated timestamps while considering the requirements for timezones and data integrity, we can follow these guidelines:
### Database Design
1. **Data Types**:
- In MySQL, use the `DATETIME` or `TIMESTAMP` data type:
- **TIMESTAMP**... | 44,346 | [
{
"from": "human",
"value": "For a certain Hibernate entity we have a requirement to store its creation time and the last time it was updated. How would you design this?\n\nWhat data types would you use in the database (assuming MySQL, possibly in a different timezone that the JVM)? Will the data types be... |
I thought it is a very simple task to export data in a view from SQL Server 2005 to a fixed width text file. But the wizard is a pain. The format is not correct. Does anybody know how to deal with it? or any better way to do that?
| Exporting data from SQL Server 2005 to a fixed-width text file can indeed be a bit challenging if you're relying on the built-in wizard, as it doesn't always provide the precise control over formatting that you might need. However, there are several alternative methods you can use to achieve this.
### Method 1: Using ... | 41,796 | [
{
"from": "human",
"value": "I thought it is a very simple task to export data in a view from SQL Server 2005 to a fixed width text file. But the wizard is a pain. The format is not correct. Does anybody know how to deal with it? or any better way to do that?\n"
},
{
"from": "gpt",
"value": "Exp... |
I have a web app that is heavily loaded in javascript and css. First time users log in it takes some time to load once it is downloading js etc. Then the caching will make everything faster.
I want my users to be aware of this loading time. How can I add some code to "show" some loading information while js and css are... | To inform users about the loading time of your web app, you can implement a simple loading indicator that displays while your JavaScript and CSS files are being downloaded. There are various approaches to achieve this, but one common method is to use a combination of HTML, CSS, and JavaScript. Here’s a step-by-step gui... | 44,163 | [
{
"from": "human",
"value": "I have a web app that is heavily loaded in javascript and css. First time users log in it takes some time to load once it is downloading js etc. Then the caching will make everything faster.\nI want my users to be aware of this loading time. How can I add some code to \"show\" s... |
I'm hoping someone can clarify this behavior for me, and explain how ASP.NET is deciding when to treat something like a new Session.
A) In Internet Explorer I load the ASP.NET site in question. It starts a new Session.
B) If I go to menu File - New Window... it stays within the same Session.
C) If I launch a new instan... | The behavior you're observing in your ASP.NET application is related to how ASP.NET manages sessions, primarily through the use of cookies. Here’s a detailed explanation of what's happening in each of your scenarios:
### A) Loading the ASP.NET Site
When you first load the ASP.NET site in Internet Explorer, a new sessi... | 48,633 | [
{
"from": "human",
"value": "I'm hoping someone can clarify this behavior for me, and explain how ASP.NET is deciding when to treat something like a new Session.\nA) In Internet Explorer I load the ASP.NET site in question. It starts a new Session.\nB) If I go to menu File - New Window... it stays within th... |
I'm writing a unit test for a method that packs boolean values into a byte. The various bit locations are determined by the value of an enum, which only has 5 values right now, but it's conceivable (though extremely unlikely) that this number could go to 9.
I'd like a simple test along the lines of:
private byte m_myN... | You're correct that Java does not have a `sizeof` operator like C or C++. However, you can still achieve your goal by using the following approach in a unit test.
You can directly check the number of bits in a byte and compare it to the number of values in your enum. In Java, a byte has 8 bits. You can create a unit t... | 47,825 | [
{
"from": "human",
"value": "I'm writing a unit test for a method that packs boolean values into a byte. The various bit locations are determined by the value of an enum, which only has 5 values right now, but it's conceivable (though extremely unlikely) that this number could go to 9.\nI'd like a simple t... |
I'm trying to make an AJAXy submission and have the resulting partial be inserted into my list at the proper place. I can think of a few options, but none is terribly good:
Option 1: Return JSON, do rendering in Javascript. That seems like the wrong place to render this, especially since the list itself is rendered i... | You have outlined some common options for handling AJAX submissions and rendering responses, each with its own pros and cons. Let's break them down and consider a fourth option that might better suit your needs.
### Option 1: Return JSON and Render in JavaScript
- **Pros**:
- Clear separation of concerns: the server... | 40,108 | [
{
"from": "human",
"value": "I'm trying to make an AJAXy submission and have the resulting partial be inserted into my list at the proper place. I can think of a few options, but none is terribly good:\nOption 1: Return JSON, do rendering in Javascript. That seems like the wrong place to render this, espe... |
I have some code which I did not originally create that uses _beginthreadex and _endthreadex. For some reason, when it calls _endthreadex(0), the call just hangs and never returns. Any ideas as to what would normally cause this call to hang?
| When encountering a situation where `_endthreadex(0)` is hanging, there are several potential causes to investigate. Here are some common issues that could lead to this behavior:
1. **Thread State**: If the thread is still running or if there are resources being held by the thread that have not been properly released,... | 48,505 | [
{
"from": "human",
"value": "I have some code which I did not originally create that uses _beginthreadex and _endthreadex. For some reason, when it calls _endthreadex(0), the call just hangs and never returns. Any ideas as to what would normally cause this call to hang?\n"
},
{
"from": "gpt",
... |
I have a class Person which can have several Homes, each one with one or many Phone numbers.
I have defined the classes, but now i am trying to create a view wich list every person, with all its homes and all the phone numbers for each home address... something like:
john smith
123 fake str
305-99-8877
305-99-8876
... | To achieve the desired output of listing each person along with their homes and associated phone numbers in Django, you can utilize the related objects and template tags effectively.
Assuming that you have the following model structure:
```python
from django.db import models
class Person(models.Model):
name = m... | 48,913 | [
{
"from": "human",
"value": "I have a class Person which can have several Homes, each one with one or many Phone numbers.\nI have defined the classes, but now i am trying to create a view wich list every person, with all its homes and all the phone numbers for each home address... something like:\njohn smit... |
I have a simple iPhone app that has a tab bar and 3 tabs. Each tab loads as a separate nib with a corresponding controller. Each nib contains a tableview with some other controls for searching/filtering etc.
What I would like (and cant seem to find an example of) is adding a navigation controller to the app so each nib... | To implement a navigation controller in your iPhone app with a tab bar and separate nibs for each tab, you should generally follow these steps:
1. **Add a Navigation Controller to Each Tab:** Each tab in your tab bar can have its own navigation controller. This allows you to push and pop view controllers (detail pages... | 46,230 | [
{
"from": "human",
"value": "I have a simple iPhone app that has a tab bar and 3 tabs. Each tab loads as a separate nib with a corresponding controller. Each nib contains a tableview with some other controls for searching/filtering etc.\nWhat I would like (and cant seem to find an example of) is adding a na... |
I'm using the jQuery.Validation plugin for client side validation, and among other things I validate email addresses. Now I also want to validate on the server side (for users without javascript etc). For lack of better ideas I started on a regex, but quite soon I realized that I want to important to use the same requi... | The jQuery Validation plugin does not have a strict, predefined regex for email validation built-in; instead, it utilizes a more general approach that checks whether the provided input conforms to an email format. The built-in email validation rule uses a basic regex pattern which is designed to cover common cases of v... | 44,557 | [
{
"from": "human",
"value": "I'm using the jQuery.Validation plugin for client side validation, and among other things I validate email addresses. Now I also want to validate on the server side (for users without javascript etc). For lack of better ideas I started on a regex, but quite soon I realized that ... |
Please consider the following fork()/SIGCHLD pseudo-code.
// main program excerpt
for (;;) {
if ( is_time_to_make_babies ) {
pid = fork();
if (pid == -1) {
/* fail */
} else if (pid == 0) {
/* child stuff */
print "child started"
exit
... | The race condition you identified is indeed a common issue when using `fork()` and signal handlers for child processes. The problem arises because the child process can terminate before the parent process has a chance to add its PID to the list of active children, potentially leading to the parent waiting indefinitely ... | 46,562 | [
{
"from": "human",
"value": "Please consider the following fork()/SIGCHLD pseudo-code.\n // main program excerpt\n for (;;) {\n if ( is_time_to_make_babies ) {\n\n pid = fork();\n if (pid == -1) {\n /* fail */\n } else if (pid == 0) {\n /* child stuff */\n ... |
I would like to be able to see how a web page looks on different browsers before releasing it. I have several on my machine, but I cannot check different versions of IE, and other browsers, and I cannot check other OSs. I know of http://browsershots.org/ but this takes ~30 minutes at times, thus it can be problematic f... | If you want to test your web page across different browsers and operating systems more efficiently than using BrowserShots, there are several other options and tools you can consider:
1. **CrossBrowserTesting**: This is a comprehensive platform that allows you to test your site on various browsers, operating systems, ... | 48,862 | [
{
"from": "human",
"value": "I would like to be able to see how a web page looks on different browsers before releasing it. I have several on my machine, but I cannot check different versions of IE, and other browsers, and I cannot check other OSs. I know of http://browsershots.org/ but this takes ~30 minut... |
I'm trying to send an email in html format using JavaMail but it always seems to only display as a text email in Outlook.
Here is my code:
try
{
Properties props = System.getProperties();
props.put("mail.smtp.host", mailserver);
props.put("mail.smtp.from", fromEmail);
props.put("mail.smtp.auth", authe... | The issue you're facing is likely due to how you're structuring your email's content. In your code, you're creating a multipart email with both plain text and HTML parts, but you may not be specifying the correct content type for the `MimeMessage`.
To ensure that the HTML content is displayed correctly in email clien... | 46,152 | [
{
"from": "human",
"value": "I'm trying to send an email in html format using JavaMail but it always seems to only display as a text email in Outlook. \nHere is my code:\ntry \n{\n Properties props = System.getProperties();\n props.put(\"mail.smtp.host\", mailserver);\n props.put(\"mail.smtp.from\"... |
I am using staruml, I find it is hard to draw a perfect UML class diagram when the relation is complex.uml diagram
| Creating complex UML class diagrams can indeed be challenging, especially when dealing with intricate relationships between classes. Here are some tips and best practices for using StarUML to create clearer and more effective UML class diagrams:
1. **Use a Consistent Layout**:
- Try to maintain a consistent layout ... | 46,432 | [
{
"from": "human",
"value": "I am using staruml, I find it is hard to draw a perfect UML class diagram when the relation is complex.uml diagram\n"
},
{
"from": "gpt",
"value": "Creating complex UML class diagrams can indeed be challenging, especially when dealing with intricate relationships bet... |
Is there a way using the iPhone SDK to get WiFi information? Things like Signal Strength, WiFi Channel and SSID are the main things I'm looking for.
Only interested in Wifi info, not cellular.
| As of my last knowledge update in October 2023, obtaining detailed WiFi information such as signal strength, WiFi channel, and SSID directly using the iPhone SDK (iOS) is somewhat limited due to privacy and security restrictions imposed by Apple.
However, you can access some basic WiFi information using the `Network` ... | 46,343 | [
{
"from": "human",
"value": "Is there a way using the iPhone SDK to get WiFi information? Things like Signal Strength, WiFi Channel and SSID are the main things I'm looking for.\nOnly interested in Wifi info, not cellular.\n"
},
{
"from": "gpt",
"value": "As of my last knowledge update in Octobe... |
I'm looking for a PHP (with MYSQL) nested sets class with all needed functions.
For example:
createLeftNode, createRightNode,createRootNode, createSubNode,deleteNode and moveTree. Not only 1 left, 1 right, 1 up and 1 down but also a part of a tree in a nother tree.
Thanks!
| Creating a PHP class to manage a nested set model in a MySQL database requires a solid understanding of both the nested set model and how to handle MySQL operations in PHP. Below is a basic implementation of a nested set class that includes the functions you requested: `createLeftNode`, `createRightNode`, `createRootNo... | 38,668 | [
{
"from": "human",
"value": "I'm looking for a PHP (with MYSQL) nested sets class with all needed functions.\nFor example:\ncreateLeftNode, createRightNode,createRootNode, createSubNode,deleteNode and moveTree. Not only 1 left, 1 right, 1 up and 1 down but also a part of a tree in a nother tree.\nThanks!\n... |
Is there any way to set the src attribute of an iframe without the iframe generating an http request? If not, is there a way to format the request headers before the request is sent?
edit: I just need the src to match the path of a cookie, but I don't ever want that cookie sent to the server. See my comments on this qu... | Setting the `src` attribute of an `<iframe>` will always result in an HTTP request to the specified URL. There isn't a way to set the `src` without generating this request. When the iframe source is set, the browser will load the content from the specified URL, and this process includes sending cookies associated with ... | 44,897 | [
{
"from": "human",
"value": "Is there any way to set the src attribute of an iframe without the iframe generating an http request? If not, is there a way to format the request headers before the request is sent?\nedit: I just need the src to match the path of a cookie, but I don't ever want that cookie sent... |
Can I load an stand alone aspx page in another stand alone aspx page using System.Reflection?
I am using the ASP.NET 2.0 Web site project model.
| In ASP.NET Web Forms, a standalone `.aspx` page is typically a full-fledged web page that is designed to be accessed directly by a user via a URL. However, if you want to load one `.aspx` page within another `.aspx` page, it can be done using various approaches.
Using `System.Reflection` is not a typical approach for... | 47,386 | [
{
"from": "human",
"value": "Can I load an stand alone aspx page in another stand alone aspx page using System.Reflection? \nI am using the ASP.NET 2.0 Web site project model.\n"
},
{
"from": "gpt",
"value": "In ASP.NET Web Forms, a standalone `.aspx` page is typically a full-fledged web page t... |
I am using master page on some pages. And that master page is loading the user control. So I want to disable or enable user control on some page load which has master page.
Is there anyway can I disable User control on master page Page_load()
<div class="ucTabCtrl" >
<uc1:TLTabControl ID="ctrlname" runat="serve... | In ASP.NET Web Forms, when you are working with User Controls within a Master Page, the User Control should be properly instantiated and available during the `Page_Load` event of the Master Page. If you're finding that `ctrlname` is always null, it may be due to how you're trying to access it.
Here are some steps to e... | 44,628 | [
{
"from": "human",
"value": "I am using master page on some pages. And that master page is loading the user control. So I want to disable or enable user control on some page load which has master page. \n\nIs there anyway can I disable User control on master page Page_load()\n\n<div class=\"ucTabCtrl\" >\n... |
What is the easiest way to check if a computer is alive and responding (say in ping/NetBios)?
I'd like a deterministic method that I can time-limit.
One solution is simple access the share (File.GetDirectories(@"\compname")) in a separate thread, and kill the thread if it takes too long.
| To check if a computer is alive and responding within a time limit, a more efficient approach would be to use the **ping** command, which is generally available on all operating systems and allows you to check if a host is reachable. Here's a deterministic method that you can implement using C# for example, which uses ... | 44,421 | [
{
"from": "human",
"value": "What is the easiest way to check if a computer is alive and responding (say in ping/NetBios)?\nI'd like a deterministic method that I can time-limit.\nOne solution is simple access the share (File.GetDirectories(@\"\\compname\")) in a separate thread, and kill the thread if it t... |
I would like to have an aspx page that contains something like....
<form id="form1" runas=server >
Hello <%= Me.UserName() %>
</form>
and a code-behind something like...
Public Class Somepage
inherits SomeOtherPage
Private Readonly Property UserName() as String
Get
return "Rory"
End Get
... | To achieve the desired functionality in an ASP.NET Web Forms application, you need to ensure that the property you're trying to access is properly defined and correctly referenced in the ASPX page.
### Here’s how to correctly set up your ASPX page and code-behind:
### Step 1: ASPX Page
Your ASPX page should look som... | 46,329 | [
{
"from": "human",
"value": "I would like to have an aspx page that contains something like....\n<form id=\"form1\" runas=server >\n Hello <%= Me.UserName() %>\n</form>\n\nand a code-behind something like...\nPublic Class Somepage\n inherits SomeOtherPage\n Private Readonly Property UserName() as ... |
Is is possible to query the current browser from within an applet?
I would like to know if the current browser is IE6 or IE7.
| In Java applets, you generally cannot directly query the browser type or version due to security and sandboxing restrictions. However, you can use some indirect methods to achieve this.
1. **User-Agent Header**: You could use a JavaScript snippet to read the `navigator.userAgent` property and then pass that informatio... | 47,198 | [
{
"from": "human",
"value": "Is is possible to query the current browser from within an applet? \nI would like to know if the current browser is IE6 or IE7.\n"
},
{
"from": "gpt",
"value": "In Java applets, you generally cannot directly query the browser type or version due to security and sandb... |
This is a C# question, but really could be language-agnostic
I have inherited a large object model (100+ types), with a hierarchy of objects that 'own' 0..n of other typed objects that all share a base (where there is a 'relatively' strict type hierarachy).
I want to start decoupling these objects though inheritance to... | Decoupling a large object model in order to implement Inversion of Control (IoC) and facilitate unit testing is a significant task, and choosing the right starting point can indeed impact your progress and the ease of transition. Here are some considerations to help you decide where to start:
### 1. Start with the Bas... | 45,180 | [
{
"from": "human",
"value": "This is a C# question, but really could be language-agnostic\nI have inherited a large object model (100+ types), with a hierarchy of objects that 'own' 0..n of other typed objects that all share a base (where there is a 'relatively' strict type hierarachy).\nI want to start dec... |
Let's say I have a split view, and I want to fill half of it with a table view (a fairly common use case, I would think). Is there any way to tell the table view to size itself to fit the split view or do I really have to size it manually?
| In a typical UI framework that supports split views (like UIKit in iOS or SwiftUI), you can usually configure your table view (or any view) to automatically adjust its size to fit within the split view without needing to manually size it.
### In UIKit (iOS):
If you're using a `UISplitViewController`, the child view c... | 45,352 | [
{
"from": "human",
"value": "Let's say I have a split view, and I want to fill half of it with a table view (a fairly common use case, I would think). Is there any way to tell the table view to size itself to fit the split view or do I really have to size it manually?\n"
},
{
"from": "gpt",
"val... |
I have an html like this:
<div id="container1">
<div class="dragme">drag me</div>
</div>
<div id="container2">
<div class="dragme">drag me</div>
</div>
<div id="droponme"></div>
$(".dragme").draggable();
$("#droponme").droppable({
accept: ".dragme",
drop: function(e, u) { alert( /* find id of the conta... | To determine which container the draggable element belongs to when it is dropped, you can use the `draggable` event information provided in the drop handler. The event's `ui.draggable` property gives you a reference to the element being dragged, so you can find its closest container.
Here's how you can modify your `dr... | 49,573 | [
{
"from": "human",
"value": "I have an html like this:\n<div id=\"container1\">\n <div class=\"dragme\">drag me</div>\n</div>\n<div id=\"container2\">\n <div class=\"dragme\">drag me</div>\n</div>\n<div id=\"droponme\"></div>\n\n$(\".dragme\").draggable();\n$(\"#droponme\").droppable({\n accept: \"... |
The one that ships with IDEA is nothing more than a GWT project creation tool. Is there a better plugin? Is there a standalone GUI editor for GWT?
| As of my last knowledge update in October 2023, the standard GWT (Google Web Toolkit) project creation tool that comes with IntelliJ IDEA is often viewed as limited. However, there are a few alternatives and suggestions that you might find helpful:
1. **GWT Plugin for IntelliJ IDEA**: While the built-in support is min... | 46,453 | [
{
"from": "human",
"value": "The one that ships with IDEA is nothing more than a GWT project creation tool. Is there a better plugin? Is there a standalone GUI editor for GWT?\n"
},
{
"from": "gpt",
"value": "As of my last knowledge update in October 2023, the standard GWT (Google Web Toolkit)... |
Just flicking through one of my favourite books (Ellen Ullman's The Bug) and there is a small bit where one programmer confronts another over three levels of indirection:
***object_array = ***winarray;
I get the idea of double indirection - a way of passing a pointer into a function, and allowing it to point to an obj... | Yes, three levels of indirection (or more) can be used in programming, although they are relatively rare compared to single or double indirection. Here are a few scenarios where you might encounter or need to use three levels of indirection:
1. **Dynamic Data Structures**: In complex dynamic data structures such as li... | 49,114 | [
{
"from": "human",
"value": "Just flicking through one of my favourite books (Ellen Ullman's The Bug) and there is a small bit where one programmer confronts another over three levels of indirection:\n***object_array = ***winarray;\n\nI get the idea of double indirection - a way of passing a pointer into a ... |
We have an application that has one or more text console windows that all essentially represent serial ports (text input and output, character by character). These windows have turned into a major performance problem in the way they are currently code... we manage to spend a very significant chunk of time in them.
Th... | It sounds like you're facing a common performance challenge in GUI applications, particularly when using message passing and redrawing techniques that can become inefficient. Here are several strategies you can consider to improve performance for your text console windows:
### 1. Reduce Message Passing Overhead
Instea... | 47,094 | [
{
"from": "human",
"value": "We have an application that has one or more text console windows that all essentially represent serial ports (text input and output, character by character). These windows have turned into a major performance problem in the way they are currently code... we manage to spend a v... |
For a web application, I would like to create a simple but effective licensing system. In C#, this is a little difficult, since my decryption method could be viewed by anyone with Reflector installed.
What are some methods for encrypting files in C# that are fairly tamper-proof?
| Creating a tamper-proof licensing system requires careful consideration of how you handle encryption and verification. Here are some approaches you can take in C# to achieve a secure licensing mechanism:
### 1. **Strong Encryption Algorithms**
Use strong encryption algorithms like AES (Advanced Encryption Standard) fo... | 44,066 | [
{
"from": "human",
"value": "For a web application, I would like to create a simple but effective licensing system. In C#, this is a little difficult, since my decryption method could be viewed by anyone with Reflector installed.\nWhat are some methods for encrypting files in C# that are fairly tamper-proof... |
Possible Duplicate:
How can a C++ windows dll be merged into a C# application exe?
Is anybody aware of a program that can pack several DLL and a .EXE into one executable. I am not talking about .NET case here, I am talking about general DLLs, some of which I generate in C++, some of others are external DLL I have no... | Packing multiple DLLs and an EXE into a single executable while maintaining the ability to load the DLLs correctly is indeed challenging due to how the operating system handles DLL loading. Typically, when an executable is run, the OS expects the required DLLs to be present in specific locations, such as the applicatio... | 42,581 | [
{
"from": "human",
"value": "\nPossible Duplicate:\nHow can a C++ windows dll be merged into a C# application exe? \n\nIs anybody aware of a program that can pack several DLL and a .EXE into one executable. I am not talking about .NET case here, I am talking about general DLLs, some of which I generate in C... |
When I use wsdl.exe to create a client from my wsdl, it finishes O.K., but inserts the following comment in the file:
// CODEGEN: Parameter 'VerificationData' requires additional schema information that cannot be captured using the parameter mode. The specific attribute is 'System.Xml.Serialization.XmlArrayItemAttribut... | The comment you are seeing from the `wsdl.exe` tool indicates that it requires more information to properly serialize the `VerificationData` parameter, specifically related to handling collections and their item types.
In your WSDL snippet, you're using an `xsd:sequence` that contains an unbounded list of `Verificatio... | 45,803 | [
{
"from": "human",
"value": "When I use wsdl.exe to create a client from my wsdl, it finishes O.K., but inserts the following comment in the file:\n// CODEGEN: Parameter 'VerificationData' requires additional schema information that cannot be captured using the parameter mode. The specific attribute is 'Sys... |
Bonus points for explaining how you improved it.
| Sure! To provide an effective response, I'd first need context regarding what specific content or project you're referring to that requires improvement. However, I can outline a general process for improving written content or a project, and then I can demonstrate how I might apply that process to an example.
### Gene... | 44,906 | [
{
"from": "human",
"value": "Bonus points for explaining how you improved it.\n"
},
{
"from": "gpt",
"value": "Sure! To provide an effective response, I'd first need context regarding what specific content or project you're referring to that requires improvement. However, I can outline a general... |
I have a function that presents the user a combo-box.
def select_interface(interfaces)
list_box :items => interfaces do |list|
interface = list.text
end
### ideally should wait until interface has a value then: ###
return interface
end
The rest of the program depends on the selection from this combo-box.
I... | In Shoes, to achieve a functionality where you need to wait for user input from a combo box before proceeding with the rest of the code, you can use a blocking approach by using a `@result` instance variable and a loop that waits until the input is set.
Here's an example implementation of how you can structure your `s... | 47,830 | [
{
"from": "human",
"value": "I have a function that presents the user a combo-box.\ndef select_interface(interfaces)\n list_box :items => interfaces do |list|\n interface = list.text\n end\n ### ideally should wait until interface has a value then: ###\n return interface\nend\n\nThe rest of the progr... |
There's this Excel file I want users to be able to download from my server. There must be an easy way to initiate the download of the file after a click on the "Download" button... but I have no clue how to make that happen.
I have this so far: (VBscript and ASP)
<head>
<script type="text/javascript" src="overzicht.js... | To enable users to download an Excel file from your server when they click a button, you can use a combination of ASP and JavaScript. Here's a complete example of how to set this up:
### Step 1: Modify Your ASP Script
You need to create a separate ASP script that will handle the file download. Let's call this script ... | 45,155 | [
{
"from": "human",
"value": "There's this Excel file I want users to be able to download from my server. There must be an easy way to initiate the download of the file after a click on the \"Download\" button... but I have no clue how to make that happen.\nI have this so far: (VBscript and ASP)\n<head>\n<s... |
How can I do remote debugging of a multi threaded Python application, running on an Embedded Linux based system, from Windows XP or Vista?
So far I have only come across PyScripter based remote debugging. How does it perform?
| Remote debugging a multi-threaded Python application running on an embedded Linux system can be challenging, but it is definitely feasible. Here are the steps and tools you can consider, including insights into PyScripter and other options.
### Using PyScripter for Remote Debugging
1. **Setup PyScripter**: PyScripter... | 43,774 | [
{
"from": "human",
"value": "How can I do remote debugging of a multi threaded Python application, running on an Embedded Linux based system, from Windows XP or Vista?\nSo far I have only come across PyScripter based remote debugging. How does it perform?\n"
},
{
"from": "gpt",
"value": "Remote ... |
As the title says, whats the difference between
MyFunction = function() {
}
and
function MyFunction() {
}
Nothing?
Duplicate: var functionName = function() {} vs function functionName() {}
| There are some important differences between the two ways of defining functions in JavaScript that you've mentioned. Here's a breakdown of each:
### 1. Function Declaration
```javascript
function MyFunction() {
// Function body
}
```
- **Hoisting**: Function declarations are hoisted to the top of their containing ... | 49,273 | [
{
"from": "human",
"value": "As the title says, whats the difference between\nMyFunction = function() {\n\n}\n\nand\nfunction MyFunction() {\n\n}\n\nNothing?\nDuplicate: var functionName = function() {} vs function functionName() {}\n"
},
{
"from": "gpt",
"value": "There are some important diffe... |
I'm trying to write a program to calculate the quadratic formula. When I run it, I get 2 error messages:
error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup
fatal error LNK1120: 1 unresolved externals
this is after I changed the last line of code from
...:
<< danswer1, dans... | It seems that you're encountering a couple of different issues while trying to compile your program that implements the quadratic formula. Let's address each one step by step.
### 1. Error LNK2019: Unresolved External Symbol `_WinMain@16`
This error usually occurs when the linker is unable to find the `WinMain` functi... | 44,089 | [
{
"from": "human",
"value": "I'm trying to write a program to calculate the quadratic formula. When I run it, I get 2 error messages:\nerror LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup\nfatal error LNK1120: 1 unresolved externals\nthis is after I changed the la... |
What is the most efficient way to remove duplicate items from an array under the constraint that axillary memory usage must be to a minimum, preferably small enough to not even require any heap allocations? Sorting seems like the obvious choice, but this is clearly not asymptotically efficient. Is there a better algo... | Removing duplicate items from an array with minimal auxiliary memory usage can indeed be a challenge, but there are a few strategies you can employ that balance efficiency with the constraint of low memory usage. Below are some methods, along with their trade-offs:
### 1. In-place Sorting and Removal of Duplicates
On... | 48,208 | [
{
"from": "human",
"value": "What is the most efficient way to remove duplicate items from an array under the constraint that axillary memory usage must be to a minimum, preferably small enough to not even require any heap allocations? Sorting seems like the obvious choice, but this is clearly not asymptot... |
Do you write createSomething() or addSomething()?
Do you write readSomething(), getSomething() or fetchSomething()?
This is totally a petty gripe. In the meeting room we refer to it as CRUD, but in actual code, it's becoming AGUD.
What's your naming convention of preference? Does it matter?
thnx.
| When it comes to naming conventions in programming, particularly in relation to CRUD operations (Create, Read, Update, Delete), the choice between different verbs can indeed seem petty but can have implications for code clarity and maintainability. Here’s a breakdown of the options you mentioned and some thoughts on na... | 44,735 | [
{
"from": "human",
"value": "Do you write createSomething() or addSomething()?\nDo you write readSomething(), getSomething() or fetchSomething()?\nThis is totally a petty gripe. In the meeting room we refer to it as CRUD, but in actual code, it's becoming AGUD.\nWhat's your naming convention of preference? ... |
Is it possible to cast an object in Java to a combined generic type?
I have a method like:
public static <T extends Foo & Bar> void doSomething(T object) {
//do stuff
}
Calling this method is no problem if I have a class that implements both interfaces (Foo & Bar).
The problem is when I need to call this method th... | In Java, when you're working with generic types and you have an object that is of type `Object`, you need to cast it in a way that satisfies the generic type bounds. Given your situation, where you have a method that accepts a type that extends both `Foo` and `Bar`, you can achieve the necessary cast by using a safe ca... | 46,573 | [
{
"from": "human",
"value": "Is it possible to cast an object in Java to a combined generic type?\nI have a method like:\npublic static <T extends Foo & Bar> void doSomething(T object) {\n //do stuff\n}\n\nCalling this method is no problem if I have a class that implements both interfaces (Foo & Bar).\nT... |
I'm curious about what it takes to program for mobile devices (Windows Mobile 6.1) and if I can use the IDE's we're already used to (RAD Studio 2009).
Is there a Mobile Development Community around where Delphi or C++Builder users can learn from?
Are there differences in development techniques, like: Drivers, Memor... | Programming for mobile devices, particularly for a platform like Windows Mobile 6.1, involves several unique considerations and may not be directly comparable to developing for desktop environments like Windows or using RAD Studio 2009. Here are some insights into mobile development in this context:
### Development En... | 45,533 | [
{
"from": "human",
"value": "I'm curious about what it takes to program for mobile devices (Windows Mobile 6.1) and if I can use the IDE's we're already used to (RAD Studio 2009). \nIs there a Mobile Development Community around where Delphi or C++Builder users can learn from? \nAre there differences in de... |
I have two tables one has a three column composite key. The other needs to reference this composite key.
What is the syntax for creating a foreign key which references multiple columns.
I tried googleing, but I couldn't find it.
| To create a foreign key that references a composite key in another table, you'll need to specify all the columns involved in the composite key. Below is the general syntax for creating a foreign key that references multiple columns in SQL.
Assuming you have two tables: `tableA` which has the composite key (`column1`, ... | 45,062 | [
{
"from": "human",
"value": "I have two tables one has a three column composite key. The other needs to reference this composite key.\nWhat is the syntax for creating a foreign key which references multiple columns. \nI tried googleing, but I couldn't find it. \n"
},
{
"from": "gpt",
"value": "T... |
Why can't Delphi variants hold objects? More importantly, what's the reason behind this limitation?
| In Delphi, variants are a special data type that can hold different kinds of values, such as integers, strings, floats, and even arrays. However, they cannot directly hold objects or class instances. The primary reasons for this limitation are related to how variants are implemented and the nature of object references ... | 47,465 | [
{
"from": "human",
"value": "Why can't Delphi variants hold objects? More importantly, what's the reason behind this limitation? \n"
},
{
"from": "gpt",
"value": "In Delphi, variants are a special data type that can hold different kinds of values, such as integers, strings, floats, and even arra... |
One of my goals is to be able to deploy a new version of a web application that runs side by side the old version. The catch is that everything shares a database. A database that in the new version tends to include significant refactoring to database tables. I would like to be rollout the new version of the applicati... | Deploying a new version of a web application alongside an older version while sharing a common database can be quite challenging, especially when the new version involves significant changes to the database schema. Here’s a step-by-step approach you can take to manage breaking database changes while ensuring that your ... | 39,427 | [
{
"from": "human",
"value": "One of my goals is to be able to deploy a new version of a web application that runs side by side the old version. The catch is that everything shares a database. A database that in the new version tends to include significant refactoring to database tables. I would like to be... |
I'm writing an application that includes a plugin system in a different assembly.
The problem is that the plugin system needs to get application settings from the main app (like the directory to look for plugins).
How is this done, or am I going about this the wrong way?
Edit: I was encouraged to add some details about... | Creating a plugin system that can access application settings from the main app is a common challenge. There are various approaches to achieve this, depending on your design and architectural choices. Here are a few methods you can consider:
### 1. Dependency Injection
One of the most flexible and maintainable ways to... | 44,287 | [
{
"from": "human",
"value": "I'm writing an application that includes a plugin system in a different assembly.\nThe problem is that the plugin system needs to get application settings from the main app (like the directory to look for plugins).\nHow is this done, or am I going about this the wrong way?\nEdit... |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
namespace ConsoleApplication1
{
public class Class1
{
static void Main(string[] args)
{
List<Car> mylist = new List<Car>();
Car car1;
Car car2;
... | To update the list by replacing the Honda car with `id = 1` with the Honda car with `id = 3`, you can find the car with `id = 1` and then replace it directly in the list. The `Where` method returns an `IEnumerable`, which does not allow assignment. Instead, you should use the `SingleOrDefault` method to get the specifi... | 48,636 | [
{
"from": "human",
"value": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Linq.Expressions;\nusing System.Text;\n\nnamespace ConsoleApplication1\n{\n\n public class Class1 \n {\n static void Main(string[] args)\n {\n List<Car> mylist = new L... |
Are there any particularly good university lectures available online for download as MP3 (or some other audio format)? I am particularly interested in hearing some of the more advanced classes that I didn't get to take in my engineering degree, like compilers, operating systems, AI, cryptography, etc.
There is another ... | Yes, there are several resources where you can find university lectures available for download in audio formats like MP3. Here are some platforms and specific courses that might interest you, especially in the fields you mentioned:
1. **MIT OpenCourseWare (OCW)**: MIT offers a wealth of courses, many of which include ... | 48,138 | [
{
"from": "human",
"value": "Are there any particularly good university lectures available online for download as MP3 (or some other audio format)? I am particularly interested in hearing some of the more advanced classes that I didn't get to take in my engineering degree, like compilers, operating systems,... |
Duplicate of 249087
I have a bunch of user generated addresses that may contain characters with diacritic marks.
What is the most effective (i.e. generic) way (apart from a straightforward replace) to automatically convert any such characters to their closest English equivalent?
E.g.
any of àâãäå would become a
æ wou... | To convert characters with diacritic marks to their closest English equivalents in a generic and effective way, you can use Unicode normalization. In Python, for example, you can use the `unicodedata` library to accomplish this. Here's a sample code snippet that demonstrates how to do this:
```python
import unicodedat... | 49,593 | [
{
"from": "human",
"value": "Duplicate of 249087\nI have a bunch of user generated addresses that may contain characters with diacritic marks. \nWhat is the most effective (i.e. generic) way (apart from a straightforward replace) to automatically convert any such characters to their closest English equivale... |
Is it possible using jQuery to select all <a> links which href ends with "ABC"?
For example, if I want to find this link <a href="http://server/page.aspx?id=ABC">
| Yes, you can use jQuery to select all `<a>` links where the `href` attribute ends with "ABC". You can achieve this using the `filter` method along with the `endsWith` method in JavaScript. Here’s an example of how you can do that:
```javascript
$(document).ready(function() {
// Select all <a> tags
$('a').filte... | 49,156 | [
{
"from": "human",
"value": "Is it possible using jQuery to select all <a> links which href ends with \"ABC\"?\nFor example, if I want to find this link <a href=\"http://server/page.aspx?id=ABC\">\n"
},
{
"from": "gpt",
"value": "Yes, you can use jQuery to select all `<a>` links where the `href`... |
Ok, I'm not great in mysql, but I know an index would help me out here, however I've done some plugging and can't find one to help...
Anyone got any ideas?
explain
select `users_usr`.`id_usr` AS `id_usr`,
`users_usr`.`firstname_usr` AS `firstname_usr`,
`users_usr`.`lastname_usr` AS `lastname_usr`,`users_usr`.`soci... | To optimize your query with indexes, let's analyze the query structure and the current indices:
### Current Query Analysis
Your query involves joining multiple tables (`users_usr`, `credit_acc`, `cfc_cfc`) and filters on the `credit_acc` table with the conditions:
- `credit_acc.type_acc = 'init'`
- `credit_acc.status_... | 43,950 | [
{
"from": "human",
"value": "Ok, I'm not great in mysql, but I know an index would help me out here, however I've done some plugging and can't find one to help...\nAnyone got any ideas?\n explain \nselect `users_usr`.`id_usr` AS `id_usr`,\n`users_usr`.`firstname_usr` AS `firstname_usr`,\n`users_usr`.`las... |
UPDATE
I have combined various answers from here into a 'definitive' answer on a new question.
Original question
In my code I have an event publisher, which exists for the whole lifetime of the application (here reduced to bare essentials):
public class Publisher
{
//ValueEventArgs<T> inherits from EventArgs
p... | It looks like you're facing a common issue in event-driven programming, particularly with dynamically created and destroyed controls in a WinForms application. The challenge arises from the fact that anonymous methods (or lambdas) create strong references to their captured variables, which can prevent garbage collectio... | 47,753 | [
{
"from": "human",
"value": "UPDATE \nI have combined various answers from here into a 'definitive' answer on a new question.\nOriginal question\nIn my code I have an event publisher, which exists for the whole lifetime of the application (here reduced to bare essentials):\npublic class Publisher\n{\n //... |
Everyone has this huge massively parallelized supercomputer on their desktop in the form of a graphics card GPU.
What is the "hello world" equivalent of the GPU community?
What do I do, where do I go, to get started programming the GPU for the major GPU vendors?
-Adam
| Hi Adam,
Getting started with GPU programming can be an exciting journey! The "Hello, World!" equivalent in the GPU community often involves writing a simple program that performs parallel computation. The most common introductory example is a basic vector addition, which showcases how to leverage the parallel nature ... | 32,836 | [
{
"from": "human",
"value": "Everyone has this huge massively parallelized supercomputer on their desktop in the form of a graphics card GPU.\n\nWhat is the \"hello world\" equivalent of the GPU community?\nWhat do I do, where do I go, to get started programming the GPU for the major GPU vendors?\n\n-Adam\n... |
I'm currently working on a large project, where many developers worked over time and the code was terrible. After many refactorings we now arrived a point, where the code is ok. Now I'm thinking what "ok" means - probably for everyone something different.
Do you think it's possible to specify "ok"? What is important? N... | Defining what "ok" means in the context of code quality is indeed subjective, and it can vary based on team standards, project requirements, and individual perspectives. However, there are several key dimensions you can evaluate to establish a baseline for "ok" in your project. Here are the important factors to conside... | 38,780 | [
{
"from": "human",
"value": "I'm currently working on a large project, where many developers worked over time and the code was terrible. After many refactorings we now arrived a point, where the code is ok. Now I'm thinking what \"ok\" means - probably for everyone something different.\nDo you think it's po... |
<% using (Html.BeginForm() { %>
<%=Html.DropDownList("TopItemsList", ViewData["ListData"], new { onchange="[???]" })%>
<% } %>
In the above example, what value should you set onchange to? Or, how do you get the correct form?
Is there any difference with Ajax.BeginFrom?
| In your example, you're creating a dropdown list with an `onchange` event handler in an ASP.NET MVC Razor view. To properly set the `onchange` attribute, you would typically want to call a JavaScript function that handles the event when the selection changes. Here's how you can do it:
1. **Define a JavaScript function... | 44,970 | [
{
"from": "human",
"value": "<% using (Html.BeginForm() { %>\n\n <%=Html.DropDownList(\"TopItemsList\", ViewData[\"ListData\"], new { onchange=\"[???]\" })%>\n\n<% } %>\n\nIn the above example, what value should you set onchange to? Or, how do you get the correct form?\nIs there any difference with Ajax.Be... |
A method I work with that is called tens of thousands of times started throwing exceptions recently. In most debugging circumstances I would set a breakpoint at the top of this method and run through until I reach the call I'm interested in with a parameter value that triggers the exception. In this case that would b... | It sounds like you're experiencing a frustrating issue with conditional breakpoints in Visual Studio. While there are many potential causes for the behavior you're observing, here are some common issues and potential solutions you can explore:
1. **Complexity of Conditional Expressions**: If the condition you specifie... | 46,295 | [
{
"from": "human",
"value": "A method I work with that is called tens of thousands of times started throwing exceptions recently. In most debugging circumstances I would set a breakpoint at the top of this method and run through until I reach the call I'm interested in with a parameter value that triggers ... |
What is the simplest way to count # of visits by a user in an ASP.NET web app?
Our app services anonymous users, registered users and an intermediate user, called a "prospect". Prospects are users that request information but do not create an account.
We leave an ID cookie for every type of user, and that's the key in... | To effectively count the number of visits by different types of users in your ASP.NET 1.1 web application, including anonymous users, registered users, and prospects, you can follow a straightforward approach that utilizes the session cookie and your existing ID cookie.
### Suggested Approach:
1. **Unique Identifier ... | 42,182 | [
{
"from": "human",
"value": "What is the simplest way to count # of visits by a user in an ASP.NET web app?\nOur app services anonymous users, registered users and an intermediate user, called a \"prospect\". Prospects are users that request information but do not create an account.\nWe leave an ID cookie ... |
I have a SSIS package that eventually I would like to pass parameters too, these parameters will come from a .NET application (VB or C#) so I was curious if anyone knows of how to do this, or better yet a website with helpful hints on how to do it.
So basically I want to execute a SSIS package from .NET passing the SS... | To execute an SSIS package from a .NET application (C# or VB.NET) and pass parameters to it, you can use the SQL Server Integration Services (SSIS) runtime. Below are the steps and code snippets that will guide you through the process:
### Prerequisites
1. Ensure you have the necessary libraries: You will need to refe... | 44,594 | [
{
"from": "human",
"value": "I have a SSIS package that eventually I would like to pass parameters too, these parameters will come from a .NET application (VB or C#) so I was curious if anyone knows of how to do this, or better yet a website with helpful hints on how to do it. \nSo basically I want to execu... |
I've been doing a convert(varchar,datefield,112) on each date field that I'm using in 'between' queries in SQL server to ensure that I'm only accounting for dates and not missing any based on the time part of datetime fields.
Now, I'm hearing that the converts aren't indexable and that there are better methods, in SQL ... | In SQL Server, using `CONVERT` on your date fields can indeed prevent the use of indexes on those fields, leading to less efficient queries. Instead of converting your date fields to `varchar`, you can leverage the properties of the `DATETIME` data type directly.
To compare only the date part of `DATETIME` fields whil... | 48,316 | [
{
"from": "human",
"value": "I've been doing a convert(varchar,datefield,112) on each date field that I'm using in 'between' queries in SQL server to ensure that I'm only accounting for dates and not missing any based on the time part of datetime fields.\nNow, I'm hearing that the converts aren't indexable ... |
We have a pretty big ASP.NET WebForm (web application) project with a lot of references to other libraries, other projects etc and most of the time after a compilation, the first time we load a page it takes a LONG time before rendering anything... Disk IO is the main problem. For small projects it's nearly instantan... | The first page load time after a compilation in ASP.NET WebForms can be significantly longer than in ASP.NET MVC, particularly for large projects. This difference primarily stems from how the two frameworks handle page lifecycle and initialization.
### Reasons for Longer Load Times in ASP.NET WebForms:
1. **View Stat... | 46,174 | [
{
"from": "human",
"value": "We have a pretty big ASP.NET WebForm (web application) project with a lot of references to other libraries, other projects etc and most of the time after a compilation, the first time we load a page it takes a LONG time before rendering anything... Disk IO is the main problem. ... |
How do I download a file from the internet in a Flex based AIR application.
I tried using a file with url set to the address, but I got a file does not exist error when I tried to save it. And it is really hard to google for help on this issue.
| To download a file from the internet in a Flex-based Adobe AIR application, you can use the `URLLoader` and `File` classes in conjunction with a `FileStream`. Here's a step-by-step guide on how to accomplish this:
1. **Import Necessary Classes**: Make sure to import the necessary classes in your code.
```actionsc... | 45,543 | [
{
"from": "human",
"value": "How do I download a file from the internet in a Flex based AIR application. \nI tried using a file with url set to the address, but I got a file does not exist error when I tried to save it. And it is really hard to google for help on this issue.\n"
},
{
"from": "gpt",... |
I need to find a reg ex that only allows alphanumeric. So far, everyone I try only works if the string is alphanumeric, meaning contains both a letter and a number. I just want one what would allow either and not require both.
| To create a regular expression (regex) that allows any alphanumeric character (letters and numbers) but does not require both, you can use the following pattern:
```regex
^[a-zA-Z0-9]+$
```
### Explanation:
- `^` asserts the start of the string.
- `[a-zA-Z0-9]` is a character class that matches any uppercase or lower... | 49,534 | [
{
"from": "human",
"value": "I need to find a reg ex that only allows alphanumeric. So far, everyone I try only works if the string is alphanumeric, meaning contains both a letter and a number. I just want one what would allow either and not require both.\n"
},
{
"from": "gpt",
"value": "To crea... |
I have an array of different type objects and I use a BinaryWriter to convert each item to its binary equivalent so I can send the structure over the network.
I currently do something like
for ( i=0;i<tmpArrayList.Count;i++)
{
object x=tmpArrayList[i];
if (x.GetType() == typeof(byte))
{
wrt.Write((byte... | Your approach for serializing a variety of object types into a byte array for network transmission is interesting. However, you can optimize and simplify it significantly. Here’s a revised version that maintains type safety while avoiding the complexity of reflection and a lengthy series of `if` statements.
### Revise... | 44,619 | [
{
"from": "human",
"value": "I have an array of different type objects and I use a BinaryWriter to convert each item to its binary equivalent so I can send the structure over the network.\nI currently do something like \nfor ( i=0;i<tmpArrayList.Count;i++)\n{\n object x=tmpArrayList[i];\n if (x.GetType(... |
I have found ASP.Net PageMethods very handy and easy to use, but I have just started developing using MVC and am not sure how to use them?
What is the equivalent of PageMethods.MyFunction() in MVC where MyFunction is a Controller action?
I know I can use the Json function to return a value, but how do I call the actio... | In ASP.NET MVC, you can achieve similar functionality to ASP.NET PageMethods by using AJAX calls to your controller actions. Instead of using `PageMethods.MyFunction()`, you can use jQuery or Fetch API to make an AJAX request to your MVC controller's action method. Here's a step-by-step guide on how to set this up:
##... | 47,274 | [
{
"from": "human",
"value": "I have found ASP.Net PageMethods very handy and easy to use, but I have just started developing using MVC and am not sure how to use them?\nWhat is the equivalent of PageMethods.MyFunction() in MVC where MyFunction is a Controller action?\nI know I can use the Json function to ... |
Our company is transitioning code from VS 2005. I know they won't be able to use VS 2008 to access it, but we have the patch to enable web access for TFS 2008 applied to our TFS server. This means they can access the source code via the web, but do the work in VS 2005.
The code will eventually be rewritten in VS 20... | Transitioning from Visual Studio 2005 to later versions, while maintaining the legacy codebase in TFS (Team Foundation Server) 2008, does present some considerations. Here are some points to think about:
1. **Compatibility**: Visual Studio 2005 projects may not open correctly in Visual Studio 2008 without modification... | 48,814 | [
{
"from": "human",
"value": "Our company is transitioning code from VS 2005. I know they won't be able to use VS 2008 to access it, but we have the patch to enable web access for TFS 2008 applied to our TFS server. This means they can access the source code via the web, but do the work in VS 2005. \nThe ... |
I am big into code generation for the service/data layer of my apps. What I would really love to do is generate some basic WPF Controls, Data Templates, or some other XAML code based on the metadata I use to generate my service/data layer. EDIT: This generation is done before compile time.
What I envision is being abl... | In WPF, while there is no direct equivalent to CSS for styling and layout manipulation, there are several approaches you can consider that allow you to separate layout and styling concerns from the generated XAML code. Here are some options:
### 1. **Use Styles and Control Templates**
WPF supports styles and control ... | 47,628 | [
{
"from": "human",
"value": "I am big into code generation for the service/data layer of my apps. What I would really love to do is generate some basic WPF Controls, Data Templates, or some other XAML code based on the metadata I use to generate my service/data layer. EDIT: This generation is done before c... |
I have a class A and another class that inherits from it, B. I am overriding a function that accepts an object of type A as a parameter, so I have to accept an A. However, I later call functions that only B has, so I want to return false and not proceed if the object passed is not of type B.
What is the best way to fin... | In many object-oriented programming languages, you can check the type of an object using type checking mechanisms provided by the language. Since you have a class `A` and a class `B` that inherits from `A`, you can use type checking to determine if an object of type `A` is actually an instance of type `B`.
Here's how ... | 46,261 | [
{
"from": "human",
"value": "I have a class A and another class that inherits from it, B. I am overriding a function that accepts an object of type A as a parameter, so I have to accept an A. However, I later call functions that only B has, so I want to return false and not proceed if the object passed is n... |
I would like to know if there is software that, given a regex and of course some other constraints like length, produces random text that always matches the given regex.
Thanks
| Yes, there are several tools and libraries that can generate random text that matches a given regular expression (regex) while adhering to specified constraints like length. Here are a few options:
1. **Regex Generator Libraries**:
- **Python Libraries**: Libraries like `exrex` or `regexgen` can generate strings th... | 46,517 | [
{
"from": "human",
"value": "I would like to know if there is software that, given a regex and of course some other constraints like length, produces random text that always matches the given regex.\nThanks\n"
},
{
"from": "gpt",
"value": "Yes, there are several tools and libraries that can gene... |
How can I modify the PDF document properties programmatically using .NET code?
I have purchased a number of eBooks in PDF format and unfortunately the publishers have not set the Title, Author and Subject properties. You can see this on a document by accessing the file Properties dialog and selecting the PDF tab. This ... | You can modify PDF document properties using the `iTextSharp` library in .NET, which is a popular and powerful library for working with PDFs. Although `iTextSharp` is free for open-source projects, make sure to check the licensing if you are using it for commercial purposes.
Here’s a simple example of how you can use ... | 45,569 | [
{
"from": "human",
"value": "How can I modify the PDF document properties programmatically using .NET code?\nI have purchased a number of eBooks in PDF format and unfortunately the publishers have not set the Title, Author and Subject properties. You can see this on a document by accessing the file Properti... |
I wanted to know why UDP is used in RTP rather than TCP ?. Major VoIP Tools used only UDP as i hacked some of the VoIP OSS.
| UDP (User Datagram Protocol) is favored over TCP (Transmission Control Protocol) for RTP (Real-time Transport Protocol) in VoIP (Voice over Internet Protocol) applications and streaming media for several key reasons:
1. **Low Latency**: UDP is a connectionless protocol that does not establish a connection before sendi... | 48,744 | [
{
"from": "human",
"value": "I wanted to know why UDP is used in RTP rather than TCP ?. Major VoIP Tools used only UDP as i hacked some of the VoIP OSS.\n"
},
{
"from": "gpt",
"value": "UDP (User Datagram Protocol) is favored over TCP (Transmission Control Protocol) for RTP (Real-time Transport ... |
I want to set the width of a TextBlock based on the width of its container, minus the margins set on the TextBlock.
Here is my code:
<TextBlock x:Name="txtStatusMessages"
Width="{Binding ElementName=LayoutRoot,Path=ActualWidth }"
TextWrapping="WrapWithOverflow"
Foreground="Whi... | You can achieve the desired behavior by using a combination of bindings and a converter, but instead of trying to use a parameter from a binding directly in the `ConverterParameter`, you can create a more straightforward approach.
Here’s how you can accomplish this without making it overly complex:
1. Bind the `Widt... | 48,270 | [
{
"from": "human",
"value": "I want to set the width of a TextBlock based on the width of its container, minus the margins set on the TextBlock.\nHere is my code:\n<TextBlock x:Name=\"txtStatusMessages\" \n Width=\"{Binding ElementName=LayoutRoot,Path=ActualWidth }\"\n TextWrappi... |
Where should I be logging exceptions? At the data service tier(ExecuteDataSet, etc.) and/or at the data access layer and/or at the business layer?
| Logging exceptions is a critical part of software development, as it helps in diagnosing issues and maintaining the health of the application. Where to log exceptions can depend on various factors, including the architecture of your application, the type of exceptions being caught, and the goals of your logging strateg... | 44,733 | [
{
"from": "human",
"value": "Where should I be logging exceptions? At the data service tier(ExecuteDataSet, etc.) and/or at the data access layer and/or at the business layer?\n"
},
{
"from": "gpt",
"value": "Logging exceptions is a critical part of software development, as it helps in diagnosin... |
How can I grab my local changelist and send it to someone else in Perforce? More specifically, I would like to send unsubmitted changes from a local pending changelist to another user's pending changelist.
| To send your local pending changelist changes to another user's pending changelist in Perforce, you will need to use the `p4` command-line tool. Here's a step-by-step guide on how to accomplish this:
### Step 1: Identify Your Pending Changelist
First, you need to identify the changelist you want to send. You can do t... | 46,543 | [
{
"from": "human",
"value": "How can I grab my local changelist and send it to someone else in Perforce? More specifically, I would like to send unsubmitted changes from a local pending changelist to another user's pending changelist.\n"
},
{
"from": "gpt",
"value": "To send your local pending c... |
Is there any way to follow a URL in JavaScript without setting the document.location.href?
I have a page that displays a list of objects and each object may have a file download associated with it, which is accessed via a hyperlink. Clicking the link initiates an AJAX request that ultimately leads to a transient file b... | If you're looking to initiate a file download without changing the current URL in the browser's address bar, you can accomplish this without setting `document.location.href`. Instead, you can create an invisible anchor (`<a>`) element, set its `href` to the temporary URL, and programmatically trigger a click on this an... | 39,798 | [
{
"from": "human",
"value": "Is there any way to follow a URL in JavaScript without setting the document.location.href?\nI have a page that displays a list of objects and each object may have a file download associated with it, which is accessed via a hyperlink. Clicking the link initiates an AJAX request t... |
I'm using Hibernate 3.1 and Oracle 10 DB. The blob is defined as @Lob @Basic @Column in the Hibernate entity which corresponds to the relevant DB table.
The error -java.sql.SQLException: Closed Connection- seem to appear once in while, not in every attempt to get the blob from the DB.
This seems like a hibernate fetch... | The error `java.sql.SQLException: Closed Connection` generally indicates that the database connection being used to fetch the BLOB data has been closed before the operation was completed. This could happen due to several reasons, such as connection pooling configurations, transaction boundaries, or even how Hibernate m... | 44,622 | [
{
"from": "human",
"value": "I'm using Hibernate 3.1 and Oracle 10 DB. The blob is defined as @Lob @Basic @Column in the Hibernate entity which corresponds to the relevant DB table.\nThe error -java.sql.SQLException: Closed Connection- seem to appear once in while, not in every attempt to get the blob from... |
When executing the following (complete) SQL query on Microsoft SQL Server 2000:
SELECT B.ARTIFACTTNS, B.ARTIFACTNAME, B.ARTIFACTTYPE, B.INITIALBYTES, B.TIMESTAMP1, B.FILENAME, B.BACKINGCLASS,
B.CHARENCODING, B.APPNAME, B.COMPONENTTNS, B.COMPONENTNAME, B.SCAMODULENAME, B.SCACOMPONENTNAME
FROM (SELECT DISTINCT A... | The error you're encountering, `Ambiguous column name 'ARTIFACTTYPE'`, suggests that there are multiple columns with the name `ARTIFACTTYPE` that SQL Server cannot distinguish between when you reference it in your query. This typically occurs in situations where the same column name exists in more than one table or sub... | 45,348 | [
{
"from": "human",
"value": "When executing the following (complete) SQL query on Microsoft SQL Server 2000:\nSELECT B.ARTIFACTTNS, B.ARTIFACTNAME, B.ARTIFACTTYPE, B.INITIALBYTES, B.TIMESTAMP1, B.FILENAME, B.BACKINGCLASS, \n B.CHARENCODING, B.APPNAME, B.COMPONENTTNS, B.COMPONENTNAME, B.SCAMODULENAME, ... |
I have a legacy Oracle database that has multiple 1:n lookup tables that are based on CHAR(6) primary keys in the child tables. Unfortunately, I'm not the only one who has problems with how NHibernate deals with char fields (especially with those as primary keys). See:
http://forum.hibernate.org/viewtopic.php?t=984281... | Dealing with `CHAR` fields, especially as primary keys in an Oracle database, can indeed present some challenges when using NHibernate. Below are some strategies and best practices that may help you mitigate the issues you are facing, especially with lookups and entity retrieval:
### 1. **Custom UserType Implementatio... | 45,982 | [
{
"from": "human",
"value": "I have a legacy Oracle database that has multiple 1:n lookup tables that are based on CHAR(6) primary keys in the child tables. Unfortunately, I'm not the only one who has problems with how NHibernate deals with char fields (especially with those as primary keys). See:\n\nhttp:/... |
Syntactic sugar for properties for example in C#:
private int x;
public int X{
get { return x; }
set { x = value; }
}
or simply
public int X{ get; set; }
I am missing verbatim strings in java... @"C:\My Documents\" instead of "C:\\My Documents\\"
Do you agree Java needs more "sugar"? Any one knows is there ... | Yes, many developers have expressed a desire for more syntactic sugar in Java to make the language more concise and expressive. Java is often considered verbose compared to languages like C#, Python, or JavaScript, which have more syntactic conveniences.
### Verbose Examples in Java
The example you gave illustrates ho... | 48,004 | [
{
"from": "human",
"value": "Syntactic sugar for properties for example in C#:\nprivate int x;\n\npublic int X{\n get { return x; }\n set { x = value; }\n}\n\nor simply\n public int X{ get; set; }\n\nI am missing verbatim strings in java... @\"C:\\My Documents\\\" instead of \"C:\\\\My Documents\\\\\"... |
I'm developing an idea for a web application that would be well suited to one of the popular MVC frameworks out there right now, but torn between which to go with. I was originally going to go with Pylons, but upon reading about the BizSpark program, I'm reconsidering ASP.NET MVC.
The hitch is that if I'm successful I'... | When deciding between ASP.NET MVC and various Python MVC frameworks like Pylons, Django, or web.py, there are several factors to consider, including performance, your familiarity with the frameworks, long-term costs, and the specific requirements of your project.
### Performance Comparison:
1. **ASP.NET MVC**:
- G... | 44,207 | [
{
"from": "human",
"value": "I'm developing an idea for a web application that would be well suited to one of the popular MVC frameworks out there right now, but torn between which to go with. I was originally going to go with Pylons, but upon reading about the BizSpark program, I'm reconsidering ASP.NET MV... |
Possible Duplicate:
Mod_Rewrite with Relative Path Redirects
I have a series of RewriteRules in .htaccess for my site which I'm in the process of restructuring.
# Requests for http://example.com/contents/section/4/48/
# get redirected to http://example.com/courses
RewriteRule ^content/section/4/48/$ /courses [R=301,... | To achieve the desired behavior where the rewrite rule redirects to a relative URL depending on the location of the `.htaccess` file, you can make use of the `RewriteBase` directive. This will allow you to define a base URL for your rewrite rules.
Here’s how you can set it up:
1. **In your `/new/.htaccess` file** (wh... | 49,736 | [
{
"from": "human",
"value": "\nPossible Duplicate:\nMod_Rewrite with Relative Path Redirects \n\nI have a series of RewriteRules in .htaccess for my site which I'm in the process of restructuring.\n# Requests for http://example.com/contents/section/4/48/\n# get redirected to http://example.com/courses\nRewr... |
I'm trying to setup Spring using Hibernate and JPA, but when trying to persist an object, nothing seems to be added to the database.
Am using the following:
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
<property name="url" value="${jdbc.url}"/>
<property name="driverClassName" value="$... | From your provided code and description, it seems like you're encountering an issue where the object is not being persisted to the database, even though you're not encountering any exceptions. Here are some potential issues and solutions that could help you diagnose and solve the problem:
### 1. Transaction Management... | 47,372 | [
{
"from": "human",
"value": "I'm trying to setup Spring using Hibernate and JPA, but when trying to persist an object, nothing seems to be added to the database.\nAm using the following:\n<bean id=\"dataSource\" class=\"org.apache.commons.dbcp.BasicDataSource\">\n <property name=\"url\" value=\"${jdbc.ur... |
I have a custom security principal object which I set in the global.asax for the current thread and all is well, no problems normally.
However, I'm just adding a dynamic image feature by having a page serve up the image and whenever that dynamic image page is loaded the System.Web.HttpContext.Current.Session is null in... | The issue you're encountering where `System.Web.HttpContext.Current.Session` is null during the request for the dynamic image suggests that the session state is not being correctly managed for those requests. This can happen for a couple of reasons, particularly when dealing with image requests. Here are some potential... | 45,373 | [
{
"from": "human",
"value": "I have a custom security principal object which I set in the global.asax for the current thread and all is well, no problems normally.\nHowever, I'm just adding a dynamic image feature by having a page serve up the image and whenever that dynamic image page is loaded the System.... |
This is the trace of my app,when I updated my device to 2.2.
any idea to get rid of this leak? because I think that's the culprit who keep crashing my application.
This is trace when I run my application in os2.2,see the image which show the part which might be generating leak,and if you can give me some hints to resol... | It sounds like you're dealing with a memory leak in your application that only appears after updating your device to OS 2.2. Memory leaks can lead to application crashes due to excessive memory usage, especially in environments with constrained resources.
Here are some general steps and tips to identify and resolve me... | 44,851 | [
{
"from": "human",
"value": "This is the trace of my app,when I updated my device to 2.2.\nany idea to get rid of this leak? because I think that's the culprit who keep crashing my application.\nThis is trace when I run my application in os2.2,see the image which show the part which might be generating leak... |
How do you even look at the web.config file? I don't know where to go to turn custom errors off...help!
I tried command prompt and java script....can any one help me?
| The `web.config` file is an important configuration file used in ASP.NET applications that runs on Internet Information Services (IIS). To modify the `web.config` file to turn off custom errors, you’ll typically follow these steps:
### Locating the `web.config` File
1. **File Explorer**:
- Navigate to the root di... | 47,315 | [
{
"from": "human",
"value": "How do you even look at the web.config file? I don't know where to go to turn custom errors off...help! \nI tried command prompt and java script....can any one help me?\n"
},
{
"from": "gpt",
"value": "The `web.config` file is an important configuration file used in ... |
Can someone explain to me why this code prints 14? I was just asked by another student and couldn't figure it out.
int i = 5;
i = ++i + ++i;
cout<<i;
| To understand why the code prints `14`, let's analyze the line of code step by step:
```cpp
int i = 5; // Initialize i to 5
i = ++i + ++i; // This is where it gets interesting
cout << i; // Output the value of i
```
1. **Initial Value**: The variable `i` is initialized to `5`.
2. **Pre-increment Operations... | 46,558 | [
{
"from": "human",
"value": "Can someone explain to me why this code prints 14? I was just asked by another student and couldn't figure it out.\nint i = 5;\ni = ++i + ++i;\ncout<<i;\n\n"
},
{
"from": "gpt",
"value": "To understand why the code prints `14`, let's analyze the line of code step by ... |
I understand that there's no universal answer to the attribute vs. element debate (and I read through the other questions I saw on this), but any insight into this particular circumstance would be greatly appreciated.
In our case we're going to be receiving very large amounts of master and transactional data from a s... | When deciding between attributes and elements in XML for large datasets, especially in your case where performance and memory usage are important, there are several factors to consider. Both approaches have their advantages and disadvantages:
### Using Attributes:
**Advantages:**
1. **Conciseness**: Attributes can le... | 40,537 | [
{
"from": "human",
"value": "I understand that there's no universal answer to the attribute vs. element debate (and I read through the other questions I saw on this), but any insight into this particular circumstance would be greatly appreciated. \nIn our case we're going to be receiving very large amounts... |
In Websphere when you do an LDAP query using LdapContext are the transmission of credentials encrypted?
LdapContext ctx = new InitialLdapContext (env, null);
Lets say I make an LdapContext for a web app to do some custom LDAP calls.
How do I know if my call is secure / encrypted?
| In WebSphere, when you create an `LdapContext` for making LDAP queries, the security of the connection, including whether the transmission of credentials is encrypted, depends on the configuration of the LDAP server and the parameters you use when creating the `LdapContext`.
### Secure LDAP Connections
1. **Use of LD... | 45,613 | [
{
"from": "human",
"value": "In Websphere when you do an LDAP query using LdapContext are the transmission of credentials encrypted?\nLdapContext ctx = new InitialLdapContext (env, null);\n\nLets say I make an LdapContext for a web app to do some custom LDAP calls.\nHow do I know if my call is secure / encr... |
We're planning a browser application (xbap) which is going to talk to WCF services. These WCF services get information from a SQL database. Each of our clients has his own database on this server. The clients need to get reports from SQL Reporting Services. A client can have multiple instances of this application runni... | Licensing for Microsoft products, especially in a multi-client application scenario like yours, can be quite complex. Here's a breakdown of how licensing generally works for the components you've mentioned, but it's crucial to consult with a Microsoft licensing expert or reseller to get the most accurate information ta... | 45,379 | [
{
"from": "human",
"value": "We're planning a browser application (xbap) which is going to talk to WCF services. These WCF services get information from a SQL database. Each of our clients has his own database on this server. The clients need to get reports from SQL Reporting Services. A client can have mul... |
In an iPhone app I'm working on, the user needs to enter some configuration via the settings application before my app will be able to connect to a server and run. Right now when the user first launches my app, I display an alert explaining that the user should go to settings, enter the config details and then relaunch... | You can indeed open the Settings app directly to your app's specific settings page using a custom URL scheme in your iOS app. Starting from iOS 8, you can use the URL `App-Prefs:` to navigate users to your app's settings page. Here's how you can implement this:
1. **Show an Alert**: When the app detects that the confi... | 48,396 | [
{
"from": "human",
"value": "In an iPhone app I'm working on, the user needs to enter some configuration via the settings application before my app will be able to connect to a server and run. Right now when the user first launches my app, I display an alert explaining that the user should go to settings, e... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.