instruction
stringlengths
14
27.6k
completion
stringlengths
3
38.3k
__original_row_idx
int64
0
50k
conversations
listlengths
2
2
I'm having a syntax error. I want to take the floor of a function that returns a floating point number. I thought this would give me the right answer let cyclesPerInterrupt bps bpw cpu factor = floor (fudge (float(factor) cyclesPerWord cpu wordsPerSec bps bpw)) But it doesn't. I've tried everything I can think of, a...
The syntax error in your code snippet appears to be due to how you are calling the `fudge` function. In the code you provided, you're using parentheses around `float(factor)`, which may be misleading. Additionally, it looks like you might be trying to use some parameters without proper function argument syntax. The fu...
43,086
[ { "from": "human", "value": "I'm having a syntax error.\nI want to take the floor of a function that returns a floating point number.\nI thought this would give me the right answer\nlet cyclesPerInterrupt bps bpw cpu factor = \n floor (fudge (float(factor) cyclesPerWord cpu wordsPerSec bps bpw))\n\nBut it d...
How is a breakpoint implemented on PPC (On OS X, to be specific)? For example, on x86 it's typically done with the INT 3 instruction (0xCC) -- is there an instruction comparable to this for ppc? Or is there some other way they're set/implemented?
In PowerPC (PPC) architecture, breakpoints are typically implemented using the `trap` instruction. The `trap` instruction causes an exception to be raised, which is how debuggers handle breakpoints. Unlike x86, which uses the `INT 3` (opcode `0xCC`), PowerPC does not have a direct equivalent single-byte instruction for...
42,301
[ { "from": "human", "value": "How is a breakpoint implemented on PPC (On OS X, to be specific)?\nFor example, on x86 it's typically done with the INT 3 instruction (0xCC) -- is there an instruction comparable to this for ppc? Or is there some other way they're set/implemented?\n" }, { "from": "gpt",...
How do large server farms handle gracefully shutting down all or part of the farm? I'm thinking of planed and unplanned cases like: "We need to shutdown Rack 42" "We need to do work on the power feeds to the whole block" "Blackout! UPS's running out of Juice! Aahh!" "AC is down, air temp is 125F and climbing" The i...
Handling the shutdown of large server farms requires meticulous planning and execution to ensure data integrity, service availability, and safety. Here’s how these processes can be managed during both planned and unplanned shutdown scenarios: ### 1. Planned Shutdowns #### a. Pre-Shutdown Planning - **Notification**: ...
37,751
[ { "from": "human", "value": "How do large server farms handle gracefully shutting down all or part of the farm? I'm thinking of planed and unplanned cases like:\n\n\"We need to shutdown Rack 42\" \n\"We need to do work on the power feeds to the whole block\" \n\"Blackout! UPS's running out of Juice! Aahh!\"...
I'm looking to generate a random number and issue it to a table in a database for a particular user_id. The catch is, the same number can't be used twice. There's a million ways to do this, but I'm hoping someone very keen on algorithms has a clever way of solving the problem in an elegant solution in that the followin...
To generate a unique random number for a user while minimizing database queries and in-memory processing, you can leverage a set-based approach combined with efficient querying. Here’s a step-by-step outline to implement this elegantly: ### Approach: 1. **Pre-fill a Set with Existing Numbers**: Before you begin g...
37,808
[ { "from": "human", "value": "I'm looking to generate a random number and issue it to a table in a database for a particular user_id. The catch is, the same number can't be used twice. There's a million ways to do this, but I'm hoping someone very keen on algorithms has a clever way of solving the problem in...
I have a static class that I would like to raise an event as part of a try catch block within a static method of that class. For example in this method I would like to raise a custom event in the catch. public static void saveMyMessage(String message) { try { //Do Database stuff } catch (Excep...
To raise a custom event from a static method in a static class in C#, you need to define the event and the delegate type, and then invoke the event in the `catch` block. Here’s how you can accomplish this: 1. Define a delegate type that represents the method that can handle the event. 2. Define the event using that de...
37,746
[ { "from": "human", "value": "I have a static class that I would like to raise an event as part of a try catch block within a static method of that class.\nFor example in this method I would like to raise a custom event in the catch. \npublic static void saveMyMessage(String message)\n{\n try\n {\n ...
I'm looking for good patterns for implementing a paged table of results in ASP.NET MVC with sorting, filtering, and paging provided via AJAX. It seems to me that I should have my controller actions provide only the data and not mark up to maintain the separation of concerns -- so the Ajax callback would provide new ta...
You're on the right track by focusing on separating concerns and using AJAX for your paginated table in ASP.NET MVC. This approach allows for a smoother user experience by updating only parts of the page rather than reloading it entirely. Here’s a structured way to implement a paged table with sorting, filtering, and p...
33,427
[ { "from": "human", "value": "I'm looking for good patterns for implementing a paged table of results in ASP.NET MVC with sorting, filtering, and paging provided via AJAX. It seems to me that I should have my controller actions provide only the data and not mark up to maintain the separation of concerns -- ...
I have a controller action that is being executed by a link that was created using 'Ajax.ActionLink()' the problem is that I can't tell in my action that the request is an AJAX request because Request.IsMvcAjaxRequest() is always returning false. Does Request.IsMvcAjaxRequest() not work with Ajax.ActionLink() generated...
The issue you're encountering stems from how AJAX requests are handled, particularly with the HTTP DELETE method. The `Request.IsMvcAjaxRequest()` method typically checks for the presence of certain headers that are added during AJAX requests, such as `X-Requested-With: XMLHttpRequest`. When you use `Ajax.ActionLink(...
38,329
[ { "from": "human", "value": "I have a controller action that is being executed by a link that was created using 'Ajax.ActionLink()' the problem is that I can't tell in my action that the request is an AJAX request because Request.IsMvcAjaxRequest() is always returning false.\nDoes Request.IsMvcAjaxRequest()...
Given this XML ... <ListBucketResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> <Name>public.rpmware.com</Name> <Prefix></Prefix> <Marker></Marker> <MaxKeys>1000</MaxKeys> <IsTruncated>false</IsTruncated> <Contents> <Key>0.dir</Key> <LastModified>2008-06-25T16:09:49.000Z</LastModified> <ETag>"0ba2a466...
It looks like you are encountering an issue when trying to parse the XML you provided using LINQ to XML in C#. The problem arises from the fact that your XML contains a default namespace (`xmlns="http://s3.amazonaws.com/doc/2006-03-01/"`). When dealing with XML that has namespaces, you need to account for the namespace...
40,585
[ { "from": "human", "value": "Given this XML ...\n<ListBucketResult xmlns=\"http://s3.amazonaws.com/doc/2006-03-01/\">\n <Name>public.rpmware.com</Name>\n <Prefix></Prefix>\n <Marker></Marker>\n <MaxKeys>1000</MaxKeys>\n <IsTruncated>false</IsTruncated>\n <Contents>\n <Key>0.dir</Key>\n <LastModified>2008-...
The title is a bit abstract so maybe it is easier to explain with a specific example: I find it useful to have my exception classes take an enum parameter instead of a string message. throw new SpecificException(SpecificExceptionCode.ThisThingWentWrong); There are few reasons for this, including: I can encapulate al...
You're right that C# does not allow static abstract members in the way you're attempting to use them. However, you can achieve similar functionality with a combination of a non-static abstract property and a protected constructor in your base exception class. Here's how you can refactor your code to meet your requireme...
38,498
[ { "from": "human", "value": "The title is a bit abstract so maybe it is easier to explain with a specific example:\nI find it useful to have my exception classes take an enum parameter instead of a string message. \nthrow new SpecificException(SpecificExceptionCode.ThisThingWentWrong);\n\nThere are few reas...
I have a huge list of person's full names that I must search in a huge text. Only part of the name may appear in the text. And it is possible to be misspelled, misstyped or abreviated. The text has no tokens, so I don't know where a person name starts in the text. And I don't if know if the name will appear or not in t...
Searching for names in a text under the conditions you've described is a complex task, but a combination of heuristics and fuzzy matching techniques can yield good results. Here's a step-by-step approach you can consider: ### Step 1: Preprocessing 1. **Lowercase Transformation**: Convert both the text and the names i...
40,006
[ { "from": "human", "value": "I have a huge list of person's full names that I must search in a huge text.\nOnly part of the name may appear in the text. And it is possible to be misspelled, misstyped or abreviated. The text has no tokens, so I don't know where a person name starts in the text. And I don't i...
When I'm on master, I only have to type 'git push' to push commits to the remote repo. I wish I could do so when I'm on another branch, without specifying the remote name and the branch name. Like that: Now: git push origin experimental:origin/experimental Need: git push
To achieve the desired behavior of being able to just type `git push` from any branch (including your `experimental` branch) without specifying the remote name and branch name, you need to set the upstream tracking branch for your branch. This can be done using the following command: 1. **Switch to your branch** (if y...
43,340
[ { "from": "human", "value": "When I'm on master, I only have to type 'git push' to push commits to the remote repo. I wish I could do so when I'm on another branch, without specifying the remote name and the branch name. Like that:\nNow: git push origin experimental:origin/experimental\nNeed: git push\n" ...
If you followed my previous post var filteredUser = from U in collection select new {U.fname,U.lname}; gridView.DataSource = filteredUser; gridView.DataBind(); Now I am trying to do this: Format the column names based on properties of U. So for example if U.fnam...
To format the column names in your GridView based on the properties of your object `U`, you can use the `AutoGenerateColumns` property of the GridView and set `AutoGenerateColumns` to `false`. Then, manually define your columns using the `BoundField` elements, specifying the `DataField` to match the property names you ...
38,335
[ { "from": "human", "value": "If you followed my previous post\nvar filteredUser = from U in collection\n select new {U.fname,U.lname};\n gridView.DataSource = filteredUser;\n gridView.DataBind();\n\nNow I am trying to do this:\n\nFormat the column names b...
I see two types of examples in various places. One uses form fields like curl -X PUT -d "phone=123.456.7890" "http://127.0.0.1/services/rest/user/123" and the other uses an XML content like (some variation of) this echo "<user><id>123</id><phone>123.456.7890</phone></user>" | curl -X PUT -d @- "http://127.0.0.1/serv...
When designing RESTful APIs, the choice between using form fields (application/x-www-form-urlencoded) and XML (or other structured formats like JSON) for data transfer often depends on a variety of factors, including clarity, completeness, and the specific use case of the API. Here are some considerations for both appr...
36,428
[ { "from": "human", "value": "I see two types of examples in various places. One uses form fields like\n\ncurl -X PUT -d \"phone=123.456.7890\" \"http://127.0.0.1/services/rest/user/123\"\n\nand the other uses an XML content like (some variation of) this\n\necho \"<user><id>123</id><phone>123.456.7890</phone...
I am trying to build a CAML query for SharePoint 2007 environment, to get items from a calendar list. Want to query items with a given 'From date' and 'To date', the calendar list contains 'EventDate' and 'EndDate' in Datetime format. I am only interested in the date part of the datetime field. How can I trim the "Even...
In SharePoint 2007, when building a CAML query to retrieve items from a calendar list based on date criteria using `EventDate` and `EndDate`, it's important to note that CAML queries do not directly support date manipulation like truncating to just the date portion. However, you can construct your query to compare the ...
40,993
[ { "from": "human", "value": "I am trying to build a CAML query for SharePoint 2007 environment, to get items from a calendar list. Want to query items with a given 'From date' and 'To date', the calendar list contains 'EventDate' and 'EndDate' in Datetime format. I am only interested in the date part of the...
I'm trying to expose this function to Python using SWIG: std::vector<int> get_match_stats(); And I want SWIG to generate wrapping code for Python so I can see it as a list of integers. Adding this to the .i file: %include "typemaps.i" %include "std_vector.i" namespace std { %template(IntVector) vector<int>; } I'm...
To address your question about exposing a C++ function using SWIG and the warnings related to strict aliasing, let's break it down into two parts: the SWIG interface and the warning. ### Exposing the Function with SWIG Your SWIG interface definition looks mostly correct for exposing a `std::vector<int>` to Python. He...
39,502
[ { "from": "human", "value": "I'm trying to expose this function to Python using SWIG:\nstd::vector<int> get_match_stats();\n\nAnd I want SWIG to generate wrapping code for Python so I can see it as a list of integers.\nAdding this to the .i file:\n\n%include \"typemaps.i\"\n%include \"std_vector.i\"\n\nname...
I am using a specific command in in my C# code, which works well. However, it is said to misbehave in "unmanaged" code. What is managed or unmanaged code?
In the context of C# and the .NET framework, the terms "managed" and "unmanaged" code refer to how memory management and execution are handled: ### Managed Code: - **Definition**: Managed code is code that is executed by the .NET Common Language Runtime (CLR). The CLR provides various services such as garbage collecti...
42,087
[ { "from": "human", "value": "I am using a specific command in in my C# code, which works well. However, it is said to misbehave in \"unmanaged\" code.\nWhat is managed or unmanaged code?\n" }, { "from": "gpt", "value": "In the context of C# and the .NET framework, the terms \"managed\" and \"unm...
I'm trying to make a TCP Client program in C where the client will start up, connect to a server. Then it will send a little information and then just listen to what it receives and react accordingly. The part that I'm having trouble with is the continuous listening. Here is what I have ... while (1) { numbytes = r...
It looks like your TCP client is running into an issue with receiving data from the server. The error you're seeing (`Count: -1, Error: 111`) indicates that there is a problem with the connection; error 111 corresponds to "Connection refused," which typically means that there is no server listening at the specified add...
37,856
[ { "from": "human", "value": "I'm trying to make a TCP Client program in C where the client will start up, connect to a server. Then it will send a little information and then just listen to what it receives and react accordingly.\nThe part that I'm having trouble with is the continuous listening. Here is wh...
I currently have Apache HTTP Server, but I'm guessing I'll need Tomcat (and then have to configure it in a way that makes it not open to the public), a Java JDK (which I already have, but should probably update), and an IDE (I have Eclipse). But what else should I have or know before starting?
You're on the right track by considering the components you'll need for setting up a Java-based web application environment. Here's a checklist of additional things you might want to consider or know before getting started: 1. **Tomcat Configuration**: - Make sure to properly configure your Tomcat server. This incl...
38,561
[ { "from": "human", "value": "I currently have Apache HTTP Server, but I'm guessing I'll need Tomcat (and then have to configure it in a way that makes it not open to the public), a Java JDK (which I already have, but should probably update), and an IDE (I have Eclipse). But what else should I have or know b...
If I have a for loop which is nested within another, how can I efficiently come out of both loops (inner and outer) in the quickest possible way? I don't want to have to use a boolean and then have to say go to another method, but rather just to execute the first line of code after the outer loop. What is a quick and n...
In C#, if you want to break out of both a nested for loop (an inner loop within an outer loop), the most straightforward way to do this without using flags or exceptions is to use a `goto` statement or to refactor your code into a method. However, using `goto` is generally not recommended because it can lead to less re...
40,428
[ { "from": "human", "value": "If I have a for loop which is nested within another, how can I efficiently come out of both loops (inner and outer) in the quickest possible way?\nI don't want to have to use a boolean and then have to say go to another method, but rather just to execute the first line of code a...
How can I start writing a plugin for Eclipse? I've looked for documentation, but unfortunately there is very little or it's poor, so what articles can recommended?
Writing a plugin for Eclipse can seem daunting at first, but with the right resources, you can get started effectively. Here's a step-by-step guide along with some recommended articles and resources: ### Step-by-Step Guide to Start Writing an Eclipse Plugin 1. **Install Eclipse IDE for RCP and RAP Developers**: -...
40,712
[ { "from": "human", "value": "How can I start writing a plugin for Eclipse?\nI've looked for documentation, but unfortunately there is very little or it's poor, so what articles can recommended?\n" }, { "from": "gpt", "value": "Writing a plugin for Eclipse can seem daunting at first, but with the...
Has anyone attempted this? Is it possible, and if so, what kind of problems will I run into if I try to accomplish it?
To provide a more accurate response, I need some context about what "this" refers to. Are you asking about a specific project, idea, or goal? Please provide additional details, and I'll do my best to help you understand its feasibility and potential challenges.
44,722
[ { "from": "human", "value": "Has anyone attempted this? Is it possible, and if so, what kind of problems will I run into if I try to accomplish it?\n" }, { "from": "gpt", "value": "To provide a more accurate response, I need some context about what \"this\" refers to. Are you asking about a spec...
I have created a windows installer for a windows forms app as an MSI. I have published this and put it in a zip file and sent it to the client. When they try to run the installer they get the message 'The publisher could not be verified. Are you sure you want to run this software?’ Is there a setting or something i ne...
The warning message "The publisher could not be verified" is a standard security feature in Windows to protect users from potentially harmful software. This message appears because the application is not digitally signed with a trusted code-signing certificate. To prevent this message from appearing, you can take the f...
42,095
[ { "from": "human", "value": "I have created a windows installer for a windows forms app as an MSI.\nI have published this and put it in a zip file and sent it to the client.\nWhen they try to run the installer they get the message \n'The publisher could not be verified. Are you sure you want to run this sof...
From my experiments, it does not appear to do so. If this is indeed true, what is the best method for removing line breaks? I'm currently experimenting with the parameters that TRIM accepts of the character to remove, starting with trimming \n and \r.
If you're looking to remove line breaks from a string in a programming context, you can often achieve this using a combination of string manipulation methods or regular expressions, depending on the language you are using. The `TRIM` function, in many programming languages, is typically used to remove whitespace charac...
40,282
[ { "from": "human", "value": "From my experiments, it does not appear to do so. If this is indeed true, what is the best method for removing line breaks? I'm currently experimenting with the parameters that TRIM accepts of the character to remove, starting with trimming \\n and \\r.\n" }, { "from": "...
How can I switch between GroupStyles for a ListView based on some conditions at run time? For instance I need to use Default for items that that have GroupStyle Header name null, and if it is not null then use the custom GroupStyle theme? I tried GroupStyleSelector, and it doesn't work, because it works for multi lev...
To switch between `GroupStyle` for a `ListView` based on runtime conditions in WPF, you can use a combination of a `GroupStyleSelector` along with custom logic to determine which style to apply. Since you mentioned that you're only using single-level grouping and the `GroupStyleSelector` is not working for your needs,...
37,229
[ { "from": "human", "value": "How can I switch between GroupStyles for a ListView based on some conditions at run time? For instance I need to use Default for items that that have GroupStyle Header name null, and if it is not null then use the custom GroupStyle theme? I tried GroupStyleSelector, and it doe...
If I have a query to return all matching entries in a DB that have "news" in the searchable column (i.e. SELECT * FROM table WHERE column LIKE %news%), and one particular row has an entry starting with "In recent World news, Somalia was invaded by ...", can I return a specific "chunk" of an SQL entry? Kind of like a te...
Yes, you can return a specific "chunk" or teaser of an SQL entry by using SQL string functions to manipulate the text. SQL does not have built-in functionality specifically for extracting a teaser, but you can use functions to achieve a similar effect. Here's a general approach using SQL: 1. **Use `SUBSTRING()` (or ...
41,880
[ { "from": "human", "value": "If I have a query to return all matching entries in a DB that have \"news\" in the searchable column (i.e. SELECT * FROM table WHERE column LIKE %news%), and one particular row has an entry starting with \"In recent World news, Somalia was invaded by ...\", can I return a specif...
I noticed how SLIME (lisp development package for Emacs) does not come with a frame-source-location function for CLISP, so you can't automagically jump to a source location when inside the debugger. Given that, I figured CLISP users must be using some other IDE (though I guess IDE is a little bit misleading here, maybe...
While SLIME is the most popular development environment for Common Lisp in Emacs, it is primarily designed with SBCL (Steel Bank Common Lisp) in mind, and not all features work seamlessly with CLISP. However, CLISP users can still utilize a few alternatives or workarounds for a better development experience in Emacs: ...
40,912
[ { "from": "human", "value": "I noticed how SLIME (lisp development package for Emacs) does not come with a frame-source-location function for CLISP, so you can't automagically jump to a source location when inside the debugger. Given that, I figured CLISP users must be using some other IDE (though I guess I...
How do you create non scrolling div that looks like the MS Office 2007 ribbon on a web page without two sets of scroll bars. One for the window and one for the div.
Creating a non-scrolling div that mimics the appearance of the MS Office 2007 ribbon involves using CSS to style the div and prevent any scrolling within it. This can be achieved using a combination of CSS properties to manage overflow and layout. Below is an example of how to create such a ribbon-like effect: ### HTM...
38,021
[ { "from": "human", "value": "How do you create non scrolling div that looks like the MS Office 2007 ribbon on a web page without two sets of scroll bars. One for the window and one for the div.\n" }, { "from": "gpt", "value": "Creating a non-scrolling div that mimics the appearance of the MS Off...
I have the following query which works except that I would like it to behave differently. Now it looks for all the duplicate rows on url and returns it in the order of number of duplicate urls. I use GROUP_ CONCAT to seperate all the different screen_name's. However there can be multiple rows with the same url and sam...
To achieve the desired behavior of retrieving distinct `screen_name`s while still aggregating data by `url`, you need to adjust your query slightly. You can use a subquery to first get the distinct `screen_name` for each `url` and then apply `GROUP_CONCAT` in the outer query. Here's how you can do it: ```sql SELECT ...
43,657
[ { "from": "human", "value": "I have the following query which works except that I would like it to behave differently. Now it looks for all the duplicate rows on url and returns it in the order of number of duplicate urls. I use GROUP_ CONCAT to seperate all the different screen_name's. \nHowever there can ...
Is there a way to install all versions of all browsers on one machine?
Yes, it is possible to install multiple versions of different web browsers on a single machine, but there are some considerations and limitations. Here's a general overview: ### 1. **Using Portable Versions** Many browsers offer portable versions that can run without needing to be installed traditionally. This means y...
41,259
[ { "from": "human", "value": "Is there a way to install all versions of all browsers on one machine?\n" }, { "from": "gpt", "value": "Yes, it is possible to install multiple versions of different web browsers on a single machine, but there are some considerations and limitations. Here's a general...
Besides the sample applications featured in the books Beginning Groovy and Grails and The Definitive Guide to Grails, are there any applications out there written in Grails that are good examples from which to learn best practices? Such as real applications that are open-source?
Yes, there are several open-source applications written in Grails that can serve as good examples for learning best practices. Here are some notable ones: 1. **Grails Application Template**: This is a simple scaffolded application that can help you understand the basic structure of a Grails app. While not a fully-feat...
41,919
[ { "from": "human", "value": "Besides the sample applications featured in the books Beginning Groovy and Grails and The Definitive Guide to Grails, are there any applications out there written in Grails that are good examples from which to learn best practices? Such as real applications that are open-source?...
What are the benefits of having a member variable declared as read only? Is it just protecting against someone changing its value during the lifecycle of the class or does using this keyword result in any speed or efficiency improvements?
Declaring a member variable as read-only (often referred to as `readonly` in languages like C# or `final` in Java) provides several benefits, both in terms of design and potential performance, though the primary focus is usually on design and safety rather than speed. Here are the main benefits: ### 1. **Encapsulation...
42,610
[ { "from": "human", "value": "What are the benefits of having a member variable declared as read only? Is it just protecting against someone changing its value during the lifecycle of the class or does using this keyword result in any speed or efficiency improvements?\n" }, { "from": "gpt", "val...
Except perhaps at bigger (or better) shops, the development UI is done by the developers. In your experience, how much has this impacted the final product, and how much time should we spend getting the development UI right?
The development UI, or developer user interface, plays a significant role in shaping the final product, especially in terms of developer productivity, code quality, and overall project success. Here are some key points to consider regarding its impact and the time investment needed: ### Impact on Final Product 1. **P...
38,404
[ { "from": "human", "value": "Except perhaps at bigger (or better) shops, the development UI is done by the developers. In your experience, how much has this impacted the final product, and how much time should we spend getting the development UI right?\n" }, { "from": "gpt", "value": "The devel...
I the following styles: a.button { background-color: orange; margin: .2cm; padding: .2cm; color: black; font-family: sans-serif; text-decoration: none; font-weight: bold; border: solid #000000; } a.buttonMouseover { background-color: darkGoldenRod; margin: .2cm; padding: .2c...
You're off to a great start with your HTML, CSS, and JavaScript! However, there are some areas where you can improve your code for better readability and functionality. ### Issues in Your Code 1. **JavaScript Assignment vs Comparison**: In your JavaScript, you used a single equals sign (`=`) instead of a double equals...
39,156
[ { "from": "human", "value": "I the following styles:\na.button {\n background-color: orange;\n margin: .2cm;\n padding: .2cm;\n color: black;\n font-family: sans-serif;\n text-decoration: none;\n font-weight: bold;\n border: solid #000000;\n}\n\na.buttonMouseover {\n background-co...
Is there any reason to avoid using text-align: justify;? Does it reduce readability or cause problems?
Using `text-align: justify;` can have both benefits and drawbacks, and whether or not to use it depends on the context and design objectives of your text presentation. Here are some reasons you might want to avoid it: ### Potential Issues with Justified Text 1. **Readability**: Justified text can create uneven spacin...
41,306
[ { "from": "human", "value": "Is there any reason to avoid using text-align: justify;? \nDoes it reduce readability or cause problems?\n" }, { "from": "gpt", "value": "Using `text-align: justify;` can have both benefits and drawbacks, and whether or not to use it depends on the context and desig...
I've been using the idiom below for some time now. And it seems to be the most wide-spread, at least on the sites I've visited. Is there a better/different way to read a file into a string in Java? private String readFile(String file) throws IOException { BufferedReader reader = new BufferedReader(new FileReader (f...
Your current method for reading a file into a string is effective, but there are more modern and concise ways to achieve the same result in Java, especially if you are using Java 7 or higher. One such method utilizes the `Files` class from the `java.nio.file` package. This approach not only simplifies your code but als...
40,599
[ { "from": "human", "value": "I've been using the idiom below for some time now. And it seems to be the most wide-spread, at least on the sites I've visited.\nIs there a better/different way to read a file into a string in Java?\nprivate String readFile(String file) throws IOException {\n BufferedReader r...
I have a website that was originally developed using a SQL Express database in the App_Data folder. Now I need to take upgrade it, without loosing any data, to SQL Server 2005 Workgroup or Standard. Is there a guide on how to properly upgrade by Microsoft or another source?
Upgrading your website from SQL Server Express (which typically stores its database files in the App_Data folder) to SQL Server 2005 Workgroup or Standard requires careful planning to ensure that no data is lost during the transition. Here's a step-by-step guide to help you with the upgrade process: ### Step-by-Step U...
39,769
[ { "from": "human", "value": "I have a website that was originally developed using a SQL Express database in the App_Data folder. Now I need to take upgrade it, without loosing any data, to SQL Server 2005 Workgroup or Standard. \nIs there a guide on how to properly upgrade by Microsoft or another source?\n"...
I'm just beginning work with IIS, .NET, etc. so I apologize if any of this is unclear. I recently installed a local instance of IIS and it's up and running just fine. I'm wondering if it's possible to point IIS to a shared windows folder that exists on another server, and have that folder serve as the root directory fo...
Yes, it is indeed possible to configure IIS to serve files from a shared Windows folder located on another server. However, there are several steps and considerations to set this up properly, especially when dealing with shared folders that require authentication. Below is a step-by-step guide along with resources to h...
35,840
[ { "from": "human", "value": "I'm just beginning work with IIS, .NET, etc. so I apologize if any of this is unclear. I recently installed a local instance of IIS and it's up and running just fine. I'm wondering if it's possible to point IIS to a shared windows folder that exists on another server, and have t...
I am attempting to link an application with g++ on this Debian lenny system. ld is complaining it cannot find specified libraries. The specific example here is ImageMagick, but I am having similar problems with a few other libraries too. I am calling the linker with: g++ -w (..lots of .o files/include directories/etc.....
It looks like you're trying to link against the `libmagic` library, but the linker is unable to find it using the `-lmagic` flag. Here are some steps you can take to diagnose and resolve the issue: 1. **Library Path**: You have provided `-L/usr/lib`, which is the correct option to specify the library directory. Make s...
40,166
[ { "from": "human", "value": "I am attempting to link an application with g++ on this Debian lenny system. ld is complaining it cannot find specified libraries. The specific example here is ImageMagick, but I am having similar problems with a few other libraries too.\nI am calling the linker with:\ng++ -w (....
I want to put my dependent files in the app directory. I seem to remember that you can force VB6 to use the files in the local directory only. Any hints?
In Visual Basic 6 (VB6), if you want to ensure that your application uses the dependent files (such as DLLs or OCX files) located in the application directory instead of searching the system directories (like System32), you can employ several strategies. Here are a few hints to help you with that: 1. **Set the Current...
41,986
[ { "from": "human", "value": "I want to put my dependent files in the app directory.\nI seem to remember that you can force VB6 to use the files in the local directory only.\nAny hints?\n" }, { "from": "gpt", "value": "In Visual Basic 6 (VB6), if you want to ensure that your application uses the ...
I've created a workflow/flowchart style designer for something. At the moment it is using relatively simple Bezier curve lines to connect up the various end points of the "blocks" on the workflow. However I would like something a bit more intuitive for the user. I want the lines to avoid obstacles like other blocks (re...
Creating an intuitive workflow designer with Bezier curve connections that intelligently avoids obstacles like blocks and lines is a challenging but interesting problem. There are several potential approaches to achieve this in .NET. ### Suggested Approaches 1. **Custom Bezier Routing Algorithm:** - Implement a cu...
38,290
[ { "from": "human", "value": "I've created a workflow/flowchart style designer for something. At the moment it is using relatively simple Bezier curve lines to connect up the various end points of the \"blocks\" on the workflow.\nHowever I would like something a bit more intuitive for the user. I want the li...
I'm using Java 1.5 and I'd like to launch the associated application to open the file. I know that Java 1.6 introduced the Desktop API, but I need a solution for Java 1.5. So far I found a way to do it in Windows: Runtime.getRuntime().exec(new String[]{ "rundll32", "url.dll,FileProtocolHandle...
In Java 1.5, there is no direct built-in way to launch the associated application for a given file in a cross-platform manner since the Desktop API was introduced in Java 1.6. However, you can achieve similar functionality using the `Runtime.exec()` method for both Windows and Linux by calling the appropriate system co...
42,277
[ { "from": "human", "value": "I'm using Java 1.5 and I'd like to launch the associated application to open the file. I know that Java 1.6 introduced the Desktop API, but I need a solution for Java 1.5.\nSo far I found a way to do it in Windows:\nRuntime.getRuntime().exec(new String[]{ \"rundll32\", \n ...
I want to host a test app in ASP.NET 3.5 but I can't find a decent free host anywhere! I tried http://www.aspspider.com/ and after some days I still have a pending virtual directory creation. Even if it has lots of banners with pub on it, it doesn't matter. I just want to try out something! Thanks.
Finding a free hosting service that supports ASP.NET 3.5 can indeed be challenging, especially since many free hosts have limited resources or slow support times. However, here are a few options you might consider for hosting your ASP.NET 3.5 test application: 1. **AccuWebHosting**: They offer a free ASP.NET hosting p...
39,775
[ { "from": "human", "value": "I want to host a test app in ASP.NET 3.5 but I can't find a decent free host anywhere!\nI tried http://www.aspspider.com/ and after some days I still have a pending virtual directory creation.\nEven if it has lots of banners with pub on it, it doesn't matter. I just want to try...
Trying to get this example working from http://www.munna.shatkotha.com/blog/post/2008/10/26/Light-box-effect-with-WPF.aspx However, I can't seem to get the namespace or syntax right for "Process" below. <Border x:Name="panelDialog" Visibility="Collapsed"> <Grid> <Border Background="Black" Opacity="0.49"></Border> <!--W...
It looks like there's a misunderstanding in the example code you provided. The code is trying to create a delegate to point to a method that updates the UI, but it incorrectly uses `Process` instead of a delegate type. In WPF, to invoke a method on the UI thread, you can use the `Action` delegate, which is a simple wa...
41,369
[ { "from": "human", "value": "Trying to get this example working from http://www.munna.shatkotha.com/blog/post/2008/10/26/Light-box-effect-with-WPF.aspx\nHowever, I can't seem to get the namespace or syntax right for \"Process\" below.\n<Border x:Name=\"panelDialog\" Visibility=\"Collapsed\">\n<Grid>\n<Borde...
I have an existing web app that allows users to "rate" items based on their difficulty. (0 through 15). Currently, I'm simply taking the average of each user's opinion and presenting the average straight from MySQL. However, it's becoming clear to me (and my users) that weighting the numbers would be more appropriat...
To implement a weighted rating system for your web app using PHP and MySQL, you can follow these steps. The method outlined calculates a weighted mean based on the ratings and their respective weights. The weights can be derived from how many times a particular rating was given. ### Steps to Implement Weighted Rating ...
38,204
[ { "from": "human", "value": "I have an existing web app that allows users to \"rate\" items based on their difficulty. (0 through 15). Currently, I'm simply taking the average of each user's opinion and presenting the average straight from MySQL. However, it's becoming clear to me (and my users) that wei...
I found this web site (photoblog) http://www.OneReaction.net/ and I am very curious how this is done: 1) From source code you don't see the image URL 2) How to overlay the copyright information on the image without changing the underlying photo? Ideas? Thanks!
To achieve the effects you see on the website you mentioned, there are a couple of common techniques used in web development: ### 1. Hiding Image URLs When you don't see the image URL directly in the source code, it could be due to: - **JavaScript Loading**: The images could be loaded dynamically using JavaScript. F...
41,206
[ { "from": "human", "value": "I found this web site (photoblog) \nhttp://www.OneReaction.net/\nand I am very curious how this is done:\n1) From source code you don't see the image URL\n2) How to overlay the copyright information on the image without changing the underlying photo?\nIdeas? Thanks!\n" }, { ...
In a PHP application I am writing, I would like to have users enter in text a mix of HTML and text with pointed-brackets, but when I display this text, I want to let the HTML tags be rendered by the non-HTML tags be shown literary, e.g. a user should be able to enter: <b> 5 > 3 = true</b> when displayed, the user shou...
To achieve the desired outcome in your PHP application, you can use a combination of regular expressions and HTML encoding to process the user's input. You want to display HTML tags as actual HTML while encoding the text that contains pointed brackets (`<`, `>`). Here's a way to implement this: 1. **Extract HTML Tags...
40,643
[ { "from": "human", "value": "In a PHP application I am writing, I would like to have users enter in text a mix of HTML and text with pointed-brackets, but when I display this text, I want to let the HTML tags be rendered by the non-HTML tags be shown literary, e.g. a user should be able to enter:\n<b> 5 > 3...
I have a spreadsheet with a dataset of a number of transactions, each of which is composed of substeps, each of which has the time that it occurred. There can be a variable number and order of steps. I'd like to find the duration of each transaction. If I can do this in Excel then great, as it's already in that forma...
It looks like you’ve already found a suitable solution using a pivot table to compute the duration of each transaction in Excel. Let me summarize your approach and then offer a simplified alternative method, in case you want a different way to achieve the same result without using a pivot table. ### Your Current Metho...
39,346
[ { "from": "human", "value": "I have a spreadsheet with a dataset of a number of transactions, each of which is composed of substeps, each of which has the time that it occurred. There can be a variable number and order of steps.\nI'd like to find the duration of each transaction. If I can do this in Excel...
We are busy developing a Java web service for a client. There are two possible choices: Store the encrypted user name / password on the web service client. Read from a config. file on the client side, decrypt and send. Store the encrypted user name / password on the web server. Read from a config. file on the web serv...
When developing a Java web service with a focus on storing and using encrypted usernames and passwords, here are some recommendations: ### 1. Encryption/Decryption Package You can use the Java Cryptography Architecture (JCA) which is built into the Java platform. Specifically, you can utilize: - **Java's `javax.cryp...
40,266
[ { "from": "human", "value": "We are busy developing a Java web service for a client. There are two possible choices:\n\nStore the encrypted user name / password on the web service client. Read from a config. file on the client side, decrypt and send.\nStore the encrypted user name / password on the web serv...
I know that most people recommend using HttpRuntime.Cache because it has more flexibility... etc. But what if you want the object to persist in the cache for the life of the application? Is there any big downside to using the Application[] object to cache things?
Using `HttpRuntime.Cache` and the `Application[]` object are both viable options for caching data in ASP.NET, but they serve slightly different purposes and have distinct characteristics. Let's explore the implications of using the `Application[]` object for caching objects that you want to persist for the life of the ...
41,517
[ { "from": "human", "value": "I know that most people recommend using HttpRuntime.Cache because it has more flexibility... etc. But what if you want the object to persist in the cache for the life of the application? Is there any big downside to using the Application[] object to cache things?\n" }, { ...
I have string which is base64 encoded. How can I search this string to check if this string contains specific sub string which is not encoded? I don't want to decode that string and then search it. Can I just encode that specific sub string, and search the encoded string by using the encoded sub string? Thanks,
Yes, you can encode the specific substring you want to search for and then check if the base64-encoded string contains this encoded substring. Base64 encoding works by converting binary data to ASCII characters, so if you encode your substring in the same manner, it should yield the correct result. Here's how you can ...
43,599
[ { "from": "human", "value": "I have string which is base64 encoded. How can I search this string to check if this string contains specific sub string which is not encoded? I don't want to decode that string and then search it. \nCan I just encode that specific sub string, and search the encoded string by us...
We have a number of Excel-based membership rosters for a non-profit organization and we need to merge these into one master MS Access table. From time to time, we receive updated copies of the Excel-based membership rosters and I need to synchronize these with the master MS Access table. I'm looking for the optimal wa...
Merging Excel-based membership rosters into a master MS Access table can be done effectively using various approaches. Here are some recommendations for both custom solutions and off-the-shelf tools that could help you accomplish this: ### Custom Solution Using C# If you're inclined to create a C# console application...
35,623
[ { "from": "human", "value": "We have a number of Excel-based membership rosters for a non-profit organization and we need to merge these into one master MS Access table. From time to time, we receive updated copies of the Excel-based membership rosters and I need to synchronize these with the master MS Acc...
In a html page we use the head tag to add reference to our external .js files .. we can also include script tags in the body .. But how do we include our external .js file in a web user control? After little googling I got this. It works but is this the only way? ScriptManager.RegisterStartupScript(this.Page, Page.GetT...
In ASP.NET Web User Controls (ASCX), there are several ways to include external JavaScript files, and using `ScriptManager.RegisterStartupScript` is one of the options. However, there are other methods as well. Here’s a quick overview of some common techniques: ### 1. Using `ScriptManager` (as you've mentioned) This i...
42,124
[ { "from": "human", "value": "In a html page we use the head tag to add reference to our external .js files .. we can also include script tags in the body .. But how do we include our external .js file in a web user control?\nAfter little googling I got this. It works but is this the only way?\nScriptManager...
I'm trying to do something that gets a cs file in runtime from user make it meaningful to assembly get its properties, methods etc. Is there a way to do this by reflection in C#?
Yes, you can use reflection in C# to load a C# file at runtime and inspect its properties, methods, and other types. However, it requires some additional steps since reflection works with compiled assemblies (DLLs or EXEs) rather than raw C# files. Here’s a general approach to achieve what you want: 1. **Compile the ...
34,535
[ { "from": "human", "value": "I'm trying to do something that gets a cs file in runtime from user make it meaningful to assembly get its properties, methods etc. \nIs there a way to do this by reflection in C#?\n" }, { "from": "gpt", "value": "Yes, you can use reflection in C# to load a C# file a...
Can anybody recommend a treeview component for ASP.NET that supports drag & drop (between it's own nodes - it's for a content management system to rearrage the pages). Don't mind if it's open source or commercial (can't quite stretch to the treeview from Telerik though). Shame.. Any other options? Thanks.
There are several options for ASP.NET treeview components that support drag-and-drop functionality, suitable for a content management system. Here are a few recommendations that may fit your needs: 1. **jQuery File Tree**: - **Description**: A plugin for jQuery that provides a tree view with drag-and-drop support. ...
39,883
[ { "from": "human", "value": "Can anybody recommend a treeview component for ASP.NET that supports drag & drop (between it's own nodes - it's for a content management system to rearrage the pages). Don't mind if it's open source or commercial (can't quite stretch to the treeview from Telerik though). Shame.....
Please help! Have been staring at this for 12 hours; and have looked online and can't find solution. In my application, I use 2 UIView controls in separate pages/controllers: UIImageView (retrieve data via NSData dataWithContentsOfUrl) UIWebView Just to isolate my code, and make it easier to explain, I created a new ...
From your description, it seems that you're experiencing unexpected memory leaks when using a `UIWebView` in your application. Here are some possible explanations and steps you can take to diagnose and resolve the issue: ### 1. Memory Management in Objective-C Even though you're using convenience methods that don't re...
40,196
[ { "from": "human", "value": "Please help! Have been staring at this for 12 hours; and have looked online and can't find solution.\nIn my application, I use 2 UIView controls in separate pages/controllers:\n\nUIImageView (retrieve data via\nNSData dataWithContentsOfUrl)\nUIWebView\n\nJust to isolate my code,...
I have a style defined in App.xaml file "tabControlStyle". How can I assign this style to my dynamically created TabItem control. TabItem item = new TabItem(); item.Header = String.Format("Item {0}", i); documentTab.Items.Add(item);
To apply a style defined in your `App.xaml` to a dynamically created `TabItem`, you can set the `Style` property of the `TabItem` to the static resource defined in the `App.xaml`. Assuming that your style is defined correctly in the resources, you can access it using the `FindResource` method or by using a static resou...
41,915
[ { "from": "human", "value": "I have a style defined in App.xaml file \"tabControlStyle\". How can I assign this style to my dynamically created TabItem control. \n TabItem item = new TabItem(); \n\n\n\n item.Header = String.Format(\"Item {0}\", i);\n documentTab.I...
Someone on here recently recommended BWToolkit, and it really impressed me, so I started googling for more IB plug-ins. I've found a couple on random blogs, but haven't been able to find any kind of repository/aggregator for them. Anyone know where I can find more of these? Thanks.
While there isn't a central repository specifically for Interactive Brokers (IB) plug-ins, there are several resources and communities where you can find additional tools and plug-ins: 1. **Interactive Brokers Official API Documentation**: The IB API documentation provides examples and links to community resources. Yo...
43,748
[ { "from": "human", "value": "Someone on here recently recommended BWToolkit, and it really impressed me, so I started googling for more IB plug-ins. I've found a couple on random blogs, but haven't been able to find any kind of repository/aggregator for them. Anyone know where I can find more of these?\nTha...
I'm looking for a way to embed an image in a library (Windows-only). I don't want to go the 'traditional' way of putting it in the resources (because of special circumstances that make it not so convenient to mess around with the resource handle. Ideally, there would be something like xpm files: a 'text' representation...
You can embed images directly in your C++ code as binary data, which allows you to create a bitmap from the data at runtime. Below are the steps you can follow to achieve this in a Windows environment: 1. **Convert BMP to Binary Array**: First, you need to convert your BMP file to a C-style binary array. You can use a...
37,389
[ { "from": "human", "value": "I'm looking for a way to embed an image in a library (Windows-only). I don't want to go the 'traditional' way of putting it in the resources (because of special circumstances that make it not so convenient to mess around with the resource handle.\nIdeally, there would be somethi...
I never use Access 2007 - until today. I want to connect to an existing SQL Server 2008 database. I have tried using: External Data ODBC option - but get DSN errror Upsizing wizard with ODBC - get an error Upsizing wizard with SNAC - get ODBC error. So that one seems a none starter :-) I have done some searching and ...
Connecting Access 2007 to an existing SQL Server 2008 database can be a bit tricky due to compatibility issues and configuration settings. Here are some steps and tips you can follow to troubleshoot the DSN error and successfully connect to the SQL Server: ### 1. Verify SQL Server Configuration - **SQL Server Instance...
38,054
[ { "from": "human", "value": "I never use Access 2007 - until today.\nI want to connect to an existing SQL Server 2008 database. I have tried using:\n\nExternal Data ODBC option - but get DSN errror\nUpsizing wizard with ODBC - get an error\nUpsizing wizard with SNAC - get ODBC error. So that one seems a non...
I'm interested in selectively parsing Mediawiki XML markup to generate a customized HTML page that's some subset of the HTML produced by the actual PHP Mediawiki render engine. I want it for BzReader, an offline Mediawiki compressed dump reader written in C#. So a C# parser would be ideal, but any good code would help...
Creating a customized HTML page from MediaWiki XML markup can be a complex task, especially if you're looking to do this in C#. However, there are some approaches and resources that might help you get started on this project. ### 1. Parsing MediaWiki XML Dumps Instead of using the entire MediaWiki PHP codebase, you c...
40,070
[ { "from": "human", "value": "I'm interested in selectively parsing Mediawiki XML markup to generate a customized HTML page that's some subset of the HTML produced by the actual PHP Mediawiki render engine.\nI want it for BzReader, an offline Mediawiki compressed dump reader written in C#. So a C# parser wo...
I've got a (SQL Server 2005) database where I'd like to create views on-the-fly. In my code, I'm building a CREATE VIEW statement, but the only way I can get it to work is by building the entire query string and running it bare. I'd like to use parameters, but this: SqlCommand cmd = new SqlCommand("CREATE VIEW @name ...
Creating views dynamically in SQL Server does indeed present challenges regarding SQL injection and safe execution of dynamic SQL. You cannot use parameters for object names (like the view name) because SQL Server does not allow that. You can only use parameters for values in the SQL statements. Here’s how you can saf...
39,644
[ { "from": "human", "value": "I've got a (SQL Server 2005) database where I'd like to create views on-the-fly. In my code, I'm building a CREATE VIEW statement, but the only way I can get it to work is by building the entire query string and running it bare. I'd like to use parameters, but this:\nSqlComman...
Some people have suggested that when doing an estimate one should make a lower and upper range on the expected time to delivery. The few project tools I have seen, seem to demand one fixed date. Are there any tools that support this concept of a estimation range?
Yes, there are several project management tools that support estimation ranges or allow for more flexible time estimates. Here are some options you might consider: 1. **Trello with Power-Ups**: Trello is a flexible tool that allows users to customize their boards. You can use Power-Ups like Custom Fields to add lower ...
41,319
[ { "from": "human", "value": "Some people have suggested that when doing an estimate one should make a lower and upper range on the expected time to delivery. The few project tools I have seen, seem to demand one fixed date. Are there any tools that support this concept of a estimation range?\n" }, {...
I'd like to add a click handler for a button using jQuery, but the handler needs to reference data supplied by the controller. Is there a way to access ViewData in a script block in ASP.NET MVC? Or do I need to construct the script in the controller?
In ASP.NET MVC, you can access `ViewData` directly in a script block within your Razor view. This allows you to reference data supplied by the controller in your JavaScript code. Here's how you can do it: 1. **Pass Data from the Controller**: In your controller action, you typically set data in `ViewData` or `ViewBag`...
41,149
[ { "from": "human", "value": "I'd like to add a click handler for a button using jQuery, but the handler needs to reference data supplied by the controller. Is there a way to access ViewData in a script block in ASP.NET MVC? Or do I need to construct the script in the controller?\n" }, { "from": "g...
On a Unix system, where does gcc look for header files? I spent a little time this morning looking for some system header files, so I thought this would be good information to have here.
On a Unix system, the `gcc` (GNU Compiler Collection) looks for header files in several predefined locations. The locations can vary slightly depending on the specific installation and configuration, but typically include the following directories: 1. **Standard System Directories**: - `/usr/include`: This is the p...
41,150
[ { "from": "human", "value": "On a Unix system, where does gcc look for header files?\nI spent a little time this morning looking for some system header files, so I thought this would be good information to have here.\n" }, { "from": "gpt", "value": "On a Unix system, the `gcc` (GNU Compiler Coll...
i am trying to use an ASP conditional here: if (Request.Cookies("username")) and (Request.Cookies("password")) <> "" Then And i keep getting this error: Type mismatch: '[string: ""]' Any ideas what I am getting that?
The error you're encountering suggests that the condition you are using in your ASP code is not structured properly. The issue primarily revolves around how you're checking for the existence of the cookies and their values. The error message "Type mismatch: '[string: ""]'" indicates that you are trying to compare a st...
42,880
[ { "from": "human", "value": "i am trying to use an ASP conditional here:\nif (Request.Cookies(\"username\")) and\n(Request.Cookies(\"password\")) <> \"\"\nThen\n\nAnd i keep getting this error:\n\nType mismatch: '[string: \"\"]'\n\nAny ideas what I am getting that?\n" }, { "from": "gpt", "value"...
There is a previous thread with this question, and hints at an answer, but I could not get it to work. I have an ICS file. It validates. It looks like this: BEGIN:VCALENDAR VERSION:2.0 PRODID:-//WA//FRWEB//EN BEGIN:VEVENT UID:FRICAL201 SEQUENCE:0 DTSTAMP:20081108T151809Z DTSTART:20081109T121200 SUMMARY:11/9/2008 12:12:...
To ensure that Outlook updates an existing event rather than inserting a duplicate when importing an ICS file, it is crucial to follow the iCalendar specifications closely, particularly with respect to the UID and SEQUENCE properties. Here's how to make sure that Outlook correctly interprets the ICS file as an update:...
41,004
[ { "from": "human", "value": "There is a previous thread with this question, and hints at an answer, but I could not get it to work.\nI have an ICS file. It validates. It looks like this:\nBEGIN:VCALENDAR\nVERSION:2.0\nPRODID:-//WA//FRWEB//EN\nBEGIN:VEVENT\nUID:FRICAL201\nSEQUENCE:0\nDTSTAMP:20081108T151809Z...
What's the better way to insert cell comments in excel 2007 files programmatically using c# and .net 3.5?
To insert cell comments programmatically in Excel 2007 files using C# and .NET 3.5, you can utilize the `Microsoft.Office.Interop.Excel` library. Here is a step-by-step guide to achieve this: ### Step 1: Add References First, make sure you have the `Microsoft.Office.Interop.Excel` library available in your project. Yo...
37,458
[ { "from": "human", "value": "What's the better way to insert cell comments in excel 2007 files programmatically using c# and .net 3.5?\n" }, { "from": "gpt", "value": "To insert cell comments programmatically in Excel 2007 files using C# and .NET 3.5, you can utilize the `Microsoft.Office.Intero...
What is the difference between them? When would I opt for one over the other?
It seems like your question is missing specific subjects or items to compare. If you could clarify what "them" refers to, I'd be happy to explain the differences and when one might be preferred over the other!
44,708
[ { "from": "human", "value": "What is the difference between them? \nWhen would I opt for one over the other?\n" }, { "from": "gpt", "value": "It seems like your question is missing specific subjects or items to compare. If you could clarify what \"them\" refers to, I'd be happy to explain the di...
I am using CYGWIN as a platform and would like to use wxPython. Is there a way to get the source compiled and working in cygwin?
Compiling and using wxPython in Cygwin can be a bit challenging, as wxPython is primarily designed to work with native Windows environments or Unix-like systems. However, it is possible to get wxPython running in Cygwin with some effort. Here’s a general guide to help you through the process: ### Prerequisites 1. **I...
36,610
[ { "from": "human", "value": "I am using CYGWIN as a platform and would like to use wxPython. Is there a way to get the source compiled and working in cygwin?\n" }, { "from": "gpt", "value": "Compiling and using wxPython in Cygwin can be a bit challenging, as wxPython is primarily designed to wor...
Which Eclipse files is it appropriate to put under source control, aside from the sources obviously? In my project, specifically, I'm wondering about: .metadata/* project-dir/.project project-dir/.classpath project-dir/.settings/* If there are any of these for which it depends, please explain your guidelines....
When using Eclipse for a project, it's important to consider which files should be put under source control. This helps to ensure that the project can be easily shared and built by others in a consistent manner. Here's a breakdown of the files you mentioned: 1. **`.project` file**: - **Include in source control**: ...
42,416
[ { "from": "human", "value": "Which Eclipse files is it appropriate to put under source control, aside from the sources obviously?\nIn my project, specifically, I'm wondering about:\n\n.metadata/*\n project-dir/.project\n project-dir/.classpath\n project-dir/.settings/* \n\nIf there are any of these for ...
Just looking at: (Source: https://xkcd.com/327/) What does this SQL do: Robert'); DROP TABLE STUDENTS; -- I know both ' and -- are for comments, but doesn't the word DROP get commented as well since it is part of the same line?
The SQL statement you've referenced is an example of a SQL injection attack, which takes advantage of how SQL interprets input data. Here's a breakdown of the statement `Robert'); DROP TABLE STUDENTS; --`: 1. **Initial Part (`Robert')`)**: This part could be intended as a value to insert into a SQL query, such as a n...
39,443
[ { "from": "human", "value": "Just looking at:\n\n(Source: https://xkcd.com/327/)\nWhat does this SQL do:\nRobert'); DROP TABLE STUDENTS; --\n\nI know both ' and -- are for comments, but doesn't the word DROP get commented as well since it is part of the same line?\n" }, { "from": "gpt", "value":...
My mission is to create a little app where you can upload a picture, and the app will turn it into ASCII art. I'm sure these exist already but I want to prove that I can do it myself. This would involve taking an image, making it greyscale and then matching each pixel with a character depending on how dark the picture ...
Creating an ASCII art generator from an image is a fun and interesting project! You can certainly achieve this using the GD library in PHP. The first step to turning an image into ASCII art is to convert it to grayscale (black and white). Here’s a basic guide on how you can do that with the GD library: ### Step-by-Ste...
39,679
[ { "from": "human", "value": "My mission is to create a little app where you can upload a picture, and the app will turn it into ASCII art. I'm sure these exist already but I want to prove that I can do it myself.\nThis would involve taking an image, making it greyscale and then matching each pixel with a ch...
I'm about to start a new .net web project. Previsouly for my n-layer web apps i've used the "Microsoft Data Access Application Block" (sqlhelper.cs) for the data access, then an interface class to interface with the object classes. I'm aware this technique is a bit dated and was looking to use something a little more ...
Using `SqlHelper.cs` from the Microsoft Data Access Application Block for data access in a new .NET web project is not inherently wrong, but there are several considerations to keep in mind that could influence your decision. Here are some points to consider: ### Pros of Using SqlHelper.cs 1. **Familiarity**: If you ...
40,681
[ { "from": "human", "value": "I'm about to start a new .net web project. \nPrevisouly for my n-layer web apps i've used the \"Microsoft Data Access Application Block\" (sqlhelper.cs) for the data access, then an interface class to interface with the object classes. I'm aware this technique is a bit dated and...
I have a collection of domain objects that I need to convert into another type for use by the .NET framework. What is the best practice for doing such a transformation? Specifically, I have a type called ContentEntry and I need to convert it into a SyndicationItem for use in putting into a SyndicationFeed. The conversi...
When dealing with the transformation of domain objects like `ContentEntry` into a framework type like `SyndicationItem`, you have several design patterns to consider. Each option has its pros and cons depending on your requirements, code organization, and maintainability. Here are a few approaches you might consider: ...
39,871
[ { "from": "human", "value": "I have a collection of domain objects that I need to convert into another type for use by the .NET framework. What is the best practice for doing such a transformation?\nSpecifically, I have a type called ContentEntry and I need to convert it into a SyndicationItem for use in pu...
So I'm in the process of getting GIT sold at work. First thing I need is to convince everyone that GIT is better at what they're already used to doing. We currently use Perforce. Anybody else go through a similar sale? Any good links/advice? One of the big wins is that we can work with it disconnected from the network....
Convincing a team to switch from Perforce to Git can be challenging, but with the right approach, you can make a compelling case. Here are some points and strategies that can help you advocate for the switch: ### Key Benefits of Git Over Perforce: 1. **Distributed Version Control**: - Git allows each developer to ...
37,541
[ { "from": "human", "value": "So I'm in the process of getting GIT sold at work. First thing I need is to convince everyone that GIT is better at what they're already used to doing. We currently use Perforce. Anybody else go through a similar sale? Any good links/advice?\nOne of the big wins is that we can w...
After installing the VSTS Database GDR and importing a SQL Server 2005 database that includes the ASP.NET provider schema tables, I get the following warnings: TSD04151: Procedure: [dbo].[aspnet_Users_DeleteUser] has an unresolved reference to object [dbo].[sysobjects].[name]. TSD04151: Procedure: [dbo].[aspnet_Users_D...
The warnings you're encountering (TSD04151) indicate that there are unresolved references to system objects in your SQL Server stored procedures, specifically the `[dbo].[sysobjects]` system table. This typically happens when the SQL Server Database Project in Visual Studio cannot resolve the references during the buil...
38,906
[ { "from": "human", "value": "After installing the VSTS Database GDR and importing a SQL Server 2005 database that includes the ASP.NET provider schema tables, I get the following warnings:\nTSD04151: Procedure: [dbo].[aspnet_Users_DeleteUser] has an unresolved reference to object [dbo].[sysobjects].[name].\...
Is it possible (by using the stock c# TreeView) to have Multiline TreeNodes? Also, is it possible to add control characters to TreeNode's text e.g. '\t'? This same effect could also be achieved by adding columns to the TreeNode. is this possible?
The standard C# `TreeView` control does not support multiline `TreeNode` text out of the box. Each `TreeNode` can only contain a single line of text, and it does not recognize newline characters like `\n` or `\r\n` for multiline display. Thus, you cannot create a `TreeNode` that displays text on multiple lines. Simila...
41,824
[ { "from": "human", "value": "Is it possible (by using the stock c# TreeView) to have Multiline TreeNodes? \nAlso, is it possible to add control characters to TreeNode's text e.g. '\\t'? This same effect could also be achieved by adding columns to the TreeNode. is this possible?\n" }, { "from": "gpt"...
does anyone know if you can do something like this using the (N)Hibernate criteria api: Select 1 AS obj.Property0, obj.Property1, obj.Property2 from Class Baiscally I want to select a constant value for one of my properties in the query. I can do this easy enough using HQL but I was wondering if anyone knew a way usi...
In Hibernate, the Criteria API is somewhat limited in its capabilities compared to HQL (Hibernate Query Language). However, you can still accomplish this using the Criteria API by employing projections. To select a constant value along with properties from an entity, you can create a projection for the constant value...
42,445
[ { "from": "human", "value": "does anyone know if you can do something like this using the (N)Hibernate criteria api:\nSelect 1 AS obj.Property0, obj.Property1, obj.Property2 from Class \n\nBaiscally I want to select a constant value for one of my properties in the query. I can do this easy enough using HQL ...
I need to execute a SQL Server system stored procedure, programmatically, and since it executes in the current schema, I need to change it on the fly. Like this Statement st = connection.createStatement(); st.execute("EXEC SP_ADDUSER ' ', ' '"); But SP_ADDUSER only executes on the current schema set for the connection,...
In SQL Server, the execution context of a stored procedure, including system stored procedures like `SP_ADDUSER`, is determined by the user account or the database context under which the connection is made. If you want to execute a stored procedure that modifies users in different schemas, you cannot change the schema...
40,963
[ { "from": "human", "value": "I need to execute a SQL Server system stored procedure, programmatically, and since it executes in the current schema, I need to change it on the fly.\nLike this\nStatement st = connection.createStatement();\nst.execute(\"EXEC SP_ADDUSER ' ', ' '\");\nBut SP_ADDUSER only execute...
Is there any way to "dock" a Silverlight control to the browser window? For example, I'd like to have an HTML header at the top of a page and then have the Silverlight control take up precisely the rest of the window, neatly resizing whenever the window is resized. The default page Visual Studio creates uses styles wit...
You can achieve a layout with a static header and a Silverlight control that takes up the remaining space using a combination of HTML and CSS along with the Silverlight object tag or embed tag. Here's a straightforward way to do it: 1. **Create your HTML structure**: Use a `div` for your header and another `div` for ...
40,009
[ { "from": "human", "value": "Is there any way to \"dock\" a Silverlight control to the browser window? For example, I'd like to have an HTML header at the top of a page and then have the Silverlight control take up precisely the rest of the window, neatly resizing whenever the window is resized.\nThe defaul...
I'm aware that JSR-000220 Enterprise JavaBeans 3.0 Final Release (persistence) spec states: "In general, portable applications should not invoke EntityManager or Query operations, access other entity instances, or modify relationships in a lifecycle callback method." This appears extremely restrictive. We have a situat...
Using the `EntityManager` within an `EntityListener` can lead to several potential issues and pitfalls, especially in a JPA context where lifecycle callbacks are involved. Although the JSR-000220 specification advises against it for reasons related to portability and consistency of entity state, let's break down some o...
42,359
[ { "from": "human", "value": "I'm aware that JSR-000220 Enterprise JavaBeans 3.0 Final Release (persistence) spec states:\n\"In general, portable applications should not invoke EntityManager or Query operations,\naccess other entity instances, or modify relationships in a lifecycle callback method.\"\nThis a...
I'd love to do this: UPDATE table SET blobCol = HTTPGET(urlCol) WHERE whatever LIMIT n; Is there code available to do this? I known this should be possible as the MySQL Docs include an example of adding a function that does a DNS lookup. MySQL / windows / Preferably without having to compile stuff, but I can. (If you ...
Performing HTTP requests directly from within MySQL is not natively supported, and while there are ways to extend MySQL with custom functions, they typically involve compiling shared libraries in C/C++. However, there are some alternative approaches you can consider for achieving a similar effect without diving into co...
41,858
[ { "from": "human", "value": "I'd love to do this:\nUPDATE table SET blobCol = HTTPGET(urlCol) WHERE whatever LIMIT n;\n\nIs there code available to do this? I known this should be possible as the MySQL Docs include an example of adding a function that does a DNS lookup.\nMySQL / windows / Preferably without...
I need to edit (using javascript) an SVG document embedded in an html page. When the SVG is loaded, I can access the dom of the SVG and its elements. But I am not able to know if the SVG dom is ready or not, so I cant' perform default actions on the SVG when the html page is loaded. To access the SVG dom, I use this co...
To ensure that you can access the SVG DOM after it has fully loaded, you can use the `onload` event of the `<embed>` element. This event is triggered when the SVG content has been fully loaded, and it's a good place to perform any operations you want to execute on the SVG. Here's an example of how you can implement th...
42,395
[ { "from": "human", "value": "I need to edit (using javascript) an SVG document embedded in an html page.\nWhen the SVG is loaded, I can access the dom of the SVG and its elements. But I am not able to know if the SVG dom is ready or not, so I cant' perform default actions on the SVG when the html page is lo...
One of the many quirks of Reporting Services we've run across is the complete and utter lack of a CheckBox control or even something remotely similar. We have a form that should appear automatically filled out based on information pulled from a database. We have several bit datatype fields. Printing out "True" or "Fa...
You've raised some valid points regarding the lack of a native CheckBox control in SQL Server Reporting Services (SSRS), particularly in SSRS 2005 and 2008. This limitation can indeed be a challenge when trying to represent boolean values in a visually appealing way on reports. Given your situation and the need for an...
35,817
[ { "from": "human", "value": "One of the many quirks of Reporting Services we've run across is the complete and utter lack of a CheckBox control or even something remotely similar.\nWe have a form that should appear automatically filled out based on information pulled from a database. We have several bit da...
I'm trying to concatenate 3 [char(32)] fields:title1title2title3 into one field, but the catch is that I'm using an older version of SQL and it DOES NOT support the CONCAT() subroutine or the + operatorfor example:CONCAT(title1, title2, title3)(title1 + title2 + title3) DON'T WORK!!!!Is there another way?
If you're using an older version of SQL that does not support `CONCAT()` or the `+` operator for string concatenation, you can use the `||` operator instead, which is commonly supported in SQL standards. However, keep in mind that `||` is not supported in some databases like SQL Server. If you're working with SQL Serve...
42,777
[ { "from": "human", "value": "I'm trying to concatenate 3 [char(32)] fields:title1title2title3\ninto one field, but the catch is that I'm using an older version of SQL and it DOES NOT support the CONCAT() subroutine or the + operatorfor example:CONCAT(title1, title2, title3)(title1 + title2 + title3)\nDON'T ...
I am implementing MVP/M-V-VM in WPF and I'm having good luck with it so far. However, I don't see how this model supports implementing Modal dialog boxes. I've derived my work from Crack.NET (http://www.codeplex.com/cracknetproject) to learn how this stuff works. I have a ShellView view (which is just XAML) that has ...
Implementing modal dialog boxes in a WPF application using MVP (Model-View-Presenter) or MVVM (Model-View-ViewModel) can indeed present some challenges, particularly regarding separation of concerns and testability. Let's tackle the points you've raised one by one: ### 1. ShellModelView and Reference to ShellView In a...
37,467
[ { "from": "human", "value": "I am implementing MVP/M-V-VM in WPF and I'm having good luck with it so far. However, I don't see how this model supports implementing Modal dialog boxes. I've derived my work from Crack.NET (http://www.codeplex.com/cracknetproject) to learn how this stuff works.\nI have a She...
I am running a site about PHP Frameworks, but I can't find a exact definition for it, and I am always thinking a question, how to make out a good PHP framework? Features? Manual? Efficiency? Or something?
Creating a good PHP framework involves a blend of technical features, usability, and design principles. Here’s a comprehensive breakdown of what constitutes a good PHP framework, along with key features and considerations for building one: ### Definition of a PHP Framework A PHP framework is a collection of PHP packa...
38,802
[ { "from": "human", "value": "I am running a site about PHP Frameworks, but I can't find a exact definition for it, and I am always thinking a question, how to make out a good PHP framework? Features? Manual? Efficiency? Or something?\n" }, { "from": "gpt", "value": "Creating a good PHP framework...
Where do you get Microsoft.Web.Mvc.dll? I see it included in a lot of ASP.NET MVC open-source projects but it's not on my system after having installed ASP.NET MVC Beta and .NET 3.5 SP1. In the ASP.NET MVC Beta source code from codeplex.com the Microsoft.Web.Mvc.dll is produced by the MvcFutures project. Is everyone co...
The `Microsoft.Web.Mvc.dll` is indeed part of the ASP.NET MVC Futures project, which provides additional features and functionality that were not included in the core ASP.NET MVC framework. The Futures project contains experimental features and utilities that are designed to enhance the MVC experience. To obtain `Micr...
42,828
[ { "from": "human", "value": "Where do you get Microsoft.Web.Mvc.dll? I see it included in a lot of ASP.NET MVC open-source projects but it's not on my system after having installed ASP.NET MVC Beta and .NET 3.5 SP1.\nIn the ASP.NET MVC Beta source code from codeplex.com the Microsoft.Web.Mvc.dll is produced...
I have a PPPOE connection on a computer. That computer has two LAN cards and I activated ICS on it. The problem is, the connection kinda degrades over time (don't know why), and a redial would be nice, hourly maybe. I was thinking of writing an AutoIT script that would do this, if, for example I'm sending some data to ...
If you're looking to automate the redial of a PPPoE connection using the built-in GUI on a Windows system, you can utilize the `rasdial` command from the command line, which handles dial-up connections. However, since you mentioned you'd prefer a GUI approach, you might want to use PowerShell or a batch script to perio...
40,051
[ { "from": "human", "value": "I have a PPPOE connection on a computer. That computer has two LAN cards and I activated ICS on it. The problem is, the connection kinda degrades over time (don't know why), and a redial would be nice, hourly maybe. I was thinking of writing an AutoIT script that would do this, ...
My project invovles me to make a lot of changes on the production code. The requirement keeps coming up and I need to make changes and deploy it as soon as possible. I sometimes end up creating patch work sort of code because some of the requirement would not fit into the overall design of the software. How can this be...
Handling frequent changes in production code can indeed lead to "patchwork" solutions if not managed properly. It's crucial to strike a balance between meeting immediate requirements and maintaining code quality, readability, and maintainability. Here are several strategies and design patterns you might consider to han...
39,779
[ { "from": "human", "value": "My project invovles me to make a lot of changes on the production code. The requirement keeps coming up and I need to make changes and deploy it as soon as possible. I sometimes end up creating patch work sort of code because some of the requirement would not fit into the overal...
I'm in the process of troubleshooting some memory problems we're having in our .NET WinForms application. I'm using SciTech's .NET Memory Profiler as well as dotTrace and they all seem to be indicting root allocations by static event handlers in the .NET Framework controls. From google'ing around, I've found reports ...
It sounds like you are dealing with a well-known issue related to static event handlers in the .NET Framework. When static event handlers are used, they can inadvertently keep references to instances of objects, leading to memory leaks if those instances are not unsubscribed properly. The `SystemEvents.UserPreferenceC...
40,034
[ { "from": "human", "value": "I'm in the process of troubleshooting some memory problems we're having in our .NET WinForms application. I'm using SciTech's .NET Memory Profiler as well as dotTrace and they all seem to be indicting root allocations by static event handlers in the .NET Framework controls. Fr...
I have some constants that represent the valid options in one of my model's fields. What's the best way to handle these constants in Ruby?
In Ruby, there are several ways to handle constants that represent valid options for a model's field. Here are a few common approaches: ### 1. Using `Constants` Module You can create a module to hold your constants: ```ruby module StatusOptions ACTIVE = 'active' INACTIVE = 'inactive' PENDING = 'pending' def...
41,256
[ { "from": "human", "value": "I have some constants that represent the valid options in one of my model's fields. What's the best way to handle these constants in Ruby?\n" }, { "from": "gpt", "value": "In Ruby, there are several ways to handle constants that represent valid options for a model's ...
Our groups legacy ASP 3.0 web apps were able to take advantage of a global error file by setting up a custom error file within IIS's Custom Error's tab. I'm unable to find a similar solution for ASP.NET apps. Does anyone know if there is a way to have a centralized "Error.aspx" page (for example) that will trap erro...
In ASP.NET, you can centralize error handling across multiple applications in an application pool by leveraging the features of IIS (Internet Information Services) and the ASP.NET framework. While ASP.NET does not have an exact equivalent to the legacy ASP 3.0 method you mentioned, there are several approaches you can ...
40,274
[ { "from": "human", "value": "Our groups legacy ASP 3.0 web apps were able to take advantage of a global error file by setting up a custom error file within IIS's Custom Error's tab. I'm unable to find a similar solution for ASP.NET apps. \nDoes anyone know if there is a way to have a centralized \"Error.a...
I'd much rather code an app using pure C api such as OpenGL, rather that Cocoa Touch. So I'm wondering: is it feasible? Will I be able to maintain the same user experience that you get with Interface Builder?
Yes, it is feasible to code an app using pure C APIs like OpenGL, but there are several factors to consider when trying to maintain the same user experience that you get with Interface Builder in Cocoa Touch. ### Advantages of Using OpenGL with Pure C: 1. **Performance Control**: Using OpenGL directly can give you fi...
39,896
[ { "from": "human", "value": "I'd much rather code an app using pure C api such as OpenGL, rather that Cocoa Touch. So I'm wondering: is it feasible? Will I be able to maintain the same user experience that you get with Interface Builder?\n" }, { "from": "gpt", "value": "Yes, it is feasible to co...
I have some questions about basic CSS that I was unable to understand or find an answer for. First, I tried placing 3 div tags within another div tag. The first main div tag containing the 3 other tags had nothing set for it except a size, which was 400px by 400px. Of the other 3 divs inside, all were 20px by 20px, and...
Thank you for sharing your code and question! It looks like you have a few issues in your CSS and HTML that might be causing confusion. Let's break down what's happening. ### 1. CSS Syntax Issues You have a few syntax errors in your CSS that need to be addressed: - You're using commas `,` instead of semicolons `;` at...
39,332
[ { "from": "human", "value": "I have some questions about basic CSS that I was unable to understand or find an answer for.\nFirst, I tried placing 3 div tags within another div tag. The first main div tag containing the 3 other tags had nothing set for it except a size, which was 400px by 400px. Of the other...
I've read quite a bit of the Red Bean Software SVN Book, and some of the questions here on SO, but I want to make sure I'm going about this in the right way the first time around step-by-step before I begin using it. Is this correct? Install SVN. Create SVN repository at /usr/local/svn. Directory structure looks like ...
Your approach to setting up an SVN repository and organizing your projects seems solid, but there are a few clarifications and adjustments you might want to consider to ensure you're on the right track. Here’s a step-by-step outline based on your description: ### Step-by-Step SVN Setup 1. **Install SVN**: - Ensur...
38,262
[ { "from": "human", "value": "I've read quite a bit of the Red Bean Software SVN Book, and some of the questions here on SO, but I want to make sure I'm going about this in the right way the first time around step-by-step before I begin using it. Is this correct?\n\nInstall SVN.\nCreate SVN repository at /us...
What'd also interest me is which have more or less dependencies.
When discussing dependencies, it typically refers to the reliance of one component or system on another. This can apply in various contexts, such as software development, project management, and data science. Here's a breakdown of how different areas might handle dependencies: ### 1. **Software Development** - **Mo...
42,981
[ { "from": "human", "value": "What'd also interest me is which have more or less dependencies.\n" }, { "from": "gpt", "value": "When discussing dependencies, it typically refers to the reliance of one component or system on another. This can apply in various contexts, such as software development...
Which one you choose? Use the Deploy feature in VS Build a rss script and execute it through rs.exe Build a deployment package Another option Keep in mind that in many of your environments the report developers/designers don't have publish role in Reporting Server.
When considering the options for deploying reports in a scenario where report developers/designers do not have the publish role in the Reporting Server, the best approach would be **Build a deployment package**. Here's why: 1. **Separation of Permissions**: Building a deployment package allows you to package the rep...
43,866
[ { "from": "human", "value": "Which one you choose?\n\nUse the Deploy feature in VS\nBuild a rss script and execute it through rs.exe\nBuild a deployment package\nAnother option\n\nKeep in mind that in many of your environments the report developers/designers don't have publish role in Reporting Server.\n" ...
How do I map numbers, linearly, between a and b to go between c and d. That is, I want numbers between 2 and 6 to map to numbers between 10 and 20... but I need the generalized case. My brain is fried.
To map a number \( x \) from the range \([a, b]\) to the range \([c, d]\), you can use a linear mapping formula. The formula is given by: \[ y = \frac{(x - a)(d - c)}{(b - a)} + c \] Where: - \( x \) is the input number in the range \([a, b]\). - \( y \) is the output number in the range \([c, d]\). - \( a \) is the ...
42,014
[ { "from": "human", "value": "How do I map numbers, linearly, between a and b to go between c and d.\nThat is, I want numbers between 2 and 6 to map to numbers between 10 and 20... but I need the generalized case.\nMy brain is fried.\n" }, { "from": "gpt", "value": "To map a number \\( x \\) from...
This code is executed by many way. When it's executed by the form button it works (the button start a thread and in the loop it call this method = it works). BUT it doesn't work when I have a call to that method from my BackgroundWorker in the form. With the following code: private void resizeThreadSafe(int width, int...
The issue you're encountering is related to the way Windows Forms handles threading and how controls are accessed. In Windows Forms, controls can only be accessed from the thread they were created on, which is typically the main UI thread. In your `resizeThreadSafe` method, you're checking if `this.form.InvokeRequire...
41,405
[ { "from": "human", "value": "This code is executed by many way. When it's executed by the form button it works (the button start a thread and in the loop it call this method = it works). BUT it doesn't work when I have a call to that method from my BackgroundWorker in the form. \nWith the following code:\np...