instruction
stringlengths
14
27.6k
completion
stringlengths
3
38.3k
__original_row_idx
int64
0
50k
conversations
listlengths
2
2
Although using SQL FOR XML EXPLICIT is cumbersome, I find myself using it often. Since it allows full control over the generated XML document. My problem is with perfomance, sometimes it would take more than 5 minutes to generate an XML document describing some financial data (invoices, bills .. etc.) for just one mont...
Generating XML documents using SQL Server's `FOR XML EXPLICIT` can indeed be cumbersome, but it allows for a high level of control over the structure of the output XML. However, performance can be a significant concern when dealing with large datasets, especially with complex queries. Here are some tips to help improve...
32,071
[ { "from": "human", "value": "Although using SQL FOR XML EXPLICIT is cumbersome, I find myself using it often. Since it allows full control over the generated XML document.\nMy problem is with perfomance, sometimes it would take more than 5 minutes to generate an XML document describing some financial data (...
I have to tables that have a many to many relationship. I have created the correct table codesecure_project_tst_definition and it works. I can join rows together by calling the codesecure_projects << method on a TstDefinition object. The problem is that for some reason active record wants to use Codesecure_project_i...
The issue you're encountering is due to how ActiveRecord sets up join tables for a many-to-many relationship. In your case, you're using `has_and_belongs_to_many` (HABTM) associations, but it seems that the join table `codesecure_projects_tst_definitions` is not properly configured to work with the associations you're ...
30,635
[ { "from": "human", "value": "I have to tables that have a many to many relationship. I have created the correct table codesecure_project_tst_definition and it works. I can join rows together by calling the codesecure_projects << method on a TstDefinition object. The problem is that for some reason active...
In .Net Activator.GetObject(Type type, string url, object data) returns a proxy to the object. I guess that proxy inherits from MarshalByRefObject and can be sent across AppDomains. Am I right? In my app, I am creating an object in appdomain A and using it appdomain B. The object's members are proxyobjects created usin...
Hello Anil, Your understanding of how the .NET remoting and `Activator.GetObject` work with proxies and `MarshalByRefObject` is correct. When you create an object in one AppDomain and access it from another using a proxy, you should be able to interact with it across boundaries without issues, provided everything is s...
29,991
[ { "from": "human", "value": "In .Net Activator.GetObject(Type type, string url, object data) returns a proxy to the object. I guess that proxy inherits from MarshalByRefObject and can be sent across AppDomains. Am I right?\nIn my app, I am creating an object in appdomain A and using it appdomain B. The obje...
For a very simple ajax name lookup, I'm sending an id from the client webpage to the server (Tomcat 5.5, Java 5), looking it up in a database and returning a string, which is assigned to a javascript variable back in the client (and then displayed). The javascript code that receives the value is pretty standard: //clie...
To solve your problem, you have a couple of options for safely sending strings that may contain special characters, such as "ñ", from your server to your client-side JavaScript. ### Option 1: Use JSON for Serialization Instead of trying to manually escape characters for JavaScript, you can serialize your string using...
34,779
[ { "from": "human", "value": "For a very simple ajax name lookup, I'm sending an id from the client webpage to the server (Tomcat 5.5, Java 5), looking it up in a database and returning a string, which is assigned to a javascript variable back in the client (and then displayed).\nThe javascript code that rec...
What techinques do you use? How do you find out which jobs take the longest to run? Is there a way to find out the offending applications?
To determine which jobs or processes take the longest to run and to identify any offending applications, several techniques can be employed, primarily in a systems monitoring and performance analysis context. Here are some common approaches: ### Techniques for Identifying Long-running Jobs: 1. **Monitoring Tools:** ...
33,183
[ { "from": "human", "value": "What techinques do you use? How do you find out which jobs take the longest to run? Is there a way to find out the offending applications?\n" }, { "from": "gpt", "value": "To determine which jobs or processes take the longest to run and to identify any offending appl...
We have a form that allows a user to filter a list with by typing in a textbox. We need to filter the list based on two fields. The FundName and the CompanyName. When the form loads I put the initial LINQ to SQL results into a list so that for every subsequent action (filter) the database is not hit. This speeds things...
The issue you're encountering appears to be related to null values in the `FundName` or `CompanyName` properties of the `FundShort` objects in your `linqFundShortList`. When you're trying to call `.ToLower()` on a null value, it throws a `NullReferenceException`, which leads to the error message you see. To solve this...
34,423
[ { "from": "human", "value": "We have a form that allows a user to filter a list with by typing in a textbox. We need to filter the list based on two fields. The FundName and the CompanyName. When the form loads I put the initial LINQ to SQL results into a list so that for every subsequent action (filter) th...
I'm interested in hearing your opinions in which is the best way of implementing a social activity stream (Facebook is the most famous example). Problems/challenges involved are: Different types of activities (posting, commenting ..) Different types of objects (post, comment, photo ..) 1-n users involved in different ...
Implementing a social activity stream can indeed be a complex task given the variety of activities, objects, roles, and representations involved. Below are some thoughts on how to approach this problem, along with design patterns, data models, and considerations that can lead to an effective implementation, especially ...
31,435
[ { "from": "human", "value": "I'm interested in hearing your opinions in which is the best way of implementing a social activity stream (Facebook is the most famous example). Problems/challenges involved are:\n\nDifferent types of activities (posting, commenting ..)\nDifferent types of objects (post, comment...
I am trying to write a bash script for testing that takes a parameter and sends it through curl to web site. I need to url encode the value to make sure that special characters are processed properly. What is the best way to do this? Here is my basic script so far: #!/bin/bash host=${1:?'bad host'} value=$2 shift s...
To URL-encode a value in a Bash script, you can use `curl`'s `--data-urlencode` option, which handles the encoding for you. You can adjust your script accordingly to make it simpler and more reliable. Here’s how you can modify your existing script: ```bash #!/bin/bash # Check if the host parameter is provided host=${...
34,683
[ { "from": "human", "value": "I am trying to write a bash script for testing that takes a parameter and sends it through curl to web site. I need to url encode the value to make sure that special characters are processed properly. What is the best way to do this? \nHere is my basic script so far:\n#!/bin/...
I was trying to figure out how to implement method_missing in C# 4, based on all of 2 blog posts floating around on IDynamicObject. What I want to do is have a Business Logic Layer that has a Repository, and if the method is missing from the Business Logic Layer, just call the Repository and pass through its result. ...
To effectively implement `IDynamicObject` in C# and delegate method calls to a repository, you need to ensure that the result of the invoked method is properly handled and returned from the dynamic method. When you invoke a method on the repository, you should also return the result from the `Call` method of your `Repo...
34,594
[ { "from": "human", "value": "I was trying to figure out how to implement method_missing in C# 4, based on all of 2 blog posts floating around on IDynamicObject. \nWhat I want to do is have a Business Logic Layer that has a Repository, and if the method is missing from the Business Logic Layer, just call the...
I know that Ctrl + Shift + B launches a solution build, but I would like a shortcut that just builds the current project. Is a custom shortcut my only option? Edit: Looks like a custom shortcut is my only option as Shift + F6 does not work for me.
If you're looking to build the current project in Visual Studio and `Shift + F6` doesn't work for you, creating a custom shortcut is indeed a viable solution. However, there are other built-in options you might want to check to see if they can meet your needs before resorting to custom shortcuts. Here are a few steps ...
31,448
[ { "from": "human", "value": "I know that Ctrl + Shift + B launches a solution build, but I would like a shortcut that just builds the current project. Is a custom shortcut my only option?\nEdit: Looks like a custom shortcut is my only option as Shift + F6 does not work for me.\n" }, { "from": "gpt",...
This is a problem that only occurs on application update (only tested through Admin Console, not CLI). Also, this is only happening on our development environment, which is identical to our prod env. On uninstall/install, everything is compiled properly. However, this is a large application and it takes long enough ...
It sounds like you're encountering a specific issue with JSP compilation in your WebSphere Application Server (WAS) environment. Given that this is only happening in your development environment and only for one JSP and its associated tag library, here are some troubleshooting steps you can consider: 1. **Check JSP Co...
34,639
[ { "from": "human", "value": "This is a problem that only occurs on application update (only tested through Admin Console, not CLI). Also, this is only happening on our development environment, which is identical to our prod env. On uninstall/install, everything is compiled properly. However, this is a la...
I want to do validation on my business code. I'm thinking of 2 ways to do this. One, do the validation on my class property setters in the following fashion class Student{ public string Name{ get { return _name; } set { if (value.IsNullOrEmpty) throw exception ... } } } No...
Hi Ray, You've outlined a thoughtful approach to validation in your business code, and both of your proposed methods have their pros and cons. Let's take a closer look at each method and discuss potential problems, performance, readability, maintainability, and some additional considerations for validation in your mid...
31,736
[ { "from": "human", "value": "I want to do validation on my business code. I'm thinking of 2 ways to do this.\nOne, do the validation on my class property setters in the following fashion\nclass Student{\n public string Name{\n get { return _name; }\n set {\n if (value.IsNullOrEmp...
C++ guarantees that variables in a compilation unit (.cpp file) are initialised in order of declaration. For number of compilation units this rule works for each one separately (I mean static variables outside of classes). But, the order of initialization of variables, is undefined across different compilation units. W...
Understanding the initialization order of static variables across different compilation units in C++ can indeed be complex, and relying on it can lead to subtle bugs. Both GCC (GNU Compiler Collection) and MSVC (Microsoft Visual C++) may exhibit different behaviors due to how they handle the initialization of global va...
30,882
[ { "from": "human", "value": "C++ guarantees that variables in a compilation unit (.cpp file) are initialised in order of declaration. For number of compilation units this rule works for each one separately (I mean static variables outside of classes).\nBut, the order of initialization of variables, is undef...
I am creating a Firefox Extension...what would be the javascript to open a URL in the current tab from a menuitem? e.g. in my overlay.xul file i have the following line: <menuitem label="Visit homepage" oncommand="window.location='http://www.somepage.com'"/> but in firefox, when i click on the menu item, it opens the ...
When creating a Firefox extension, it's important to manipulate the browser's behavior in a way that is consistent with its architecture. Instead of directly modifying `window.location` to change the URL, which can lead to layout issues, you can use the `gBrowser` object to open the URL in the current tab correctly. H...
35,618
[ { "from": "human", "value": "I am creating a Firefox Extension...what would be the javascript to open a URL in the current tab from a menuitem?\ne.g. in my overlay.xul file i have the following line:\n<menuitem label=\"Visit homepage\" oncommand=\"window.location='http://www.somepage.com'\"/>\n\nbut in fire...
POSIX environments provide at least two ways of accessing files. There's the standard system calls open(), read(), write(), and friends, but there's also the option of using mmap() to map the file into virtual memory. When is it preferable to use one over the other? What're their individual advantages that merit incl...
In POSIX environments, both traditional file I/O system calls (like `open()`, `read()`, `write()`, etc.) and memory-mapped file I/O using `mmap()` have their own advantages and are suitable for different scenarios. The choice between them depends on the specific requirements of your application. Here's a breakdown of t...
30,529
[ { "from": "human", "value": "POSIX environments provide at least two ways of accessing files. There's the standard system calls open(), read(), write(), and friends, but there's also the option of using mmap() to map the file into virtual memory.\nWhen is it preferable to use one over the other? What're t...
I am trying to setup SQL Reporting services on windows vista, iis7 but I keep getting this error when I try http://localhost/Reports/Pages/Folder.aspx Server Error in '/Reports' Application. Request is not available in this context Description: An unhandled exception occurred during the execution of the current web...
The error message you are encountering indicates an issue with the ASP.NET application environment, specifically related to the integrated mode of IIS 7 and the way requests are being handled in SQL Server Reporting Services (SSRS). Here are a few steps you can take to resolve this issue: ### 1. **Check Application Po...
31,102
[ { "from": "human", "value": "I am trying to setup SQL Reporting services on windows vista, iis7 but I keep getting this error when I try http://localhost/Reports/Pages/Folder.aspx\n\nServer Error in '/Reports' Application.\nRequest is not available in this context Description: An unhandled\n exception occ...
<% Set xmlDoc = Server.CreateObject("MSXML2.DOMDOCUMENT") xmlDoc.loadXML( "<response />" ) Set node = xmlDoc.createElement("account") xmlDoc.documentElement.AppendChild node Set node = xmlDoc.createElement("type") node.Text = "TheType" xmlDoc.documentElement.AppendChild node Set node ...
To modify your ASP code so that the `<type>` node is appended as a child of the `<account>` node instead of directly under `<response>`, you need to change the logic a bit. Specifically, you will want to append the `<type>` node to the `<account>` node after you have created both nodes. Here's how you can do it: ```...
35,341
[ { "from": "human", "value": "<%\n Set xmlDoc = Server.CreateObject(\"MSXML2.DOMDOCUMENT\")\n xmlDoc.loadXML( \"<response />\" )\n\n Set node = xmlDoc.createElement(\"account\")\n xmlDoc.documentElement.AppendChild node\n\n Set node = xmlDoc.createElement(\"type\")\n node.Text = \"TheType\"...
I have the following code: for attribute in site.device_attributes device.attribute end where I would like the code to substitute the value of "attribute" for the method name. I have tried device."#{attribute}" and various permutations. Is this completely impossible? Am I missing something? I have considered overrid...
In Ruby, if you want to dynamically call a method based on the name stored in a variable, you can use the `send` method. The `send` method allows you to call a method by its name as a symbol or string. Here's how you can modify your code to use `send` to call the method specified by `attribute`: ```ruby for attribute...
34,741
[ { "from": "human", "value": "I have the following code:\nfor attribute in site.device_attributes\n device.attribute\nend\n\nwhere I would like the code to substitute the value of \"attribute\" for the method name.\nI have tried device.\"#{attribute}\" and various permutations.\nIs this completely impossibl...
I can't think of many reasons (or any at all) in which multiple independent user interfaces should be instantiated in a desktop application. Is it good practice to implement the UI as a singleton? Are there are advantages or disadvantages to this approach?
Using a singleton pattern for your user interface in a desktop application can be a tempting design choice, but it comes with both advantages and disadvantages. Here’s a breakdown of each side: ### Advantages of Singleton UI 1. **Global Access**: A singleton UI provides a single, globally accessible instance, ensurin...
34,006
[ { "from": "human", "value": "I can't think of many reasons (or any at all) in which multiple independent user interfaces should be instantiated in a desktop application. Is it good practice to implement the UI as a singleton? Are there are advantages or disadvantages to this approach?\n" }, { "from"...
I am working on a large project that uses the STL and have a question about your preferred way to organise your STL #includes. Do you prefer to #include each header in the source file it is used. For example, if both foo.cpp and bar.cpp require std::string, then both will #include <string>. Do you prefer to have a si...
When it comes to organizing STL (Standard Template Library) `#include` directives in C++ projects, both methods you mentioned have their pros and cons, and the best choice often depends on the project's size, structure, and specific requirements. Here's a breakdown of both approaches: ### Including STL Headers in Each...
34,855
[ { "from": "human", "value": "I am working on a large project that uses the STL and have a question about your preferred way to organise your STL #includes.\n\nDo you prefer to #include each header in the source file it is used. For example, if both foo.cpp and bar.cpp require std::string, then both will #i...
In honor of the Hutter Prize, what are the top algorithms (and a quick description of each) for text compression? Note: The intent of this question is to get a description of compression algorithms, not of compression programs.
The Hutter Prize is a competition that encourages advancements in lossless data compression, particularly focused on text data. Here are some of the top algorithms used for text compression, along with quick descriptions of each: 1. **Lempel-Ziv-Welch (LZW)**: - LZW is a dictionary-based compression algorithm that ...
29,760
[ { "from": "human", "value": "In honor of the Hutter Prize, \nwhat are the top algorithms (and a quick description of each) for text compression?\nNote: The intent of this question is to get a description of compression algorithms, not of compression programs.\n" }, { "from": "gpt", "value": "The...
Im currently working on a PPC application that I would like to test in the PPC emulator "USA Windows mobile 5.0 PC R2 Emulator" without using Active Sync. Somewhere in my back head I think I have been able to just do that: But when I start a debug session with Visual Studio, it can not deploy the application to the emu...
To debug a Windows Mobile 5.0 application in the emulator without using ActiveSync, you will need to follow these steps to ensure that your application can be deployed successfully. While ActiveSync provides a convenient way to sync and deploy applications, there are ways to run and test your application without it. #...
31,566
[ { "from": "human", "value": "Im currently working on a PPC application that I would like to test in the PPC emulator \"USA Windows mobile 5.0 PC R2 Emulator\" without using Active Sync. Somewhere in my back head I think I have been able to just do that: But when I start a debug session with Visual Studio, i...
I've got a form that's a few pages long. To traverse the form all I'm doing is showing and hiding container divs. The last page is a confirmation page before submitting. It takes the contents of the form and lays it out so the user can see what he/she just filled out. If they click on one of these it'll take them back ...
It sounds like you're on the right track with your form confirmation page, but creating separate variables for each field is definitely not the most efficient approach, especially if you have a lot of fields. Instead, you can use loops and jQuery to make your code more scalable and manageable. Let’s break down how you ...
31,968
[ { "from": "human", "value": "I've got a form that's a few pages long. To traverse the form all I'm doing is showing and hiding container divs. The last page is a confirmation page before submitting. It takes the contents of the form and lays it out so the user can see what he/she just filled out. If they cl...
This is hopefully a simple question: I have an OpenGL texture and would like to be able to change its opacity, how do I do that? The texture already has an alpha channel and blending works fine, but I want to be able to decrease the opacity of the whole texture, to fade it into the background. I have fiddled with glBle...
To adjust the opacity of your OpenGL texture in OpenGL ES, you can use a combination of blending and modifying the color of the texture when rendering it. Since you want to change the overall opacity of the entire texture, the recommended approach is to use `glColor4f` to apply a color tint that includes the desired al...
33,640
[ { "from": "human", "value": "This is hopefully a simple question: I have an OpenGL texture and would like to be able to change its opacity, how do I do that? The texture already has an alpha channel and blending works fine, but I want to be able to decrease the opacity of the whole texture, to fade it into ...
Earlier today I was hunting down a very weird bug... I finally traced it down to what seems to be causing the problem. The original report can be found here: original question The details have changed enough to warrant a new question. It would seem my application sometimes, NOT ALL OF THE TIME, freezes when it reaches ...
It sounds like you were dealing with a tricky issue related to your application's performance, particularly with how it accesses the database using Entity Framework (EF) and LINQ. The fact that the query was causing the application to freeze intermittently can be a result of various factors. Here are some possible expl...
32,460
[ { "from": "human", "value": "Earlier today I was hunting down a very weird bug... I finally traced it\ndown to what seems to be causing the problem.\nThe original report can be found here: original question\nThe details have changed enough to warrant a new question.\nIt would seem my application sometimes, ...
I'm learning C++ and writing little programs as I go along. The following is one such program: // This program is intended to take any integer and convert to the // corresponding signed char. #include <iostream> int main() { signed char sch = 0; int n = 0; while(true){ std::cin >> n; sch = n; std::...
The behavior you're observing in your C++ program stems from the way signed char types and integer types handle values, as well as how the program interacts with invalid input. ### Key Points: 1. **Signed char and Range**: A `signed char` in C++ typically has a range of `-128` to `127`. When you assign a value ou...
32,166
[ { "from": "human", "value": "I'm learning C++ and writing little programs as I go along. The following is one such program:\n// This program is intended to take any integer and convert to the\n// corresponding signed char.\n\n#include <iostream>\n\nint main()\n{\n signed char sch = 0;\n int n = 0;\n whi...
The Visual Studio 2005 C++ debugger keeps stepping into disassembly view when I "Step into" or "Step Over". This is not something I want, so I have to keep right-clicking and "Go To Source Code". It doesn't always do this - I think it gets confused when stepping between different projects in the same solution (stati...
If the Visual Studio 2005 C++ debugger is stepping into disassembly instead of the source code, it indicates that it cannot find the appropriate debugging symbols (PDB files) or the source code files for the project. Here are several potential solutions to resolve this issue: 1. **Verify Debug Configuration**: Ensure ...
33,772
[ { "from": "human", "value": "The Visual Studio 2005 C++ debugger keeps stepping into disassembly view when I \"Step into\" or \"Step Over\". This is not something I want, so I have to keep right-clicking and \"Go To Source Code\". \nIt doesn't always do this - I think it gets confused when stepping betwee...
I have a sequential workflow with a number of Activities. One of these activities needs to access my paid S3 account. It works fine, but to be cautious, I would like to make sure it can handle unexpected situations, such as 'Host not found' or some timeout, etc. So .. i would normally put the code inside a TRY / CATCH....
To handle unexpected situations when connecting to your paid S3 account and ensure that your workflow behaves appropriately, you can follow these best practices: ### 1. Use Try/Catch with Retry Logic Within the `try` block, you would attempt to connect and perform your S3 operations. In the `catch` block, you can impl...
33,794
[ { "from": "human", "value": "I have a sequential workflow with a number of Activities. One of these activities needs to access my paid S3 account. It works fine, but to be cautious, I would like to make sure it can handle unexpected situations, such as 'Host not found' or some timeout, etc.\nSo .. i would n...
What would be a simple implementation of a method to convert a String like "Hello there everyone" to "helloThereEveryone". In JavaME support for String and StringBuffer utility operations are quite limited.
In Java ME, since you have limited utility operations for `String` and `StringBuffer`, you can implement a simple method to convert a string from the format "Hello there everyone" to "helloThereEveryone" using basic string manipulation techniques. Here's a straightforward implementation: ```java public class StringCon...
29,419
[ { "from": "human", "value": "What would be a simple implementation of a method to convert a String like \"Hello there everyone\" to \"helloThereEveryone\". In JavaME support for String and StringBuffer utility operations are quite limited.\n" }, { "from": "gpt", "value": "In Java ME, since you h...
We have a decent sized object-oriented application. Whenever an object in the app is changed, the object changes are saved back to the DB. However, this has become less than ideal. Currently, transactions are stored as a transaction and a set of transactionLI's. The transaction table has fields for who, what, when, w...
Your situation is quite common in object-oriented applications that require robust tracking of changes, particularly as they scale. When dealing with transaction logs and audit trails, performance becomes paramount, especially when your transactional data is growing rapidly. Here are some strategies and technologies th...
28,560
[ { "from": "human", "value": "We have a decent sized object-oriented application. Whenever an object in the app is changed, the object changes are saved back to the DB. However, this has become less than ideal.\nCurrently, transactions are stored as a transaction and a set of transactionLI's.\nThe transact...
In T-SQL, SPACE() function is used to add spaces to a string. For e.g. @s = 'He' + space(5) + 'llo' Output He llo So is there any function in PL/SQL that is equivalent to SPACE()? Thank you.
In PL/SQL, while there isn't a direct equivalent to the T-SQL `SPACE()` function, you can achieve similar functionality using the `RPAD()` function. The `RPAD()` function allows you to pad a string on the right with a specified character (in this case, a space) to a given length. Here's how you can use `RPAD()` to mim...
36,054
[ { "from": "human", "value": "In T-SQL, SPACE() function is used to add spaces to a string. For e.g. \n@s = 'He' + space(5) + 'llo'\n\nOutput\nHe llo\n\nSo is there any function in PL/SQL that is equivalent to SPACE()?\nThank you.\n" }, { "from": "gpt", "value": "In PL/SQL, while there isn't ...
How do I embed a tag within a url templatetag in a django template? Django 1.0 , Python 2.5.2 In views.py def home_page_view(request): NUP={"HOMEPAGE": "named-url-pattern-string-for-my-home-page-view"} variables = RequestContext(request, {'NUP':NUP}) return render_to_response('home_page.html', variables...
In Django templates, you cannot nest template tags directly within other template tags, as you've attempted with `{% url {{ NUP.HOMEPAGE }} %}`. Django's template language does not support this kind of syntax. Instead, you can use a different approach to dynamically generate URLs based on the value of `NUP.HOMEPAGE`. ...
32,338
[ { "from": "human", "value": "How do I embed a tag within a url templatetag in a django template?\nDjango 1.0 , Python 2.5.2\nIn views.py\ndef home_page_view(request):\n NUP={\"HOMEPAGE\": \"named-url-pattern-string-for-my-home-page-view\"} \n variables = RequestContext(request, {'NUP':NUP})\n re...
More specifically, if I have: public class TempClass : TempInterface { int TempInterface.TempProperty { get; set; } int TempInterface.TempProperty2 { get; set; } public int TempProperty { get; set; } } public interface TempInterface ...
To retrieve the `PropertyInfo` objects for properties that are explicitly implemented from the interface `TempInterface` in your `TempClass`, you can utilize reflection in .NET. Here's a step-by-step guide on how to do this: 1. Use `Type.GetInterfaceMap()` to get the mapping of interface members to their implementatio...
33,835
[ { "from": "human", "value": "More specifically, if I have:\npublic class TempClass : TempInterface\n{\n\n int TempInterface.TempProperty\n {\n get;\n set;\n }\n int TempInterface.TempProperty2\n {\n get;\n set;\n }\n\n public int TempProperty\n {\n ...
For Asp.net web applications, is it best to: trap errors within sql stored procedures and test for a return value in the code or just let the error occur in sql (dont handle it) and rely on ado.net raising the errors within the code. What are the best practises here?
When it comes to error handling in ASP.NET web applications using SQL stored procedures, both approaches have their advantages and disadvantages. The best practice generally involves a combination of both strategies to ensure robust error handling. Here’s a breakdown of the two approaches and some recommendations: ###...
28,707
[ { "from": "human", "value": "For Asp.net web applications, is it best to:\n\ntrap errors within sql stored procedures and test for a return value in the code or \njust let the error occur in sql (dont handle it) and rely on ado.net raising the errors within the code.\n\nWhat are the best practises here?\n" ...
I have built an application that uses SQL Express 2005 and I want to deploy it, but the problem is that anyone who has SQL Management Studio(or something like that) installed on his computer, can connect to my database and change it. Is there anyway to prevent end-users from seeing or editing the content of my databas...
Securing a SQL Server database is crucial, especially if you're concerned about unauthorized access and modifications by users with SQL Server Management Studio (SSMS) or similar tools. Here are some strategies to help you protect your SQL Server Express 2005 database: 1. **Use Windows Authentication**: If possible, c...
32,433
[ { "from": "human", "value": "I have built an application that uses SQL Express 2005 and I want to deploy it, but the problem is that anyone who has SQL Management Studio(or something like that) installed on his computer, can connect to my database and change it. \nIs there anyway to prevent end-users from s...
I've often used pointers to const objects, like so... const int *p; That simply means that you can't change the integer that p is pointing at through p. But I've also seen reference to const pointers, declared like this... int* const p; As I understand it, that means that the pointer variable itself is constant -- yo...
You're correct in your understanding of the two types of const pointers in C/C++: 1. **Pointer to const**: `const int *p;` means that the integer value being pointed to cannot be modified through the pointer `p`. However, `p` itself can point to different integers. 2. **Const pointer**: `int* const p;` means that the...
32,803
[ { "from": "human", "value": "I've often used pointers to const objects, like so...\nconst int *p;\n\nThat simply means that you can't change the integer that p is pointing at through p. But I've also seen reference to const pointers, declared like this...\nint* const p;\n\nAs I understand it, that means tha...
What you want is for users to just type in their search criteria just like they would in Google. Some words, maybe some quoted phrases, maybe a few operators, and have it just work. A .Net solution is available here: http://ewbi.blogs.com/develops/2007/05/normalizing_sql.html I am looking for a pure T-SQL version with ...
To implement a search functionality in SQL Server that mimics the behavior of natural language search, you can create a T-SQL solution that processes user input and constructs a dynamic SQL query based on specified operators and conditions. This approach will focus on using Full-Text Search capabilities and normal SQL ...
19,200
[ { "from": "human", "value": "What you want is for users to just type in their search criteria just like they would in Google. Some words, maybe some quoted phrases, maybe a few operators, and have it just work.\nA .Net solution is available here:\nhttp://ewbi.blogs.com/develops/2007/05/normalizing_sql.html\...
I'm noticing that, if the ThreadPool max thread count for my IO-intensive app is set too low (16), then my GUI will freeze. But if I set it considerable higher (250), it works just fine. Can anyone explain this phenomenon?
The behavior you're observing with your IO-intensive application and its interaction with the GUI can be explained by understanding how thread pools, I/O operations, and UI responsiveness work together. ### Key Points: 1. **Thread Pool Basics**: - A thread pool is a collection of threads that can be used to perfo...
34,180
[ { "from": "human", "value": "I'm noticing that, if the ThreadPool max thread count for my IO-intensive app is set too low (16), then my GUI will freeze. But if I set it considerable higher (250), it works just fine.\nCan anyone explain this phenomenon?\n" }, { "from": "gpt", "value": "The behavi...
I am messing around with Doctrine (version 1.0.3) to see if would make a good fit for the collection of apps I am writing. I am trying to do a query and return only 3 fields. I am getting the correct fields in one table, but the join table I am getting everything when I only want one field. I have written out the wha...
In Doctrine 1.x, when you perform a query and specify the fields you want to select, it only affects the fields returned in the query result but does not necessarily limit the properties that are loaded into related objects. In your case, you're joining the `Submitter` entity in your query and even though you only se...
35,456
[ { "from": "human", "value": "I am messing around with Doctrine (version 1.0.3) to see if would make a good fit for the collection of apps I am writing.\nI am trying to do a query and return only 3 fields. I am getting the correct fields in one table, but the join table I am getting everything when I only w...
I've tried Red Gate's SQL Prompt and like it, but cannot afford it at the moment. I miss the good code completion that this tool provides. Are there any good free tools out there that have SQL code completion (table and column names, etc)? I've tried TOAD, but it was quite buggy. It would crash, and would also leave...
If you're looking for free tools that provide good SQL code completion features similar to Red Gate's SQL Prompt, here are some options you can consider: 1. **Azure Data Studio**: This is a free, open-source tool provided by Microsoft that is designed for SQL Server and Azure SQL databases. It has great IntelliSense f...
32,669
[ { "from": "human", "value": "I've tried Red Gate's SQL Prompt and like it, but cannot afford it at the moment. I miss the good code completion that this tool provides. Are there any good free tools out there that have SQL code completion (table and column names, etc)?\nI've tried TOAD, but it was quite bu...
Currently, I have a UIView subclass that "stamps" a single 2px by 2px CGLayerRef across the screen, up to 160 x 240 times. I currently animate this by moving the UIView "up" the screen 2 pixels (actually, a UIImageView) and then drawing the next "row". Would using multiple CALayer layers speed up performance of renderi...
Using `CALayer` can indeed enhance performance, especially when dealing with animations and rendering in iOS. `CALayer` is part of the Core Animation framework, which is highly optimized for compositing and animating visual content. When you have a lot of repetitive drawing tasks, using `CALayer` can be much more effic...
31,044
[ { "from": "human", "value": "Currently, I have a UIView subclass that \"stamps\" a single 2px by 2px CGLayerRef across the screen, up to 160 x 240 times.\nI currently animate this by moving the UIView \"up\" the screen 2 pixels (actually, a UIImageView) and then drawing the next \"row\".\nWould using multip...
Is there a way to determine the display length of a given string (in pixels) based on the currently selected font in (C++) wxWidgets? For example if I print out the string "Speed:" and want to put 10 pixels between the ':' and the value about to follow, I need to know how long the "Speed:" string was. Is there a way t...
Yes, in wxWidgets, you can determine the width (in pixels) of a given string when rendered with the currently selected font. The method you're looking for is `GetTextExtent`. This function calculates the size of a string based on the font used in the context you provide. Here's a step-by-step guide on how you can achi...
29,944
[ { "from": "human", "value": "Is there a way to determine the display length of a given string (in pixels) based on the currently selected font in (C++) wxWidgets?\nFor example if I print out the string \"Speed:\" and want to put 10 pixels between the ':' and the value about to follow, I need to know how lon...
How secure are php Sessions? I am planning to use the native PHP sessions to authenticate users. Can users modify session data like they can $_POST and $_GET data?
PHP sessions, when used correctly, can be a secure way to maintain user authentication and manage state in a web application. However, like any system, they come with their own security considerations that you need to keep in mind. ### How PHP Sessions Work 1. **Session Storage**: PHP sessions store session data on t...
32,851
[ { "from": "human", "value": "How secure are php Sessions? I am planning to use the native PHP sessions to authenticate users. Can users modify session data like they can $_POST and $_GET data?\n" }, { "from": "gpt", "value": "PHP sessions, when used correctly, can be a secure way to maintain u...
I have a UIWebView in my iPhone app, which merrily shows web content, but it does not render visited links any differently to unvisited links. Ordinarily I'd expect it to use a different colour for visited links, but alas no. Safari on the other hand deals with its links correctly. I assume that UIWebView is lacking a ...
UIWebView does not maintain its own history or store information about visited links like Safari does. As a result, it doesn't automatically change the color of visited links, as it does not differentiate between visited and unvisited links. If you want to achieve a similar effect, you'll need to implement some custom ...
33,603
[ { "from": "human", "value": "I have a UIWebView in my iPhone app, which merrily shows web content, but it does not render visited links any differently to unvisited links. Ordinarily I'd expect it to use a different colour for visited links, but alas no.\nSafari on the other hand deals with its links correc...
I've editing this original question as I think I've narrowed down the problem... I have one view in my site that will not let me put $document.ready within a masterpage contentplaceholder. I've stripped this page to the bare bones and the only thing that is special about it is it has a custom route in global.asax rout...
It sounds like you're encountering an issue where the jQuery `$document.ready` function is not firing as expected within a content placeholder of a master page in your ASP.NET application, particularly when there's a custom route defined in your `Global.asax`. Here are several things to consider that may help you troub...
30,745
[ { "from": "human", "value": "I've editing this original question as I think I've narrowed down the problem...\nI have one view in my site that will not let me put $document.ready within a masterpage contentplaceholder. I've stripped this page to the bare bones and the only thing that is special about it is ...
I want to create a base object that has only methods. The object would be QUEUABLE_OBJECT_TYPE and it will have an ENQUEUE method(s). The Payload of these messages (properties) would be added by subtyping this object. I get an error that makes it sound like you cannot: PLS-00589: no attributes found in object type "QU...
In Oracle PL/SQL, when you create an object type, it is expected that you will define some attributes (properties) along with methods. If you create an object type with no attributes, you will get the error `PLS-00589: no attributes found in object type`. However, you can achieve the desired functionality by using an ...
33,297
[ { "from": "human", "value": "I want to create a base object that has only methods. The object would be QUEUABLE_OBJECT_TYPE and it will have an ENQUEUE method(s). The Payload of these messages (properties) would be added by subtyping this object.\nI get an error that makes it sound like you cannot:\n\nPLS-0...
I'm using a BindingList<T> in my Windows Forms that contains a list of "IComparable<Contact>" Contact-objects. Now I'd like the user to be able to sort by any column displayed in the grid. There is a way described on MSDN online which shows how to implement a custom collection based on BindingList<T> which allows sorti...
In Windows Forms, the `BindingList<T>` does not support sorting directly. However, you can use a `BindingSource` as an intermediary, which provides more flexibility, including sorting functionality. While `BindingSource` does not have a dedicated "Sort event" that you can hook into directly, it does expose the `Sort` p...
31,693
[ { "from": "human", "value": "I'm using a BindingList<T> in my Windows Forms that contains a list of \"IComparable<Contact>\" Contact-objects. Now I'd like the user to be able to sort by any column displayed in the grid.\nThere is a way described on MSDN online which shows how to implement a custom collectio...
A path in Perforce contains files a.txt and b.txt. I'll refer to the main path as mainline. I've create a branch (called initialbranch) from there which contains just a.txt. I make lots of changes to a.txt, and am very happy with it. However, it's not yet ready for submitting back to mainline. I can easily integrate an...
Hi Dom, Your question makes sense, and it sounds like you're navigating some typical branching and integration challenges in Perforce. Here's a way to streamline your workflow and manage the integration between branches more effectively. ### Current Scenario You have: - `mainline`: Contains files `a.txt` and `b.txt` ...
30,533
[ { "from": "human", "value": "A path in Perforce contains files a.txt and b.txt. I'll refer to the main path as mainline.\nI've create a branch (called initialbranch) from there which contains just a.txt. I make lots of changes to a.txt, and am very happy with it. However, it's not yet ready for submitting b...
I'm curious about people's experiences using AR's to_xml() to build non-entity fields (as in, not an attribute of the model you are serializing, but perhaps, utilizing the attributes in the process) from a controller. to_xml seems to supply a few options for doing this. One is by passing in references to methods on...
It sounds like you're diving into a pretty advanced use case with Active Record's `to_xml` method in Rails, specifically how to incorporate additional, non-entity fields dynamically from the controller without overloading your model with methods or modifying its structure too much. You're correct that there are limitat...
27,632
[ { "from": "human", "value": "I'm curious about people's experiences using AR's to_xml() to build non-entity fields (as in, not an attribute of the model you are serializing, but perhaps, utilizing the attributes in the process) from a controller. \nto_xml seems to supply a few options for doing this. \nOn...
When querying with LDAP against our Active Directory structure to look up user accounts, some records (but not all) are missing certain key fields, specifically memberOf and userAccountControl (which has a bit flag that indicates whether the account is disabled or not). Here's a few refining details: If the query is s...
It sounds like you've run into a classic case of permissions and attribute visibility issues within Active Directory (AD). These types of problems often arise from default security settings when transitioning to new versions of Windows Server or after changes in Group Policy. ### Summary of the Issue: - **Missing Attr...
33,398
[ { "from": "human", "value": "When querying with LDAP against our Active Directory structure to look up user accounts, some records (but not all) are missing certain key fields, specifically memberOf and userAccountControl (which has a bit flag that indicates whether the account is disabled or not).\nHere's ...
I'm in a Microsoft IE environment, but I want to use cygwin for a number of quick scripting tasks. How would I configure it to use my windows proxy information? Ruby gems, ping, etc are all trying to make direct connections. How can I get them to respect the proxy information that IE and firefox use?
To configure Cygwin to use your Windows proxy settings (the same ones used by Internet Explorer or Firefox), you need to set the appropriate environment variables that many command-line tools respect for proxy configurations. Here’s how you can do this: ### Step 1: Find Your Proxy Information First, you need to find y...
20,824
[ { "from": "human", "value": "I'm in a Microsoft IE environment, but I want to use cygwin for a number of quick scripting tasks.\nHow would I configure it to use my windows proxy information? Ruby gems, ping, etc are all trying to make direct connections. How can I get them to respect the proxy information...
I'm pretty new to JSF and the many many related technologies out there. I'm trying to make a website that has a header which includes a logo, navigation links, and a login box, such that this header can easily be included in all of the site's pages unless the user logs in, in which case a different header will appear. ...
Creating a dynamic header in a JSF application that changes based on the user's login state is a common requirement, and you have several options to achieve it. Here's a step-by-step guide that outlines a potential solution without requiring you to create a custom component from scratch. ### Step 1: Define a User Sess...
29,966
[ { "from": "human", "value": "I'm pretty new to JSF and the many many related technologies out there.\nI'm trying to make a website that has a header which includes a logo, navigation links, and a login box, such that this header can easily be included in all of the site's pages unless the user logs in, in w...
I need to grab the folder name of a currently executing batch file. I have been trying to loop over the current directory using the following syntax (which is wrong at present): set mydir = %~p0 for /F "delims=\" %i IN (%mydir%) DO @echo %i Couple of issues in that I cannot seem to pass the 'mydir' variable value in a...
To retrieve the folder name of the currently executing batch file, you can simplify the process using built-in batch file variables without needing to loop over directory names. The variable `%~dp0` provides the drive and path of the script, and you can easily extract the last folder name from that path. Here's a stra...
35,463
[ { "from": "human", "value": "I need to grab the folder name of a currently executing batch file. I have been trying to loop over the current directory using the following syntax (which is wrong at present):\nset mydir = %~p0\nfor /F \"delims=\\\" %i IN (%mydir%) DO @echo %i\n\nCouple of issues in that I can...
Aside for a few user guides found at http://fi.am/en/tag/django/2/ I have not managed to find much about WAPI. I was wondering if anyone has had an experience using WAPI and django to create a web api? I'm a little intimidated by the amount of magic these frameworks seem to do. Are there any other good alternatives to ...
Creating a web API in Python can be done using various frameworks, and you're right that some of them come with a lot of abstractions that can feel overwhelming. Here’s a breakdown of some options, including WAPI and Django, along with some alternatives: ### Using WAPI WAPI is a lightweight library for creating web A...
30,941
[ { "from": "human", "value": "Aside for a few user guides found at http://fi.am/en/tag/django/2/ I have not managed to find much about WAPI.\nI was wondering if anyone has had an experience using WAPI and django to create a web api?\nI'm a little intimidated by the amount of magic these frameworks seem to do...
The java.net.InetAddress.GetByName(String host) method can only return A records so to lookup other record types I need to be able to send DNS queries using the dnsjava library. However that normally relies on being able to parse /etc/resolv.conf or similar to find the DNS server addresses and that doesn't work on Andr...
On Android, accessing DNS settings directly from Java without invoking shell commands can be quite limited. However, you can obtain DNS information through the `ConnectivityManager` class, which provides network-related information. While it might not provide the DNS server addresses directly, it can provide the curren...
32,403
[ { "from": "human", "value": "The java.net.InetAddress.GetByName(String host) method can only return A records so to lookup other record types I need to be able to send DNS queries using the dnsjava library.\nHowever that normally relies on being able to parse /etc/resolv.conf or similar to find the DNS serv...
Our product has the requirement of exporting its native format (essentially an XML file) to Excel for viewing/editing. However, what this entails is having a dependency on Excel (or Office) itself for our product build - something that we do not want. What we have done is export the data from our native format to a cs...
Exporting data for Excel viewing and editing is indeed a common requirement, and your approach of using CSV files is widely adopted due to its simplicity and compatibility. However, there are a few alternatives and enhancements you can consider for improving the user experience and handling the export functionality wit...
33,612
[ { "from": "human", "value": "Our product has the requirement of exporting its native format (essentially an XML file) to Excel for viewing/editing. However, what this entails is having a dependency on Excel (or Office) itself for our product build - something that we do not want. \nWhat we have done is expo...
I was in need of a way to compress images in .net so i looked into using the .net GZipStream class (or DeflateStream). However i found that decompression was not always successful, sometimes the images would decompress fine and other times i would get a GDI+ error that something is corrupted. After investigating the is...
The issue you're encountering arises from the way you are handling the streams, particularly the order of operations when working with `GZipStream` and `MemoryStream`. After you write to the `GZipStream`, you should close it or dispose of it to ensure that all compressed data is flushed to the underlying `MemoryStream`...
33,663
[ { "from": "human", "value": "I was in need of a way to compress images in .net so i looked into using the .net GZipStream class (or DeflateStream). However i found that decompression was not always successful, sometimes the images would decompress fine and other times i would get a GDI+ error that something...
I use Ant to build Delphi applications (called from CruiseControl). I want ant to recursively search through a directory tree looking for files *.dpr and when found call either a second build.xml, or preferable a macro or target, passing each of the found file names as a 'parameter'. I have found that I can use subant...
You can achieve your goal of recursively searching for `.dpr` files and calling a specific Ant target for each of them by using a combination of Ant's `fileset`, `pathconvert`, and `foreach` capabilities. Below is a way to do this in your `build.xml` without needing to create separate build.xml files for each applicati...
27,343
[ { "from": "human", "value": "I use Ant to build Delphi applications (called from CruiseControl). \nI want ant to recursively search through a directory tree looking for files *.dpr and when found call either a second build.xml, or preferable a macro or target, passing each of the found file names as a 'para...
Here's the deal. I have an XML document with a lot of records. Something like this: print("<?xml version="1.0" encoding="utf-8" ?> <Orders> <Order> <Phone>1254</Phone> <City>City1</City> <State>State</State> </Order> <Order> <Phone>98764321</Phone> <Cit...
To extract data from an XML document, validate it against an XSD schema, and insert valid records into a database using .NET 3.5, you can follow these steps: 1. **Set up the XML and XSD files**: Ensure you have your XML data and the corresponding XSD schema. 2. **Use XmlReader for Validation**: Create an instance of ...
31,242
[ { "from": "human", "value": "Here's the deal. I have an XML document with a lot of records. Something like this:\nprint(\"<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n <Orders>\n <Order>\n <Phone>1254</Phone>\n <City>City1</City>\n <State>State</State>\n </Order>\n ...
Is there a way to colorize parts of logs in the eclipse console. I know I could send to error and standard streams and color them differently but I'm more looking someting in the lines of ANSI escape codes (or anyother, HTML ?) where I could embed the colors in the string to have it colored in the logs. It sure would ...
The Eclipse console does not natively support ANSI escape codes for coloring text output. The console's capabilities are limited to standard text output without formatting options like color or styles that you might find in a terminal that supports ANSI codes. However, there are a few options you might consider for ac...
32,260
[ { "from": "human", "value": "Is there a way to colorize parts of logs in the eclipse console. I know I could send to error and standard streams and color them differently but I'm more looking someting in the lines of ANSI escape codes (or anyother, HTML ?) where I could embed the colors in the string to ha...
We have a Java program run as root on Unix, that therefore can read for example the content of the folders /home/user1 and /home/user2. However, if the Unix user "user1" is logged in in our application, he should not be able to access "/home/user2" data. We would like to use directly the Unix rights and not recreate a...
In your scenario, the goal is to ensure that a Java program running as the root user only allows access to file system data that the current user is permitted to access, according to Unix file permissions. Below, I outline several approaches that could be employed to achieve this, while also discussing their feasibilit...
32,280
[ { "from": "human", "value": "We have a Java program run as root on Unix, that therefore can read for example the content of the folders /home/user1 and /home/user2. However, if the Unix user \"user1\" is logged in in our application, he should not be able to access \"/home/user2\" data. \nWe would like to u...
Just as an example, if I have a Book model and a BooksController, autotest, part of the ZenTest suite will pick up the association between the two and load test/unit/book_test.rb and test/functional/books_controller_test.rb into the test suite. On the other hand, if I have a Story model and a StoriesController, autotes...
It sounds like you're experiencing an issue with how `autotest` is recognizing the test files for your Rails application, particularly regarding the naming conventions. In Rails, `autotest` uses a set of conventions to determine which test files are associated with which models or controllers. ### Explanation of the I...
30,873
[ { "from": "human", "value": "Just as an example, if I have a Book model and a BooksController, autotest, part of the ZenTest suite will pick up the association between the two and load test/unit/book_test.rb and test/functional/books_controller_test.rb into the test suite. On the other hand, if I have a Sto...
Am working with django Publisher example, I want to list all the publishers in the db via my list_publisher.html template, my template looks like; {% extends "admin/base_site.html" %} {% block title %}List of books by publisher{% endblock %} {% block content %} <div id="content-main"> <h1>List of publisher:</h1> {%re...
It looks like there are a couple of issues in your template and potentially in your view logic. Let's address these issues step by step. ### 1. Ensure You Have Passed the Correct Context Make sure that your view is passing the `publisher` queryset to the template context. For example, if you have a `Publisher` model,...
31,534
[ { "from": "human", "value": "Am working with django Publisher example, I want to list all the publishers in the db via my list_publisher.html template, my template looks like;\n{% extends \"admin/base_site.html\" %}\n{% block title %}List of books by publisher{% endblock %}\n{% block content %}\n\n<div id=\...
I have this Array i wrote a function MostFreq that takes an array of integers and return 2 values : the more frequent number in the array and its frequency check this code i worte what do you think ? is there a better way to do it? static void Main() { int [] M={4,5,6,4,4,3,5,3}; int x; int f=MyMath.MostFr...
Your implementation of the `MostFreq` function has some good ideas, but there are more efficient ways to achieve the same goal. Here are some considerations and a proposed improvement: ### Issues with the Current Approach: 1. **Sorting Overhead**: Sorting the array (which is O(n log n)) is not necessary for counting f...
33,566
[ { "from": "human", "value": "I have this Array i wrote a function MostFreq that takes an array of integers and return 2 values : the more frequent number in the array and its frequency check this code i worte what do you think ? is there a better way to do it?\nstatic void Main()\n{ \n int [] M={4,5,6,4,...
I try to use HttpForbiddenHandler to block the file without success. The web.config is as follows: <httpHandlers> <add verb="*" path="*.ashx" type="Castle.MonoRail.Framework.MonoRailHttpHandlerFactory, Castle.MonoRail.Framework"/> <add verb="*" path="*.vm" type="System.Web.HttpForbiddenHandler"/> </httpHandlers> I hav...
It seems you are facing multiple issues while trying to block `.vm` file requests using `HttpForbiddenHandler` in IIS 5.1. Let’s try to troubleshoot the problem step-by-step. ### Step 1: Ensure the Configuration is Correct Your `web.config` seems to be mostly set up correctly, but let's clarify a few points: 1. Make...
33,102
[ { "from": "human", "value": "I try to use HttpForbiddenHandler to block the file without success. The web.config is as follows:\n<httpHandlers>\n<add verb=\"*\" path=\"*.ashx\" type=\"Castle.MonoRail.Framework.MonoRailHttpHandlerFactory, Castle.MonoRail.Framework\"/>\n<add verb=\"*\" path=\"*.vm\" type=\"Sy...
I have two methods that I need to call in my WCF application from the client. Authenticate(username, password) GetUser(username) Is it possible to combine these calls to avoid so many calls being sent back/forth?
Yes, it's possible to combine the `Authenticate` and `GetUser` calls into a single operation in your WCF service. This approach can reduce the number of calls made between the client and server, which can improve performance and reduce latency, especially in scenarios where network communication is a bottleneck. Here ...
30,590
[ { "from": "human", "value": "I have two methods that I need to call in my WCF application from the client.\nAuthenticate(username, password)\nGetUser(username)\nIs it possible to combine these calls to avoid so many calls being sent back/forth?\n" }, { "from": "gpt", "value": "Yes, it's possible...
I try to instantiate an instance of SPSite on the farm server in a custom process (MyApp.exe) and I give it as parameter the whole URI (http://mysite:80/). I also made sure that the account running MyApp.exe is Site Collection Administrator. However, I can't make an instance of SPSite whatever I am trying to do. It alw...
The `FileNotFoundException` when instantiating an `SPSite` object in a custom application can be tricky to diagnose, especially when the URI you are passing is correct and accessible through the browser. Here are a few things to consider and troubleshoot: 1. **Ensure Proper Permissions**: Even though the account runni...
30,957
[ { "from": "human", "value": "I try to instantiate an instance of SPSite on the farm server in a custom process (MyApp.exe) and I give it as parameter the whole URI (http://mysite:80/). I also made sure that the account running MyApp.exe is Site Collection Administrator.\nHowever, I can't make an instance of...
I am using the OpenArgs parameter to send a value when using DoCmd.OpenForm: DoCmd.OpenForm "frmSetOther", acNormal, , , acFormAdd, acDialog, "value" I then use Me.OpenArgs inside the opened form to grab the value. It sometimes sends a Null value instead of the original string. What is wrong?
When you use the `OpenArgs` parameter in `DoCmd.OpenForm`, it should correctly pass the string value to the opened form. However, if you're experiencing cases where `Me.OpenArgs` returns a `Null` value instead of the expected string, there are a few potential issues to consider: 1. **Form Context**: Ensure that the `D...
32,547
[ { "from": "human", "value": "I am using the OpenArgs parameter to send a value when using DoCmd.OpenForm:\nDoCmd.OpenForm \"frmSetOther\", acNormal, , , acFormAdd, acDialog, \"value\"\n\nI then use Me.OpenArgs inside the opened form to grab the value. It sometimes sends a Null value instead of the original...
I would like to create a batch script, to go through 20,000 links in a DB, and weed out all the 404s and such. How would I get the HTTP status code for a remote url? Preferably not using curl, since I dont have it installed.
If you need to check HTTP status codes for a list of URLs and do not have `curl` installed, you can use built-in utilities available in Windows or Python. Below, I'll provide examples for both batch scripts using Windows utilities (like PowerShell) and using Python. ### Method 1: Using PowerShell If you have PowerShe...
31,331
[ { "from": "human", "value": "I would like to create a batch script, to go through 20,000 links in a DB, and weed out all the 404s and such. How would I get the HTTP status code for a remote url?\nPreferably not using curl, since I dont have it installed. \n" }, { "from": "gpt", "value": "If you ...
Every morning we have a process that issues numerous queries (~10000) to DB2 on an AS400/iSeries/i6 (whatever IBM calls it nowadays), in the last 2 months, the operators have been complaining that our query locks a couple of files preventing them from completing their nightly processing. The queries are very simplisiti...
Lock escalation in DB2 on an AS400/iSeries (also referred to as IBM i) can occur when a query acquires a large number of row-level locks and the system decides to escalate those to table-level locks to conserve memory. This can lead to issues where other transactions or operations trying to access the same resources ar...
30,342
[ { "from": "human", "value": "Every morning we have a process that issues numerous queries (~10000) to DB2 on an AS400/iSeries/i6 (whatever IBM calls it nowadays), in the last 2 months, the operators have been complaining that our query locks a couple of files preventing them from completing their nightly pr...
Facebook Connect seems like the cool new way to leverage a user's Facebook account on your own site (get their friends list, write to their profile, etc). What I don't understand is what the new Facebook Connect platform offers over a traditional Facebook App with the Offline Access permission granted. Can anyone help...
Facebook Connect is indeed a powerful tool for integrating Facebook’s social features into third-party applications and websites. To clarify the differences between using Facebook Connect and a traditional Facebook App with Offline Access permissions, let’s break down the key features and use cases of each: ### Facebo...
31,897
[ { "from": "human", "value": "Facebook Connect seems like the cool new way to leverage a user's Facebook account on your own site (get their friends list, write to their profile, etc). What I don't understand is what the new Facebook Connect platform offers over a traditional Facebook App with the Offline A...
There are a few books about specific ORM products such as Hibernate or Linq to SQL, but I would be quite interested in any material on the more general principles, history etc of ORM. Do you know of any books, white papers, well researched blog posts etc on this topic? Thanks /Erik
Certainly! There are several resources that delve into the general principles, history, and concepts behind Object-Relational Mapping (ORM). Here are some recommendations: ### Books: 1. **"Object-Relational Mapping Explained: Solutions for Practitioners and Programmers" by David A. M. Hurst** - This book provides a co...
33,091
[ { "from": "human", "value": "There are a few books about specific ORM products such as Hibernate or Linq to SQL, but I would be quite interested in any material on the more general principles, history etc of ORM.\nDo you know of any books, white papers, well researched blog posts etc on this topic?\nThanks ...
In adobe Flex datagrid height is equally to fix height . I want to make datagrid height is depend data .
In Adobe Flex, if you want a `DataGrid` to adjust its height based on the number of rows it contains, you can accomplish this by setting its height dynamically based on the number of items in the data provider. One common way to do this is by adding an event listener that updates the height whenever the data changes. ...
32,627
[ { "from": "human", "value": "In adobe Flex datagrid height is equally to fix height . I want to make datagrid height is depend data . \n" }, { "from": "gpt", "value": "In Adobe Flex, if you want a `DataGrid` to adjust its height based on the number of rows it contains, you can accomplish this by...
Oracle has this concept of allowing database users to be identified by the operating system user who is running the program that is connecting to Oracle. See here. This allows you to do, as that user on a unix machine for example, a command such as: sqlplus / I am attempting to write a Java program for Oracle 10.2 whi...
To connect to an Oracle database using operating system (OS) authentication in Java, you need to use a specific URL format along with the appropriate JDBC driver and potentially specific configurations that allow you to connect without providing a username or password. In Oracle JDBC, the typical connection string for...
30,518
[ { "from": "human", "value": "Oracle has this concept of allowing database users to be identified by the operating system user who is running the program that is connecting to Oracle. See here.\nThis allows you to do, as that user on a unix machine for example, a command such as:\nsqlplus /\n\nI am attemptin...
Is there a good way to add a .swf programatically to a panel on an asp.net page - ie: I know i could just insert the html tags: ie: <object type="application/x-shockwave-flash" data="yourflash.swf" width="" height=""> <param name="movie" value="yourflash.swf"> </object> But is there an existing .net or free FLASH com...
In ASP.NET, while there is no built-in component specifically designed for embedding Flash (.swf) files, you can easily create a reusable user control or a simple custom control that encapsulates the HTML structure you provided. However, since you are looking for a way to do it programmatically without creating a full ...
31,263
[ { "from": "human", "value": "Is there a good way to add a .swf programatically to a panel on an asp.net page - ie: I know i could just insert the html tags:\nie: \n<object type=\"application/x-shockwave-flash\" data=\"yourflash.swf\" width=\"\" height=\"\">\n<param name=\"movie\" value=\"yourflash.swf\">\n<...
Eric Meyer's advice to keep individual rules alphabetized in a CSS style definition makes sense - there's no "natural" way to order rules, and this makes it easy in a complex definition to make sure you don't define the same thing twice. div.Foo { background:Green; border:1px solid Khaki; display:none; ...
If you're looking for a way to alphabetize CSS rules without losing the formatting you prefer, there are several options and tools you can consider: ### Visual Studio Extensions 1. **Prettier**: This popular code formatter can be configured to format CSS, and while it doesn’t specifically alphabetize properties, it h...
33,861
[ { "from": "human", "value": "Eric Meyer's advice to keep individual rules alphabetized in a CSS style definition makes sense - there's no \"natural\" way to order rules, and this makes it easy in a complex definition to make sure you don't define the same thing twice.\ndiv.Foo\n{\n background:Green;\n ...
Is there a simple way to parse a date that may be in MM/DD/yyyy, or M/D/yyyy, or some combination? i.e. the zero is optional before a single digit day or month. To do it manually, one could use: String[] dateFields = dateString.split("/"); int month = Integer.parseInt(dateFields[0]); int day = Integer.parseInt(dateFiel...
Yes, you can use `SimpleDateFormat` from the `java.text` package to parse dates in the format you're describing. The `SimpleDateFormat` class can handle optional leading zeros by allowing the pattern to have single-digit options. For your specific case of parsing dates in the formats MM/DD/yyyy or M/D/yyyy, you can use...
24,110
[ { "from": "human", "value": "Is there a simple way to parse a date that may be in MM/DD/yyyy, or M/D/yyyy, or some combination? i.e. the zero is optional before a single digit day or month.\nTo do it manually, one could use:\nString[] dateFields = dateString.split(\"/\");\nint month = Integer.parseInt(dateF...
If I have a function that returns an object, but this return value is never used by the caller, will the compiler optimize away the copy? (Possibly an always/sometimes/never answer.) Elementary example: ReturnValue MyClass::FunctionThatAltersMembersAndNeverFails() { //Do stuff to members of MyClass that never fails...
When it comes to optimization, compilers are generally quite adept at eliminating unnecessary code, including unnecessary copies. However, the specifics can depend on several factors, including the type being returned and the particular optimizations performed by the compiler. ### General Case: 1. **ReturnValue as an...
35,421
[ { "from": "human", "value": "If I have a function that returns an object, but this return value is never used by the caller, will the compiler optimize away the copy? (Possibly an always/sometimes/never answer.)\nElementary example:\nReturnValue MyClass::FunctionThatAltersMembersAndNeverFails()\n{\n //Do...
What order of precedence are events handled in JavaScript? Here are the events in alphabetical order... onabort - Loading of an image is interrupted onblur - An element loses focus onchange - The user changes the content of a field onclick - Mouse clicks an object ondblclick - Mouse double-clicks an object onerror - A...
In JavaScript, particularly in the context of event handling in the browser, events are processed according to a specific order that is influenced by a combination of the event type and the phase of the event propagation. The flow of events is generally categorized into three phases: the capturing phase, the target pha...
33,980
[ { "from": "human", "value": "What order of precedence are events handled in JavaScript?\nHere are the events in alphabetical order...\n\nonabort - Loading of an image is\ninterrupted\nonblur - An element loses focus\nonchange - The user changes the\ncontent of a field\nonclick - Mouse clicks an object\nondb...
I'm trying to compile a project and I'm getting this error. The error occurs in a RemObjects source file, but I think it doesn't have anything to do with RemObjects. Anyway this error is too generic, and I don't quite get why it happens, so how can I solve it?
When facing a generic error during the compilation of a project, especially in a third-party library like RemObjects, there are several steps you can take to troubleshoot and resolve the issue. Here are some suggestions: ### 1. **Check the Error Message:** - Review the exact error message that you are receiving. Of...
34,735
[ { "from": "human", "value": "I'm trying to compile a project and I'm getting this error.\nThe error occurs in a RemObjects source file, but I think it doesn't have anything to do with RemObjects.\nAnyway this error is too generic, and I don't quite get why it happens, so how can I solve it?\n" }, { ...
I have a C# class the returns a List, using System.Collections.Generic Lists not F# List I want to iterate though the list to find a object or not find it. Here is how I would do it in C#. How would I accomplish the similar thing in F# foreach (AperioCaseObj caseObj in CaseList) { if (caseObj.CaseId == "") ...
In F#, you can use a combination of the `List.iter` function or a `for` loop to iterate through a list. Assuming you have a list of `AperioCaseObj` objects and you're interested in checking the `CaseId` property, here's how you can perform the equivalent operation in F#. ### Using `List.iter` If you want to process e...
33,541
[ { "from": "human", "value": "I have a C# class the returns a List, using System.Collections.Generic Lists not F# List\nI want to iterate though the list to find a object or not find it. Here is how I would do it in C#. How would I accomplish the similar thing in F#\nforeach (AperioCaseObj caseObj in CaseL...
What are the main differences between a Linked List and a BinarySearchTree? Is BST just a way of maintaining a LinkedList? My instructor talked about LinkedList and then BST but did't compare them or didn't say when to prefer one over another. This is probably a dumb question but I'm really confused. I would appreciate...
It's not a dumb question at all! Understanding data structures like Linked Lists and Binary Search Trees (BSTs) is crucial for computer science, and comparing them can help clarify their unique characteristics and use cases. Here’s a simple breakdown of the differences between a Linked List and a Binary Search Tree: #...
29,389
[ { "from": "human", "value": "What are the main differences between a Linked List and a BinarySearchTree? Is BST just a way of maintaining a LinkedList? My instructor talked about LinkedList and then BST but did't compare them or didn't say when to prefer one over another. This is probably a dumb question bu...
I am trying to connect to a webservice over ssl with a client certificate. Is there an elegant way of doing this apart from shoving things like "javax.net.ssl.keyStore" into System.properties. Any pointers to code examples would be appreciated.
Yes, there are more elegant ways to configure SSL connections with client certificates in Java without having to set system properties like `javax.net.ssl.keyStore`. You can use the `SSLContext` class along with `KeyManagerFactory` and `TrustManagerFactory` to programmatically set up the SSL connection. Here's a step-...
26,524
[ { "from": "human", "value": "I am trying to connect to a webservice over ssl with a client certificate. Is there an elegant way of doing this apart from shoving things like \"javax.net.ssl.keyStore\" into System.properties.\nAny pointers to code examples would be appreciated.\n" }, { "from": "gpt", ...
As title. I didn't find one via google, at any rate. Update: thanks for the links from the two answers; this is very useful, but not what I was after - I am curious to see whether it is possible to query an IRepository backed by memcached (or some other distributed cache), backed by a RDBMS. I've really no idea how t...
It sounds like you're envisioning a layered architecture that combines a distributed cache (like Memcached) with a relational database management system (RDBMS), utilizing the IRepository pattern alongside LINQ. This is a common pattern to enhance application performance by caching frequently accessed data, reducing th...
29,422
[ { "from": "human", "value": "As title. I didn't find one via google, at any rate.\nUpdate: thanks for the links from the two answers; this is very useful, but not what I was after - I am curious to see whether it is possible to query an IRepository backed by memcached (or some other distributed cache), bac...
In Visual Source Safe 6.0, you could "reset" a working folder by setting it to a blank string. This meant that the working folder would be determined by the working folder of the parent. How do I do this in Visual Source Safe 2005?
In Visual SourceSafe 2005, you can reset a working folder by setting it to a blank value, just like in version 6.0. However, the interface and steps to do this may be slightly different. Here are the steps to reset a working folder in Visual SourceSafe 2005: 1. **Open Visual SourceSafe Explorer**: Start the Visual So...
22,012
[ { "from": "human", "value": "In Visual Source Safe 6.0, you could \"reset\" a working folder by setting it to a blank string. This meant that the working folder would be determined by the working folder of the parent.\nHow do I do this in Visual Source Safe 2005?\n" }, { "from": "gpt", "value":...
We're trying to come up with a recommended design pattern for our team when it comes to record locking. The typical school of thought goes something like this: 1. User picks a record from a list 2. Lock the record with the user id 3. Load the locked record record (no lock, then someone beat ya to it). Am I missing som...
Your proposed design pattern for record locking is quite common, especially when dealing with scenarios where multiple users might attempt to edit the same record simultaneously. However, there are a few nuances and additional considerations you might want to incorporate to ensure a robust and user-friendly approach. H...
34,048
[ { "from": "human", "value": "We're trying to come up with a recommended design pattern for our team when it comes to record locking. The typical school of thought goes something like this:\n1. User picks a record from a list\n2. Lock the record with the user id\n3. Load the locked record record (no lock, t...
For some weeks now I simply can't run gem install in windows. It sticks on this line: C:\Windows\System32>gem install rails --version 2.1.2 Bulk updating Gem source index for: http://gems.rubyforge.org/ Any ideas what it could be?
If your `gem install` command is hanging on the line about bulk updating the Gem source index, there are a few possible reasons and solutions you can try to resolve the issue: ### 1. Use HTTPS instead of HTTP RubyGems is moving towards secure connections. You can change your gem source to use HTTPS. Run the following ...
34,268
[ { "from": "human", "value": "For some weeks now I simply can't run gem install in windows.\nIt sticks on this line:\nC:\\Windows\\System32>gem install rails --version 2.1.2\nBulk updating Gem source index for: http://gems.rubyforge.org/\n\nAny ideas what it could be?\n" }, { "from": "gpt", "valu...
I basically have a page which shows a "processing" screen which has been flushed to the browser. Later on I need to redirect this page, currently we use meta refresh and this normally works fine. With a new payment system, which includes 3D secure, we potentially end up within an iframe being directed back to our si...
To handle the redirection from an iframe and ensure that your page busts out of it, you can use a combination of JavaScript to check if the page is within an iframe, and then redirect accordingly. Below is a sample code snippet that should help you achieve this. ### JavaScript Solution You can add the following JavaS...
33,881
[ { "from": "human", "value": "I basically have a page which shows a \"processing\" screen which has been flushed to the browser. Later on I need to redirect this page, currently we use meta refresh and this normally works fine. \nWith a new payment system, which includes 3D secure, we potentially end up wi...
I was a C++ developer (mostly ATL/COM stuff) until, as many of us, I switched to C# in 2001. I didn't do much C++ programming since then. Do you have any tips on how to revive my C++ skills? What has changed in C++ in the last years? Are there good books, articles or blogs covering the language. The problem is that mos...
Reviving your C++ skills after a long break can be both exciting and challenging, especially considering the advancements in the language over the years. Here's a guide to help you get started: ### Key Changes in C++ (C++11 and Beyond) 1. **C++11**: This version introduced a host of features including: - **Auto ke...
20,005
[ { "from": "human", "value": "I was a C++ developer (mostly ATL/COM stuff) until, as many of us, I switched to C# in 2001. I didn't do much C++ programming since then.\nDo you have any tips on how to revive my C++ skills? What has changed in C++ in the last years? Are there good books, articles or blogs cove...
How do you programmatically obtain a picture of a .Net control?
To programmatically obtain a picture (bitmap) of a .NET control, you can use the `Graphics` class to draw the control onto a bitmap. The general approach is to create a new `Bitmap`, create a `Graphics` object from that bitmap, and then use the `DrawToBitmap` method (available on some controls) or custom drawing logic ...
30,523
[ { "from": "human", "value": "How do you programmatically obtain a picture of a .Net control?\n" }, { "from": "gpt", "value": "To programmatically obtain a picture (bitmap) of a .NET control, you can use the `Graphics` class to draw the control onto a bitmap. The general approach is to create a n...
I'm specifically interested in tools that can be plugged into Vim to allow CScope-style source browsing (1-2 keystroke commands to locate function definitions, callers, global symbols and so on) for languages besides C/C++ such as Java and C# (since Vim and Cscope already integrate very well for browsing C/C++). I'm no...
For enhancing Vim's capabilities for source code browsing in languages like Java and C#, you can consider the following tools and plugins that provide CScope-style functionality: ### For Java 1. **Eclim**: - **Description**: Eclim is a bridge between Eclipse and Vim. It allows you to use Eclipse's powerful feature...
15,388
[ { "from": "human", "value": "I'm specifically interested in tools that can be plugged into Vim to allow CScope-style source browsing (1-2 keystroke commands to locate function definitions, callers, global symbols and so on) for languages besides C/C++ such as Java and C# (since Vim and Cscope already integr...
I'm working on a Facebook FBML controls library and would like to create my FBML controls somewhat patterned like the ASP.NET WebControls library. I have a base class that handles rendering by default; here's my render method: protected override void Render(HtmlTextWriter writer) { AddAttr...
In order to achieve your desired rendering behavior where an HTML element can be either a self-closing tag or a standard opening and closing tag based on a condition, you need to manage how you call the methods of `HtmlTextWriter`. When using `HtmlTextWriter`, rendering self-closing tags does require a slightly differ...
34,919
[ { "from": "human", "value": "I'm working on a Facebook FBML controls library and would like to create my FBML controls somewhat patterned like the ASP.NET WebControls library. I have a base class that handles rendering by default; here's my render method:\n\n protected override void Render(HtmlTextW...
Can any one tell me how to convert an legacy application which is vb6 ( COM dll's ocx and exes) to use Regfree COM . I tried opening the dlls in visual studio and created manifest file, but some of the dlls it is giving error. Is there any tools out there which will help me to do this process? I tried a tool from code...
Converting a legacy VB6 application that uses COM components to Reg-Free COM (Registration-Free COM) can indeed be challenging, especially with complex components. Here are steps and resources that might help you in this process: ### Steps to Convert to Reg-Free COM 1. **Understand Reg-Free COM**: Familiarize yoursel...
30,162
[ { "from": "human", "value": "Can any one tell me how to convert an legacy application which is vb6 ( COM dll's ocx and exes) to use Regfree COM .\nI tried opening the dlls in visual studio and created manifest file, but some of the dlls it is giving error.\nIs there any tools out there which will help me t...
Does anyone know why CMapStringToOb::Lookup doesn't work in Japanese? The code loads a string from the string table, and puts it into a CMapStringToOb object. Later it loads the same string from the string table (so it is guaranteed to be exactly the same) and calls CMapStringToOb::Lookup to find it. It works in all ...
The issue you’re encountering with `CMapStringToOb::Lookup` not working for Japanese strings could be related to several factors inherent to how strings are compared in C++ and how Unicode (specifically UTF-16) is handled in different locales. Here are some steps and considerations to help troubleshoot and potentially ...
35,309
[ { "from": "human", "value": "Does anyone know why CMapStringToOb::Lookup doesn't work in Japanese? The code loads a string from the string table, and puts it into a CMapStringToOb object. Later it loads the same string from the string table (so it is guaranteed to be exactly the same) and calls CMapStringT...
I'm looking for an OpenSource server monitoring tool that allows the following: Monitor a variety of services on TCP, UDP. Supports custom port numbers. Supports some basic response checking (beyond initial connection checking). Basic dashboard overview of health status. Alert notifications via e-mail. I could roll m...
There are several open-source server monitoring tools that meet your requirements and can run on Windows. Here are some notable options: 1. **Nagios Core** - **Description**: A powerful monitoring system that enables organizations to identify and resolve IT infrastructure problems before they affect critical busine...
27,674
[ { "from": "human", "value": "I'm looking for an OpenSource server monitoring tool that allows the following:\n\nMonitor a variety of services on TCP, UDP.\nSupports custom port numbers.\nSupports some basic response checking (beyond initial connection checking).\nBasic dashboard overview of health status.\n...
Is there a common or established algorithm for peer-nodes in a network to decide on a unique "network-channel" (or any other form of semi-secret identifier)? The environment I'm working in is SecondLife. I am trying to figure out how to get many identical peer scripted objects to agree on a "channel" number which allo...
What you're dealing with is a common problem in distributed systems, often referred to as the "unique identifier" or "channel selection" problem in environments where multiple nodes (or peer objects, in your case) are instantiated simultaneously. The challenge is to reach consensus on a unique identifier without collis...
31,075
[ { "from": "human", "value": "Is there a common or established algorithm for peer-nodes in a network to decide on a unique \"network-channel\" (or any other form of semi-secret identifier)?\nThe environment I'm working in is SecondLife. I am trying to figure out how to get many identical peer scripted objec...
There is a method to create a namespace extension rooted in a particular folder. It involves creating folder with a name like: My Custom NSE.{785EE551-DEE1-4F57-A8C9-0EF76F346A29} And Windows Explorer will automatically host the NSE of that clsid at that location. But for the life of me i cannot find the syntax anymor...
To create a namespace extension in Windows Explorer rooted in a particular folder, you can indeed use a special folder naming convention based on a Class Identifier (CLSID). Here’s how you can do it: ### Steps to Create a Namespace Extension 1. **Create the CLSID**: First, you need a valid CLSID (Class ID) for your n...
33,546
[ { "from": "human", "value": "There is a method to create a namespace extension rooted in a particular folder.\nIt involves creating folder with a name like:\nMy Custom NSE.{785EE551-DEE1-4F57-A8C9-0EF76F346A29}\n\nAnd Windows Explorer will automatically host the NSE of that clsid at that location.\nBut for ...
Simply put, MVC is the pattern for separating contents (model) from presentation (view), and having a mechanism in place (controller) defining how to gather both. If you already see where I am going at, I am very interested to hear your opinion on the matter. Of course, MVC applies to serverside mechanics and all, but ...
Your exploration of applying the MVC (Model-View-Controller) paradigm to the front-end context is an interesting one and definitely worth discussing. Let’s break it down a bit further based on your interpretation: 1. **Model (HTML)**: - You’re correct in identifying HTML as the "Model" in this context. HTML repres...
32,281
[ { "from": "human", "value": "Simply put, MVC is the pattern for separating contents (model) from presentation (view), and having a mechanism in place (controller) defining how to gather both.\nIf you already see where I am going at, I am very interested to hear your opinion on the matter. Of course, MVC app...
I'd like to write some unit tests for some code that connects to a database, runs one or more queries, and then processes the results. (Without actually using a database) Another developer here wrote our own DataSource, Connection, Statement, PreparedStatement, and ResultSet implementation that will return the correspo...
You're not necessarily reinventing the wheel, as many developers have created custom DataSource, Connection, and ResultSet implementations for testing purposes. However, there are established practices and libraries that may provide a more robust and efficient approach to testing JDBC code without needing to rely on a ...
31,136
[ { "from": "human", "value": "I'd like to write some unit tests for some code that connects to a database, runs one or more queries, and then processes the results.\n(Without actually using a database)\nAnother developer here wrote our own DataSource, Connection, Statement, PreparedStatement, and ResultSet i...
I have a form that excepts a file upload in ASP.NET. I need to increase the max upload size to above the 4 MB default. I have found in certain places referencing the below code at msdn. [ConfigurationPropertyAttribute("maxRequestLength", DefaultValue = )] None of the references actually describe how to use it, and I ...
To increase the maximum file upload size in an ASP.NET application, you typically modify the `web.config` file of your project. The `maxRequestLength` setting is the key to this configuration. ### Setting `maxRequestLength` in `web.config` The `maxRequestLength` attribute is specified in kilobytes (KB), and it is loc...
34,136
[ { "from": "human", "value": "I have a form that excepts a file upload in ASP.NET. I need to increase the max upload size to above the 4 MB default.\nI have found in certain places referencing the below code at msdn. \n[ConfigurationPropertyAttribute(\"maxRequestLength\", DefaultValue = )]\n\nNone of the ref...