instruction
stringlengths
14
27.6k
completion
stringlengths
3
38.3k
__original_row_idx
int64
0
50k
conversations
listlengths
2
2
I have a pure Winapi application that needs a few new features. One of them would best be implemented as two lists where you can drag-and-drop (multiple) elements between the lists. The new feature can be limited to a single dialog. What would be the quickest way to implement this? A few ideas: Pure Winapi (is it Dete...
Implementing drag-and-drop functionality for two lists in a pure WinAPI application can be a bit complex due to the low-level nature of the WinAPI, but it is certainly achievable. Here's a rundown of your options, along with recommendations: ### Option 1: Pure WinAPI You can implement drag-and-drop using the `WM_LBUTT...
17,626
[ { "from": "human", "value": "I have a pure Winapi application that needs a few new features. One of them would best be implemented as two lists where you can drag-and-drop (multiple) elements between the lists. The new feature can be limited to a single dialog.\nWhat would be the quickest way to implement t...
After being troubled by an issue that I simply did not have the knowledge to debug, I've just decided that I have to learn how to use Windbg. My only problem: I have no clue where to start :-( I'm not really a WinApi-Guy, having use languages that abstract the Windows Api away from me usually. So I just wonder: What is...
Learning WinDbg can be a bit daunting at first, especially if you're not familiar with the Windows API or low-level programming concepts. However, there are some excellent resources available to help you get started. Here are some recommendations: ### Books: 1. **"Debugging Windows Drivers" by Daniel P. Bovet and Marc...
11,724
[ { "from": "human", "value": "After being troubled by an issue that I simply did not have the knowledge to debug, I've just decided that I have to learn how to use Windbg. My only problem: I have no clue where to start :-( I'm not really a WinApi-Guy, having use languages that abstract the Windows Api away f...
I read this article and try to do the exercise in D Programming Language, but encounter a problem in the first exercise. (1) Display series of numbers (1,2,3,4, 5....etc) in an infinite loop. The program should quit if someone hits a specific key (Say ESCAPE key). Of course the infinite loop is not a big prob...
To achieve your goal of displaying an infinite series of numbers until a specific key (like the ESCAPE key) is pressed, you'll need to handle keyboard input without relying on libraries that are not universally available. Here's a general approach using D's standard libraries. 1. **Use the standard input:** You can ru...
15,176
[ { "from": "human", "value": "I read this article and try to do the exercise in D Programming Language, but encounter a problem in the first exercise.\n\n(1) Display series of numbers\n (1,2,3,4, 5....etc) in an infinite\n loop. The program should quit if\n someone hits a specific key (Say\n ESCAPE key)....
I am developing a web application using Struts 2.1.2 and Hibernate 3.2.6.GA. I have an entity, User, which I have mapped to a table USERS in the DB using Hibernate. I want to have an image associated with this entity, which I plan to store as a BLOB in the DB. I also want to display the image on a webpage along with ot...
Your proposed solution for storing and displaying images in your web application using Struts and Hibernate is a common approach and can work effectively. Here's a breakdown of your approach and some suggestions for improvement: ### Proposed Approach 1. **Database Design**: Having a separate table for images (IMAGES)...
15,485
[ { "from": "human", "value": "I am developing a web application using Struts 2.1.2 and Hibernate 3.2.6.GA. I have an entity, User, which I have mapped to a table USERS in the DB using Hibernate. I want to have an image associated with this entity, which I plan to store as a BLOB in the DB. I also want to dis...
Is it possible to enumerate all the current errors being displayed through an "Error Provider" without having to access the controls?
In a Windows Forms application using an `ErrorProvider`, you can enumerate the current errors displayed by the `ErrorProvider` without directly accessing the controls that the errors are associated with. While the `ErrorProvider` does not provide a built-in method to enumerate errors directly, you can maintain a custom...
12,779
[ { "from": "human", "value": "Is it possible to enumerate all the current errors being displayed through an \"Error Provider\" without having to access the controls?\n" }, { "from": "gpt", "value": "In a Windows Forms application using an `ErrorProvider`, you can enumerate the current errors disp...
How can I list all the types that are declared by a module in Ruby?
In Ruby, you can list all the types (classes and modules) declared within a module by using the `constants` method along with the `const_get` method to retrieve the actual classes or modules. Here’s a general approach to achieve this: 1. **Use the `constants` method**: This method returns an array of all the constants...
19,595
[ { "from": "human", "value": "How can I list all the types that are declared by a module in Ruby?\n" }, { "from": "gpt", "value": "In Ruby, you can list all the types (classes and modules) declared within a module by using the `constants` method along with the `const_get` method to retrieve the a...
If I have a subclass that has yet to implement a function provided by the base class, I can override that function and have it throw a NotSupportedException. Is there a way to generate a compile-time error for this to avoid only hitting this at runtime? Update: I can't make the base class abstract.
If you have a base class that provides a method that you expect subclasses to implement, but cannot make the base class abstract, you can still enforce that the subclasses provide their own implementation of the method using an approach involving interfaces and compile-time checks. Since you cannot change the base cla...
18,256
[ { "from": "human", "value": "If I have a subclass that has yet to implement a function provided by the base class, I can override that function and have it throw a NotSupportedException. Is there a way to generate a compile-time error for this to avoid only hitting this at runtime?\nUpdate: I can't make th...
I'm helping a customer who has a problem with a flash app. The flash app uses an XMLSocket to connect to a service running on localhost. It works fine under firefox. It uses the following line to setup the security policy: System.security.loadPolicyFile("xmlsocket://localhost:10032"); Running the flash app under firef...
It looks like you've identified the main issue affecting the Flash application when running in Internet Explorer. The behavior you described regarding the hidden `<div>` tag is consistent with Flash's security model and how it handles policy file requests. In Flash Player, security restrictions are quite strict, espec...
19,557
[ { "from": "human", "value": "I'm helping a customer who has a problem with a flash app. The flash app uses an XMLSocket to connect to a service running on localhost. It works fine under firefox. \nIt uses the following line to setup the security policy:\nSystem.security.loadPolicyFile(\"xmlsocket://localhos...
What is the best method for displaying major/minor versions in a C# console application? The System.Windows.Forms namespace includes a ProductVersion class that can be used to display the name/version information set via the Visual Studio project properties (Assembly Information). As such, here is my current mechanism:...
Using `System.Windows.Forms.Application` to retrieve product name and version in a console application is somewhat unconventional, as it is primarily designed for Windows Forms applications. However, it's not inherently wrong. That said, using it in a console application can introduce unnecessary dependencies, especial...
20,137
[ { "from": "human", "value": "What is the best method for displaying major/minor versions in a C# console application?\nThe System.Windows.Forms namespace includes a ProductVersion class that can be used to display the name/version information set via the Visual Studio project properties (Assembly Informatio...
I'm working in .Net 3.5sp1 in C# for an ASP.Net solution and I'm wondering if there's any way to turn on the Class Name and Method Name drop-downs in the text editor that VB.Net has at the top. It's one of the few things from VB that I actually miss. Edit: Also, is there any way to get the drop downs to be populated wi...
In C# for Visual Studio, while you won't find the exact same drop-down functionality as in VB.NET at the top of the code editor, you can access similar functionality through the **"IntelliSense"** features and the **"Document Outline"** window. ### Accessing Class Name and Method Name Dropdowns in C# 1. **Using the D...
16,947
[ { "from": "human", "value": "I'm working in .Net 3.5sp1 in C# for an ASP.Net solution and I'm wondering if there's any way to turn on the Class Name and Method Name drop-downs in the text editor that VB.Net has at the top. It's one of the few things from VB that I actually miss.\nEdit: Also, is there any wa...
My dad always says "Responsibility without Authority is meaningless". However, I find that as developers, we get stuck in situations all the time where we are: Responsible for ensuring the software is "bug free", but don't have the authority to implement a bug tracking system Responsible for hitting project deadlines,...
You're absolutely right that the tension between responsibility and authority can be frustrating, especially in software development environments. Here are some technical solutions and strategies that can empower you and your team, providing data and insights to help address challenges related to bugs and project deadl...
14,697
[ { "from": "human", "value": "My dad always says \"Responsibility without Authority is meaningless\".\nHowever, I find that as developers, we get stuck in situations all the time where we are:\n\nResponsible for ensuring the software is \"bug free\", but don't have the authority to implement a bug tracking s...
Has anybody attempted to pass a VBA (or VB6) function (via AddressOf ?) to the SQLite create a UDF function (http://www.sqlite.org/c3ref/create_function.html). How would the resulting callback arguments be handled by VBA? The function to be called would have the following signature... void (xFunc)(sqlite3_context,int...
To use a VBA (or VB6) function as a user-defined function (UDF) in SQLite by passing it via the `AddressOf` operator, you face a significant challenge. The main issue is that VBA/VB6 functions do not directly match the expected C function signature used by SQLite, and therefore, direct interoperability is not straightf...
13,469
[ { "from": "human", "value": "Has anybody attempted to pass a VBA (or VB6) function (via AddressOf ?) to the SQLite create a UDF function (http://www.sqlite.org/c3ref/create_function.html). \nHow would the resulting callback arguments be handled by VBA?\nThe function to be called would have the following si...
MySQL 5.0.45 What is the syntax to alter a table to allow a column to be null, alternately what's wrong with this: ALTER mytable MODIFY mycolumn varchar(255) null; I interpreted the manual as just run the above and it would recreate the column, this time allowing null. The server is telling me I have syntactical erro...
The syntax you are using to modify a column in MySQL is generally correct, but it's possible that the issue lies in how you are executing the command or the specific version of MySQL you are using. In MySQL, the correct syntax to alter a table and modify a column to allow `NULL` values is: ```sql ALTER TABLE mytable...
20,865
[ { "from": "human", "value": "MySQL 5.0.45\nWhat is the syntax to alter a table to allow a column to be null, alternately what's wrong with this:\nALTER mytable MODIFY mycolumn varchar(255) null;\n\nI interpreted the manual as just run the above and it would recreate the column, this time allowing null. The...
If I want to call Bar() instead of Foo(), does Bar() return me a copy (additional overhead) of what Foo() returns, or it returns the same object which Foo() places on the temporary stack? vector<int> Foo(){ vector<int> result; result.push_back(1); return result; } vector<int> Bar(){ return F...
When you call `Bar()`, it invokes `Foo()`, which returns a `vector<int>`. In C++, when a function returns an object by value (like `vector<int>` in this case), a few key concepts related to copy elision and move semantics come into play. Here's what happens in your scenario: 1. **Return by Value**: In `Foo()`, you cr...
19,141
[ { "from": "human", "value": "If I want to call Bar() instead of Foo(), does Bar() return me a copy (additional overhead) of what Foo() returns, or it returns the same object which Foo() places on the temporary stack?\nvector<int> Foo(){ \n vector<int> result; \n result.push_back(1); \n return re...
At my workplace, the traffic blocker/firewall has been getting progressively worse. I can't connect to my home machine on port 22, and lack of ssh access makes me sad. I was previously able to use SSH by moving it to port 5050, but I think some recent filters now treat this traffic as IM and redirect it through anoth...
Given the constraints and issues you're facing, here are some potential solutions that might help you bypass the restrictions while maintaining your SSH access over HTTPS. ### 1. SSH over WebSockets If you have the ability to run a web server on your home machine, you can set up a WebSocket proxy for SSH. This way, y...
19,055
[ { "from": "human", "value": "At my workplace, the traffic blocker/firewall has been getting progressively worse. I can't connect to my home machine on port 22, and lack of ssh access makes me sad. I was previously able to use SSH by moving it to port 5050, but I think some recent filters now treat this tr...
Why am I getting a textbox that returns undefined list of variables? When I run this code: var query = (from tisa in db.TA_Info_Step_Archives where tisa.ta_Serial.ToString().StartsWith(prefixText) select tisa.TA_Serial.ToString()).Distinct().Take(Convert.ToInt32(count)); return query....
It seems like you're trying to populate a textbox (likely in a web application) with values returned from a query to a database, but you're encountering an issue where the textbox is returning "undefined" instead of the expected values. Here are several possible reasons and solutions for this issue: ### 1. Data Bindi...
17,303
[ { "from": "human", "value": "Why am I getting a textbox that returns undefined list of variables?\nWhen I run this code:\nvar query = (from tisa in db.TA_Info_Step_Archives\n where tisa.ta_Serial.ToString().StartsWith(prefixText)\n select tisa.TA_Serial.ToString()).Distinct()...
I'm writing a web application that I want to be able to use forms authentication pointing to a SQL database, or use integrated authentication in different installations of the web app. I'm authenticating users just fine with either provider but I have a question on how to architect my database. Currently what I'm doin...
You're on the right track by considering a unified architecture for managing user identities in a way that accommodates both forms authentication and integrated Windows authentication. Having a proper structure for users in your database will make it much easier to manage user data across different authentication metho...
11,945
[ { "from": "human", "value": "I'm writing a web application that I want to be able to use forms authentication pointing to a SQL database, or use integrated authentication in different installations of the web app. I'm authenticating users just fine with either provider but I have a question on how to archi...
I am encountering a problem: On an html page, when i click a certain control (a tab panel title) i make an ajax call. From Wicket (java code) i call a javascript function that "redraws" all the componenets on my page (this is like a reload of the page). Everytime i do this i get a flickering effect on the html (which...
The flickering effect you're experiencing when redrawing components on your page is likely due to the way the DOM elements are being manipulated in response to your AJAX call and the subsequent redrawing process. Here are several strategies you could consider to reduce or eliminate the flickering effect: ### 1. Optimi...
17,554
[ { "from": "human", "value": "I am encountering a problem: \nOn an html page, when i click a certain control (a tab panel title) i make an ajax call. \nFrom Wicket (java code) i call a javascript function that \"redraws\" all the componenets on my page (this is like a reload of the page). Everytime i do this...
I might be starting a new project in .NET soon, and would prefer not to use an XML-based build tool like Nant or MSBuild. I like Rake, but I'm thinking it may be better to have something based on a .NET dynamic language (such as Boo), similar in spirit to gant or BuildR for Java. Is there such a thing for .NET? If not,...
While there isn't a direct equivalent to Rake or Gant that's widely adopted in the .NET ecosystem, there are a few options you might consider that align more closely with your preferences for a dynamic language-based build tool. ### 1. **FAKE (F# Make)** FAKE is a build automation system that is based on F# and integ...
16,666
[ { "from": "human", "value": "I might be starting a new project in .NET soon, and would prefer not to use an XML-based build tool like Nant or MSBuild. I like Rake, but I'm thinking it may be better to have something based on a .NET dynamic language (such as Boo), similar in spirit to gant or BuildR for Java...
What is Big O notation? Do you use it? I missed this university class I guess :D Does anyone use it and give some real life examples of where they used it? See also: Big-O for Eight Year Olds? Big O, how do you calculate/approximate it? Did you apply computational complexity theory in real life?
### What is Big O Notation? Big O notation is a mathematical concept used in computer science to describe the performance or complexity of an algorithm in terms of time (time complexity) or space (space complexity). It provides an upper limit on the growth rate of an algorithm's running time or memory usage as the siz...
12,128
[ { "from": "human", "value": "What is Big O notation? Do you use it?\nI missed this university class I guess :D\nDoes anyone use it and give some real life examples of where they used it?\n\nSee also:\nBig-O for Eight Year Olds?\nBig O, how do you calculate/approximate it?\nDid you apply computational comple...
My app uses a WebRequest at certain points to get pages from itself. This shouldn't be a problem. It actually works fine on the server, which is a "shared" hosting package with Medium trust. Locally, I use a custom security policy based on Medium trust, which includes the following — copied straight from the default ...
The issue you're encountering seems to be related to the `WebPermission` and how it restricts access based on the environment and the specific URI being requested. Here are a few things you could consider to resolve this issue: 1. **Verify the URI**: Ensure that the URI being passed to the `GetEntity` method is indeed...
13,761
[ { "from": "human", "value": "My app uses a WebRequest at certain points to get pages from itself.\nThis shouldn't be a problem. It actually works fine on the server, which is a \"shared\" hosting package with Medium trust. Locally, I use a custom security policy based on Medium trust, which includes the f...
I'm working on a Linux based server system in which there are two network interfaces, both on the same subnet (for now, lets just say they are 172.17.32.10 & 172.17.32.11). When I send data to a host on the network, I would like to specify which interface on my server the data is transmitted on. I need to be able to ...
To achieve your goal of specifying which network interface to use for outbound traffic on a Linux-based server, you have a few options aside from using the netlink library to modify routing rules. Here are some alternatives: ### 1. **Binding Sockets to Specific Interfaces** One straightforward method is to bind your ...
16,202
[ { "from": "human", "value": "I'm working on a Linux based server system in which there are two network interfaces, both on the same subnet (for now, lets just say they are 172.17.32.10 & 172.17.32.11). When I send data to a host on the network, I would like to specify which interface on my server the data ...
I've written a small test application using the .Net FileSystemWatcher to keep an eye on a directory. When I copy a large-ish (a few Mb) file into that directory I get the following events listed (see screenshot - and ignore the Delete event to begin with). alt text http://robinwilson.homelinux.com/FSW.png I get a crea...
The behavior you're observing with the `FileSystemWatcher` is a common issue that many developers face when working with file events in .NET. When you copy a large file into a directory, the operating system generates multiple events as it writes the file to disk. Here's a breakdown of what's likely happening: 1. **Fi...
15,363
[ { "from": "human", "value": "I've written a small test application using the .Net FileSystemWatcher to keep an eye on a directory. When I copy a large-ish (a few Mb) file into that directory I get the following events listed (see screenshot - and ignore the Delete event to begin with).\nalt text http://robi...
I would like to implement a data access object pattern in C++, but preferably without using multiple inheritance and/or boost (which my client does not like). Do you have any suggestions?
Certainly! The Data Access Object (DAO) pattern is a structural design pattern that provides an abstract interface to a database or other persistence mechanism. The goal of a DAO is to separate the data access logic from the business logic, which makes your application easier to maintain and test. Here's a simplified ...
11,245
[ { "from": "human", "value": "I would like to implement a data access object pattern in C++, but preferably without using multiple inheritance and/or boost (which my client does not like). \nDo you have any suggestions?\n" }, { "from": "gpt", "value": "Certainly! The Data Access Object (DAO) patt...
How do I go from this string: "ThisIsMyCapsDelimitedString" ...to this string: "This Is My Caps Delimited String" Fewest lines of code in VB.net is preferred but C# is also welcome. Cheers!
You can achieve the desired transformation by using a regular expression to insert spaces before each uppercase letter (except for the first one). Here’s a concise solution in both VB.NET and C#: ### VB.NET ```vb.net Imports System.Text.RegularExpressions Module Module1 Sub Main() Dim input As String = "T...
20,832
[ { "from": "human", "value": "How do I go from this string: \"ThisIsMyCapsDelimitedString\"\n...to this string: \"This Is My Caps Delimited String\"\nFewest lines of code in VB.net is preferred but C# is also welcome.\nCheers!\n" }, { "from": "gpt", "value": "You can achieve the desired transform...
I just started experimenting with SVG in web pages, and I discovered that it is only possible to add SVG images into HTML using <object /> tags, not <img /> like I would have expected. Most of the time, I add graphics to web pages through CSS because they are part of the presentation of the site, not the content. I kno...
Yes, you can use CSS to add a vector image (SVG) to an HTML element without using the `<object>` or `<img>` tags directly. One common approach is to use the `background-image` property in CSS. Here’s how you can do it: ### Using `background-image` in CSS You can set an SVG as a background image for any HTML element u...
17,937
[ { "from": "human", "value": "I just started experimenting with SVG in web pages, and I discovered that it is only possible to add SVG images into HTML using <object /> tags, not <img /> like I would have expected. Most of the time, I add graphics to web pages through CSS because they are part of the present...
With .Net what is the best way to interact with a service (i.e. how do most tray-apps communicate with their servers). It would be preferred if this method would be cross-platform as well (working in Mono, so I guess remoting is out?) Edit: Forgot to mention, we still have to support Windows 2000 machines in the fiel...
Given your requirements for a cross-platform solution that works with .NET, Mono, and supports Windows 2000, you have a few viable options for inter-process communication (IPC) and communication with services. Since WCF and anything above .NET 2.0 won't work for you, here are some alternatives: ### 1. **HTTP/REST APIs...
4,475
[ { "from": "human", "value": "With .Net what is the best way to interact with a service (i.e. how do most tray-apps communicate with their servers). It would be preferred if this method would be cross-platform as well (working in Mono, so I guess remoting is out?)\n\nEdit:\nForgot to mention, we still have ...
Since arrays and hashes can only contain scalars in Perl, why do you have to use the $ to tell the interpreter that the value is a scalar when accessing array or hash elements? In other words, assuming you have an array @myarray and a hash %myhash, why do you need to do: $x = $myarray[1]; $y = $myhash{'foo'}; instead ...
In Perl, the reason you need to use the `$` symbol to indicate that you are accessing scalar values from arrays and hashes is due to Perl's context sensitivity and its distinction between different data types. Even though arrays and hashes themselves can only contain scalars, Perl uses sigils (the `$`, `@`, `%` symbols...
17,706
[ { "from": "human", "value": "Since arrays and hashes can only contain scalars in Perl, why do you have to use the $ to tell the interpreter that the value is a scalar when accessing array or hash elements? In other words, assuming you have an array @myarray and a hash %myhash, why do you need to do:\n$x = $...
Something like var life= { users : { guys : function(){ this.SOMETHING.mameAndDestroy(this.girls); }, girls : function(){ this.SOMETHING.kiss(this.boys); }, }, mameAndDestroy : function(group){ }, kiss : function(group){ } }; this.SOMETHING is what I imagine th...
In JavaScript, when you want to refer to the parent object from within a nested object or function, you can usually use the `this` keyword. However, if the context changes (like inside a function), `this` may not refer to the parent object as you might expect. In your example, if you want `this.SOMETHING` to referenc...
16,771
[ { "from": "human", "value": "Something like\nvar life= {\n users : {\n guys : function(){ this.SOMETHING.mameAndDestroy(this.girls); },\n girls : function(){ this.SOMETHING.kiss(this.boys); },\n },\n mameAndDestroy : function(group){ },\n kiss : function(g...
Giving a URL to the TOpenFileDialog, the Execute method throws an exception: OpenDialog1.Filename := 'http://www.osfi-bsif.gc.ca/app/DocRepository/1/eng/issues/terrorism/indstld_e.xls'; bResult := OpenDialog1.Execute; But you are allowed to open files from a URL. Delphi 5
In Delphi 5, the `TOpenFileDialog` component is primarily designed to open files from the local file system. When you attempt to set the `Filename` property to a URL, it will throw an exception because the dialog expects a local file path, not a URL. To open a file from a URL in Delphi 5, you need to download the file...
16,802
[ { "from": "human", "value": "Giving a URL to the TOpenFileDialog, the Execute method throws an exception:\nOpenDialog1.Filename := 'http://www.osfi-bsif.gc.ca/app/DocRepository/1/eng/issues/terrorism/indstld_e.xls';\nbResult := OpenDialog1.Execute;\n\nBut you are allowed to open files from a URL.\nDelphi 5\...
Is there a public/government web service that I can call to find out what the national holidays are for a given year? (For the US and/or any country in the world.) Edit: Does anybody have a set of formulas to calculate US holidays? (C# would be my language of choice if there is a choice.)
There are several ways to find out about national holidays for different countries, including web services and APIs. Here are a few options that you might find useful: ### Public APIs for National Holidays 1. **Calendarific**: This is a popular API that provides public holiday data for many countries, including the U...
6,763
[ { "from": "human", "value": "Is there a public/government web service that I can call to find out what the national holidays are for a given year? (For the US and/or any country in the world.)\nEdit: Does anybody have a set of formulas to calculate US holidays? (C# would be my language of choice if there is...
We have a large backlog of things we should do in our software, in a lot of different categories, for example: New problem areas for our products to solve New functionality supporting existing problem areas New functionality requested by our existing users Usability and "look" enhancements Architectural upgrades to t...
Managing a large backlog of tasks and requirements, particularly in a complex software environment, can indeed be a daunting task. Here’s a structured approach to help you prioritize effectively and ensure that you're always focusing on the most valuable items for your customers and business: ### 1. Centralize Informa...
10,539
[ { "from": "human", "value": "We have a large backlog of things we should do in our software, in a lot of different categories, for example:\n\nNew problem areas for our products to solve \nNew functionality supporting existing problem areas\nNew functionality requested by our existing users\nUsability and \...
I have a function that is effectively a replacement for print, and I want to call it without parentheses, just like calling print. # Replace print $foo, $bar, "\n"; # with myprint $foo, $bar, "\n"; In Perl, you can create subroutines with parameter templates and it allows exactly this behavior if you define a subrout...
In PHP, you cannot directly create a function that behaves like a language construct (such as `print`) and allows calling it without parentheses in the same way. PHP requires parentheses for function calls, and there isn't a built-in way to bypass this for user-defined functions. However, if you're looking to achieve ...
20,620
[ { "from": "human", "value": "I have a function that is effectively a replacement for print, and I want to call it without parentheses, just like calling print.\n# Replace\nprint $foo, $bar, \"\\n\";\n\n# with\nmyprint $foo, $bar, \"\\n\";\n\nIn Perl, you can create subroutines with parameter templates and i...
I want to generate some XML in a stored procedure based on data in a table. The following insert allows me to add many nodes but they have to be hard-coded or use variables (sql:variable): SET @MyXml.modify(' insert <myNode> {sql:variable("@MyVariable")} </myNode> into (/root[1...
Certainly! In SQL Server, you can combine the XML generation capabilities of `FOR XML` with the manipulation capabilities of `XML.modify()` to create an XML structure without the need for explicit looping. While `FOR XML` is excellent for creating XML directly from the query results, if you want to use `XML.modify()` ...
15,076
[ { "from": "human", "value": "I want to generate some XML in a stored procedure based on data in a table.\nThe following insert allows me to add many nodes but they have to be hard-coded or use variables (sql:variable):\nSET @MyXml.modify('\n insert\n <myNode>\n {sql:variable(\"@MyVar...
I want Windows Update to automatically download and install updates on my Vista machine, however I don't want to be bothered by the system tray reboot prompts (which can, at best, only be postponed by 4 hours). I have performed the registry hack described here to prevent Windows forcibly rebooting my machine, which is ...
On Windows Vista, there isn't a straightforward way to completely eliminate the reboot prompts after updates, as this is a built-in safety feature designed to ensure system stability and security. However, you can adjust certain settings to minimize the frequency and impact of these prompts. Here are a couple of appro...
19,339
[ { "from": "human", "value": "I want Windows Update to automatically download and install updates on my Vista machine, however I don't want to be bothered by the system tray reboot prompts (which can, at best, only be postponed by 4 hours).\nI have performed the registry hack described here to prevent Window...
I'm looking for a way to authenticate users through LDAP with PHP (with Active Directory being the provider). Ideally, it should be able to run on IIS 7 (adLDAP does it on Apache). Anyone had done anything similar, with success? Edit: I'd prefer a library/class with code that's ready to go... It'd be silly to invent t...
If you're looking to authenticate users against Active Directory using LDAP in PHP on IIS 7, you're in luck—there are libraries that can help you achieve this without needing to reinvent the wheel. Below are steps and a simple implementation using the `adLDAP` library, which you can use on any PHP environment, includin...
14,878
[ { "from": "human", "value": "I'm looking for a way to authenticate users through LDAP with PHP (with Active Directory being the provider). Ideally, it should be able to run on IIS 7 (adLDAP does it on Apache). Anyone had done anything similar, with success?\n\nEdit: I'd prefer a library/class with code that...
I am using the RSA Algorithm for encryption/decryption, and in order to decrypt the files you have to deal with some pretty big values. More specifically, things like P = C^d % n = 62^65 % 133 Now that is really the only calculations that ill be doing. I have tried using Matt McCutchen's BigInteger Library, but I a...
The errors you're encountering suggest that while you have included the header file for the `BigInteger` library, the necessary implementation file that contains the definitions for the `BigInteger` methods is not linked into your project. In C++, the declaration (in the header file) and the definition (in the correspo...
18,055
[ { "from": "human", "value": "I am using the RSA Algorithm for encryption/decryption, and in order to decrypt the files you have to deal with some pretty big values. More specifically, things like \nP = C^d % n\n = 62^65 % 133\n\nNow that is really the only calculations that ill be doing. I have tried using...
What is your preferred method for reading through the contents of zipped directories with Perl ?
To read through the contents of zipped directories in Perl, the preferred method is to use the `Archive::Zip` module, which provides a straightforward interface for handling ZIP files. Below is a step-by-step guide to reading the contents of a zipped directory using this module. ### Step 1: Install the Archive::Zip Mo...
18,492
[ { "from": "human", "value": "What is your preferred method for reading through the contents of zipped directories with Perl ?\n" }, { "from": "gpt", "value": "To read through the contents of zipped directories in Perl, the preferred method is to use the `Archive::Zip` module, which provides a st...
I despise the PHP language, and I'm quite certain that I'm not alone. But the great thing about PHP is the way that mod_php takes and hides the gory details of integrating with the apache runtime, and achieves CGI-like request isolation and decent performance. What's the shortest-distance approach to getting the same ...
If you're looking for a solution that provides the simplicity, speed, and isolation of PHP's runtime environment, but with Perl semantics, there are several approaches you can consider. Here are some options that might fit your needs: ### 1. **Mojolicious** Mojolicious is a modern web framework for Perl that is simple...
14,025
[ { "from": "human", "value": "I despise the PHP language, and I'm quite certain that I'm not alone. But the great thing about PHP is the way that mod_php takes and hides the gory details of integrating with the apache runtime, and achieves CGI-like request isolation and decent performance.\nWhat's the short...
We are beginning to go down the path of mobile browser support for an enterprise e-commerce webapp (Java/Servlet based). Of course there are many decisions to be made, but it seems to me the cornerstone is to be able to reliably detect mobile browsers, and make decisions on the content to be returned accordingly. Is ...
When adding mobile browser support to an existing enterprise e-commerce web application, detecting mobile browsers and their capabilities is indeed crucial. Here are some common strategies and best practices to accomplish this: ### 1. User-Agent Detection The most straightforward method for detecting mobile browsers i...
17,455
[ { "from": "human", "value": "We are beginning to go down the path of mobile browser support for an enterprise e-commerce webapp (Java/Servlet based). Of course there are many decisions to be made, but it seems to me the cornerstone is to be able to reliably detect mobile browsers, and make decisions on the...
I have some code where I'm returning an array of objects. Here's a simplified example: string[] GetTheStuff() { List<string> s = null; if( somePredicate() ) { s = new List<string>(); // imagine we load some data or something } return (s == null) ? new string[0] : s.ToArray(); } ...
In .NET, when you create a new array, even if it has zero elements, some memory is still allocated for the array object itself. Specifically, an array in .NET is a reference type, and its memory allocation includes a header for the array object, which contains information such as the array's length. The memory layout t...
19,928
[ { "from": "human", "value": "I have some code where I'm returning an array of objects.\nHere's a simplified example:\nstring[] GetTheStuff() {\n List<string> s = null;\n if( somePredicate() ) {\n s = new List<string>(); // imagine we load some data or something\n }\n return (s == null) ? ...
I'm writing by own blogging engine in PHP with a MYSQL backend database. MY question is: How would you go about making user comments and blog posts include newlines wherever they are appropriate? For example, if a user hits the return key in the message/comments box how would this translate into a new line that would s...
To achieve the desired behavior of translating newlines from user input into HTML line breaks in your PHP-based blogging engine, you can follow these steps: ### Step 1: Capture User Input When a user submits a comment or a blog post, you will receive that input via a form. Make sure that you're properly handling the i...
16,101
[ { "from": "human", "value": "I'm writing by own blogging engine in PHP with a MYSQL backend database. MY question is: How would you go about making user comments and blog posts include newlines wherever they are appropriate?\nFor example, if a user hits the return key in the message/comments box how would t...
Our network admins have disabled IMAP and POP for our exchange server, but do have RDP over HTTP enabled. Does Mac Mail only use IMAP to communicate with exchange servers, or does it also know how to use RDP over HTTP?
Mac Mail primarily communicates with Exchange servers using the Exchange ActiveSync (EAS) protocol or IMAP/SMTP for email services. It does not natively use RDP over HTTP for email access. RDP (Remote Desktop Protocol) is used for remote desktop services and is not applicable for email clients. If IMAP and POP are dis...
21,535
[ { "from": "human", "value": "Our network admins have disabled IMAP and POP for our exchange server, but do have RDP over HTTP enabled. Does Mac Mail only use IMAP to communicate with exchange servers, or does it also know how to use RDP over HTTP?\n" }, { "from": "gpt", "value": "Mac Mail prima...
The latest makefiles we've received from a third party vendor contain rules with --depend on the end of build rules, so I thought I would look it up on Google, but try as I might, I can't persuade it to display any pages with exactly the characters --depend I've tried surrounding it with quotes "--depend": I've tried t...
Searching for very specific text on Google can be tricky, especially with special characters like dashes. Here are a few techniques you can try to refine your search: 1. **Use Quotes**: You mentioned trying quotes, which is indeed the first step. Make sure you have the quotes around the exact phrase: `"--depend"`. 2....
19,858
[ { "from": "human", "value": "The latest makefiles we've received from a third party vendor contain rules with --depend on the end of build rules, so I thought I would look it up on Google, but try as I might, I can't persuade it to display any pages with exactly the characters --depend\nI've tried surroundi...
I want to be able to explore the contents of a DB for this version of the DB. I was thinking of using the Squirrel DB client (which needs a JDBC driver). Therefore, I'm looking for a JDBC type 4 driver for SQL SERVER 3.5. Can somone point me to a FREE OR open source or trial ware ? If no JDBC driver, how do MS develop...
To explore the contents of a SQL Server Compact Edition (SQL Server CE), specifically for `.sdf` files, you typically won't find a JDBC Type 4 driver since SQL Server CE is not designed to be accessed in the same way as full SQL Server instances. However, here are some alternatives you can consider: ### 1. Use SQL Ser...
18,992
[ { "from": "human", "value": "I want to be able to explore the contents of a DB for this version of the DB. I was thinking of using the Squirrel DB client (which needs a JDBC driver).\nTherefore, I'm looking for a JDBC type 4 driver for SQL SERVER 3.5. Can somone point me to a FREE OR open source or trial w...
I have little knowledge of Flash but for a little Flash game I have to store score and successful tries of users in a database using PHP. Now the Flash runs locally on the users computer and connects to a remote server. How can I secure against manipulation of game scores. Is there any best practice for this use case?
Storing scores and user data for a Flash game (or any web application) in a secure manner is critical to prevent cheating and manipulation. Here are some best practices you can follow: ### 1. Server-Side Validation Always perform validation on the server side when the Flash client sends data to the PHP script. Never t...
16,546
[ { "from": "human", "value": "I have little knowledge of Flash but for a little Flash game I have to store score and successful tries of users in a database using PHP. Now the Flash runs locally on the users computer and connects to a remote server. How can I secure against manipulation of game scores. Is th...
I get obsessed with the best names for arrays and variables that I use, I'll look up words in the thesaurus, dictionary, etc.. So I'm trying to name this array / structure: $nameMe = array( '392' => TRUE, '234' => TRUE, '754' => TRUE, '464' => TRUE, ); and it's used to check if that id has a certain pr...
Choosing effective names for arrays and variables is crucial for code readability and maintainability. You want your variable names to be descriptive yet concise. Here are a few strategies and suggestions for naming your specific array that checks for a property based on IDs: ### 1. **Use Contextual Shortcuts**: You c...
19,869
[ { "from": "human", "value": "I get obsessed with the best names for arrays and variables that I use, I'll look up words in the thesaurus, dictionary, etc..\nSo I'm trying to name this array / structure:\n$nameMe = array(\n '392' => TRUE,\n '234' => TRUE,\n '754' => TRUE,\n '464' => TRUE,\n);\n\n...
Can anyone recommend a good .NET based lexical analyser, preferably written in C#?
Certainly! If you're looking for a .NET-based lexical analyzer written in C#, here are a few options you might consider: 1. **ANTLR (Another Tool for Language Recognition)**: - ANTLR is a powerful parser generator that can be used to create lexers and parsers. While it's not exclusively a C# tool, it does support C...
18,752
[ { "from": "human", "value": "Can anyone recommend a good .NET based lexical analyser, preferably written in C#?\n" }, { "from": "gpt", "value": "Certainly! If you're looking for a .NET-based lexical analyzer written in C#, here are a few options you might consider:\n\n1. **ANTLR (Another Tool fo...
I've installed .NET Framework 3.5 SP1 on web server (Server 2008 Enterprise), so running IIS 7.0. I want to change the version of .NET Framework used by an existing site. So I right-click on appropriate Application Pool and selected Edit Application Pool. The .NET Framework dropdown does not include an explicit entry...
You're correct that .NET Framework 3.5 runs on the CLR version 2.0.50727, which is why you only see .NET Framework 2.0 in the application pool settings in IIS 7.0. The .NET Framework 3.5 SP1 is considered an extension of the .NET Framework 2.0 and is designed to be fully compatible with it. Therefore, in IIS, it will b...
14,105
[ { "from": "human", "value": "I've installed .NET Framework 3.5 SP1 on web server (Server 2008 Enterprise), so running IIS 7.0.\nI want to change the version of .NET Framework used by an existing site. So I right-click on appropriate Application Pool and selected Edit Application Pool. The .NET Framework d...
SQL Server 2005/2008 Express edition has the limitation of 4 GB per database. As far as I known the database engine considers data only, thus excluding log files, unused space, and index size. Getting the length of the MDF file should not give the correct database size in terms of SQL Server limitation. My question is ...
In SQL Server, especially in versions like 2005 and 2008 Express, the database size limit pertains to the amount of data stored in the database, which does not include the size of the log files and certain overheads. To get the actual database size that is considered by SQL Server (i.e., the data size), you can use the...
18,782
[ { "from": "human", "value": "SQL Server 2005/2008 Express edition has the limitation of 4 GB per database. As far as I known the database engine considers data only, thus excluding log files, unused space, and index size.\nGetting the length of the MDF file should not give the correct database size in terms...
I am using SetCursor to set the system cursor to my own image. The code looks something like this: // member on some class HCURSOR _cursor; // at init time _cursor = LoadCursorFromFile("somefilename.cur"); // in some function SetCursor(_cursor); When I do this the cursor does change, but on the first mouse move mess...
The issue you're experiencing is likely due to how the Windows messaging system handles cursors. When you set the cursor using `SetCursor`, you are only setting it for the current mouse move event. If the default behavior is to restore the system's default cursor, you'll need to override that behavior. Here are a few ...
16,043
[ { "from": "human", "value": "I am using SetCursor to set the system cursor to my own image. The code looks something like this:\n// member on some class\nHCURSOR _cursor;\n\n// at init time\n_cursor = LoadCursorFromFile(\"somefilename.cur\");\n\n// in some function\nSetCursor(_cursor);\n\nWhen I do this the...
.Net Compact Framework Scenario: User is on a screen. Device can't finds a printer and asks the user if they want to try again. If they click "No", the current screen is closed and they are returned to the parent menu screen. If they click the "No" button multiple times, the first click will be used by the No button an...
This situation can be tricky, particularly with the limited UI responsiveness of the .NET Compact Framework. While you don’t have heavy operations to justify a wait cursor, the delay from the screen redrawing can lead to a confusing user experience, especially if a quick press of "No" leads to unintended navigation. H...
17,113
[ { "from": "human", "value": ".Net Compact Framework\nScenario: User is on a screen. Device can't finds a printer and asks the user if they want to try again. If they click \"No\", the current screen is closed and they are returned to the parent menu screen. If they click the \"No\" button multiple times, th...
The Weblogic servers we are using have been configured to allow JNDI datasource names like "appds". For development (localhost), we might be running Tomcat and when declared in the <context> section of server.xml, Tomcat will hang JNDI datasources on "java:comp/env/jdbc/*" in the JNDI tree. Problem: in Weblogic, the JN...
You can address the difference in JNDI lookup in a couple of elegant ways without the need to maintain multiple Spring configuration files. Here are some strategies you might consider: ### 1. Use Spring's JndiObjectFactoryBean Spring allows you to create a JNDI datasource in a consistent manner regardless of the serv...
14,659
[ { "from": "human", "value": "The Weblogic servers we are using have been configured to allow JNDI datasource names like \"appds\".\nFor development (localhost), we might be running Tomcat and when declared in the <context> section of server.xml, Tomcat will hang JNDI datasources on \"java:comp/env/jdbc/*\" ...
I have an application where the contents of e-mails that get sent are stored in a .resx file. This is an ASP.Net application, the .resx file lives in /App_GlobalResources When I need to send an e-mail, i'm reading this using: HttpContext.GetGlobalResourceObject("MailContents", "EmailID").ToString Now, I need to us...
To read the contents of `.resx` files from a separate project (like a class library or DLL) when you do not have access to `HttpContext`, you'll need to load the `.resx` file directly. Here are a couple of approaches that you can take: ### Approach 1: Using `ResXResourceReader` You can use the `ResXResourceReader` cl...
18,269
[ { "from": "human", "value": "I have an application where the contents of e-mails that get sent are stored in a .resx file.\nThis is an ASP.Net application, the .resx file lives in /App_GlobalResources \nWhen I need to send an e-mail, i'm reading this using: \n HttpContext.GetGlobalResourceObject(\"MailCont...
In my specific example, I'm dealing with a drop-down, e.g.: <select name="foo" id="bar"> <option disabled="disabled" selected="selected">Select an item:</option> <option>an item</option> <option>another item</option> </select> Of course, that's pretty nonsensical, but I'm wondering whether any strict beh...
When it comes to HTML `<select>` elements, particularly with the use of the `disabled` and `selected` attributes, the behavior can indeed vary slightly between browsers. Here's a breakdown of how to handle your specific scenario. ### Initial Selection and Behavior 1. **Disabled Option**: - The `<option>` element ...
15,603
[ { "from": "human", "value": "In my specific example, I'm dealing with a drop-down, e.g.:\n\n\n<select name=\"foo\" id=\"bar\">\r\n <option disabled=\"disabled\" selected=\"selected\">Select an item:</option>\r\n <option>an item</option>\r\n <option>another item</option>\r\n</select>\n\n\n\nOf course, tha...
I am starting a new ASP.NET MVC project to learn with, and am wondering what's the optimal way to set up the project(s) to connect to a SQL server for the data. For example lets pretend we have a Product table and a product object I want to use to populate data in my view. I know somewhere in here I should have an int...
Setting up an ASP.NET MVC project to connect to SQL Server and implementing a data access layer (DAL) can definitely seem overwhelming at first. However, you can create a solid architecture that provides flexibility and maintainability for your application. Here is a structured approach to help you get started: ### 1....
12,793
[ { "from": "human", "value": "I am starting a new ASP.NET MVC project to learn with, and am wondering what's the optimal way to set up the project(s) to connect to a SQL server for the data. For example lets pretend we have a Product table and a product object I want to use to populate data in my view.\nI k...
Assume a table structure of MyTable(KEY, datafield1, datafield2...). Often I want to either update an existing record, or insert a new record if it doesn't exist. Essentially: IF (key exists) run update command ELSE run insert command What's the best performing way to write this?
To efficiently handle the scenario where you want to either update an existing record or insert a new one if it doesn't exist, you can use the `INSERT ... ON DUPLICATE KEY UPDATE` syntax in MySQL, or the `MERGE` statement in SQL Server. Different databases have different methods for handling this pattern. Below are exa...
8,946
[ { "from": "human", "value": "Assume a table structure of MyTable(KEY, datafield1, datafield2...).\nOften I want to either update an existing record, or insert a new record if it doesn't exist.\nEssentially:\nIF (key exists)\n run update command\nELSE\n run insert command\n\nWhat's the best performing way ...
I'm looking for way to PHP to detect if a script was run from a manual invocation on a shell (me logging in and running it), or if it was run from the crontab entry. I have various maintenance type scripts written in php that i have set to run in my crontab. Occasionally, and I need to run them manually ahead of schedu...
You can distinguish between a manual invocation and a crontab execution in PHP by checking the environment variables that are available when the script is run. When a script is executed via cron, certain environment variables are set, while they are typically not set during manual execution in the shell. Here's a simp...
17,796
[ { "from": "human", "value": "I'm looking for way to PHP to detect if a script was run from a manual invocation on a shell (me logging in and running it), or if it was run from the crontab entry.\nI have various maintenance type scripts written in php that i have set to run in my crontab. Occasionally, and I...
I have a webapp that segfaults when the database in restarted and it tries to use the old connections. Running it under gdb --args apache -X leads to the following output: Program received signal SIGSEGV, Segmentation fault. [Switching to Thread -1212868928 (LWP 16098)] 0xb7471c20 in mysql_send_query () from /usr/lib/l...
The segmentation fault you're encountering is likely due to the application attempting to use a stale database connection after the database server has been restarted. When the database connection is lost and not properly handled, it can lead to undefined behavior, which in your case results in a segmentation fault. H...
15,935
[ { "from": "human", "value": "I have a webapp that segfaults when the database in restarted and it tries to use the old connections. Running it under gdb --args apache -X leads to the following output:\nProgram received signal SIGSEGV, Segmentation fault.\n[Switching to Thread -1212868928 (LWP 16098)]\n0xb74...
I am trying to set the background color for a double spin box, and I am not sure what function I should use. I saw some function called SetBackgroundRole which accepts a Qt::ColorRole, but I am not sure how to use this one as well. Kindly let me know, what's the simple way to change the background color of a QComboBox ...
To change the background color of a `QDoubleSpinBox` or a `QComboBox` in Qt, the simplest way is usually to set a style sheet. This allows you to customize the appearance of widgets, including their background colors. Here’s how you can do it using style sheets: ### Using Style Sheets You can set a style sheet for y...
16,709
[ { "from": "human", "value": "I am trying to set the background color for a double spin box, and I am not sure what function I should use.\nI saw some function called SetBackgroundRole which accepts a Qt::ColorRole, but I am not sure how to use this one as well.\nKindly let me know, what's the simple way to ...
I have a very large monitor. When I open a text file in MSVC, the file defaults to a width of about 80% of my screen space. For most bits of code that's about twice the size I need. Is there a way to set the default size of a newly opened file?
In Microsoft Visual Studio, there isn't a direct setting specifically for adjusting the default size of newly opened text files. However, you can work around the issue by modifying the window layout and saving the changes. Here’s how you can manage this: ### Method 1: Adjust Window Size and Save Layout 1. **Open a Te...
16,254
[ { "from": "human", "value": "I have a very large monitor. When I open a text file in MSVC, the file defaults to a width of about 80% of my screen space. For most bits of code that's about twice the size I need. Is there a way to set the default size of a newly opened file?\n" }, { "from": "gpt", ...
Rather than population said DOM object with an external page such as HTML CFM or PHP, what if I simply want to send text? I've tried: $("#myDOMObject").val("some text"); No errors, but the object value doesn't update either.
If you're trying to update the text content of a DOM element using jQuery, you need to make sure you're targeting the correct type of element. The `.val()` method is used for form elements like `<input>`, `<select>`, or `<textarea>`. If you want to update the text of a regular HTML element, you should use the `.text()`...
19,128
[ { "from": "human", "value": "Rather than population said DOM object with an external page such as HTML CFM or PHP, what if I simply want to send text?\nI've tried:\n$(\"#myDOMObject\").val(\"some text\");\nNo errors, but the object value doesn't update either.\n" }, { "from": "gpt", "value": "If...
I would like to setup a admin page (ASP.NET/C#) that can add IIS host headers to the website that the admin page is hosted on. Is this possible? I dont want to add a http header - I want to mimick the action of going into IIS manually, bringing up the properties of the website, clicking advanced on the website tab, an...
Yes, it is indeed possible to programmatically add IIS host headers to a website using ASP.NET and C#. You can achieve this by utilizing the `Microsoft.Web.Administration` namespace, which provides a managed interface for configuring IIS. To create an admin page that can add IIS host headers to the website, you'll ne...
17,192
[ { "from": "human", "value": "I would like to setup a admin page (ASP.NET/C#) that can add IIS host headers to the website that the admin page is hosted on. Is this possible? \nI dont want to add a http header - I want to mimick the action of going into IIS manually, bringing up the properties of the website...
I'm looking for a library/method to parse an html file with more html specific features than generic xml parsing libraries.
When it comes to parsing HTML files with features that go beyond generic XML parsing, you have several excellent libraries to choose from, depending on the programming language you're using. Here are some popular options: ### Python 1. **Beautiful Soup**: - A widely-used library that makes it easy to scrape informa...
14,898
[ { "from": "human", "value": "I'm looking for a library/method to parse an html file with more html specific features than generic xml parsing libraries.\n" }, { "from": "gpt", "value": "When it comes to parsing HTML files with features that go beyond generic XML parsing, you have several excelle...
I have an application that takes the quality results for a manufacturing process and creates graphs both to show Pareto charts of the bad, and also to show production throughput. To automate the task of testing these statistical procedures I would like to deterministically be able to add records into the database and ...
Yes, there is a well-known algorithm to randomly shuffle a list while ensuring that each permutation of the list is equally likely. The most commonly used algorithm for this purpose is the **Fisher-Yates shuffle**, also known as the **Knuth shuffle**. This algorithm works efficiently in O(n) time complexity, which make...
18,292
[ { "from": "human", "value": "I have an application that takes the quality results for a manufacturing process and \ncreates graphs both to show Pareto charts of the bad, and also to show production throughput.\nTo automate the task of testing these statistical procedures I would like to deterministically be...
We are developing a .NET 2.0 winform application. The application needs to access Web Services. Yet, we are encountering issues with users behind proxies. Popular windows backup applications (think Mozy) are providing a moderately complex dialog window dedicated the proxy settings. Yet, re-implementing yet-another prox...
Dealing with proxy settings in a .NET 2.0 WinForms application can be challenging, especially when users are behind different proxy configurations. Here's a structured approach to help you effectively handle proxy settings in your application. ### 1. Use Default System Proxy Settings .NET provides a way to automatica...
10,160
[ { "from": "human", "value": "We are developing a .NET 2.0 winform application. The application needs to access Web Services. Yet, we are encountering issues with users behind proxies.\nPopular windows backup applications (think Mozy) are providing a moderately complex dialog window dedicated the proxy setti...
I've got some code that uses the Component Categories manager to load all of the classes that implement a particular category. Is there an easy way to get a description, path and version information from the loaded DLL or EXE?
Yes, in .NET, you can retrieve metadata such as the description, file path, and version information from an assembly (DLL or EXE) using the `Assembly` class available in the `System.Reflection` namespace. Here's a straightforward way to do this: 1. **Load the Assembly**: You need to reference the assembly that you are...
17,109
[ { "from": "human", "value": "I've got some code that uses the Component Categories manager to load all of the classes that implement a particular category.\nIs there an easy way to get a description, path and version information from the loaded DLL or EXE?\n" }, { "from": "gpt", "value": "Yes, i...
Like most *nix people, I tend to play with my tools and get them configured just the way that I like them. This was all well and good until recently. As I do more and more work, I tend to log onto more and more machines, and have more and more stuff that's configured great on my home machine, but not necessarily on my ...
Managing configuration files across multiple machines can indeed become a challenge. Fortunately, there are several strategies you can use to keep your configurations synchronized and easily deployable across different environments. Here are a few common methods: ### 1. **Version Control Systems (e.g., Git)** - **Cre...
17,176
[ { "from": "human", "value": "Like most *nix people, I tend to play with my tools and get them configured just the way that I like them. This was all well and good until recently. As I do more and more work, I tend to log onto more and more machines, and have more and more stuff that's configured great on my...
I'm trying to show someone a use for interfaces in a crazy situation they've created. They have several unrelated objects in lists, and need to perform an operation on two string properties in each object. I'm pointing out that if they define the properties as part of an interface, they can use the interface object a...
The issue you're encountering is related to the way generics and casting work in C#. In your example, you're trying to directly cast a `List<Test>` to `IEnumerable<IDoSomething>`, but this isn't valid because `List<Test>` is not the same type as `IEnumerable<IDoSomething>`. This is a case of the generic type parameter ...
17,229
[ { "from": "human", "value": "I'm trying to show someone a use for interfaces in a crazy situation they've created. They have several unrelated objects in lists, and need to perform an operation on two string properties in each object. I'm pointing out that if they define the properties as part of an inter...
I have three divs: <div id="login" /> <div id="content" /> <div id="menu" /> How would I define the CSS styles (without touching the HTML) to have the menu-div as the left column, the login-div in the right column and the content-div also in the right column but below the login-div. The width of every div is fixed...
To achieve the layout you described, you can use CSS Flexbox or CSS Grid. Here's how you can do it using both methods. ### Method 1: Using CSS Flexbox ```css body { display: flex; } #menu { width: 200px; /* Set a fixed width for the menu */ background-color: lightgray; /* Optional: Add a background color...
15,142
[ { "from": "human", "value": "I have three divs:\n<div id=\"login\" />\n<div id=\"content\" /> \n<div id=\"menu\" /> \n\nHow would I define the CSS styles (without touching the HTML) to have the menu-div as the left column, the login-div in the right column and the content-div also in the right column but ...
I'm not talking about how to indent here. I'm looking for suggestions about the best way of organizing the chunks of code in a source file. Do you arrange methods alphabetically? In the order you wrote them? Thematically? In some kind of 'didactic' order? What organizing principles do you follow? Why?
Organizing code in a source file is a crucial aspect of software development that can significantly impact readability, maintainability, and collaboration within a team. While there isn't a one-size-fits-all solution, here are some common principles and strategies for organizing code that many developers find effective...
8,316
[ { "from": "human", "value": "I'm not talking about how to indent here. I'm looking for suggestions about the best way of organizing the chunks of code in a source file.\nDo you arrange methods alphabetically? In the order you wrote them? Thematically? In some kind of 'didactic' order?\nWhat organizing princ...
What is the best way (in C++) to set up a container allowing for double-indexing? Specifically, I have a list of objects, each indexed by a key (possibly multiple per key). This implies a multimap. The problem with this, however, is that it means a possibly worse-than-linear lookup to find the location of an object. I'...
Your scenario presents a unique challenge in C++ where you want to maintain a collection of objects with double-indexing (by a key and by coordinate) while ensuring stable references. To achieve this, the Boost library indeed offers a couple of suitable options, such as Boost.MultiIndex and Boost.Bimap. ### Option 1: ...
13,763
[ { "from": "human", "value": "What is the best way (in C++) to set up a container allowing for double-indexing? Specifically, I have a list of objects, each indexed by a key (possibly multiple per key). This implies a multimap. The problem with this, however, is that it means a possibly worse-than-linear loo...
I'm a Java head mainly, and I want a way to generate a pseudo-random number between 0 and 74. In Java I would use the method: Random.nextInt(74) I'm not interested in a discussion about seeds or true randomness, just how you accomplish the same task in Objective-C. I've scoured Google, and there just seems to be lots ...
In Objective-C, you can generate a pseudo-random number in a similar way to Java using the `arc4random_uniform` function, which is part of the C standard library and available in iOS and macOS development. This function generates a random number in a specified range without any bias. Here’s how you can generate a pseu...
21,169
[ { "from": "human", "value": "I'm a Java head mainly, and I want a way to generate a pseudo-random number between 0 and 74. In Java I would use the method:\nRandom.nextInt(74)\n\nI'm not interested in a discussion about seeds or true randomness, just how you accomplish the same task in Objective-C. I've scou...
As the title says: What is the difference between a non-secure random number generator and a secure random number generator?
The main differences between a non-secure random number generator (RNG) and a secure random number generator revolve around their intended uses, the algorithms they employ, and their overall quality of randomness. Here’s a breakdown of the key differences: ### 1. **Purpose and Use Cases:** - **Non-Secure RNG:** ...
13,295
[ { "from": "human", "value": "As the title says: What is the difference between a non-secure random number generator and a secure random number generator?\n" }, { "from": "gpt", "value": "The main differences between a non-secure random number generator (RNG) and a secure random number generator ...
I need to stream a file to the Response for saving on the end user's machine. The file is plain text, so what content type can I use to prevent the text being displayed in the browser?
To stream a plain text file to the user's machine while preventing it from being displayed in the browser, you can use the `Content-Disposition` header in addition to the appropriate content type. For the `Content-Type`, you can use `text/plain`, but the key to preventing the file from being displayed in the browser i...
20,096
[ { "from": "human", "value": "I need to stream a file to the Response for saving on the end user's machine. The file is plain text, so what content type can I use to prevent the text being displayed in the browser?\n" }, { "from": "gpt", "value": "To stream a plain text file to the user's machin...
I am trying to integrate the SSRS report to my web page. The code is as follows: ReportViewer1.ProcessingMode = rocessingMode.Remote; ReportViewer1.ServerReport.ReportServerUrl = new Uri("http://localhost/reportserver"); ReportViewer1.ServerReport.ReportPath = "/Report Project1/Reconciliation"; List<ReportParameter> pa...
The error you are encountering, `rsAccessDenied`, indicates that the user account under which your web application is running does not have sufficient permissions to access the SSRS (SQL Server Reporting Services) report you are trying to view. Here are some steps you can take to resolve this issue: ### 1. Check SSRS ...
17,152
[ { "from": "human", "value": "I am trying to integrate the SSRS report to my web page.\nThe code is as follows:\nReportViewer1.ProcessingMode = rocessingMode.Remote;\nReportViewer1.ServerReport.ReportServerUrl = new Uri(\"http://localhost/reportserver\");\nReportViewer1.ServerReport.ReportPath = \"/Report Pr...
How do I loop into all the resources in the resourcemanager? Ie: foreach (string resource in ResourceManager) //Do something with the recource. Thanks
To loop through all the resources in a `ResourceManager`, you generally need to use the appropriate methods provided by the `ResourceManager` class in .NET. However, it's worth noting that the `ResourceManager` class does not directly support enumeration of its resources like a collection does. Instead, you can retri...
17,253
[ { "from": "human", "value": "How do I loop into all the resources in the resourcemanager?\nIe:\nforeach (string resource in ResourceManager)\n //Do something with the recource.\nThanks\n" }, { "from": "gpt", "value": "To loop through all the resources in a `ResourceManager`, you generally need ...
I am building an application where I want to be able to click a rectangle represented by a DIV, and then use the keyboard to move that DIV by listing for keyboard events. Rather than using an event listener for those keyboard events at the document level, can I listen for keyboard events at the DIV level, perhaps by gi...
In HTML, only certain elements are focusable by default (like input, textarea, button, etc.). A `div` is not focusable unless you explicitly make it so by setting the `tabindex` attribute. This allows the `div` to receive keyboard focus and respond to keyboard events. Here's how you can modify your code to make the `i...
16,188
[ { "from": "human", "value": "I am building an application where I want to be able to click a rectangle represented by a DIV, and then use the keyboard to move that DIV by listing for keyboard events.\nRather than using an event listener for those keyboard events at the document level, can I listen for keybo...
What's the best tool for viewing and editing a merge in Git? I'd like to get a 3-way merge view, with "mine", "theirs" and "ancestor" in separate panels, and a fourth "output" panel. Also, instructions for invoking said tool would be great. (I still haven't figure out how to start kdiff3 in such a way that it doesn't g...
For viewing and editing merges in Git with a 3-way merge view, **kdiff3** is a great choice. It provides a clear interface with separate panels for "mine," "theirs," "ancestor," and an output panel. ### Installing KDiff3 If you don't have `kdiff3` installed, you can install it via the terminal: ```bash sudo apt upda...
18,806
[ { "from": "human", "value": "What's the best tool for viewing and editing a merge in Git? I'd like to get a 3-way merge view, with \"mine\", \"theirs\" and \"ancestor\" in separate panels, and a fourth \"output\" panel.\nAlso, instructions for invoking said tool would be great. (I still haven't figure out h...
I've been working on a very simple crud generator for pylons. I came up with something that inspects SomeClass._sa_class_manager.mapper.c Is it ok to inspect this (or to call methods begining with underscore)? I always kind of assumed this is legal though frowned upon as it relies heavily on the internal structure of...
Inspecting private or "protected" attributes (those beginning with an underscore) in Python can be a bit of a gray area. Here's a breakdown of considerations to keep in mind: ### 1. Understanding Python's Naming Conventions - In Python, a single underscore prefix (e.g., `_attribute`) is a convention that indicates tha...
20,328
[ { "from": "human", "value": "I've been working on a very simple crud generator for pylons. I came up with something that inspects \nSomeClass._sa_class_manager.mapper.c\n\nIs it ok to inspect this (or to call methods begining with underscore)? I always kind of assumed this is legal though frowned upon as it...
Are JKS (Java Key Store) files encrypted? Do they provide full protection for encryption keys, or do I need to rely solely on access control? Is there a way to ensure that the keys are protected? I'm interested in the gritty details, including algorithm, key management, etc. Is any of this configurable?
Java KeyStore (JKS) files are a type of storage for cryptographic keys and certificates in Java. They are often used for managing SSL certificates and are supported by the Java Security API. To address your questions, let's look into the details regarding encryption, protection, and configuration of JKS files. ### Are...
15,412
[ { "from": "human", "value": "Are JKS (Java Key Store) files encrypted? Do they provide full protection for encryption keys, or do I need to rely solely on access control?\nIs there a way to ensure that the keys are protected?\nI'm interested in the gritty details, including algorithm, key management, etc. I...
Does anyone know the format of the MAPI property PR_SEARCH_KEY? The online documentation has this to say about it: The search key is formed by concatenating the address type (in uppercase characters), the colon character ':', the e-mail address in canonical form, and the terminating null character. And the ...
The MAPI property `PR_SEARCH_KEY` (PidTagSearchKey) is indeed used as a unique identifier for objects in a MAPI store, and its format can be a bit confusing. 1. **Search Key Composition**: - According to the information you've provided, the `PR_SEARCH_KEY` is a binary value that contains specific information about...
19,923
[ { "from": "human", "value": "Does anyone know the format of the MAPI property PR_SEARCH_KEY?\nThe online documentation has this to say about it:\n\nThe search key is formed by\n concatenating the address type (in\n uppercase characters), the colon\n character ':', the e-mail address in\n canonical form,...
I'm implementing a email newsletter sender service using .NET and Windows Server technologies. Are there comprehensive guidelines which could help avoiding emails being trapped by spam filters and other mechanisms? They should cover all aspects of (legal) bulk mail sending: SMTP configuration, DNS, HTML content, images...
Implementing an email newsletter sender service that avoids being trapped by spam filters requires a comprehensive approach encompassing technical configurations, content strategies, and adherence to legal standards. Below are guidelines across various aspects of bulk email sending: ### 1. Legal Compliance Before conf...
12,814
[ { "from": "human", "value": "I'm implementing a email newsletter sender service using .NET and Windows Server technologies. Are there comprehensive guidelines which could help avoiding emails being trapped by spam filters and other mechanisms?\nThey should cover all aspects of (legal) bulk mail sending: SMT...
What's the best delimiter to use when exporting data? What's the best way to work with NULL data if you have an INT field in the table?
### Best Delimiter for Exporting Data The choice of delimiter when exporting data depends on the specific requirements and context of your data. However, here are some commonly used delimiters: 1. **Comma (`,`)**: This is the standard delimiter for CSV (Comma-Separated Values) files. It's widely supported and easy to...
16,923
[ { "from": "human", "value": "\nWhat's the best delimiter to use when exporting data?\nWhat's the best way to work with NULL data if you have an INT field in the table?\n\n" }, { "from": "gpt", "value": "### Best Delimiter for Exporting Data\n\nThe choice of delimiter when exporting data depends ...
I'm returning to c++ after being away for a bit and trying to dust off the old melon. In Java Iterator is an interface to a container having methods: hasNext(), next() and remove(). The presence of hasNext() means it has the concept of a limit for the container being traversed. //with an Iterator Iterator<String> iter...
You're on the right track in your understanding of iterators in both Java and C++. Let’s expand on a few key points, subtle nuances, and the overall design philosophies regarding iterators in both languages. ### Key Comparisons and Subtleties 1. **Iterator Types**: - In C++, the Standard Template Library (STL) pro...
16,224
[ { "from": "human", "value": "I'm returning to c++ after being away for a bit and trying to dust off the old melon. \nIn Java Iterator is an interface to a container having methods: hasNext(), next() and remove(). The presence of hasNext() means it has the concept of a limit for the container being traversed...
How do you decide if something goes in the view or the controller? Here are some specific examples: Zend_Captcha: Does the controller generate the captcha and pass it to the view or does the view generate it? Zend_Alc: Does the view decide if a segment of the view should be displayed to the user or do you have multip...
In the Model-View-Controller (MVC) design pattern, the distribution of responsibilities between the components (Model, View, Controller) is essential for maintaining a clean separation of concerns. This promotes modularity, testability, and easier maintenance of your code. Here’s how to decide what goes in the View and...
16,319
[ { "from": "human", "value": "How do you decide if something goes in the view or the controller?\nHere are some specific examples: \n\nZend_Captcha: Does the controller generate the captcha and pass it to the view or does the view generate it?\nZend_Alc: Does the view decide if a segment of the view should b...
I am having a doubt in page_init, page preinit, load. I need to know when we use this also where we need to call our objects in different stages of our life cycle. Please let me know how they will process for each events raised
In ASP.NET Web Forms, the page lifecycle includes several stages that allow you to manage the execution of your application. Understanding these stages is crucial for effective event handling and control management. Here’s a breakdown of the `Page_PreInit`, `Page_Init`, and `Page_Load` events, along with guidance on wh...
17,790
[ { "from": "human", "value": "I am having a doubt in page_init, page preinit, load.\nI need to know when we use this also where we need to call our objects in different stages of our life cycle.\nPlease let me know how they will process for each events raised\n" }, { "from": "gpt", "value": "In A...
We are currently using Apache 2.2.3 and Tomcat 5 (Embedded in JBoss 4.2.2) using mod_proxy_jk as the connector. Can someone shed some light on the the correct way to calculate / configure the values below (as well as anything else that may be relevant). Both Apache and Tomcat are running on separate machines and have ...
Configuring Apache and Tomcat for optimal performance involves understanding various parameters and how they interact with your workload, especially when running on separate machines. Here’s a detailed breakdown of the configuration values you've provided, along with recommendations for tweaking them based on typical u...
14,480
[ { "from": "human", "value": "We are currently using Apache 2.2.3 and Tomcat 5 (Embedded in JBoss 4.2.2) using mod_proxy_jk as the connector.\nCan someone shed some light on the the correct way to calculate / configure the values below (as well as anything else that may be relevant). Both Apache and Tomcat ...
This is really annoying, we've switched our client downloads page to a different site and want to send a link out with our installer. When the link is created and overwrites the existing file, the metadata in windows XP still points to the same place even though the contents of the .url shows the correct address. I ca...
It sounds like you're dealing with a caching or metadata issue in Windows XP related to the Internet Shortcut files. When you overwrite an existing `.url` file, Windows may not fully refresh the associated metadata, which can lead to confusion since the old shortcut may still point to the old URL in some contexts. Her...
17,474
[ { "from": "human", "value": "This is really annoying, we've switched our client downloads page to a different site and want to send a link out with our installer. When the link is created and overwrites the existing file, the metadata in windows XP still points to the same place even though the contents of ...
Have any of you ever tried to run from sharepoint? I've worked with sharepoint enough to know that it is not something that interests me. My interests are more along the lines of APIs / backend / distributed development. Have any of you found ways, as consultants, to move away from sharepoint and keep learning other th...
It's understandable to feel boxed in by a technology or platform like SharePoint, especially when your interests lie elsewhere, such as in APIs, backend systems, or distributed development. Here are some strategies you can consider to transition away from SharePoint and explore other areas: 1. **Skill Diversification*...
17,198
[ { "from": "human", "value": "Have any of you ever tried to run from sharepoint? I've worked with sharepoint enough to know that it is not something that interests me. My interests are more along the lines of APIs / backend / distributed development. Have any of you found ways, as consultants, to move away f...
Other than pasting a WDSL in the tech spec, what are the recommended ways to document a WCF web-service before you begin coding?
When documenting a WCF (Windows Communication Foundation) web service before coding, it's important to ensure that all aspects of the service are clearly defined for future reference and for any team members who will be involved in the development. Here are some recommended ways to document a WCF web service effectivel...
17,377
[ { "from": "human", "value": "Other than pasting a WDSL in the tech spec, what are the recommended ways to document a WCF web-service before you begin coding?\n" }, { "from": "gpt", "value": "When documenting a WCF (Windows Communication Foundation) web service before coding, it's important to en...
I have a string that looks like this: "Name1=Value1;Name2=Value2;Name3=Value3" Is there a built-in class/function in Python that will take that string and construct a dictionary, as though I had done this: dict = { "Name1": "Value1", "Name2": "Value2", "Name3": "Value3" } I have looked through the modules...
Python doesn't have a built-in function that directly parses a string in the format you described into a dictionary, but you can achieve this easily using a combination of Python's built-in string methods. While it’s true that there is no specific built-in class dedicated to this exact task, you can use the `str.split...
19,967
[ { "from": "human", "value": "I have a string that looks like this:\n\"Name1=Value1;Name2=Value2;Name3=Value3\"\n\nIs there a built-in class/function in Python that will take that string and construct a dictionary, as though I had done this:\ndict = {\n \"Name1\": \"Value1\",\n \"Name2\": \"Value2\",\n...
I am totally new to SQL. I have a simple select query similar to this: SELECT COUNT(col1) FROM table1 There are some 120 records in the table and shown on the GUI. For some reason, this query always returns a number which is less than the actual count. Can somebody please help me?
Welcome to the world of SQL! The issue you're experiencing could arise from several factors. Let's explore some common reasons why `SELECT COUNT(col1) FROM table1` might return a count that is less than the actual number of records you expect: 1. **NULL Values**: The `COUNT(column_name)` function counts only the non-N...
17,917
[ { "from": "human", "value": "I am totally new to SQL. I have a simple select query similar to this:\nSELECT COUNT(col1) FROM table1\n\nThere are some 120 records in the table and shown on the GUI.\nFor some reason, this query always returns a number which is less than the actual count.\nCan somebody please ...
I am trying to use JQUERY to grab photos from a Flickr group. I can get back valid JSON, but can't figure out how to get access to the actual photos. The JSON that is returned contains an empty list where I would expect photos. So when I plug this into the browser: http://api.flickr.com/services/rest?method=flickr.grou...
It looks like you're correctly calling the Flickr API, but the empty `photo` array in the response suggests that the group you are querying does not have any photos available to the public or the API request doesn't have permission to access them. Here are a few steps you can take to troubleshoot this issue: 1. **Che...
17,536
[ { "from": "human", "value": "I am trying to use JQUERY to grab photos from a Flickr group. I can get back valid JSON, but can't figure out how to get access to the actual photos. The JSON that is returned contains an empty list where I would expect photos.\nSo when I plug this into the browser:\nhttp://api....
A few years ago I developed a web app for which we wanted to make sure the users weren't sharing credentials. One of the things we decided to to, was only allow the user to be logged in from one computer at a time. The way I did this, was to have a little iframe ping the server every N seconds; as long as the server ha...
The approach you took, using an iframe to ping the server, does indeed have its limitations and vulnerabilities, as you suspected. While it may serve as a temporary deterrent against multiple logins from different locations, it can be easily circumvented by advanced users who can manipulate their browser or network con...
17,180
[ { "from": "human", "value": "A few years ago I developed a web app for which we wanted to make sure the users weren't sharing credentials.\nOne of the things we decided to to, was only allow the user to be logged in from one computer at a time. The way I did this, was to have a little iframe ping the server...
Let's say I have a model like this class Foo(db.Model): id = db.StringProperty() bar = db.StringProperty() baz = db.StringProperty() And I'm going a GqlQuery like this foos = db.GqlQuery("SELECT * FROM Foo") I want to take the results of the GqlQuery and turn into some sort of JSON string that I can manip...
Your current approach is functional and gets the job done, but there are definitely ways to make it cleaner and more Pythonic. Here are a few suggestions to improve your code: 1. **Use a List Comprehension**: Instead of manually looping through the GqlQuery results and adding each instance to a dictionary, you can use...
20,139
[ { "from": "human", "value": "Let's say I have a model like this\nclass Foo(db.Model):\n id = db.StringProperty()\n bar = db.StringProperty()\n baz = db.StringProperty()\n\nAnd I'm going a GqlQuery like this\nfoos = db.GqlQuery(\"SELECT * FROM Foo\")\n\nI want to take the results of the GqlQuery and...
I am trying to create a multi dimensional array using this syntax: $x[1] = 'parent'; $x[1][] = 'child'; I get the error: [] operator not supported for strings because it is evaluating the $x[1] as a string as opposed to returning the array so I can append to it. What is the correct syntax for doing it this way? The o...
You're encountering the issue because when you assign a string to `$x[1]`, it is treated as a string, and attempting to use `[]` to append to it will result in an error since strings do not support appending in that way. To create a multidimensional array in PHP, you need to initialize `$x[1]` as an array before you c...
20,498
[ { "from": "human", "value": "I am trying to create a multi dimensional array using this syntax:\n$x[1] = 'parent';\n$x[1][] = 'child';\n\nI get the error: [] operator not supported for strings because it is evaluating the $x[1] as a string as opposed to returning the array so I can append to it.\nWhat is t...
I have an script that receives an encrypted url and from that generates a download, the most critic par of the script is this: $MimeType = new MimeType(); $mimetype = $MimeType->getType($filename); $basename = basename($filename); header("Content-type: $mimetype"); header("Content-Disposition: attachment; filename=\"$b...
The issue you're encountering with Internet Explorer (IE) when attempting to serve files for download is known to be tricky, particularly because different versions of IE have various quirks regarding how they handle file downloads. Here are a few recommendations that might help resolve your problem: ### 1. Add Cache-...
17,900
[ { "from": "human", "value": "I have an script that receives an encrypted url and from that generates a download, the most critic par of the script is this:\n$MimeType = new MimeType();\n$mimetype = $MimeType->getType($filename);\n$basename = basename($filename);\nheader(\"Content-type: $mimetype\");\nheader...
I am writing a unit test to check that a private method will close a stream. The unit test calls methodB and the variable something is null The unit test doesn't mock the class on test The private method is within a public method that I am calling. Using emma in eclipse (via the eclemma plugin) the method call is displ...
In your scenario, it appears that the `methodA()` is indeed calling `methodB()`, but the reason that the call to `methodB()` is not shown as covered by your unit test could be due to several factors related to how code coverage tools like Emma (or EclEmma, its Eclipse plugin) function. Here are some potential reasons: ...
16,380
[ { "from": "human", "value": "I am writing a unit test to check that a private method will close a stream.\nThe unit test calls methodB and the variable something is null\nThe unit test doesn't mock the class on test\nThe private method is within a public method that I am calling.\nUsing emma in eclipse (via...
In SVN, trunk is the recommended place for the main development and I use this convention for all of my projects. However, this means that trunk is sometimes unstable, or even broken. This happens for instance when I commit something by mistake When the trunk simply has to be broken because of the way SVN works. Canon...
You’ve raised valid concerns about the challenges of maintaining a stable `trunk` in an SVN workflow, particularly in the context of operations that can leave the code in an unstable state. Here are some strategies to address these issues: ### 1. Use Feature Branches One effective way to manage unstable code in the `t...
18,671
[ { "from": "human", "value": "In SVN, trunk is the recommended place for the main development and I use this convention for all of my projects. However, this means that trunk is sometimes unstable, or even broken. This happens for instance when\n\nI commit something by mistake\nWhen the trunk simply has to b...