instruction
stringlengths
14
27.6k
completion
stringlengths
3
38.3k
__original_row_idx
int64
0
50k
conversations
listlengths
2
2
How to customize the color of the symbol inserted in the "glasses mode" in Emacs? I have not found the option for this. Can anyone suggest anything?
In Emacs, "glasses mode" refers to the use of the `display-fill-column-indicator-mode`, which is often represented by a specific symbol (like an open or closed bracket) in the margin. If you want to customize the color of the symbol used in this mode, you can do so by modifying the face associated with it. Here are th...
8,996
[ { "from": "human", "value": "How to customize the color of the symbol inserted in the \"glasses mode\" in Emacs?\nI have not found the option for this. Can anyone suggest anything?\n" }, { "from": "gpt", "value": "In Emacs, \"glasses mode\" refers to the use of the `display-fill-column-indicator...
Starting from ASP.NET MVC Preview 3, HTML.Button ( and other related HTML controls) are no longer supported. The question is, what is the equivalent for them? I've an app that was built using Preview 2, now I have to make it compatible with the latest CTP releases.
In ASP.NET MVC, starting from Preview 3, the `Html.Button` helper and similar methods were removed in favor of more flexible HTML helpers that are based on the `HtmlHelper` class. To create buttons and other HTML elements, you can use the `Html.Button` method that is available in later versions. Below are the equivalen...
7,636
[ { "from": "human", "value": "Starting from ASP.NET MVC Preview 3, HTML.Button ( and other related HTML controls) are no longer supported.\nThe question is, what is the equivalent for them? I've an app that was built using Preview 2, now I have to make it compatible with the latest CTP releases.\n" }, {...
What is the best solution of defaultButton and "Enter key pressed" for ASP.NET 2.0-3.5 forms?
In ASP.NET Web Forms (versions 2.0 to 3.5), handling the `Enter` key pressed event to trigger a specific button, like a default button, is often a requirement. This helps enhance user experience by allowing users to submit a form by pressing the `Enter` key without having to click a button. Here’s a straightforward ap...
4,962
[ { "from": "human", "value": "What is the best solution of defaultButton and \"Enter key pressed\" for ASP.NET 2.0-3.5 forms?\n" }, { "from": "gpt", "value": "In ASP.NET Web Forms (versions 2.0 to 3.5), handling the `Enter` key pressed event to trigger a specific button, like a default button, is...
I'd like to be able to open a TDataSet asynchronously in its own thread so that the main VCL thread can continue until that's done, and then have the main VCL thread read from that TDataSet afterwards. I've done some experimenting and have gotten into some very weird situations, so I'm wondering if anyone has done this...
Working with `TDataSet` in a multi-threaded environment can be quite tricky, especially in a VCL application where the main UI thread needs to remain responsive. In Delphi, VCL components (including `TDataSet` and its descendants like `TMySQLQuery`) are not thread-safe, which means that you should not access them from ...
4,409
[ { "from": "human", "value": "I'd like to be able to open a TDataSet asynchronously in its own thread so that the main VCL thread can continue until that's done, and then have the main VCL thread read from that TDataSet afterwards. I've done some experimenting and have gotten into some very weird situations,...
I use Visual Studio 2008. I haven't seen this behavior before and, as far as I know, I didn't change anything in the options. When I press Start debugging all the possibly windows (watch 1 - 4), data sources, properties, registers (to be honest I have not even ever seen these windows before) appear in front of the cod...
It sounds like you are experiencing a layout issue with the Visual Studio 2008 IDE, particularly during the transition between normal and debug modes. Here are some steps you can take to troubleshoot and potentially resolve the issue: ### 1. Reset Window Layout Try resetting the window layout in Visual Studio. This ca...
7,198
[ { "from": "human", "value": "I use Visual Studio 2008. I haven't seen this behavior before and, as far as I know, I didn't change anything in the options.\nWhen I press Start debugging all the possibly windows (watch 1 - 4), data sources, properties, registers (to be honest I have not even ever seen these ...
Okay so im working on this php image upload system but for some reason internet explorer turns my basepath into the same path, but with double backslashes instead of one; ie: C:\\Documents and Settings\\kasper\\Bureaublad\\24.jpg This needs to become C:\Documents and Settings\kasper\Bureaublad\24.jpg.
It sounds like you're encountering a common issue with how file paths are handled, especially when dealing with different browsers like Internet Explorer. In PHP, you can use the `str_replace` function to normalize the backslashes in the file path to a single backslash. Here's how you can do this: ```php // Assume thi...
7,721
[ { "from": "human", "value": "Okay so im working on this php image upload system but for some reason internet explorer turns my basepath into the same path, but with double backslashes instead of one; ie:\nC:\\\\Documents and Settings\\\\kasper\\\\Bureaublad\\\\24.jpg\n\nThis needs to become C:\\Documents a...
Oracle 11g version of ODP.Net introduces the provider model objects (session state provider, identity provider etc) which lets the application to store these information in an oracle DB without writing custom provider implementation. Has anyone has done any performance benchmarking on these objects? how do they compare...
As of my last update in October 2023, there hasn’t been extensive, widely published performance benchmarking specifically comparing the Oracle 11g ODP.NET session state provider to the SQL Server implementations provided with .NET. However, I can provide some general insights and considerations regarding performance an...
5,106
[ { "from": "human", "value": "Oracle 11g version of ODP.Net introduces the provider model objects (session state provider, identity provider etc) which lets the application to store these information in an oracle DB without writing custom provider implementation.\nHas anyone has done any performance benchmar...
I am confused between the term file modification time and file changed time. Can anyone help to make it clearer?
Certainly! In the context of files in a filesystem, "file modification time" and "file changed time" refer to two different timestamps associated with a file. Here’s a breakdown of each term: 1. **File Modification Time (mtime)**: - This timestamp indicates when the actual content of the file was last modified. For...
9,258
[ { "from": "human", "value": "I am confused between the term file modification time and file changed time. Can anyone help to make it clearer?\n" }, { "from": "gpt", "value": "Certainly! In the context of files in a filesystem, \"file modification time\" and \"file changed time\" refer to two dif...
I've heard that unit testing is "totally awesome", "really cool" and "all manner of good things" but 70% or more of my files involve database access (some read and some write) and I'm not sure how to write a unit test for these files. I'm using PHP and Python but I think it's a question that applies to most/all languag...
You're correct in thinking that unit testing code that interacts with a database presents some unique challenges. However, it's entirely possible to write effective unit tests even for code that deals with database access. The key to overcoming these challenges lies in using techniques such as mocking, dependency injec...
1,971
[ { "from": "human", "value": "I've heard that unit testing is \"totally awesome\", \"really cool\" and \"all manner of good things\" but 70% or more of my files involve database access (some read and some write) and I'm not sure how to write a unit test for these files.\nI'm using PHP and Python but I think ...
Is it ready for that? I've been playing with it for a short amount of time and it seems quite reasonable. Is anyone using it for live sites? any issues to be aware of?
It sounds like you're referring to a new tool, software, or platform that you're experimenting with. Without knowing the specific application or context, I can provide some general considerations for using new technology on live sites: 1. **Stability**: Ensure that the tool has been tested thoroughly and is stable eno...
8,831
[ { "from": "human", "value": "Is it ready for that?\nI've been playing with it for a short amount of time and it seems quite reasonable. Is anyone using it for live sites?\nany issues to be aware of?\n" }, { "from": "gpt", "value": "It sounds like you're referring to a new tool, software, or pla...
I have three models: class ReleaseItem < ActiveRecord::Base has_many :pack_release_items has_one :pack, :through => :pack_release_items end class Pack < ActiveRecord::Base has_many :pack_release_items has_many :release_items, :through=>:pack_release_items end class PackReleaseItem < ActiveRecord::Base belon...
The issue you're encountering stems from how you're trying to associate a `Pack` with a `ReleaseItem`. The `pack` association on `ReleaseItem` is defined through the `PackReleaseItem` join table, but you're trying to assign a `Pack` directly to the `pack` method, which is not how the association works in this case. In...
5,931
[ { "from": "human", "value": "I have three models:\nclass ReleaseItem < ActiveRecord::Base\n has_many :pack_release_items\n has_one :pack, :through => :pack_release_items\nend\n\nclass Pack < ActiveRecord::Base\n has_many :pack_release_items\n has_many :release_items, :through=>:pack_release_items\nend\n...
I've built a wrapper over NumbericUpDown control. The wrapper is generic and can support int? and double? I would like to write a method that will do the following. public partial class NullableNumericUpDown<T> : UserControl where T : struct { private NumbericUpDown numericUpDown; private T? Getvalue() { T?...
To properly implement the `GetValue` method in your `NullableNumericUpDown<T>` wrapper class, where `T` can be either `int` or `double`, you can use a combination of generics and reflection. Since you want to avoid using `if` or `switch` statements, using a dictionary to map types to corresponding conversion functions ...
8,094
[ { "from": "human", "value": "I've built a wrapper over NumbericUpDown control.\nThe wrapper is generic and can support int? and double?\nI would like to write a method that will do the following.\npublic partial class NullableNumericUpDown<T> : UserControl where T : struct\n{\n private NumbericUpDown numer...
I'm sure you have all been there, you take on a project where there is a creaky old code base which is barely fit for purpose and you have to make the decision to either re-write it from scratch or repair what already exists. Conventional wisdom tends to suggest that you should never attempt a re-write from scratch a...
Facing a decision between rewriting an outdated codebase and refactoring it is a common challenge in software development. Here's a structured approach to how I navigated a similar situation: ### 1. **Assessment of the Current Codebase** - **Code Quality**: I evaluated the code for maintainability, readability, and...
3,546
[ { "from": "human", "value": "I'm sure you have all been there, you take on a project where there is a creaky old code base which is barely fit for purpose and you have to make the decision to either re-write it from scratch or repair what already exists. \nConventional wisdom tends to suggest that you shou...
We generate web pages that should always be printed in landscape mode. Web browser print dialogs default to portrait, so for every print job the user has to manually select landscape. It's minor, but would be nice for the user if we can remove this unnecessary step. Thanks in advance to all respondents.
To suggest a workaround for forcing print layouts to landscape mode in web pages, you can use CSS styles. While web browsers typically rely on user preferences, you can hint the browser to use landscape by utilizing a `@media print` rule within your CSS. Here’s a method to specify that your content should be printed i...
5,171
[ { "from": "human", "value": "We generate web pages that should always be printed in landscape mode. Web browser print dialogs default to portrait, so for every print job the user has to manually select landscape. It's minor, but would be nice for the user if we can remove this unnecessary step. \nThanks in...
What data structures would you use to represent a chessboard for a computer chess program?
Representing a chessboard for a computer chess program can be accomplished using various data structures, each with its own advantages and trade-offs. Here are some commonly used approaches: ### 1. **2D Array (Matrix)**: - **Structure**: A simple 8x8 array where each element represents a square on the chessboard. - **...
1,046
[ { "from": "human", "value": "What data structures would you use to represent a chessboard for a computer chess program?\n" }, { "from": "gpt", "value": "Representing a chessboard for a computer chess program can be accomplished using various data structures, each with its own advantages and trad...
It seems that Microsoft wants Silverlight to take off, yet I cannot find an easy way to develop in it without buying Visual Studio 2008. Has anyone out there found a way to get the silverlight development environment in the express editions of Visual Studio? Any other tools?
As of my last update, Microsoft Silverlight has been largely deprecated and is no longer actively developed or supported. However, during its peak, it was indeed possible to develop Silverlight applications using the Express Editions of Visual Studio, specifically Visual Web Developer Express. Here are some options th...
8,156
[ { "from": "human", "value": "It seems that Microsoft wants Silverlight to take off, yet I cannot find an easy way to develop in it without buying Visual Studio 2008. Has anyone out there found a way to get the silverlight development environment in the express editions of Visual Studio? Any other tools?\n" ...
I would like to test out the new SP1 in my development server and then install it for my production server. But I wonder what it had enhance to the ASP.NET portion specifically as that is where my concerns are. I read the docs found in the SP1 Download page but it seens a bit too general to me, not much on the ASP.NE ...
Service Pack 1 (SP1) for .NET Framework often includes various enhancements and fixes, particularly aimed at ASP.NET. While the specific details may vary depending on the version of the .NET Framework you are referring to, generally, the enhancements for ASP.NET in SP1 typically include the following areas: 1. **Perfo...
8,130
[ { "from": "human", "value": "I would like to test out the new SP1 in my development server and then install it for my production server. But I wonder what it had enhance to the ASP.NET portion specifically as that is where my concerns are. \nI read the docs found in the SP1 Download page but it seens a bit ...
I'm teaching myself Python and my most recent lesson was that Python is not Java, and so I've just spent a while turning all my Class methods into functions. I now realise that I don't need to use Class methods for what I would done with static methods in Java, but now I'm not sure when I would use them. All the advic...
Absolutely! It can be confusing when coming from a Java background, but class methods in Python serve their own specific purpose. Let's clarify when and how to use class methods effectively. ### What are Class Methods? In Python, class methods are methods that are bound to the class rather than its instance. This mea...
5,462
[ { "from": "human", "value": "I'm teaching myself Python and my most recent lesson was that Python is not Java, and so I've just spent a while turning all my Class methods into functions.\nI now realise that I don't need to use Class methods for what I would done with static methods in Java, but now I'm not ...
I've had to install MbUnit multiple times now and it keeps coming with something called the Gallilo Icarus GUI Test Runner I have tried using it thinking it was just an update to the MbUnit GUI but it won't detect my MbUnit tests and sometimes won't even open the assemblies properly. Perhaps I'm just overlooking it but...
MbUnit is part of the Gallio testing platform, which encompasses a broader range of testing capabilities beyond just the original MbUnit framework. The transition from MbUnit to Gallio means that Gallio has incorporated not only the features of MbUnit but also additional testing features and a new graphical user interf...
7,427
[ { "from": "human", "value": "I've had to install MbUnit multiple times now and it keeps coming with something called the\nGallilo Icarus GUI Test Runner\nI have tried using it thinking it was just an update to the MbUnit GUI but it won't detect my MbUnit tests and sometimes won't even open the assemblies pr...
I've got some (C#) code that relies on today's date to correctly calculate things in the future. If I use today's date in the testing, I have to repeat the calculation in the test, which doesn't feel right. What's the best way to set the date to a known value within the test so that I can test that the result is a know...
Testing code that relies on the current date can indeed be challenging, as it introduces non-determinism into your tests. To solve this, you can use dependency injection, mocking, or a simple abstraction to control the current date in your tests. Here's how you can do it: ### 1. Abstract the Date Provider Create a da...
6,745
[ { "from": "human", "value": "I've got some (C#) code that relies on today's date to correctly calculate things in the future. If I use today's date in the testing, I have to repeat the calculation in the test, which doesn't feel right. What's the best way to set the date to a known value within the test so ...
I want to convert a primitive to a string, and I tried: myInt.toString(); This fails with the error: int cannot be dereferenced Now, I get that primitives are not reference types (ie, not an Object) and so cannot have methods. However, Java 5 introduced autoboxing and unboxing (a la C#... which I never liked in C#, ...
In Java, the issue you're encountering arises from the fact that the `int` primitive type does not have methods, and while autoboxing is indeed a feature of Java (introduced in Java 5), it does not work the way you might expect in this case. Let's break down the key points to understand why your call to `myInt.toString...
5,173
[ { "from": "human", "value": "I want to convert a primitive to a string, and I tried:\nmyInt.toString();\n\nThis fails with the error:\nint cannot be dereferenced\n\nNow, I get that primitives are not reference types (ie, not an Object) and so cannot have methods. However, Java 5 introduced autoboxing and u...
This is a pretty simple question, at least it seems like it should be, about sudo permissions in Linux. There are a lot of times when I just want to append something to /etc/hosts or a similar file but end up not being able to because both > and >> are not allowed, even with root. Is there someway to make this work wit...
Yes, appending content to a file like `/etc/hosts` with `sudo` can be a bit tricky due to how shell redirection works. When you use `sudo`, it only applies to the command itself, not to the redirection. Therefore, a command like: ```bash sudo echo "127.0.0.1 example.com" >> /etc/hosts ``` doesn't work because the `>>...
4,486
[ { "from": "human", "value": "This is a pretty simple question, at least it seems like it should be, about sudo permissions in Linux.\nThere are a lot of times when I just want to append something to /etc/hosts or a similar file but end up not being able to because both > and >> are not allowed, even with ro...
Help me ..my page index is not working in visual studio. my page load is as follows: protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { CustomerView.DataSource = Customer.GetAll(); CustomerView.DataBind(); } ...
The issue with your `CustomerView_PageIndexChanging` event handler lies in the fact that you are not setting the new page index before you call `DataBind()`. The `GridView` control needs to be told what page it should be displaying, which is done by setting the `PageIndex` property. Here’s how you can fix it: 1. Set ...
7,094
[ { "from": "human", "value": "Help me ..my page index is not working in visual studio.\nmy page load is as follows:\nprotected void Page_Load(object sender, EventArgs e)\n {\n if (!Page.IsPostBack)\n {\n CustomerView.DataSource = Customer.GetAll();\n ...
I am having problems getting text within a table to appear centered in IE. In Firefox 2, 3 and Safari everything work fine, but for some reason, the text doesn't appear centered in IE 6 or 7. I'm using: h2 { font: 300 12px "Helvetica", serif; text-align: center; text-transform: uppercase; } I've also tried a...
When you're dealing with centering text within a table in Internet Explorer (IE) 6 or 7, there are a few key points and potential issues to consider. IE has specific quirks that often require additional styling or different approaches to achieve the same results seen in other browsers. Here are some strategies you can...
4,837
[ { "from": "human", "value": "I am having problems getting text within a table to appear centered in IE. \nIn Firefox 2, 3 and Safari everything work fine, but for some reason, the text doesn't appear centered in IE 6 or 7. \nI'm using:\nh2 {\n font: 300 12px \"Helvetica\", serif; \n text-align: center; \n...
What is the best method for executing FTP commands from a SQL Server stored procedure? we currently use something like this: EXEC master..xp_cmdshell 'ftp -n -s:d:\ftp\ftpscript.xmt 172.1.1.1' The problem is that the command seems to succeed even if the FTP ended in error. Also, the use of xp_cmdshell requires special...
Using `xp_cmdshell` to execute FTP commands directly from a SQL Server stored procedure is indeed a common approach, but it does have its drawbacks, as you've noted. There are a few alternatives and improvements you can consider: ### 1. Use a More Robust FTP Client Instead of relying on `xp_cmdshell`, you might want ...
5,181
[ { "from": "human", "value": "What is the best method for executing FTP commands from a SQL Server stored procedure? we currently use something like this:\nEXEC master..xp_cmdshell 'ftp -n -s:d:\\ftp\\ftpscript.xmt 172.1.1.1'\n\nThe problem is that the command seems to succeed even if the FTP ended in error....
So I got this question from one of the developers in my team: What is domain driven design? I could of course point to the book from Evans but is that actually an answer? How would you explain DDD in a few sentences to junior software engineers in your team?
Domain-Driven Design (DDD) is an approach to software development that emphasizes collaboration between technical and domain experts to create a shared understanding of the problem space. At its core, DDD focuses on modeling the software based on the domain—essentially, the area of knowledge or business activity the ap...
10,264
[ { "from": "human", "value": "So I got this question from one of the developers in my team: What is domain driven design? I could of course point to the book from Evans but is that actually an answer? \nHow would you explain DDD in a few sentences to junior software engineers in your team?\n" }, { "f...
When trying to implement an asynchronous API calls / Non-blocking calls, I know a little in a All Plain-C application I have, I read a about APM (Asynchronous Programming Model) by 'Delegates'. Basically what I want to do is call one API f1() to do a functionality(which takes long time 8-10 seconds), So I call that API...
The Asynchronous Programming Model (APM) using delegates in C# is one way to implement non-blocking calls, but there are newer and more straightforward alternatives available, such as the Task-based Asynchronous Pattern (TAP) using `async` and `await`. In this response, I’ll provide an overview of both APM and TAP, alo...
3,496
[ { "from": "human", "value": "When trying to implement an asynchronous API calls / Non-blocking calls, I know a little in a All Plain-C application I have, I read a about APM (Asynchronous Programming Model) by 'Delegates'. Basically what I want to do is call one API f1() to do a functionality(which takes lo...
Most of the MVC samples I have seen pass an instance of the view to the controller like this public class View { Controller controller = new Controller(this); } Is there any advantage to passing a class which provides access to just the the properties and events the controller is interested in, like this: publi...
Yes, there are several advantages to using a wrapper class like `UIWrapper` that restricts access to only the properties and events the controller is interested in, as opposed to passing the entire view directly to the controller. Here are some of the key benefits: 1. **Encapsulation**: By using a wrapper, you encapsu...
7,451
[ { "from": "human", "value": "Most of the MVC samples I have seen pass an instance of the view to the controller like this\npublic class View \n{ \nController controller = new Controller(this); \n}\n\nIs there any advantage to passing a class which provides access to just the the properties and events th...
What are the advantages/disadvantages between MS VS C++ 6.0 and MSVS C++ 2008? The main reason for asking such a question is that there are still many decent programmers that prefer using the older version instead of the newest version. Is there any reason the might prefer the older over the new?
When comparing Microsoft Visual Studio C++ 6.0 (MS VC++ 6.0) and Microsoft Visual Studio C++ 2008 (MS VC++ 2008), several advantages and disadvantages arise based on various aspects such as features, performance, compatibility, and developer preferences. Here’s a breakdown of some of these factors: ### Advantages of M...
3,513
[ { "from": "human", "value": "What are the advantages/disadvantages between MS VS C++ 6.0 and MSVS C++ 2008? \nThe main reason for asking such a question is that there are still many decent programmers that prefer using the older version instead of the newest version.\nIs there any reason the might prefer th...
Is the return value of GetHashCode() guaranteed to be consistent assuming the same string value is being used? (C#/ASP.NET) I uploaded my code to a server today and to my surprise I had to reindex some data because my server (win2008 64-bit) was returning different values compared to my desktop computer.
In C#, the `GetHashCode()` method is not guaranteed to return the same hash code across different executions of an application, different versions of the .NET framework, or different machines. This means that the same string may produce different hash code values when processed in different environments or even in diff...
5,796
[ { "from": "human", "value": "Is the return value of GetHashCode() guaranteed to be consistent assuming the same string value is being used? (C#/ASP.NET)\nI uploaded my code to a server today and to my surprise I had to reindex some data because my server (win2008 64-bit) was returning different values compa...
I try to externalize all strings (and other constants) used in any application I write, for many reasons that are probably second-nature to most stack-overflowers, but one thing I would like to have is the ability to automate spell checking of any user-visible strings. This poses a couple problems: Not all strings ar...
Automating spell checking for user-visible strings in software applications is a great way to catch potential typos and improve the quality of your user interfaces. Here are some strategies to implement a spell-checking process effectively while addressing the challenges you've mentioned: ### 1. **Separate User-Visibl...
4,402
[ { "from": "human", "value": "I try to externalize all strings (and other constants) used in any application I write, for many reasons that are probably second-nature to most stack-overflowers, but one thing I would like to have is the ability to automate spell checking of any user-visible strings. This pos...
The Visual Studio compiler does not seem to warn on signed/unsigned assignments, only on comparisons. For example the code below will generate a warning on the if statement but not the initial assignments. Is there anyway to make it catch these? I'm already at W4 but thought (hoped) there may be another setting somewhe...
Yes, you're correct! The Visual Studio compiler does not issue warnings for signed/unsigned mismatches during assignments by default, even at warning level W4. However, it does provide a way to enable these warnings explicitly using a `#pragma` directive. Specifically, you can enable warning C4365, which is related to...
6,845
[ { "from": "human", "value": "The Visual Studio compiler does not seem to warn on signed/unsigned assignments, only on comparisons. For example the code below will generate a warning on the if statement but not the initial assignments.\nIs there anyway to make it catch these? I'm already at W4 but thought (h...
I'm looking for suggestions on how to debug and chase down deadlock issues in an SQL Server 2000 database. I've had it recommended to me to use trace flags 1024 and 3605, which I have found give me the following: 1024 - this trace flag returns the type of locks participating in the deadlock and the current command aff...
Debugging deadlocks in SQL Server 2000 can be a complex task, but with the right approach, you can uncover the underlying issues and implement solutions effectively. Here are some additional strategies and tips to help you in this process, along with your plan to use trace flags 1024 and 3605: ### 1. **Use Trace Flags...
3,707
[ { "from": "human", "value": "I'm looking for suggestions on how to debug and chase down deadlock issues in an SQL Server 2000 database. I've had it recommended to me to use trace flags 1024 and 3605, which I have found give me the following:\n1024 - this trace flag returns the type of locks participating i...
Possible Duplicates: Learn Obj-C Memory Management Where are the best explanations of memory management for iPhone? I come from a C/C++ background and the dynamic nature of Objective-C is somewhat foreign to me, is there a good resource anyone can point me to for some basic memory management techniques in Objective-...
Welcome to Objective-C! It can indeed feel quite different from C/C++, especially with its memory management model. Here are some resources and explanations that should help you get started with memory management in Objective-C. ### Basic Memory Management Concepts 1. **Reference Counting**: Objective-C primarily use...
6,929
[ { "from": "human", "value": "\nPossible Duplicates:\nLearn Obj-C Memory Management\nWhere are the best explanations of memory management for iPhone? \n\nI come from a C/C++ background and the dynamic nature of Objective-C is somewhat foreign to me, is there a good resource anyone can point me to for some ba...
I have several applications that are part of a suite of tools that various developers at our studio use. these applications are mainly command line apps that open a DOS cmd shell. These apps in turn start up a GUI application that tracks output and status (via sockets) of these command line apps. The command line app...
It sounds like you're dealing with a complex environment where command-line applications interact with a GUI, and you want to manage the visibility of that GUI based on the user's session state. To determine whether a user’s desktop is visible (i.e., whether the session is locked or if they are logged out), you can use...
6,109
[ { "from": "human", "value": "I have several applications that are part of a suite of tools that various developers at our studio use. these applications are mainly command line apps that open a DOS cmd shell. These apps in turn start up a GUI application that tracks output and status (via sockets) of thes...
I have some code documentation in MS Powerpoint 2003 that I'm revision-controlling in an SVN repository. I'd like to auto-insert the latest revision number into this document whenever I open it. I am using TortoiseSVN. I've been able to google up a macro or two that might work but wanted advice from experts. :) Thanks!...
To automatically insert the latest SVN revision number into your PowerPoint 2003 document using a macro, you can follow these steps: 1. **Install TortoiseSVN**: Ensure that you have TortoiseSVN installed and that it is properly configured to work with your SVN repository. 2. **Create a Macro**: Open your PowerPoint 2...
3,400
[ { "from": "human", "value": "I have some code documentation in MS Powerpoint 2003 that I'm revision-controlling in an SVN repository. I'd like to auto-insert the latest revision number into this document whenever I open it. I am using TortoiseSVN. I've been able to google up a macro or two that might work b...
I will elaborate somewhat. Jsf is kind-of extremely painful for working with from designer's perspective, somewhat in the range of trying to draw a picture while having hands tied at your back, but it is good for chewing up forms and listing lots of data. So sites we are making in my company are jsf admin pages and jsp...
Integrating JSP and JSF can indeed pose challenges, especially when trying to share state and manage the lifecycle of beans effectively. Here are some strategies you can consider to achieve your goal of initializing a JSF session bean from a JSP page: ### 1. Use a Request Parameter You can pass parameters from your J...
5,622
[ { "from": "human", "value": "I will elaborate somewhat. Jsf is kind-of extremely painful for working with from designer's perspective, somewhat in the range of trying to draw a picture while having hands tied at your back, but it is good for chewing up forms and listing lots of data. So sites we are making ...
If you were to self-fund a software project which tools, frameworks, components would you employ to ensure maximum productivity for the dev team and that the "real" problem is being worked on. What I'm looking for are low friction tools which get the job done with a minimum of fuss. Tools I'd characterize as such are S...
When self-funding a software project, especially with an emphasis on maximizing productivity and minimizing friction for the development team, it's essential to select tools and frameworks that streamline workflows and address common challenges in software development. Below are some suggestions across various categori...
2,922
[ { "from": "human", "value": "If you were to self-fund a software project which tools, frameworks, components would you employ to ensure maximum productivity for the dev team and that the \"real\" problem is being worked on.\nWhat I'm looking for are low friction tools which get the job done with a minimum o...
I'm writing a web app that points to external links. I'm looking to create a non-sequential, non-guessable id for each document that I can use in the URL. I did the obvious thing: treating the url as a string and str#crypt on it, but that seems to choke on any non-alphanumberic characters, like the slashes, dots and un...
Creating a non-sequential, non-guessable ID for each document that can be used in a URL is a common requirement in web development. Here are a few approaches you can consider: ### 1. UUIDs (Universally Unique Identifiers) UUIDs are a great option for generating unique identifiers. They are 128-bit values and can be ge...
6,616
[ { "from": "human", "value": "I'm writing a web app that points to external links. I'm looking to create a non-sequential, non-guessable id for each document that I can use in the URL. I did the obvious thing: treating the url as a string and str#crypt on it, but that seems to choke on any non-alphanumberic ...
I installed MySQL via MacPorts. What is the command I need to stop the server (I need to test how my application behave when MySQL is dead)?
If you installed MySQL via MacPorts, you can stop the MySQL server using the following command in your terminal: ```bash sudo port unload mysql57-server ``` Replace `mysql57-server` with the specific version of MySQL you installed (e.g., `mysql80-server` for MySQL 8.0). To check which version of MySQL is installed,...
10,062
[ { "from": "human", "value": "I installed MySQL via MacPorts. What is the command I need to stop the server (I need to test how my application behave when MySQL is dead)?\n" }, { "from": "gpt", "value": "If you installed MySQL via MacPorts, you can stop the MySQL server using the following comman...
Is it possible to actually make use of placement new in portable code when using it for arrays? It appears that the pointer you get back from new[] is not always the same as the address you pass in (5.3.4, note 12 in the standard seems to confirm that this is correct), but I don't see how you can allocate a buffer for ...
You've stumbled upon a common issue when using placement `new[]` with dynamically allocated arrays in C++. The problem arises from the fact that different compilers and even different configurations within the same compiler may impose different alignment and overhead requirements when managing arrays. The overhead ofte...
1,783
[ { "from": "human", "value": "Is it possible to actually make use of placement new in portable code when using it for arrays?\nIt appears that the pointer you get back from new[] is not always the same as the address you pass in (5.3.4, note 12 in the standard seems to confirm that this is correct), but I do...
I have a div with two images and an h1. All of them need to be vertically aligned within the div, next to each other. One of the images needs to be absolute positioned within the div. What is the CSS needed for this to work on all common browsers? <div id="header"> <img src=".." ></img> <h1>testing...</h1> <img s...
To achieve the layout you're describing, you'll need to use CSS Flexbox for vertical alignment of the items within the `div`, and you can use relative positioning for the parent `div` and absolute positioning for the image that you want to position absolutely. Here's a simple example of how you can structure your CSS:...
8,233
[ { "from": "human", "value": "I have a div with two images and an h1. All of them need to be vertically aligned within the div, next to each other. One of the images needs to be absolute positioned within the div.\nWhat is the CSS needed for this to work on all common browsers?\n<div id=\"header\">\n <img s...
I have a table with a "Date" column. Each Date may appear multiple times. How do I select only the dates that appear < k number of times?
To select dates that appear less than `k` times in a table with a "Date" column, you can use SQL with a `GROUP BY` clause along with a `HAVING` clause. Here’s a general way to do it: Assuming your table is named `your_table` and `k` is a placeholder for the maximum number of occurrences you want to consider, you can u...
8,542
[ { "from": "human", "value": "I have a table with a \"Date\" column. Each Date may appear multiple times. How do I select only the dates that appear < k number of times?\n" }, { "from": "gpt", "value": "To select dates that appear less than `k` times in a table with a \"Date\" column, you can u...
I've had to do some introspection in python and it wasn't pretty: name = sys._getframe(1).f_code name = "%s:%d %s()" %(os.path.split(name.co_filename)[1],name.co_firstlineno,name.co_name) To get something like foo.py:22 bar() blah blah In our debugging output. I'd ideally like to prepend anything to stderr with this ...
Yes, it is possible to change the behavior of `print` globally in Python, but it's often done by creating a custom print function and overriding the built-in `print` function with it. Here's how you could implement a custom print function that prepends your desired debugging information to the standard error output. ...
7,076
[ { "from": "human", "value": "I've had to do some introspection in python and it wasn't pretty:\nname = sys._getframe(1).f_code\nname = \"%s:%d %s()\" %(os.path.split(name.co_filename)[1],name.co_firstlineno,name.co_name)\n\nTo get something like\nfoo.py:22 bar() blah blah\n\nIn our debugging output.\nI'd id...
Was this an oversight? Or is it to do with the JVM?
To provide a meaningful answer, I need a bit more context regarding what specific situation or issue you're referring to as an "oversight" and how it may relate to the JVM (Java Virtual Machine). Could you please elaborate on the specific scenario or problem you're discussing?
10,986
[ { "from": "human", "value": "Was this an oversight? Or is it to do with the JVM?\n" }, { "from": "gpt", "value": "To provide a meaningful answer, I need a bit more context regarding what specific situation or issue you're referring to as an \"oversight\" and how it may relate to the JVM (Java V...
I've got an open-source app that is hosted at code.google.com. It is cross platform ( Linux / Windows / Mac ). I uploaded the code initially from a WinXP machine using TortoiseSVN and it seems that none of the "configure" batch files that are used for the linux build have their "execute" bits set. What would be the ea...
To set the execute permission bits for files in a repository that you've uploaded from Windows (where the execute bit cannot be set), you can do so using the command line on your Linux machine. TortoiseSVN does not provide a direct way to set execute bits for files across all platforms. Here’s how you can do it using t...
8,049
[ { "from": "human", "value": "I've got an open-source app that is hosted at code.google.com. It is cross platform ( Linux / Windows / Mac ). I uploaded the code initially from a WinXP machine using TortoiseSVN and it seems that none of the \"configure\" batch files that are used for the linux build have thei...
Is it possible to generate PDF Documents in an Adobe AIR application without resorting to a round trip web service for generating the PDF? I've looked at the initial Flex Reports on GoogleCode but it requires a round trip for generating the actual PDF. Given that AIR is supposed to be the Desktop end for RIAs is there ...
Yes, it is possible to generate PDF documents in an Adobe AIR application without relying on a round-trip web service. While Adobe AIR does not have built-in support for PDF generation like some other platforms do, there are some approaches you can take to accomplish this on the client side. ### Options for PDF Genera...
6,562
[ { "from": "human", "value": "Is it possible to generate PDF Documents in an Adobe AIR application without resorting to a round trip web service for generating the PDF? I've looked at the initial Flex Reports on GoogleCode but it requires a round trip for generating the actual PDF.\nGiven that AIR is suppose...
I have a problem with a little .Net web application which uses the Amazon webservice. With the integrated Visual Studio web server everything works fine. But after deploying it to the IIS on the same computer i get the following error message: Ein Verbindungsversuch ist fehlgeschlagen, da die Gegenstelle nach einer bes...
It seems like your .NET application is trying to connect to a service at `192.168.123.254:8080`, which is being blocked due to a proxy configuration that was left over from previous Active Directory settings. Here are some steps you can take to diagnose and potentially resolve this issue: ### 1. Check the Application ...
2,948
[ { "from": "human", "value": "I have a problem with a little .Net web application which uses the Amazon webservice. With the integrated Visual Studio web server everything works fine. But after deploying it to the IIS on the same computer i get the following error message:\nEin Verbindungsversuch ist fehlges...
I've read https://stackoverflow.com/questions/41354/is-the-stackoverflow-login-situation-bearable and must agree to a certain point that openid (for me) makes it more difficult to log in. Not a show stoper but I'm used to opening the front page of the site, there's a small login form, firefox' password manager already ...
It sounds like you're looking for ways to streamline the OpenID login process on Stack Overflow and make it feel as seamless as your previous experience with standard username/password logins. While OpenID does add some complexity, there are a few strategies and tools you might consider to simplify your workflow: 1. *...
5,884
[ { "from": "human", "value": "I've read https://stackoverflow.com/questions/41354/is-the-stackoverflow-login-situation-bearable and must agree to a certain point that openid (for me) makes it more difficult to log in. Not a show stoper but I'm used to opening the front page of the site, there's a small login...
For various reasons, such as cookies, SEO, and to keep things simple, I would like to make apache automatically redirect any requests for http://www.foobar.com/anything to http://foobar.com/anything. The best I could come up with is a mod_rewrite-based monstrosity, is there some easy simple way to tell it "Redirect all...
Yes, you can achieve a simple redirect from `http://www.foobar.com/anything` to `http://foobar.com/anything` using Apache's `mod_alias` module, which is simpler than using `mod_rewrite`. You can add the following lines to your Apache configuration file (such as `httpd.conf` or your site's `.htaccess` file): ```apache ...
6,761
[ { "from": "human", "value": "For various reasons, such as cookies, SEO, and to keep things simple, I would like to make apache automatically redirect any requests for http://www.foobar.com/anything to http://foobar.com/anything. The best I could come up with is a mod_rewrite-based monstrosity, is there some...
I have a windows service that runs various system monitoring operations. However, when running SNMP related checks, I always get a NullReference exception. The code runs fine when run through the user interface (under my username and password), but always errors running as the service. I've tried running the servi...
The `NullReferenceException` you’re encountering when running your Windows service to perform SNMP operations can arise due to several reasons, especially when the service runs under a different context compared to a user-interactive application. Here are some potential causes and solutions you can explore: 1. **Permi...
6,830
[ { "from": "human", "value": "I have a windows service that runs various system monitoring operations. However, when running SNMP related checks, I always get a NullReference exception. \nThe code runs fine when run through the user interface (under my username and password), but always errors running as t...
Is a Star-Schema design essential to a data warehouse? Or can you do data warehousing with another design pattern?
A Star Schema design is a popular and effective method for organizing data in a data warehouse, but it is not the only design pattern available. While Star Schemas are often preferred for their simplicity and ease of understanding, particularly for OLAP (Online Analytical Processing) systems, there are several other de...
8,193
[ { "from": "human", "value": "Is a Star-Schema design essential to a data warehouse? Or can you do data warehousing with another design pattern?\n" }, { "from": "gpt", "value": "A Star Schema design is a popular and effective method for organizing data in a data warehouse, but it is not the only...
How do you programmatically retrieve the name of a shared services provider that's associated with a specific Sharepoint web application? I have a custom solution that needs to: Enumerate all web applications that it's deployed to Figure out the Shared Services provider that each of the web applications is associated ...
To programmatically retrieve the name of the Shared Services Provider (SSP) associated with a specific SharePoint web application, you will need to leverage the SharePoint object model. Below is a step-by-step guide on how to achieve this. ### Step 1: Access the SPWebApplication Object First, you need to get a refere...
6,606
[ { "from": "human", "value": "How do you programmatically retrieve the name of a shared services provider that's associated with a specific Sharepoint web application?\nI have a custom solution that needs to:\n\nEnumerate all web applications that it's deployed to\nFigure out the Shared Services provider tha...
I have a .NET assembly that contains classes to be registered as ServicedComponent through EnterpriseServices (COM+) and invoked through COM RPC by a third-party application. Therefore, I need to both add it to the GAC and add a registry entry under HKEY_CLASSES_ROOT\CLSID\{clsid}\CodeBase with the path to the assembl...
In Windows Installer, there are several properties that can be used to refer to paths and locations, including the Global Assembly Cache (GAC). However, the GAC itself doesn't have a direct property that you can use to reference its path. Here are a few points to consider: 1. **GAC Path**: The GAC for 32-bit assembli...
6,707
[ { "from": "human", "value": "I have a .NET assembly that contains classes to be registered as ServicedComponent through EnterpriseServices (COM+) and invoked through COM RPC by a third-party application. Therefore, I need to both add it to the GAC and add a registry entry under HKEY_CLASSES_ROOT\\CLSID\\{c...
How do I fix a broken debugger, one that just won't start, in EclipseME (now Mobile Tools Java)? (This question has an answer which will be transferred from another question soon)
If you're experiencing issues with a broken debugger in EclipseME (now known as Mobile Tools for Java), here are some troubleshooting steps you can take to try to resolve the problem: 1. **Check Installation**: Make sure that EclipseME or Mobile Tools for Java is properly installed. If not, reinstall the plugin. 2. *...
5,812
[ { "from": "human", "value": "How do I fix a broken debugger, one that just won't start, in EclipseME (now Mobile Tools Java)?\n(This question has an answer which will be transferred from another question soon)\n" }, { "from": "gpt", "value": "If you're experiencing issues with a broken debugger ...
Does anyone know a keyboard shortcut to close all tabs except for the current one in Visual Studio? And while we're at it, the shortcut for closing all tabs? Is there a Resharper option for this? I've looked in the past and have never been able to find it.
In Visual Studio, there are keyboard shortcuts for managing tabs, but they may not be set by default. Here are the keyboard shortcuts you can use: 1. **Close All Tabs Except Current**: Unfortunately, Visual Studio does not have a built-in keyboard shortcut for closing all tabs except the current one. However, you can ...
9,391
[ { "from": "human", "value": "Does anyone know a keyboard shortcut to close all tabs except for the current one in Visual Studio? And while we're at it, the shortcut for closing all tabs? Is there a Resharper option for this? I've looked in the past and have never been able to find it. \n" }, { "from...
I usually store my connectionstring in web.config or in the application settings of my Visual Studio project. The application I'm currently working on makes a lot of trips to the database which means it will look up the connectionstring every time. Should I be putting the connectionstring in the cache or should I be lo...
You're right that the best practice is typically to store the connection string in a configuration file (like `web.config`) for easy management and security. However, when it comes to managing the database connections themselves, there are some important considerations. ### Caching the Connection String Storing the co...
5,470
[ { "from": "human", "value": "I usually store my connectionstring in web.config or in the application settings of my Visual Studio project. The application I'm currently working on makes a lot of trips to the database which means it will look up the connectionstring every time. Should I be putting the connec...
What application should I use for creating Flash animations for a website?
While Adobe Flash has been widely used for creating animations, it has been largely discontinued as of December 2020. Modern web standards favor HTML5, CSS3, and JavaScript for animations. Here are some popular applications and tools you can use to create animations for websites: 1. **Adobe Animate**: The successor to...
9,624
[ { "from": "human", "value": "What application should I use for creating Flash animations for a website?\n" }, { "from": "gpt", "value": "While Adobe Flash has been widely used for creating animations, it has been largely discontinued as of December 2020. Modern web standards favor HTML5, CSS3, a...
Currently I have two Linux servers running MySQL, one sitting on a rack right next to me under a 10 Mbit/s upload pipe (main server) and another some couple of miles away on a 3 Mbit/s upload pipe (mirror). I want to be able to replicate data on both servers continuously, but have run into several roadblocks. One of th...
What you're experiencing is a common challenge in managing MySQL replication, especially across servers with different bandwidth capacities and potential interruptions. Here are some potential solutions and strategies to help address the replication issues you face: ### 1. **Use Semi-Synchronous Replication** Instead...
3,204
[ { "from": "human", "value": "Currently I have two Linux servers running MySQL, one sitting on a rack right next to me under a 10 Mbit/s upload pipe (main server) and another some couple of miles away on a 3 Mbit/s upload pipe (mirror).\nI want to be able to replicate data on both servers continuously, but h...
I'm writing a program that sends an email out at a client's specific local time. I have a .NET method that takes a timezone & time and destination timezone and returns the time in that timezone. So my method is to select every distinct timezone in the database, check if it is the correct time using the method, then sel...
In general, both of your provided SQL queries are functionally equivalent and will return the same result set. However, there are some performance and readability considerations you might want to keep in mind. ### Performance Comparison 1. **Using `IN`:** ```sql SELECT email FROM tClient WHERE timezoneID in (1,...
3,831
[ { "from": "human", "value": "I'm writing a program that sends an email out at a client's specific local time. I have a .NET method that takes a timezone & time and destination timezone and returns the time in that timezone. So my method is to select every distinct timezone in the database, check if it is th...
Okay, I've looked all over the internet for a good solution to get PHP and MySQL working on IIS7.0. It's nearly impossible, I've tried it so many times and given up in vain. Please please help by linking some great step-by-step tutorial to adding PHP and MySQL on IIS7.0 from scratch. PHP and MySQL are essential for ins...
Setting up PHP and MySQL on IIS 7.0 can be a bit challenging, but it’s definitely doable! Here's a step-by-step guide to help you install and configure PHP and MySQL on IIS 7.0. ### Step 1: Install IIS 7.0 1. **Enable IIS on Windows:** - Go to **Control Panel > Programs > Turn Windows features on or off**. - Che...
3,043
[ { "from": "human", "value": "Okay, I've looked all over the internet for a good solution to get PHP and MySQL working on IIS7.0. It's nearly impossible, I've tried it so many times and given up in vain. Please please help by linking some great step-by-step tutorial to adding PHP and MySQL on IIS7.0 from scr...
I write my app in VS 2008 and so use all the fanciful stuffs such as LINQ, object initializers etc. Now can my app run on machines that have only .Net 2.0 runtime, but no .Net 3.5 runtime? .Net 3.5 runtime is a huge download, as all of you might know.
No, your application that uses features from .NET 3.5, such as LINQ and object initializers, will not run on machines that only have the .NET 2.0 runtime installed. The features you are utilizing are not backward compatible with the .NET 2.0 runtime; they are part of the enhancements introduced in .NET 3.5. If you nee...
9,661
[ { "from": "human", "value": "I write my app in VS 2008 and so use all the fanciful stuffs such as LINQ, object initializers etc. Now can my app run on machines that have only .Net 2.0 runtime, but no .Net 3.5 runtime? .Net 3.5 runtime is a huge download, as all of you might know.\n" }, { "from": "gp...
At the beginning of all my executable Python scripts I put the shebang line: #!/usr/bin/env python I'm running these scripts on a system where env python yields a Python 2.2 environment. My scripts quickly fail because I have a manual check for a compatible Python version: if sys.version_info < (2, 4): raise Impor...
A common issue arises when the default `python` interpreter points to an older version, such as Python 2.2, and you require at least Python 2.4 for your scripts. Since you want to maintain the shebang line as-is while avoiding the need for user intervention or administrative privileges to modify the environment, you ca...
4,186
[ { "from": "human", "value": "At the beginning of all my executable Python scripts I put the shebang line:\n#!/usr/bin/env python\n\nI'm running these scripts on a system where env python yields a Python 2.2 environment. My scripts quickly fail because I have a manual check for a compatible Python version:\n...
We create new sites in IIS 6 (Windows Server 2003) using IIS Manager. When these sites are created in IIS 6, the ASP.NET version defaults to ASP.NET 1.1. We would like it to default to ASP.NET 2.0. The reason this is a problem for us is that when you take any site on the server and switch the ASP.NET version from AS...
In IIS 6 (Windows Server 2003), the default ASP.NET version for newly created sites can be a hassle when it defaults to ASP.NET 1.1. Unfortunately, there is no direct setting in the IIS metabase that allows you to change the default version of ASP.NET for new sites. However, you can use a script to automate the creatio...
6,386
[ { "from": "human", "value": "We create new sites in IIS 6 (Windows Server 2003) using IIS Manager. When these sites are created in IIS 6, the ASP.NET version defaults to ASP.NET 1.1. We would like it to default to ASP.NET 2.0. The reason this is a problem for us is that when you take any site on the serv...
I'd rather not have to resort to calling the command line. I'm looking for code that can map/disconnect a drive, while also having exception handling. Any ideas?
Certainly! If you're looking to map and disconnect network drives in a Windows environment using Python, you can use the `os` module along with the `ctypes` library to handle drive mapping. You can also use exception handling to manage any errors that arise during this process. Below are examples for both mapping and d...
5,587
[ { "from": "human", "value": "I'd rather not have to resort to calling the command line.\nI'm looking for code that can map/disconnect a drive, while also having exception handling.\nAny ideas?\n" }, { "from": "gpt", "value": "Certainly! If you're looking to map and disconnect network drives in a...
In my previous question, most commenters agreed that having validation logic both at client & server sides is a good thing. However there is a problem - you need to keep your validation rules in sync between database and client code. So the question is, how can we deal with it? One approach is to use ORM techniques, mo...
Keeping validation rules in sync between client and server is a common challenge in software development, but it's also a crucial part of ensuring data integrity and providing a good user experience. Here are several approaches you can consider, along with their pros and cons: ### 1. **Use of ORM for Validation** Mode...
684
[ { "from": "human", "value": "In my previous question, most commenters agreed that having validation logic both at client & server sides is a good thing.\nHowever there is a problem - you need to keep your validation rules in sync between database and client code.\nSo the question is, how can we deal with it...
How do you determine the collation of a database in SQL 2005, for instance if you need to perform a case-insensitive search/replace?
In SQL Server 2005, the collation of a database determines how string comparison is performed, including case sensitivity and accent sensitivity. To determine the collation of a database, you can use the following SQL query: ```sql SELECT DATABASEPROPERTYEX('YourDatabaseName', 'Collation') AS DatabaseCollation; ``` R...
8,405
[ { "from": "human", "value": "How do you determine the collation of a database in SQL 2005, for instance if you need to perform a case-insensitive search/replace?\n" }, { "from": "gpt", "value": "In SQL Server 2005, the collation of a database determines how string comparison is performed, includ...
After downloading all .NET framework symbols and sources using NetMassDownloader, is it possible to setup the VS.NET 2005 for debugging into .NET 2.0 source files?
Yes, it is possible to set up Visual Studio 2005 for debugging into .NET 2.0 source files after downloading the symbols and sources using NetMassDownloader. Here’s how you can configure it: ### Step-by-Step Setup 1. **Download Symbols and Sources**: Make sure that you have downloaded the correct symbols (.pdb file...
5,575
[ { "from": "human", "value": "After downloading all .NET framework symbols and sources using NetMassDownloader, is it possible to setup the VS.NET 2005 for debugging into .NET 2.0 source files?\n" }, { "from": "gpt", "value": "Yes, it is possible to set up Visual Studio 2005 for debugging into .N...
I am trying to find a generic way of accessing a set of containers. I have a standard vector and list in addition to another custom list. The custom list defines an iterator; class Iterator: public std::iterator<std::forward_iterator_tag, T> { // ... } Iterator begin() { return (Iterator(root)); } Iterator en...
To achieve a generic way of accessing different container types in C++, you can use polymorphism or templates. Since you want to use different types of iterators (from `std::list`, `std::vector`, and your custom `custom_list`), one elegant approach is to use a common interface through type erasure or a variant-like str...
4,258
[ { "from": "human", "value": "I am trying to find a generic way of accessing a set of containers. I have a standard vector and list in addition to another custom list.\nThe custom list defines an iterator;\nclass Iterator: public std::iterator<std::forward_iterator_tag, T> {\n // ...\n}\n\nIterator begin(...
There is a netsh and a route command on Windows. From their help text it looks like both can be used to configure static routes. When should you use one and not the other? Is IPv6 a distinguishing factor here?
The `netsh` and `route` commands in Windows both can be used to configure static routes, but they are designed for slightly different scenarios and levels of control. Here’s a breakdown of when to use each: ### `route` Command - **Purpose**: The `route` command is a simpler tool primarily focused on managing the routi...
4,841
[ { "from": "human", "value": "There is a netsh and a route command on Windows. From their help text it looks like both can be used to configure static routes. When should you use one and not the other? Is IPv6 a distinguishing factor here?\n" }, { "from": "gpt", "value": "The `netsh` and `route...
When a process in jBPM forks into concurrent paths, each of these paths gets their own copy of the process variables, so that they run isolated from each other. But what happens when the paths join again ? Obviously there could be conflicting updates. Does the context revert back to the state before the fork? Can I cho...
In jBPM (Java Business Process Model), when a process forks into concurrent paths, each path operates with its own copy of the process variables. This isolation means that changes made to the process variables in one path do not affect the values in the other paths. When the paths later join again, the behavior regar...
7,627
[ { "from": "human", "value": "When a process in jBPM forks into concurrent paths, each of these paths gets their own copy of the process variables, so that they run isolated from each other.\nBut what happens when the paths join again ?\nObviously there could be conflicting updates.\nDoes the context revert ...
I have a String representation of a date that I need to create a Date or Calendar object from. I've looked through Date and Calendar APIs but haven't found anything that can do this other than creating my own ugly parse method. I know there must be a way, does anyone know of a solution?
Yes, in Java, you can easily convert a string representation of a date into a `Date` or `Calendar` object by using the `SimpleDateFormat` class or the newer `java.time` package (introduced in Java 8). Here’s how you can do it using both methods: ### Using `SimpleDateFormat` ```java import java.text.ParseException; ...
7,475
[ { "from": "human", "value": "I have a String representation of a date that I need to create a Date or Calendar object from. I've looked through Date and Calendar APIs but haven't found anything that can do this other than creating my own ugly parse method. I know there must be a way, does anyone know of a s...
I have a site, which contains several ashx handlers, on a couple of the handlers I want to reject non-SSL requests. Is there a way that I can do this in code?
Yes, you can reject non-SSL requests in your ASHX handler code. The approach involves checking the request's URL scheme within the handler and returning an appropriate response if the request is not using HTTPS. Here is how you can do it: 1. Open your ASHX handler file. 2. Within the `ProcessRequest` method, check if...
6,938
[ { "from": "human", "value": "I have a site, which contains several ashx handlers, on a couple of the handlers I want to reject non-SSL requests. Is there a way that I can do this in code?\n" }, { "from": "gpt", "value": "Yes, you can reject non-SSL requests in your ASHX handler code. The approac...
What is the best way to support multiple languages for the interface in an ASP.NET MVC application? I've seen people use resource files for other applications. Is this still the best way?
Yes, using resource files (resx) is still one of the best practices for supporting multiple languages in an ASP.NET MVC application. This approach allows for efficient localization and management of text and strings used throughout your application. Here’s a detailed explanation of how to implement localization using r...
4,313
[ { "from": "human", "value": "What is the best way to support multiple languages for the interface in an ASP.NET MVC application? I've seen people use resource files for other applications. Is this still the best way?\n" }, { "from": "gpt", "value": "Yes, using resource files (resx) is still one ...
I have an application deployed into multiple zones and there are some issues with opening larger documents (20-50MB) across the WAN. Currently the documents are stored in Zone 1 (Americas) and a link stored in the database to the docs. I have heard some things about blobs in oracle and store binary in MS SQL Server...
When dealing with large documents in a multi-zone architecture, several strategies can help improve performance and address issues related to WAN latencies. Below are some suggestions, including some considerations for the technologies you mentioned: ### 1. **Storing Documents as BLOBs** - **Oracle BLOBs**: In Oracle...
4,161
[ { "from": "human", "value": "I have an application deployed into multiple zones and there are some issues with opening larger documents (20-50MB) across the WAN. \nCurrently the documents are stored in Zone 1 (Americas) and a link stored in the database to the docs. \nI have heard some things about blobs ...
I have Oracle SQL Developer already installed and am able to connect to and query Oracle databases. Using Help -> Check for Updates I was able to install the Oracle MySQL Browser extension but there are no connection options for MySQL databases.
To connect to MySQL databases using Oracle SQL Developer, you'll need to ensure that you've installed the necessary MySQL JDBC driver and set up a connection properly. Here’s how to do that: ### Step 1: Download MySQL JDBC Driver 1. Visit the [MySQL Connector/J download page](https://dev.mysql.com/downloads/connector/...
5,757
[ { "from": "human", "value": "I have Oracle SQL Developer already installed and am able to connect to and query Oracle databases.\nUsing Help -> Check for Updates I was able to install the Oracle MySQL Browser extension but there are no connection options for MySQL databases.\n" }, { "from": "gpt", ...
I'm fully aware that set division can be accomplished through a series of other operations, so my question is: Is there a command for set division in SQL?
In SQL, there is no direct command or operator specifically designated for set division as you might find for set union or set intersection. However, you can achieve set division using a combination of SQL operations, primarily through the use of `JOIN` and `GROUP BY`. Set division is often defined as finding all valu...
8,229
[ { "from": "human", "value": "I'm fully aware that set division can be accomplished through a series of other operations, so my question is: \nIs there a command for set division in SQL?\n" }, { "from": "gpt", "value": "In SQL, there is no direct command or operator specifically designated for s...
I'm trying to preform setup and teardown for a set of integration tests, using jUnit 4.4 to execute the tests. The teardown needs to be run reliably. I'm having other problems with TestNG, so I'm looking to port back to jUnit. What hooks are available for execution before any tests are run and after all tests have comp...
In JUnit 4.4, you can use the following methods for setup and teardown of your integration tests: 1. **@BeforeClass** and **@AfterClass**: These annotations are used to specify methods that should be executed once before any of the test methods in the class are run and once after all the tests in the class have been r...
3,114
[ { "from": "human", "value": "I'm trying to preform setup and teardown for a set of integration tests, using jUnit 4.4 to execute the tests. The teardown needs to be run reliably. I'm having other problems with TestNG, so I'm looking to port back to jUnit. What hooks are available for execution before any te...
I'm working on getting an Introduction to Groovy presentation ready for my local Java User's Group and I've pretty much got it together. What I'd like to see is what you all think I just have to cover. Remember, this is an introductory presentation. Most of the people are experienced Java developers, but I'm pretty...
That sounds like a great initiative! For your introductory presentation on Groovy aimed at experienced Java developers, here are some key topics you might want to consider covering within a 1-hour timeframe: ### 1. **Introduction to Groovy** - What is Groovy? - Brief history and evolution of Groovy. - Groovy ...
5,778
[ { "from": "human", "value": "I'm working on getting an Introduction to Groovy presentation ready for my local Java User's Group and I've pretty much got it together. What I'd like to see is what you all think I just have to cover. \nRemember, this is an introductory presentation. Most of the people are e...
I am creating a custom content type feature for MOSS that will also include a Word 2007 document as the document template. The same Word document will also have a Document Information Panel (DIP) and Quick Parts for all the fields in the content type. The problem is that when my feature is deployed the Word document's ...
To ensure that the Quick Parts in your Word 2007 document template correctly bind to the columns in your content type in MOSS (Microsoft Office SharePoint Server), you need to follow these steps during the feature deployment process: 1. **Correctly Define the Content Type**: Make sure that your custom content type is ...
5,826
[ { "from": "human", "value": "I am creating a custom content type feature for MOSS that will also include a Word 2007 document as the document template. The same Word document will also have a Document Information Panel (DIP) and Quick Parts for all the fields in the content type.\nThe problem is that when m...
What database should a beginner use in the C language? Can I use MySQL? Thanks
Yes, you can use MySQL with C, and it's a great choice for a beginner who wants to learn about databases while working in C. MySQL is widely used and has a well-documented C API that you can use to interact with the database. Here are some steps and tips to get you started: 1. **Install MySQL**: Ensure that you have...
6,032
[ { "from": "human", "value": "What database should a beginner use in the C language?\nCan I use MySQL?\nThanks\n" }, { "from": "gpt", "value": "Yes, you can use MySQL with C, and it's a great choice for a beginner who wants to learn about databases while working in C. MySQL is widely used and has...
I want to set all the fields and labels on a VFP7 report to Float and Stretch with overflow. I tried Using the .frx file and doing the following REPLACE but it didn't work. Is there some other field I need to change too? REPLACE float WITH .T. FOR objtype = 8
In Visual FoxPro 7 (VFP7), the `.frx` file contains the binary data for reports, and directly modifying it through SQL commands like `REPLACE` can be tricky and may not yield the expected results. Instead of working directly with the `.frx` file, you should consider using the Visual FoxPro Report Designer to make chang...
6,240
[ { "from": "human", "value": "I want to set all the fields and labels on a VFP7 report to Float and Stretch with overflow. I tried Using the .frx file and doing the following REPLACE but it didn't work. \nIs there some other field I need to change too?\nREPLACE float WITH .T. FOR objtype = 8\n\n" }, { ...
I want to be able to view a SQL Server 2005 Reporting Services report from an ASP.NET application in a DMZ through a ReportViewer control. The SQLand SSRS server are behind the firewall.
Accessing SQL Server Reporting Services (SSRS) reports from an ASP.NET application in a DMZ while keeping the SQL Server and SSRS servers behind a firewall involves several steps and considerations to ensure security and proper functionality. Below is a guide on how to achieve this. ### Steps to Access SSRS Reports 1...
4,936
[ { "from": "human", "value": "I want to be able to view a SQL Server 2005 Reporting Services report from an ASP.NET application in a DMZ through a ReportViewer control. The SQLand SSRS server are behind the firewall.\n" }, { "from": "gpt", "value": "Accessing SQL Server Reporting Services (SSRS)...
I implemented a Lucene search solution awhile back, and it got me interested in compressed file indexes that are searchable. At the time I could not find any good information on how exactly you would go about creating a custom search index, so I wonder if anyone can point me in the right direction? My primary interest...
Creating a custom search index that utilizes compression and file formatting can be a complex but rewarding task. Below, I'll outline some key concepts, techniques, and resources to help guide you through this process. ### Key Concepts and Techniques 1. **Document and Field Structure**: - Similar to Lucene, your i...
4,575
[ { "from": "human", "value": "I implemented a Lucene search solution awhile back, and it got me interested in compressed file indexes that are searchable. At the time I could not find any good information on how exactly you would go about creating a custom search index, so I wonder if anyone can point me in ...
I am building a web page to show a customer what software they purchased and to give them a link to download said software. Unfortunately, the data on what was purchased and the download information are in separate databases so I can't just take care of it with joins in an SQL query. The common item is SKU. I'll be pu...
To achieve your goal of displaying customer purchases along with the associated download links efficiently, you'll need to consolidate data from two separate sources into a single structure. Here’s a step-by-step approach you can consider: ### 1. Retrieve Data from Both Sources You can start by retrieving the necessar...
2,158
[ { "from": "human", "value": "I am building a web page to show a customer what software they purchased and to give them a link to download said software. Unfortunately, the data on what was purchased and the download information are in separate databases so I can't just take care of it with joins in an SQL ...
After the suggestion to use a library for my ajax needs I am going to use one, the problem is that there are so many and I've no idea how to even begin telling them apart. Thus, can anybody A) Give a rundown of the differences or B) Point me (and others like me) somewhere that has such a list. Failing that plan C is...
When it comes to AJAX (Asynchronous JavaScript and XML) libraries, there are several popular options available, each with its own strengths, weaknesses, and use cases. Here’s a rundown of some of the most commonly used AJAX libraries: ### A) Rundown of AJAX Libraries 1. **jQuery** - **Overview**: One of the most p...
2,678
[ { "from": "human", "value": "After the suggestion to use a library for my ajax needs I am going to use one, the problem is that there are so many and I've no idea how to even begin telling them apart.\nThus, can anybody \nA) Give a rundown of the differences or \nB) Point me (and others like me) somewhere t...
Was looking to get peoples thoughts on keeping a Lucene index up to date as changes are made to the domain model objects of an application. The application in question is a Java/J2EE based web app that uses Hibernate. The way I currently have things working is that the Hibernate mapped model objects all implement a ...
Maintaining an up-to-date Lucene index in the context of a Java/J2EE application using Hibernate can be challenging, especially when handling concurrent CRUD operations and ensuring that the index remains consistent with the state of the underlying domain model. Here are several strategies and considerations you might ...
5,271
[ { "from": "human", "value": "Was looking to get peoples thoughts on keeping a Lucene index up to date as changes are made to the domain model objects of an application. \nThe application in question is a Java/J2EE based web app that uses Hibernate. The way I currently have things working is that the Hiber...
I've seen this weird behavior on several sites recently: I scroll down a page and follow a link to another page. When I click the Back button and return, I am left back at the top of the previous page, not at the link. This is very annoying if I'm clicking on links in a search results page or a list of "10 Best Foo Bar...
The behavior you're experiencing with the Back button and the scroll position can be attributed to how different browsers handle page caching and the restoration of scroll positions. When you navigate to a new page and then use the Back button to return to the previous page, browsers typically try to restore the exact...
8,368
[ { "from": "human", "value": "I've seen this weird behavior on several sites recently: I scroll down a page and follow a link to another page. When I click the Back button and return, I am left back at the top of the previous page, not at the link. This is very annoying if I'm clicking on links in a search r...
I've been trimming the UI of our website by doing the following in the onload event of that control: btnDelete.isVisible = user.IsInRole("can delete"); This has become very tedious because there are so many controls to check again and again. As soon as I get it all working, designers request to change the UI and then...
It sounds like you’re dealing with repetitive code for controlling UI visibility based on user roles, which can become tedious and error-prone. Here are a few suggestions to streamline the process and make it more manageable: ### 1. Centralize Role Checks Instead of checking user roles in multiple places, create a ce...
5,464
[ { "from": "human", "value": "I've been trimming the UI of our website by doing the following in the onload event of that control:\nbtnDelete.isVisible = user.IsInRole(\"can delete\");\n\nThis has become very tedious because there are so many controls to check again and again. As soon as I get it all workin...
I'm using a native DLL (FastImage.dll) in a C# ASP.NET Web Service that sometimes locks (can't delete it---says access denied); this requires stopping IIS to delete the DLL. The inability to delete this DLL in the bin folder of my published Web Service prevents me from publishing successfully (even though it thinks it ...
Dealing with native DLLs in an ASP.NET application can be tricky, especially when you encounter file locking issues. Here are some strategies and solutions that may help you resolve the issues you're experiencing: ### 1. Diagnose the Locking Issue Before implementing workarounds, it's essential to understand what's ca...
5,110
[ { "from": "human", "value": "I'm using a native DLL (FastImage.dll) in a C# ASP.NET Web Service that sometimes locks (can't delete it---says access denied); this requires stopping IIS to delete the DLL. The inability to delete this DLL in the bin folder of my published Web Service prevents me from publishin...
I'm a front-end developer and I was looking for opinions about the best all-round online documentation for javascript/css/html/xhtml/dom/browser quirks and support. I've tried Sitepoint, Quirksmode, W3Schools but all of these seem to be lacking in certain aspects and have been using them in combination.
As a front-end developer, having access to comprehensive and reliable documentation is crucial. Here are some of the best resources you can use for JavaScript, CSS, HTML, DOM, and browser support: 1. **MDN Web Docs (Mozilla Developer Network)**: - **URL**: [MDN Web Docs](https://developer.mozilla.org/) - **Descr...
4,991
[ { "from": "human", "value": "I'm a front-end developer and I was looking for opinions about the best all-round online documentation for javascript/css/html/xhtml/dom/browser quirks and support. I've tried Sitepoint, Quirksmode, W3Schools but all of these seem to be lacking in certain aspects and have been u...
I have an MS Access database, how can I determine which encoding characters are used in the database?
Determining the encoding used in an MS Access database can be a bit challenging, as Access does not explicitly expose character encoding settings like some other database systems. However, you can follow these steps to infer the encoding used in the database: ### Steps to Determine Encoding in MS Access 1. **Check th...
5,941
[ { "from": "human", "value": "I have an MS Access database, how can I determine which encoding characters are used in the database?\n" }, { "from": "gpt", "value": "Determining the encoding used in an MS Access database can be a bit challenging, as Access does not explicitly expose character enco...
(see here for the problem I'm trying to solve) How do you get hibernate to log clob values it's going to insert. It is logging other value types, such as Integer etc. I have the following in my log4j config: log4j.logger.net.sf.hibernate.SQL=DEBUG log4j.logger.org.hibernate.SQL=DEBUG log4j.logger.net.sf.hibernate.type=...
To enable logging of CLOB values in Hibernate, you need to adjust your logging configuration and ensure that the appropriate logging level is set for the specific classes responsible for handling CLOB types. Although you already have debug logging for Hibernate's SQL and type bindings, CLOB values might not be logged d...
6,568
[ { "from": "human", "value": "(see here for the problem I'm trying to solve)\nHow do you get hibernate to log clob values it's going to insert. It is logging other value types, such as Integer etc.\nI have the following in my log4j config:\nlog4j.logger.net.sf.hibernate.SQL=DEBUG\nlog4j.logger.org.hibernate....
How can I programmatically make a query in MS Access default to landscape when printed, specifically when viewing it as a PivotChart? I'm currently attempting this in MS Access 2003, but would like to see a solution for any version.
In Microsoft Access, controlling the print orientation (landscape vs. portrait) directly from a query or PivotChart is not straightforward since Access does not provide a direct property to set print orientation for queries. However, you can achieve this through VBA (Visual Basic for Applications) programming. Here’s ...
4,789
[ { "from": "human", "value": "How can I programmatically make a query in MS Access default to landscape when printed, specifically when viewing it as a PivotChart? I'm currently attempting this in MS Access 2003, but would like to see a solution for any version.\n" }, { "from": "gpt", "value": "I...
I've got an Active Directory synchronization tool (.NET 2.0 / C#) written as a Windows Service that I've been working on for a while and have recently been tasked with adding the ability to drive events based on changes in group membership. The basic scenario is that users are synchronized with a security database and,...
Your scenario indeed poses challenges when dealing with Active Directory group membership changes, especially when you need to maintain efficiency and ensure you don't miss any updates. Below are some suggestions and approaches that could help you tackle this problem: ### 1. Use Change Notifications: If you're not alr...
3,568
[ { "from": "human", "value": "I've got an Active Directory synchronization tool (.NET 2.0 / C#) written as a Windows Service that I've been working on for a while and have recently been tasked with adding the ability to drive events based on changes in group membership. The basic scenario is that users are s...
I have an Enumerable array int meas[] = new double[] {3, 6, 9, 12, 15, 18}; On each successive call to the mock's method that I'm testing I want to return a value from that array. using(_mocks.Record()) { Expect.Call(mocked_class.GetValue()).Return(meas); } using(_mocks.Playback()) { foreach(var i in meas) As...
It looks like you are trying to mock a method in a class so that it returns different values from an array each time it is called. However, the way you've set it up right now would return the entire array on the first call instead of returning each individual value on successive calls. To achieve the desired behavior,...
6,650
[ { "from": "human", "value": "I have an Enumerable array\nint meas[] = new double[] {3, 6, 9, 12, 15, 18};\n\nOn each successive call to the mock's method that I'm testing I want to return a value from that array.\nusing(_mocks.Record()) {\n Expect.Call(mocked_class.GetValue()).Return(meas); \n}\nusing(_moc...
Is there any way to know if I'm compiling under a specific Microsoft Visual Studio version?
Yes, you can determine the Microsoft Visual Studio version you are compiling under by checking predefined macros that are automatically defined by the compiler. Here are a few ways you can do this: ### Using Predefined Macros Microsoft Visual Studio defines several macros that indicate the version of the compiler you ...
5,759
[ { "from": "human", "value": "Is there any way to know if I'm compiling under a specific Microsoft Visual Studio version?\n" }, { "from": "gpt", "value": "Yes, you can determine the Microsoft Visual Studio version you are compiling under by checking predefined macros that are automatically define...
I know that if you have a loop that modifies the count of the items in the loop, using the NSEnumerator on a set is the best way to make sure your code blows up, however I would like to understand the performance tradeoffs between the NSEnumerator class and just an old school for loop
When considering the performance trade-offs between using `NSEnumerator` and a traditional for loop in Objective-C, particularly with collections such as `NSArray` or `NSSet`, there are a few key points to consider: ### 1. **Readability and Maintainability** - **NSEnumerator:** Using `NSEnumerator` (through methods...
5,746
[ { "from": "human", "value": "I know that if you have a loop that modifies the count of the items in the loop, using the NSEnumerator on a set is the best way to make sure your code blows up, however I would like to understand the performance tradeoffs between the NSEnumerator class and just an old school fo...
Suppose you have an ActiveRecord::Observer in one of your Ruby on Rails applications - how do you test this observer with rSpec?
Testing an `ActiveRecord::Observer` in a Ruby on Rails application using RSpec involves a few steps. You'll want to ensure that your observer responds correctly to the lifecycle events of the model it's observing. Here’s how you can do that: ### Step-by-Step Guide 1. **Setup Your Environment**: Make sure RSpec is set...
5,990
[ { "from": "human", "value": "Suppose you have an ActiveRecord::Observer in one of your Ruby on Rails applications - how do you test this observer with rSpec?\n" }, { "from": "gpt", "value": "Testing an `ActiveRecord::Observer` in a Ruby on Rails application using RSpec involves a few steps. You'...
I'd like to use alternatives to System Center Virtual Machine Manager 2008 is possible, in other words, any FREE tools?
Yes, there are several free alternatives to System Center Virtual Machine Manager (SCVMM) 2008 that you can consider for managing virtual machines. Here are some options: 1. **Proxmox Virtual Environment (VE)**: - Proxmox VE is a free and open-source virtualization platform that allows you to manage VMs and contain...
7,097
[ { "from": "human", "value": "I'd like to use alternatives to System Center Virtual Machine Manager 2008 is possible, in other words, any FREE tools?\n" }, { "from": "gpt", "value": "Yes, there are several free alternatives to System Center Virtual Machine Manager (SCVMM) 2008 that you can consid...