instruction
stringlengths
14
27.6k
completion
stringlengths
3
38.3k
__original_row_idx
int64
0
50k
conversations
listlengths
2
2
Is anyone using Castle MonoRail and ELMAH with success? We are using a number of Resuces to present users with friendly error messages, but if we do this the exceptions never get as far as ELMAH as the MonoRail rescue intercepts them. Ideally we want the user to see the rescue, but for the exception to be logged in ELM...
Hi Jay, Using Castle MonoRail with ELMAH can indeed present some challenges, especially when you want to handle exceptions gracefully while also logging them for debugging purposes. Since your MonoRail rescues are intercepting the exceptions, you'll need a way to log the exception to ELMAH before presenting the user w...
41,513
[ { "from": "human", "value": "Is anyone using Castle MonoRail and ELMAH with success?\nWe are using a number of Resuces to present users with friendly error messages, but if we do this the exceptions never get as far as ELMAH as the MonoRail rescue intercepts them.\nIdeally we want the user to see the rescue...
From index.jsp code, statement.executeQuery("select * from fus where tester_num like 'hf60' ") ; Example I want "hf60" to be a variable(userinput), wherein USER must input/write data from input text then submit and get the data so that the result will be ("select * from fus where tester_num like 'userinput' ") Wh...
To make the query dynamically accept user input from a form in your `index.jsp`, you need to follow these steps: 1. **Create a Form in `index.jsp`**: Add a form element that allows users to input the `tester_num` and submit it. 2. **Modify the `InsertServlet` to Handle the Query**: The servlet should be capable of pr...
38,309
[ { "from": "human", "value": "From index.jsp code, \nstatement.executeQuery(\"select * from fus where tester_num like 'hf60' \") ;\n\nExample I want \"hf60\" to be a variable(userinput), wherein USER must input/write data from input text then submit and get the data so that the result will be \n(\"select *...
I have a JComponent that's painting various shapes on itself. I'm detecting whenever the mouse enters one of these shapes and changing the tooltip accordingly. The problems I'm having are: The tooltip doesn't follow the mouse as the user tracks the mouse across the shape. It stays where it was first set and then onl...
To achieve immediate tooltip display and have it follow the mouse as it moves over shapes, you can leverage the functionality of the `ToolTipManager` and the mouse events within your `JComponent`. Here's a way to implement your requirements: 1. **Immediate Tooltip Appearance**: You can control the delay of the tooltip...
35,152
[ { "from": "human", "value": "I have a JComponent that's painting various shapes on itself. I'm detecting whenever the mouse enters one of these shapes and changing the tooltip accordingly.\nThe problems I'm having are:\n\nThe tooltip doesn't follow the mouse as the user tracks the mouse across the shape. I...
I need to create a rectangle bubble with rounded corners with text inside, like a cartoon speech bubble. I need the bubble to expand horizontally and vertically depending on the size of the text it contain. I would like the speech arrow and the radius of the rounded corners to remain constant. I could simply use a pat...
Creating a resizable cartoon speech bubble with rounded corners, maintaining a constant corner radius and arrow position, can be accomplished using a combination of `Grid`, `Rectangle`, and `Path` elements in XAML. Your current implementation is on the right track, but you may need to adjust it to ensure that it dynami...
41,454
[ { "from": "human", "value": "I need to create a rectangle bubble with rounded corners with text inside, like a cartoon speech bubble. I need the bubble to expand horizontally and vertically depending on the size of the text it contain. I would like the speech arrow and the radius of the rounded corners to ...
I have a small math problem I am trying to solve Given a number x and resolution y, I need to find the next x' with the required resolution. e.g. x = 1.002 y = 0.1 x'= 1.1 x = 0.348 y = 0.1 x'= 0.4 x = 0.50 y = 1 x'= 1 x = 0.32 y = 0.05 x'= 0.35 Is there any smart way of doing this in ...
You can find the next number `x'` that rounds up to the required resolution `y` using a simple mathematical approach. The idea is to determine the next multiple of `y` that is greater than or equal to `x`. You can achieve this by using the `math.ceil` function to round up after dividing `x` by `y` and then multiplying ...
44,390
[ { "from": "human", "value": "I have a small math problem I am trying to solve\nGiven a number x and resolution y, I need to find the next x' with the required resolution.\ne.g.\nx = 1.002 y = 0.1 x'= 1.1\n\nx = 0.348 y = 0.1 x'= 0.4\n\nx = 0.50 y = 1 x'= 1\n\nx = 0.32 y = 0.05 ...
I have an issue with EMMA where it is correctly covering all my various Java projects except one. I am puzzled as to why this occurs as the ANT script appears to be correct. The following expected output is given: [echo] c:\cc_local_home\emmadata\ProjectName [instr] processing instrumentation path ... [instr] instrume...
From the description of your issue with EMMA, it seems like the main problem lies in the absence of runtime coverage data being generated during the execution of your tests. This is why you're seeing the message "nothing to do: no runtime coverage data found in any of the data files" when you run the `emma.report` task...
40,750
[ { "from": "human", "value": "I have an issue with EMMA where it is correctly covering all my various Java projects except one.\nI am puzzled as to why this occurs as the ANT script appears to be correct. The following expected output is given:\n [echo] c:\\cc_local_home\\emmadata\\ProjectName\n[instr] proce...
Is there any way to force Text-Mate to use a two-space tab instead of a full tab when editing HTML (Rails) documents?
Yes, you can configure TextMate to use two spaces instead of a full tab when editing HTML (Rails) documents by adjusting the settings for your project or for specific file types. Here’s how to do it: ### Set Up Indentation in TextMate 1. **Open Your Document**: Open an HTML (or Rails) file in TextMate. 2. **Access P...
42,136
[ { "from": "human", "value": "Is there any way to force Text-Mate to use a two-space tab instead of a full tab when editing HTML (Rails) documents?\n" }, { "from": "gpt", "value": "Yes, you can configure TextMate to use two spaces instead of a full tab when editing HTML (Rails) documents by adjus...
I'm using a Response.Redirect to redirect users to another server to download a file, and the other server is checking the header to ensure it came from the correct server... however it seems Response.Redirect strips the headers from the Response. Does anybody know how i can add the headers back? I've tried: Response....
When you're using `Response.Redirect` in ASP.NET, it issues an HTTP 302 status code to instruct the client to navigate to a different URL. This redirection results in the client making a new request to the target URL, and any custom headers you may have set are not carried over to that new request. This is a limitation...
38,991
[ { "from": "human", "value": "I'm using a Response.Redirect to redirect users to another server to download a file, and the other server is checking the header to ensure it came from the correct server... however it seems Response.Redirect strips the headers from the Response.\nDoes anybody know how i can ad...
I need a command to replace the hosts file on my machine. Seems pretty straight forward but I cannot get the command to work with xcopy. Any obvious flaws in the command? luaexec -w -f "XCOPY" "%ScriptPath%/ModifiedHosts/vista/hosts" "%windir%/system32/drivers/etc/hosts" /H The /R flag does not seem to help and the er...
The error message "ShellExecuteEx failed 0x2" usually indicates that the command is unable to locate the specified file. In your `luaexec` command, there are a few potential issues to consider: 1. **File Paths**: Ensure that `%ScriptPath%/ModifiedHosts/vista/hosts` is a valid path and that the file actually exists at ...
41,985
[ { "from": "human", "value": "I need a command to replace the hosts file on my machine. Seems pretty straight forward but I cannot get the command to work with xcopy. Any obvious flaws in the command?\nluaexec -w -f \"XCOPY\" \"%ScriptPath%/ModifiedHosts/vista/hosts\" \n\"%windir%/system32/drivers/etc/hosts\...
In a latin-1 database i have '\222\222\223\225', when I try to pull this field from the django models I get back u'\u2019\u2019\u201c\u2022'. from django.db import connection ...
It looks like you're encountering an issue related to character encoding when retrieving data from a MySQL database using Django. The problem arises because the MySQL Python driver is interpreting the data from the database in a different encoding than what you expect (Latin-1). Here are some steps you can take to dia...
38,692
[ { "from": "human", "value": "In a latin-1 database i have '\\222\\222\\223\\225', when I try to pull this field from the django models I get back u'\\u2019\\u2019\\u201c\\u2022'.\nfrom django.db import connection ...
Essentially i want to have a generic function which accepts a LINQ anonymous list and returns an array back. I was hoping to use generics but i just can seem to get it to work. hopefully the example below helps say i have a person object with id, fname, lname and dob. i have a generic class with contains a list of obje...
In VB.NET, to create a generic function that converts an `IEnumerable(Of T)` (which can include anonymous types) to an array, you can do it as follows. However, since anonymous types cannot be directly specified as type parameters in generic methods, you will need to work with a non-generic interface to maintain the fl...
42,884
[ { "from": "human", "value": "Essentially i want to have a generic function which accepts a LINQ anonymous list and returns an array back. I was hoping to use generics but i just can seem to get it to work.\nhopefully the example below helps\nsay i have a person object with id, fname, lname and dob.\ni have ...
How do you modify a propertygrid at runtime in every way? I want to be able to add and remove properties and add "dynamic types", what I mean with that is a type that result in a runtime generated dropdown in the propertygrid using a TypeConverter. I have actually been able to do both those things (add/remove propertie...
To achieve what you want—dynamically adding/removing properties to a `PropertyGrid` and using a custom `TypeConverter` to create a dropdown for a property—you need to ensure that your `CustomProperty` class properly integrates both these functionalities. The primary issue you are likely facing is ensuring that your `Ty...
36,483
[ { "from": "human", "value": "How do you modify a propertygrid at runtime in every way? I want to be able to add and remove properties and add \"dynamic types\", what I mean with that is a type that result in a runtime generated dropdown in the propertygrid using a TypeConverter.\nI have actually been able t...
Is there a way to tell SQL Server to not cache certain types of plans? For example, if you have a large number of users queries coming from SQL Server Management Studio, is there a way to tell these to not be cached in the plan cache, thus taking up memory and other resources? Are there other behavioral tweaks that y...
Yes, there are ways to manage plan caching behavior in SQL Server, particularly for ad-hoc queries or queries coming from tools like SQL Server Management Studio (SSMS). Here are some strategies you can use to reduce the impact of ad-hoc queries on your production server: ### 1. Use the `OPTION (RECOMPILE)` Query Hint...
39,907
[ { "from": "human", "value": "Is there a way to tell SQL Server to not cache certain types of plans? For example, if you have a large number of users queries coming from SQL Server Management Studio, is there a way to tell these to not be cached in the plan cache, thus taking up memory and other resources? ...
I have a string from which I wish to extract a single word, but with a numerical appended to it, which might be different in each line: This is string1 this is string This is string11 This is string6 and it is in this line I want to parse this file and get the values of "stringXXX", starting from 0 to 100 # suppose A...
To achieve your goal of extracting "stringXXX" from each line in your file, you'll want to use a regular expression that matches the pattern you described. Below is a corrected version of your code in Perl, incorporating the necessary changes to accomplish this: ```perl # Open the file for reading open(FH1, "<", "Abc....
43,574
[ { "from": "human", "value": "I have a string from which I wish to extract a single word, but with a numerical appended to it, which might be different in each line:\nThis is string1 this is string\nThis is string11 \nThis is string6 and it is in this line\n\nI want to parse this file and get the values of \...
I have an application that is using Windows Authentication and a SqlRoleProvider for user authentication and role management respectively. It is working fine with my test users that I have added to the database as defaults. The application requires users to login (using Windows credentials) and then be able to use th...
To achieve the desired behavior of automatically assigning new users to a default role upon their first login using Windows Authentication and an enhanced `SqlRoleProvider`, you can use the `Application_AuthenticateRequest` method in the `Global.asax` file. This method is triggered on every request, but you can impleme...
42,905
[ { "from": "human", "value": "I have an application that is using Windows Authentication and a SqlRoleProvider for user authentication and role management respectively. It is working fine with my test users that I have added to the database as defaults. The application requires users to login (using Window...
In the below program: class Main { static string staticVariable = "Static Variable"; string instanceVariable = "Instance Variable"; public Main(){} } The instanceVariable will be stored inside the memory allocated for object instance. Where will the staticVariable be stored, is it stored in the obje...
In your program, the `staticVariable` is a static member of the `Main` class. Here's how the memory allocation works for static and instance variables: 1. **Instance Variables**: The `instanceVariable` is associated with an instance of the `Main` class. Each time you create an object (or instance) of `Main`, a separat...
42,683
[ { "from": "human", "value": "In the below program:\nclass Main\n{ \n static string staticVariable = \"Static Variable\";\n string instanceVariable = \"Instance Variable\";\n\n public Main(){} \n}\n\nThe instanceVariable will be stored inside the memory allocated for object instance. Where will ...
I need to be able to allow query strings that contain characters like '<' and '>'. However, putting something like id=mi<ke into the the URL will output an error page saying: A potentially dangerous Request.QueryString value was detected from the client (id="mi<ke"). If I first url encode the url (to create id=mi%3Cke)...
The error you're encountering is related to ASP.NET's request validation feature, which is designed to prevent potentially dangerous content from being processed. By default, ASP.NET blocks certain characters in input fields, including query strings, to protect against cross-site scripting (XSS) attacks. If you want t...
40,301
[ { "from": "human", "value": "I need to be able to allow query strings that contain characters like '<' and '>'. However, putting something like id=mi<ke into the the URL will output an error page saying:\nA potentially dangerous Request.QueryString value was detected from the client (id=\"mi<ke\").\nIf I fi...
I know that new-ing something in one module and delete-ing it in another can often cause problems in VC++. Problems with different runtimes. Mixing modules with staticly linked runtimes and/or dynamically linked versioning mismatches both can screw stuff up if I recall correctly. However, is it safe to use VC++ 2008's ...
Using `std::tr1::shared_ptr` (or any `shared_ptr` for that matter) across module boundaries in VC++ can indeed be tricky due to potential mismatches in runtime libraries, especially if you are mixing different linking models (static vs. dynamic). Here are some considerations and best practices to ensure safety when us...
41,869
[ { "from": "human", "value": "I know that new-ing something in one module and delete-ing it in another can often cause problems in VC++. Problems with different runtimes. Mixing modules with staticly linked runtimes and/or dynamically linked versioning mismatches both can screw stuff up if I recall correctly...
How do conditional statements (like IF ... ELSE) affect the query execution plan in SQL Server (2005 and above)? Can conditional statements cause poor execution plans, and are there any form of conditionals you need to be wary of when considering performance? ** Edited to add ** : I'm specifically referring to the ca...
Conditional statements like `IF ... ELSE` in SQL Server can have significant implications for query execution plans, particularly when it comes to caching and performance. ### Effects of Conditional Statements on Query Execution Plans 1. **Execution Plan Caching**: In your example with the `IF ... ELSE` statement,...
40,335
[ { "from": "human", "value": "How do conditional statements (like IF ... ELSE) affect the query execution plan in SQL Server (2005 and above)? \nCan conditional statements cause poor execution plans, and are there any form of conditionals you need to be wary of when considering performance?\n** Edited to ad...
When I'm writing spaghetti code in my MVC views, R# keeps automatically dropping my braces to the next line and indenting and such. Is there a way I can turn this off for just my view pages?
Yes, you can configure ReSharper (R#) to apply different formatting settings for specific file types, such as your MVC view pages (e.g., `.cshtml` files). Here’s how you can adjust the formatting settings specifically for your view pages: 1. **Open ReSharper Options:** - Go to the top menu and click on `ReSharper`....
42,206
[ { "from": "human", "value": "When I'm writing spaghetti code in my MVC views, R# keeps automatically dropping my braces to the next line and indenting and such. Is there a way I can turn this off for just my view pages?\n" }, { "from": "gpt", "value": "Yes, you can configure ReSharper (R#) to ap...
My application's context root is /foobar and I am running an exploded deployment with maven-jetty-plugin. I need to dynamically remap requets for /images/* to /foobar/images/*, and I cannot remap my application's context root to /. For weblogic I have a halfwit solution where I deploy an additional war containing a pro...
To achieve the dynamic request remapping of `/images/*` to `/foobar/images/*` while using the `maven-jetty-plugin` with an exploded deployment, you can use a servlet filter or a custom servlet to handle the mapping. This way, you won't need to deploy a separate WAR file or modify the context root. Here’s a basic appro...
39,142
[ { "from": "human", "value": "My application's context root is /foobar and I am running an exploded deployment with maven-jetty-plugin.\nI need to dynamically remap requets for /images/* to /foobar/images/*, and I cannot remap my application's context root to /.\nFor weblogic I have a halfwit solution where ...
When you run git branch -r why the blazes does it list origin/HEAD? For example, there's a remote repo on GitHub, say, with two branches: master and awesome-feature. If I do git clone to grab it and then go into my new directory and list the branches, I see this: $ git branch -r origin/HEAD origin/master origin/awesome...
The `origin/HEAD` reference in the output of `git branch -r` serves as a convenience feature for users working with remote repositories. Here’s a bit more detail on what it represents and why it exists: ### What is `origin/HEAD`? 1. **Symbolic Reference**: `origin/HEAD` is a symbolic reference that points to the defa...
43,182
[ { "from": "human", "value": "When you run git branch -r why the blazes does it list origin/HEAD? For example, there's a remote repo on GitHub, say, with two branches: master and awesome-feature. If I do git clone to grab it and then go into my new directory and list the branches, I see this:\n$ git branch -...
I'm trying to load javascript code with a user web control into a page via a the Page.LoadControl method during an asyncron post back of an update panel. I've tried the specially for that scenario designed methods of the scriptmanager, but the javascript just doens't get returned to the user. To explain my scenario a b...
Injecting JavaScript into a page during an asynchronous postback using the `ScriptManager` can be a bit tricky, especially when dealing with user controls and the ASP.NET UpdatePanel. Here's how you can manage JavaScript injection correctly in this scenario. ### Understanding the Basics 1. **Page Lifecycle**: The ASP...
41,122
[ { "from": "human", "value": "I'm trying to load javascript code with a user web control into a page via a the Page.LoadControl method during an asyncron post back of an update panel.\nI've tried the specially for that scenario designed methods of the scriptmanager, but the javascript just doens't get return...
I would like to create a custom XmlDeclaration while using the XmlDocument/XmlDeclaration classes in c# .net 2 or 3. This is my desired output (it is an expected output by a 3rd party app): <?xml version="1.0" encoding="ISO-8859-1" ?> <?MyCustomNameHere attribute1="val1" attribute2="val2" ?> [ ...more xml... ] Using ...
In the .NET Framework, the `XmlDocument` and `XmlDeclaration` classes are specifically designed to handle the standard XML declaration, and they only allow for a single XML declaration at the beginning of the document. However, if you need to include a custom declaration (like your `<?MyCustomNameHere attribute1="val1"...
40,964
[ { "from": "human", "value": "I would like to create a custom XmlDeclaration while using the XmlDocument/XmlDeclaration classes in c# .net 2 or 3. \nThis is my desired output (it is an expected output by a 3rd party app):\n<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>\n<?MyCustomNameHere attribute1=\"val1...
I have a couple of apps talking to each other, and I use a NamedPipe. But if the other app isn't available then the NamedPipe waits for ever to connect. It also doesn't support timeouts. What's the right way to do this?
To manage communication between applications using Named Pipes while avoiding indefinite blocking when the other app is unavailable, you have several options: ### 1. **Use `CreateNamedPipe` with Non-Blocking Mode** You can create the Named Pipe in a non-blocking mode. In Windows, you can set the `SECURITY_ATTRIBUTES` ...
40,277
[ { "from": "human", "value": "I have a couple of apps talking to each other, and I use a NamedPipe. But if the other app isn't available then the NamedPipe waits for ever to connect. It also doesn't support timeouts.\nWhat's the right way to do this?\n" }, { "from": "gpt", "value": "To manage com...
In SQL server 2005 this query select len(cast('the quick brown fox jumped over the lazy dog' as varchar)) returns 30 as length while the supplied string has more characters. This seems to be the default. Why 30, and not 32 or any other power of 2? [EDIT] I am aware that I should always specifiy the length when casting...
In SQL Server 2005, when you use the `CAST` function to convert a string to `VARCHAR` without specifying the length, SQL Server defaults to a length of `30` characters for the `VARCHAR` type. This is a design choice made by Microsoft for the behavior of the `CAST` function in such cases. The reason why the default len...
44,006
[ { "from": "human", "value": "In SQL server 2005 this query\nselect len(cast('the quick brown fox jumped over the lazy dog' as varchar))\n\nreturns 30 as length while the supplied string has more characters. This seems to be the default. Why 30, and not 32 or any other power of 2?\n[EDIT] I am aware that I s...
This site is pretty good but I'm wondering what other resources are out there. I guess it's probably pretty language dependent but in general I have not found any other sites with a good wealth of general programming knowledge where I can just post a question and someone will actually answer it. Especially when you'r...
It's great to hear that you find value in the site you're using! There are definitely several resources where you can ask programming questions and get responses, especially for multi-technology issues. Here are some popular ones: 1. **Stack Overflow**: This is one of the largest communities for programmers. You can a...
42,917
[ { "from": "human", "value": "This site is pretty good but I'm wondering what other resources are out there. I guess it's probably pretty language dependent but in general I have not found any other sites with a good wealth of general programming knowledge where I can just post a question and someone will a...
How are you instrumenting your UI's? In the past I've read that people have instrumented their user interfaces, but what I haven't found is examples or tips on how to instrument a UI. By instrumenting, I mean collecting data regarding usage and performance of the system. A MSDN article on Instrumentation is http://msdn...
Instrumenting a WPF application involves gathering data about user interactions and system performance while ensuring that the
1,932
[ { "from": "human", "value": "How are you instrumenting your UI's? In the past I've read that people have instrumented their user interfaces, but what I haven't found is examples or tips on how to instrument a UI.\nBy instrumenting, I mean collecting data regarding usage and performance of the system. A MSDN...
I was unable to install cython due to strict version numbering class of Distutils. For example binutils-2.18.50-20080109-2.tar.gz cannot be used along with MinGW for installing cython. The source code documentation says that "The rationale for this version numbering system will be explained in the distutils documentati...
The rationale for the strict version numbering system in `Distutils` stems from the need for consistency, compatibility, and predictability in package management. Here are some key points regarding this approach: 1. **Semantic Versioning**: Distutils often follows the principles of semantic versioning, where the versi...
42,155
[ { "from": "human", "value": "I was unable to install cython due to strict version numbering class of Distutils. For example binutils-2.18.50-20080109-2.tar.gz cannot be used along with MinGW for installing cython. The source code documentation says that \"The rationale for this version numbering system will...
i could call a page inside the same domain, but its not working when i calling a page in a sub domain due to security issues. what i have to do? help me!!!
When you're trying to access a page on a subdomain from a different subdomain (or the main domain), you may encounter issues due to the same-origin policy enforced by web browsers. This policy restricts how a document or script loaded from one origin can interact with resources from another origin. ### Here are severa...
41,941
[ { "from": "human", "value": "i could call a page inside the same domain, but its not working when i calling a page in a sub domain due to security issues. what i have to do? help me!!!\n" }, { "from": "gpt", "value": "When you're trying to access a page on a subdomain from a different subdomain ...
I'm using an NSTimer to do some rendering in an OpenGL based iPhone app. I have a modal dialog box that pops up and requests user input. While the user is providing input I'd like to "pause" i.e. something like this: [myNSTimer pause]; I'm using this syntax because I've been doing things like: [myNSTimer invalidate]...
NSTimer does not have a built-in `pause` method. However, you can achieve similar functionality by using a boolean flag to control whether your rendering code should execute during the timer's callbacks. Here's a general approach to "pause" an NSTimer: 1. Create a boolean variable to indicate whether the timer should...
43,549
[ { "from": "human", "value": "I'm using an NSTimer to do some rendering in an OpenGL based iPhone app. I have a modal dialog box that pops up and requests user input. While the user is providing input I'd like to \"pause\" i.e. something like this:\n[myNSTimer pause];\n\nI'm using this syntax because I've ...
Is it possible to save an integer array using NSUserDefaults on the iPhone? I have an array declared in my .h file as: int playfield[9][11] that gets filled with integers from a file and determines the layout of a game playfield. I want to be able to have several save slots where users can save their games. If I do:...
Yes, you can save an integer array using `NSUserDefaults`, but you cannot directly save a C array like `int playfield[9][11]`. Instead, you need to convert the array into an `NSArray` or `NSData` format, which `NSUserDefaults` can handle. Here is one way to do it using `NSData` and `NSUserDefaults`: ### Saving the In...
43,572
[ { "from": "human", "value": "Is it possible to save an integer array using NSUserDefaults on the iPhone? I have an array declared in my .h file as: int playfield[9][11] that gets filled with integers from a file and determines the layout of a game playfield. I want to be able to have several save slots wh...
I'm using reflection to loop through a Type's properties and set certain types to their default. Now, I could do a switch on the type and set the default(Type) explicitly, but I'd rather do it in one line. Is there a programmatic equivalent of default?
In C#, you can use `Activator.CreateInstance` to obtain a default instance of a type. This is particularly useful for types that have a parameterless constructor, which includes all reference types (the default will be `null`) and value types (which will be set to their default value). If you're looking for a way to s...
42,957
[ { "from": "human", "value": "I'm using reflection to loop through a Type's properties and set certain types to their default. Now, I could do a switch on the type and set the default(Type) explicitly, but I'd rather do it in one line. Is there a programmatic equivalent of default?\n" }, { "from": ...
Is it possible to use the asp templating engine (With the partial code-behind class, dynamic <% ... %> blocks and such) to generate non HTML? I want to have a clean and maintainable way to generate code dynamically. (Specifically, I want to generate LaTeX code populated with values from a database.) Currently my LaTeX...
Yes, it is indeed possible to use ASP.NET's templating system to generate non-HTML content like LaTeX. While ASP.NET is primarily designed for web applications and generating HTML, you can leverage its capabilities to create any type of text-based output. ### Here are the steps to generate LaTeX code using ASP.NET: 1...
41,750
[ { "from": "human", "value": "Is it possible to use the asp templating engine (With the partial code-behind class, dynamic <% ... %> blocks and such) to generate non HTML? I want to have a clean and maintainable way to generate code dynamically. (Specifically, I want to generate LaTeX code populated with val...
I'm creating a C# dll, which is going to be used by others developers in WinForms. For some reasons, I want to detect, if methods from this library, are called from Main (GUI) Thread and warn developer he has done such a thing (ie. in log file). Is there any reasonable way to detect calling method from main thread? Rem...
Detecting whether a method in a C# DLL is called from the main GUI thread (or any specific thread) can be tricky, especially because you don't have access to the WinForms application code itself. However, you can use some common techniques to achieve this. ### Method 1: Use `SynchronizationContext` The `Synchronizat...
38,030
[ { "from": "human", "value": "I'm creating a C# dll, which is going to be used by others developers in WinForms. For some reasons, I want to detect, if methods from this library, are called from Main (GUI) Thread and warn developer he has done such a thing (ie. in log file). Is there any reasonable way to de...
I am being sent an xml feed via multicast, but I don't know the multicast group address. Can I just use localhost instead? Socket socket = new Socket(AddressFamily.InterNetwork,SocketType.Dgram,ProtocolType.Udp); IPEndPoint ip = new IPEndPoint(IPAddress.Any,8888); socket.Bind(ip); socket.SetSocketOption (Socke...
Using `localhost` (or `127.0.0.1`) as the multicast group address won't work for multicast communication. Multicast addresses are in the range of `224.0.0.0` to `239.255.255.255`, and they are intended for sending data to multiple hosts at once. The IP address `127.0.0.1` is a loopback address used for communication wi...
41,140
[ { "from": "human", "value": "I am being sent an xml feed via multicast, but I don't know the multicast group address. Can I just use localhost instead?\nSocket socket = \n new Socket(AddressFamily.InterNetwork,SocketType.Dgram,ProtocolType.Udp);\nIPEndPoint ip = new IPEndPoint(IPAddress.Any,8888);\nsock...
Recently my team has spent too many hours setting up machines with previous product releases or database servers with specific patches. In some cases, we have taken a developers machine down for up three days as a result. Clearly, this would be an ideal case for using a virtual machine. I am trying to champion the prac...
Using virtualization tools can significantly streamline the setup process for development and testing environments, and it's great that you're looking to implement this in your team's workflow. Aside from VMware, there are several other virtualization tools that you can consider for your Java development on Windows XP ...
41,257
[ { "from": "human", "value": "Recently my team has spent too many hours setting up machines with previous product releases or database servers with specific patches. In some cases, we have taken a developers machine down for up three days as a result. Clearly, this would be an ideal case for using a virtual ...
How do I check if a string represents a numeric value in Python? def is_number(s): try: float(s) return True except ValueError: return False The above works, but it seems clunky. If what you are testing comes from user input, it is still a string even if it represents an int or a float...
Your `is_number` function is a common way to check if a string can be converted to a numeric value in Python. It uses exception handling to attempt conversion and determine if a value can be treated as a number. While it works well, there are alternative approaches that can be cleaner or more specific, depending on you...
42,870
[ { "from": "human", "value": "How do I check if a string represents a numeric value in Python?\ndef is_number(s):\n try:\n float(s)\n return True\n except ValueError:\n return False\n\nThe above works, but it seems clunky.\n\nIf what you are testing comes from user input, it is sti...
I'm developing a website (using asp.net by the way) and I'm having a problem with IE6. When I use some icons near links, using background-image and padding-left on the links, the icons display nice on FF and Chrome but in IE6 they take a kind of "gray" background, and sometimes the flash strangely. Any ideas? is there ...
Dealing with Internet Explorer 6 (IE6) can be quite challenging due to its poor CSS support and rendering issues. The problem you're encountering with the icons and the background color is commonly related to how IE6 handles background images and padding. Here are some potential solutions and CSS hacks to help you res...
39,039
[ { "from": "human", "value": "I'm developing a website (using asp.net by the way) and I'm having a problem with IE6.\nWhen I use some icons near links, using background-image and padding-left on the links, the icons display nice on FF and Chrome but in IE6 they take a kind of \"gray\" background, and sometim...
Source RegexOptions.IgnoreCase is more expensive than I would have thought (eg, should be barely measurable) Assuming that this applies to PHP, Python, Perl, Ruby etc as well as C# (which is what I assume Jeff was using), how much of a slowdown is it and will I incur a similar penalty with /[a-zA-z]/ as I will with /...
The performance impact of using case-insensitive regular expressions can vary significantly between different programming languages and their respective regex engines. In general, here are some considerations regarding the performance of case-insensitive matching: ### Performance Impact 1. **Regex Engine Implementati...
1,143
[ { "from": "human", "value": "Source\n\nRegexOptions.IgnoreCase is more expensive than I would have thought (eg, should be barely measurable)\n\nAssuming that this applies to PHP, Python, Perl, Ruby etc as well as C# (which is what I assume Jeff was using), how much of a slowdown is it and will I incur a sim...
I'm looking for a method to grep for multiple atoms e.g. "foo" and "bar". I'm aware i can use grep 'foo' file | grep 'bar' to get both of them but i was wondering if there was a more efficient way. Any googleing seems to only throw results for an 'or' based search rather than 'and'.
To search for multiple patterns (like "foo" and "bar") in a file and ensure that both are present in the same line, you can use `grep` with the `-E` option for extended regular expressions. Specifically, you can use a positive lookahead assertion to achieve this in a single `grep` command. Here's how you can do it: ...
42,401
[ { "from": "human", "value": "I'm looking for a method to grep for multiple atoms e.g. \"foo\" and \"bar\".\nI'm aware i can use \ngrep 'foo' file | grep 'bar'\nto get both of them but i was wondering if there was a more efficient way. Any googleing seems to only throw results for an 'or' based search rather...
I'm using MSVE, and I have my own tiles I'm displaying in layers on top. Problem is, there's a ton of them, and they're on a network server. In certain directories, there are something on the order of 30,000+ files. Initially I called Directory.GetFiles, but once I started testing in a pseudo-real environment, it timed...
When dealing with a large number of files, like 30,000+ in a single directory
1,945
[ { "from": "human", "value": "I'm using MSVE, and I have my own tiles I'm displaying in layers on top. Problem is, there's a ton of them, and they're on a network server. In certain directories, there are something on the order of 30,000+ files. Initially I called Directory.GetFiles, but once I started testi...
So, I'm reasonably new to both unit testing and mocking in C# and .NET; I'm using xUnit.net and Rhino Mocks respectively. I'm a convert, and I'm focussing on writing behaviour specifications, I guess, instead of being purely TDD. Bah, semantics; I want an automated safety net to work above, essentially. A thought str...
Your thought about semi-integration tests is indeed an interesting topic in the realm of software testing. Let's break down your question and explore the potential value and trade-offs of this approach. ### Understanding the Testing Layers 1. **Unit Tests**: These tests validate individual units of code (usually a cl...
38,980
[ { "from": "human", "value": "So, I'm reasonably new to both unit testing and mocking in C# and .NET; I'm using xUnit.net and Rhino Mocks respectively. I'm a convert, and I'm focussing on writing behaviour specifications, I guess, instead of being purely TDD. Bah, semantics; I want an automated safety net ...
In its enthusiasm to stemm tokens into lexemes, PostgreSQL Full Text Search engine also reduce proper nouns. For instance: essais=> select to_tsquery('english', 'bortzmeyer'); to_tsquery ------------ 'bortzmey' essais=> select to_tsquery('english', 'balling'); to_tsquery ------------ 'ball' (1 row) At least for the...
In PostgreSQL's Full Text Search (FTS), stemming is applied by default to reduce words to their base or root form, which can sometimes lead to the issues you've identified, especially with proper nouns or specialized terms that shouldn't be stemmed. To avoid unwanted stemming, you have a few options: ### 1. Use a Diff...
43,061
[ { "from": "human", "value": "In its enthusiasm to stemm tokens into lexemes, PostgreSQL Full Text Search engine also reduce proper nouns. For instance:\nessais=> select to_tsquery('english', 'bortzmeyer');\nto_tsquery \n------------\n'bortzmey'\n\nessais=> select to_tsquery('english', 'balling');\nto_tsquer...
We had a discussion here at work regarding why fread() and fwrite() take a size per member and count and return the number of members read/written rather than just taking a buffer and size. The only use for it we could come up with is if you want to read/write an array of structures which aren't evenly divisible by the...
The design choice behind the `fread()` and `fwrite()` functions in C, which take a size and a count parameter rather than a single buffer size, is rooted in flexibility and the ability to handle a variety of data structures efficiently. ### Key Reasons for this Design: 1. **Handling Arrays of Different Types:** By...
41,227
[ { "from": "human", "value": "We had a discussion here at work regarding why fread() and fwrite() take a size per member and count and return the number of members read/written rather than just taking a buffer and size. The only use for it we could come up with is if you want to read/write an array of struct...
I know Hostmonster allows Python. Has anyone successfully run Django on there? Any problems?
HostMonster, like many shared hosting providers, offers support for Python, but there are some limitations when it comes to running web frameworks like Django. While some users have been able to set up Django on HostMonster, here are some common challenges and considerations you may encounter: 1. **Shared Hosting Limi...
989
[ { "from": "human", "value": "I know Hostmonster allows Python. Has anyone successfully run Django on there? Any problems? \n" }, { "from": "gpt", "value": "HostMonster, like many shared hosting providers, offers support for Python, but there are some limitations when it comes to running web fram...
Say for example I have the following string: var testString = "Hello, world"; And I want to call the following methods: var newString = testString.Replace("Hello", "").Replace("world", ""); Is there some code construct that simplifies this, so that I only have to specify the Replace method once, and can specify a bunch...
Yes, you can simplify the process of replacing multiple substrings in a single go by using a loop or a more functional approach. While C# does not have a built-in method that allows you to replace multiple strings in a single method call, you can create an extension method or use a list of strings along with LINQ. Her...
40,342
[ { "from": "human", "value": "Say for example I have the following string:\nvar testString = \"Hello, world\";\nAnd I want to call the following methods:\nvar newString = testString.Replace(\"Hello\", \"\").Replace(\"world\", \"\");\nIs there some code construct that simplifies this, so that I only have to s...
As far as I understand, binding to a var in ActionScript is carried out via events which are automatically fired when a var is changed. I have a few questions about this: What happens if the class doesn't explicitly extend EventDispatcher? Is there is some sort of magic that goes on in the compiler which essentially m...
Your questions regarding ActionScript's binding mechanism and the use of the `[Bindable]` metadata tag highlight some key features and inner workings of the language. Let’s break down your questions one by one: ### 1. What happens if the class doesn't explicitly extend EventDispatcher? If a class in ActionScript does...
38,603
[ { "from": "human", "value": "As far as I understand, binding to a var in ActionScript is carried out via events which are automatically fired when a var is changed. I have a few questions about this:\n\nWhat happens if the class doesn't explicitly extend EventDispatcher? Is there is some sort of magic that ...
I'm using int as an example, but this applies to any value type in .Net In .Net 1 the following would throw a compiler exception: int i = SomeFunctionThatReturnsInt(); if( i == null ) //compiler exception here Now (in .Net 2 or 3.5) that exception has gone. I know why this is: int? j = null; //nullable int if( i == ...
Your observation highlights a feature of the C# type system known as *nullable types*. Let's explore this a bit further. In C#, the concept of nullable types (like `int?`, which is shorthand for `
1,799
[ { "from": "human", "value": "I'm using int as an example, but this applies to any value type in .Net\nIn .Net 1 the following would throw a compiler exception:\nint i = SomeFunctionThatReturnsInt();\n\nif( i == null ) //compiler exception here\n\nNow (in .Net 2 or 3.5) that exception has gone.\nI know why t...
Does anyone know how the built in dictionary type for python is implemented? My understanding is that it is some sort of hash table, but I haven't been able to find any sort of definitive answer.
Yes, you are correct that Python's built-in dictionary type (`dict`) is implemented using a hash table. The dictionary is designed to provide efficient key-value pair storage and retrieval. Here are some key points about its implementation: 1. **Hash Table**: Dictionaries in Python use a hash table under the hood. Whe...
42,889
[ { "from": "human", "value": "Does anyone know how the built in dictionary type for python is implemented? My understanding is that it is some sort of hash table, but I haven't been able to find any sort of definitive answer.\n" }, { "from": "gpt", "value": "Yes, you are correct that Python's bu...
I'm new to Flex, although not new to programming. I want to write a generic event handler that will be called by all my textinput boxes when they receive focus. When they have focus, I want to change the colour of the textinput box. When they lose focus, I want to restore the "inactive" color profile. I could write a...
In Flex/ActionScript, you can indeed create a generic event handler that responds to focus events for multiple TextInput components. You can take advantage of event handling and the `event.target` property to identify which TextInput has triggered the event. This way, you can manipulate the properties of the TextInput ...
42,140
[ { "from": "human", "value": "I'm new to Flex, although not new to programming. I want to write a generic event handler that will be called by all my textinput boxes when they receive focus. When they have focus, I want to change the colour of the textinput box. When they lose focus, I want to restore the ...
mysql> desc categories; +-------+-------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +-------+-------------+------+-----+---------+----------------+ | id | int(11) | NO | PRI | NULL | auto_increment | | name | varchar(80) | YES | | NUL...
You can indeed achieve this using ActiveRecord without embedding raw SQL in your Rails application. Using ActiveRecord provides several advantages, such as better abstraction, built-in query optimizations, and easier maintenance as you move between different database vendors. Here’s how you can translate your SQL quer...
43,013
[ { "from": "human", "value": "mysql> desc categories;\n+-------+-------------+------+-----+---------+----------------+\n| Field | Type | Null | Key | Default | Extra |\n+-------+-------------+------+-----+---------+----------------+\n| id | int(11) | NO | PRI | NULL | auto_increme...
How to get the number of years between two java.util.Date? Note: using only java.util.Date
To calculate the number of years between two `java.util.Date` objects in Java, you need to consider how to handle the calculation properly, taking into account the difference in time and how to round the difference to years. Here is a step-by-step guide to do that: 1. Get the time in milliseconds from both dates. 2. ...
40,480
[ { "from": "human", "value": "How to get the number of years between two java.util.Date?\nNote: using only java.util.Date\n" }, { "from": "gpt", "value": "To calculate the number of years between two `java.util.Date` objects in Java, you need to consider how to handle the calculation properly, ta...
I'm relatively new to the Windows Server world (coming from *nix land). I'm used to analyzing a web-server's configuration by grepping through an apache config file. Is there an equivalent file/group-of-files for IIS? Lacking that, is there an official scripting interface for IIS?
Welcome to the Windows Server world! IIS (Internet Information Services) doesn't have a single configuration file like Apache's `httpd.conf`, but it does use a system of XML configuration files primarily stored in the following locations: 1. **ApplicationHost.config**: This is the main configuration file for IIS, whic...
41,996
[ { "from": "human", "value": "I'm relatively new to the Windows Server world (coming from *nix land). I'm used to analyzing a web-server's configuration by grepping through an apache config file. \nIs there an equivalent file/group-of-files for IIS? Lacking that, is there an official scripting interface fo...
I want to pose a question such as: What is your name? Joe How would I accomplish this using Console.WriteLine to also wait for the response on that same line instead of it being broken into: What is your name? Joe
In C#, you can achieve the behavior of prompting for user input on the same line as the question by using `Console.Write()` instead of `Console.WriteLine()`. The `Write()` method outputs the text without adding a new line, allowing the user's response to appear immediately after the prompt. Here’s an example of how yo...
44,351
[ { "from": "human", "value": "I want to pose a question such as:\n\nWhat is your name? Joe\n\nHow would I accomplish this using Console.WriteLine to also wait for the response on that same line instead of it being broken into:\n\nWhat is your name?\nJoe\n\n" }, { "from": "gpt", "value": "In C#, y...
I'm trying to do a simple "Select Count(*) from PRODUCTS where date > xxx" with Castle on NHibernate. If I was directly using NHibernate, I could reuse this question answers but unfortunately I see no easy way to access the Current NHibernate session from Castle Records. I obviously don't want to retrieve all my object...
When working with Castle ActiveRecord (which is built on top of NHibernate), you can perform a count query directly using ActiveRecord's querying capabilities, which abstracts a lot of the NHibernate functionality. To perform a count directly on the `PRODUCTS` table using a date condition, you can use the `Count` meth...
43,151
[ { "from": "human", "value": "I'm trying to do a simple \"Select Count(*) from PRODUCTS where date > xxx\" with Castle on NHibernate.\nIf I was directly using NHibernate, I could reuse this question answers but unfortunately I see no easy way to access the Current NHibernate session from Castle Records.\nI o...
I have been searching for recent performance benchmarks that compare L2S and EF and couldnt find any that tested calling stored procedures using the released version of EF. So, I ran some of my own tests and found some interesting results. Do these results look right? Should I be testing it in a different way? One inst...
It sounds like you've conducted some interesting performance tests comparing LINQ to SQL (L2S) and Entity Framework (EF) with respect to calling stored procedures. However, since I cannot access external links or dead links, I can provide some general guidance on how to interpret your results and suggestions for furthe...
39,182
[ { "from": "human", "value": "I have been searching for recent performance benchmarks that compare L2S and EF and couldnt find any that tested calling stored procedures using the released version of EF. So, I ran some of my own tests and found some interesting results.\nDo these results look right? Should I ...
What is a good free PHP script to use as a poll for a website? I'd need a simple script to show on the web page with the standard multiple option vote + bar chart graph. Also an admin interface with add / edit / delete poll would be required.
There are several free PHP scripts available that can be used to create polls with the features you're looking for. Below are a few popular options that include features such as multiple-choice voting, bar chart graph display, and an admin interface for managing polls: ### 1. **PHP Poll Script by PHPJabbers** - **Feat...
39,903
[ { "from": "human", "value": "What is a good free PHP script to use as a poll for a website? I'd need a simple script to show on the web page with the standard multiple option vote + bar chart graph. Also an admin interface with add / edit / delete poll would be required.\n" }, { "from": "gpt", "...
Can anyone give me details of runtime error 3734 in Access vba. For reference i am getting it from a code in the following thread How to run a loop of queries in access? Sub plausibt_check() Dim rs As DAO.Recordset Dim rs2 As ADODB.Recordset Dim db As database Dim strsql As String Dim tdf As TableDef Set db = o...
The error "Runtime Error 3734: The operation requested by the application is not allowed because the object is open." in Microsoft Access VBA typically occurs when you're trying to manipulate an object (like a recordset or a database) that is already open or in use in a way that conflicts with the current state of the ...
40,456
[ { "from": "human", "value": "Can anyone give me details of \n\nruntime error 3734\n\nin Access vba.\nFor reference i am getting it from a code in the following thread\nHow to run a loop of queries in access?\nSub plausibt_check()\n\nDim rs As DAO.Recordset\nDim rs2 As ADODB.Recordset\nDim db As database\nDi...
I'm currently planning the migration of a Microsoft Content Management Server (MCMS) website to a SharePoint 2007 publishing site. The top-level site is a public facing, anonymously-accessible website. It will contain two areas which need to be protected with forms-based authentication - each of which will have a disti...
Migrating from Microsoft Content Management Server (MCMS) to SharePoint 2007 can be a complex task, especially with your requirement for a public-facing site and multiple protected areas using forms-based authentication (FBA). Here are some thoughts and recommendations on your scenario: ### Single Web Application with...
41,599
[ { "from": "human", "value": "I'm currently planning the migration of a Microsoft Content Management Server (MCMS) website to a SharePoint 2007 publishing site.\nThe top-level site is a public facing, anonymously-accessible website. It will contain two areas which need to be protected with forms-based authen...
If i try to paste source code in word 2007 the spacing between the lines seems to get messed up as all new lines are spaced way apart compared to a programming text editor. Can somebody tell me how to paste source code in word 2007 preserving the formatting and the spacing between lines?
Pasting source code into Word 2007 while preserving the formatting can indeed be tricky. Here are some steps to help you paste your code correctly while maintaining the desired spacing and formatting: ### Method 1: Use "Keep Text Only" 1. **Copy the Code**: In your code editor, select the code you want to copy and pr...
39,776
[ { "from": "human", "value": "If i try to paste source code in word 2007 the spacing between the lines seems to get messed up as all new lines are spaced way apart compared to a programming text editor.\nCan somebody tell me how to paste source code in word 2007 preserving the formatting and the spacing betw...
I wan't to change the background color of a div dynamicly using the following HTML, CSS and javascript. HTML: <div id="menu"> <div class="menuItem"><a href=#>Bla</a></div> <div class="menuItem"><a href=#>Bla</a></div> <div class="menuItem"><a href=#>Bla</a></div> </div> CSS: .menuItem{ display:inline; ...
You can achieve dynamic background color changes on hover using the jQuery code you provided. However, to ensure that the DOM is fully loaded before the JavaScript runs, you should wrap your jQuery code in a `$(document).ready()` function. Here’s the complete code with the necessary adjustments: ### HTML ```html <div ...
42,411
[ { "from": "human", "value": "I wan't to change the background color of a div dynamicly using the following HTML, CSS and javascript.\nHTML:\n<div id=\"menu\">\n <div class=\"menuItem\"><a href=#>Bla</a></div>\n <div class=\"menuItem\"><a href=#>Bla</a></div>\n <div class=\"menuItem\"><a href=#>Bla<...
Is there a way to detect whether IIS is enabled or not? I know how to check if it is INSTALLED, but I need to know if it's installed but not enabled. Also, can this be done natively via InstallShield? Checking this via .NET would be acceptable as we can write custom actions, but if there is an IS call then that would ...
Detecting whether Internet Information Services (IIS) is enabled or not involves checking its state on the system. While you might have already determined if IIS is installed, checking if it is enabled requires a bit more work. Here are a few methods to achieve this, including using InstallShield and .NET. ### Using P...
36,221
[ { "from": "human", "value": "Is there a way to detect whether IIS is enabled or not?\nI know how to check if it is INSTALLED, but I need to know if it's installed but not enabled.\nAlso, can this be done natively via InstallShield? Checking this via .NET would be acceptable as we can write custom actions, ...
What is the difference in terms of functionality between the Apache HTTP Server and Apache Tomcat? I know that Tomcat is written in Java and the HTTP Server is in C, but other than that I do not really know how they are distinguished. Do they have different functionality?
Yes, Apache HTTP Server (often referred to as simply "Apache") and Apache Tomcat are different in terms of functionality and the roles they serve in web application deployment. Here are the key distinctions: ### 1. **Purpose and Use Case**: - **Apache HTTP Server**: This is a web server designed primarily to
1,630
[ { "from": "human", "value": "What is the difference in terms of functionality between the Apache HTTP Server and Apache Tomcat?\nI know that Tomcat is written in Java and the HTTP Server is in C, but other than that I do not really know how they are distinguished. Do they have different functionality?\n" ...
What is the difference between find-grep and grep-find in Emacs?
In Emacs, both `find-grep` and `grep-find` are commands used for searching text within files, but they differ in how they execute the search and the specific functionality they provide. ### `grep-find` - **Purpose**: `grep-find` is used to search for a regular expression across files in the current directory and its ...
42,602
[ { "from": "human", "value": "What is the difference between find-grep and grep-find in Emacs?\n" }, { "from": "gpt", "value": "In Emacs, both `find-grep` and `grep-find` are commands used for searching text within files, but they differ in how they execute the search and the specific functionali...
Inside my page, I have the following: <aspe:UpdatePanel runat="server" ID="updatePanel"> <ContentTemplate> <local:KeywordSelector runat="server" ID="ksKeywords" /> </ContentTemplate> </aspe:UpdatePanel> The KeywordSelector control is a control I define in the same assembly and local is mapped to its na...
It sounds like you're encountering an issue where the child controls within your `KeywordSelector` user control are not being properly initialized. Since you mentioned that the `Controls` collection is empty, this suggests that the child controls may not be instantiated due to some lifecycle issue. Here are a few thing...
40,973
[ { "from": "human", "value": "Inside my page, I have the following:\n<aspe:UpdatePanel runat=\"server\" ID=\"updatePanel\">\n <ContentTemplate>\n <local:KeywordSelector runat=\"server\" ID=\"ksKeywords\" />\n </ContentTemplate>\n</aspe:UpdatePanel>\n\nThe KeywordSelector control is a control I d...
During navigation of the java.lang.reflect.Method class I came across the method isBridge. Its Javadoc says that it returns true only if the Java spec declares the method as true. Please help me understand what this is used for! Can a custom class declare its method as a bridge if required?
In Java, a bridge method is a synthetic method that the Java compiler automatically creates to ensure type compatibility during method overriding when generics are involved. The `isBridge` method in the `java.lang.reflect.Method` class allows you to check if a given method is one of these synthetic bridge methods. ###...
40,388
[ { "from": "human", "value": "During navigation of the java.lang.reflect.Method class I came across the method isBridge. Its Javadoc says that it returns true only if the Java spec declares the method as true.\nPlease help me understand what this is used for! Can a custom class declare its method as a bridge...
i have a problem with windows system cache. Sample code: int main(int argc, char* argv[]) { HANDLE file_ = INVALID_HANDLE_VALUE; file_ = CreateFile( "test_file.txt", GENERIC_WRITE, FILE_SHARE_READ, ...
The behavior you are observing is not a memory leak in the conventional sense, but rather a characteristic of how the Windows file system and its caching mechanism work. When you write to a file in Windows, the system caches those writes to improve performance. The cache is utilized for both reads and writes, allowing...
42,273
[ { "from": "human", "value": "i have a problem with windows system cache.\nSample code:\nint main(int argc, char* argv[])\n{\n HANDLE file_ = INVALID_HANDLE_VALUE;\n file_ = CreateFile(\n \"test_file.txt\",\n GENERIC_WRITE, \n ...
I teach the third required intro course in a CS department. One of my homework assignments asks students to speed up code they have written for a previous assignment. Factor-of-ten speedups are routine; factors of 100 or 1000 are not unheard of. (For a factor of 1000 speedup you have to have made rookie mistakes wit...
Given the constraints you've outlined and the need for a simple, intuitive version control system that accommodates your students’ requirements, I recommend using **Git** with a few additional tools and resources to simplify the experience for beginners. Here’s how you can set it up: ### Why Git? - **Distributed**: Gi...
40,634
[ { "from": "human", "value": "I teach the third required intro course in a CS department. One of my homework assignments asks students to speed up code they have written for a previous assignment. Factor-of-ten speedups are routine; factors of 100 or 1000 are not unheard of. (For a factor of 1000 speedup ...
I was just working on a localizable Lua string solution, when I came up with this hack, problem is I don't know how to avoid getting hacked by it :) So I was wondering if anyone, has done something similar and or knows how to protect from this kind of attack. (in user code) Since we can do this: =("foo"):upper() -->out...
What you're encountering is a potential security issue related to the metatables in Lua. Specifically, the problem arises from modifying the behavior of built-in types like strings through their metatables. This can allow an attacker to override the default functions, leading to malicious behavior such as exiting the a...
42,374
[ { "from": "human", "value": "I was just working on a localizable Lua string solution, when I came up with this hack, problem is I don't know how to avoid getting hacked by it :)\nSo I was wondering if anyone, has done something similar and or knows how to protect from this kind of attack. (in user code)\nSi...
How does one preserve the settings in the Open Dialog box? For example, I would the Open Dialog to remember that I chose the Details view and sorted by date modified.
Preserving settings in the Open dialog box, such as view type (Details view) and sort order (by date modified), can vary depending on the operating system you are using (e.g., Windows or macOS) and the specific application. However, here's a general approach to achieve this in Windows, as it's the most common scenario:...
40,719
[ { "from": "human", "value": "How does one preserve the settings in the Open Dialog box? For example, I would the Open Dialog to remember that I chose the Details view and sorted by date modified.\n" }, { "from": "gpt", "value": "Preserving settings in the Open dialog box, such as view type (Det...
Does anyone know tools like SpyStudio to hook processes? The features I would like to have are: log function calls on other processes GUI scriptable opensource I already looked at some tools like: SpyStudio Detours DynInst but none really fully satisfies me.
If you're looking for tools similar to SpyStudio that allow you to hook processes, log function calls, and meet your other specified criteria (GUI, scriptable, and open-source), here are some alternatives you can consider: 1. **Frida**: - **Description**: Frida is a dynamic instrumentation toolkit that allows you t...
40,583
[ { "from": "human", "value": "Does anyone know tools like SpyStudio to hook processes?\nThe features I would like to have are:\n\nlog function calls on other processes\nGUI\nscriptable\nopensource\n\nI already looked at some tools like:\n\nSpyStudio\nDetours\nDynInst\n\nbut none really fully satisfies me.\n"...
Given this HTML snippet: <div id="box" style="overflow:auto; width:200px; height:200px; border:1px solid black;"> 1<br>2<br>3<br>4<br>5<br>6<br>7<br>8<br>9<br>10<br> 11<br>12<br>13<br>14<br>15<br>16<br>17<br>18<br>19<br>20<br> 21<br>22<br>23<br>24<br>25<br>26<br>27<br>28<br>29<br>30<br> </div> You (usually) get a blac...
To find the current scroll position of the `div` with the ID `box`, you can use plain JavaScript or jQuery to access the `scrollTop` property. This property returns the number of pixels that the content of an element is scrolled vertically. In this case, since each row is 15 pixels high, you can calculate the scroll ...
41,478
[ { "from": "human", "value": "Given this HTML snippet:\n<div id=\"box\" style=\"overflow:auto; width:200px; height:200px; border:1px solid black;\">\n1<br>2<br>3<br>4<br>5<br>6<br>7<br>8<br>9<br>10<br>\n11<br>12<br>13<br>14<br>15<br>16<br>17<br>18<br>19<br>20<br>\n21<br>22<br>23<br>24<br>25<br>26<br>27<br>28...
In the Oracle world, it's been gospel to build your database block size to be even multiples of the File system's block size. I assume this is still true but I'm not adverse to being told why technology has made this irrelevant. But I've been told some SQL Server DBA's are going to upgrade the OS of a SS2000 installati...
Your understanding aligns with key concepts in database and file system performance optimization, but let's clarify a few points regarding SQL Server 2000, page size, and file system block size. ### SQL Server 2000 and Page Size 1. **Fixed Page Size**: SQL Server 2000 indeed has a fixed page size of 8 KB. This page si...
41,785
[ { "from": "human", "value": "In the Oracle world, it's been gospel to build your database block size to be even multiples of the File system's block size. I assume this is still true but I'm not adverse to being told why technology has made this irrelevant.\nBut I've been told some SQL Server DBA's are goin...
In asp.net mvc, I want to create a action for login. So this is how I am doing it: create a action/view named login that simply displays the view. create another action, named login2 that will be the page that handles the form post and checks the database if the username/password are correct. If it is, redirect to so...
Your approach to handling user login in ASP.NET MVC is generally sound, but there are some best practices and improvements you might want to consider for better security, maintainability, and user experience. Below is an outline of your current method along with some recommendations. ### Current Method 1. **Login Act...
35,728
[ { "from": "human", "value": "In asp.net mvc, I want to create a action for login.\nSo this is how I am doing it:\n\ncreate a action/view named login that simply displays the view.\ncreate another action, named login2 that will be the page that handles the form post and checks the database if the username/pa...
I have 2 tables event + event_artist event eventId | eventName ------------------- 1 , gig1 2, gig2 event_artist eventId, artistName ------------------- 1, Led Zip 1, The Beatles ie Led Zep and the Beatles are both playing @ Gig1 I need to create the SQl to bind to a gridview ( you necessarily need to k...
To achieve the desired result where you concatenate artist names for each event into a single string, you can use the `GROUP_CONCAT` function (in MySQL) or its equivalent in other SQL databases. Since you mentioned an inner select, you might want to use a `JOIN` to get the event data and the corresponding artists. Ass...
39,482
[ { "from": "human", "value": "I have 2 tables event + event_artist\nevent\neventId | eventName \n-------------------\n1 , gig1 \n2, gig2 \n\nevent_artist\neventId, artistName \n------------------- \n1, Led Zip \n1, The Beatles \n\nie Led Zep and the Beatles are both playing @ Gig1\nI need to create th...
How do you get two unrelated controls to raise the same custom event? All examples I have seen so far have an event defined within a single control, should I be taking a different approach? Eg. I'd like to raise a custom bubbling event from an OnFocus handler for a button and a textbox.
To have two unrelated controls raise the same custom event in a user interface framework (like WinForms, WPF, or ASP.NET), you generally want to define the event in a shared context, such as a parent control or a manager class. Here's how you can accomplish this in a few steps: ### Step 1: Define a Custom Event First...
42,482
[ { "from": "human", "value": "How do you get two unrelated controls to raise the same custom event? All examples I have seen so far have an event defined within a single control, should I be taking a different approach?\nEg. I'd like to raise a custom bubbling event from an OnFocus handler for a button and ...
If there are 3 tasks(T1,T2,t3) with priority P1 P2 P3. P1 is pended. Assume that task P2 is doing some computation. During its execution, it wants to Yield the CPU to other tasks in the system. Will TaskDelay(0) still works in this condition? or it works only when all the tasks are with same priority? Regards, Prabhu
In many real-time operating systems (RTOS) and multitasking environments, the behavior of task yielding and delays depends on the task scheduling policy and the priorities assigned to the tasks. ### Scenario Breakdown 1. **Task Priorities**: - T1: Priority P1 (pending) - T2: Priority P2 (currently executing) ...
42,739
[ { "from": "human", "value": "If there are 3 tasks(T1,T2,t3) with priority P1 P2 P3. \nP1 is pended.\nAssume that task P2 is doing some computation. During its execution, it wants to Yield the CPU to other tasks in the system.\nWill TaskDelay(0) still works in this condition? or it works only when all the ta...
I'll try to explain my scenario as best i can; At each application tick I query the current state of the keyboard and mouse and wrap them in individual classes and data structures. For the keyboard it's an array of my Keys enum (one item for each of the keys that are currently pressed) and for the mouse it's a class co...
Your scenario sounds interesting, and it shares a lot of common elements with game development. The design pattern you choose will significantly influence how your application processes input. Here are a few considerations to help you decide how best to manage input snapshots in your state machine: ### Option 1: Pre-p...
40,145
[ { "from": "human", "value": "I'll try to explain my scenario as best i can;\nAt each application tick I query the current state of the keyboard and mouse and wrap them in individual classes and data structures. For the keyboard it's an array of my Keys enum (one item for each of the keys that are currently ...
My build environment is configured to compile, run and create coverage file at the command line (using Ned Batchelder coverage.py tool). I'm using Eclipse with PyDev as my editor, but for practical reasons, it's not possible/convenient for me to convert my whole build environment to Eclipse (and thus generate the cove...
Yes, you can integrate the coverage data generated by your external environment into Eclipse with PyDev, allowing you to visualize and analyze your coverage results directly in the IDE. Here’s how you can do that: ### Step 1: Generate Coverage Data First, ensure that you generate the coverage data in a format that PyD...
41,547
[ { "from": "human", "value": "My build environment is configured to compile, run and create coverage file at the command line (using Ned Batchelder coverage.py tool). \nI'm using Eclipse with PyDev as my editor, but for practical reasons, it's not possible/convenient for me to convert my whole build environm...
I'm creating a data entry app for some in-house stuff. My team needs to enter info about "items" which can have many "categories" and vice versa. I need a quick way to let them enter an arbitrary amount of categories. Here's my idea: On the item entry page, I'll have it so that initially there's one text input for "cat...
Your idea for a data entry app that allows users to quickly add categories through keyboard navigation is a solid concept. It optimizes the data entry process and minimizes mouse use, which can enhance productivity. Here are some thoughts and suggestions: ### User Interface Considerations 1. **Usability**: Your appro...
41,031
[ { "from": "human", "value": "I'm creating a data entry app for some in-house stuff.\nMy team needs to enter info about \"items\" which can have many \"categories\" and vice versa.\nI need a quick way to let them enter an arbitrary amount of categories.\nHere's my idea:\nOn the item entry page, I'll have it ...
How do you repopulate a form in ASP.NET MVC that contains a DropDownList?
In ASP.NET MVC, repopulating a form with a `DropDownList` after a form submission (for instance, when there are validation errors) involves ensuring that you provide the list of items for the dropdown in the action method that renders the form again. This is typically done in the `HttpGet` method. Here's how you can d...
40,890
[ { "from": "human", "value": "How do you repopulate a form in ASP.NET MVC that contains a DropDownList?\n" }, { "from": "gpt", "value": "In ASP.NET MVC, repopulating a form with a `DropDownList` after a form submission (for instance, when there are validation errors) involves ensuring that you pr...
I'm comparing between two techniques to create partitioned tables in SQL 2005. Use partitioned views with a standard version of SQL 2005 (described here) Use the built in partition in the Enterprise edition of SQL 2005 (described here) Given that the enterprise edition is much more expensive, I would like to know wha...
When comparing the two methods of creating partitioned tables in SQL Server 2005, there are several factors to consider, especially since you're weighing the cost of the Enterprise Edition against the Standard Edition and the use of partitioned views. Here are the main benefits and differences: ### Benefits of Built-i...
76
[ { "from": "human", "value": "I'm comparing between two techniques to create partitioned tables in SQL 2005.\n\nUse partitioned views with a standard version of SQL 2005 (described here)\nUse the built in partition in the Enterprise edition of SQL 2005 (described here)\n\nGiven that the enterprise edition is...
We use Trac as our bug tracking / development / wiki system and I was wondering if anyone has experience and uses some of the Trac Agile/Scrum plugins or functionalities? Anything you'd recommend? Or would it be better to duplicate Trac tickets as dead-tree user story index cards and a hand-drawn burndown chart? Note ...
Using Trac for Agile and Scrum methodologies can be effective, especially when leveraging specific plugins designed for these frameworks. Here are a few recommendations based on common experiences: ### Trac Agile/Scrum Plugins 1. **Trac Agile**: This plugin introduces various Agile functionalities directly into Trac....
43,507
[ { "from": "human", "value": "We use Trac as our bug tracking / development / wiki system and I was wondering if anyone has experience and uses some of the Trac Agile/Scrum plugins or functionalities? Anything you'd recommend?\nOr would it be better to duplicate Trac tickets as dead-tree user story index car...
I've a problem with partial mocking using Rhino Mocks: var authentication = (FormsAuthenticationService)_mocks.PartialMock( typeof(FormsAuthenticationService)); Expect.Call( delegate{ authentication.SetAuthCookie(null, null); }).IgnoreArguments(); ..and I get NullReferenceException on "Expect." line.. I will just ad...
The `NullReferenceException` you are encountering when using Rhino Mocks for partial mocking could be due to a few different issues. Here are some things to check and potential solutions to help you resolve the problem: 1. **Initialization of Mocks**: Ensure that you have properly initialized your mock object. For ...
39,475
[ { "from": "human", "value": "I've a problem with partial mocking using Rhino Mocks:\nvar authentication = (FormsAuthenticationService)_mocks.PartialMock(\n typeof(FormsAuthenticationService));\nExpect.Call( delegate{ authentication.SetAuthCookie(null, null); }).IgnoreArguments();\n\n..and I get NullReferen...
<asp:RadioButton GroupName="EndorsementType" runat="server" ID="rdoAddProperty" Text="Add Property to TIV" /> <asp:RadioButton GroupName="EndorsementType" runat="server" ID="rdoRemoveProperty" Text="Remove Property from TIV" /> <asp:RadioButton GroupName="EndorsementType" runat="server" ID="rdoChangeProperty" Text="Cha...
In ASP.NET Web Forms, when you want to implement a custom validation for a group of radio buttons, and you want to avoid hardcoding the `ClientId`, you can achieve this by using a more generic JavaScript approach. Instead of referencing specific IDs, you can select the radio buttons based on their `name` attribute, whi...
42,680
[ { "from": "human", "value": "<asp:RadioButton GroupName=\"EndorsementType\" runat=\"server\" ID=\"rdoAddProperty\" Text=\"Add Property to TIV\" />\n<asp:RadioButton GroupName=\"EndorsementType\" runat=\"server\" ID=\"rdoRemoveProperty\" Text=\"Remove Property from TIV\" />\n<asp:RadioButton GroupName=\"Endo...
I am trying to login in to my works Solaris box from cygwin on windows. SSH is not supported. I have tried different combination in the .rhosts with no luck I do not have root privileges.
If you're trying to log in to a Solaris box from Cygwin and SSH is not an option, you might be attempting to use `rlogin` or `telnet`. Since you mentioned issues with `.rhosts`, it sounds like you're specifically trying to use `rlogin`. Here are the steps and considerations to help you troubleshoot your situation: ##...
40,869
[ { "from": "human", "value": "I am trying to login in to my works Solaris box from cygwin on windows.\nSSH is not supported. I have tried different combination in the .rhosts with no luck\nI do not have root privileges.\n" }, { "from": "gpt", "value": "If you're trying to log in to a Solaris box ...
I have a solution which contains many class libraries and an ASP .NET website which references those assemblies. When I build the solution from within the IDE, all assemblies referenced by the website end up in the bin directory. Great! When I use MsBuild from the command line, all the referenced assemblies are not cop...
The issue you're experiencing when building your ASP.NET website using MSBuild from the command line could be caused by a few different factors. Here are some common reasons and their potential solutions: 1. **Target Framework Mismatch**: Ensure that your command line build targets the correct framework. If you have d...
40,144
[ { "from": "human", "value": "I have a solution which contains many class libraries and an ASP .NET website which references those assemblies.\nWhen I build the solution from within the IDE, all assemblies referenced by the website end up in the bin directory. Great!\nWhen I use MsBuild from the command line...
Although a DataTable is a memory hog, wouldn't a DataTable be the best choice to implement and IdentityMap if the set of objects is very large since retrieval time is O(1)? Update If I decide to use IDictionary, do I sacrifice speed when retrieving my objects?
When considering whether to use a `DataTable` or an `IDictionary` for implementing an Identity Map pattern, it's important to weigh the pros and cons of each approach, especially in the context of your application's requirements and the characteristics of the data you are working with. ### DataTable vs. IDictionary 1...
42,357
[ { "from": "human", "value": "Although a DataTable is a memory hog, wouldn't a DataTable be the best choice to implement and IdentityMap if the set of objects is very large since retrieval time is O(1)?\nUpdate\nIf I decide to use IDictionary, do I sacrifice speed when retrieving my objects?\n" }, { ...
We are currently setting up the evaluation criteria for a trade study we will be conducting. One of the criterion we selected is reliability (and/or robustness - are these the same?). How do you assess that software is reliable without being able to afford much time evaluating it? Edit: Along the lines of the response ...
Reliability and robustness are related but distinct concepts in software evaluation. Reliability refers to the ability of the software to perform its intended function consistently over time without failure, while robustness indicates the software's capability to handle errors, unexpected input, or adverse conditions g...
42,074
[ { "from": "human", "value": "We are currently setting up the evaluation criteria for a trade study we will be conducting.\nOne of the criterion we selected is reliability (and/or robustness - are these the same?).\nHow do you assess that software is reliable without being able to afford much time evaluating...
Is anyone using the OSGi Bundle Repository and what for?
Yes, the OSGi (Open Services Gateway initiative) Bundle Repository is used by various developers and organizations for managing and deploying modular applications in a service-oriented architecture. Here are some common use cases: 1. **Modular Application Development**: Developers use OSGi to create modular applicatio...
43,179
[ { "from": "human", "value": "Is anyone using the OSGi Bundle Repository and what for?\n" }, { "from": "gpt", "value": "Yes, the OSGi (Open Services Gateway initiative) Bundle Repository is used by various developers and organizations for managing and deploying modular applications in a service-o...
I am getting a web host and i have projects with teammats. I thought it be a nice idea to have my own paste site that has no expiry date on paste (i know http://pastie.org/ exist) and other things. i wanted to know. Whats a simple highlight lib i can use on code? i would be only using C/C++.
If you're looking to create your own paste site with syntax highlighting for C/C++, there are several libraries you can use to achieve this. Here are some simple and popular options: 1. **Highlight.js**: - Website: [highlightjs.org](https://highlightjs.org/) - Highlight.js is a lightweight JavaScript library tha...
38,823
[ { "from": "human", "value": "I am getting a web host and i have projects with teammats. I thought it be a nice idea to have my own paste site that has no expiry date on paste (i know http://pastie.org/ exist) and other things. i wanted to know. Whats a simple highlight lib i can use on code? i would be onl...
A table exists that someone else loaded. I need to query against the table, but the lack of indexes makes the query plan abysmal. What I would like to do is detect if there is an index for a particular column, so that I can created it if it does not exist, and not create it if it is already there. Thanks. Evil
To check for the existence of an index on a specific column in a SQL database, you can query the system catalog or information schema, depending on the type of database management system (DBMS) you are using. Below are examples for common DBMSs: ### For PostgreSQL: You can use the following query to check for the exi...
40,379
[ { "from": "human", "value": "A table exists that someone else loaded. I need to query against the table, but the lack of indexes makes the query plan abysmal. What I would like to do is detect if there is an index for a particular column, so that I can created it if it does not exist, and not create it if...
I came across a c library for opening files given a Unicode filename. Before opening the file, it first converts the filename to a path by prepending "\\?\". Is there any reason to do this other than to increase the maximum number of characters allowed in the path, per this msdn article? It looks like these "\\?\" pat...
Yes, prepending the `\\?\` prefix to a file path in Windows serves a couple of important purposes, primarily related to how the Windows API handles file paths and the various limitations associated with them. Here’s a deeper look into why this is done and its implications: 1. **Extended Length Paths**: As you correctl...
42,675
[ { "from": "human", "value": "I came across a c library for opening files given a Unicode filename. Before opening the file, it first converts the filename to a path by prepending \"\\\\?\\\". Is there any reason to do this other than to increase the maximum number of characters allowed in the path, per this...
I'm inserting something in the cache when the user does a login. Now I want to delete that from the cache when the user's session expires. HttpContext is null .. so I don't know for which user the session expired. How can I go about finding this ? EDIT: unfortunately SessionID doesn't offer me much. What i'm doing in ...
To manage cache entries when user sessions expire, you can take advantage of the ASP.NET session state management features. While it's true that you won't have access to `HttpContext` directly in an `HttpModule`, you can still achieve your goal by handling session expiration events in a different way. ### Solution App...
41,213
[ { "from": "human", "value": "I'm inserting something in the cache when the user does a login. \nNow I want to delete that from the cache when the user's session expires. HttpContext is null .. so I don't know for which user the session expired. How can I go about finding this ?\nEDIT: unfortunately SessionI...
I need to reinforce the structure of a Microsoft Word document. EG: Style Question here blah blah blah Style Answer Here blah blahblah The enforcement here would be the "Answer" style cannot be placed unless there is a "Question" style above it. To do this I would use a Macro, so ideally I would like to call my Macro e...
In Microsoft Word, you can indeed use VBA macros to enforce styles and implement checks for your document structure. However, you're correct that there isn't a built-in event that triggers a macro every time the document is edited. Instead, you can attach your macro to the `Document_Change` event, but this event is not...
41,424
[ { "from": "human", "value": "I need to reinforce the structure of a Microsoft Word document.\nEG:\nStyle Question here blah blah blah\nStyle Answer Here blah blahblah\nThe enforcement here would be the \"Answer\" style cannot be placed unless there is a \"Question\" style above it.\nTo do this I would use a...
I've heard that trampolining is an ineffective way of implementing TCO. How does DrScheme (PLAI Scheme, technically) do it? Does it do it the 'right' way (that is, produce assembly code which directly branches to the tail call, instead of going through the stack and trampolining)?
In DrScheme (now known as Racket), the implementation of tail call optimization (TCO) is indeed designed to efficiently handle tail calls, which is a crucial feature for functional programming languages like Scheme. To clarify, tail call optimization is a technique that allows a program to reuse the current function's...
41,415
[ { "from": "human", "value": "I've heard that trampolining is an ineffective way of implementing TCO. How does DrScheme (PLAI Scheme, technically) do it? Does it do it the 'right' way (that is, produce assembly code which directly branches to the tail call, instead of going through the stack and trampolining...
My current process for debugging stored procedures is very simple. I create a table called "debug" where I insert variable values from the stored procedure as it runs. This allows me to see the value of any variable at a given point in the script, but is there a better way to debug MySQL stored procedures?
Debugging stored procedures in MySQL can indeed be challenging, especially because traditional debugging tools are limited. Your current method of creating a debug table to log variable values is a common and effective practice, but there are some other techniques and tools that can enhance your debugging process: 1. ...
40,423
[ { "from": "human", "value": "My current process for debugging stored procedures is very simple. I create a table called \"debug\" where I insert variable values from the stored procedure as it runs. This allows me to see the value of any variable at a given point in the script, but is there a better way to ...
I cannot get a two-way bind in WPF to work. I have a string property in my app's main window that is bound to a TextBox (I set the mode to "TwoWay"). The only time that the value of the TextBox will update is when the window initializes. When I type into the TextBox, the underlying string properties value does not c...
In WPF (Windows Presentation Foundation), to achieve two-way binding between a `TextBox` and a property in your view model (or code-behind), you need to ensure that a few key aspects are correctly implemented. Here are the steps you need to follow to ensure that your two-way binding works as expected: ### 1. Implement...
38,147
[ { "from": "human", "value": "I cannot get a two-way bind in WPF to work. \nI have a string property in my app's main window that is bound to a TextBox (I set the mode to \"TwoWay\"). \nThe only time that the value of the TextBox will update is when the window initializes. \nWhen I type into the TextBox, the...
I recently upgraded from Delphi 4 to Delphi 2009. With Delphi 4 I had been using GpProfile by Primoz Gabrijelcic as a profiler and Memory Sleuth by Turbo Power for memory analysis and leak debugging. Both worked well for me. But I now need new tools that will work with Delphi 2009. The leader in Profiling/Analysis too...
It sounds like you've done a thorough investigation into your options for profiling and memory analysis in Delphi 2009, and you've rightly identified some of the major tools available. Here’s a summary of your considerations along with some additional insights: ### Memory Analysis 1. **FastMM**: As you've noted, FastM...
41,367
[ { "from": "human", "value": "I recently upgraded from Delphi 4 to Delphi 2009. With Delphi 4 I had been using GpProfile by Primoz Gabrijelcic as a profiler and Memory Sleuth by Turbo Power for memory analysis and leak debugging. Both worked well for me. But I now need new tools that will work with Delphi 20...