instruction
stringlengths
14
27.6k
completion
stringlengths
3
38.3k
__original_row_idx
int64
0
50k
conversations
listlengths
2
2
I would like to take a pascal-cased string like "CountOfWidgets" and convert it into something more user-friendly like "Count of Widgets" in C#. Multiple adjacent uppercase characters should be left intact. What is the most efficient way to do this? NOTE: Duplicate of .NET - How can you split a "caps" delimited string ...
To convert a Pascal-cased string like "CountOfWidgets" into a more user-friendly format like "Count of Widgets" in C#, you can use regular expressions. The idea is to identify the boundaries between words based on uppercase letters while taking care to maintain multiple adjacent uppercase letters intact. Here's an eff...
42,377
[ { "from": "human", "value": "I would like to take a pascal-cased string like \"CountOfWidgets\" and convert it into something more user-friendly like \"Count of Widgets\" in C#. Multiple adjacent uppercase characters should be left intact. What is the most efficient way to do this?\nNOTE: Duplicate of .NET ...
How can I parse integers passed to an application as command line arguments if the app is unicode? Unicode apps have a main like this: int _tmain(int argc, _TCHAR* argv[]) argv[?] is a wchar_t*. That means i can't use atoi. How can I convert it to an integer? Is stringstream the best option?
When working with command-line arguments in a Unicode application where the main function signature is `int _tmain(int argc, _TCHAR* argv[])`, you are indeed dealing with `wchar_t` strings, so functions like `atoi` (which operates on `char`) are not suitable. Instead, you can use the appropriate functions to convert wi...
39,934
[ { "from": "human", "value": "How can I parse integers passed to an application as command line arguments if the app is unicode?\nUnicode apps have a main like this:\nint _tmain(int argc, _TCHAR* argv[])\n\nargv[?] is a wchar_t*. That means i can't use atoi. How can I convert it to an integer? Is stringstrea...
I have a trigger in which I want to have a variable that holds an INT I get from a SELECT, so I can use it in two IF statements instead of calling the SELECT twice. How do you declare/use variables in MySQL triggers?
In MySQL, you can declare and use variables within a trigger using the `DECLARE` statement. Variables in MySQL triggers are scoped to the trigger body and you can assign values to them using `SELECT INTO`. Below is an example of how to do this: 1. Declare a variable using the `DECLARE` statement. 2. Use the `SELECT .....
39,839
[ { "from": "human", "value": "I have a trigger in which I want to have a variable that holds an INT I get from a SELECT, so I can use it in two IF statements instead of calling the SELECT twice. How do you declare/use variables in MySQL triggers?\n" }, { "from": "gpt", "value": "In MySQL, you can...
I have a large array with a range of integers that are mostly continuous, eg 1-100, 110-160, etc. All integers are positive. What would be the best algorithm to compress this? I tried the deflate algorithm but that gives me only 50% compression. Note that the algorithm cannot be lossy. All numbers are unique and progre...
To compress an array of mostly continuous integers that are positive and unique, a common approach is to use techniques that take advantage of the properties of the data, such as delta encoding or run-length encoding, rather than general-purpose compression algorithms like deflate. Here's a brief overview of two suit...
34,700
[ { "from": "human", "value": "I have a large array with a range of integers that are mostly continuous, eg 1-100, 110-160, etc. All integers are positive.\nWhat would be the best algorithm to compress this?\nI tried the deflate algorithm but that gives me only 50% compression.\nNote that the algorithm cannot...
I want to do exactly the same as in this question: Windows file system is case insensitive. How, given a file/folder name (e.g. "somefile"), I get the actual name of that file/folder (e.g. it should return "SomeFile" if Explorer displays it so)? But I need to do it in .NET and I want the full path (D:/Temp/Foobar.xml...
In .NET, you can obtain the actual name of a file or folder (with the correct case) in a case-insensitive file system like Windows by using the `DirectoryInfo` and `FileInfo` classes. However, simply using `FullName` will not give you the correct case representation. Instead, you can use the `EnumerateFiles` and `Enume...
38,829
[ { "from": "human", "value": "I want to do exactly the same as in this question:\n\nWindows file system is case insensitive. How, given a file/folder name (e.g. \"somefile\"), I get the actual name of that file/folder (e.g. it should return \"SomeFile\" if Explorer displays it so)?\n\nBut I need to do it in ...
Seems likes it might be useful to have the assert display a message when an assertion fails. Currently an AssertionError gets thrown, can you specify a custom message for it? Can you show an example mechanism for doing this (other than creating your own exception type and throwing it)?
Yes, in Python, you can customize the message that is displayed when an assertion fails by providing a second argument to the `assert` statement. This second argument will be used as the message for the `AssertionError` when the assertion is not true. Here’s a simple example to illustrate this: ```python def check_po...
41,007
[ { "from": "human", "value": "Seems likes it might be useful to have the assert display a message when an assertion fails.\nCurrently an AssertionError gets thrown, can you specify a custom message for it?\nCan you show an example mechanism for doing this (other than creating your own exception type and thro...
I have a session class that needs to store session information in a MySQL database. Obviously I will need to query the database in the methods of this class. In general I may need to connect more than one database simultaneously and may or may not be connected to that database already. Given that, what's the best w...
Creating a class to manage database connections is an excellent approach for your session management needs, especially if you plan to handle multiple databases simultaneously and manage connections efficiently. Here’s a breakdown of how you can structure this: ### 1. Database Connection Manager Class You can create a...
34,424
[ { "from": "human", "value": "I have a session class that needs to store session information in a MySQL database. Obviously I will need to query the database in the methods of this class. In general I may need to connect more than one database simultaneously and may or may not be connected to that database...
In working with another company I'm trying to write a SOAP client to talk to their service. The service itself has no wsdl-files but I've managed to successfully write my own proxy class inheriting from SoapHttpClientProtocol. Basic methods that only return an integer or a single value is not a problem but when I try t...
When working with SOAP services and parsing the responses, the key aspects to focus on are ensuring the proper handling of the XML response structure and understanding the namespaces used. Given the XML response you've provided, it appears that you're encountering issues with parsing the returned results into your expe...
36,375
[ { "from": "human", "value": "In working with another company I'm trying to write a SOAP client to talk to their service. The service itself has no wsdl-files but I've managed to successfully write my own proxy class inheriting from SoapHttpClientProtocol. Basic methods that only return an integer or a singl...
I expect the column to be a VARCHAR2, in my Oracle Database. US Zips are 9. Canadian is 7. I am thinking 32 characters would be reasonable upper limit What am I missing? [EDIT] TIL: 12 is a reasonable answer to the question Thanks to everyone who contributed.
It looks like you are working with ZIP code formats for both US and Canadian addresses and are considering the maximum size for a column in your Oracle Database. Here's a breakdown of your considerations: 1. **US ZIP Codes**: - Standard US ZIP codes are 5 digits (e.g., 90210). - ZIP+4 codes include the 5 digits...
41,566
[ { "from": "human", "value": "I expect the column to be a VARCHAR2, in my Oracle Database.\nUS Zips are 9.\nCanadian is 7.\nI am thinking 32 characters would be reasonable upper limit\nWhat am I missing?\n[EDIT]\nTIL: 12 is a reasonable answer to the question\nThanks to everyone who contributed.\n" }, { ...
I am using NHibernate on a new ASP.NET project, and am running into what I believe to be strange behavior. I am attempting to manage my session by using an HttpModule to catch the EndRequest event and close the session. This is working fine, however, after the EndRequest event fires, I am getting an exception in the ...
The behavior you're experiencing with NHibernate and lazy loading in your ASP.NET project is related to the lifecycle of your HTTP request and how NHibernate manages sessions and lazy-loaded properties. ### Explanation of the Issue 1. **NHibernate Session Lifecycle**: - NHibernate operates with a session that is t...
38,639
[ { "from": "human", "value": "I am using NHibernate on a new ASP.NET project, and am running into what I believe to be strange behavior. I am attempting to manage my session by using an HttpModule to catch the EndRequest event and close the session. This is working fine, however, after the EndRequest event...
Is it possible to create a list that can be access by either an index or a key? I am looking for a Collection type that already exists but has this facility, I want to avoid redefining the indexers
Yes, in C# you can use the `Dictionary<TKey, TValue>` along with a `List<T>` to create a collection that can be accessed by both an index and a key. However, if you want a built-in collection type that supports this functionality without having to redefine indexers, the most straightforward approach is to create a cust...
39,707
[ { "from": "human", "value": "Is it possible to create a list that can be access by either an index or a key?\nI am looking for a Collection type that already exists but has this facility, I want to avoid redefining the indexers \n" }, { "from": "gpt", "value": "Yes, in C# you can use the `Dictio...
I have an entity that maps to an external oracle table which is one of the primary data sources of my application. This entity is modelled using hibernate. The oracle table now has a complex function defined the calculates some special values. I need to call this function somehow - almost as another accessor on the ent...
Incorporating a complex function from an external Oracle database table into your Hibernate entity requires a thoughtful approach to maintain the simplicity of Hibernate access while still allowing for the functionality you need. Here are a few strategies you can consider: ### 1. Using a Hibernate User-Defined Functio...
38,544
[ { "from": "human", "value": "I have an entity that maps to an external oracle table which is one of the primary data sources of my application. This entity is modelled using hibernate.\nThe oracle table now has a complex function defined the calculates some special values. I need to call this function someh...
In a legacy project that I'm on, we have several processing that are preformed via DTS. DTS is not something I worked with a lot back in its hey day.... I was in college. More specificity, these process are in ActiveX code blocks -- which is basically VBScript for database. It is really hard to debug. Anyway, I'm won...
Debugging and troubleshooting DTS (Data Transformation Services) packages can indeed be challenging, especially when ActiveX scripting is involved. Here are some tips that might help you manage and improve the debugging process: ### General Tips for Debugging DTS Packages: 1. **Use Logging**: - Enable logging in y...
37,325
[ { "from": "human", "value": "In a legacy project that I'm on, we have several processing that are preformed via DTS. DTS is not something I worked with a lot back in its hey day.... I was in college. \nMore specificity, these process are in ActiveX code blocks -- which is basically VBScript for database. It...
How do I add a the http://github.com/technoweenie/restful-authentication/tree/master plugin to my Rails project and the commit it to the git repo ? I need it to be committed with the project. I have tried a few times but it's ignored by git. Thanks.
To add the `restful-authentication` plugin from GitHub to your Rails project and commit it to your Git repository, follow these steps: ### Step 1: Add the Plugin to Your Rails Project 1. **Navigate to your Rails project directory**: ```bash cd path/to/your/rails/project ``` 2. **Install the plugin**: Use th...
39,783
[ { "from": "human", "value": "How do I add a the http://github.com/technoweenie/restful-authentication/tree/master plugin to my Rails project and the commit it to the git repo ? I need it to be committed with the project.\nI have tried a few times but it's ignored by git.\nThanks.\n" }, { "from": "g...
When I add an assembly reference to a project in Visual Studio 8 the Aliases property, of that reference, is set to "global". What is this property good for and why is it set to global? MSDN tells me that this is a list of aliases for the assembly but not why I might want to use this property or why most are aliased a...
The Aliases property in Visual Studio, particularly when dealing with assembly references in projects, allows developers to define alternative names (aliases) for an assembly. This is useful primarily in scenarios involving multiple versions or conflicting namespaces within assemblies. ### Purpose of the Aliases Prope...
40,399
[ { "from": "human", "value": "When I add an assembly reference to a project in Visual Studio 8 the Aliases property, of that reference, is set to \"global\". What is this property good for and why is it set to global?\nMSDN tells me that this is a list of aliases for the assembly but not why I might want to...
I want to be able to apply a style at runtime to an object ONLY if the current style is the default style. I don't want to override any user defined styles. Anyone know how to do this?
To apply a style at runtime to an object only if its current style is the default style, you can use a combination of conditional checks and style application in your code. Here’s a general approach you can take, which can be adapted depending on the specific framework or technology you are using (like WPF, WinForms, e...
40,099
[ { "from": "human", "value": "I want to be able to apply a style at runtime to an object ONLY if the current style is the default style. I don't want to override any user defined styles. Anyone know how to do this?\n" }, { "from": "gpt", "value": "To apply a style at runtime to an object only if ...
I am developing an iOS application, and trying to zip the file I have created in the application, is there any built in function able to do this?
In iOS development, there isn't a built-in method specifically for zipping files in the standard libraries provided by Apple. However, you can achieve this by using third-party libraries or Apple's `Compression` framework. ### Option 1: Using the `Compression` Framework The `Compression` framework can be used for dat...
39,201
[ { "from": "human", "value": "I am developing an iOS application, and trying to zip the file I have created in the application, is there any built in function able to do this?\n" }, { "from": "gpt", "value": "In iOS development, there isn't a built-in method specifically for zipping files in the ...
I used standard exception handling methods in C++. Which is try{} and catch{} block. In my code, func1() would throw an exception, And func2 is like this: bool func2() { try{ func1(); } catch(myException& e) { cerr << "error!" << endl; return false; } return true; } But wh...
The issue you're experiencing is likely due to the way exceptions are thrown and caught, as well as potentially the type of exception you're throwing and catching. Here are a few things to check and consider: 1. **Exception Type**: Make sure that the type of exception you're throwing in `func1()` is indeed of the type...
37,923
[ { "from": "human", "value": "I used standard exception handling methods in C++. Which is try{} and catch{} block. In my code, func1() would throw an exception, And func2 is like this:\nbool func2()\n{\n try{\n func1();\n }\n\n catch(myException& e)\n {\n cerr << \"error!\" << endl;\n...
I know Windows has SMTP capabilities under IIS, but I thought a basic SMTP would be a good project for learning Windows application development. I don't want a relay. I want an actual SMTP server that will send email from localhost anonymously. Obviously, it is only to be used for routing emails sent during a developme...
Creating a basic SMTP server on Windows for development purposes can be a great project to enhance your understanding of Windows application development. Below are some considerations and insights regarding your queries: ### 1. **Language and Development Approach** - **VB.NET vs. C#:** Both VB.NET and C# are common la...
37,388
[ { "from": "human", "value": "I know Windows has SMTP capabilities under IIS, but I thought a basic SMTP would be a good project for learning Windows application development. I don't want a relay. I want an actual SMTP server that will send email from localhost anonymously. Obviously, it is only to be used f...
Has anybody seen such a thing? Small self-sufficient modules are preferred.
It sounds like you might be looking for examples of small, self-sufficient modules in various contexts. Here are a few areas where such modules are commonly found: 1. **Tiny Homes**: Small, self-sufficient living spaces designed for minimalism and sustainability. They often include solar panels, composting toilets, an...
41,916
[ { "from": "human", "value": "Has anybody seen such a thing? Small self-sufficient modules are preferred.\n" }, { "from": "gpt", "value": "It sounds like you might be looking for examples of small, self-sufficient modules in various contexts. Here are a few areas where such modules are commonly f...
Has anyone been able to get velocity and tiles working with struts 2? I am having some problem finding examples or tutorials online and from what I have gathered from mailing lists it seems it might not even be possible at all (but the mails were quite old).
Integrating Apache Velocity and Tiles with Struts 2 is possible, but it can require some configuration since Struts 2 has its own preferred templating mechanisms. While many developers use JSP, you can definitely work with Velocity as well. Below are some steps to help you set it up along with some resources to guide y...
38,165
[ { "from": "human", "value": "Has anyone been able to get velocity and tiles working with struts 2?\nI am having some problem finding examples or tutorials online and from what I have gathered from mailing lists it seems it might not even be possible at all (but the mails were quite old).\n" }, { "fr...
We've got a situation where someone messed up a Commit to our SVN server. A lot of files were deleted, etc. Question: What is the technique for making the previous (to the bad Commit) revision the HEAD revision? I've seen discussion here on SO for doing this for 1 file, but we'd like to make it like that last commit n...
To effectively revert your SVN repository to the state it was in before the bad commit, you can utilize the `svn merge` command to undo the changes introduced by that commit. Here’s how to do it: ### Step-by-Step Guide 1. **Identify the Revision Number**: First, determine the revision number of the bad commit. You...
40,998
[ { "from": "human", "value": "We've got a situation where someone messed up a Commit to our SVN server. A lot of files were deleted, etc. \nQuestion: What is the technique for making the previous (to the bad Commit) revision the HEAD revision? I've seen discussion here on SO for doing this for 1 file, but we...
Are DES Encryption called "One Way Encryption" or "two way Encryption" ? Are there a PHP class or method to decrypt the DES Encryption ?
DES (Data Encryption Standard) is considered "two-way encryption" because it allows for both encryption and decryption. In a two-way encryption system, you can take plaintext, encrypt it to produce ciphertext, and then decrypt the ciphertext back to the original plaintext using the appropriate key. ### Decrypting DES ...
39,181
[ { "from": "human", "value": "Are DES Encryption called \"One Way Encryption\" or \"two way Encryption\" ?\nAre there a PHP class or method to decrypt the DES Encryption ?\n" }, { "from": "gpt", "value": "DES (Data Encryption Standard) is considered \"two-way encryption\" because it allows for bo...
I'm working on something that requires traversing through the file system and for any given path, I need to know how 'deep' I am in the folder structure. Here's what I'm currently using: int folderDepth = 0; string tmpPath = startPath; while (Directory.GetParent(tmpPath) != null) { folderDepth++; tmpPath = Di...
Your current implementation of determining the folder depth by traversing up the directory tree is correct, but it can be simplified and optimized slightly. Instead of calling `Directory.GetParent()` multiple times, you can get the parent directory just once per iteration, which reduces the number of method calls. Her...
42,088
[ { "from": "human", "value": "I'm working on something that requires traversing through the file system and for any given path, I need to know how 'deep' I am in the folder structure. Here's what I'm currently using:\nint folderDepth = 0;\nstring tmpPath = startPath;\n\nwhile (Directory.GetParent(tmpPath) !=...
If I try to quit Firefox when it's "Looking up domain.com..." it beachballs (hangs), goes into "not responding" status, then finally quits. It does this without fail. This is on Mac with the latest FF, but it's always been this way for me, even on Windows with FF and I've noticed it with other applications. Is there a...
The behavior you're experiencing when trying to quit Firefox (or other applications) while they are in the process of looking up a domain is a common issue that can be attributed to several factors. Here’s a technical breakdown of what might be happening and why it can be problematic: ### Technical Reasons for Hanging...
37,417
[ { "from": "human", "value": "If I try to quit Firefox when it's \"Looking up domain.com...\" it beachballs (hangs), goes into \"not responding\" status, then finally quits. It does this without fail.\nThis is on Mac with the latest FF, but it's always been this way for me, even on Windows with FF and I've ...
In standard php or source code based projects we easily keep all of the code in SVN and each developer can checkout their own copy and collaborate on the same code. When developing a Drupal site however, much of the work is in "setup". Besides the theme and modules you don't really have any "source code". How do yo...
When working with Drupal and similar content management systems (CMS), managing development and production environments effectively, especially when database changes are involved, can be challenging. However, there are several strategies you can employ to make this process smoother and more efficient. Here are some bes...
39,730
[ { "from": "human", "value": "In standard php or source code based projects we easily keep all of the code in SVN and each developer can checkout their own copy and collaborate on the same code. \nWhen developing a Drupal site however, much of the work is in \"setup\". Besides the theme and modules you don...
Let’s say I have this markup: <div id="content"> <div id="firstP"><p>First paragraph</p></div> <div id="secondP"><p>Second paragraph</p></div> <div id="thirdP"><p>Third paragraph</p></div> <div id="fourthP"><p>Fourth paragraph</p></div> </div> I want to add a new <div> with jQuery and focus on this new element...
The issue you're facing is that the `.focus()` method is generally used with focusable elements like `<input>`, `<textarea>`, or `<button>`. A `<div>` element is not focusable by default. To make a `<div>` focusable, you need to add a `tabindex` attribute to it. Here’s how you can modify your `addParagraph` function t...
43,237
[ { "from": "human", "value": "Let’s say I have this markup:\n<div id=\"content\">\n <div id=\"firstP\"><p>First paragraph</p></div>\n <div id=\"secondP\"><p>Second paragraph</p></div>\n <div id=\"thirdP\"><p>Third paragraph</p></div>\n <div id=\"fourthP\"><p>Fourth paragraph</p></div>\n</div>\n\nI want t...
I'm trying to use route constraints in an Asp.Net MVC Application. routes.MapRoute( "theRoute", "MyAction/{page}", new { controller = "TheController", action = "MyAction", page = 1 }, new { page = @"[0-9]" }); When I enter an url like ~/MyAction/aString, an YSOD is shown with an invalid operation exce...
In ASP.NET MVC, route constraints can indeed be used to enforce specific rules on route parameters. However, if a request matches a route but the parameters do not meet the specified constraints, you might encounter a "Yellow Screen of Death" (YSOD) if it results in an exception in the controller or action method. To ...
37,063
[ { "from": "human", "value": "I'm trying to use route constraints in an Asp.Net MVC Application. \nroutes.MapRoute(\n \"theRoute\",\n \"MyAction/{page}\",\n new { controller = \"TheController\", action = \"MyAction\", page = 1 },\n new { page = @\"[0-9]\" });\n\nWhen I enter an url like ~/MyActio...
I love WinSCP for Windows. What is the best equivalent software for Linux? I tried to use sshfs to mount the remote file system on my local machine, but it is not as user friendly as simply launching a GUI, plus it seems to require root access on the client machine, which is not very convenient. Of course command-line...
If you're looking for a GUI-based alternative to WinSCP for Linux, there are several options available that can provide a user-friendly experience for managing files over SSH, SFTP, and other protocols. Here are some of the best options: 1. **FileZilla**: This is a popular cross-platform FTP and SFTP client that provi...
41,551
[ { "from": "human", "value": "I love WinSCP for Windows. What is the best equivalent software for Linux?\nI tried to use sshfs to mount the remote file system on my local machine, but it is not as user friendly as simply launching a GUI, plus it seems to require root access on the client machine, which is n...
I am developing an Intranet Application in ASP.NET that uses Windows Authentication. I have created an AD class that gets information from the Active Directory Domain Controller. This is what I use to get things like User Groups that the currently logged user is in. The problem is in the ASP.NET Roles that the user is ...
To reconcile the difference between the Active Directory groups (AD Groups) a user is a member of and the roles in your ASP.NET application, you can create a custom role provider that maps AD groups directly to ASP.NET roles. The `AspNetWindowsTokenRoleProvider` may not automatically reflect the user's actual AD group ...
38,507
[ { "from": "human", "value": "I am developing an Intranet Application in ASP.NET that uses Windows Authentication. I have created an AD class that gets information from the Active Directory Domain Controller. This is what I use to get things like User Groups that the currently logged user is in. The problem ...
As above. Usually at work someone else does the database design, and when I do personal projects they're small enough to not really require more than five or six tables, but I'm about to start a personal project that I think will probably require around eleven or twelve tables and I'd like something to help me design i...
Designing a database, especially for a more complex project, can indeed be a challenging task, but there are several approaches and tools you can use to help organize your thoughts and create a well-structured schema. Here’s a step-by-step guide to help you design your database: ### 1. Define Requirements - **Under...
36,654
[ { "from": "human", "value": "As above. Usually at work someone else does the database design, and when I do personal projects they're small enough to not really require more than five or six tables, but I'm about to start a personal project that I think will probably require around eleven or twelve tables a...
Is there any way to increase the heap size for Java ME on a device? I'm developing an application for a Nokia N95, but am bumping into memory issues when I try to do image processing of larger images. The phone has plenty of heap space available, but seems to restrict the amount allowed to be used by Java ME to 1MB.
Increasing the heap size for Java ME (Java Platform, Micro Edition) applications on devices like the Nokia N95 can be quite challenging. Java ME applications often operate within a predefined set of constraints, and the heap size is typically determined by the device's implementation of the Java ME environment. Here a...
41,247
[ { "from": "human", "value": "Is there any way to increase the heap size for Java ME on a device? I'm developing an application for a Nokia N95, but am bumping into memory issues when I try to do image processing of larger images. The phone has plenty of heap space available, but seems to restrict the amou...
I have a webservice running under sharepoint, on a bog-standard Server2003/IIS6 setup. This webservice needs to open and read a file from a share on another machine in the same domain. At the moment I am getting a System.UnauthorizedAccessException: Access to the path '\strand\DROPBOXES\MattTrinder\SharepointShared\b...
In order to grant your web service the necessary permissions to access a file on a remote share (in your case, `\\strand\DROPBOXES\MattTrinder\...`), you'll need to follow these steps: 1. **Identify the Identity Under Which the Web Service Runs:** - By default, IIS 6.0 applications can run under different identitie...
40,413
[ { "from": "human", "value": "I have a webservice running under sharepoint, on a bog-standard Server2003/IIS6 setup. This webservice needs to open and read a file from a share on another machine in the same domain. At the moment I am getting a \nSystem.UnauthorizedAccessException: Access to the path '\\stra...
I have started using aspects for parameter validation in our development framework. It works nicely, and I enjoy not littering the first half of a public method with validation code. What I am wondering is if anyone has any recommendations with where in the namespace structure you would place parameter validation? Pa...
It's great to hear that you're incorporating aspects for parameter validation in your development framework. Aspects can certainly help keep your code cleaner and more focused on business logic rather than boilerplate validation. ### Namespace Structure Recommendations When it comes to namespace organization, it's im...
38,748
[ { "from": "human", "value": "I have started using aspects for parameter validation in our development framework. It works nicely, and I enjoy not littering the first half of a public method with validation code.\nWhat I am wondering is if anyone has any recommendations with where in the namespace structure...
How could I detect when any application loses focus? Is there any system hooks to use? I want to pick up when ever a new application is in focus, or when one is lost. Even having the "current" HWND of the user would be good. I am using C#, however, its all win api stuff I am sure... so any info would be great.
To detect when any application loses focus in a Windows environment using C#, you can utilize the Windows API to set a global hook. Specifically, you'll want to use a Low-Level Keyboard Hook or a Low-Level Mouse Hook, combined with the use of Windows messages to detect focus changes. However, for simply tracking the a...
36,130
[ { "from": "human", "value": "How could I detect when any application loses focus? Is there any system hooks to use? I want to pick up when ever a new application is in focus, or when one is lost. Even having the \"current\" HWND of the user would be good.\nI am using C#, however, its all win api stuff I ...
Suppose you're the product manager for an internal enterprise web application that has 2000 users and 7 developers. You have a list of 350 future features, each ranging from 5 to 150 developer days of work. How do you choose what features to work on, and how do you run the release process? Here's what I'm thinking: (sk...
Your approach to both the release process and feature prioritization is thoughtful and recognizes the complexity of managing an internal enterprise web application. Here’s a refined strategy to enhance your methodology: ### Release Process 1. **Continuous Delivery Model**: Your inclination toward a shorter release pr...
39,294
[ { "from": "human", "value": "Suppose you're the product manager for an internal enterprise web application that has 2000 users and 7 developers. You have a list of 350 future features, each ranging from 5 to 150 developer days of work.\nHow do you choose what features to work on, and how do you run the rele...
I'm writing a VoiceXML application where we have a speech grammar and a DTMF grammar. If the caller is calling from a particularly noisy environment, we need to disable the speech grammar. Is there a way to do this which doesn't involve copying the entire form into another form and deleting the speech grammar?
In VoiceXML, you can control the use of grammars dynamically using the `<grammar>` element and some conditional logic in your application. If you want to disable the speech grammar based on certain conditions (like detecting a noisy environment) without duplicating the entire form, you can use the `<if>` tag in combina...
40,817
[ { "from": "human", "value": "I'm writing a VoiceXML application where we have a speech grammar and a DTMF grammar. If the caller is calling from a particularly noisy environment, we need to disable the speech grammar. Is there a way to do this which doesn't involve copying the entire form into another fo...
My company has got quite a number of client laptops out in the field. These laptops are running Windows Vista Home edition. I was recently asked if I could find a way to disable the user's ability to adjust the system time. My first thought was to use gpedit, but as I found this is unavailable in home edition. I th...
Disabling a user's ability to change the system time in Windows Vista Home Edition can be a challenge, given the lack of Group Policy Editor (gpedit.msc) and Local Security Settings. Here are a few alternative approaches you could consider: ### 1. **Using a Service to Manage Time Changes** You could create a Windows s...
41,370
[ { "from": "human", "value": "My company has got quite a number of client laptops out in the field. These laptops are running Windows Vista Home edition.\nI was recently asked if I could find a way to disable the user's ability to adjust the system time. \n\nMy first thought was to use gpedit, but as I fou...
I am confused by J2ee webservers !! I downloaded a free Glassfish server from sun, then as I am an Oracle developer downloaded the latest JDeveloper, which comes with a Weblogic server from BEa/Oracle. One is free the other costs $1000s. What is the real difference. I want to write a SOAP interface to my Oracle datab...
It's understandable that you're feeling confused given the various options available for Java EE (formerly J2EE) web servers and application servers. Let’s break down the different servers you mentioned, their purposes, and how they relate to each other. ### 1. GlassFish Server - **Type**: Open-source application serv...
38,193
[ { "from": "human", "value": "I am confused by J2ee webservers !! I downloaded a free Glassfish server from sun, then as I am an Oracle developer downloaded the latest JDeveloper, which comes with a Weblogic server from BEa/Oracle. One is free the other costs $1000s. What is the real difference.\nI want to...
I think in this case there is no need to declare a public constructor since the class is not accessible outside the package anyway. But is there some hidden impact when the class has only package private constructor?
When a class in Java has only a package-private (default access) constructor, it can indeed affect the usability of that class, particularly in the context of testing and subclassing. Here are some considerations regarding the impacts of a package-private constructor: 1. **Instantiability within the Package**: The cl...
40,718
[ { "from": "human", "value": "I think in this case there is no need to declare a public constructor since the class is not accessible outside the package anyway. But is there some hidden impact when the class has only package private constructor?\n" }, { "from": "gpt", "value": "When a class in J...
I have a question about using new[]. Imagine this: Object.SomeProperty = new[] {"string1", "string2"}; Where SomeProperty expects an array of strings. I know this code snippet will work. But i want to know what it does under the hood. Does new[] makes an instance of the class object and in SomeProperty it converts it ...
In C#, when you use `new[] { "string1", "string2" }`, you are creating an array of strings (specifically, a `string[]` array). Here's how it works under the hood: 1. **Array Creation**: The `new[]` syntax is a shorthand for creating an array without explicitly specifying the type. The type is inferred from the provide...
42,184
[ { "from": "human", "value": "I have a question about using new[].\nImagine this:\nObject.SomeProperty = new[] {\"string1\", \"string2\"};\n\nWhere SomeProperty expects an array of strings.\nI know this code snippet will work. But i want to know what it does under the hood. Does new[] makes an instance of th...
My problem: I'm looking for a way to represent a person's name and address as an encoded id. The id should contain only alpha-numeric characters, be collision-proof, and be represented in a smallest number of characters possible. My first thought was to simply use a cryptographic hash function like MD5 or SHA1, but t...
To create a compact, alphanumeric, collision-resistant identifier based on a person's name and address, you'll want a method that combines parts of the input data into a fixed-length string while ensuring consistency. Here's a step-by-step outline of an approach to achieve this: ### Step-by-Step Approach 1. **Normali...
38,900
[ { "from": "human", "value": "My problem:\nI'm looking for a way to represent a person's name and address as an encoded id. The id should contain only alpha-numeric characters, be collision-proof, and be represented in a smallest number of characters possible. My first thought was to simply use a cryptogra...
My team works on a Medium sized product which takes about 2 hours to build on a single dual-core machine. As part of an effort to improve productivity I am looking for alternatives to improve our build process. Currently we build C++ code and .NET code using VS2005 solutions, we also have some legacy code built using m...
Improving your build process can significantly enhance productivity and reduce development time. Based on your requirements, here are several products and approaches you can consider to achieve your goals: ### 1. **Build Automation Tools** Replacing your Perl scripts with a more robust build automation tool can stream...
39,697
[ { "from": "human", "value": "My team works on a Medium sized product which takes about 2 hours to build on a single dual-core machine.\nAs part of an effort to improve productivity I am looking for alternatives to improve our build process.\nCurrently we build C++ code and .NET code using VS2005 solutions, ...
I have a xml build of <elig> <subscriber code="1234"/> <date to="12/30/2004" from="12/31/2004"/> <person name="bob" ID="654321"/> <dog type="labrador" color="white"/> <location name="hawaii" islandCode="01"/> </subscriber> </elig> In XSL I have: <xsl...
To control the order of the output when using XSLT templates, you should not rely on the `apply-templates` function as it processes nodes in the order they are provided. Instead, you can explicitly specify the order by calling `apply-templates` in the desired order. In your case, since you want the `location` block t...
41,598
[ { "from": "human", "value": "I have a xml build of\n<elig>\n <subscriber code=\"1234\"/>\n <date to=\"12/30/2004\"\n from=\"12/31/2004\"/>\n <person name=\"bob\"\n ID=\"654321\"/>\n <dog type=\"labrador\"\n color=\"white\"/>\n <location name=\"hawaii\"\n ...
I need a javascript regex pattern to match a person's height to check if the input is valid. Here are some sample input: 5' 9" 6' 5'8" Any ideas?
You can create a JavaScript regex pattern to match various formats of height inputs, including feet and inches. The following regex pattern should work for the examples you've provided: ```javascript const heightRegex = /^(?:\d{1,2}'\s?(?:\d{1,2}"|\d{1,2})?|\d{1,2}')$/; // Test examples const heights = [ "5' 9\""...
39,361
[ { "from": "human", "value": "I need a javascript regex pattern to match a person's height to check if the input is valid. Here are some sample input:\n5' 9\"\n6'\n5'8\"\nAny ideas?\n" }, { "from": "gpt", "value": "You can create a JavaScript regex pattern to match various formats of height input...
The VSTO bit I understand. Visual Studio has the project templates to get you started with creating nice .NET based add-ins. But where is VSTA? I installed the SDK but it seems to be gears towards adding extensibility to your own applications. I had thought that VSTA was like the new VBA for Office 2007. Infopath 200...
You’re correct that VSTO (Visual Studio Tools for Office) provides a way to create managed code add-ins for Microsoft Office applications using .NET, and it indeed includes project templates in Visual Studio to help you get started. VSTA (Visual Studio Tools for Applications), on the other hand, is designed to allow u...
40,542
[ { "from": "human", "value": "The VSTO bit I understand. Visual Studio has the project templates to get you started with creating nice .NET based add-ins.\nBut where is VSTA? I installed the SDK but it seems to be gears towards adding extensibility to your own applications.\nI had thought that VSTA was like...
Here's a relatively common task for me, and, I think, for many a .NET programmer: I want to use the .NET ThreadPool for scheduling worker threads that need to process a given type of tasks. As a refresher, the signatures for the queueing method of the ThreadPool and its associated delegate are: public static bool Queue...
Your question touches on an important aspect of API design in the .NET Framework and the decision-making process behind making certain classes and methods generic versus non-generic. ### Reasons for Non-Generic API in ThreadPool 1. **Historical Context**: When the ThreadPool and its related APIs were first designed, ...
38,303
[ { "from": "human", "value": "Here's a relatively common task for me, and, I think, for many a .NET programmer:\nI want to use the .NET ThreadPool for scheduling worker threads that need to process a given type of tasks.\nAs a refresher, the signatures for the queueing method of the ThreadPool and its associ...
I have just installed the GDR RTM version of Visual Studio Team System Database Edition GDR RTM. It all seems to work wonderfully, but I seem to have to edit XML (Database.sqlpermissions) for specify SQL Permissions. Am I missing something? For that matter where is the schema diagram tool? I understand GDR exposes alot...
Visual Studio Team System Database Edition (often referred to as DB Pro or Database Projects) underwent significant changes and enhancements with the GDR (General Distribution Release) updates. Here are some insights regarding your questions: ### SQL Permissions and XML Configuration 1. **SQL Permissions**: - In ...
40,288
[ { "from": "human", "value": "I have just installed the GDR RTM version of Visual Studio Team System Database Edition GDR RTM.\nIt all seems to work wonderfully, but I seem to have to edit XML (Database.sqlpermissions) for specify SQL Permissions.\nAm I missing something?\nFor that matter where is the schema...
Will a query like this on a recordset work rs.open "select * from table where vd=1; update table set vd1 = 1 where vd=2 or vd=3;" or is there anything wrong thanks
The SQL query you've written contains both a `SELECT` statement and an `UPDATE` statement in the same string, which is not valid SQL syntax for most database systems. A `SELECT` statement is used to retrieve data, while an `UPDATE` statement is used to modify data. However, you cannot combine them into a single query l...
41,732
[ { "from": "human", "value": "Will a query like this on a recordset work\nrs.open \"select * from table where vd=1; update table set vd1 = 1 where vd=2 or vd=3;\"\nor is there anything wrong\nthanks\n" }, { "from": "gpt", "value": "The SQL query you've written contains both a `SELECT` statement a...
I have a django project pro1 with several apps: app1, app2, app3 and so on. I want to display some top level template that contains blocks from each and every app: example_base_template.html: [header /] [left nav bar]{{ app1 rendered template }}[/left nav bar] [right nav bar]{{ app2 rendered template }}[/right nav bar]...
To achieve your goal of displaying blocks from multiple Django apps within a single top-level template, you'll want to make use of Django's template rendering, views, and context passing effectively. Here’s a step-by-step approach on how to accomplish this: ### Step 1: Create the Top-Level View First, you will create...
34,701
[ { "from": "human", "value": "I have a django project pro1 with several apps: app1, app2, app3 and so on. I want to display some top level template that contains blocks from each and every app:\nexample_base_template.html:\n[header /]\n[left nav bar]{{ app1 rendered template }}[/left nav bar]\n[right nav bar...
What options are there for installing Django such that multiple users (each with an "Account") can each have their own database? The semantics are fairly intuitive. There may be more than one User for an Account. An Account has a unique database (and a database corresponds to an account). Picture WordpressMU. :) I've c...
Your use case of allowing multiple users (each with an "Account") to have their own unique database in a Django application presents several architectural challenges. Here are some approaches to consider, weighing the pros and cons of each method. ### 1. **Separate Django Installations for Each Account** You've alread...
37,039
[ { "from": "human", "value": "What options are there for installing Django such that multiple users (each with an \"Account\") can each have their own database?\nThe semantics are fairly intuitive. There may be more than one User for an Account. An Account has a unique database (and a database corresponds to...
I have a object of type ICollection<string>. What is the best way to convert to string[]. How can this be done in .NET 2? How can this be done cleaner in later version of C#, perhaps using LINQ in C# 3?
In .NET 2.0, you can convert an `ICollection<string>` to a `string[]` using the `CopyTo` method of the `ICollection<T>` interface. Here’s how you can do it: ### .NET 2.0 Example: ```csharp ICollection<string> collection = new List<string> { "one", "two", "three" }; // Example collection string[] array = new string[co...
40,951
[ { "from": "human", "value": "I have a object of type ICollection<string>. What is the best way to convert to string[]. \nHow can this be done in .NET 2?\nHow can this be done cleaner in later version of C#, perhaps using LINQ in C# 3?\n" }, { "from": "gpt", "value": "In .NET 2.0, you can conve...
I am trying to have one one layer, and center images within. I.E., if I have 3 images and want 3 links beneath them, is there a way to do this without using a separate div tag for each link and image? To automatically make the links be centered under the images, and the images to be spaced evenly within a layer? I was...
To achieve the layout you described, you can utilize CSS Flexbox to center your images and their corresponding links, while also ensuring that the images are evenly spaced. Here's a simple example of how you could structure your HTML and CSS to accomplish this: ### HTML ```html <div class="container"> <div class="...
39,440
[ { "from": "human", "value": "I am trying to have one one layer, and center images within. I.E., if I have 3 images and want 3 links beneath them, is there a way to do this without using a separate div tag for each link and image? To automatically make the links be centered under the images, and the images t...
I'm trying to build a Java regular expression to match ".jar!" The catch is that I don't want the matcher to consume the exclamation mark. I tried using Pattern.compile("\\.jar(?=!)") but that failed. As did escaping the exclamation mark. Can anyone get this to work or is this a JDK bug? UPDATE: I feel like an idiot, P...
No need to feel like an idiot! Regular expressions can be tricky, and it's easy to overlook details like which matcher method to use. The pattern `\\.jar(?=!)` is correct for your goal. The `(?=!)` part is a positive lookahead that asserts what follows `.jar` is an exclamation mark, without consuming it. Just to sum...
42,973
[ { "from": "human", "value": "I'm trying to build a Java regular expression to match \".jar!\"\nThe catch is that I don't want the matcher to consume the exclamation mark. I tried using Pattern.compile(\"\\\\.jar(?=!)\") but that failed. As did escaping the exclamation mark.\nCan anyone get this to work or i...
Recently when I looked into iPhone memory management, I tried to compare the convenience method and init method on the same object. For example, I have UIImageView where it displays a downloaded NSData: Convenience method: imageView.image = [UIImage imageWithData:[downloads dataAtIndex:0]]; init method: UIImage *aImag...
The difference in memory behavior that you're observing between using a convenience method and an init method in your example can be attributed to several factors beyond just the difference between autorelease and direct release. Here’s a breakdown of the key points that contribute to the difference: 1. **Autorelease ...
40,325
[ { "from": "human", "value": "Recently when I looked into iPhone memory management, I tried to compare the convenience method and init method on the same object. For example, I have UIImageView where it displays a downloaded NSData:\nConvenience method:\nimageView.image = [UIImage imageWithData:[downloads da...
I am creating a C# WinForms application. I would like to have a Custom Form Border. And I want to create a black custom window (with border and controls) like that of Adobe Lightroom. For example - How do I create it, please help?
Creating a custom window with a specific style in a C# WinForms application involves several steps. You will need to override the default window behavior and create a custom title bar along with borders. Here’s a step-by-step guide on how to achieve a custom form border similar to that in Adobe Lightroom: ### Step 1: ...
38,533
[ { "from": "human", "value": "I am creating a C# WinForms application. I would like to have a Custom Form Border. And I want to create a black custom window (with border and controls) like that of Adobe Lightroom. For example -\n\nHow do I create it, please help?\n" }, { "from": "gpt", "value": "...
How can i do something like this: class Foo(): do_stuff = { "A" : lambda x: self.do_A(x), "B" : lambda x: self.do_B(x) } def __init__(self): print "hi" def run(self): muh = ['A', 'B', 'A'] for each in muh: self.do_stuff[each](each) def do_A(self, moo): print "...
Using lambdas to reference instance methods within a class can work, but there are more straightforward ways to achieve what you're trying to do. Your approach of using lambdas is functional, but it can make the code less readable. Instead, you could store the methods directly in the dictionary without needing lambdas....
42,801
[ { "from": "human", "value": "How can i do something like this:\nclass Foo():\n do_stuff = { \n \"A\" : lambda x: self.do_A(x),\n \"B\" : lambda x: self.do_B(x)\n }\ndef __init__(self):\n print \"hi\"\n\ndef run(self):\n muh = ['A', 'B', 'A']\n for each in muh:\n ...
There might be applications that are not suited for Core Data - image manipulation programs like Photoshop or Gimp for example. But for applications that are suited for Core Data, say Address Book or iCal, what is the criteria to choose Core Data over a custom model?
Choosing Core Data over a custom data model for applications like Address Book or iCal involves several considerations that relate to the specific needs of your application and how you want to manage data. Here are key criteria to help guide that decision: ### 1. **Complex Data Relationships** - **Core Data** is de...
37,666
[ { "from": "human", "value": "There might be applications that are not suited for Core Data - image manipulation programs like Photoshop or Gimp for example. But for applications that are suited for Core Data, say Address Book or iCal, what is the criteria to choose Core Data over a custom model?\n" }, {...
I'm making my first WPF application, and its purpose is to generate 6 images from some data. Ideally I'd like to display them in the window, with little "forward" and "back" buttons, and a text indicator for where we are in the image-stack. Kind of like a "mini Windows Photo Gallery." I think the way to do this might b...
Creating a WPF application to display images with navigation buttons is a common scenario, and you have a couple of good options to implement this functionality. While using a `ListView` with customized styles can work, a simpler and more straightforward approach might be to use a `StackPanel` or a `Grid` layout to dis...
35,550
[ { "from": "human", "value": "I'm making my first WPF application, and its purpose is to generate 6 images from some data. Ideally I'd like to display them in the window, with little \"forward\" and \"back\" buttons, and a text indicator for where we are in the image-stack. Kind of like a \"mini Windows Phot...
I have a ton of repeating code in my class that looks like the following: NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:self]; The problem with asynchronous requests is when you have various requests going off, and ...
Managing multiple asynchronous requests in a clean and maintainable way is a common challenge in Objective-C, especially when using `NSURLConnection`. Since you want to avoid repetitive code and the complexity that comes with handling multiple asynchronous responses, I recommend the following strategies: ### 1. Use a ...
39,371
[ { "from": "human", "value": "I have a ton of repeating code in my class that looks like the following:\nNSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request\n delegate:self];\n\nThe problem with asynchronous requests is w...
Google app engine tells me to optimize this code. Anybody any ideas what I could do? def index(request): user = users.get_current_user() return base.views.render('XXX.html', dict(profiles=Profile.gql("").fetch(limit=100), user=user)) And later in the template I do: {% for profile in profiles ...
Optimizing your code can involve multiple aspects such as performance improvements, reducing the number of database queries, and improving overall efficiency. Here are a few suggestions that could help: ### 1. Optimize Querying The current `Profile.gql("").fetch(limit=100)` fetches profiles without any filters. If po...
39,535
[ { "from": "human", "value": "Google app engine tells me to optimize this code. Anybody any ideas what I could do?\ndef index(request):\n user = users.get_current_user()\n return base.views.render('XXX.html', \n dict(profiles=Profile.gql(\"\").fetch(limit=100), user=user))\n\nAnd later ...
When connecting to a network share for which the current user (in my case, a network enabled service user) has no rights, name and password have to be provided. I know how to do this with Win32 functions (the WNet* family from mpr.dll), but would like to do it with .Net (2.0) functionality. What options are available? ...
To connect to a network share using .NET (2.0) from a Windows Service, especially when your service is running under an account that doesn't have access rights to the share, you can use the `System.Net.NetworkCredential` and `System.Net.CredentialCache` classes in combination with `System.Net.WebClient` or `System.IO`....
38,575
[ { "from": "human", "value": "When connecting to a network share for which the current user (in my case, a network enabled service user) has no rights, name and password have to be provided.\nI know how to do this with Win32 functions (the WNet* family from mpr.dll), but would like to do it with .Net (2.0) f...
This seems like a simple question, but I can't find it with the Stack Overflow search or Google. What does a type followed by a _t mean? Such as int_t anInt; I see it a lot in C code meant to deal closely with hardware—I can't help but think that they're related.
The `_t` suffix in C (and C++) is a convention that often indicates a type definition. Specifically, it is typically used to denote a type that has been defined using `typedef`. For example, `int_t` would be a custom type that was defined to refer to an integer type, potentially with a specific size or characteristic. ...
38,843
[ { "from": "human", "value": "This seems like a simple question, but I can't find it with the Stack Overflow search or Google. What does a type followed by a _t mean? Such as\nint_t anInt;\n\nI see it a lot in C code meant to deal closely with hardware—I can't help but think that they're related.\n" }, {...
In javascript, I've got a block of HTML like this: <h2>{title}</h2> <p><a href="{url}">{content}</a></p> And I'm trying use regex "match" to spit out an array of all the {item}'s. So my output should look like: ['title', 'url', 'content'] I've gotten as far as: var pattern = new RegExp("\{[a-zA-Z]+\}+"); var match = ...
To extract all occurrences of `{item}` from a string using a regular expression in JavaScript, you'll want to use the `g` (global) flag with your regex pattern. This allows the pattern to find all matches in the string, rather than stopping at the first match. Here's how you can do it: ```javascript const html = "<h2...
42,744
[ { "from": "human", "value": "In javascript, I've got a block of HTML like this:\n<h2>{title}</h2>\n<p><a href=\"{url}\">{content}</a></p>\n\nAnd I'm trying use regex \"match\" to spit out an array of all the {item}'s. So my output should look like:\n['title', 'url', 'content']\n\nI've gotten as far as:\nvar...
I am using the web browser control from shdocvw.dll to build an html and image viewer that I'm automatically controlling. Some of the images I'm loading are pretty large in resolution so I'd like to be able to automatically zoom the control out to the extent of the content, and would like to support back to IE6. Is t...
Using the Web Browser Control from `shdocvw.dll`, you can create a basic HTML and image viewer, but achieving automatic zooming to fit the content, especially for larger images, is more complex and may be limited due to the inherent constraints of the control and the versions of Internet Explorer, particularly when tar...
38,792
[ { "from": "human", "value": "I am using the web browser control from shdocvw.dll to build an html and image viewer that I'm automatically controlling. Some of the images I'm loading are pretty large in resolution so I'd like to be able to automatically zoom the control out to the extent of the content, and...
Should I use textbox.text.Trim() function every time when I insert any data from web page to database. I just have a habit of using the trim function? Does it effect the performance any way? Should I use everytime or just when needed?
Using `textbox.Text.Trim()` to clean up whitespace from user input before inserting it into a database is generally a good practice. It helps ensure that you don't inadvertently store extraneous spaces that could lead to data inconsistency or unexpected results during queries and comparisons. ### Reasons to Use `Trim(...
40,654
[ { "from": "human", "value": "Should I use textbox.text.Trim() function every time when I insert any data from web page to database.\nI just have a habit of using the trim function? Does it effect the performance any way? Should I use everytime or just when needed?\n" }, { "from": "gpt", "value":...
How to figure out if a table is in use in SQL (on any type database)? if somebody is already using it, or have it "open" then its in use.
Determining if a table is currently in use (i.e., locked or being accessed) can vary depending on the database management system (DBMS) you are using, as different DBMS have different ways of managing locks and tracking access. Here are some approaches for a few popular DBMS: ### 1. **SQL Server** In SQL Server, you ...
39,771
[ { "from": "human", "value": "How to figure out if a table is in use in SQL (on any type database)? if somebody is already using it, or have it \"open\" then its in use.\n" }, { "from": "gpt", "value": "Determining if a table is currently in use (i.e., locked or being accessed) can vary depending...
Update I am making this a community wiki, for three reasons: I don't feel like I got a definitive answer, but I have long since stopped needing an answer, because I rolled my own accordion function this question gets tons of views, so clearly lots of people are still interested So if anybody wants to change/clarify t...
It seems like you're facing some compatibility issues with jQuery's accordion UI in Internet Explorer (IE), especially with animations and content flashing. This is a common problem due to how IE handles CSS and JavaScript animations. Here are a few suggestions you could try to mitigate these issues while keeping the a...
39,477
[ { "from": "human", "value": "Update\nI am making this a community wiki, for three reasons:\n\nI don't feel like I got a definitive answer, but\nI have long since stopped needing an answer, because I rolled my own accordion function\nthis question gets tons of views, so clearly lots of people are still inter...
I'm launching a Weblogic application inside Eclipse via the BEA Weblogic Server v9.2 runtime environment. If this were running straight from the command-line, I'd do a ctrl-BREAK to force a thread dump. Is there a way to do it in Eclipse?
Yes, you can obtain a thread dump for a WebLogic application running in Eclipse, but the process is a bit different from using `Ctrl-BREAK` in the command line. Here’s how you can achieve that: ### Option 1: Using JVisualVM 1. **Run your application in Eclipse** as you normally do. 2. Open **JVisualVM**, which is incl...
41,395
[ { "from": "human", "value": "I'm launching a Weblogic application inside Eclipse via the BEA Weblogic Server v9.2 runtime environment. If this were running straight from the command-line, I'd do a ctrl-BREAK to force a thread dump. Is there a way to do it in Eclipse?\n" }, { "from": "gpt", "valu...
I'd like to make an (MS)SQL query that returns something like this: Col1 Col2 Col3 ---- --------------------- ------ AAA 18.92 18.92 BBB 20.00 40.00 AAA 30.84 30.84 BBB 06.00 12.00 AAA 30.84 30.84 AAA 46.79 ...
You can achieve this by using a `CASE` statement in your SQL query to set the value of `Col3` based on the value of `Col1`. Here's an example of how you can construct the query: ```sql SELECT Col1, Col2, CASE WHEN Col1 = 'AAA' THEN Col2 WHEN Col1 = 'BBB' THEN Col2 * 2 ELSE 0 -- Yo...
43,229
[ { "from": "human", "value": "I'd like to make an (MS)SQL query that returns something like this:\nCol1 Col2 Col3\n---- --------------------- ------\nAAA 18.92 18.92\nBBB 20.00 40.00\nAAA 30.84 30.84\nBBB 06.00 12.00\nAAA 3...
I need to design a SOAP api (my first one!). What are the best practices regarding errors returned to the caller. Assuming an api as follow [WebMethod] public List<someClass> GetList(String param1) { } Should I Throw an exception. Let the SOAP infrastructure generate a SOAP fault -- and the caller would have to try/c...
Designing a SOAP API requires careful consideration for error handling and communication with clients. There are several best practices for returning errors to the caller in a way that is clear, structured, and informative. Let's explore the options you've provided and some additional recommendations. ### Option 1: Us...
36,585
[ { "from": "human", "value": "I need to design a SOAP api (my first one!). What are the best practices regarding errors returned to the caller.\nAssuming an api as follow\n[WebMethod]\npublic List<someClass> GetList(String param1)\n{\n}\n\nShould I\n\nThrow an exception. Let the SOAP infrastructure generate ...
I am currently receiving this error: Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster. I have found multiple solutions to this error. T...
Yes, the solution you've described—specifying a static `<machineKey>` configuration with fixed `validationKey` and `decryptionKey`—is a common and effective approach to resolve the "Validation of viewstate MAC failed" error in ASP.NET applications, including those targeting .NET 3.5. This configuration is essential, es...
38,915
[ { "from": "human", "value": "I am currently receiving this error:\n\nValidation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster. \n\nI h...
Looking for free/opensource code or description of algorithms to code (simple) and decode (hard) the 2D barcode QR code. It doesn't seem like a trivial problem, but it's so popular in Japan that there must be something already available...
Yes, there are several free and open-source libraries available that can help you encode and decode QR codes. Here are some popular options for both tasks: ### Libraries for QR Code Encoding and Decoding 1. **ZXing (Zebra Crossing)**: - **Description**: ZXing is a widely used open-source library for processing bar...
38,723
[ { "from": "human", "value": "Looking for free/opensource code or description of algorithms to code (simple) and decode (hard) the 2D barcode QR code.\nIt doesn't seem like a trivial problem, but it's so popular in Japan that there must be something already available...\n" }, { "from": "gpt", "va...
var pattern = /^0+$/; My guess is this: "Take a look at both the beginning and the end of the string, and if there's a pattern of one or more zeros at the beginning and the end, then return that pattern." I'm sure that's wrong, though, because when I run the expression with this string: var string = "0000009000000"; ...
Your understanding of the regular expression `/^0+$/` and its behavior with the provided string `"0000009000000"` is mostly correct, but let's clarify a few points for a complete understanding. ### Breakdown of the Regular Expression 1. **`^`**: This asserts the position at the start of the string. It means that what...
40,083
[ { "from": "human", "value": "var pattern = /^0+$/;\n\nMy guess is this:\n\"Take a look at both the beginning and the end of the string, and if there's a pattern of one or more zeros at the beginning and the end, then return that pattern.\"\nI'm sure that's wrong, though, because when I run the expression wi...
in C++ I have two chars holding hex values e.g.: char t = 0x4; char q = 0x4; How would i compare if the two values held in the char are the same?? I tried if (t == q) // should give me true but no, any help, thanks!
In C++, comparing two `char` values that hold hex values should work correctly with the comparison operator (`==`). Your example with `char t = 0x4;` and `char q = 0x4;` should indeed yield true when you compare them using `if (t == q)`. However, there might be some confusion regarding the representation of `char` ty...
41,387
[ { "from": "human", "value": "in C++ I have two chars holding hex values e.g.:\nchar t = 0x4;\nchar q = 0x4;\n\nHow would i compare if the two values held in the char are the same?? I tried\nif (t == q) // should give me true\n\nbut no, any help, thanks!\n" }, { "from": "gpt", "value": "In C++, c...
We have a piece of functionality that is used by several different applications (clients) on the same server. It can best be modeled as a service, has a backend database, and there will only be one version of the functionality and the database in use at any one time. Until now we have employed simple DLL-reuse, with th...
You're navigating a common architectural challenge when dealing with shared functionality across multiple applications. Let's break down the two approaches you outlined, and I'll add some insights into both options and considerations you might want to take into account. ### Option 1: GAC Deployment **Pros:** - **Perfo...
38,638
[ { "from": "human", "value": "We have a piece of functionality that is used by several different applications (clients) on the same server. It can best be modeled as a service, has a backend database, and there will only be one version of the functionality and the database in use at any one time.\nUntil now ...
I'm trying to create an in-process unit test for my service to client interactions using net.pipe binding. Like a good WCF service it uses FaultContractAttribute on service operations to expose possible faults (wrapped exceptions) to metadata. I would like to have the client and service endpoints configured thru XML ...
It looks like you're facing issues with catching and returning the custom exception from your WCF service. Let's address a couple of key areas to ensure that your WCF service and client are correctly configured to handle faults and that you can retrieve the custom `ValidationException`. ### 1. FaultContract Ensure th...
34,929
[ { "from": "human", "value": "I'm trying to create an in-process unit test for my service to client interactions using net.pipe binding. Like a good WCF service it uses FaultContractAttribute on service operations to expose possible faults (wrapped exceptions) to metadata. I would like to have the client a...
I am building a "document storage" system for storing text files on my server. I was wondering if anybody has any recommendations or best practices on the best way to store text files remotely. The system will be user-based, each user can upload multiple text files. I want the text files to be stored in some fashion w...
Building a document storage system for text files involves several important considerations, especially regarding file storage, indexing for search, and user management. Below are some recommendations and best practices for implementing such a system: ### 1. File Storage Structure - **Directory Structure**: Organize f...
39,237
[ { "from": "human", "value": "I am building a \"document storage\" system for storing text files on my server. I was wondering if anybody has any recommendations or best practices on the best way to store text files remotely. \nThe system will be user-based, each user can upload multiple text files. I want t...
I'm generating a menu with a Repeater control bound to an XmlDataSource. <asp:Repeater ID="myRepeater" runat="server" DataSourceID="myDataSource" onitemdatabound="myRepeater_ItemDataBound" onitemcreated="myRepeater_ItemCreated"> <HeaderTemplate> <ul class="menu_list"> </HeaderTemplate> ...
In ASP.NET Web Forms, you can customize the attributes and styles of controls during the `ItemDataBound` event of a `Repeater`. However, in your code, you're attempting to use `HtmlGenericControl` for the `<li>` element, which is defined as a `li` tag in your markup. The issue is that you're trying to set the `Style` p...
40,157
[ { "from": "human", "value": "I'm generating a menu with a Repeater control bound to an XmlDataSource. \n<asp:Repeater ID=\"myRepeater\" runat=\"server\" \n DataSourceID=\"myDataSource\" \n onitemdatabound=\"myRepeater_ItemDataBound\" \n onitemcreated=\"myRepeater_ItemCreated\">\n <HeaderTemplat...
I'm trying to get the contents from another file with file_get_contents (don't ask why). I have two files: test1.php and test2.php. test1.php returns a string, bases on the user that is logged in. test2.php tries to get the contents of test1.php and is being executed by the browser, thus getting the cookies. To send th...
It looks like you are trying to retrieve the contents of `test1.php` from `test2.php` using `file_get_contents()`, and you're encountering a `404 Not Found` error. Here are a few things you can check to troubleshoot and fix the issue: 1. **URL Accuracy**: Ensure that the URL you are providing is correct. Double-check ...
39,961
[ { "from": "human", "value": "I'm trying to get the contents from another file with file_get_contents (don't ask why).\nI have two files: test1.php and test2.php. test1.php returns a string, bases on the user that is logged in.\ntest2.php tries to get the contents of test1.php and is being executed by the br...
My program works already, I have Perl (GUI Window) where I can input data, data passed to the webpage (using to Tomcat server, JSP) and then saved it to oracle database. What I want is to make search parameter (webapp) that retrieve/extract data from the Oracle database using Perl CGI. Is it possible? Or any suggestion...
Yes, it is possible to create a search parameter in your web application that retrieves data from an Oracle database using Perl CGI. Below are the steps and some code snippets to help you implement this functionality. ### Steps to Create a Search Functionality 1. **Set Up Your Perl CGI Environment**: Ensure that you ...
37,846
[ { "from": "human", "value": "My program works already, I have Perl (GUI Window) where I can input data, data passed to the webpage (using to Tomcat server, JSP) and then saved it to oracle database. What I want is to make search parameter (webapp) that retrieve/extract data from the Oracle database using Pe...
I'm currently in the process of becoming a maintainer of a small open source project (a Facebook toolkit), and of course, one of the responsibilities is to answer user questions on our forum. While I'm happy to help users learn how to work with our toolkit and deal with issues they may run into (which may eventually in...
It's great to hear that you want to support users of your open source project while also recognizing the limits of your time and expertise! Here are some strategies to help you guide users who have general programming questions without feeling overwhelmed: 1. **Create a Resources Section**: On your project's forum or ...
41,468
[ { "from": "human", "value": "I'm currently in the process of becoming a maintainer of a small open source project (a Facebook toolkit), and of course, one of the responsibilities is to answer user questions on our forum. While I'm happy to help users learn how to work with our toolkit and deal with issues t...
In this abbreviated code, the inline event works - the "event" is passed to the testKeyPress function <textarea id="source" onkeydown= "showCursPos(this); var tf=testKeyPress(event); document.onkeypress=function(){return tf}; document.onkeydown=function(){return tf}; " ></textarea> function testKeyP...
To pass the event object correctly in a more modern approach using JavaScript, you should avoid relying on the global `event` object, as it may not be defined in all contexts (for example, in most modern browsers). Instead, you should use the event parameter that is passed to the event handler function. Here's how you ...
40,665
[ { "from": "human", "value": "In this abbreviated code, the inline event works - the \"event\" is passed to the testKeyPress function \n<textarea id=\"source\"\n onkeydown= \"showCursPos(this); \n var tf=testKeyPress(event);\n document.onkeypress=function(){return tf};\n document.onkeydown=funct...
I know you can set the auto refresh interval in the design of the report itself, but what I am trying to do is allow a user to set/change this interval himself in a web app (ASP.NET) that uses a ReportViewer control. Is there any way to do this?
Yes, you can allow users to set or change the auto-refresh interval of a ReportViewer control in an ASP.NET web application. However, the ReportViewer control itself does not provide built-in support for user-configurable refresh intervals directly. You will need to implement a workaround to achieve this behavior. Here...
38,461
[ { "from": "human", "value": "I know you can set the auto refresh interval in the design of the report itself, but what I am trying to do is allow a user to set/change this interval himself in a web app (ASP.NET) that uses a ReportViewer control. Is there any way to do this?\n" }, { "from": "gpt", ...
We have a custom REST handler on ASP.NET that is configured like this to handle all incoming requests: <add path="*" verb="*" type="REST.RESTProtocolHandler"/> However, passing it a pipe character, properly encoded or not at all, triggers a validation error that seems to come from inside ASP.NET. Accessing http://loca...
The issue you are encountering with ASP.NET rejecting URLs containing the pipe character `|` is due to the framework's built-in validation for illegal characters in paths. The pipe character is considered an illegal character because it has special meanings in file paths and URIs. When you access a URL that contains t...
39,517
[ { "from": "human", "value": "We have a custom REST handler on ASP.NET that is configured like this to handle all incoming requests:\n<add path=\"*\" verb=\"*\" type=\"REST.RESTProtocolHandler\"/>\n\nHowever, passing it a pipe character, properly encoded or not at all, triggers a validation error that seems ...
In C++, how can I establish an SQL connection to store data in an SQL database?
To establish an SQL connection and store data in an SQL database using C++, you typically use a library that provides the necessary interface for working with databases. Popular libraries include: 1. **MySQL Connector/C++**: For MySQL databases. 2. **SQLite**: For SQLite databases, which is a serverless, self-containe...
37,843
[ { "from": "human", "value": "In C++, how can I establish an SQL connection to store data in an SQL database?\n" }, { "from": "gpt", "value": "To establish an SQL connection and store data in an SQL database using C++, you typically use a library that provides the necessary interface for working ...
In ASP.NET (not MVC), what is the best approach to programmatically setting styles on an unordered list used for navigation so the appropriate menu item is styled as the active item if that page is being viewed? This would most likely be used in conjunction with a MasterPage.
In ASP.NET Web Forms (not MVC), a common approach to highlight the active menu item in a navigation bar implemented using an unordered list (`<ul>`) is to programmatically set a CSS class for the active menu item based on the currently viewed page. Below is a detailed approach using a `MasterPage`, which is a common st...
36,895
[ { "from": "human", "value": "In ASP.NET (not MVC), what is the best approach to programmatically setting styles on an unordered list used for navigation so the appropriate menu item is styled as the active item if that page is being viewed? \nThis would most likely be used in conjunction with a MasterPage....
I need to send an HTML email. All email clients (Outlook, Thunderbird ..) but Entourage can receive and read this email without major problems. Entourage, though is breaking the content and displays just few lines from the beginning. My guess is that it has something to do with the way how Entourage handles quoted-prin...
The issue you're experiencing with Microsoft Entourage displaying only part of your HTML email could indeed be related to how Entourage handles quoted-printable encoding, particularly when it encounters certain characters or sequences, such as `=00`, which is encoded NULL. Here are a few suggestions to troubleshoot an...
38,184
[ { "from": "human", "value": "I need to send an HTML email. All email clients (Outlook, Thunderbird ..) but Entourage can receive and read this email without major problems. Entourage, though is breaking the content and displays just few lines from the beginning.\nMy guess is that it has something to do with...
I've heard some people saying that enums are evil and shouldn't be used in web services because of the mismatches that could occur between the server and the client if some values are assigned, or if the enum is marked with the Flags attribute. They also said that web services exposing enums are harder to maintain but ...
Enums can be a powerful tool in defining a set of named constants in your code, making your code more readable and maintainable. However, when using enums in web services, such as WCF (Windows Communication Foundation), there are both pros and cons that developers should consider. Here's a breakdown of those aspects: ...
40,523
[ { "from": "human", "value": "I've heard some people saying that enums are evil and shouldn't be used in web services because of the mismatches that could occur between the server and the client if some values are assigned, or if the enum is marked with the Flags attribute. They also said that web services e...
I have the need to create the functionality to allow my registered users to associate themselves with other uses and create a family. My database tables look something like this: db.persons - (Bob, Jane, Timmy, etc) id name email db.persons_persons id person__id_parent person_id_child relationtype_id db.relationtyp...
Your database design appears to be a reasonable approach to modeling relationships between individuals in a family context using a relational database. You have structured your tables to capture the necessary relationships while keeping the model flexible. Here are some points to consider regarding your design and its ...
38,877
[ { "from": "human", "value": "I have the need to create the functionality to allow my registered users to associate themselves with other uses and create a family. My database tables look something like this:\ndb.persons - (Bob, Jane, Timmy, etc)\n\nid\nname\nemail\n\ndb.persons_persons\n\nid\nperson__id_par...
I need to spawn a child process that is a console application, and capture its output. I wrote up the following code for a method: string retMessage = String.Empty; ProcessStartInfo startInfo = new ProcessStartInfo(); Process p = new Process(); startInfo.CreateNoWindow = true; startInfo.RedirectStandardOutput = true; ...
It looks like you're on the right track! Using `p.StandardOutput.ReadToEnd()` directly after starting the process is indeed a simpler and effective way to capture the output of the console application. However, if you want to use asynchronous output reading with the `OutputDataReceived` event, you'll need to make a few...
38,999
[ { "from": "human", "value": "I need to spawn a child process that is a console application, and capture its output.\nI wrote up the following code for a method:\nstring retMessage = String.Empty;\nProcessStartInfo startInfo = new ProcessStartInfo();\nProcess p = new Process();\n\nstartInfo.CreateNoWindow = ...
In the course of my career I've noticed that developers working on new functionality are, as a rule, more cheerful than these assigned to troubleshooting and fixing bugs. Good tips on keeping business support a happy? Organising business support in the way that team's morale isn’t hurt?
Maintaining high morale among business support teams, particularly those tasked with troubleshooting and fixing bugs, is crucial for productivity and job satisfaction. Here are some tips to help keep their spirits up: ### 1. **Acknowledge and Celebrate Achievements** - **Recognize Efforts:** Regularly acknowledge t...
37,653
[ { "from": "human", "value": "In the course of my career I've noticed that developers working on new functionality are, as a rule, more cheerful than these assigned to troubleshooting and fixing bugs.\nGood tips on keeping business support a happy? Organising business support in the way that team's morale is...
I am the .Net specialist in a consultancy with many difference flavors of developers using many different languages and frameworks. Because everyone is pretty much trying to push their own agendas with our different clients in terms of what technology to propose, I'm constantly finding myself in the classic arguments w...
Hi Matt, It's great that you're looking to strengthen your argument for .NET in performance discussions. Here are several strategies and resources that you can use to support your case: ### 1. **Benchmarking Resources**: - **TechEmpower Benchmarks**: This is one of the most comprehensive benchmarking resources ava...
37,617
[ { "from": "human", "value": "I am the .Net specialist in a consultancy with many difference flavors of developers using many different languages and frameworks. Because everyone is pretty much trying to push their own agendas with our different clients in terms of what technology to propose, I'm constantly ...
The controllers in my ASP.NET MVC web app are starting to get a bit bloated with business logic. The examples on the web all show simple controller actions that simply pull data out of a repository and pass it to the view. But what if you also need to support business logic on top of that? Say, for instance, an act...
Yes, your intuition about separating concerns in your ASP.NET MVC application is correct. It is generally a good practice to keep your controllers lean and focused on handling HTTP requests and responses, while delegating the business logic to service classes. This separation helps maintain clean code, improves testabi...
40,156
[ { "from": "human", "value": "The controllers in my ASP.NET MVC web app are starting to get a bit bloated with business logic. The examples on the web all show simple controller actions that simply pull data out of a repository and pass it to the view. But what if you also need to support business logic on...
I've had this problem many times before, and I've never had a solution I felt good about. Let's say I have a Transaction base class and two derived classes AdjustmentTransaction and IssueTransaction. I have a list of transactions in the UI, and each transaction is of the concrete type AdjustmentTransaction or IssueTra...
You are correct in wanting to avoid a switch statement to determine which editor to use for your transaction types. Instead, you can take advantage of the Factory pattern combined with a parallel inheritance hierarchy. Here’s how you can structure your code: 1. **Create an Editor Interface**: Define an interface or an...
39,932
[ { "from": "human", "value": "I've had this problem many times before, and I've never had a solution I felt good about. \nLet's say I have a Transaction base class and two derived classes AdjustmentTransaction and IssueTransaction.\nI have a list of transactions in the UI, and each transaction is of the conc...
C#: public partial class MainWindow : Window { Storyboard a = new Storyboard(); int i; public MainWindow() { InitializeComponent(); a.Completed += new EventHandler(a_Completed); a.Duration = TimeSpan.FromMilliseconds(10); a.Begin(); } void a_Completed(object send...
The issue you're encountering is likely due to the way the `Storyboard` operates and how the `Completed` event is handled. In your code, you are starting the `Storyboard` repeatedly in the `a_Completed` event handler. However, because the duration of the `Storyboard` is set to a very short time (10 milliseconds), it ma...
39,149
[ { "from": "human", "value": "C#:\npublic partial class MainWindow : Window\n{\n Storyboard a = new Storyboard();\n int i;\n public MainWindow()\n {\n InitializeComponent();\n a.Completed += new EventHandler(a_Completed);\n a.Duration = TimeSpan.FromMilliseconds(10);\n ...
I don't have much experience with databases, so I don't know which is better for long-term performance, better practice, etc. Here is my (hypothetical) case: imagine you have a database of customer information and history of purchase orders for each. You want to keep track of how much each customer is buying. I can thi...
Your dilemma is a common one in database design, and you're weighing the trade-offs between performance and maintainability, which is crucial in any long-term project. Both approaches you've outlined have their merits and downsides, so let's break down the considerations further. ### Approach 1: Calculating SUM() on-t...
37,860
[ { "from": "human", "value": "I don't have much experience with databases, so I don't know which is better for long-term performance, better practice, etc.\nHere is my (hypothetical) case: imagine you have a database of customer information and history of purchase orders for each. You want to keep track of h...
I have the following one route, registered in my global.asax. routes.MapRoute( "Home", // Unique name "", // Root url new { controller = "Home", action = "Index", tag = string.Empty, page = 1 } ); kewl. when I start the site, it correctly picks up this route. Now, when I try to programmatically do...
The issue you are experiencing with your route and the `GetVirtualPath` method returning `null` is related to how ASP.NET MVC handles route values and defaults, particularly when you specify default values in your route definition. ### Understanding the Route Configuration In your original route definition: ```cshar...
39,847
[ { "from": "human", "value": "I have the following one route, registered in my global.asax.\nroutes.MapRoute(\n \"Home\", // Unique name\n \"\", // Root url\n new { controller = \"Home\", action = \"Index\", \n tag = string.Empty, page = 1 }\n);\n\nkewl. when I start the site, it correctly pi...
First of all, let me say I am very new to rails, have been working with it for only a couple of days. My first application is a little different from traditional: on one of my model classes I have parts of data that is pulled from a database and other part that is acquired by doing an HTTP REST request to an external r...
Welcome to the world of Rails! It's great to hear that you're diving into building applications. Let's tackle your caching strategy for the external resource you're dealing with. Here’s a comprehensive approach to implementing a caching mechanism for the data you retrieve via HTTP. ### 1. Caching Strategy You can lev...
39,823
[ { "from": "human", "value": "First of all, let me say I am very new to rails, have been working with it for only a couple of days.\nMy first application is a little different from traditional: on one of my model classes I have parts of data that is pulled from a database and other part that is acquired by d...
I develop applications for the PocketPC platform (.NET Compact Framework 2.0 and higher), and one of the problems I constantly run in to is the drop-down width for ComboBox controls is not wide enough to show very long string values. I've run across P/Invoke methods to widen the dropdown width, but what I'd really like...
To achieve the Smartphone-style behavior of ComboBoxes on the PocketPC platform, you have to acknowledge the differences in UI design principles and APIs between the two environments. Unfortunately, the PocketPC and Smartphone platforms utilize distinct control implementations, and the PocketPC does not provide native ...
38,483
[ { "from": "human", "value": "I develop applications for the PocketPC platform (.NET Compact Framework 2.0 and higher), and one of the problems I constantly run in to is the drop-down width for ComboBox controls is not wide enough to show very long string values.\nI've run across P/Invoke methods to widen th...