instruction
stringlengths
14
27.6k
completion
stringlengths
3
38.3k
__original_row_idx
int64
0
50k
conversations
listlengths
2
2
I have created a nice silverlight control doing exactly what I want it to do, and it looks great :) When I host it in the test projects ASPX sample file or the HTML sample file it shows up nicely. I now have to use the control in my existing ASP.NET 2.0 project, which has a fancy design. The problem I'm having is that ...
It sounds like you're encountering a common issue when integrating Silverlight controls into a complex HTML/CSS layout. Here are some troubleshooting steps and tips to help ensure that your Silverlight control displays correctly: ### 1. **Z-Index and Positioning** - Ensure that the `div` containing the Silverlight ...
13,042
[ { "from": "human", "value": "I have created a nice silverlight control doing exactly what I want it to do, and it looks great :) When I host it in the test projects ASPX sample file or the HTML sample file it shows up nicely.\nI now have to use the control in my existing ASP.NET 2.0 project, which has a fan...
Forgive me if this verges on being a "discussion" question, but I really would appreciate a yes/no answer, with an appropriate explanation. Suppose you have to design and implement a control API for a robot, say the next generation Mars Rover. Do you architect this API according to RESTful principles, or do you u...
**No**, a RESTful architecture may not be the best fit for a control API for a robot like the Mars Rover, especially when considering the specific use case of closely controlling a system with low-level commands. **Explanation**: RESTful principles are indeed designed around managing resources over a network, utilizin...
18,350
[ { "from": "human", "value": "Forgive me if this verges on being a \"discussion\" question, but I really would \nappreciate a yes/no answer, with an appropriate explanation. \nSuppose you have to design and implement a control API for a robot, say the next \ngeneration Mars Rover. Do you architect this API...
I'm planning to write a simple J2SE application to aggregate information from multiple web sources. The most difficult part, I think, is extraction of meaningful information from web pages, if it isn't available as RSS or Atom feeds. For example, I might want to extract a list of questions from stackoverflow, but I abs...
For extracting meaningful information from web pages in your J2SE application, you can use several libraries and techniques that focus on HTML parsing. Given your requirements for simplicity and the ability to handle around 5MB of HTML, here are some recommendations: ### Libraries: 1. **Jsoup**: - **Description**:...
17,931
[ { "from": "human", "value": "I'm planning to write a simple J2SE application to aggregate information from multiple web sources.\nThe most difficult part, I think, is extraction of meaningful information from web pages, if it isn't available as RSS or Atom feeds. For example, I might want to extract a list ...
I'm working with a fairly large solution right now in Visual Studio 2005 and whenever I try to use the ">of" command in the toolbar search box it causes my solution explorer go haywire. Specifically, all of the folders start showing that there aren't any files in them anymore and I have to hit the "Refresh" button in ...
It's not uncommon to experience issues with older versions of Visual Studio like 2005, especially when dealing with large solutions. The problem you're facing with the `">of"` command affecting the Solution Explorer is a known issue, and while it may not be ideal, there are some alternatives you can try to navigate to ...
18,743
[ { "from": "human", "value": "I'm working with a fairly large solution right now in Visual Studio 2005 and whenever I try to use the \">of\" command in the toolbar search box it causes my solution explorer go haywire. Specifically, all of the folders start showing that there aren't any files in them anymore...
Several extensions offer a "bottom window" for viewing their content. Firebug and ScribeFire are good examples where the main content appears at the bottom of the browser. This appears to be very similar to the sidebar functionality in the browser. Is there a best practice/method to create a bottom window in an exten...
Creating a bottom window or panel for a browser extension can be a bit challenging since most browsers do not have a built-in "bottom sidebar" functionality like they do for sidebars. However, you can achieve similar behavior through the use of pop-up panels or utilizing the existing web technologies (HTML/CSS/JavaScri...
15,486
[ { "from": "human", "value": "Several extensions offer a \"bottom window\" for viewing their content. Firebug and ScribeFire are good examples where the main content appears at the bottom of the browser. This appears to be very similar to the sidebar functionality in the browser.\nIs there a best practice/...
I have a custom class loader so that a desktop application can dynamically start loading classes from an AppServer I need to talk to. We did this since the amount of jars that are required to do this are ridiculous (if we wanted to ship them). We also have version problems if we don't load the classes dynamically at ru...
In Java, classes are loaded by the class loader, and once a class has been loaded, it is not possible to unload it without unloading the entire class loader that loaded it. This is because classes are loaded into a single class loader namespace and are not designed to be unloaded individually. Therefore, you cannot sel...
16,985
[ { "from": "human", "value": "I have a custom class loader so that a desktop application can dynamically start loading classes from an AppServer I need to talk to. We did this since the amount of jars that are required to do this are ridiculous (if we wanted to ship them). We also have version problems if we...
I have a huge database with 100's of tables and stored procedures. Using SQL Server 2005, how can I get a list of stored procedures that are doing an insert or update operation on a given table.
To find stored procedures in SQL Server 2005 that perform `INSERT` or `UPDATE` operations on a specific table, you can query the system catalog views and look for references in the stored procedure definitions. SQL Server 2005 does not have built-in functionality to directly parse the SQL statements in the stored proce...
12,422
[ { "from": "human", "value": "I have a huge database with 100's of tables and stored procedures. Using SQL Server 2005, how can I get a list of stored procedures that are doing an insert or update operation on a given table.\n" }, { "from": "gpt", "value": "To find stored procedures in SQL Server...
I'm implementing a ioctl in a Windows CE device driver that takes a pointer to a large chunk of application memory to perform asynchronous I/O initiated through an application call to DeviceIoControl. When using MapCallerPtr(), the pointer gets unmapped when the XXX_IOControl function returns; when the pointer is used...
In Windows CE 5.0, when you're dealing with device drivers and handling memory pointers passed from user mode applications, you need to ensure that the memory remains valid throughout the execution of your asynchronous I/O operations, especially if you intend to access that memory in an Interrupt Service Thread (IST) o...
15,021
[ { "from": "human", "value": "I'm implementing a ioctl in a Windows CE device driver that takes a pointer to a large chunk of application memory to perform asynchronous I/O initiated through an application call to DeviceIoControl.\nWhen using MapCallerPtr(), the pointer gets unmapped when the XXX_IOControl f...
class someclass {}; class base { int a; int *pint; someclass objsomeclass; someclass* psomeclass; public: base() { objsomeclass = someclass(); psomeclass = new someclass(); pint = new int(); throw "constructor failed"; a = 43; } } int main() { b...
In the provided code snippets, you have a class named `base` that has several member variables and a constructor that throws an exception. Let's analyze both scenarios and discuss memory leaks and how to avoid them. ### First Code Snippet: ```cpp class someclass {}; class base { int a; int *pint; someclas...
13,511
[ { "from": "human", "value": "class someclass {};\n\nclass base\n{\n int a;\n int *pint;\n someclass objsomeclass;\n someclass* psomeclass;\npublic:\n base()\n {\n objsomeclass = someclass();\n psomeclass = new someclass();\n pint = new int(); \n throw \"construc...
I have a function that looks like this class NSNode { function insertAfter(NSNode $node) { ... } } I'd like to be able to use that function to indicate that the node is being inserted at the start, therefore it is after nothing. The way I think about that is that null means "nothing", so I'd write my f...
To allow your `insertAfter` function to accept a "null-esque" value while maintaining strict typing, you can use a combination of union types (available in PHP 8.0 and later) and possibly define a special class that acts as a placeholder. Here’s how you could implement a solution with union types: ```php class NSNod...
18,826
[ { "from": "human", "value": "I have a function that looks like this\nclass NSNode {\n function insertAfter(NSNode $node) {\n ...\n }\n}\n\nI'd like to be able to use that function to indicate that the node is being inserted at the start, therefore it is after nothing. The way I think about that...
Let's assume you have one massive table with three columns as shown below: [id] INT NOT NULL, [date] SMALLDATETIME NOT NULL, [sales] FLOAT NULL Also assume you are limited to one physical disk and one filegroup (PRIMARY). You expect this table to hold sales for 10,000,000+ ids, across 100's of dates (easily 1B+ rec...
In this scenario with a massive table holding sales data, where the data is expected to grow sequentially by date and queries are often focused on a small subset of IDs, there are multiple indexing and partitioning strategies to consider. Let's break down the options and their implications. ### Option #1: Clustered In...
16,378
[ { "from": "human", "value": "Let's assume you have one massive table with three columns as shown below:\n[id] INT NOT NULL,\n\n[date] SMALLDATETIME NOT NULL,\n\n[sales] FLOAT NULL\n\nAlso assume you are limited to one physical disk and one filegroup (PRIMARY). You expect this table to hold sales for 10,000...
Every morning, after logging into your machine, you do a variety of routine stuffs. The list can include stuffs like opening/checking your email clients, rss readers, launching visual studio, running some business apps, typing some replies, getting latest version from Source Control, compiling, connecting to a differen...
Automating routine tasks can greatly enhance productivity and free up time for more critical work. Here’s a list of common tasks that people often automate along with some strategies and tools to achieve that automation: ### Common Routine Tasks 1. **Email Checking and Response**: - **Tool**: Use tools like Micros...
13,844
[ { "from": "human", "value": "Every morning, after logging into your machine, you do a variety of routine stuffs.\nThe list can include stuffs like opening/checking your email clients, rss readers, launching visual studio, running some business apps, typing some replies, getting latest version from Source Co...
I know of the following: The venerable getopt(3) The extended getopt_long glibc's argp parser for Unix-style argument vectors popt from the GNOME project (or its spiritual successor in Glib) I'm sure there's more that I haven't used or even heard of; a quick Google search reveals Gopt, argtable, and Optlist. Personal...
When it comes to argument parsing in C, the options you've listed cover many of the common libraries and approaches available. Here’s a summary of some of them, along with additional options and my thoughts on their usage: 1. **getopt / getopt_long**: These are standard functions provided by the POSIX library for pars...
17,120
[ { "from": "human", "value": "I know of the following:\n\nThe venerable getopt(3)\nThe extended getopt_long\nglibc's argp parser for Unix-style argument vectors\npopt from the GNOME project (or its spiritual successor in Glib)\n\nI'm sure there's more that I haven't used or even heard of; a quick Google sear...
I have an application that needs to open a CDialog written inside a DLL. The problem is that when DoModal() is called inside the DLL, the program crashes with: "Debug Assertion Failed!". Does anyone have any idea how can i get the CDialog opened? Thank you!
When working with CDialog in a DLL, a few common pitfalls can lead to crashes or assertion failures when calling `DoModal()`. Here are some steps and considerations to help you troubleshoot and resolve the issue: 1. **Ensure Proper Initialization**: Make sure that the DLL has been properly initialized. This includes e...
17,553
[ { "from": "human", "value": "I have an application that needs to open a CDialog written inside a DLL. The problem is that when DoModal() is called inside the DLL, the program crashes with: \"Debug Assertion Failed!\". Does anyone have any idea how can i get the CDialog opened? Thank you!\n" }, { "fr...
I'm writing a game in Java, and I want the user to be able to provide input from both the command line and my GUI. Currently, I use this method to get input: static String getInput(){ System.out.println("Your move:"); Scanner sc = new Scanner(System.in); return sc.nextLine(); } I want t...
Simulating user input in Java for `System.in` can be tricky, since it is a stream that typically reads from the keyboard. However, you can achieve the desired functionality by creating a custom input stream that feeds data to `System.in`. Here's a basic approach using an `InputStream` and a `ByteArrayInputStream` to r...
14,512
[ { "from": "human", "value": "I'm writing a game in Java, and I want the user to be able to provide input from both the command line and my GUI. Currently, I use this method to get input:\n static String getInput(){\n System.out.println(\"Your move:\");\n Scanner sc = new Scanner(System.in);...
Is it possible to find out who called a stored procedure? For example, say I get an error in proc3. From within that proc I want to know if it was called by proc1 or proc2.
In SQL Server, you can determine the caller of a stored procedure by using the `ORIGINAL_LOGIN()` and `SESSION_CONTEXT()` functions in combination with the context provided by the stack trace. When an error occurs in a stored procedure, you can also use the `ERROR_PROCEDURE()` function to find out the name of the proc...
15,527
[ { "from": "human", "value": "Is it possible to find out who called a stored procedure?\nFor example, say I get an error in proc3. From within that proc I want to know if it was called by proc1 or proc2.\n" }, { "from": "gpt", "value": "In SQL Server, you can determine the caller of a stored proc...
I'm working on an iPhone application that would allow viewing and editing of data that I want to keep in sync with a desktop application. I don't see anything in the SDK that directly addresses data synchronization, nor can I find anything that allows my to "hook" into the iTunes sync process. I could do something klud...
Syncing data between an iPhone application and a desktop application is indeed a common requirement, but as you’ve noticed, iOS does not provide a built-in API specifically designed for arbitrary data synchronization between the two. Here are some approaches you can consider for implementing this functionality: ### 1....
18,056
[ { "from": "human", "value": "I'm working on an iPhone application that would allow viewing and editing of data that I want to keep in sync with a desktop application. I don't see anything in the SDK that directly addresses data synchronization, nor can I find anything that allows my to \"hook\" into the iTu...
Is there any way to download attachment from a web service without using WSE in C#?
Yes, you can download attachments from a web service in C# without using Windows Communication Foundation (WCF) or Web Services Enhancements (WSE). You can achieve this using the standard `HttpClient` class or `WebClient` class in .NET, depending on how the web service is designed to provide the attachment. Below are ...
16,052
[ { "from": "human", "value": "Is there any way to download attachment from a web service without using WSE in C#?\n" }, { "from": "gpt", "value": "Yes, you can download attachments from a web service in C# without using Windows Communication Foundation (WCF) or Web Services Enhancements (WSE). Yo...
Is there a way to detect if the user is holding down the shift key (or other modifier keys) when executing a javascript bookmarklet? In my tests of Safari 3.1 and Firefox 3, window.event is always undefined.
Detecting modifier keys (like Shift, Ctrl, or Alt) when using a JavaScript bookmarklet can be a bit tricky because bookmarklets are executed in a context that doesn't have direct access to the event objects that would normally be present during user interactions (like `click` or `keydown` events). However, you can ach...
17,037
[ { "from": "human", "value": "Is there a way to detect if the user is holding down the shift key (or other modifier keys) when executing a javascript bookmarklet?\nIn my tests of Safari 3.1 and Firefox 3, window.event is always undefined.\n" }, { "from": "gpt", "value": "Detecting modifier keys (...
Whilst refactoring some code I came across some getter methods that returns a std::string. Something like this for example: class foo { private: std::string name_; public: std::string name() { return name_; } }; Surely the getter would be better returning a const std::string&? The current met...
You're correct that returning a `const std::string&` can be more efficient than returning a `std::string` by value, especially if the `std::string` can be large. Returning by reference avoids the overhead of copying the string, which can lead to better performance, particularly in performance-critical code. Here’s how...
19,266
[ { "from": "human", "value": "Whilst refactoring some code I came across some getter methods that returns a std::string. Something like this for example:\nclass foo\n{\nprivate:\n std::string name_;\npublic:\n std::string name()\n {\n return name_;\n }\n};\n\nSurely the getter would be be...
Please help! I'm really at my wits' end. My program is a little personal notes manager (google for "cintanotes"). On some computers (and of course I own none of them) it crashes with an unhandled exception just after start. Nothing special about these computers could be said, except that they tend to have AMD CPUs. En...
It sounds like you've successfully identified and resolved a challenging bug related to the use of SSE2 instructions on machines that do not support them. It's great to hear that you were able to debug the application on the problematic PC, and now you understand that the crash was due to the enhanced instruction set b...
19,957
[ { "from": "human", "value": "Please help! I'm really at my wits' end.\nMy program is a little personal notes manager (google for \"cintanotes\").\nOn some computers (and of course I own none of them) it crashes with an unhandled exception just after start. \nNothing special about these computers could be sa...
I am seeking a WinForm control that would provide an autocomplete behavior for multiple space-separated - exactly ala del.icio.us (or stackoverflow.com for that matter). Does anyone knows how to do that within a .NET 2.0 WinForm application?
To implement an autocomplete behavior for multiple space-separated values in a WinForms application using .NET 2.0, you will need to create a custom control or extend an existing control like `TextBox`. Here's a basic approach to help you get started. ### Steps to Create an Autocomplete Control 1. **Create a New User...
12,256
[ { "from": "human", "value": "I am seeking a WinForm control that would provide an autocomplete behavior for multiple space-separated - exactly ala del.icio.us (or stackoverflow.com for that matter).\nDoes anyone knows how to do that within a .NET 2.0 WinForm application?\n" }, { "from": "gpt", "...
<my:DataGridTemplateColumn CanUserResize="False" Width="150" Header="{Binding MeetingName, Source={StaticResource LocStrings}}" SortMemberPath="MeetingName"> </my:DataGridTemplateColumn> I have the above column in a Silverlight grid control. But it is giving me ...
The issue you're experiencing with the `XamlParser` error when trying to bind the `Header` property directly in a `DataGridTemplateColumn` is due to the way the `Header` property is defined. In Silverlight and WPF, the `Header` property of a `DataGridColumn` does not support binding directly in this manner. To bind th...
19,671
[ { "from": "human", "value": " <my:DataGridTemplateColumn \n CanUserResize=\"False\" \n Width=\"150\" \n Header=\"{Binding MeetingName, Source={StaticResource LocStrings}}\" \n SortMemberPath=\"MeetingName\"> \n </my:DataGridTemplateColumn>\n\nI have the above co...
What tools are out there that compete with this product? CodeKana I know ReSharper has improved syntax highlighting. Is it comparable to this?
CodeKana is a tool designed to enhance code readability and productivity through features like syntax highlighting, code suggestions, and more. If you're looking for alternatives or competitors to CodeKana, here are some popular tools in the coding and development space that offer similar functionalities: 1. **ReSharp...
19,884
[ { "from": "human", "value": "What tools are out there that compete with this product?\nCodeKana\nI know ReSharper has improved syntax highlighting. Is it comparable to this? \n" }, { "from": "gpt", "value": "CodeKana is a tool designed to enhance code readability and productivity through feature...
Is there a way to be sure we hold a useable reference to an object i.e. being sure it has not been already freed leaving that non nil reference dangling.
In programming, especially in languages like C or C++, managing object lifetimes and ensuring that you don't dereference a dangling pointer can be challenging. Here are some strategies and approaches that can help you manage object references safely: ### 1. Smart Pointers (C++) In C++, you can use smart pointers like...
17,772
[ { "from": "human", "value": "Is there a way to be sure we hold a useable reference to an object i.e. being sure it has not been already freed leaving that non nil reference dangling.\n" }, { "from": "gpt", "value": "In programming, especially in languages like C or C++, managing object lifetimes...
I'm not looking for a full implementation, I'm more interested in how they do it. I know they use GWT, but I'd like a more low level answer. Naively, I would start by thinking when you click the popout link they simply open a new window and copy content into it. There are lots of reasons why that won't work out well...
When implementing a popout functionality in a web application, particularly with frameworks like GWT (Google Web Toolkit), a naive approach of simply opening a new window and copying content may not suffice. There are several considerations and techniques that can be used to achieve a smooth user experience. ### 1. **...
18,183
[ { "from": "human", "value": "I'm not looking for a full implementation, I'm more interested in how they do it. I know they use GWT, but I'd like a more low level answer. Naively, I would start by thinking when you click the popout link they simply open a new window and copy content into it. There are lot...
I have a custom login component in Flex that is a simple form that dispatches a custom LoginEvent when a user click the login button: <?xml version="1.0" encoding="utf-8"?> <mx:Form xmlns:mx="http://www.adobe.com/2006/mxml" defaultButton="{btnLogin}"> <mx:Metadata> [Event(name="login",tpye="events.LoginEv...
The issue you're encountering with the "undefined property cLogin" error when trying to add an event listener in your main.mxml file is likely due to the way you are trying to access the `cLogin` instance in the ActionScript code. In Flex, the ID of a component is only accessible after it is instantiated. If you are t...
15,083
[ { "from": "human", "value": "I have a custom login component in Flex that is a simple form that dispatches a custom LoginEvent when a user click the login button:\n\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<mx:Form xmlns:mx=\"http://www.adobe.com/2006/mxml\" defaultButton=\"{btnLogin}\">\n\n <mx:Meta...
I was wondering if there is a good way to hook into the Application_Start of a SharePoint 2007 site when developing a feature? I know I can directly edit the Global.asax file in the site root, but is there a way to do this so that it gets deployed with the feature? Thanks!
In SharePoint 2007, it is not possible to directly hook into the `Application_Start` event of the Global.asax file from a feature because the Global.asax file is specific to each site and is not managed through SharePoint features. However, you can achieve similar functionality by using a few alternatives: 1. **Featur...
16,189
[ { "from": "human", "value": "I was wondering if there is a good way to hook into the Application_Start of a SharePoint 2007 site when developing a feature? I know I can directly edit the Global.asax file in the site root, but is there a way to do this so that it gets deployed with the feature?\nThanks!\n" ...
My application is targeted for Compact .Net 1.0 framework. The application has to check and download any updates available from a web-site. I am thinking of providing the updates as CAB files. Since the CAB files are processor type specific, I want to download the CAB file based on the Processor Type. What is the API f...
To determine the processor type in a Compact .NET Framework application, you can use the `System.Environment` class, which provides a way to access various system information, including the processor architecture. You can check the processor architecture using the `Environment.GetEnvironmentVariable` method. Here's a ...
20,972
[ { "from": "human", "value": "My application is targeted for Compact .Net 1.0 framework. The application has to check and download any updates available from a web-site. I am thinking of providing the updates as CAB files. Since the CAB files are processor type specific, I want to download the CAB file based...
Is it possible to use OpenID for both .NET web sites and PHP websites (Apache/Linux)? I have a manager that wants single sign-on for access to any/all web sites, regardless of which web server hosts a web site. I create .NET web apps and the PHP web sites/apps are done by another programmer. How would I go about u...
Yes, it is indeed possible to use OpenID for both .NET web applications and PHP applications, allowing for a single sign-on (SSO) experience across different technologies and platforms. OpenID is an authentication protocol that allows users to log in to multiple websites using a single identity, regardless of the under...
15,588
[ { "from": "human", "value": "Is it possible to use OpenID for both .NET web sites and PHP websites (Apache/Linux)? \nI have a manager that wants single sign-on for access to any/all web sites, regardless of which web server hosts a web site. \nI create .NET web apps and the PHP web sites/apps are done by a...
I'm using ASP.NET, with session state stored out of process in SQL Server. When a page request begins, are the entire contents of a user's session retrieved from the DB, deserialized, and sent to the ASP.NET process in one fell swoop, or are individual objects transferred to the ASP.NET process only as needed? Basicall...
In ASP.NET, when session state is stored out of process (for example, in SQL Server), the entire session state is serialized and stored in the database as a single blob. This means that when a page request begins, the entire contents of a user's session are retrieved from the database in one operation, deserialized, an...
19,987
[ { "from": "human", "value": "I'm using ASP.NET, with session state stored out of process in SQL Server. When a page request begins, are the entire contents of a user's session retrieved from the DB, deserialized, and sent to the ASP.NET process in one fell swoop, or are individual objects transferred to the...
I tried committing files with CRLF-ending lines, but it failed. I spent a whole work day on my Windows computer trying different strategies and was almost drawn to stop trying to use Git and instead try Mercurial. How to properly handle CRLF line endings?
Handling CRLF (Carriage Return and Line Feed) line endings in Git can be a bit tricky, especially when working across different operating systems (like Windows and Unix/Linux). However, Git provides built-in mechanisms to handle line endings effectively. Here’s how you can manage CRLF line endings in Git: ### 1. Confi...
14,570
[ { "from": "human", "value": "I tried committing files with CRLF-ending lines, but it failed.\nI spent a whole work day on my Windows computer trying different strategies and was almost drawn to stop trying to use Git and instead try Mercurial.\nHow to properly handle CRLF line endings?\n" }, { "from...
Is there any easier solution in porting a windows manual-reset event to pthread, than a pthread conditional-variable + pthread mutex + a flag if event is set or unset?
Porting a Windows manual-reset event to a POSIX environment can indeed be a bit challenging due to the differences in how synchronization primitives are implemented in each system. The Windows manual-reset event allows multiple threads to be released once the event is set, and it remains set until explicitly reset. If...
17,275
[ { "from": "human", "value": "Is there any easier solution in porting a windows manual-reset event to pthread,\nthan a pthread conditional-variable + pthread mutex + a flag if event is set or unset?\n" }, { "from": "gpt", "value": "Porting a Windows manual-reset event to a POSIX environment can i...
When developing distributed applications, all written in Java by the same company, would you choose Web Services or RMI? What are the pros and cons in terms of performance, loose coupling, ease of use, ...? Would anyone choose WS? Can you build a service-oriented architecture with RMI?
When developing distributed applications in Java, you may consider various options for communication between different components. Two common approaches are Web Services (WS) and Remote Method Invocation (RMI). Each has its own pros and cons, and the best choice depends on the specific requirements of your application....
16,524
[ { "from": "human", "value": "When developing distributed applications, all written in Java by the same company, would you choose Web Services or RMI? What are the pros and cons in terms of performance, loose coupling, ease of use, ...? Would anyone choose WS? Can you build a service-oriented architecture wi...
We're trying to put together kiosk solution where we can charge people by hour for applications they use. As such, we need a way to figure out when an application is started, when it is closed and log this information for billing. I am a reasonably experienced .NET programmer so a managed code solution would be great. ...
Creating a kiosk solution that tracks the usage of applications for billing purposes can be achieved using .NET in conjunction with some Windows APIs. Below are some ideas to help you get started: ### Overview of the Solution 1. **Monitor Application Start and Stop Events**: You'll need to monitor when applications a...
14,349
[ { "from": "human", "value": "We're trying to put together kiosk solution where we can charge people by hour for applications they use. As such, we need a way to figure out when an application is started, when it is closed and log this information for billing. I am a reasonably experienced .NET programmer so...
Ok, this is bit of an obscure question, but hopefully someone can help me out with it. The system I'm working on builds a dynamic SQL string for execution inside a stored procedure, and part of that dynamic SQL defining column aliases, which themselves are actually values retrieved from another table of user generated ...
Handling double quotes in SQL aliases can be a bit tricky, especially in Oracle SQL. Since you're generating dynamic SQL and the alias can potentially contain double quotes, you'll need to find a way to safely include these quotes without breaking the SQL syntax. In Oracle SQL, when you want to include double quotes w...
18,618
[ { "from": "human", "value": "Ok, this is bit of an obscure question, but hopefully someone can help me out with it.\nThe system I'm working on builds a dynamic SQL string for execution inside a stored procedure, and part of that dynamic SQL defining column aliases, which themselves are actually values retri...
I have a number of stored procs which I would like to all run simultaneously on the server. Ideally all on the server without reliance on connections to an external client. What options are there to launch all these and have them run simultaneously (I don't even need to wait until all the processes are done to do addi...
To execute multiple stored procedures simultaneously on a SQL Server without relying on external client connections, here are several options you can consider: ### 1. SQL Server Agent Jobs Using SQL Server Agent jobs is one of the most straightforward methods. You can create individual jobs for each stored procedure....
15,685
[ { "from": "human", "value": "I have a number of stored procs which I would like to all run simultaneously on the server. Ideally all on the server without reliance on connections to an external client.\nWhat options are there to launch all these and have them run simultaneously (I don't even need to wait u...
I'd like to log stuff in my Sharepoint Web Parts, but I want it to go into the ULS. Most examples that I've found log into the Event Log or some other file, but I did not really find one yet for logging into the ULS. Annoyingly, Microsoft.SharePoint.Diagnostics Classes are all marked Internal. I did find one example of...
In SharePoint 2007, while it is true that logging directly to ULS (Unified Logging Service) is not as straightforward as it is in later versions like SharePoint 2010, you can still achieve it using the internal logging mechanisms provided by SharePoint. Since the `Microsoft.SharePoint.Diagnostics` classes are marked a...
16,713
[ { "from": "human", "value": "I'd like to log stuff in my Sharepoint Web Parts, but I want it to go into the ULS. Most examples that I've found log into the Event Log or some other file, but I did not really find one yet for logging into the ULS.\nAnnoyingly, Microsoft.SharePoint.Diagnostics Classes are all ...
I have a standard windows server that inherits from the ServiceBase class. On the OnStart method I want to check for certain conditions before I get to the main purpose of what my service does. For example: protected override void OnStart(string[] args) { if (condition == false) { EventLog.WriteEntry("Pre-condi...
In a Windows Service, once you call the `OnStart` method, the service is expected to either start successfully or handle any failures appropriately. If your service needs to stop because a precondition is not met, you can handle it by throwing a `ServiceBase.ServiceStopped` exception or by setting the service's state i...
12,920
[ { "from": "human", "value": "I have a standard windows server that inherits from the ServiceBase class.\nOn the OnStart method I want to check for certain conditions before I get to the main purpose of what my service does.\nFor example:\nprotected override void OnStart(string[] args)\n{\n if (condition ==...
I've been developing web apps for over a decade now, all the way from CGI to ASP.Net and Struts+Spring+Hibernate. The prevalent architectural style seems to be server-assisted MVC, e.g. Struts, Ruby on Rails, etc. Recent developments lead me to ask if these are on the decline. Adobe's AIR and Flex Microsoft's WPF and ...
You've raised some interesting points regarding the evolution of web application architecture and the balance between server-assisted MVC frameworks and client-side technologies. Indeed, the landscape of web development has been changing significantly over the last few years. 1. **Client-Side Frameworks**: There's be...
18,091
[ { "from": "human", "value": "I've been developing web apps for over a decade now, all the way from CGI to ASP.Net and Struts+Spring+Hibernate. The prevalent architectural style seems to be server-assisted MVC, e.g. Struts, Ruby on Rails, etc. Recent developments lead me to ask if these are on the decline.\n...
Where is the setting in Visual Studio 2003 to set the include path for individual projects? I know about the VC Directories option in Tools>Options but that is machine specific and won't help when I hand this off to other developers.
In Visual Studio 2003, you can set the include path for individual projects by modifying the project's properties. This allows you to specify include directories that are specific to that project, ensuring that the settings will travel with the project when handed off to other developers. Here’s how you can do it: 1. ...
20,032
[ { "from": "human", "value": "Where is the setting in Visual Studio 2003 to set the include path for individual projects? I know about the VC Directories option in Tools>Options but that is machine specific and won't help when I hand this off to other developers. \n" }, { "from": "gpt", "value"...
In the spirit of being helpful, this is a problem I had and solved, so I will answer the question here. Problem I have: An application that has to be installed on on Redhat or SuSE enterprise. It has huge system requirements and requires OpenGL. It is part of a suite of tools that need to operate together on one mach...
It sounds like you encountered a challenging situation, and it's great that you found a solution! Running a resource-intensive application that requires OpenGL on a Linux server from a remote Windows machine can indeed be tricky. Here's a general outline of your approach, and I can suggest a few alternatives as well. ...
17,683
[ { "from": "human", "value": "In the spirit of being helpful, this is a problem I had and solved, so I will answer the question here. \nProblem\nI have:\nAn application that has to be installed on on Redhat or SuSE enterprise. \nIt has huge system requirements and requires OpenGL.\nIt is part of a suite of t...
How do I iterate over a timespan after days, hours, weeks or months? Something like: for date in foo(from_date, to_date, delta=HOURS): print date Where foo is a function, returning an iterator. I've been looking at the calendar module, but that only works for one specific year or month, not between dates.
To create an iterator that allows you to iterate over a `datetime` range with a specified delta (like days, hours, weeks, or months), you can define a custom function. Python's `datetime` module combined with `timedelta` can help you achieve this. Below is an example implementation of your `foo` function that supports ...
17,673
[ { "from": "human", "value": "How do I iterate over a timespan after days, hours, weeks or months?\nSomething like:\nfor date in foo(from_date, to_date, delta=HOURS):\n print date\n\nWhere foo is a function, returning an iterator. I've been looking at the calendar module, but that only works for one speci...
As much as I generally don't like the discussion/subjective posts on SO, I have really come to appreciate the "Hidden Secrets" set of posts that people have put together. They provide a great overview of some commonly missed tools that you might now otherwise discover. For this question I would like to explore the Vis...
The Visual Studio .NET debugger is a powerful tool that offers many features beyond just stepping through code. Here are some "hidden secrets" and features that can significantly enhance your debugging experience: 1. **Edit and Continue**: This feature allows you to make changes to your code while debugging, and the c...
14,849
[ { "from": "human", "value": "As much as I generally don't like the discussion/subjective posts on SO, I have really come to appreciate the \"Hidden Secrets\" set of posts that people have put together. They provide a great overview of some commonly missed tools that you might now otherwise discover.\nFor t...
I've installed owfs and am trying to read the data off a iButton temperature logger. owfs lets me mount the iButton as a fuse filesystem and I can see all the data. I'm having trouble figuring out what is the best way to access the data though. I can get individual readings by catting the files, e.g. cat onewire/{dev...
To access the recorded logs from your iButton temperature logger using the `owpython` library, you can utilize the `log` functionality of the `Sensor` object. However, it seems like the `log` attribute is not directly available on the `Sensor` object as you mentioned. Instead, you'll want to read the logs manually by a...
15,183
[ { "from": "human", "value": "I've installed owfs and am trying to read the data off a iButton temperature logger.\nowfs lets me mount the iButton as a fuse filesystem and I can see all the data. I'm having trouble figuring out what is the best way to access the data though. I can get individual readings b...
We have been designing our reports around Crystal Reports in VS2008 for our web application and I just discovered the Microsoft provided ReportViewer control. I've searched around a bit but cannot find a good breakdown of the pros and cons of each method of producing reports. I'm looking for pros and cons regarding: ...
When comparing Crystal Reports and Microsoft ReportViewer for use in a web application, it's important to consider various factors that affect ease of development, deployment, data export capabilities, and the support available. Here's a breakdown of the pros and cons of each reporting solution based on those criteria:...
16,445
[ { "from": "human", "value": "We have been designing our reports around Crystal Reports in VS2008 for our web application and I just discovered the Microsoft provided ReportViewer control. I've searched around a bit but cannot find a good breakdown of the pros and cons of each method of producing reports.\n...
What does the ISupportErrorInfo interface mean? I'm at a bit of a loss to understand it. From MSDN: This interface ensures that error information can be propagated up the call chain correctly. Automation objects that use the error handling interfaces must implement ISupportErrorInfo. This method indicates wh...
The `ISupportErrorInfo` interface is a part of the Component Object Model (COM) in Windows programming. Its primary purpose is to indicate whether a particular COM interface supports the `IErrorInfo` interface, which provides structured error information to clients when an operation fails. ### Key Concepts: 1. **Erro...
16,253
[ { "from": "human", "value": "What does the ISupportErrorInfo interface mean? I'm at a bit of a loss to understand it. From MSDN:\n\nThis interface ensures that error\n information can be propagated up the\n call chain correctly. Automation\n objects that use the error handling\n interfaces must implemen...
I had defined a custom content type, and I am trying to define a filtered lookup column. I can select the list from where to pick up the column I need, but I can't find any example of the needed format of query string. I can filter the list manually by appending "?FilterField1=columnName&FilterValue1=myValue" to the li...
To create a filtered lookup column in SharePoint, you typically use the `?FilterField1=<columnName>&FilterValue1=<myValue>` query string format to filter the list. However, the exact setup may depend on the specific SharePoint environment you're working with. Here are a few examples and explanations to help guide you ...
17,317
[ { "from": "human", "value": "I had defined a custom content type, and I am trying to define a filtered lookup column. I can select the list from where to pick up the column I need, but I can't find any example of the needed format of query string. I can filter the list manually by appending \"?FilterField1=...
It is a real pain to deploy my InfoPath 2007 Forms from the designer into our development environment's SharePoint server. All of our forms require "full trust" since they include business logic written in C#. Here are the manual steps: 1) Run the "Publish Form" wizard in InfoPath, specifying the target site to publi...
Automating the deployment of InfoPath forms in SharePoint can streamline your process significantly. While there isn't a straightforward command to publish InfoPath forms directly from the command line, you can use PowerShell and STSADM together to script parts of your deployment process. Below is a general approach to...
15,783
[ { "from": "human", "value": "It is a real pain to deploy my InfoPath 2007 Forms from the designer into our development environment's SharePoint server. All of our forms require \"full trust\" since they include business logic written in C#. Here are the manual steps:\n1) Run the \"Publish Form\" wizard in...
I'd like to find a way to determine how long each function in PHP, and each file in PHP is taking to run. I've got an old legacy PHP application that I'm trying to find the "rough spots" in and so I'd like to locate which routines and pages are taking a very long time to load, objectively. Are there any pre-made tool...
Profiling a legacy PHP application to find performance bottlenecks can indeed be a challenging task, but there are several tools and techniques available that can help you achieve this without building your own profiling framework from scratch. Here are some options: ### 1. **Xdebug** Xdebug is a powerful tool for deb...
14,617
[ { "from": "human", "value": "I'd like to find a way to determine how long each function in PHP, and each file in PHP is taking to run. I've got an old legacy PHP application that I'm trying to find the \"rough spots\" in and so I'd like to locate which routines and pages are taking a very long time to load...
I'm working on a free software (bsd license) project with others. We're searching for a system that check out our source code (svn) and build it also as test it (unit tests with Check / other tools). It should have a webbased interface and generate reports. I hope we don't have to write such a system from null by ourse...
It sounds like you're looking for a Continuous Integration (CI) system that can integrate with your Subversion (SVN) repository, build your code, run unit tests, and provide a web-based interface with reporting features. Here are several options that might suit your needs: ### 1. **Jenkins** - **Description**: Jenkins...
16,150
[ { "from": "human", "value": "I'm working on a free software (bsd license) project with others. We're searching for a system that check out our source code (svn) and build it also as test it (unit tests with Check / other tools).\nIt should have a webbased interface and generate reports.\nI hope we don't hav...
Is there an Oracle equivalent to MS SQL's full text search service? If so, has anyone implemented it and had good / bad experiences?
Yes, Oracle Database has a feature equivalent to Microsoft SQL Server's Full-Text Search, known as Oracle Text. Oracle Text provides robust capabilities for full-text searching, allowing users to search large amounts of unstructured data, such as documents, emails, and web content, as well as structured data stored in ...
19,210
[ { "from": "human", "value": "Is there an Oracle equivalent to MS SQL's full text search service?\nIf so, has anyone implemented it and had good / bad experiences?\n" }, { "from": "gpt", "value": "Yes, Oracle Database has a feature equivalent to Microsoft SQL Server's Full-Text Search, known as O...
I recently had a need to interpret a DEC 32-bit floating point representation. It differs from the IEEE floating point representations in the number of bits allocated to the exponent and mantissa. Here's a description of a bunch of floating point formats: http://www.quadibloc.com/comp/cp0201.htm I managed to roll my o...
As of my last update in October 2023, there isn't a widely-known, dedicated library specifically for converting DEC 32-bit floating point representations to IEEE 32-bit floating point representations in C++. However, the task can be handled manually, as you’ve done, since the conversion primarily involves interpreting ...
18,613
[ { "from": "human", "value": "I recently had a need to interpret a DEC 32-bit floating point representation. It differs from the IEEE floating point representations in the number of bits allocated to the exponent and mantissa.\nHere's a description of a bunch of floating point formats:\nhttp://www.quadibloc...
I have an application running under Windows XP, and I'm accessing the Processor and Memory performance counters. When I try to run the same code and access them on XP Embedded, the counters don't seem to be present. They are present in the image - I can see them all in perfmon. What's the missing piece here?
Accessing performance counters in Windows XP Embedded can be a bit tricky, especially because Windows XP Embedded is a more customizable version of Windows XP and often has different components included based on the specific configuration. Here are some potential reasons why you might be experiencing issues accessing P...
18,914
[ { "from": "human", "value": "I have an application running under Windows XP, and I'm accessing the Processor and Memory performance counters. When I try to run the same code and access them on XP Embedded, the counters don't seem to be present. They are present in the image - I can see them all in perfmon...
My question is pretty straightforward: You are an executable file that outputs "Access granted" or "Access denied" and evil persons try to understand your algorithm or patch your innards in order to make you say "Access granted" all the time. After this introduction, you might be heavily wondering what I am doing. Is...
Creating a challenging and secure crackme requires a blend of clever algorithm design and anti-tampering techniques. Here are several strategies you can use to make your crackme more difficult for attackers to reverse-engineer or patch: ### 1. **Obfuscation Techniques:** - **Control Flow Obfuscation:** Change the c...
16,563
[ { "from": "human", "value": "My question is pretty straightforward: You are an executable file that outputs \"Access granted\" or \"Access denied\" and evil persons try to understand your algorithm or patch your innards in order to make you say \"Access granted\" all the time. \nAfter this introduction, yo...
I subscribe to a newsletter from www.sqlservercentral.com that I like because each day I get an email digest with some interesting headlines & summaries of SQL Server articles that are already out there on the web. It's a great way to learn something new a bit at a time. Is there something like this for C#? (If your...
Yes, there are several newsletters and resources similar to the SQL Server Central newsletter that focus on C#. Here are some popular options: 1. **C# Digest** - This is a weekly newsletter that curates articles, tutorials, and tips related to C# and .NET development. 2. **C# Corner** - This platform offers articles...
18,810
[ { "from": "human", "value": "I subscribe to a newsletter from www.sqlservercentral.com that I like because each day I get an email digest with some interesting headlines & summaries of SQL Server articles that are already out there on the web. It's a great way to learn something new a bit at a time.\nIs th...
The following is a Simple Style for ListBoxItem, ListBoxItem has a son Border. Border has a Padding property with value of 8, I want to change the value to 0, when the item is selected. How can I write the trigger? <??Style TargetType="{x:Type ListBoxItem}"> <Setter Property="Background" Value="Transparent"...
To change the `Padding` property of the `Border` within the `ControlTemplate` of a `ListBoxItem` when the item is selected, you need to set the `Padding` property on the `Border` within the trigger. Here’s how you can structure the `Trigger` to achieve this: ```xml <Style TargetType="{x:Type ListBoxItem}"> <Sette...
19,890
[ { "from": "human", "value": "The following is a Simple Style for ListBoxItem, ListBoxItem has a son Border. Border has a Padding property with value of 8, I want to change the value to 0, when the item is selected. How can I write the trigger?\n <??Style TargetType=\"{x:Type ListBoxItem}\">\n <Set...
I'm trying to find out what the performance of a large directory structure would be if deep directories were to be accessed on a shared, nfs filesystem. The structure would be excessively large, with 4 levels of nested directories, each level containing 1024 directories. (1024 at root, 1024 in a given subdirectory, and...
Accessing a large directory structure, especially in a nested configuration like the one you described (4 levels with 1024 directories each), can present significant challenges on an NFS (Network File System) setup. Here are some key factors that will influence performance: ### 1. Directory Access Performance - **File...
12,219
[ { "from": "human", "value": "I'm trying to find out what the performance of a large directory structure would be if deep directories were to be accessed on a shared, nfs filesystem. The structure would be excessively large, with 4 levels of nested directories, each level containing 1024 directories. (1024 a...
MessageBox.Show has forms like MessageBox.Show( ownerWindow, .... ). What do I gain by assigning a owner window?
Using an owner window with `MessageBox.Show` in a WinForms application has several advantages: 1. **Modal Behavior**: When you specify an owner window, the message box will be modal to that owner window. This means that the user must respond to the message box before they can interact with the owner window again. This...
19,955
[ { "from": "human", "value": "MessageBox.Show has forms like MessageBox.Show( ownerWindow, .... ).\nWhat do I gain by assigning a owner window?\n" }, { "from": "gpt", "value": "Using an owner window with `MessageBox.Show` in a WinForms application has several advantages:\n\n1. **Modal Behavior**:...
I'm working on a MS Access database. I've made some changes to one of the modules. I want to go out for lunch, but when I try closing the database, I get the following message: "You do not have exclusive access to the database. Your design changes cannot be saved at this time. Do you want to close without saving yo...
It sounds like you encountered a common issue with Microsoft Access databases, especially when dealing with shared databases in a multi-user environment. The message you received usually indicates that there are other users with the database open, or that there is some lingering lock on the database file. Here are some...
18,609
[ { "from": "human", "value": "I'm working on a MS Access database. I've made some changes to one of the modules. I want to go out for lunch, but when I try closing the database, I get the following message:\n\"You do not have exclusive access to the database. Your design changes cannot be saved at this ti...
Our company is sending out a lot of emails per day and planning to send even more in future. (thousands) Also there are mass mailouts as well in the ten thousands every now and then. Anybody has experience with hotmail, yahoo (web.de, gmx.net) and similar webmail companies blocking your emails because "too many from th...
Sending large volumes of emails can indeed lead to deliverability issues, especially with webmail providers like Hotmail, Yahoo, and others. These providers have algorithms in place to identify and block what they consider to be spammy behavior, which can include too many emails sent from the same source in a short per...
14,006
[ { "from": "human", "value": "Our company is sending out a lot of emails per day and planning to send even more in future. (thousands) Also there are mass mailouts as well in the ten thousands every now and then.\nAnybody has experience with hotmail, yahoo (web.de, gmx.net) and similar webmail companies bloc...
Is there any IDE for coding mono on windows platform?
Yes, there are several Integrated Development Environments (IDEs) and editors that support Mono development on the Windows platform. Here are some popular ones: 1. **Visual Studio**: Visual Studio has support for C# and can be used with Mono. You can create and manage Mono projects by using the Mono runtime along with...
20,364
[ { "from": "human", "value": "Is there any IDE for coding mono on windows platform?\n" }, { "from": "gpt", "value": "Yes, there are several Integrated Development Environments (IDEs) and editors that support Mono development on the Windows platform. Here are some popular ones:\n\n1. **Visual Stud...
I'm working on a C++ application that needs detailed timing information, down to the millisecond level. We intend to gather the time to second accuracy using the standard time() function in <ctime>. We would like to additionally gather the milliseconds elapsed since the last second given by time(). Does anyone kno...
To obtain detailed timing information in C++, you can utilize the `<chrono>` library, which provides high-resolution clocks and time point functionality. Here's how you can achieve millisecond precision along with second-level precision from the standard `time()` function. ### Using `<chrono>` 1. **Get the current ti...
17,807
[ { "from": "human", "value": "I'm working on a C++ application that needs detailed timing information, down to the millisecond level. \nWe intend to gather the time to second accuracy using the standard time() function in <ctime>. We would like to additionally gather the milliseconds elapsed since the last...
I have a .NET WinForms textbox for a phone number field. After allowing free-form text, I'd like to format the text as a "more readable" phone number after the user leaves the textbox. (Outlook has this feature for phone fields when you create/edit a contact) 1234567 becomes 123-4567 1234567890 becomes (123) 456-7890...
To achieve the desired phone number formatting in a .NET WinForms application, you can utilize the `Leave` event of the TextBox. Below is an example of how you can implement this functionality. ### Steps to Implement Phone Number Formatting 1. **Create the TextBox**: Ensure you have a TextBox in your WinForms applica...
17,353
[ { "from": "human", "value": "I have a .NET WinForms textbox for a phone number field. After allowing free-form text, I'd like to format the text as a \"more readable\" phone number after the user leaves the textbox. (Outlook has this feature for phone fields when you create/edit a contact)\n\n1234567 becom...
I have a DataGridView with several created columns. I've add some rows and they get displayed correctly; however, when I click on a cell, the content disappears. What am I doing wrong? The code is as follows: foreach (SaleItem item in this.Invoice.SaleItems) { DataGridViewRow row = new DataGridViewRow(); gridVi...
The issue you're encountering, where the cell content disappears when you click on a cell, is likely due to how you're adding cells to the `DataGridViewRow`. Specifically, you are directly assigning the `DataGridViewCell` instances to the `Cells` collection of the row, which is not the correct approach. When you creat...
17,266
[ { "from": "human", "value": "I have a DataGridView with several created columns. I've add some rows and they get displayed correctly; however, when I click on a cell, the content disappears.\nWhat am I doing wrong?\nThe code is as follows:\nforeach (SaleItem item in this.Invoice.SaleItems)\n{\n DataGridV...
I am looking for a way to interact with a standalone full version of Windows Media Player. Mostly I need to know the Path of the currently played track. The iTunes SDK makes this really easy but unfortunately there really isn't any way to do it with Windows Media Player, at least not in .Net(C#) without any heavy use o...
To interact with a standalone instance of Windows Media Player (WMP) in C#, you can use the COM interface provided by WMP. While it may not be as straightforward as using the iTunes SDK, it is definitely achievable without heavy use of P/Invoke. Windows Media Player exposes its functionality through a COM object which...
17,726
[ { "from": "human", "value": "I am looking for a way to interact with a standalone full version of Windows Media Player.\nMostly I need to know the Path of the currently played track.\nThe iTunes SDK makes this really easy but unfortunately there really isn't any way to do it with Windows Media Player, at le...
I am creating an RSS reader as a hobby project, and at the point where the user is adding his own URL's. I was thinking of two things. A plaintext file where each url is a single line SQLite where i can have unique ID's and descriptions following the URL Is the SQLite idea to much of an overhead or is there a better ...
When deciding between using a plaintext file or SQLite for storing user-defined URLs in your RSS reader project, both approaches have their pros and cons. Here’s a breakdown to help you decide: ### Plaintext File **Pros:** - **Simplicity**: It's easy to read and modify, both for you as a developer and for users who m...
15,221
[ { "from": "human", "value": "I am creating an RSS reader as a hobby project, and at the point where the user is adding his own URL's.\nI was thinking of two things.\n\nA plaintext file where each url is a single line\nSQLite where i can have unique ID's and descriptions following the URL\n\nIs the SQLite id...
Anyone know how to create a routed event in Silverlight 2? In WPF, the code would be like below. However, there’s no EventManager in Silverlight. public static readonly RoutedEvent ShowVideoEvent = EventManager.RegisterRoutedEvent("ShowVideo", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(Nav...
In Silverlight 2, you don't have access to the `EventManager` class like you do in WPF, which means you can't create routed events in the same way. However, you can still create your own events in Silverlight using standard .NET event patterns. Here's how you can define and raise a custom event in Silverlight: ### Ste...
18,511
[ { "from": "human", "value": "Anyone know how to create a routed event in Silverlight 2? In WPF, the code would be like below. However, there’s no EventManager in Silverlight.\n public static readonly RoutedEvent ShowVideoEvent =\n EventManager.RegisterRoutedEvent(\"ShowVideo\", RoutingStrategy.B...
Basically, what I need is something like Dependecy Walker, but it should work with .NET applications. Is there anywhere such tool?
Yes, there are several tools available that can help you analyze dependencies in .NET applications. Here are a few options: 1. **ILSpy**: This is an open-source .NET assembly browser and decompiler. It allows you to inspect the contents of .NET assemblies, including their dependencies. 2. **dotPeek**: JetBrains dotPe...
20,114
[ { "from": "human", "value": "Basically, what I need is something like Dependecy Walker, but it should work with .NET applications. Is there anywhere such tool?\n" }, { "from": "gpt", "value": "Yes, there are several tools available that can help you analyze dependencies in .NET applications. Her...
Per this helpful article I have confirmed I have a connection pool leak in some application on my IIS 6 server running W2k3. The tough part is that I'm serving 300 websites written by 700 developers from this server in 6 application pools, 50% of which are .NET 1.1 which doesn't even show connections in the CLR Data p...
Diagnosing connection pool leaks in an IIS 6 environment can indeed be challenging, especially when dealing with multiple applications and developers. Here are some strategies you can employ to identify and mitigate the issues without causing too much disruption in a production environment: 1. **Enable Connection Pool...
16,459
[ { "from": "human", "value": "Per this helpful article I have confirmed I have a connection pool leak in some application on my IIS 6 server running W2k3. \nThe tough part is that I'm serving 300 websites written by 700 developers from this server in 6 application pools, 50% of which are .NET 1.1 which doesn...
I know we can use tools like JProfiler etc. Is there any tutorial on how to configure it to display the memory usage just by remote monitoring? Any idea?
Certainly! To use JProfiler for remote monitoring of Java applications and display memory usage, you'll need to follow a series of steps to set it up correctly. Below is a basic guide to help you configure JProfiler for remote monitoring: ### Step-by-Step Guide to Configure JProfiler for Remote Monitoring 1. **Downlo...
18,177
[ { "from": "human", "value": "I know we can use tools like JProfiler etc.\nIs there any tutorial on how to configure it to display the memory usage just by remote monitoring?\nAny idea?\n" }, { "from": "gpt", "value": "Certainly! To use JProfiler for remote monitoring of Java applications and dis...
What is the easiest way to update a single attribute in a XML tag using PHP without rewriting and saving the file? Any way to do this just using regular DOM stuff?
To update a single attribute in an XML tag using PHP without rewriting and saving the entire file, you will typically need to load the XML into memory, modify it, and then save it back. However, if you are looking for a way to temporarily modify the XML and then use it without saving, you can utilize the `DOMDocument` ...
14,911
[ { "from": "human", "value": "What is the easiest way to update a single attribute in a XML tag using PHP without rewriting and saving the file? Any way to do this just using regular DOM stuff?\n" }, { "from": "gpt", "value": "To update a single attribute in an XML tag using PHP without rewriting...
What do folks here see as the relative strengths and weaknesses of Git, Mercurial, and Bazaar? In considering each of them with one another and against version control systems like SVN and Perforce, what issues should be considered? In planning a migration from SVN to one of these distributed version control systems, w...
When comparing Git, Mercurial, and Bazaar, it's important to consider their strengths and weaknesses, especially in the context of migrating from a centralized version control system like SVN or Perforce. Below is a breakdown of each system, followed by key considerations for migration. ### Git **Strengths:** - **Popu...
15,468
[ { "from": "human", "value": "What do folks here see as the relative strengths and weaknesses of Git, Mercurial, and Bazaar?\nIn considering each of them with one another and against version control systems like SVN and Perforce, what issues should be considered?\nIn planning a migration from SVN to one of t...
When developing a database of articles in a Knowledge Base (for example) - what are the best ways to sort and display the most relevant answers to a users' question? Would you use additional data such as keyword weighting based on whether previous users found the article of help, or do you find a simple keyword matchin...
When developing a database of articles for a Knowledge Base, sorting and displaying the most relevant answers to user questions is crucial for user experience and satisfaction. Here are several strategies and considerations to optimize the relevance of displayed articles: ### 1. **Keyword Matching Algorithms** - **...
16,692
[ { "from": "human", "value": "When developing a database of articles in a Knowledge Base (for example) - what are the best ways to sort and display the most relevant answers to a users' question?\nWould you use additional data such as keyword weighting based on whether previous users found the article of hel...
Every so often when I'm debugging, I get this message in nice brown text on an ASP.NET error page: Access to the path "c:\windows\microsoft.net\framework\(version)\Temporary ASP.NET Files\(blah)" is denied. I've never been able to figure out what causes it, what really fixes it, and why it happens. Often...
The "Access to the path ... is denied" error you are encountering in ASP.NET usually indicates a permissions issue related to the temporary files that ASP.NET uses during runtime. Here are some insights into what might be causing this issue, as well as some suggestions on how to fix it: ### Possible Causes 1. **Permi...
18,052
[ { "from": "human", "value": "Every so often when I'm debugging, I get this message in nice brown text on an ASP.NET error page:\n\nAccess to the path \n \"c:\\windows\\microsoft.net\\framework\\(version)\\Temporary ASP.NET Files\\(blah)\"\n is denied.\n\nI've never been able to figure out what cau...
is there a tomahawk component, that enables "scrollable tabs"? What I mean is something for the following situation: If I have very many tabs, the tab-bar gets a little arrow on the side to scroll through all the open tabs (like in firefox). Is there a tomahawk component for creating something similar?
As of my last knowledge update in October 2023, there isn't a specific "scrollable tabs" component provided by Tomahawk (a web framework). However, you can implement scrollable tabs using standard web development techniques, possibly utilizing libraries or custom CSS/JavaScript. ### Custom Scrollable Tabs Implementati...
15,444
[ { "from": "human", "value": "is there a tomahawk component, that enables \"scrollable tabs\"? What I mean is something for the following situation:\nIf I have very many tabs, the tab-bar gets a little arrow on the side to scroll through all the open tabs (like in firefox).\n\nIs there a tomahawk component f...
I am trying to use cvs annotate. This is the what I run: cvs -d /mycvs/cvsroot/ annotate "projects/dg/SomeClass.java" However, I get the following error: cvs annotate: failed to create lock directory for `/mycvs/cvsroot/projects/dg^M' (/mycvs/cvsroot/projects/dg^M/#cvs.lock): No such file or directory cvs annotate: fa...
The `^M` character you see in the error message typically represents a carriage return (CR) character, which is often added when files are edited on Windows systems and then used on Unix-based systems like CentOS. This can cause issues with command-line tools like CVS, which do not expect these characters in directory ...
17,823
[ { "from": "human", "value": "I am trying to use cvs annotate. This is the what I run:\ncvs -d /mycvs/cvsroot/ annotate \"projects/dg/SomeClass.java\"\n\nHowever, I get the following error:\ncvs annotate: failed to create lock directory for `/mycvs/cvsroot/projects/dg^M' (/mycvs/cvsroot/projects/dg^M/#cvs.lo...
I'm curious to know how people are using table aliases. The other developers where I work always use table aliases, and always use the alias of a, b, c, etc. Here's an example: SELECT a.TripNum, b.SegmentNum, b.StopNum, b.ArrivalTime FROM Trip a, Segment b WHERE a.TripNum = b.TripNum I disagree with them, and think t...
Your approach to using table aliases is quite reasonable and aligns with many best practices in SQL. Table aliases can enhance query readability and manageability, but how they are applied can vary based on project standards, team preferences, or specific use cases. Let's discuss both perspectives on using table aliase...
19,910
[ { "from": "human", "value": "I'm curious to know how people are using table aliases. The other developers where I work always use table aliases, and always use the alias of a, b, c, etc.\nHere's an example:\nSELECT a.TripNum, b.SegmentNum, b.StopNum, b.ArrivalTime\nFROM Trip a, Segment b\nWHERE a.TripNum =...
How is it possible to read/write to the Windows registry using Java?
Reading from and writing to the Windows registry in Java is not supported directly by the standard Java API. However, you can achieve this by using the Java Native Interface (JNI) to call native Windows API functions or by utilizing third-party libraries that provide this functionality. Below are a couple of approaches...
3,486
[ { "from": "human", "value": "How is it possible to read/write to the Windows registry using Java?\n" }, { "from": "gpt", "value": "Reading from and writing to the Windows registry in Java is not supported directly by the standard Java API. However, you can achieve this by using the Java Native I...
Is there some simple way to calculate a Weeknumber value from a date value stored in XML? It needs to be pure XSLT solution. I cannot use any code :(
Certainly! In XSLT, you can calculate the week number from a date value using built-in functions. To calculate the week number based on ISO 8601 (where weeks start on Monday), you can follow the method described below. Assuming you have a date in the format "YYYY-MM-DD" stored in an XML element, here’s a basic outline...
18,204
[ { "from": "human", "value": "Is there some simple way to calculate a Weeknumber value from a date value stored in XML?\nIt needs to be pure XSLT solution. I cannot use any code :(\n" }, { "from": "gpt", "value": "Certainly! In XSLT, you can calculate the week number from a date value using built...
Odd behavior loading emacs on ubuntu, there seems to be some initialization that goes on that is not in the .emacs nor in any of the files emacs reports loading through "emacs --debug-init". I've found some references to font-related resizing but this behavior doesn't seem to be limited to that (e.g reappearing menus a...
Emacs has a multi-step initialization process that can sometimes lead to unexpected behavior if you're not familiar with where all the configuration files are loaded from. Here’s a breakdown of how Emacs initializes and where it looks for configuration files. ### Emacs Initialization Process 1. **System-wide Configur...
17,719
[ { "from": "human", "value": "Odd behavior loading emacs on ubuntu, there seems to be some initialization that goes on that is not in the .emacs nor in any of the files emacs reports loading through \"emacs --debug-init\". I've found some references to font-related resizing but this behavior doesn't seem to ...
I use K2 as my workflow engine. For some reason my processes are not available in any of the reporting views (on the workspace). Do I have to do something special when deploying to get them there?
In K2, if your processes are not appearing in the reporting views after deployment, there are several steps and considerations you should check to ensure they show up correctly: 1. **Deployment Confirmation**: Make sure that the processes were deployed successfully. Check the deployment logs in K2 Management to see if...
19,883
[ { "from": "human", "value": "I use K2 as my workflow engine. For some reason my processes are not available in any of the reporting views (on the workspace). Do I have to do something special when deploying to get them there?\n" }, { "from": "gpt", "value": "In K2, if your processes are not appe...
Where is the location of my oracle event log (on a default Linux installation)?
On a default Linux installation of Oracle Database, the event log files can typically be found in the following directory structure: ``` /u01/app/oracle/diag/rdbms/<database_name>/<instance_name>/trace ``` Here's a breakdown of the components: - **/u01/app/oracle**: This is the default base directory for Oracle inst...
19,184
[ { "from": "human", "value": "Where is the location of my oracle event log (on a default Linux installation)?\n" }, { "from": "gpt", "value": "On a default Linux installation of Oracle Database, the event log files can typically be found in the following directory structure:\n\n```\n/u01/app/orac...
I understand that this could be a big security issue if people manage to hack it and able to view the server logs. Is there any application that can actually grab logs and display via web interface with the necessary security imposed? I am talking about java enterprise application
Yes, there are several Java-based enterprise applications that can help you collect, manage, and display server logs with security features in place. Here are a few options you might consider: 1. **ELK Stack (Elasticsearch, Logstash, Kibana)**: - **Logstash** is used for collecting and processing logs. - **Elast...
13,050
[ { "from": "human", "value": "I understand that this could be a big security issue if people manage to hack it and able to view the server logs.\nIs there any application that can actually grab logs and display via web interface with the necessary security imposed? I am talking about java enterprise applicat...
Suppose I have a non-recurring event that needs to be raised X seconds from now such as a timeout. Intuitively it would make sense to create a System.Timers.Timer, set its interval to X*1000, wire its tick up to the event and start it. Since this is a non-recurring event and you only want it raised once you would the...
Using `System.Timers.Timer` to handle a non-recurring event, such as a timeout, is indeed a common practice in .NET, and it can be done safely even though `Timer` is designed to support recurring events. Here are the pros and cons of each approach you mentioned: ### Approach 1: Using `System.Timers.Timer` 1. **Implem...
16,734
[ { "from": "human", "value": "Suppose I have a non-recurring event that needs to be raised X seconds from now such as a timeout. Intuitively it would make sense to create a System.Timers.Timer, set its interval to X*1000, wire its tick up to the event and start it. Since this is a non-recurring event and y...
I use NHibernate for my dataacess, and for awhile not I've been using SQLite for local integration tests. I've been using a file, but I thought I would out the :memory: option. When I fire up any of the integration tests, the database seems to be created (NHibernate spits out the table creation sql) but interfacting ...
Using NHibernate with an in-memory SQLite database can be a bit tricky due to how SQLite handles the in-memory databases. The main issue is that each connection to an in-memory database is isolated, meaning if you open a new connection, it won't have access to the tables created in previous connections. This can cause ...
17,707
[ { "from": "human", "value": "I use NHibernate for my dataacess, and for awhile not I've been using SQLite for local integration tests. I've been using a file, but I thought I would out the :memory: option. When I fire up any of the integration tests, the database seems to be created (NHibernate spits out ...
Is there any free software tool or combination that allows me to identify the pitch of a recorded singing session? The idea is to display some kind of graph with the current pitch in a time line along with markers for the standard notes (C3, C#3, D, etc). I don't need pitch correction and I don't need it to be done in ...
Yes, there are several free software tools and combinations that can help you analyze the pitch of recorded singing sessions and visualize it alongside standard musical notes. Here are a few options: 1. **Audacity**: This is a popular free audio editing software that can be used to record and analyze audio. While it d...
17,069
[ { "from": "human", "value": "Is there any free software tool or combination that allows me to identify the pitch of a recorded singing session?\nThe idea is to display some kind of graph with the current pitch in a time line along with markers for the standard notes (C3, C#3, D, etc). I don't need pitch cor...
In SQL Server 2005, is there a way for a trigger to find out what object is responsible for firing the trigger? I would like to use this to disable the trigger for one stored procedure. Is there any other way to disable the trigger only for the current transaction? I could use the following code, but if I'm not mistake...
In SQL Server, there isn't a direct way to determine which object (stored procedure, function, etc.) has fired a trigger. However, you can use a workaround to achieve a similar effect. ### Option 1: Use a Context Info You can set a context information value before calling your stored procedure and then check that val...
15,764
[ { "from": "human", "value": "In SQL Server 2005, is there a way for a trigger to find out what object is responsible for firing the trigger? I would like to use this to disable the trigger for one stored procedure.\nIs there any other way to disable the trigger only for the current transaction? I could use ...
I was previously taught today how to set parameters in a SQL query in .NET in this answer (click). Using parameters with values are fine, but when I try to set a field in the database to null I'm unsuccessful. Either the method thinks I am not setting a valid parameter or not specifying a parameter. e.g. Dim dc As New ...
When setting a parameter to `NULL` in a SQL command using ADO.NET in .NET, you need to ensure that you correctly specify the type of the parameter as well. In your code snippet, when you're attempting to add a parameter with a value of `Nothing`, it might not be interpreted correctly as a `DBNull` value, which is what ...
19,819
[ { "from": "human", "value": "I was previously taught today how to set parameters in a SQL query in .NET in this answer (click).\nUsing parameters with values are fine, but when I try to set a field in the database to null I'm unsuccessful. Either the method thinks I am not setting a valid parameter or not s...
I am trying to set myself up on a mac to learn Ruby on Rails, however I seem to be having some problems. If I try to run commands such as ./script/server, i get this: Rails requires RubyGems >= 0.9.4 (you have 0.9.2). Please gem update --system and try again. When I run "gem update.." I get this: Updating RubyGems....
It looks like you're running into a couple of issues with your Ruby and RubyGems installation on macOS. Here's a step-by-step guide to help you resolve them and get set up for Ruby on Rails development. ### Step 1: Check Your Ruby Environment First, check which version of Ruby you are using and where it's installed: ...
19,936
[ { "from": "human", "value": "I am trying to set myself up on a mac to learn Ruby on Rails, however I seem to be having some problems. If I try to run commands such as ./script/server, i get this: \n\nRails requires RubyGems >= 0.9.4 (you have 0.9.2). Please gem update --system and try again.\n\nWhen I run \...
Just that, if you embed an icon: [Embed(source='icons/checkmark.png')] private static var CheckMark:Class; You end up with a dynamic class. You can pretty easily assign the icon to a button at runtime by calling the setStyle method: var btn:Button = new Button(); btn.setStyle("icon", CheckMark); But what if you wante...
To modify an embedded icon at runtime in ActionScript (assuming you are using Flex or Flash), you can create an instance of the embedded icon class, apply your transformations (like altering the alpha value or redrawing pixels), and then assign that instance to the button. Here's how you can do it: 1. **Create an inst...
16,908
[ { "from": "human", "value": "Just that, if you embed an icon:\n[Embed(source='icons/checkmark.png')]\nprivate static var CheckMark:Class;\n\nYou end up with a dynamic class. You can pretty easily assign the icon to a button at runtime by calling the setStyle method:\nvar btn:Button = new Button();\nbtn.setS...
What's the best way to break from nested loops in Javascript? //Write the links to the page. for (var x = 0; x < Args.length; x++) { for (var Heading in Navigation.Headings) { for (var Item in Navigation.Headings[Heading]) { if (Args[x] == Navigation.Headings[Heading][Item].Name) { ...
To break out of nested loops in JavaScript, you can use a few strategies. The most common approaches include using flags, throwing exceptions, or utilizing the `break` statement in combination with labeled statements. Below are a few different methods you can employ, with an explanation of each. ### 1. Using Labeled S...
16,346
[ { "from": "human", "value": "What's the best way to break from nested loops in Javascript?\n//Write the links to the page.\nfor (var x = 0; x < Args.length; x++)\n{\n for (var Heading in Navigation.Headings)\n {\n for (var Item in Navigation.Headings[Heading])\n {\n if (Args[x] == Navi...
As far as variable naming conventions go, should iterators be named i or something more semantic like count? If you don't use i, why not? If you feel that i is acceptable, are there cases of iteration where it shouldn't be used?
Variable naming conventions can significantly influence code readability and maintainability. When it comes to naming iterators, there are arguments for both using `i` (or other single-letter names) and opting for more descriptive names like `count` or `index`. ### Using `i` as an Iterator 1. **Simplicity**: In many ...
14,880
[ { "from": "human", "value": "As far as variable naming conventions go, should iterators be named i or something more semantic like count? If you don't use i, why not? If you feel that i is acceptable, are there cases of iteration where it shouldn't be used?\n" }, { "from": "gpt", "value": "Varia...
I just saw Ayende's post today about PostSharp. I downloaded the code and tried it out, and I thought it was the coolest, most easy to use way to handle AOP that I've seen. In his post, Ayende says that PostSharp accomplishes it's magic via IL Weaving. Now, at some abstract level I can deduce what that means, but I wa...
IL Weaving is a technique used primarily in .NET to modify Intermediate Language (IL) code after it has been compiled from source code, but before it is executed. This allows developers to inject additional behavior into existing code without modifying the source code directly. It is commonly used in Aspect-Oriented Pr...
17,781
[ { "from": "human", "value": "I just saw Ayende's post today about PostSharp. I downloaded the code and tried it out, and I thought it was the coolest, most easy to use way to handle AOP that I've seen. \nIn his post, Ayende says that PostSharp accomplishes it's magic via IL Weaving. Now, at some abstract le...
I'm trying to redirect/forward a Pylons request. The problem with using redirect_to is that form data gets dropped. I need to keep the POST form data intact as well as all request headers. Is there a simple way to do this?
In web applications, redirecting a request while preserving the original request's POST data and headers isn't straightforward, as standard HTTP redirects (like those done with a `302` status code) do not retain the original request data. However, there are a few methods you can consider to achieve similar functionalit...
18,453
[ { "from": "human", "value": "I'm trying to redirect/forward a Pylons request. The problem with using redirect_to is that form data gets dropped. I need to keep the POST form data intact as well as all request headers.\nIs there a simple way to do this?\n" }, { "from": "gpt", "value": "In web a...
At work I am responsible for writing specifications quite often and I am also the person who insisted on getting specifications in the first place. The problem is I am unsure how specifications should look and what they should contain. A lot of the time when my boss is writing the specifications (we are both inexperien...
Writing effective specifications is an essential skill in any technical environment, especially when developing software like web applications. A good specification should serve as a clear guide for developers and stakeholders, outlining the requirements and expectations of the project. Here are some steps to help you ...
13,320
[ { "from": "human", "value": "At work I am responsible for writing specifications quite often and I am also the person who insisted on getting specifications in the first place. The problem is I am unsure how specifications should look and what they should contain. A lot of the time when my boss is writing t...
I'm interested in tracing database calls made by LINQ to SQL back to the .NET code that generated the call. For instance, a DBA might have a concern that a particular cached execution plan is doing poorly. If for example a DBA were to tell a developer to address the following code... exec sp_executesql N'SELECT [t0].[C...
To trace LINQ to SQL queries back to the original C# code that generated them, especially in a large application, you can use a couple of strategies. Unfortunately, LINQ to SQL does not natively support attaching metadata such as an ID or label directly in the generated SQL. However, there are some workarounds that cou...
16,296
[ { "from": "human", "value": "I'm interested in tracing database calls made by LINQ to SQL back to the .NET code that generated the call. For instance, a DBA might have a concern that a particular cached execution plan is doing poorly. If for example a DBA were to tell a developer to address the following co...
When running command-line queries in MySQL you can optionally use '\G' as a statement terminator, and instead of the result set columns being listed horizontally across the screen, it will list each column vertically, which the corresponding data to the right. Is there a way to the same or a similar thing with the DB2 ...
In the DB2 command line interface (CLI), there isn't a direct equivalent to MySQL's `\G` option for formatting query results vertically. However, you can achieve a similar effect by using the `FORMAT` option available in the DB2 CLI or by leveraging the SQL statements and the `db2` command line options. Here are a cou...
18,940
[ { "from": "human", "value": "When running command-line queries in MySQL you can optionally use '\\G' as a statement terminator, and instead of the result set columns being listed horizontally across the screen, it will list each column vertically, which the corresponding data to the right. Is there a way to...
Is there an iSeries command to export the data in a table to CSV format? I know about the Windows utilities, but since this needs to be run automatically I need to run this from a CL program.
Yes, you can export data from a table to CSV format in an IBM i (iSeries) environment using SQL and a CL program. One common approach is to use the `RUNSQL` command in a CL program to run an SQL query that selects the data and writes it to a file in CSV format. Here’s a basic outline of the steps involved: 1. **Creat...
17,017
[ { "from": "human", "value": "Is there an iSeries command to export the data in a table to CSV format?\nI know about the Windows utilities, but since this needs to be run automatically I need to run this from a CL program.\n" }, { "from": "gpt", "value": "Yes, you can export data from a table to ...
There are so many little options and settings within Microsoft Visual Studio. Which adjustments do you recommend to others?
Microsoft Visual Studio is a powerful IDE, and there are several settings and adjustments you can make to optimize your development experience. Here are some recommendations: ### General Settings 1. **Theme Customization**: - Choose a theme that’s easy on your eyes. Light and Dark themes are popular, but you can fi...
17,538
[ { "from": "human", "value": "There are so many little options and settings within Microsoft Visual Studio. Which adjustments do you recommend to others?\n" }, { "from": "gpt", "value": "Microsoft Visual Studio is a powerful IDE, and there are several settings and adjustments you can make to opti...