instruction
stringlengths
14
27.6k
completion
stringlengths
3
38.3k
__original_row_idx
int64
0
50k
conversations
listlengths
2
2
ReSharper likes to point out multiple functions per ASP.NET page that could be made static. Does it help me if I do make them static? Should I make them static and move them to a utility class?
Making functions static in an ASP.NET page (or any class) can have several implications, and whether you should do it depends on various factors. Here are some points to consider: ### Benefits of Making Functions Static 1. **Memory Efficiency**: Static methods are associated with the class itself rather than an insta...
16,779
[ { "from": "human", "value": "ReSharper likes to point out multiple functions per ASP.NET page that could be made static. Does it help me if I do make them static? Should I make them static and move them to a utility class?\n" }, { "from": "gpt", "value": "Making functions static in an ASP.NET pa...
I have a lot of classes in the App_Code directory could this be a problem? Would it build faster if it was in a separate library? Any other tips?
Having a lot of classes in the `App_Code` directory of an ASP.NET application can lead to a few potential issues, especially in larger projects. Here are some considerations regarding performance, organization, and maintainability: ### Performance and Build Speed 1. **Build Time**: If you have many classes in the `App...
16,866
[ { "from": "human", "value": "I have a lot of classes in the App_Code directory could this be a problem? Would it build faster if it was in a separate library?\nAny other tips?\n" }, { "from": "gpt", "value": "Having a lot of classes in the `App_Code` directory of an ASP.NET application can lead ...
I have a server access log, with timestamps of each http request, I'd like to obtain a count of the number of requests at each second. Using sed, and cut -c, so far I've managed to cut the file down to just the timestamps, such as: 22-Sep-2008 20:00:21 +0000 22-Sep-2008 20:00:22 +0000 22-Sep-2008 20:00:22 +0000 ...
You can achieve the desired result using a combination of `sort`, `uniq`, and `awk` in a single command line. Here's how you can do it: 1. First, ensure you have the timestamps in a file, let's call it `timestamps.txt`. 2. Then you can run the following command: ```bash sort timestamps.txt | uniq -c | awk '{print $2,...
17,232
[ { "from": "human", "value": "I have a server access log, with timestamps of each http request, I'd like to obtain a count of the number of requests at each second. Using sed, and cut -c, so far I've managed to cut the file down to just the timestamps, such as:\n\n22-Sep-2008 20:00:21 +0000\n 22-Sep-2008 20...
Im running a ASP.NET Site where I have problems to find some JavaScript Errors just with manual testing. Is there a possibility to catch all JavaScript Errors on the Clientside and log them on the Server i.e. in the EventLog (via Webservice or something like that)?
Yes, you can catch JavaScript errors on the client side and log them on the server side in an ASP.NET application. Here's a high-level approach to achieving this: ### 1. Catch JavaScript Errors on the Client Side You can use the `window.onerror` event handler to catch unhandled JavaScript errors. You can then send th...
14,129
[ { "from": "human", "value": "Im running a ASP.NET Site where I have problems to find some JavaScript Errors just with manual testing.\nIs there a possibility to catch all JavaScript Errors on the Clientside and log them on the Server i.e. in the EventLog (via Webservice or something like that)?\n" }, { ...
I want to add my own member to the StringBuilder class, but when I go to create it IntelliSense doesn't bring it up. public class myStringBuilder() Inherits System.Text.[StringBuilder should be here] .... end class Is it even possible? thanks
In .NET, the `StringBuilder` class is a sealed class, which means it cannot be inherited. Because of this, you cannot create a subclass of `StringBuilder`. This is why you are not seeing it in IntelliSense when you try to inherit from it. If you want to extend the functionality of `StringBuilder`, you have a couple of...
18,637
[ { "from": "human", "value": "I want to add my own member to the StringBuilder class, but when I go to create it IntelliSense doesn't bring it up.\npublic class myStringBuilder()\n Inherits System.Text.[StringBuilder should be here]\n ....\nend class\n\nIs it even possible? thanks\n" }, { "from...
When Windows Internet Properties -> Connections -> LAN Settings -> Automatic Configuration is set to "Automatically detect settings" how does Windows actually determine/discover what the settings are? Is it a network broadcast or some kind of targeted query to a server configured somewhere in the registry, or something...
When the "Automatically detect settings" option is enabled in the LAN Settings of Windows Internet Properties, Windows uses a protocol called Web Proxy Auto-Discovery Protocol (WPAD) to locate the settings automatically. Here's how it generally works: 1. **WPAD Protocol**: Windows uses the WPAD protocol to discover pr...
17,944
[ { "from": "human", "value": "When Windows Internet Properties -> Connections -> LAN Settings -> Automatic Configuration is set to \"Automatically detect settings\" how does Windows actually determine/discover what the settings are? Is it a network broadcast or some kind of targeted query to a server configu...
I'm currently working on a web business application that has many entities (people,organizations) with lots of contact information ie. multiple postal addresses, email addresses, phone numbers etc. At the moment the database schema is such that persons table has postal address columns, phone number columns as does org...
Your proposal for a dynamic contact information schema is both innovative and complex. It allows for a flexible way to handle various types of contact information without being constrained by a predefined schema. However, implementing such a design comes with challenges, particularly in the areas of performance, comple...
12,532
[ { "from": "human", "value": "I'm currently working on a web business application that has many entities (people,organizations) with lots of contact information ie. multiple postal addresses, email addresses, phone numbers etc. \nAt the moment the database schema is such that persons table has postal address...
Is there a way to define a column (primary key) as a UUID in SQLAlchemy if using PostgreSQL (Postgres)?
Yes, you can define a column as a UUID and set it as the primary key in SQLAlchemy when using PostgreSQL. PostgreSQL has native support for UUIDs, and SQLAlchemy provides a way to use it through the `sqlalchemy.dialects.postgresql` module. Here’s a basic example of how to define a model with a UUID primary key in SQLA...
16,233
[ { "from": "human", "value": "Is there a way to define a column (primary key) as a UUID in SQLAlchemy if using PostgreSQL (Postgres)?\n" }, { "from": "gpt", "value": "Yes, you can define a column as a UUID and set it as the primary key in SQLAlchemy when using PostgreSQL. PostgreSQL has native su...
I am trying to make an Outlook 2003 add-in using Visual Studio 2008 on Windows XP SP3 and Internet Explorer 7. My add-in is using custom Folder Home Page which displays my custom form, which wraps Outlook View Control. I get COM Exception with 'Exception from HRESULT: 0xXXXXXXXX' description every time when I try to se...
It sounds like you're encountering a COM exception when trying to set the `Folder` property of the Outlook View Control (OVC) in your Outlook 2003 add-in. Since the issue occurs only with folders in non-default PST files and only after certain updates, there are a few troubleshooting steps and considerations you can fo...
13,211
[ { "from": "human", "value": "I am trying to make an Outlook 2003 add-in using Visual Studio 2008 on Windows XP SP3 and Internet Explorer 7.\nMy add-in is using custom Folder Home Page which displays my custom form, which wraps Outlook View Control.\nI get COM Exception with 'Exception from HRESULT: 0xXXXXXX...
After installing VMware Server I get the following error when I try to access the VMware web-based server manager: The VMware Infrastructure Web Service at "http://localhost:8222/sdk" is not responding
The error you're encountering suggests that the VMware Infrastructure Web Service, which is necessary for accessing the VMware Server's web-based management interface, is not running or not responding at the specified address. Here are some steps you can take to troubleshoot and resolve the issue: 1. **Check the VMwar...
16,383
[ { "from": "human", "value": "After installing VMware Server I get the following error when I try to access the VMware web-based server manager:\n\nThe VMware Infrastructure Web Service\n at \"http://localhost:8222/sdk\" is not\n responding\n\n" }, { "from": "gpt", "value": "The error you're en...
What is the benefit of using singleton instead of global for database connections in PHP? I feel using singleton instead of global makes the code unnecessarily complex. Code with Global $conn = new PDO(...); function getSomething() { global $conn; . . . } Code with Singleton class DB_Instance { pr...
Using a singleton pattern for database connections in PHP has some advantages over using a global variable. However, it's worth noting that both approaches have their pros and cons, and the best choice often depends on the context of the application and the architecture you're using. ### Advantages of Singleton Over ...
15,395
[ { "from": "human", "value": "What is the benefit of using singleton instead of global for database connections in PHP? I feel using singleton instead of global makes the code unnecessarily complex.\nCode with Global\n$conn = new PDO(...);\n\nfunction getSomething()\n{\n global $conn;\n .\n .\n ....
I know that that is not a question... erm anyway HERE is the question. I have inherited a database that has 1(one) table in that looks much like this. Its aim is to record what species are found in the various (200 odd) countries. ID Species Afghanistan Albania Algeria American Samoa Andorra Angola .... Western Sahara...
Certainly! You are correct in identifying that the structure of your original table can lead to an inefficient querying process, especially when trying to derive relationships between species and countries. To achieve your goal, you can leverage a more programmatic approach to transform your data into the desired struc...
12,661
[ { "from": "human", "value": "I know that that is not a question... erm anyway HERE is the question.\nI have inherited a database that has 1(one) table in that looks much like this. Its aim is to record what species are found in the various (200 odd) countries.\nID \nSpecies\nAfghanistan\nAlbania\nAlgeria\nA...
I'm trying to consume a SOAP webservice from an Adobe Flex 3 application, but the server tell me "Invalid SOAP Envelope. SOAP Body does not contain a message nor a fault". I already wrote other test clients (with both Delphi and C#) and I'm sure it's all ok on the server side, so I need to examine the SOAP envelope Fle...
To debug the SOAP envelope being sent from an Adobe Flex 3 application, you can intercept the outgoing requests by extending the `WebService` class or by using a custom SOAP service that logs the requests before passing them along to the actual server. Here's a simple approach to help you log the SOAP request: 1. **E...
16,003
[ { "from": "human", "value": "I'm trying to consume a SOAP webservice from an Adobe Flex 3 application, but the server tell me \"Invalid SOAP Envelope. SOAP Body does not contain a message nor a fault\". I already wrote other test clients (with both Delphi and C#) and I'm sure it's all ok on the server side,...
(I'll begin by making it clear, I am not a .NET developer and am not tied to any other environment.) Recently, I heard that the London Stock Exchange went down for an entire day. I've also heard that the software was written in .NET. Up to this point they would experience performance hits on busy days. People seem to b...
.NET is a versatile and powerful framework that can scale to accommodate a variety of applications, including large enterprise solutions and high-performance systems like those used in financial markets. However, like any technology, .NET has its own characteristics, strengths, and limitations that can affect its scala...
12,992
[ { "from": "human", "value": "(I'll begin by making it clear, I am not a .NET developer and am not tied to any other environment.)\nRecently, I heard that the London Stock Exchange went down for an entire day. I've also heard that the software was written in .NET. Up to this point they would experience perfo...
Our application has a file format similar to the OpenDocument file format (see http://en.wikipedia.org/wiki/OpenDocument) - i.e. zipped with a manifest file, a thumbnail image, etc. I notice that OpenOffice files have a preview image of the Open Office file as their icons, both in Windows and in Linux. Is there some wa...
To create dynamic icons for your application’s file format based on an internal thumbnail image, you will need to implement specific solutions for each operating system. Here are options for Windows, Linux (GNOME), and macOS: ### Windows 1. **Thumbnail Cache**: You can create a shell extension (specifically a thu...
16,586
[ { "from": "human", "value": "Our application has a file format similar to the OpenDocument file format (see http://en.wikipedia.org/wiki/OpenDocument) - i.e. zipped with a manifest file, a thumbnail image, etc.\nI notice that OpenOffice files have a preview image of the Open Office file as their icons, both...
I'm doing a tech review and looking at AMF integration with various backends (Rails, Python, Grails etc). Lots of options are out there, question is, what do the Adobe products do (BlazeDS etc) that something like RubyAMF / pyAMF don't?
Adobe's BlazeDS and similar technologies like LiveCycle Data Services provide a robust framework for integrating Flex applications with back-end services. When comparing Adobe's solutions with alternative options like RubyAMF and pyAMF, several key differences and features come into play: ### Features of Adobe BlazeDS...
13,796
[ { "from": "human", "value": "I'm doing a tech review and looking at AMF integration with various backends (Rails, Python, Grails etc).\nLots of options are out there, question is, what do the Adobe products do (BlazeDS etc) that something like RubyAMF / pyAMF don't?\n" }, { "from": "gpt", "value...
Trying to create a QtRuby application, I get the following error: /usr/lib64/ruby/site_ruby/1.8/Qt/qtruby4.rb:2144: [BUG] Segmentation fault ruby 1.8.6 (2008-03-03) [x86_64-linux] I am running a 64-bit version of Novell OpenSUSE 11 with DKE4 and Qt
The segmentation fault you're experiencing while working with QtRuby could be attributed to several potential issues. Here are some steps you can take to diagnose and possibly resolve the problem: 1. **Update Ruby and QtRuby**: You're using an older version of Ruby (1.8.6). It is highly recommended to upgrade to a mor...
14,290
[ { "from": "human", "value": "Trying to create a QtRuby application, I get the following error:\n/usr/lib64/ruby/site_ruby/1.8/Qt/qtruby4.rb:2144: [BUG] Segmentation fault\nruby 1.8.6 (2008-03-03) [x86_64-linux]\n\nI am running a 64-bit version of Novell OpenSUSE 11 with DKE4 and Qt\n" }, { "from": "...
If a person is looking to batch convert a large number of raster images into vector graphics, are there any tools out there that do that well? For an example, think of just about any diagram that has standard shapes (ellipses, rectangles) and text.
Batch converting raster images to vector graphics can be a challenging task, especially when it comes to maintaining quality and accuracy. However, there are several tools and software that can help achieve this. Here are some of the most popular ones: 1. **Adobe Illustrator**: - **Image Trace**: Adobe Illustrator ...
17,166
[ { "from": "human", "value": "If a person is looking to batch convert a large number of raster images into vector graphics, are there any tools out there that do that well?\nFor an example, think of just about any diagram that has standard shapes (ellipses, rectangles) and text.\n" }, { "from": "gpt"...
Does the using catch the exception or throw it? i.e. using (StreamReader rdr = File.OpenText("file.txt")) { //do stuff } If the streamreader throws an exception is it caught by using or thrown so the calling function can handle it?
The `using` statement in C# is a construct that ensures that the `IDisposable` object is properly disposed of, regardless of whether an exception is thrown or not. When you use `using`, if the code inside the block (where you do "stuff") throws an exception, the exception is not caught by the `using` statement itself. ...
19,665
[ { "from": "human", "value": "Does the using catch the exception or throw it? i.e. \nusing (StreamReader rdr = File.OpenText(\"file.txt\"))\n{\n //do stuff\n}\n\nIf the streamreader throws an exception is it caught by using or thrown so the calling function can handle it?\n" }, { "from": "gpt", "...
What is the best or most concise method for returning a string repeated an arbitrary amount of times? The following is my best shot so far: function repeat(s, n){ var a = []; while(a.length < n){ a.push(s); } return a.join(''); }
Your implementation effectively repeats a string an arbitrary number of times, but there are more concise and efficient methods to achieve the same result in JavaScript. Here are a few options: ### Option 1: Using `String.prototype.repeat` The simplest and most concise way to repeat a string in modern JavaScript is t...
19,201
[ { "from": "human", "value": "What is the best or most concise method for returning a string repeated an arbitrary amount of times?\nThe following is my best shot so far:\nfunction repeat(s, n){\n var a = [];\n while(a.length < n){\n a.push(s);\n }\n return a.join('');\n}\n\n" }, { ...
There is a Microsoft knowledge base article with sample code to open all mailboxes in a given information store. It works so far (requires a bit of copy & pasting on compilers newer than VC++ 6.0). At one point it calls IExchangeManageStore::GetMailboxTable with the distinguished name of the information store. For the ...
To programmatically retrieve the distinguished name (DN) of the information store for the currently open mailbox in an Exchange environment, you can make use of the MAPI interfaces provided by the Microsoft Messaging Application Programming Interface (MAPI). Here’s a general approach to achieve this using MAPI: 1. **...
12,418
[ { "from": "human", "value": "There is a Microsoft knowledge base article with sample code to open all mailboxes in a given information store. It works so far (requires a bit of copy & pasting on compilers newer than VC++ 6.0).\nAt one point it calls IExchangeManageStore::GetMailboxTable with the distinguish...
I installed the ReSharper evaluation version and uninstalled it. Afterwards Visual Studio's Intellisense stopped working. I have restarted computer but I still have this problem. Can anyone please help me here? I am using Visual Studio 2005. Thanks.
If you’re experiencing issues with IntelliSense in Visual Studio 2005 after uninstalling ReSharper, it’s possible that some settings or components were altered during the ReSharper installation or uninstallation process. Here are some steps you can take to try to resolve the issue: 1. **Reset Visual Studio Settings**:...
18,205
[ { "from": "human", "value": "I installed the ReSharper evaluation version and uninstalled it. Afterwards Visual Studio's Intellisense stopped working. I have restarted computer but I still have this problem. \nCan anyone please help me here?\nI am using Visual Studio 2005. Thanks.\n" }, { "from": "...
What is the ideal code to logging ratio? I'm not used to writing logs as most of the applications I've developed have not had much logging. Recently though I've changed job, and I've noticed that you can't see the application code for the calls to log4net. I appreciate that this is useful but surely having too many deb...
The ideal logging ratio is not a strict rule but rather a guideline that balances the need for visibility into application behavior with the need to maintain readable and manageable code. Here are some key considerations regarding logging practices: ### 1. **Logging Levels** - Use different logging levels (e.g., DE...
17,256
[ { "from": "human", "value": "What is the ideal code to logging ratio? I'm not used to writing logs as most of the applications I've developed have not had much logging.\nRecently though I've changed job, and I've noticed that you can't see the application code for the calls to log4net. I appreciate that thi...
There are certain Crystal Reports features that cannot be combined in the same report, for example SQL command objects and server side grouping. However, as far as I can find, the built-in help doesn't seem to clearly document these conflicts. For example, checking the help page for either of those features doesn't men...
Finding comprehensive documentation on feature conflicts in Crystal Reports, particularly for versions like Crystal Reports XI, can indeed be challenging. Unfortunately, the official documentation often does not explicitly state which features cannot coexist, which can lead to confusion when trying to use multiple func...
18,383
[ { "from": "human", "value": "There are certain Crystal Reports features that cannot be combined in the same report, for example SQL command objects and server side grouping. However, as far as I can find, the built-in help doesn't seem to clearly document these conflicts. For example, checking the help page...
I've always assumed that before I can use the Dvorak layout I need to purchase a Dvorak keyboard. But I can't find one on Amazon. Is it simply a matter of popping the keys off a Qwerty keyboard and moving them around?
You don't necessarily need to purchase a dedicated Dvorak keyboard to use the Dvorak layout. Most modern operating systems allow you to change the keyboard layout in the settings without any physical modifications. You can simply switch your keyboard layout to Dvorak in your computer's settings. If you want to make yo...
19,330
[ { "from": "human", "value": "I've always assumed that before I can use the Dvorak layout I need to purchase a Dvorak keyboard. But I can't find one on Amazon. Is it simply a matter of popping the keys off a Qwerty keyboard and moving them around?\n" }, { "from": "gpt", "value": "You don't necess...
An MXML component can be quite complex, containing many nested controls, including asynchronously loaded content such as Image/SWFLoader. Is there one event I can watch for on my component that will only be raised when every control and sub-component has loaded, including SWFs and Images?
In MXML and Flex, there isn't a single built-in event that guarantees all nested components, including asynchronously loaded content like `Image` or `SWFLoader`, have fully loaded. However, you can work around this limitation by combining the use of multiple events. You can listen for the `complete` event on your `SWF...
16,332
[ { "from": "human", "value": "An MXML component can be quite complex, containing many nested controls, including asynchronously loaded content such as Image/SWFLoader.\nIs there one event I can watch for on my component that will only be raised when every control and sub-component has loaded, including SWFs ...
Had an interesting discussion with some colleagues about the best scheduling strategies for realtime tasks, but not everyone had a good understanding of the common or useful scheduling strategies. For your answer, please choose one strategy and go over it in some detail, rather than giving a little info on several stra...
Let's delve into **Priority-Based Preemptive Scheduling**, a widely used strategy for managing real-time tasks in operating systems. ### General Case In a priority-based preemptive scheduling algorithm, each task is assigned a priority level, and the scheduler selects the task with the highest priority to run. If a h...
17,344
[ { "from": "human", "value": "Had an interesting discussion with some colleagues about the best scheduling strategies for realtime tasks, but not everyone had a good understanding of the common or useful scheduling strategies.\nFor your answer, please choose one strategy and go over it in some detail, rather...
What is the equivalent of the extended procedure 'xp_dirscan' in SQL Server 2005?
In SQL Server 2005, the `xp_dirscan` extended stored procedure is used to scan a directory on the file system and return information about the files it contains. However, it's important to note that `xp_dirscan` is not available in SQL Server 2005. This procedure was a part of earlier versions of SQL Server. In SQL Se...
19,737
[ { "from": "human", "value": "What is the equivalent of the extended procedure 'xp_dirscan' in SQL Server 2005?\n" }, { "from": "gpt", "value": "In SQL Server 2005, the `xp_dirscan` extended stored procedure is used to scan a directory on the file system and return information about the files it ...
I'm building a Django project that needs search functionality, and until there's a django.contrib.search, I have to choose a search app. So, which is the best? By "best" I mean... easy to install / set up has a Django- or at least Python-friendly API can perform reasonably complex searches Here are some apps I've hea...
For adding search functionality to your Django project, there are several good options you can consider that meet your criteria of ease of installation/setup, Django-friendly APIs, and the capability to perform complex searches. Here are some recommendations: ### 1. **Django Haystack** - **Installation/Setup**: Very e...
14,369
[ { "from": "human", "value": "I'm building a Django project that needs search functionality, and until there's a django.contrib.search, I have to choose a search app. So, which is the best? By \"best\" I mean...\n\neasy to install / set up\nhas a Django- or at least Python-friendly API\ncan perform reasonabl...
In the earliest stages of planning the development of a new system, which development model to follow seems paramount. I've always held onto the belief that a classic waterfall (or hybrid waterfall/iterative prototyping) is the best approach for medium to large projects. It seems that once a project gets to be a cert...
Your intuition about the challenges of managing larger systems with Agile methodologies is shared by many in the software development community. While Agile approaches, including Scrum, XP, and others, offer significant benefits in terms of flexibility, collaboration, and responsiveness to change, there are certainly l...
15,832
[ { "from": "human", "value": "In the earliest stages of planning the development of a new system, which development model to follow seems paramount. I've always held onto the belief that a classic waterfall (or hybrid waterfall/iterative prototyping) is the best approach for medium to large projects. It se...
Function FillAdminAccount() As Boolean FillAdminAccount = True Try SQLconn.ConnectionString = "connect timeout=9999999;" & _ "data source=" & DefaultIserver & ";" & _ "initial catalog=" & DefaultIdBase & "; " & _ ...
The issue you're experiencing is related to the way you are retrieving and converting the `userpassword` field from a BINARY type in your database. When you retrieve a BINARY field, it's typically not a string representation by default, which is likely why you're seeing unexpected behavior when you try to cast it as a ...
17,970
[ { "from": "human", "value": "Function FillAdminAccount() As Boolean\n\n FillAdminAccount = True\n\n Try\n\n SQLconn.ConnectionString = \"connect timeout=9999999;\" & _\n \"data source=\" & DefaultIserver & \";\" & _\n \"...
Where do the type/member/parameter descriptions that you see in the Intellisense bubble come from? Are they stored in type attributes? EDIT: I'm specifically interested in the built-in types.
In Visual Studio and other IDEs that utilize Intellisense, the descriptions you see in the Intellisense bubbles for types, members, and parameters come from several sources. For built-in types, the information is typically embedded within the .NET Framework or the language's specifications. Here's a breakdown of where ...
18,606
[ { "from": "human", "value": "Where do the type/member/parameter descriptions that you see in the Intellisense bubble come from? Are they stored in type attributes?\nEDIT: I'm specifically interested in the built-in types.\n" }, { "from": "gpt", "value": "In Visual Studio and other IDEs that util...
I need to hide (make private) the -init method of my class in Objective-C. How can I do that?
In Objective-C, the `-init` method (as well as any method) can be made private by using class extensions (also known as anonymous categories). This technique allows you to declare the method in the class's implementation file (.m file) but not in the public header file (.h file). This means that the method will not be ...
18,768
[ { "from": "human", "value": "I need to hide (make private) the -init method of my class in Objective-C.\nHow can I do that?\n" }, { "from": "gpt", "value": "In Objective-C, the `-init` method (as well as any method) can be made private by using class extensions (also known as anonymous categorie...
I have a modal dialog form which has some "help links" within it which should open other non-modal panels or dialogs on top of it (while keeping the main dialog otherwise modal). However, these always end up behind the mask. YUI seems to be recognizing the highest z-index out there and setting the mask and modal dia...
It sounds like you're dealing with some complexities of managing z-index and focus behavior in your modal dialogs when using YUI (Yahoo User Interface) or possibly jQuery. Here are a few strategies to achieve your desired behavior: ### Approach 1: Adjusting Z-index and Focus Handling in YUI 1. **Override Z-index of t...
14,348
[ { "from": "human", "value": "I have a modal dialog form which has some \"help links\" within it which should open other non-modal panels or dialogs on top of it (while keeping the main dialog otherwise modal). \nHowever, these always end up behind the mask. YUI seems to be recognizing the highest z-index ...
I am creating a Windows Forms control derived from UserControl to be embedded in a WPF app. I have generally followed the procedures given in this link. public ref class CTiledImgViewControl : public UserControl { ... virtual void OnPaint( PaintEventArgs^ e ) override; ... }; And in my CPP file: void CTiledImgViewCo...
When you're creating a Windows Forms control and you want to override the `OnPaint` method, there are a few key things to keep in mind. Here are some suggestions on things to check to ensure that your `OnPaint` method is called correctly: 1. **Ensure `Control::OnPaint` is Triggered**: You need to make sure that the co...
15,360
[ { "from": "human", "value": "I am creating a Windows Forms control derived from UserControl to be embedded in a WPF app. I have generally followed the procedures given in this link.\npublic ref class CTiledImgViewControl : public UserControl\n{\n...\n\nvirtual void OnPaint( PaintEventArgs^ e ) override;\n\n...
I would like to wipe out all data for a specific kind in Google App Engine. What is the best way to do this? I wrote a delete script (hack), but since there is so much data is timeout's out after a few hundred records.
Wiping out all data for a specific kind in Google App Engine can indeed be challenging, especially if you're dealing with large datasets that cause timeouts. Instead of using a single script that tries to delete everything at once, consider using the following strategies to efficiently delete large amounts of data: ##...
10,091
[ { "from": "human", "value": "I would like to wipe out all data for a specific kind in Google App Engine. What is the\nbest way to do this?\nI wrote a delete script (hack), but since there is so much data is\ntimeout's out after a few hundred records. \n" }, { "from": "gpt", "value": "Wiping out ...
I'm running into an issue where I have a FileUpload control in an UpdatePanel. When I attempt to save changes and upload the file, no file is found. If I remove the UpdatePanel everything seems to work fine. Any ideas why this might be happening? And is there a work-around?
The issue you're encountering with the FileUpload control not working properly inside an UpdatePanel is a common one in ASP.NET Web Forms. This occurs because the FileUpload control does not work well with partial postbacks that UpdatePanels utilize. When a partial postback occurs, the file input is reset, and therefor...
15,235
[ { "from": "human", "value": "I'm running into an issue where I have a FileUpload control in an UpdatePanel. When I attempt to save changes and upload the file, no file is found. If I remove the UpdatePanel everything seems to work fine. \nAny ideas why this might be happening? And is there a work-around...
We have a web application that can be deployed on many application servers, including Oracle 10g. On that platform, however, we are having classpath issues. The webapp uses JAXB 2, but Oracle 10g ships with JAXB 1, and this was causing errors. To get around those we configured Oracle to prefer classes in our webapp,...
The "loader constraints violated" exception typically occurs in Java when two different class loaders load classes that are supposed to be from the same package, but are not considered the same due to being loaded by different class loaders. This usually happens in complex environments like application servers, where y...
15,012
[ { "from": "human", "value": "We have a web application that can be deployed on many application servers, including Oracle 10g. On that platform, however, we are having classpath issues. The webapp uses JAXB 2, but Oracle 10g ships with JAXB 1, and this was causing errors. To get around those we configure...
I've googled the hell out of it, and it seems like there is no way to install gcc on OS X without installing Xcode (which takes at leats 1.5GB of space). All I need is gcc and none of the other junk that comes with Xcode. And at this point, I'll take any other kind of C compiler. I know I could simply install Xcode, bu...
Installing GCC or any C compiler on macOS without the full Xcode package can be quite tricky, primarily because macOS typically relies on Xcode’s command line tools for necessary libraries, headers, and other development resources. However, here are a few alternative approaches you can try: 1. **Install Command Line T...
13,268
[ { "from": "human", "value": "I've googled the hell out of it, and it seems like there is no way to install gcc on OS X without installing Xcode (which takes at leats 1.5GB of space). All I need is gcc and none of the other junk that comes with Xcode. And at this point, I'll take any other kind of C compiler...
In C, using the standard Windows API, what is the best way to read an unformatted disk? Specifically, I have an MMC or SD card with data, but no file system (not FAT16, not FAT32, just raw data). If there was a simple way to open the entire card for byte by byte binary access, that would be great. Thanks!
To read an unformatted disk (like an MMC or SD card without a file system) using the Windows API in C, you can use the `CreateFile` function to open the device directly. This allows you to perform low-level read operations on the raw disk. Here's a general approach to achieving this: 1. **Identify the Drive Letter**: ...
12,238
[ { "from": "human", "value": "In C, using the standard Windows API, what is the best way to read an unformatted disk? Specifically, I have an MMC or SD card with data, but no file system (not FAT16, not FAT32, just raw data). If there was a simple way to open the entire card for byte by byte binary access, t...
I use checkstyle to analyze my code. A useful rule is PackageHtml, that checks, if a package contains a Javadoc-description. But with newer java-version it's recommended to use package-info.java instead of package.html. Problem is, checkstyle ignores the package-info.java and reports a rule violation. How can checkstyl...
To configure Checkstyle to accept both `package.html` and `package-info.java` for package documentation, you can customize the Checkstyle configuration file. The `PackageHtml` rule is specifically designed to check for `package.html`, but you need to create a custom check that allows for the documentation in `package-i...
15,269
[ { "from": "human", "value": "I use checkstyle to analyze my code. A useful rule is PackageHtml, that checks, if a package contains a Javadoc-description. But with newer java-version it's recommended to use package-info.java instead of package.html. Problem is, checkstyle ignores the package-info.java and re...
I am looking for different ways to pause and resume programmatically a particular process via its process ID under Windows XP. Process suspend/resume tool does it with SuspendThread / ResumeThread but warns about multi-threaded programs and deadlock problems. PsSuspend looks okay, but I wonder if it does anything speci...
Suspending and resuming a process programmatically in Windows can indeed be tricky, especially with multithreaded applications where improper handling can lead to deadlocks. Below are a few methods you could consider for both C++ and Python, along with considerations regarding deadlocks. ### Method 1: Using `SuspendTh...
8,699
[ { "from": "human", "value": "I am looking for different ways to pause and resume programmatically a particular process via its process ID under Windows XP.\nProcess suspend/resume tool does it with SuspendThread / ResumeThread but warns about multi-threaded programs and deadlock problems.\nPsSuspend looks o...
Is there a way to take substrings of a string with .bat/.cmd files? For example given the string "hello.txt" is there a way to strip the .txt? EDIT: Also is there a more general way to do this, not under the assumption that it is a file name or file path?
Yes, you can take substrings of a string in a batch file (.bat or .cmd) using various methods. If you want to strip the ".txt" extension from a file name like "hello.txt", you can use string manipulation features that are built into the command processor. Below are a few methods, including one that's more general for a...
17,664
[ { "from": "human", "value": "Is there a way to take substrings of a string with .bat/.cmd files?\nFor example given the string \"hello.txt\" is there a way to strip the .txt?\nEDIT: Also is there a more general way to do this, not under the assumption that it is a file name or file path?\n" }, { "fr...
SQL to find duplicate entries (within a group) I have a small problem and I'm not sure what would be the best way to fix it, as I only have limited access to the database (Oracle) itself. In our Table "EVENT" we have about 160k entries, each EVENT has a GROUPID and a normal entry has exactly 5 rows with the same GROUPI...
To identify duplicate entries for each `GROUPID` without resorting to a subquery or temporary tables and while maintaining reasonable performance, you can use a common table expression (CTE) in Oracle SQL to first calculate the counts, and then filter the results based on these counts. Here's how you can do it: 1. **U...
15,862
[ { "from": "human", "value": "SQL to find duplicate entries (within a group)\nI have a small problem and I'm not sure what would be the best way to fix it, as I only have limited access to the database (Oracle) itself.\nIn our Table \"EVENT\" we have about 160k entries, each EVENT has a GROUPID and a normal ...
Can we get people to post code of simple, optimized implementations of the A* pathfinding algorithm, in every single language? This is mostly for fun and to play with what stackoverflow itself is capable of... although I actually am interested in getting an ActionScript 3 version of this. But the idea is that this "Qu...
That sounds like a fun and ambitious project! While I can't directly post on Stack Overflow or any other forum, I can help you get started with a basic implementation of the A* algorithm in a few popular programming languages. You can then use these examples as a basis for soliciting contributions from others for diffe...
4,645
[ { "from": "human", "value": "Can we get people to post code of simple, optimized implementations of the A* pathfinding algorithm, in every single language?\nThis is mostly for fun and to play with what stackoverflow itself is capable of... although I actually am interested in getting an ActionScript 3 versi...
I've been learning Java for about a month now, and not very familiar with a client/server situation like this one. Basically I ran into a situation where our client java software (GUI) displayed a nullpointerexception popup but no stack trace on the client side. Someone had to go check the server side for the stack tra...
In a typical client-server architecture, error handling and logging can indeed become complex. You raise a valid point about the `NullPointerException` not providing sufficient feedback on the client side. Here are some considerations regarding error handling in client-server applications: ### 1. Separation of Concern...
17,737
[ { "from": "human", "value": "I've been learning Java for about a month now, and not very familiar with a client/server situation like this one.\nBasically I ran into a situation where our client java software (GUI) displayed a nullpointerexception popup but no stack trace on the client side. Someone had to ...
How do you use the CSS content property to add HTML entities? Using something like this just prints &nbsp; to the screen instead of the non-breaking space: .breadcrumbs a:before { content: '&nbsp;'; }
The `content` property in CSS is used to insert content before or after an element using the `::before` or `::after` pseudo-elements. However, when using the `content` property, you cannot directly insert HTML entities by writing them as strings (like `&nbsp;`). Instead, you can use Unicode escape sequences or special ...
17,516
[ { "from": "human", "value": "How do you use the CSS content property to add HTML entities?\nUsing something like this just prints &nbsp; to the screen instead of the non-breaking space:\n.breadcrumbs a:before {\n content: '&nbsp;';\n}\n\n" }, { "from": "gpt", "value": "The `content` property in...
Looking into System.Data.DbType there is no SqlVariant type there. SqlDataReader, for example, provides the GetString method for reading into string variable. What is the appropriate way to retrieve data from the database field of type sql_variant, presumably into object? The aim is to read data stored as sql_variant ...
When dealing with the `sql_variant` type in SQL Server, it is indeed true that you won't find a direct mapping for it in the `System.Data.DbType` enumeration, as `sql_variant` is a special type that can store different types of data. When you retrieve data from a database field of type `sql_variant` using `SqlDataRead...
16,194
[ { "from": "human", "value": "Looking into System.Data.DbType there is no SqlVariant type there. SqlDataReader, for example, provides the GetString method for reading into string variable. What is the appropriate way to retrieve data from the database field of type sql_variant, presumably into object? \nThe ...
Basically I want to know how to set center alignment for a cell using VBScript... I've been googling it and can't seem to find anything that helps.
To set center alignment for a cell in Excel using VBScript, you'll need to use the Excel COM object model. Below is a simple example of how to open Excel, create a new workbook, set the value of a cell, and then center-align that cell's content. Here’s a sample VBScript code: ```vbscript ' Create an Excel application...
15,668
[ { "from": "human", "value": "Basically I want to know how to set center alignment for a cell using VBScript...\nI've been googling it and can't seem to find anything that helps.\n" }, { "from": "gpt", "value": "To set center alignment for a cell in Excel using VBScript, you'll need to use the Ex...
Could anyone could point me to some code/give me ideas on how to create a smooth scrolling vertical marquee for VFP 8 or 9? Any help is appreciated.
Creating a smooth scrolling vertical marquee in Visual FoxPro (VFP) 8 or 9 involves utilizing a combination of timer events and control properties to achieve the desired effect. Below, I will outline a simple approach to create a vertical marquee. ### Steps to Create a Vertical Marquee in VFP 1. **Create a New Form**...
13,819
[ { "from": "human", "value": "Could anyone could point me to some code/give me ideas on how to create a smooth scrolling vertical marquee for VFP 8 or 9?\nAny help is appreciated.\n" }, { "from": "gpt", "value": "Creating a smooth scrolling vertical marquee in Visual FoxPro (VFP) 8 or 9 involves ...
Is it possible to apply DRM forward lock to windows mobile applications?
Yes, it is possible to apply DRM (Digital Rights Management) forward lock to Windows Mobile applications, but the implementation and support for such features can vary based on the specific version of Windows Mobile and the tools available at the time. In general, DRM forward lock is a technique used to prevent unauth...
20,398
[ { "from": "human", "value": "Is it possible to apply DRM forward lock to windows mobile applications?\n" }, { "from": "gpt", "value": "Yes, it is possible to apply DRM (Digital Rights Management) forward lock to Windows Mobile applications, but the implementation and support for such features ca...
When programmatically issuing HTTP POST requests, what timeout values would be sensible? In my case, I'm looking to set 'sensible' timeout values when making POST requests in PHP, however this applies to any language. I need to be able to issue a set of requests, each to a user-specified URL. If I do need to process re...
Setting sensible timeout values for HTTP POST requests depends on several factors, including the nature of the application, network conditions, and the expectations for the performance of the remote server. Here are some considerations and suggestions for timeout values: ### General Guidelines for Timeouts 1. **Netwo...
14,656
[ { "from": "human", "value": "When programmatically issuing HTTP POST requests, what timeout values would be sensible?\nIn my case, I'm looking to set 'sensible' timeout values when making POST requests in PHP, however this applies to any language.\nI need to be able to issue a set of requests, each to a use...
Before I upgraded to Firefox 3 I used to constantly use the View Source Chart Firefox Addon which shows the source HTML in a very organized, graphical form. Unfortunately, this addon is only for Firefox 2 and the beta version for Firefox 3 now costs $10 on the author's site. Anyone know of a similar addon that works f...
If you're looking for a similar add-on for Firefox 3 that offers a structured view of HTML source code, there are a few alternatives you can consider that are free: 1. **Web Developer**: This add-on provides a variety of web development tools, including a view source option that can help you visualize the structure of...
14,427
[ { "from": "human", "value": "Before I upgraded to Firefox 3 I used to constantly use the View Source Chart Firefox Addon which shows the source HTML in a very organized, graphical form. Unfortunately, this addon is only for Firefox 2 and the beta version for Firefox 3 now costs $10 on the author's site. \nA...
If you were a programming teacher and you had to choose one sorting algorithm to teach your students which one would it be? I am asking for only one because I just want to introduce the concept of sorting. Should it be the bubble sort or the selection sort? I have noticed that these two are taught most often. Is there ...
If I had to choose one sorting algorithm to teach students the concept of sorting, I would recommend **insertion sort**. Here’s why: 1. **Conceptual Clarity**: Insertion sort is intuitive and closely resembles the way we might sort playing cards in real life. You take one card and insert it into the correct position r...
20,081
[ { "from": "human", "value": "If you were a programming teacher and you had to choose one sorting algorithm to teach your students which one would it be? I am asking for only one because I just want to introduce the concept of sorting. Should it be the bubble sort or the selection sort? I have noticed that t...
What algorithms and processes are involved in storing revision changes like stackoverflow and wikipedia do? Is only one copy of the message kept? And if so is it only the latest copy? Then only changes to go back to the previous version(s) are stored from there? (This would make for a faster display of the main mess...
Storing revision changes in platforms like Stack Overflow and Wikipedia involves a combination of techniques for version control, data storage, and efficient retrieval. Here’s an overview of how it generally works: ### Revision Control 1. **Complete Copy vs. Delta Storage**: - Many systems store both complete copi...
11,199
[ { "from": "human", "value": "What algorithms and processes are involved in storing revision changes like stackoverflow and wikipedia do?\nIs only one copy of the message kept? And if so is it only the latest copy? Then only changes to go back to the previous version(s) are stored from there? (This would ...
I was given a MySQL database file that I need to restore as a database on my Windows Server 2008 machine. I tried using MySQL Administrator, but I got the following error: The selected file was generated by mysqldump and cannot be restored by this application. How do I get this working?
To restore a MySQL database from a dump file generated by `mysqldump`, you'll need to use the MySQL command-line tools instead of MySQL Administrator. Here's how to do it step-by-step on your Windows Server 2008 machine: ### Prerequisites - Ensure that MySQL is installed on your Windows Server 2008 machine. - Make sur...
14,565
[ { "from": "human", "value": "I was given a MySQL database file that I need to restore as a database on my Windows Server 2008 machine.\nI tried using MySQL Administrator, but I got the following error:\n\nThe selected file was generated by\n mysqldump and cannot be restored by\n this application.\n\nHow d...
I would like to have both Eclipse and Netbeans (with JUnit) installed on one system, so I can be somewhat familiar with both. Besides GUI development (see "Using both Eclipse and Netbeans"), are there any other issues with using both IDEs on the same system, or even the same project?
Using both Eclipse and NetBeans on the same system is entirely feasible, and many developers do this to familiarize themselves with different IDEs and their features. Here are some considerations and potential issues to keep in mind: ### General Considerations 1. **Workspace Management**: - Each IDE has its own w...
16,832
[ { "from": "human", "value": "I would like to have both Eclipse and Netbeans (with JUnit) installed on one system, so I can be somewhat familiar with both.\nBesides GUI development (see \"Using both Eclipse and Netbeans\"), are there any other issues with using both IDEs on the same system, or even the same ...
In the past we experienced some problems using a DLL library created with Visual Studio 2005 in our Visual Studio 6.0 application (VS2005 DLL was C++ unmanaged, of course). In your opinion can we fall in the same kind of problem if the library is static (*.lib) and not dynamic?
When working with a static library (`*.lib`) created in Visual Studio 2005 and using it in a Visual Studio 6.0 application, there are several potential issues you should be aware of, although the nature of the problems may differ from those encountered when using a dynamic link library (`*.dll`). ### Potential Issues ...
16,142
[ { "from": "human", "value": "In the past we experienced some problems using a DLL library created with Visual Studio 2005 in our Visual Studio 6.0 application (VS2005 DLL was C++ unmanaged, of course). In your opinion can we fall in the same kind of problem if the library is static (*.lib) and not dynamic?\...
I'm scraping a static html site and moving the content into a database-backed CMS. I'd like to use Textile in the CMS. Is there a tool out there that converts HTML into Textile, so I can scrape the existing site, convert the HTML to Textile, and insert that data into the database?
Yes, there are tools available that can help you convert HTML to Textile format. While there may not be a dedicated tool specifically for this purpose, you can utilize libraries and scripts that facilitate the conversion. Here are a few options you might consider: 1. **HTML to Textile Ruby Library**: If you're comfort...
19,616
[ { "from": "human", "value": "I'm scraping a static html site and moving the content into a database-backed CMS. I'd like to use Textile in the CMS. \nIs there a tool out there that converts HTML into Textile, so I can scrape the existing site, convert the HTML to Textile, and insert that data into the dat...
I know that a SQL Server full text index can not index more than one table. But, I have relationships in tables that I would like to implement full text indexes on. Take the 3 tables below... Vehicle Veh_ID - int (Primary Key) FK_Atr_VehicleColor - int Veh_Make - nvarchar(20) Veh_Model - nvarchar(50) Veh_LicensePlate -...
When designing a database schema that needs to handle full-text search efficiently while maintaining relationships and normalization, you have several options to consider. Here’s a breakdown of the possible approaches based on your requirements and the relationships between the tables. ### Option 1: Maintain Foreign K...
15,174
[ { "from": "human", "value": "I know that a SQL Server full text index can not index more than one table. But, I have relationships in tables that I would like to implement full text indexes on.\nTake the 3 tables below...\nVehicle\nVeh_ID - int (Primary Key)\nFK_Atr_VehicleColor - int\nVeh_Make - nvarchar(2...
I would have thought that it would be clear cut whether memory allocation is faster in managed code than in native code - but there seems to be some controversy. Perhaps memory management under a Virtual Machine be faster because of no context-swapping calls to the OS, but then I see that the VM would itself need to m...
The comparison of memory allocation speed between managed code (such as Java or C# running on a virtual machine) and native code (such as C or C++ running directly on the operating system) is indeed a nuanced topic that depends on a variety of factors, including the specific implementations of memory management, the ru...
15,202
[ { "from": "human", "value": "I would have thought that it would be clear cut whether memory allocation is faster in managed code than in native code - but there seems to be some controversy. Perhaps memory management under a Virtual Machine be faster because of no context-swapping calls to the OS, but then...
I have the following in my Global.asax.cs routes.MapRoute( "Arrival", "{partnerID}", new { controller = "Search", action = "Index", partnerID="1000" } ); routes.MapRoute( "Default", "{controller}/{action}/{id}", new { controller = "Home", action = "Index", id = "" } ); My SearchController look...
It seems you're experiencing a routing issue with ASP.NET MVC in a virtual directory. The routing in ASP.NET MVC can sometimes behave unexpectedly when it's run under a virtual directory if the routes are not configured properly. Here are some things to consider and check: ### 1. Ensure Correct Virtual Directory Confi...
16,149
[ { "from": "human", "value": "I have the following in my Global.asax.cs\nroutes.MapRoute(\n \"Arrival\",\n \"{partnerID}\",\n new { controller = \"Search\", action = \"Index\", partnerID=\"1000\" }\n);\n\nroutes.MapRoute(\n \"Default\",\n \"{controller}/{action}/{id}\",\n new { controller =...
I enjoy programming, usually. Tedious stuff is easy to get done as quickly and correctly as possible so I can get through it and not have to see it again. But a lot of my coding is fun and when I get in the 'zone' I just really enjoy myself. Which is where I make the mistake of spending too much time, perhaps adding f...
Hi Adam, It sounds like you have a healthy passion for programming, which is a fantastic trait! However, it's understandable that the fun can sometimes lead to over-investing time in projects. Here are some strategies to help you recognize when you're getting too deep and how to manage your time effectively: ### Reco...
10,856
[ { "from": "human", "value": "I enjoy programming, usually. Tedious stuff is easy to get done as quickly and correctly as possible so I can get through it and not have to see it again.\nBut a lot of my coding is fun and when I get in the 'zone' I just really enjoy myself.\nWhich is where I make the mistake ...
Anyone have any idea how to do the following? declare cursor open cursor fetch cursor << Start reading the cursor in a LOOP >> Lets say the cursor have 10 records. Read until 5th record then go to the 6th record and do some checking. Now, is it possible to go back to 5th record from 6th record ?
In most SQL database systems, once you've fetched a cursor to a certain position, you cannot directly move backward in that cursor to revisit a previously fetched record. Cursors typically operate in a forward-only manner, meaning you can read from the beginning to the end, but not in reverse. However, there are a cou...
16,257
[ { "from": "human", "value": "Anyone have any idea how to do the following?\ndeclare cursor\nopen cursor\nfetch cursor \n<< Start reading the cursor in a LOOP >>\nLets say the cursor have 10 records.\nRead until 5th record then go to the 6th record and do some checking.\nNow, is it possible to go back to 5th...
This morning I ran into an issue with returning back a text string as result from a Web Service call. the Error I was getting is below ************** Exception Text ************** System.ServiceModel.CommunicationException: Error in deserializing body of reply message for operation 'GetFilingTreeXML'. ---> System.Inval...
The error message you're encountering indicates that the response from the web service call exceeds the maximum allowed size for string content in the XML data. The default maximum string content length in WCF is set to 8192 characters, which is why you're getting the exception when the response exceeds this limit. To...
15,387
[ { "from": "human", "value": "This morning I ran into an issue with returning back a text string as result from a Web Service call. the Error I was getting is below\n************** Exception Text **************\nSystem.ServiceModel.CommunicationException: Error in deserializing body of reply message for oper...
I have built a CFC designed to serve as a dynamic, aging cache intended for almost everything worth caching. LDAP queries, function results, arrays, ojects, you name it. Whatever takes time or resources to calculate and is needed more than once. I'd like to be able to do a few things: share the CFC between application...
You're on the right track with your design goals for the caching CFC. Here are some suggestions to implement your caching mechanism effectively, with a focus on modularity, scope management, and locking: ### 1. **Flexible Scope Definition** To allow for flexible cache scope (server, application, session, request), co...
12,796
[ { "from": "human", "value": "I have built a CFC designed to serve as a dynamic, aging cache intended for almost everything worth caching. LDAP queries, function results, arrays, ojects, you name it. Whatever takes time or resources to calculate and is needed more than once. I'd like to be able to do a few t...
I do mostly Java and C/C++ development, but I'm starting to do more web development (PHP, Rails) and Eiffel (learning a new language is always good). Currently, I use Eclipse for Java, C/C++, and Ruby (not Rails). Since I know the environment, I'm thinking that it would be easier for me to find a plugin and use Eclipse...
Using a single IDE like Eclipse for multiple programming languages can definitely streamline your development process, especially since you’re already familiar with it. However, there are cases where a language-specific IDE can offer significant advantages over a general-purpose IDE like Eclipse. Here are some consider...
18,639
[ { "from": "human", "value": "I do mostly Java and C/C++ development, but I'm starting to do more web development (PHP, Rails) and Eiffel (learning a new language is always good).\nCurrently, I use Eclipse for Java, C/C++, and Ruby (not Rails). Since I know the environment, I'm thinking that it would be easi...
I'm using the d programing language to write a program, and I'm trying to use ddbg to debug it. When there is an exception, I want to have the program break whenever there is an exception thrown so that I can inspect the stack. Alternatively, is there another debugger that works with d? Is there another way to get a ...
To enable breaking on exceptions using `ddbg` in the D programming language, you can make use of a specific feature of the debugger that allows it to halt execution when an exception is thrown. This can be extremely useful for inspecting the stack and diagnosing issues. ### Using ddbg 1. **Set Breakpoints for Excepti...
14,460
[ { "from": "human", "value": "I'm using the d programing language to write a program, and I'm trying to use ddbg to debug it. When there is an exception, I want to have the program break whenever there is an exception thrown so that I can inspect the stack.\nAlternatively, is there another debugger that wor...
I'm wondering if it's possible to distribute a RoR app for production use without source code? I've seen this post on SO, but my situation is a little different. This would be an app administered by people with some clue, so I'm cool with still requiring an Apache/Mongrel/MySQL setup on the customer end. All I reall...
Distributing a Ruby on Rails (RoR) application without exposing its source code presents a challenge, particularly due to the open-source nature of Ruby. However, there are a few approaches you can consider to protect your code, some of which you've already mentioned: 1. **JRuby**: As you pointed out, using JRuby can ...
15,367
[ { "from": "human", "value": "I'm wondering if it's possible to distribute a RoR app for production use without source code? I've seen this post on SO, but my situation is a little different. This would be an app administered by people with some clue, so I'm cool with still requiring an Apache/Mongrel/MySQ...
According to the doucmentation for "Directory.Delete( "path", true )", it remove directories, subdirectories, and files in the path. What does Directory.Delete( "path", false ) do? According to the doucmentation it does "otherwise". I mean how can you delete a directory without removing the directory, subdirectories, a...
The `Directory.Delete(string path, bool recursive)` method in C# is used to delete a directory at the specified `path`. The second parameter, `recursive`, determines whether the deletion should also remove any subdirectories and files within that directory. Here's a breakdown of the behavior of the method depending on...
18,088
[ { "from": "human", "value": "According to the doucmentation for \"Directory.Delete( \"path\", true )\", it remove directories, subdirectories, and files in the path.\nWhat does Directory.Delete( \"path\", false ) do? According to the doucmentation it does \"otherwise\".\nI mean how can you delete a director...
Is there a built in dll that will give me a list of links from a string. I want to send in a string with valid html and have it parse all the links. I seem to remember there being something built into either .net or an unmanaged library. I found a couple open source projects that looked promising but I thought there wa...
In .NET, there isn't a built-in DLL specifically for parsing HTML and extracting links. However, you can accomplish this using the built-in `System.Xml` namespace or by using `System.Net.Http` to fetch the HTML if it's coming from a URL, combined with regular expressions or the HTML Agility Pack. If you're looking for...
12,187
[ { "from": "human", "value": "Is there a built in dll that will give me a list of links from a string. I want to send in a string with valid html and have it parse all the links. I seem to remember there being something built into either .net or an unmanaged library.\nI found a couple open source projects th...
I have TurtoiseSVN and ankhSVN installed. I created a repository on my computer: C:\Documents and Settings\user1\My Documents\Subversion\Repository\. I am trying to connect to this repository from my co-worker's computer. What should this URL be?
To connect to your Subversion repository from your co-worker's computer, you need to use the appropriate URL format based on how the repository is accessed. Here are some options: 1. **File Protocol (Local Access)**: If your co-worker is on the same local network and can access your computer directly, you can use a fi...
19,410
[ { "from": "human", "value": "I have TurtoiseSVN and ankhSVN installed. I created a repository on my computer: C:\\Documents and Settings\\user1\\My Documents\\Subversion\\Repository\\.\nI am trying to connect to this repository from my co-worker's computer. What should this URL be?\n" }, { "from": ...
I want to convert a string into a double and after doing some math on it, convert it back to a string. How do I do this in Objective-C? Is there a way to round a double to the nearest integer too?
In Objective-C, you can convert a string to a double using the `doubleValue` method of the NSString class. After performing your mathematical operations on the double, you can convert it back to a string using the `stringWithFormat:` method or by using `NSString`'s `stringValue` method. To round a double to the nearest...
18,396
[ { "from": "human", "value": "I want to convert a string into a double and after doing some math on it, convert it back to a string.\nHow do I do this in Objective-C?\nIs there a way to round a double to the nearest integer too?\n" }, { "from": "gpt", "value": "In Objective-C, you can convert a s...
I am doing profiling of a C code in Microsoft VS 2005 on a Intel Core-2Duo platform. I measure the time(secs:millisecs) counsumed by my function. But i have some doubts about the accuracy of this measurement as the operating system will not continuously run my application, but instead schedule others apps/services in ...
Profiling applications in a multitasking environment like Windows can indeed yield results that are affected by OS scheduling and other overheads. Here are a few suggestions and methods to more accurately assess the performance of your application, as well as to get a sense of the overhead introduced by the operating s...
14,907
[ { "from": "human", "value": "I am doing profiling of a C code in Microsoft VS 2005 on a Intel Core-2Duo platform. \nI measure the time(secs:millisecs) counsumed by my function. But i have some doubts about the accuracy of this measurement as the operating system will not continuously run my application, but...
Our application is written in ActionScript2 and has about 50.000+ lines of code. We want to port it to ActionScript3 and we're trying to find out what our options are. Do we have to do it manually or can we use a converter, and what problems can we expect?
Porting an application from ActionScript 2 (AS2) to ActionScript 3 (AS3) is a significant undertaking, given the substantial changes in the programming model and language features. Here are some key considerations and options for your migration process: ### Options for Porting 1. **Manual Conversion**: - The most ...
13,311
[ { "from": "human", "value": "Our application is written in ActionScript2 and has about 50.000+ lines of code. We want to port it to ActionScript3 and we're trying to find out what our options are. Do we have to do it manually or can we use a converter, and what problems can we expect? \n" }, { "from...
I am trying to pass a member function within a class to a function that takes a member function class pointer. The problem I am having is that I am not sure how to properly do this within the class using the this pointer. Does anyone have suggestions? Here is a copy of the class that is passing the member function: c...
To properly pass a member function of a class to another function, you need to ensure that you're using the correct syntax for member function pointers, especially since member functions require an instance (or a `this` pointer) to be called. Let's go through the steps and identify where changes are needed. ### Code C...
13,499
[ { "from": "human", "value": "I am trying to pass a member function within a class to a function that takes a member function class pointer. The problem I am having is that I am not sure how to properly do this within the class using the this pointer. Does anyone have suggestions?\nHere is a copy of the cl...
I'm using Team Foundation Build but we aren't yet using TFS for problem tracking, so I would like to disable the work item creation on a failed build. Is there any way to do this? I tried commenting out the work item info in the TFSBuild.proj file for the build type but that didn't do the trick.
In Team Foundation Build (TFS Build), when a build fails, it typically tries to create a work item based on the failure. If you want to disable this feature, there are several approaches you can take, depending on the version of TFS you are using. Here’s how you can disable work item creation on a failed build: ### Me...
15,758
[ { "from": "human", "value": "I'm using Team Foundation Build but we aren't yet using TFS for problem tracking, so I would like to disable the work item creation on a failed build. Is there any way to do this? I tried commenting out the work item info in the TFSBuild.proj file for the build type but that did...
Some ways to iterate through the characters of a string in Java are: Using StringTokenizer? Converting the String to a char[] and iterating over that. What is the easiest/best/most correct way to iterate?
In Java, there are several ways to iterate through the characters of a string, and the best choice depends on your specific use case. Here are some common methods: 1. **Using a for loop with `charAt()`**: This is one of the most straightforward and common methods. You can use a simple for loop to access each charac...
18,762
[ { "from": "human", "value": "Some ways to iterate through the characters of a string in Java are:\n\nUsing StringTokenizer?\nConverting the String to a char[] and iterating over that.\n\nWhat is the easiest/best/most correct way to iterate?\n" }, { "from": "gpt", "value": "In Java, there are sev...
I've used DTCTester before to diagnose MSDTC problems. However, I just noticed DTCPing seems to do about the same thing. What's the difference between these two? From what I can tell so far, DTCPing needs to run on both client and server machines, whereas DTCTester only needs to run from the client. Are there any other...
You're correct that both **DTCTester** and **DTCPing** are tools used to diagnose issues related to Microsoft Distributed Transaction Coordinator (MSDTC). However, they have different purposes and operational mechanics: ### DTCTester - **Primary Purpose**: DTCTester is designed primarily to test the ability of a clien...
16,773
[ { "from": "human", "value": "I've used DTCTester before to diagnose MSDTC problems. However, I just noticed DTCPing seems to do about the same thing. What's the difference between these two?\nFrom what I can tell so far, DTCPing needs to run on both client and server machines, whereas DTCTester only needs t...
This certainly presupposes that unit testing is a good thing. Our projects have some level of unit testing, but it's inconsistent at best. What are the most convincing ways that you have used or have had used with you to convince everyone that formalized unit testing is a good thing and that making it required is reall...
Convincing stakeholders of the importance of formalized unit testing can often be a challenge, especially in environments where development practices may not be well-defined. However, there are several key arguments and strategies you can use to advocate for more consistent and formalized unit testing practices within ...
13,591
[ { "from": "human", "value": "This certainly presupposes that unit testing is a good thing. Our projects have some level of unit testing, but it's inconsistent at best.\nWhat are the most convincing ways that you have used or have had used with you to convince everyone that formalized unit testing is a good ...
Ryan Delucchi asked here in comment #3 to Tom Hawtin's answer: why is Class.newInstance() "evil"? this in response to the code sample: // Avoid Class.newInstance, for it is evil. Constructor<? extends Runnable> ctor = runClass.getConstructor(); Runnable doRun = ctor.newInstance(); so, why is it Evil?
The term "evil" in programming often refers to practices that can lead to issues such as maintainability problems, performance overhead, or errors that are hard to diagnose. In the case of `Class.newInstance()`, the reasons it is considered "evil" are as follows: 1. **Deprecated Method**: `Class.newInstance()` is a me...
18,894
[ { "from": "human", "value": "Ryan Delucchi asked here in comment #3 to Tom Hawtin's answer:\n\nwhy is Class.newInstance() \"evil\"?\n\nthis in response to the code sample:\n// Avoid Class.newInstance, for it is evil.\nConstructor<? extends Runnable> ctor = runClass.getConstructor();\nRunnable doRun = ctor.n...
How can I tell if an assembly is in use by any process?
Determining if a specific assembly (such as a DLL or executable) is in use by any process can be approached using various tools and techniques, depending on your operating system. Below are methods for both Windows and Unix-based systems. ### On Windows: 1. **Using Process Explorer:** - Download **Process Explorer...
17,148
[ { "from": "human", "value": "How can I tell if an assembly is in use by any process?\n" }, { "from": "gpt", "value": "Determining if a specific assembly (such as a DLL or executable) is in use by any process can be approached using various tools and techniques, depending on your operating system...
Although perhaps a bizare thing to want to do, I need to create an Array in .Net with a lower bound > 0. This at first seems to be possible, using: Array.CreateInstance(typeof(Object), new int[] {2}, new int[] {9}); Produces the desired results (an array of objects with a lower bound set to 9). However the created arr...
In .NET, when you create a single-dimensional array with a non-zero lower bound using `Array.CreateInstance`, you're not creating a standard `Object[]` array. Instead, you are creating a special array type with a distinct internal representation, which is why you are encountering casting issues when trying to cast it t...
17,379
[ { "from": "human", "value": "Although perhaps a bizare thing to want to do, I need to create an Array in .Net with a lower bound > 0. This at first seems to be possible, using:\nArray.CreateInstance(typeof(Object), new int[] {2}, new int[] {9});\n\nProduces the desired results (an array of objects with a lo...
I know it is not recommended, but is it at all possible to pass the user's password to scp? I'd like to copy a file via scp as part of a batch job and the receiving server does, of course, need a password and, no, I cannot easily change that to key-based authentication.
While it is technically possible to pass a password to `scp`, it is not recommended due to security reasons. However, if you must automate the file transfer using `scp` and cannot set up key-based authentication, you can use a few methods that might help. 1. **Using `sshpass`:** This utility allows you to provide a p...
17,924
[ { "from": "human", "value": "I know it is not recommended, but is it at all possible to pass the user's password to scp?\nI'd like to copy a file via scp as part of a batch job and the receiving server does, of course, need a password and, no, I cannot easily change that to key-based authentication.\n" },...
I am trying to convert an ASP.NET website into a web application project. The conversion has gone ok I think apart from previously I had 2 xsd files in the App_Code folder. I believe this folder is not used in web applications projects, so where would I put xsd files now.
In ASP.NET Web Application Projects, the `App_Code` folder is not used as it is in Web Site Projects. Instead, you can organize your XSD files in a different way within your Web Application Project. Here are a couple of options for where you can place your XSD files: 1. **Create a New Folder**: You can create a new f...
18,068
[ { "from": "human", "value": "I am trying to convert an ASP.NET website into a web application project. The conversion has gone ok I think apart from previously I had 2 xsd files in the App_Code folder. I believe this folder is not used in web applications projects, so where would I put xsd files now.\n" }...
I am trying to make SVG XML documents with a mixture of lines and brief text snippets (two or three words typically). The major problem I'm having is getting the text aligning with line segments. For horizontal alignment I can use text-anchor with left, middle or right. I can't find a equivalent for vertical alignment;...
In SVG, the vertical alignment of text can indeed be a bit tricky, but there are proper methods for aligning text relative to line segments. The `alignment-baseline` attribute is what you should use for vertical alignment, but it may not always behave as expected due to the differing ways it interacts with different ty...
17,058
[ { "from": "human", "value": "I am trying to make SVG XML documents with a mixture of lines and brief text snippets (two or three words typically). The major problem I'm having is getting the text aligning with line segments.\nFor horizontal alignment I can use text-anchor with left, middle or right. I can't...
Possible Duplicate: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result When I run my php page, I get this error and do not know what's wrong, can anyone help? If anyone needs more infomation, I'll post the whole code. Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL resul...
The warning you're encountering indicates that the result of your SQL query (`$result`) is not a valid resource. This typically happens for a few reasons, such as: 1. **Error in the SQL Query:** The SQL statement may be incorrect, which leads to the query failing. You should check if the table `tb_address_book` exists...
17,055
[ { "from": "human", "value": "\nPossible Duplicate:\nWarning: mysql_fetch_array(): supplied argument is not a valid MySQL result \n\nWhen I run my php page, I get this error and do not know what's wrong, can anyone help? If anyone needs more infomation, I'll post the whole code.\nWarning: mysql_fetch_assoc()...
I have a winforms application, the issue has to do with threading. Since I am calling 'MyCustomCode() which creates a new thread, and calls the method 'SomeMethod()' which then accesses MessageBox.Show(...). The problem has to do with threading, since the newly created thread is trying to access a control that was cre...
The error you're experiencing, "Cross-thread operation not valid," occurs because you are trying to access the UI elements from a thread that did not create them. In Windows Forms, all interactions with the UI should occur on the main UI thread. To fix this issue, you can use the `Invoke` method of the form to marshal...
18,285
[ { "from": "human", "value": "I have a winforms application, the issue has to do with threading.\nSince I am calling 'MyCustomCode() which creates a new thread, and calls the method\n'SomeMethod()' which then accesses MessageBox.Show(...).\nThe problem has to do with threading, since the newly created thread...
When I need some complex algorithm I first check if there's anything relevant already published on the Internet. 10 times out of 10 I'll find that someone already have figured out a solution much smarter than what I would have thought of. Apart from a generic Google search, I use: Citeseer That has a lot of good theo...
Certainly! There are several other resources where you can find quality computer science articles, papers, and research. Here are some notable ones: 1. **Google Scholar**: This is a specialized search engine for scholarly literature across various disciplines. You can find a wide range of articles, theses, books, and ...
16,781
[ { "from": "human", "value": "When I need some complex algorithm I first check if there's anything relevant already published on the Internet. 10 times out of 10 I'll find that someone already have figured out a solution much smarter than what I would have thought of.\nApart from a generic Google search, I u...
In Python, you can do this: print "Hi! I'm %(name)s, and I'm %(age)d years old." % ({"name":"Brian","age":30}) What's the closest, simplest Ruby idiom to replicate this behavior? (No monkeypatching the String class, please.) One of the really excellent benefits of this is that you can store the pre-processed string ...
In Ruby, while you can't use the same syntax as Python's string formatting with `%`, you can achieve similar functionality using the `String#%` method along with a hash to substitute variables. Here’s how you can replicate the behavior you described: ```ruby template = "Hi! I'm %{name}, and I'm %{age} years old." def...
18,770
[ { "from": "human", "value": "In Python, you can do this:\nprint \"Hi! I'm %(name)s, and I'm %(age)d years old.\" % ({\"name\":\"Brian\",\"age\":30})\n\nWhat's the closest, simplest Ruby idiom to replicate this behavior? (No monkeypatching the String class, please.)\nOne of the really excellent benefits of...
I am writing a C# program which captures signals from a external device, and sends keystrokes to another application. I am using SendKeys and it works fine. SendKeys does "press" a key by holding and releasing it immediately. I would like to make it push key and release it at will. My question is : "is there a way to s...
`SendKeys` in C# is not designed for simulating longer key presses, as it sends key presses and releases immediately. To achieve the functionality of holding a key down for a specified duration, you can use the Windows API functions to manually manage the key press and release events. You can achieve this using the `...
15,661
[ { "from": "human", "value": "I am writing a C# program which captures signals from a external device, and sends keystrokes to another application. I am using SendKeys and it works fine.\nSendKeys does \"press\" a key by holding and releasing it immediately. I would like to make it push key and release it at...
What are the different database options on Windows Mobile available? I have used CEDB and EDB for linear dataset needs. I have heard of SQL server 2005 Mobile edition. But what are the advantages over others (if there is any)
On Windows Mobile, there were several database options available for developers, each catering to different needs and use cases. Here's a breakdown of some of the primary databases: ### 1. **CEDB (Compact Embedded Database)** - **Type**: Key-value store - **Use Case**: Suitable for simple datasets that require a light...
14,481
[ { "from": "human", "value": "What are the different database options on Windows Mobile available?\nI have used CEDB and EDB for linear dataset needs.\nI have heard of SQL server 2005 Mobile edition. But what are the advantages over others (if there is any)\n" }, { "from": "gpt", "value": "On Win...
I have a specific changeset that I want to "rollback" my Development branch to, but I want to take all of the the changes after that specific changeset and put them in to a new branch. Is this possible in TFS? If so, how could I do such a thing? Thanks, Dave
Yes, it's possible to rollback a branch in TFS (Team Foundation Server) to a specific changeset while preserving the changes made after that changeset in a new branch. Here's how you can do this: ### Step 1: Identify Changeset First, you need to identify the changeset number of the changeset you want to roll back to....
16,642
[ { "from": "human", "value": "I have a specific changeset that I want to \"rollback\" my Development branch to, but I want to take all of the the changes after that specific changeset and put them in to a new branch. Is this possible in TFS? If so, how could I do such a thing?\nThanks,\nDave\n" }, { ...
How do I create a windows application that does the following: it's a regular GUI app when invoked with no command line arguments specifying the optional "--help" command line argument causes the app to write usage text to stdout then terminate it must be a single executable. No cheating by making a console app exec ...
Creating a Windows application that meets your specified requirements involves a few steps. You'll be using the Windows API for creating a GUI application that can also handle command-line arguments. The idea is to implement a GUI that can optionally display a window based on the command-line arguments. Here's a simpl...
11,323
[ { "from": "human", "value": "How do I create a windows application that does the following:\n\nit's a regular GUI app when invoked with no command line arguments\nspecifying the optional \"--help\" command line argument causes the app to write usage text to stdout then terminate\nit must be a single executa...
I'm experimenting with internationalization by making a Hello World program that uses properties files + ResourceBundle to get different strings. Specifically, I have a file "messages_en_US.properties" that stores "hello.world=Hello World!", which works fine of course. I then have a file "messages_ja_JP.properties" whi...
It's great to hear that you figured out the issue with your `properties` files! Internationalization can be a bit tricky, especially when it comes to character encoding. For anyone else facing similar issues with Japanese strings in `properties` files, here’s a summary of the key points to ensure proper encoding and d...
18,230
[ { "from": "human", "value": "I'm experimenting with internationalization by making a Hello World program that uses properties files + ResourceBundle to get different strings.\nSpecifically, I have a file \"messages_en_US.properties\" that stores \"hello.world=Hello World!\", which works fine of course.\nI t...
Just found this out the hard way. I wanted to pop up a FontDialog to allow the user to choose a font.. one of those familiar dialogs..
If you're looking to implement a font selection dialog in your application, you can use the `FontDialog` class available in Windows Forms for .NET applications. Here's a simple example of how to do this in C#. ### Example Code 1. Ensure you have the appropriate using directive at the top of your code file: ```csh...
12,776
[ { "from": "human", "value": "Just found this out the hard way. I wanted to pop up a FontDialog to allow the user to choose a font.. one of those familiar dialogs..\n" }, { "from": "gpt", "value": "If you're looking to implement a font selection dialog in your application, you can use the `FontDi...
I always seem to use Get when working with data (strongly typed or otherwise) from the database and I have never really needed to use Fill although I just as easily could use Fill instead of get when pulling out and updating data. Can anyone provide guidance as to the implications and gotchas of each method? In what s...
When working with data from a database, especially in the context of ADO.NET or similar frameworks in .NET, you typically encounter two main methods for retrieving data: `Get` (often associated with methods like `ExecuteReader`, `ExecuteScalar`, or direct querying into objects) and `Fill` (often associated with `DataAd...
15,694
[ { "from": "human", "value": "I always seem to use Get when working with data (strongly typed or otherwise) from the database and I have never really needed to use Fill although I just as easily could use Fill instead of get when pulling out and updating data.\nCan anyone provide guidance as to the implicati...
For various reasons a web application would be best suite a project that I am working on but I am worried about the user interface. There will be a lot of pick and choose options that could be handled by check lists, combo boxes, etc… and to a lesser extent their will be some free text fields. However, I am concerned...
Designing a user interface for a web application that will be used on touchscreen computers in a manufacturing environment poses unique challenges, especially with regard to usability, accessibility, and durability. Here are some recommendations to ensure that your web application is user-friendly and functional in suc...
15,094
[ { "from": "human", "value": "For various reasons a web application would be best suite a project that I am working on but I am worried about the user interface. There will be a lot of pick and choose options that could be handled by check lists, combo boxes, etc… and to a lesser extent their will be some f...
I have a dtsx package with a precedence constraint that evaluates an expression and a constraint. The constraint is "success" and the expression is "@myVariable" == 3. myVariable is an int32, and when set in Visual Studio's design GUI the package executes fine. There are two other paths that check for the value to b...
The issue you're experiencing appears to be related to the way you're setting the value for `myVariable` in the `dtexec` command. When you specify `3` in your command, it should be passed correctly as an integer value. However, it's crucial to ensure that the syntax and structure of the command are correct, especially ...
16,533
[ { "from": "human", "value": "I have a dtsx package with a precedence constraint that evaluates an expression and a constraint. The constraint is \"success\" and the expression is \"@myVariable\" == 3. myVariable is an int32, and when set in Visual Studio's design GUI the package executes fine. There are ...
I've only recently started working with asp.net and c#. Is there a standard practice set of web.config settings for a live final website? There seem to be a ton of options available and I'm looking to streamline performance, close possible security holes and other unnecessary options.
Absolutely! When deploying an ASP.NET application to a production environment, it's crucial to configure your `web.config` file for both performance and security. Below are some standard practices for configuring `web.config` in a live environment: ### Basic Configuration Settings 1. **Compilation Settings:** Set ...
9,989
[ { "from": "human", "value": "I've only recently started working with asp.net and c#. Is there a standard practice set of web.config settings for a live final website? There seem to be a ton of options available and I'm looking to streamline performance, close possible security holes and other unnecessary op...