instruction
stringlengths
14
27.6k
completion
stringlengths
3
38.3k
__original_row_idx
int64
0
50k
conversations
listlengths
2
2
Assume that write operation throws an exception half-way. Is there any data written into the file, or is no data written in the file?
When a write operation throws an exception halfway through, whether any data is written to the file or not depends on several factors, including: 1. **File System Behavior**: Different file systems handle writes differently. Some might write data in a manner that only some of it is committed, while others may not writ...
46,074
[ { "from": "human", "value": "Assume that write operation throws an exception half-way. Is there any data written into the file, or is no data written in the file?\n" }, { "from": "gpt", "value": "When a write operation throws an exception halfway through, whether any data is written to the file...
We have some issues in our application with skype taking over some of our urls, replacing them with a skype plug in that enables you to start calls. Looks like skype thinks they are phone numbers. I was wondering if there are some way to mark our urls such that skype doesn't think they are phone numbers? Its described ...
Yes, there are a few ways you can prevent Skype from automatically converting certain URLs or text that looks like phone numbers into clickable links for starting calls. ### 1. Use the `data-` Attribute One common approach is to add a custom `data-` attribute to your anchor tags. While this won't directly prevent Sky...
49,476
[ { "from": "human", "value": "We have some issues in our application with skype taking over some of our urls, replacing them with a skype plug in that enables you to start calls. Looks like skype thinks they are phone numbers. I was wondering if there are some way to mark our urls such that skype doesn't thi...
Does anybody has an experience with Spring Integration project as embedded ESB? I'm highly interesting in such use cases as: Reading files from directory on schedule basis Getting data from JDBC data source Modularity and possibility to start/stop/redeploy module on the fly (e.g. one module can scan directory on sched...
Yes, using Spring Integration as an embedded Enterprise Service Bus (ESB) is a common practice, and it can effectively handle the use cases you've mentioned, including reading files, accessing JDBC data sources, and modularity. Let's go through your specific questions: ### 1. **Reading Files from Directory on Schedule...
39,672
[ { "from": "human", "value": "Does anybody has an experience with Spring Integration project as embedded ESB?\nI'm highly interesting in such use cases as:\n\nReading files from directory on schedule basis\nGetting data from JDBC data source\nModularity and possibility to start/stop/redeploy module on the fl...
How do you make the authentication for a browser-based application dependent on the client machine? Say the admin can login only from this machine. Assumptions: There is complete control over the network and all machines (client and server) involved. I am looking for an apache/linux solution.
To implement authentication for a browser-based application that restricts access to a specific client machine, you can use a combination of IP whitelisting, client machine identifiers (such as MAC address), and possibly client-side certificates. Below is a detailed approach to achieve this using Apache on a Linux serv...
45,286
[ { "from": "human", "value": "How do you make the authentication for a browser-based application dependent on the client machine? Say the admin can login only from this machine.\nAssumptions: There is complete control over the network and all machines (client and server) involved.\nI am looking for an apache...
I am looking to add the capability for users to write plugins to the program I have developed in Delphi. The program is a single executable with no DLLs used. This would allow the user community to write extensions to my program to access the internal data and add capabilities that they may find useful. I've seen the...
Adding plugin capabilities to a single executable Delphi application without using DLLs or additional modules is a bit challenging, but it can be done using some specific techniques. Here are some approaches you might consider, along with resources and tips for implementing them: ### 1. Script-Based Plugins One common...
45,262
[ { "from": "human", "value": "I am looking to add the capability for users to write plugins to the program I have developed in Delphi. The program is a single executable with no DLLs used. \nThis would allow the user community to write extensions to my program to access the internal data and add capabilities...
I'm trying to get an object element from my webpage using getElementById (ultimately so I can replace it with a dynamically created object element) but it is returning null in IE6. In the following code, the byId() function returns null in IE but an [object HTMLObjectElement] in Firefox 3 and the lengthOfByTagName() fu...
It looks like you're encountering a couple of issues that are specific to Internet Explorer (IE) 6. There are a few things you should consider when working with object elements in IE. 1. **Correct Typo in Parameter Name**: There is a typo in your `<param>` element's `name` attribute. The correct spelling is `allowScri...
45,790
[ { "from": "human", "value": "I'm trying to get an object element from my webpage using getElementById (ultimately so I can replace it with a dynamically created object element) but it is returning null in IE6.\nIn the following code, the byId() function returns null in IE but an [object HTMLObjectElement] i...
I'm trying to implement a Visual Studio Addin to support cross-platform development. The addon currently only warns developer when using unsupported functions but I also want to implement a feature that informs him about functions that are implemented but produce sideffects / are unstable etc. Can anyone help me? I wo...
Creating a Visual Studio Add-in to support cross-platform development is a great way to enhance the development experience for developers working with different platforms. To implement a feature that informs developers about functions that are implemented but produce side effects or are unstable, you can follow these s...
44,995
[ { "from": "human", "value": "I'm trying to implement a Visual Studio Addin to support cross-platform development. The addon currently only warns developer when using unsupported functions but I also want to implement a feature that informs him about functions that are implemented but produce sideffects / ar...
having a little architectural trouble here. In C++, we have the notion of 'friends,' where such friend classes can access private members. So, I'm deving a Java app and trying to adhere to the MVC architecture. I've got a controller class that manages graph connectivity between 'map_objects.' I'd like to hide the funct...
You're facing a common challenge when trying to encapsulate functionality in a way that adheres to the principles of object-oriented design, especially when working within the MVC (Model-View-Controller) architecture. ### Key Concepts 1. **Encapsulation**: This principle of OOP allows you to hide the internal state a...
47,391
[ { "from": "human", "value": "having a little architectural trouble here.\nIn C++, we have the notion of 'friends,' where such friend classes can access private members.\nSo, I'm deving a Java app and trying to adhere to the MVC architecture. I've got a controller class that manages graph connectivity betwee...
Can anyone recommend a graphical call stack visualiser for JavaScript, that I can install on a Linux box (or is OS neutral)? Preferably one that doesn't involve having to modify the JavaScript being profiled. I'm after something similar to the graphs produced by valgrind/kcachegrind but for JavaScript. Edit: A couple o...
If you're looking for a graphical call stack visualizer for JavaScript that can work on a Linux box or is OS-neutral and doesn't require modifying the code, here are a few options you might find helpful: 1. **Chrome DevTools**: The built-in profiling tools in Chrome DevTools provide a detailed view of the JavaScript c...
48,896
[ { "from": "human", "value": "Can anyone recommend a graphical call stack visualiser for JavaScript, that I can install on a Linux box (or is OS neutral)? Preferably one that doesn't involve having to modify the JavaScript being profiled.\nI'm after something similar to the graphs produced by valgrind/kcache...
I was thinking of centralizing this functionality by having a single method that gets passed an AppState argument and it deals with changing the properties of all GUI elements based on this argument. Every time the app changes its state (ready, busy, downloading so partially busy, etc), this function is called with the...
Centralizing the management of your application's state and corresponding GUI updates is a great approach to ensure consistency and maintainability. Here are several strategies that you can consider to complement your idea or provide alternatives: 1. **State Management Pattern**: Utilize a state management pattern (e....
47,429
[ { "from": "human", "value": "I was thinking of centralizing this functionality by having a single method that gets passed an AppState argument and it deals with changing the properties of all GUI elements based on this argument. Every time the app changes its state (ready, busy, downloading so partially bus...
I have a basic HTML form that gets inserted into a server side div tag based on how many records exist in the database. This HTML form comes out just fine, and everything looks good. But on my action page I cannot seem to access the input elements from the code behind. I have tried using the Request scope, but I have c...
When dealing with dynamically generated HTML forms in ASP.NET where the controls are not created server-side (i.e., they don't have the `runat="server"` attribute), you can still access their values on form submission, but it requires different handling. Here are some suggestions to help you retrieve the values of your...
49,644
[ { "from": "human", "value": "I have a basic HTML form that gets inserted into a server side div tag based on how many records exist in the database. This HTML form comes out just fine, and everything looks good. But on my action page I cannot seem to access the input elements from the code behind. I have tr...
I've currently got a tool which allows me to configure a database connection (using JDBC) and specify a set of queries to run against the database. This is scheduled to run at a specific time of day (using cron or windows scheduler currently). The tool then exports the results to a file (xml) and sends this file to my ...
Creating a user-friendly front-end for your data extraction tool is a great idea to empower your customers and simplify their setup process. Here are a few approaches you can consider: ### 1. Use a Low-Code or No-Code Platform If you prefer not to delve into rich client development, you might consider using low-code/n...
47,045
[ { "from": "human", "value": "I've currently got a tool which allows me to configure a database connection (using JDBC) and specify a set of queries to run against the database. This is scheduled to run at a specific time of day (using cron or windows scheduler currently). The tool then exports the results t...
Is there a difference between SSLv3 and TLSv1? How does IIS6.0 control what type of security is used for a website enabled with HTTPS? MS says that there is a hierarchy in which the security and encryption level is negotiated before connection is established. What is this hierarchy? Is SSLv3 available in IIS6.0 by def...
Yes, there are differences between SSLv3 (Secure Sockets Layer version 3) and TLSv1 (Transport Layer Security version 1.0). While both are cryptographic protocols designed to secure communications over a computer network, TLSv1 is considered the successor to SSLv3 and includes improvements in security and performance. ...
48,174
[ { "from": "human", "value": "Is there a difference between SSLv3 and TLSv1? How does IIS6.0 control what type of security is used for a website enabled with HTTPS? \nMS says that there is a hierarchy in which the security and encryption level is negotiated before connection is established. What is this hier...
Currently it's a big PITA to create timesheet report for say a week or month in FogBugz... maybe someone knows about a plugin to that for you?
As of my last update in October 2023, FogBugz does not have built-in features for extensive timesheet reporting, which can make it challenging to generate detailed reports for a week or month. However, there are a few approaches you could consider: 1. **Third-party Integrations:** There may be third-party tools or plu...
45,290
[ { "from": "human", "value": "Currently it's a big PITA to create timesheet report for say a week or month in FogBugz... maybe someone knows about a plugin to that for you?\n" }, { "from": "gpt", "value": "As of my last update in October 2023, FogBugz does not have built-in features for extensive...
I got a templated control (a repeater) listing some text and other markup. Each item has a radiobutton associated with it, making it possible for the user to select ONE of the items created by the repeater. The repeater writes the radiobutton setting its id and name generated with the default ASP.NET naming convention ...
You've run into a common challenge when working with ASP.NET Web Forms and templated controls like Repeater. Since the Repeater generates a unique ID for each of its items, this results in each `<input type="radio">` having a different name, thus preventing them from being grouped together properly. However, there is ...
48,690
[ { "from": "human", "value": "I got a templated control (a repeater) listing some text and other markup. Each item has a radiobutton associated with it, making it possible for the user to select ONE of the items created by the repeater.\nThe repeater writes the radiobutton setting its id and name generated w...
I can't directly add ChartFrame object to my Jframe object with .add(Component) method. And it's not possible to cast from ChartFrame to JComponent. Casting ChartFrame to Component from java.awt library is also impossible. How can I add ChartFrame to JFrame the other way?
To display a `ChartFrame` in a `JFrame`, you cannot directly add `ChartFrame` because it is a top-level window in itself, similar to `JFrame`. Instead, you can use `ChartPanel`, which is a component that can be added to your JFrame. `ChartPanel` is specifically designed to display charts created with JFreeChart. Here ...
49,541
[ { "from": "human", "value": "I can't directly add ChartFrame object to my Jframe object with .add(Component) method. And it's not possible to cast from ChartFrame to JComponent. Casting ChartFrame to Component from java.awt library is also impossible. \nHow can I add ChartFrame to JFrame the other way?\n" ...
When the following two lines of code are executed in a bash script, "ls" complains that the files don't exist: dirs=/content/{dev01,dev02} ls -l $dirs When I run the script with the -x option, it appears to be passing the variable within single quotes (which would prevent globbing): + dirs=/content/{dev01,dev01} + ls ...
The behavior you are observing stems from how brace expansion works in Bash and how it interacts with variable assignments. When you run the following line in your script: ```bash dirs=/content/{dev01,dev02} ``` you are not performing a brace expansion at that moment. Instead, you are simply assigning the string `/c...
46,247
[ { "from": "human", "value": "When the following two lines of code are executed in a bash script, \"ls\" complains that the files don't exist:\ndirs=/content/{dev01,dev02}\nls -l $dirs\n\nWhen I run the script with the -x option, it appears to be passing the variable within single quotes (which would prevent...
I've a couple of extension methods I've been developing for a couple of projects, they currently rely heavily on some AJAX to make bits and pieces work. The problem is that they require copying and pasting JavaScript files to the project you want to use it in. As this JavaScript file only needs to be used once (all ins...
In ASP.NET MVC, you can add JavaScript files to the page dynamically without requiring the consumer to copy and paste or modify their pages. You can do this by creating a custom HTML helper or by using the `@section` feature available in Razor views. Here’s a detailed approach on how to achieve this: ### Step 1: Creat...
47,793
[ { "from": "human", "value": "I've a couple of extension methods I've been developing for a couple of projects, they currently rely heavily on some AJAX to make bits and pieces work. The problem is that they require copying and pasting JavaScript files to the project you want to use it in.\nAs this JavaScrip...
Is there any way to get the exposure settings (aperture, shutter speed, ISO) for a photo taken on an iPhone? An app running on the iPhone can use the UIImagePickerController interface for taking pictures, but that doesn't provide much info about the picture. The EXIF data for a photo taken on the iPhone contains apertu...
To retrieve exposure settings such as aperture, shutter speed, and ISO from photos taken with an iPhone, you'll need to access the EXIF data of the image. However, it's worth noting that the EXIF data available for a photo can vary based on the camera settings and the app used to capture the image. When using `UIImage...
46,744
[ { "from": "human", "value": "Is there any way to get the exposure settings (aperture, shutter speed, ISO) for a photo taken on an iPhone?\nAn app running on the iPhone can use the UIImagePickerController interface for taking pictures, but that doesn't provide much info about the picture.\nThe EXIF data for ...
Is there a way to restore an Sql Server 2005 DB to Sql Server 2000? I'm unable to attach it either. Any tools, ideas etc?
Restoring a SQL Server 2005 database directly to SQL Server 2000 is not straightforward, as SQL Server databases are generally not backward compatible. However, there are some potential strategies you can use to migrate the data from the SQL Server 2005 database to a SQL Server 2000 database. Here are a few approaches ...
49,639
[ { "from": "human", "value": "Is there a way to restore an Sql Server 2005 DB to Sql Server 2000? I'm unable to attach it either. Any tools, ideas etc?\n" }, { "from": "gpt", "value": "Restoring a SQL Server 2005 database directly to SQL Server 2000 is not straightforward, as SQL Server databases...
This is my first time using joomla. I don't know if I'm using the concept of a Contact in the wrong way, but I have a Contact Us menu that I've created and I've added the contact details in. I'm looking to add a sentence or two of text above the contact details & the e-mail contact form. There doesn't seem to be a w...
Welcome to Joomla! It's great that you're exploring its features. When it comes to adding text above the contact details and the email contact form on your "Contact Us" page, you have a few options. Here’s how you can do it: ### Method 1: Using a Custom HTML Module 1. **Create a Custom HTML Module**: - Go to `Exte...
46,492
[ { "from": "human", "value": "This is my first time using joomla. I don't know if I'm using the concept of a Contact in the wrong way, but I have a Contact Us menu that I've created and I've added the contact details in. I'm looking to add a sentence or two of text above the contact details & the e-mail co...
I am designing a system which will at some point require to send email notifications. So I am looking for a simple way to do this. Some background: the system will be running on Linux platform, there will be a working SMTP server somewhere on the network, the operator will configure its address, server credentials if r...
For your requirements, there are several options that allow you to send emails from a C program without the complexities of configuring sendmail or implementing low-level SMTP communication. Here are some libraries and command-line tools that can help: ### Libraries 1. **libcurl**: This is a widely-used library that s...
44,280
[ { "from": "human", "value": "I am designing a system which will at some point require to send email notifications. So I am looking for a simple way to do this. Some background: the system will be running on Linux platform, there will be a working SMTP server somewhere on the network, the operator will confi...
Other than the fact that ASP.NET MVC Web Application has more clarity in its implementation of the MVC pattern and that it strictly follows the MVC pattern, how is it different from ASP.NET Web Application? If you make your ASP.NET Web Application have a Business Logic Layer, Data Access Layer and strictly make all dat...
Your understanding of the ASP.NET Web Application architecture and how it can be organized is valid to some extent, but there are key differences between ASP.NET MVC and ASP.NET Web Forms (the original model for ASP.NET Web Applications) that extend beyond just the structure of business logic and data access layers. #...
46,177
[ { "from": "human", "value": "Other than the fact that ASP.NET MVC Web Application has more clarity in its implementation of the MVC pattern and that it strictly follows the MVC pattern, how is it different from ASP.NET Web Application?\nIf you make your ASP.NET Web Application have a Business Logic Layer, D...
I'm very interested in what F# has to offer and I'm very keen to start the time based investment necessary to learn it. However are the F# jobs going to start to materialise or could it be a wasted investment?
F# is a functional-first programming language that runs on the .NET platform. While it may not have as large a job market as languages like C# or JavaScript, there are several factors to consider regarding the demand and opportunities for F# developers: 1. **Growing Interest in Functional Programming**: There is a gro...
48,414
[ { "from": "human", "value": "I'm very interested in what F# has to offer and I'm very keen to start the time based investment necessary to learn it. However are the F# jobs going to start to materialise or could it be a wasted investment?\n" }, { "from": "gpt", "value": "F# is a functional-first...
I have this quiz application where I match what people type with the right answer. For now, what I do is basically that : if ($input =~ /$answer/i) { print "you won"; } It's nice, as if the answer is "fish" the user can type "a fish" and be counted a good answer. The problem I'm facing is that, well, my users as ...
To handle the normalization of accented characters and make your quiz application more flexible in accepting user input while avoiding hard-coding replacements, you can use the `Unicode::Collate` module in Perl. This module allows you to perform locale-aware string comparisons, including accent-insensitive matches. He...
48,678
[ { "from": "human", "value": "I have this quiz application where I match what people type with the right answer. For now, what I do is basically that :\nif ($input =~ /$answer/i) {\n print \"you won\";\n}\n\nIt's nice, as if the answer is \"fish\" the user can type \"a fish\" and be counted a good answer...
I use an sql server regularly and have recently been getting frustrated by the performance. It would be difficult for me to get direct access to find out the hardware so: Is there a direct way in management studio to assess performance or find out the exact hardware. Alternatively does someone have a set of test sql pr...
When it comes to assessing the performance of an SQL Server instance, especially if you're limited in your ability to directly access the hardware or server settings, there are several tools and methods available within SQL Server Management Studio (SSMS) that can provide insight into performance issues. ### 1. SQL Se...
41,086
[ { "from": "human", "value": "I use an sql server regularly and have recently been getting frustrated by the performance. It would be difficult for me to get direct access to find out the hardware so:\nIs there a direct way in management studio to assess performance or find out the exact hardware.\nAlternati...
I have a project requirement where I need to authenticate against ActiveDirectory in a remote/disconnected WPF application. There is probably several ways to attempt to do this, but what would be the best approach using ActiveDirectory's MembershipProvider? I need to: Authenticate that the user exists. obtain the AD u...
When working with Active Directory (AD) authentication from a remote or disconnected WPF application, you need to address several challenges, particularly since the application is outside the network where the AD is hosted. While the `MembershipProvider` is commonly used for ASP.NET applications, there are some conside...
40,069
[ { "from": "human", "value": "I have a project requirement where I need to authenticate against ActiveDirectory in a remote/disconnected WPF application.\nThere is probably several ways to attempt to do this, but what would be the best approach using ActiveDirectory's MembershipProvider?\nI need to:\n\nAuthe...
I came across this article about programming styles, seen by Edsger Dijsktra. To quickly paraphrase, the main difference is Mozart, when the analogy is made to programming, fully understood (debatable) the problem before writing anything, while Beethoven made his decisions as he wrote the notes out on paper, creating ...
Your summary of Edsger Dijkstra's views on programming styles is insightful, and it captures the essence of the contrast between the "Mozart" and "Beethoven" approaches. Let's delve deeper into your questions regarding the feasibility and potential benefits of Mozart programming in today's context. ### Is Mozart Progr...
46,973
[ { "from": "human", "value": "I came across this article about programming styles, seen by Edsger Dijsktra. To quickly paraphrase, the main difference is Mozart, when the analogy is made to programming, fully understood (debatable) the problem before writing anything, while Beethoven made his decisions as h...
I'm writing a asp.net web application in which I want the users to be able to apply simple formatting to the text they enter in text areas. One of the possibilities is to use a javascript wisywig editor (like tinymce). However, to keep the text html-clean and readible, I'd prefer that the users have to do the formattin...
If you're looking for a way to allow users to apply simple formatting to text in a way that's clean and similar to how wikis work, you might want to consider using Markdown. Markdown is a lightweight markup language with plain-text formatting syntax, and it's widely used in wikis and other applications. ### Options fo...
48,841
[ { "from": "human", "value": "I'm writing a asp.net web application in which I want the users to be able to apply simple formatting to the text they enter in text areas.\nOne of the possibilities is to use a javascript wisywig editor (like tinymce). However, to keep the text html-clean and readible, I'd pref...
At the start of any project, once you've got your object model there then comes a period of tedium as you crank out the skeleton code required. Are there any tools that will help me with this task (including unit test skeletons if possible), a bit like the scaffolding feature in Rails? Thanks.
Yes, there are several tools and frameworks across various programming languages that can help automate the creation of skeleton code and boilerplate code, including unit test skeletons. Here are some options you might find useful: ### For JavaScript/Node.js: 1. **Yeoman**: Yeoman is a scaffolding tool that helps gene...
48,812
[ { "from": "human", "value": "At the start of any project, once you've got your object model there then comes a period of tedium as you crank out the skeleton code required.\nAre there any tools that will help me with this task (including unit test skeletons if possible), a bit like the scaffolding feature i...
Code I'm working on collects performance data (eg CPU usage) from the operating system. I'm wondering if I should bother to attempt to unit test this code. It seems that to unit test code, you need to design code that is isolated into units. My code is so closely tied to the OS though that if I isolated the code out th...
You're not alone in grappling with the challenges of unit testing code that heavily interacts with the operating system. Your concerns are valid, and here are some insights to consider regarding your specific situation: ### Understanding Unit Testing 1. **What Unit Testing Is**: Unit tests are designed to test indivi...
48,820
[ { "from": "human", "value": "Code I'm working on collects performance data (eg CPU usage) from the operating system. I'm wondering if I should bother to attempt to unit test this code. It seems that to unit test code, you need to design code that is isolated into units. My code is so closely tied to the OS ...
I would like to be able to show a non-modal form in an already existing application. At the moment I can do something like: myform.ShowDialog(handleToApp); but that will create a modal form parented to the application and what I'm really looking for something that isn't modal so when the form loses focus it won't bre...
To show a non-modal form in your existing application, you can use the `Show` method instead of `ShowDialog`. The `ShowDialog` method creates a modal dialog, which means that it requires the user to close the form before they can interact with the parent form again. On the other hand, using `Show` allows the form to be...
49,139
[ { "from": "human", "value": "I would like to be able to show a non-modal form in an already existing application. At the moment I can do something like:\nmyform.ShowDialog(handleToApp);\n\nbut that will create a modal form parented to the application and what I'm really looking for something that isn't mod...
Our company has for many years had multiple domain names to protect our product name. When our webiste was first set up we had all these domain names resolving to on IP address which worked fine until now. We rewrote the site with ASP.NET MVC and now use Recaptcha. The Recaptcha keys are registered to "www.example.com"...
To achieve your goal of redirecting traffic from alternate domains to your main domain while avoiding infinite loops, you can indeed use IIS and the URL Rewrite module. Here's how to set this up: ### Setting Up Domain Redirects in IIS 1. **Add Additional Domains to IIS:** Make sure that your alternate domains (`ww...
44,114
[ { "from": "human", "value": "Our company has for many years had multiple domain names to protect our product name. When our webiste was first set up we had all these domain names resolving to on IP address which worked fine until now. We rewrote the site with ASP.NET MVC and now use Recaptcha. The Recaptcha...
I've got about 3 million files I need to copy from one folder to another over my company's SAN. What's the best way for me to do this?
Copying a large number of files, such as 3 million, can be challenging due to the potential for long transfer times, resource constraints, and the risk of interruptions. Here are some strategies to effectively copy a massive number of files over a Storage Area Network (SAN): ### 1. **Use Command-Line Tools:** - **R...
49,510
[ { "from": "human", "value": "I've got about 3 million files I need to copy from one folder to another over my company's SAN. What's the best way for me to do this? \n" }, { "from": "gpt", "value": "Copying a large number of files, such as 3 million, can be challenging due to the potential for l...
Duplicate of: Continuous Integration Servers Hi, Recently i've looked into several CIS and read a lot of articles about them. I'm kinda impressed by Hudson, because it is so easy to set up. I like to start a discussion about several CIS like CC, Bamboo, Continuum etc. It would be nice if some experienced users could t...
Hi kukudas, It's great to hear that you're exploring different Continuous Integration Servers (CIS)! Each tool has its strengths and weaknesses, and personal experiences can vary widely depending on the specific needs of your projects and teams. Here are some insights into a few popular CIS options: ### 1. **Hudson/J...
48,828
[ { "from": "human", "value": "Duplicate of: Continuous Integration Servers\n\nHi,\nRecently i've looked into several CIS and read a lot of articles about them.\nI'm kinda impressed by Hudson, because it is so easy to set up. I like to start a discussion about several CIS like CC, Bamboo, Continuum etc. It wo...
I'm trying to read document score of lucene search results. I get a set of document scores through the hits object when I use the following method : Hits hits = IndexSearcher.search(myQuery); However,if i use the method: searcher.search(myQuery, hitsCollector); I get a totally different set of document scores through t...
When you're using Apache Lucene to search and retrieve document scores, the discrepancy you're observing between the `Hits` object and a custom `HitsCollector` can be attributed to several factors. Let's clarify both approaches to understand why the scores might differ. 1. **Using `Hits`:** When you use the method ...
47,777
[ { "from": "human", "value": "I'm trying to read document score of lucene search results.\nI get a set of document scores through the hits object when I use the following method :\nHits hits = IndexSearcher.search(myQuery);\nHowever,if i use the method:\nsearcher.search(myQuery, hitsCollector);\nI get a tota...
I am trying to use C# to parse CSV. I used regular expressions to find "," and read string if my header counts were equal to my match count. Now this will not work if I have a value like: "a",""b","x","y"","c" then my output is: 'a' '"b' 'x' 'y"' 'c' but what I want is: 'a' '"b","x","y"' 'c' Is there any regex or an...
Parsing CSV files can be tricky, especially when handling values that contain commas or quotes. Instead of using regular expressions, which can become complex and difficult to maintain for such tasks, I recommend using a CSV parsing library. In C#, the `TextFieldParser` class from the `Microsoft.VisualBasic.FileIO` n...
44,859
[ { "from": "human", "value": "I am trying to use C# to parse CSV. I used regular expressions to find \",\" and read string if my header counts were equal to my match count.\nNow this will not work if I have a value like:\n\"a\",\"\"b\",\"x\",\"y\"\",\"c\"\n\nthen my output is:\n'a'\n'\"b'\n'x'\n'y\"'\n'c'\n\...
I am using Google Apps for domain to host the email from my domain and I've setup the MX records on my site according to the Google documentation. Can I also use a "sendmail" server to send additional emails from my webserver without there being a conflict with Google APPS? Specific questions: 1) I want to add MX reco...
You can use a separate Sendmail server to send emails while still using Google Apps (now known as Google Workspace) to receive emails for your domain. Here’s how you can achieve that without causing conflicts between the two: ### Answer to Your Questions: 1. **MX Records Conflict**: - MX (Mail Exchange) records a...
44,532
[ { "from": "human", "value": "I am using Google Apps for domain to host the email from my domain and I've setup the MX records on my site according to the Google documentation. Can I also use a \"sendmail\" server to send additional emails from my webserver without there being a conflict with Google APPS?\n...
We have recently switched from the Rational stack (ClearQuest/ClearCase etc..) over to TFS 2008 for our .NET group and one of the challenges that we are seeing are some of the limitations of the Team System Web Access as far as what work items a client can view. Has anyone been able to take TSWA and successfully expos...
Using Team Foundation Server (TFS) 2008, managing permissions for users accessing Team System Web Access (TSWA) can be somewhat challenging, particularly when it comes to exposing work items to clients while controlling visibility. Here are some approaches you can take to control what work items clients can view: 1. ...
49,064
[ { "from": "human", "value": "We have recently switched from the Rational stack (ClearQuest/ClearCase etc..) over to TFS 2008 for our .NET group and one of the challenges that we are seeing are some of the limitations of the Team System Web Access as far as what work items a client can view. Has anyone been...
First, I would like to say I'm not an image processing specialist. I would like to convert image colorspace from one to another, and change icc color profile at the same time. I managed to do it using JMagick (the ImageMagick Java port), but no way in pure Java (even using JAI).
Converting an image's color space and changing its ICC color profile in pure Java can be a bit challenging since Java's standard libraries do not directly provide comprehensive image processing capabilities like ImageMagick. However, you can use the `java.awt.color` package along with the `java.awt.image` package to pe...
47,247
[ { "from": "human", "value": "First, I would like to say I'm not an image processing specialist.\nI would like to convert image colorspace from one to another, and change icc color profile at the same time. I managed to do it using JMagick (the ImageMagick Java port), but no way in pure Java (even using JAI)...
I have a bash file that contains wget commands to download over 100,000 files totaling around 20gb of data. The bash file looks something like: wget http://something.com/path/to/file.data wget http://something.com/path/to/file2.data wget http://something.com/path/to/file3.data wget http://something.com/path/to/file4.da...
Running a script that downloads a large number of files using `wget` on a shared server can be done, but there are several considerations regarding reliability, resources, and session management. ### Reliability and SSH Session Management: 1. **SSH Timeout**: Most servers have an SSH timeout setting that will disconn...
46,991
[ { "from": "human", "value": "I have a bash file that contains wget commands to download over 100,000 files totaling around 20gb of data.\nThe bash file looks something like:\nwget http://something.com/path/to/file.data\nwget http://something.com/path/to/file2.data\nwget http://something.com/path/to/file3.da...
How do I translate something like this into SQLAlchemy? SELECT (a * b) - (x + y) / z AS result FROM table ORDER BY result
To translate a SQL query like the one you provided into SQLAlchemy, you'll need to use SQLAlchemy's expression language to construct the query. Here's a step-by-step guide on how to achieve this. Assuming you have a table defined in SQLAlchemy, here's how you would write the equivalent SQLAlchemy query: 1. **Define y...
48,858
[ { "from": "human", "value": "How do I translate something like this into SQLAlchemy?\nSELECT (a * b) - (x + y) / z AS result\nFROM table\nORDER BY result\n\n" }, { "from": "gpt", "value": "To translate a SQL query like the one you provided into SQLAlchemy, you'll need to use SQLAlchemy's express...
How are you managing your usage of DojoX code or widgets in a production application? The Dojo Toolkit is comprised of Core, Dijit, and DojoX. As an incubator for new ideas to extend the toolkit, DojoX code and widgets are functional with varying degrees of instability. DojoX Code like QueryReadStore (for fetching bat...
Managing the usage of DojoX code and widgets in a production application requires careful planning and continuous maintenance to ensure that your application remains stable as the Dojo Toolkit evolves. Here are some strategies to achieve this: 1. **Version Control**: Lock your dependencies to specific versions of the ...
47,032
[ { "from": "human", "value": "How are you managing your usage of DojoX code or widgets in a production application?\nThe Dojo Toolkit is comprised of Core, Dijit, and DojoX. As an incubator for new ideas to extend the toolkit, DojoX code and widgets are functional with varying degrees of instability. \nDojoX...
I've got a simple AlwaysVisibleControlExtender that extends a small Panel containing a "Loading..." message and animated GIF. The whole thing is inside an UpdateProgress control, so it only displays when my app is processing. I've got it set to display at the top center. It works fine, but I've noticed that it displays...
The issue you're experiencing with the `AlwaysVisibleControlExtender` displaying slightly offset is likely due to timing issues in the rendering of the controls. When the `UpdateProgress` control is activated, it may not have fully rendered the inner controls (like your `ProcessingPanel`) before the extender tries to c...
41,772
[ { "from": "human", "value": "I've got a simple AlwaysVisibleControlExtender that extends a small Panel containing a \"Loading...\" message and animated GIF. The whole thing is inside an UpdateProgress control, so it only displays when my app is processing. I've got it set to display at the top center. It wo...
The "Application Icon" of my application is wrong. My application shows in taskbar a different icon than the classic Delphi icon. Instead is shows the icon of one of my VCL's. That specific VCL from which the icon was "stolen" is not used in my application but other VCL's in the same package are used. Related info: - ...
This issue you're experiencing with the application icon in Delphi 7 can be tricky. Here are some steps to help you diagnose and potentially resolve the problem: 1. **Check Project Settings**: - Go to your project options and ensure that the "Application" settings have the correct icon set. Sometimes, the wrong ico...
44,994
[ { "from": "human", "value": "The \"Application Icon\" of my application is wrong.\nMy application shows in taskbar a different icon than the classic Delphi icon. Instead is shows the icon of one of my VCL's. That specific VCL from which the icon was \"stolen\" is not used in my application but other VCL's i...
I have a asp:ListBox wrapped inside an asp:UpdatePanel. The list box contains all the United States. If I select Alaska, for example, and then scroll down to select Wyoming, the listbox jumps back up to the top of the list instead of staying on Wyoming and it deselects Alaska, but Wyoming remains selected. Has anyon...
This behavior you are encountering with the `asp:ListBox` within an `asp:UpdatePanel` is a common issue related to how ASP.NET Web Forms maintains the state of controls during partial page postbacks. When you select an item in the `ListBox`, and then perform an action (like scrolling and selecting a different item), t...
48,877
[ { "from": "human", "value": "I have a asp:ListBox wrapped inside an asp:UpdatePanel. The list box contains all the United States. If I select Alaska, for example, and then scroll down to select Wyoming, the listbox jumps back up to the top of the list instead of staying on Wyoming and it deselects Alaska,...
I'm looking at some open source Java projects to get into Java and notice a lot of them have some sort of 'constants' interface. For instance, processing.org has an interface called PConstants.java, and most other core classes implement this interface. The interface is riddled with static members. Is there a reason for...
The use of a constants interface in Java, as you've observed in the `PConstants` example, is a practice that has been used in various codebases. However, it's worth discussing both the rationale behind this approach and the reasons it is generally considered a bad practice in modern Java development. ### Reasons for U...
44,941
[ { "from": "human", "value": "I'm looking at some open source Java projects to get into Java and notice a lot of them have some sort of 'constants' interface.\nFor instance, processing.org has an interface called PConstants.java, and most other core classes implement this interface. The interface is riddled ...
I'm writing a file that requires dates to be in decimal format: 2007-04-24T13:18:09 becomes 39196.554270833331000 Does anyone have a time formatter that will do this (Decimal time is what VB/Office, etc. use)? Basic code goes like follows: final DateTime date = new DateTime(2007, 04, 24, 13, 18, 9, 0, DateTimeZone.U...
To convert a `DateTime` in Joda-Time to a decimal format representing the number of days since January 1, 1900, you can use the following approach. This code snippet demonstrates how to achieve the desired decimal representation for a given date and time. Here's a complete example in Java using Joda-Time: ```java imp...
48,808
[ { "from": "human", "value": "I'm writing a file that requires dates to be in decimal format:\n\n2007-04-24T13:18:09 becomes 39196.554270833331000 \n\nDoes anyone have a time formatter that will do this (Decimal time is what VB/Office, etc. use)?\nBasic code goes like follows:\nfinal DateTime date = new Date...
Following on from this question I now have code that can attach to a process using the Mdbg API. The problem is that I can't detach from the process if I need to. When I call mgProcess.Detach().WaitOne(); ( where mgProcess is a MDbgProcess created from an MDbgEngine object ) I get the following error message: Process...
The error message you're encountering, "Process not synchronized," indicates that the process you're trying to detach from is not in a state that allows detachment. The MDbg API requires that the process is in a specific state (synchronized) before you can detach from it. Here are some steps you can take to troubleshoo...
49,801
[ { "from": "human", "value": "Following on from this question I now have code that can attach to a process using the Mdbg API.\nThe problem is that I can't detach from the process if I need to. When I call \nmgProcess.Detach().WaitOne(); ( where mgProcess is a MDbgProcess created from an MDbgEngine object ) ...
I would appreciate your opinion/advice on the following Scenario HTML has PDF file nick name, back end has URL for each nick. The link URL is always download.php?what=%PDF_Nick% to ensure download for JS disabled clients. For JS enabled clients I do JQuery AJAX call and rewrite link URL from download.php?what=%PDF_N...
Based on your scenario, it looks like you're running into an issue where the AJAX call to retrieve the download URL is causing a reload or a redirection back to the original `download.php` link. This can be explained by how you're currently handling the download functionality in the `download()` JavaScript function. H...
48,218
[ { "from": "human", "value": "I would appreciate your opinion/advice on the following\nScenario \nHTML has PDF file nick name, back end has URL for each nick. \nThe link URL is always download.php?what=%PDF_Nick% to ensure download for JS disabled clients. \nFor JS enabled clients I do JQuery AJAX call and r...
C# When I try to debug my program today I get "The requested operation requires elevation" (Vista of course). Why today? I've not changed anything the reads/writes to the registry or hard drive, where should I look? Thanks
When you encounter the "The requested operation requires elevation" error in a Windows environment (such as Windows Vista), it typically indicates that your application requires elevated privileges to perform a certain operation. Since you've mentioned that you haven't changed anything in your program, there are a few ...
45,592
[ { "from": "human", "value": "C#\nWhen I try to debug my program today I get \"The requested operation requires elevation\" (Vista of course). Why today? I've not changed anything the reads/writes to the registry or hard drive, where should I look?\nThanks\n" }, { "from": "gpt", "value": "When yo...
Why didn't languages such as C end up being using for web dev? Surely the speed increases from being compiled would be useful for heavy load sites?
Languages like C are indeed fast due to their compiled nature, but several factors contribute to the choice of other languages for web development, particularly for server-side and client-side programming. Here are some key reasons: 1. **Development Speed and Complexity**: C is a lower-level language that requires det...
46,570
[ { "from": "human", "value": "Why didn't languages such as C end up being using for web dev? Surely the speed increases from being compiled would be useful for heavy load sites?\n" }, { "from": "gpt", "value": "Languages like C are indeed fast due to their compiled nature, but several factors con...
How can the OpenFileDialog View Menu be set to Detail View?
To set the `OpenFileDialog` view to Detail View in a Windows Forms application, you typically don't have direct access to the dialog's view settings. The `OpenFileDialog` control doesn't expose properties for changing its internal view mode (like Detail View, List View, etc.) directly. However, there are a couple of w...
49,014
[ { "from": "human", "value": "How can the OpenFileDialog View Menu be set to Detail View?\n" }, { "from": "gpt", "value": "To set the `OpenFileDialog` view to Detail View in a Windows Forms application, you typically don't have direct access to the dialog's view settings. The `OpenFileDialog` con...
I have been reading the proper article in MSDN, Strong-Named Assemblies and a related Stack Overflow question, Checking an assembly for a strong name. To which extent can a strong-named assembly be verified to avoid tampering? Is it possible to use strong-naming to verify an assembly author? The first question arises...
You are correct in recognizing that strong-named assemblies serve specific purposes in the .NET framework, but they have limitations, especially in the context of security and verifying the authorship of an assembly. ### 1. Extent of Verification Against Tampering Strong naming provides a mechanism to ensure the inte...
46,427
[ { "from": "human", "value": "I have been reading the proper article in MSDN, Strong-Named Assemblies and a related Stack Overflow question, Checking an assembly for a strong name.\n\nTo which extent can a strong-named assembly be verified to avoid tampering?\nIs it possible to use strong-naming to verify an...
How do I convert text between multi-byte text strings, for example Simplified Chinese GB 2312, into UTF8 using c++ ?
To convert multi-byte text strings, such as those encoded in GB 2312, to UTF-8 in C++, you can use the standard libraries available in modern C++. Here’s an example of how you can achieve this using the `<codecvt>` header (up to C++17) or by using external libraries like `iconv`. ### Using `<codecvt>` (Up to C++17) S...
42,948
[ { "from": "human", "value": "How do I convert text between multi-byte text strings, for example Simplified Chinese GB 2312, into UTF8 using c++ ?\n" }, { "from": "gpt", "value": "To convert multi-byte text strings, such as those encoded in GB 2312, to UTF-8 in C++, you can use the standard libra...
JavaFX 1.0 was released on Thursday, Dec. 4. As a developer, what do you think of JavaFX? In your workplace, do you have any plans to move forward with JavaFX-based apps or websites? Do you have near-term plans to learn JavaFX?
JavaFX is a powerful framework for building rich internet applications and desktop applications using Java. It provides a modern approach to UI design, allowing developers to create visually appealing applications with features like CSS styling, FXML for UI layout, and a robust set of controls. Here are some thoughts ...
48,900
[ { "from": "human", "value": "JavaFX 1.0 was released on Thursday, Dec. 4. \nAs a developer, what do you think of JavaFX? In your workplace, do you have any plans to move forward with JavaFX-based apps or websites? Do you have near-term plans to learn JavaFX?\n" }, { "from": "gpt", "value": "J...
We are randomly seeing this error during long executions of our system. The error is caught by our alarm system, and we successfully retry, and continue running the system. The only hits we found on Google seem to mention corrupt installations. We do not think this is the case here, since our systems are running, get t...
It sounds like you're dealing with an intermittent error that isn’t causing a complete failure of your system, which can make troubleshooting quite challenging. Here are several steps and considerations that may help you further diagnose and potentially resolve the issue: ### 1. **Error Logging** - **Detailed Logs*...
45,049
[ { "from": "human", "value": "We are randomly seeing this error during long executions of our system. The error is caught by our alarm system, and we successfully retry, and continue running the system. The only hits we found on Google seem to mention corrupt installations. We do not think this is the case h...
My goal is to make sure that in most scenarios objects are used via a "read-only interface" that is a subset of the full interface. As an example, if I were using C++, I would just return a const object. In C#, if I could achieve this with interfaces, I would just implement a read-only interface and use it everywhere....
In C#, if you want to provide a read-only interface for your objects while allowing for operator overloading and avoiding exposing unnecessary mutability, you can use a combination of an interface and a read-only abstract base class. ### Strategy 1. **Define a Read-Only Interface**: Create an interface that exposes o...
46,428
[ { "from": "human", "value": "My goal is to make sure that in most scenarios objects are used via a \"read-only interface\" that is a subset of the full interface.\n\nAs an example, if I were using C++, I would just return a const object.\nIn C#, if I could achieve this with interfaces, I would just implemen...
Background I have an application written in native C++ over the course of several years that is around 60 KLOC. There are many many functions and classes that are dead (probably 10-15% like the similar Unix based question below asked). We recently began doing unit testing on all new code and applying it to modified cod...
Detecting dead code in a legacy C++ application, especially one as large as yours (60 KLOC), can be challenging, particularly when you want to avoid writing extensive test cases. Here are several strategies and tools you can consider to identify dead code in your project under the constraints you've outlined: ### 1. C...
48,028
[ { "from": "human", "value": "Background\nI have an application written in native C++ over the course of several years that is around 60 KLOC. There are many many functions and classes that are dead (probably 10-15% like the similar Unix based question below asked). We recently began doing unit testing on al...
I've cached a value using the ASP.NET Cache, with the following code: Cache.Insert("TEST_VALUE", 150, null, Cache.NoAbsoluteExpiration, TimeSpan.FromSeconds(120)); As I understand it, this should mean that if nothing accesses that object for 120 seconds, it will expire and return null. However, if after 10 minutes I r...
The behavior you are observing with the ASP.NET Cache can be explained by a couple of key concepts related to caching and how the Cache class operates. Let’s clarify a few points: 1. **Expiration Behavior**: The code you provided specifies that the cached item should expire after 120 seconds of inactivity, which is co...
46,503
[ { "from": "human", "value": "I've cached a value using the ASP.NET Cache, with the following code:\nCache.Insert(\"TEST_VALUE\", 150, null, Cache.NoAbsoluteExpiration, TimeSpan.FromSeconds(120));\n\nAs I understand it, this should mean that if nothing accesses that object for 120 seconds, it will expire and...
I have implemented combobox in CakePHP using following statement: echo $form->select('brand_id',array($brands),null,array(),'Choose Brand'); For brand and input form for category: echo $form->input('category_id',array('type'=>'select',$categories,'empty'=>'Choose Category')); But none of above option allows me to a...
In CakePHP, if you want to implement a combination of a combobox (dropdown) and a text input, you typically need to use a custom HTML structure, as the built-in select inputs don't directly support this functionality. Here’s how you can achieve it by manually creating your form fields. ### Step 1: Create the Dropdown ...
43,769
[ { "from": "human", "value": "I have implemented combobox in CakePHP using following statement: \necho $form->select('brand_id',array($brands),null,array(),'Choose Brand');\n\nFor brand and input form for category: \necho $form->input('category_id',array('type'=>'select',$categories,'empty'=>'Choose Category...
When designing tables, I've developed a habit of having one column that is unique and that I make the primary key. This is achieved in three ways depending on requirements: Identity integer column that auto increments. Unique identifier (GUID) A short character(x) or integer (or other relatively small numeric type) c...
Your questions touch on some fundamental aspects of database design and normalization, and it's great that you're seeking to understand the rationale behind various design choices. Let’s break down your questions one by one. ### 1. Valid Cases for Non-Consistent Row Identifiers and Clustering Across Various Columns W...
45,144
[ { "from": "human", "value": "When designing tables, I've developed a habit of having one column that is unique and that I make the primary key. This is achieved in three ways depending on requirements:\n\nIdentity integer column that auto increments.\nUnique identifier (GUID)\nA short character(x) or integ...
I am trying to use Office Automation to open a word document. The problem is that I would like to open it without invoking the Document_Open macro. Is there a way to do this? The relevant line below is wordApp.Documents.Open() Imports Microsoft.Office.Interop Public Class WordFunctions Public Shared Function Conve...
When you open a Word document via Office Automation, the `Document_Open` macro will automatically execute unless you have disabled macros or you open the document in a way that bypasses the macros. Here are a few strategies to open a Word document without invoking any `Document_Open` macros: ### Method 1: Disable Macr...
48,156
[ { "from": "human", "value": "I am trying to use Office Automation to open a word document. The problem is that I would like to open it without invoking the Document_Open macro. Is there a way to do this?\nThe relevant line below is wordApp.Documents.Open()\nImports Microsoft.Office.Interop\n\nPublic Class...
I want to convert from char representing a hexadecimal value (in upper or lower case) to byte, like '0'->0, '1' -> 1, 'A' -> 10, 'a' -> 10, 'f' -> 15 etc... I will be calling this method extremely often, so performance is important. Is there a faster way than to use a pre-initialized HashMap<Character,Byte> to get the...
To convert a character representing a hexadecimal digit (from '0' to 'f', in either upper or lower case) into a byte efficiently, your benchmark already includes several methods of varying performance. Below is a review of the most effective methods along with suggested optimizations: ### Recommended Methods 1. **Arr...
41,229
[ { "from": "human", "value": "I want to convert from char representing a hexadecimal value (in upper or lower case) to byte, like\n'0'->0, '1' -> 1, 'A' -> 10, 'a' -> 10, 'f' -> 15 etc...\n\nI will be calling this method extremely often, so performance is important. Is there a faster way than to use a pre-in...
What is the best approach in stripping leading and trailing spaces in C?
In C, to strip leading and trailing spaces from a string, you can create a function that iterates through the string to find the first non-space character and the last non-space character, then create a new string that consists of the characters in between. Here's a commonly used approach: 1. Use pointers or indices t...
46,656
[ { "from": "human", "value": "What is the best approach in stripping leading and trailing spaces in C?\n" }, { "from": "gpt", "value": "In C, to strip leading and trailing spaces from a string, you can create a function that iterates through the string to find the first non-space character and th...
I wonder if people (meaning the company/developers) really care about having [SuppressMessage] attributes lying around in the shipping assemblies. Creating separate configs in the Project files that include CODE_ANALYSIS in Release mode and then yanking it off in the final build seems kind of an avoidable overhead to m...
SuppressMessage attributes (and other code analysis attributes) can serve a useful purpose during the development and testing phases by helping developers manage code quality warnings and ensure that the codebase adheres to defined standards. However, it's generally a good practice to keep shipping assemblies clean fro...
48,569
[ { "from": "human", "value": "I wonder if people (meaning the company/developers) really care about having [SuppressMessage] attributes lying around in the shipping assemblies.\nCreating separate configs in the Project files that include CODE_ANALYSIS in Release mode and then yanking it off in the final buil...
When I pass an immutable type object(String, Integer,.. ) as final to a method I can achieve the characters of a C++ constant pointer. But how can I enforce such behavior in objects which are mutable? public void someMethod(someType someObject){ /* * code that modifies the someObject's state * */ } All I want ...
In Java, while you can use the `final` keyword to prevent reassignment of reference variables, it doesn't prevent the object's state from being modified if the object is mutable. However, there are a few approaches you can take to achieve similar behavior to a C++ constant pointer for mutable types. ### 1. Use Immutab...
49,145
[ { "from": "human", "value": "When I pass an immutable type object(String, Integer,.. ) as final to a method I can achieve the characters of a C++ constant pointer. But how can I enforce such behavior in objects which are mutable?\npublic void someMethod(someType someObject){\n /*\n * code that modifies the...
I have some questions about customers about NF mode for DB2. Google had very little information about it. I've been able to infer the following but I don't completely trust it... NF and CM (compatibility mode) are settings on DB2 v8 on mainframe. DB2 v8 on z/OS in CM is designed to allow DB2 v8 to be used as a drop i...
You have a good foundation in your understanding of DB2 and the distinctions between NF (New Function) and CM (Compatibility Mode) in DB2 v8 for z/OS. I'll provide some clarification and additional details based on what you’ve shared: 1. **Compatibility Modes**: - **Compatibility Mode (CM)**: This mode allows DB2 v...
47,427
[ { "from": "human", "value": "I have some questions about customers about NF mode for DB2. Google had very little information about it.\nI've been able to infer the following but I don't completely trust it...\n\nNF and CM (compatibility mode) are settings on DB2 v8 on mainframe.\nDB2 v8 on z/OS in CM is de...
When transmitting data, the Hamming code apparently allows you to recreate data that has been corrupted over the wire (an error correcting code). How does this work and what are its limitations, if any? Are there any better solutions for error correction (as opposed to retransmission)? Are there circumstances where ret...
Hamming code is a widely-used error-correcting code that enables the detection and correction of single-bit errors in transmitted data. Here's how it works, its limitations, and an overview of alternative error correction methods as well as when retransmission might be preferable. ### How Hamming Code Works 1. **Redu...
49,330
[ { "from": "human", "value": "When transmitting data, the Hamming code apparently allows you to recreate data that has been corrupted over the wire (an error correcting code).\nHow does this work and what are its limitations, if any?\nAre there any better solutions for error correction (as opposed to retrans...
I am trying to process an uploaded file in a Perl program, using CGI::Application. I need to get the content type of the uploaded file. From what I read, the following should work, but it doesn't for me: my $filename = $q->param("file"); my $contenttype = $q->uploadInfo($filename)->{'Content-Type'}; As it turns out,...
When you're working with file uploads in a Perl program using `CGI::Application`, it’s important to ensure that you’re correctly processing the uploaded file. The `uploadInfo` method is part of the CGI.pm library, but it should be called correctly to retrieve the information about the uploaded file. Here are a few step...
49,023
[ { "from": "human", "value": "I am trying to process an uploaded file in a Perl program, using CGI::Application. I need to get the content type of the uploaded file. From what I read, the following should work, but it doesn't for me:\nmy $filename = $q->param(\"file\");\nmy $contenttype = $q->uploadInfo($f...
How do you rotate an image with the canvas html5 element from the bottom center angle? <html> <head> <title>test</title> <script type="text/javascript"> function startup() { var canvas = document.getElementById('canvas'); var ctx = canvas.getContext('2d');...
To rotate an image around its bottom center point using the HTML5 Canvas, you'll need to adjust the translation to move the origin of the canvas context to the bottom center of the image before performing the rotation. After rotating, you'll need to draw the image such that its bottom center is aligned with the new ori...
45,457
[ { "from": "human", "value": "How do you rotate an image with the canvas html5 element from the bottom center angle?\n<html>\n <head>\n <title>test</title>\n <script type=\"text/javascript\">\n function startup() {\n var canvas = document.getElementById('canvas');\n...
Am I becoming a lazy researcher? If I don't find good answers via Google, instead of continuing to try various research methodologies, here I am at SO again... I want to host a few websites on IIS7 on Windows Server 2008. I am familiar with how to setup/configure the website. What I would like to do is setup a ftp site...
It’s completely normal to seek help on forums like Stack Overflow when you hit a wall in your research, especially when dealing with specific technical setups. It doesn’t mean you’re a lazy researcher; it just means you’re prioritizing your time and efforts effectively to find the information you need. To set up FTP s...
47,328
[ { "from": "human", "value": "Am I becoming a lazy researcher? If I don't find good answers via Google, instead of continuing to try various research methodologies, here I am at SO again...\nI want to host a few websites on IIS7 on Windows Server 2008. I am familiar with how to setup/configure the website. W...
Is there a simple and foolproof way we can test an AJAX installation? We have a problem in calling a webscript using AJAX form a JS file. The error is 'ServiceLib' is not defined. The error gets a few hits on Google. We've added some AJAX functionality to a customer's app. This works fine here in the office on dev m...
Hi Mike, It sounds like you’re facing quite a challenge with your AJAX implementation on the customer’s live server. While it can be difficult to diagnose issues remotely, here are some systematic approaches you can take to test the AJAX installation and potentially identify where the problem lies. ### Steps to Diagn...
48,456
[ { "from": "human", "value": "Is there a simple and foolproof way we can test an AJAX installation? We have a problem in calling a webscript using AJAX form a JS file. The error is 'ServiceLib' is not defined. The error gets a few hits on Google.\nWe've added some AJAX functionality to a customer's app. T...
I have a rather large project developed on Sharepoint and Project Server, designed as a multi-tier application. I programmatically manage web parts on certain web part pages. According to the choices of the user in one of the web pages, appropriate web parts are added to the web part collection of another web part page...
Managing web parts in a SharePoint and Project Server application, especially in a multi-tier architecture, can be challenging, but structuring your project correctly can help maintain clean separation of concerns and enhance maintainability. ### Recommended Approach 1. **Business Logic Layer (BLL)**: - Your BLL s...
48,724
[ { "from": "human", "value": "I have a rather large project developed on Sharepoint and Project Server, designed as a multi-tier application. I programmatically manage web parts on certain web part pages. According to the choices of the user in one of the web pages, appropriate web parts are added to the web...
I have an action handling a form post, but I want to make sure they are authenticated before the action. The problem is that the post data is lost because they user is redirected to the login page, and then back. [AcceptVerbs(HttpVerbs.Post)] [Authorize] public ActionResult AskQuestion(string question) ...
To handle the situation where you need to ensure that a user is authenticated before processing a form submission (like asking a question), and to avoid losing the posted data when redirecting to the login page, you can use a couple of strategies. Here are a few options: ### 1. Use TempData You can temporarily store ...
48,954
[ { "from": "human", "value": "I have an action handling a form post, but I want to make sure they are authenticated before the action. The problem is that the post data is lost because they user is redirected to the login page, and then back. \n [AcceptVerbs(HttpVerbs.Post)]\n [Authorize]\n public A...
When thinking about what areas should be taken into account for a localized version of an application a number of things pop up right away: Text display Date and time Units Numbers and decimals User input formats LeftToRight support Dialog and control sizes Are there other things/areas to remember or keep in mind whe...
Absolutely, localization involves a wide array of considerations beyond just text translation. Here are some additional areas to consider when building a localizable application: ### Additional Areas for Localization: 1. **Cultural Sensitivity**: - Avoid idioms, metaphors, or culturally specific references that m...
48,086
[ { "from": "human", "value": "When thinking about what areas should be taken into account for a localized version of an application a number of things pop up right away:\n\nText display\nDate and time\nUnits\nNumbers and decimals\nUser input formats\nLeftToRight support\nDialog and control sizes\n\nAre there...
I need to query for a list of available Wireless Access points. I only need their SSIDs. The App is currently .Net CF 2.0, but it's not a problem going with 3.5 if we have to.
To retrieve a list of available wireless access points and their SSIDs in a .NET Compact Framework (CF) application, you'll need to use some platform-specific APIs. Note that working with .NET CF 2.0 can be limiting since it lacks many features present in later versions like .NET CF 3.5, which has better support for ne...
44,313
[ { "from": "human", "value": "I need to query for a list of available Wireless Access points. I only need their SSIDs.\nThe App is currently .Net CF 2.0, but it's not a problem going with 3.5 if we have to.\n" }, { "from": "gpt", "value": "To retrieve a list of available wireless access points an...
I have an SSIS package that needs to lookup two different types of excel files, type A and type B and load the data within to two different staging tables, tableA and tableB. The formats of these excel sheets are different and they match their respective tables. I have thought of putting typeA.xls and typeB.xls in two ...
Your approach of using SSIS to scan the folder for unprocessed files, load them into their respective staging tables, and rename the files afterward is a common and effective strategy. Here's a detailed breakdown of how to implement this in your SSIS package: ### a) Checking the Configured Folder for the Latest File ...
44,574
[ { "from": "human", "value": "I have an SSIS package that needs to lookup two different types of excel files, type A and type B and load the data within to two different staging tables, tableA and tableB. The formats of these excel sheets are different and they match their respective tables.\nI have thought ...
Is there an equivalent to Trac written in PHP? I need something that integrates with SVN and is free. It should allow me to browse the SVN source, have some kind of bug tracking and show recent changes in the SVN. A wiki isn't essential. Thanks in advance.
Yes, there are several PHP-based alternatives to Trac that support SVN integration and offer features like bug tracking and viewing recent changes. Here are a few options to consider: 1. **MantisBT**: - **Description**: Mantis Bug Tracker (MantisBT) is a free, open-source bug tracking system that is written in PHP....
45,738
[ { "from": "human", "value": "Is there an equivalent to Trac written in PHP? I need something that integrates with SVN and is free. It should allow me to browse the SVN source, have some kind of bug tracking and show recent changes in the SVN. A wiki isn't essential.\nThanks in advance.\n" }, { "from...
need help in Fortran... This is the main loop of the program.. do iStep=0,nStep write(7,*)iStep !* Compute new temperature using FTCS scheme. do i=1,N if( istep==0) then !only for t=0 tt_new(i)=250 write(7,*)tt_new(i) else if(i==1) then tt_new(i)...
Based on the code snippet and output you've shared, it looks like the issue is with how you're treating the boundary conditions for the first and last nodes in your `if` conditions. Specifically, when you are calculating the new temperature `tt_new(i)` for the boundary nodes (i.e., the first and last nodes), you're usi...
43,880
[ { "from": "human", "value": "need help in Fortran...\nThis is the main loop of the program..\ndo iStep=0,nStep\n write(7,*)iStep\n\n !* Compute new temperature using FTCS scheme.\n do i=1,N\n if( istep==0) then !only for t=0\n tt_new(i)=250\n write(7,*)tt_new(i)\n else\...
I was wondering if it is possible to declare an array (size not known at this time), as a private member of a class and later set the size in the constructor of the class. For example: class Test { int a[]; public: Test(int size); }; Test::Test(int size) { a[size]; // this is wrong, but what can i do here? } Is th...
In C++, when you want to create an array with a size that is determined at runtime, you should use dynamic memory allocation. The syntax you provided for the array declaration (`int a[];`) is known as a "flexible array member," but it cannot be used like that in a class directly. Instead, you can use pointers along wit...
44,659
[ { "from": "human", "value": "I was wondering if it is possible to declare an array (size not known at this time), as a private member of a class and later set the size in the constructor of the class. For example:\nclass Test {\nint a[];\npublic:\nTest(int size);\n};\n\nTest::Test(int size) {\na[size]; /...
What is the appropriate method to read arguments from command line? I've read of using strings args[] but I can't come to grasp the concept of how to do it properly. Example Commands: /animal dog -c white -s medium /car civic -c green -y 1999 What would be the appropriate manner to read, /thecommand all the other -let...
To read command-line arguments in a structured way, you can split the input string into parts and analyze those parts based on your command format. The input will typically consist of a command, a main argument, and a number of additional options represented by flags (e.g., `-c`, `-s`, `-y`). Here's an example of how...
44,802
[ { "from": "human", "value": "What is the appropriate method to read arguments from command line? I've read of using strings args[] but I can't come to grasp the concept of how to do it properly.\nExample Commands:\n/animal dog -c white -s medium\n/car civic -c green -y 1999\nWhat would be the appropriate ma...
I currently have an issue in my DLR language implementation where subsequent calls to a method defined in the language occur with the same input parameters used by the first call to that method. So... if I do this in my language: PrintType( 34 ); PrintType( 34.1 ); ... the output is: Integer Integer Where I would expe...
Your understanding of the issue seems correct, and you are on the right track with your reasoning about the `Restrictions` in the DLR (Dynamic Language Runtime) environment. When you create a `MetaObject` with `Restrictions.Empty`, it indicates to the DLR that the expression can be reused without any constraints. This ...
47,614
[ { "from": "human", "value": "I currently have an issue in my DLR language implementation where subsequent calls to a method defined in the language occur with the same input parameters used by the first call to that method.\nSo... if I do this in my language:\nPrintType( 34 );\nPrintType( 34.1 );\n\n... the...
I'm working on some Silverlight controls and I would like to explicitly handle the way they appear in Blend. Specifically, these controls have dependencies that are initialized at runtime, and thus throw exceptions in the designer. But even in the absence of the exception, I would like to make them appear a certain way...
In Silverlight, handling design-time support for custom controls can be a bit tricky, as it doesn't have the same design-time extensibility model as WPF with its `*.VisualStudio.Design.dll` assemblies. However, there are a few strategies you can adopt to improve the design-time experience of your Silverlight controls i...
47,168
[ { "from": "human", "value": "I'm working on some Silverlight controls and I would like to explicitly handle the way they appear in Blend.\nSpecifically, these controls have dependencies that are initialized at runtime, and thus throw exceptions in the designer. But even in the absence of the exception, I wo...
I have a simple PowerShell script that uses WMI to create a web site on a Vista box. Yes, I know PowerShell has an IIS provider for working with IIS 7, but this script must also support IIS 6.0, so that rules that out. Anyway, the script was working just fine, but all of the sudden (and I mean that literally, I made z...
The issue you're experiencing, where a second site with a seemingly random name is created whenever you run the `CreateNewSite` method, is not uncommon when working with WMI and IIS, especially with older versions like IIS 6.0. This unexpected behavior could be due to several reasons. Here are a few possible explanatio...
46,629
[ { "from": "human", "value": "I have a simple PowerShell script that uses WMI to create a web site on a Vista box. Yes, I know PowerShell has an IIS provider for working with IIS 7, but this script must also support IIS 6.0, so that rules that out.\nAnyway, the script was working just fine, but all of the s...
I'm designing a Data Access layer for an C#/ASP.net application and I have a question regarding the treatment of parameters in sql queries. At the moment, when a query needs a dynamically set parameter for the Where clause I have to (1) define a variable to hold the value, (2) add a new QueryStringParameter to the SqlD...
Yes, there are several approaches you can take to streamline the handling of parameters in your Data Access Layer (DAL) for an ASP.NET application. You can improve the maintainability and readability of your code by encapsulating the parameter handling in a way that avoids repetition and makes it easier to manage param...
48,966
[ { "from": "human", "value": "I'm designing a Data Access layer for an C#/ASP.net application and I have a question regarding the treatment of parameters in sql queries.\nAt the moment, when a query needs a dynamically set parameter for the Where clause I have to (1) define a variable to hold the value, (2) ...
When doing a Ajax call to an MVC action currently I have my javascript inside the View, not inside its own JS file. It is then very easy to do this: var xhr = $.ajax({ url: '<%= Url.Action("DisplayItem","Home") %>/' + el1.siblings("input:hidden").val(), data: { ajax: "Y" }, cache: false, success: fu...
To move your AJAX call to its own JavaScript file while avoiding hardcoding the URL, you can pass the URL dynamically to the JavaScript file from your Razor View. There are a couple of approaches you could take. Here are two common methods: ### Method 1: Using Data Attributes 1. **Add a data attribute to an HTML elem...
47,832
[ { "from": "human", "value": "When doing a Ajax call to an MVC action currently I have my javascript inside the View, not inside its own JS file.\nIt is then very easy to do this:\nvar xhr = $.ajax({\n url: '<%= Url.Action(\"DisplayItem\",\"Home\") %>/' + el1.siblings(\"input:hidden\").val(),\n data:...
I'm wondering to using extension method to avoid checking for null in hierarchy. The example: // GetItems(), GetFirstOrDefault(), GetProduct(), GetIDProduct() are extension methods like: public static SomeType GetSomeProperty( this XYZ obj ) { if ( object.ReferenceEquals( obj, null ) ) { return default( SomeType );...
**Vote: Bad** ### Reasons: 1. **Readability and Maintainability**: While using extension methods can reduce the verbosity of null checks, it can also obscure the flow of data and the handling of nulls. When other developers read the code, they may not immediately understand that each method could return a default val...
45,997
[ { "from": "human", "value": "I'm wondering to using extension method to avoid checking for null in hierarchy.\nThe example:\n// GetItems(), GetFirstOrDefault(), GetProduct(), GetIDProduct() are extension methods like:\npublic static SomeType GetSomeProperty( this XYZ obj ) {\n if ( object.ReferenceEquals...
This is my first crack at a method that is run periodically during the lifetime of my ASP.NET application to clean up expired sessions stored in my database. It seems to work pretty well, but the software engineer in me doesn't feel "right" about this code. I've been working with LINQ to SQL for a few months now, but I...
Your code for cleaning up expired session records is functional, but there are a few areas where it could be improved, both in terms of performance and safety when accessed in a multi-threaded environment. Here are some suggestions: ### 1. Use Asynchronous Calls If your ASP.NET application is running in an environment...
46,109
[ { "from": "human", "value": "This is my first crack at a method that is run periodically during the lifetime of my ASP.NET application to clean up expired sessions stored in my database. It seems to work pretty well, but the software engineer in me doesn't feel \"right\" about this code. I've been working w...
I have a goal to build an application with UI that would run on both Windows Mobile and "normal" desktop Windows. The priority is for it to "look good" under Windows Mobile, and for desktop Windows it is OK if it distorted. Before I invest days trying, I would like to hear if that is possible to begin with. There are s...
Building an application that runs on both Windows Mobile and desktop Windows is indeed a challenging but possible task. Here are the answers to your questions: ### 1. Is .NET Compact Framework a subset of "normal" .NET Framework? The .NET Compact Framework (CF) is not strictly a subset of the .NET Framework for deskt...
48,119
[ { "from": "human", "value": "I have a goal to build an application with UI that would run on both Windows Mobile and \"normal\" desktop Windows. The priority is for it to \"look good\" under Windows Mobile, and for desktop Windows it is OK if it distorted. Before I invest days trying, I would like to hear i...
I've just started developing in Silverlight 2 and have not run into any "missing parts" of .Net that I was using in the full version. Have you found anything to be missing from Silverlight 2's version of .Net that (1) you missed, (2) really needed, or (3) had to abandon Silverlight 2 because it was missing?
Silverlight 2, while a powerful framework for building rich internet applications, does have some limitations compared to the full .NET Framework. Here are a few aspects that developers often find missing or lacking when working with Silverlight 2: 1. **Limited Class Libraries**: Silverlight 2 does not include the ent...
48,334
[ { "from": "human", "value": "I've just started developing in Silverlight 2 and have not run into any \"missing parts\" of .Net that I was using in the full version. Have you found anything to be missing from Silverlight 2's version of .Net that (1) you missed, (2) really needed, or (3) had to abandon Silver...
I'm porting a servlet from Tomcat 5.5 to OC4J 10.1.3.1. In Tomcat we set up a JDBCRealm for authentication and authorization. This was configured via the $TOMCAT_HOME/conf/server.xml. Is there a similar mechanism in OC4J? Where do I start looking for it? How do I define it?
In OC4J (Oracle Containers for Java EE), you can configure security realms for authentication and authorization, but the configuration is different from Tomcat's JDBCRealm approach. OC4J uses a combination of security policies, JAAS (Java Authentication and Authorization Service), and data source configuration. Here a...
47,304
[ { "from": "human", "value": "I'm porting a servlet from Tomcat 5.5 to OC4J 10.1.3.1.\nIn Tomcat we set up a JDBCRealm for authentication and authorization. This was configured via the $TOMCAT_HOME/conf/server.xml.\nIs there a similar mechanism in OC4J? Where do I start looking for it? How do I define it?...
I hate to have to ask, but I'm pretty stuck here. I need to test a sequence of numbers to find the first which has over 500 factors: http://projecteuler.net/index.php?section=problems&id=12 -At first I attempted to brute force the answer (finding a number with 480 after a LONG time) -I am now looking at determining the...
You're on the right track with trying to find the number of factors for triangular numbers. The key to efficiently calculating the number of factors for a number is to utilize its prime factorization rather than trying to brute force every potential divisor. ### How to Calculate the Number of Factors For a number `n...
46,027
[ { "from": "human", "value": "I hate to have to ask, but I'm pretty stuck here.\nI need to test a sequence of numbers to find the first which has over 500 factors:\nhttp://projecteuler.net/index.php?section=problems&id=12\n-At first I attempted to brute force the answer (finding a number with 480 after a LON...
In all my projects till now, I use to use singleton pattern to access Application configuration throughout the application. Lately I see lot of articles taking about not to use singleton pattern , because this pattern does not promote of testability also it hides the Component dependency. My question is what is the b...
Hi Madhu, You're correct in noting that the singleton pattern can introduce challenges in terms of testability and dependency management. However, there are alternative strategies to manage application configuration effectively without passing configuration objects throughout your application. Here are some approaches...
46,877
[ { "from": "human", "value": "In all my projects till now, I use to use singleton pattern to access Application configuration throughout the application. Lately I see lot of articles taking about not to use singleton pattern , because this pattern does not promote of testability also it hides the Component ...
what is the preferred method of deploying a web project? Just copy the dll's after compiling in release mode and registering them? or using NSIS to build an installer or the MS set up project.
The preferred method for deploying a web project can vary based on several factors including the project's size, complexity, and the environment in which it will be deployed. Here are some common approaches, along with their pros and cons: ### 1. **Manual Deployment (Copying DLLs)** - **Description**: This involves b...
47,979
[ { "from": "human", "value": "what is the preferred method of deploying a web project? Just copy the dll's after compiling in release mode and registering them? or using NSIS to build an installer or the MS set up project.\n" }, { "from": "gpt", "value": "The preferred method for deploying a web ...
I am trying to do some contract first development, and have already designed a schema where an element has minoccurs=0 and nullable=false. However I am not able to make a DataContract or XmlSerializer that generates this xsd. I have an idea that this is not possible. The only solution I have found is an ugly one, see i...
You're correct in observing that achieving a combination of `minOccurs=0` and `nullable=false` is a bit of a challenge in .NET serialization frameworks like `DataContractSerializer` or `XmlSerializer`, as they do not directly support this specific configuration out of the box. Here's a breakdown of the situation: ###...
49,564
[ { "from": "human", "value": "I am trying to do some contract first development, and have already designed a schema where an element has minoccurs=0 and nullable=false.\nHowever I am not able to make a DataContract or XmlSerializer that generates this xsd.\nI have an idea that this is not possible.\nThe only...
During practice of customizing VirtualPathProvider, I found that it the custom VirtualPathProvider can be registered in Global.asax or in AppInitialize method according to MSDN http://msdn.microsoft.com/en-us/library/system.web.hosting.virtualpathprovider.aspx. However, MSDN doesn't clearly describe the method AppIniti...
In ASP.NET, the `AppInitialize` method is not a standard part of the framework, and it does not automatically invoke a static method named `AppInitialize` located in the App_Code folder or anywhere else. However, you can define a custom static method named `AppInitialize` in your code, and then call it explicitly from...
46,431
[ { "from": "human", "value": "During practice of customizing VirtualPathProvider, I found that it the custom VirtualPathProvider can be registered in Global.asax or in AppInitialize method according to MSDN http://msdn.microsoft.com/en-us/library/system.web.hosting.virtualpathprovider.aspx. However, MSDN doe...
I'm working on a new development in C++, using MS Visual Studio 2005. For this, I need to add several new projects to my solution. I always set my warning level to 4, and turn on "treat warnings as errors" (project -> properties -> c++ -> general). Is there a way for me to tell Visual Studio that this is my default so ...
In Visual Studio 2005, while there isn’t a direct way to set the default warning level and “treat warnings as errors” for all new projects, you can achieve this by creating a custom project template. Here’s how you can do that: ### Step 1: Create a new project with your desired settings 1. Open Visual Studio 2005 and ...
47,055
[ { "from": "human", "value": "I'm working on a new development in C++, using MS Visual Studio 2005. For this, I need to add several new projects to my solution. I always set my warning level to 4, and turn on \"treat warnings as errors\" (project -> properties -> c++ -> general).\nIs there a way for me to te...
I have made a C# application and I am trying to figure out if I can tap into build events of cctray (cruise control tray)? I don't want to re-invent the wheel, I just want to know when my builds fail or succeed (on a client machine) so than my custom C# application may execute a specific set of routines.
You can indeed tap into build events from CruiseControl.NET (CCNet) and utilize them in your C# application. While CCTray is primarily a UI tool for monitoring builds, you can access the status of your builds programmatically through the CCNet API. Here's a general approach on how to accomplish this: ### 1. Use the C...
49,606
[ { "from": "human", "value": "I have made a C# application and I am trying to figure out if I can tap into build events of cctray (cruise control tray)? I don't want to re-invent the wheel, I just want to know when my builds fail or succeed (on a client machine) so than my custom C# application may execute a...
I have got two classes, one a subclass of the other (say Animal and Dog). The superclass has got some initializers (say initAnimal), the subclass has some initializers (say initDog). The problem is that it is perfecly legal (from the compiler’s viewpoint) to do something like Dog *adog = [[Dog alloc] initAnimal], ie. i...
What you're encountering is a common concern when dealing with inheritance and initialization in object-oriented programming. In Objective-C, while you can certainly call a superclass's initializer in a subclass, as you've noted, it can lead to issues if the subclass has additional properties that need to be initialize...
46,951
[ { "from": "human", "value": "I have got two classes, one a subclass of the other (say Animal and Dog). The superclass has got some initializers (say initAnimal), the subclass has some initializers (say initDog). The problem is that it is perfecly legal (from the compiler’s viewpoint) to do something like Do...