instruction
stringlengths
14
27.6k
completion
stringlengths
3
38.3k
__original_row_idx
int64
0
50k
conversations
listlengths
2
2
I have the classical table with expandable and collapsible records that if expanded show several subrecords (as new records in the same parent table, not some child div/child table). I am also using tablesorter and absolutely love it. The problem is that tablesorter isn't keeping expanded child records next to the pare...
To achieve the desired functionality of keeping child records grouped with their parent records while using tablesorter, you will likely need to implement a workaround since tablesorter, by default, does not support this behavior for rows that are visually hidden or nested within the same table. ### Suggested Approach...
26,689
[ { "from": "human", "value": "I have the classical table with expandable and collapsible records that if expanded show several subrecords (as new records in the same parent table, not some child div/child table). I am also using tablesorter and absolutely love it.\nThe problem is that tablesorter isn't keepi...
I'm having some trouble getting my ColdFusion server classpath to recognize my custom Java jars. The classpath is not reading my jvm.config file correctly (I assume out of my JRun server which is where the CF instance is running out of, it's a production server with multiple sites attached). I have been banging my he...
To troubleshoot and resolve your issue with ColdFusion not recognizing the custom Java JAR files, follow these steps: 1. **Verify Classpath Settings**: Ensure that the paths to your JAR files are correctly specified in the `jvm.config` file for your specific ColdFusion instance. The `jvm.config` file is typically loca...
28,065
[ { "from": "human", "value": "I'm having some trouble getting my ColdFusion server classpath to recognize my custom Java jars. The classpath is not reading my jvm.config file correctly (I assume out of my JRun server which is where the CF instance is running out of, it's a production server with multiple si...
Coming from a desktop background I'm not sure exactly how to pass the exceptions I have caught to an Error page in order to avoid the standard exception screen being seen by my users. My general question is how do I pass the exception from page X to my Error page in ASP.net?
To handle exceptions in ASP.NET and redirect users to a custom error page instead of displaying the standard exception screen, you can follow these steps: ### 1. Use Global Error Handling A common approach is to handle errors globally using the `Application_Error` method in the `Global.asax` file. This way, you can c...
22,713
[ { "from": "human", "value": "Coming from a desktop background I'm not sure exactly how to pass the exceptions I have caught to an Error page in order to avoid the standard exception screen being seen by my users. \nMy general question is how do I pass the exception from page X to my Error page in ASP.net?\...
I'm using the asp.net SqlMembershipProvider and LinqToSql in a hobby/learning application. I have some user properties that I'm keeping in LinqtoSql, so my flow is: Membership.CreateUser -> MyClass.AddUserDetails. I'd like to wrap the whole thing in a transaction, so if the myclass bit fails I can roll back the members...
To implement a transaction that encompasses both the creation of a user using the `SqlMembershipProvider` and additional user detail storage using LINQ to SQL, you can use the `TransactionScope` class provided by the System.Transactions namespace. This allows you to manage a transaction across multiple resource manager...
26,070
[ { "from": "human", "value": "I'm using the asp.net SqlMembershipProvider and LinqToSql in a hobby/learning application. I have some user properties that I'm keeping in LinqtoSql, so my flow is:\nMembership.CreateUser -> MyClass.AddUserDetails. I'd like to wrap the whole thing in a transaction, so if the myc...
So Google Analytics does not have an API that we can use to get our data, so is there an efficient way to programaticly fetch the data collected by Google, without logging it locally? Edit: I would prefer a Python or PHP solution but anything will work.
As of my last knowledge update in October 2023, Google Analytics does provide APIs that you can use to programmatically access your data. In particular, the Google Analytics Reporting API (for Universal Analytics) and the Google Analytics Data API (for GA4) allow you to fetch analytics data without needing to log it lo...
21,348
[ { "from": "human", "value": "So Google Analytics does not have an API that we can use to get our data, so is there an efficient way to programaticly fetch the data collected by Google, without logging it locally?\nEdit:\nI would prefer a Python or PHP solution but anything will work.\n" }, { "from":...
I have some cross platform DNS client code that I use for doing end to end SMTP and on windows I can find the current DNS server ip addresses by looking in the registry. On the Mac I can probably use the SystemConfiguration framework as mentioned in the first answer, however the exact method of doing so is not immediat...
To retrieve the DNS server IP addresses on macOS, you can use the System Configuration framework, specifically the `SCDynamicStore` functions. The DNS server addresses are stored in the network configuration. Below is a sample code snippet that demonstrates how to use this framework to obtain the DNS server addresses: ...
27,490
[ { "from": "human", "value": "I have some cross platform DNS client code that I use for doing end to end SMTP and on windows I can find the current DNS server ip addresses by looking in the registry. On the Mac I can probably use the SystemConfiguration framework as mentioned in the first answer, however the...
I need to store encrypted data (few small strings) between application runs. I do not want the user to provide a passphrase every time (s)he launches the application. I.e. after all it goes down to storing securely the encryption key(s). I was looking into RSACryptoServiceProvider and using PersistentKeyInCsp, but I'm ...
The scenario you're describing involves securely storing sensitive information without requiring the user to input a passphrase each time the application runs. The approach you're considering—using RSA encryption with a persistent key—is a good start, but let's clarify how it works and whether it meets your requirement...
21,516
[ { "from": "human", "value": "I need to store encrypted data (few small strings) between application runs. I do not want the user to provide a passphrase every time (s)he launches the application. I.e. after all it goes down to storing securely the encryption key(s).\nI was looking into RSACryptoServiceProvi...
What are the “normal” ways to do plug-ins in compiled languages (C#/C/C++/D)? I am specifically interested in language agnostic approaches but language specific is not unacceptable. For the time being, “compile time” plug in approaches (just include the code or not and everything works) are valid but things that can mi...
Creating plug-ins in compiled languages (like C#, C, C++, and D) can involve various approaches, especially if you're looking for flexibility to allow dynamic loading of plug-ins at runtime. Below are some language-agnostic and language-specific methods for implementing a plug-in architecture: ### Language-Agnostic Ap...
22,165
[ { "from": "human", "value": "What are the “normal” ways to do plug-ins in compiled languages (C#/C/C++/D)? I am specifically interested in language agnostic approaches but language specific is not unacceptable.\nFor the time being, “compile time” plug in approaches (just include the code or not and everythi...
Is there a way to "stream" a set of results (eg. a DataTable) from a BackgroundWorker to a DataGridView. What I want to do is to query data, and fill the results in a DataGridView as they come (like query grid results in SQL Server Management Studio). My first thought was to use a BackgroundWorker (to avoid the UI free...
To achieve a streaming effect where the results of a query are displayed in a `DataGridView` as they come in, you can utilize a combination of asynchronous programming, data binding, and possibly the `IAsyncEnumerable<T>` interface or a custom iterator for streaming data from a database. Here’s a general approach usi...
26,926
[ { "from": "human", "value": "Is there a way to \"stream\" a set of results (eg. a DataTable) from a BackgroundWorker to a DataGridView. What I want to do is to query data, and fill the results in a DataGridView as they come (like query grid results in SQL Server Management Studio). My first thought was to u...
What is the functional equivalent of Windows Communication Foundation in Java 6?
The functional equivalent of Windows Communication Foundation (WCF) in Java 6 is typically represented by the Java EE (Enterprise Edition) stack, specifically focusing on two main technologies: Java RMI (Remote Method Invocation) and JAX-WS (Java API for XML Web Services). 1. **Java RMI (Remote Method Invocation)**: T...
29,774
[ { "from": "human", "value": "What is the functional equivalent of Windows Communication Foundation in Java 6?\n" }, { "from": "gpt", "value": "The functional equivalent of Windows Communication Foundation (WCF) in Java 6 is typically represented by the Java EE (Enterprise Edition) stack, specifi...
The application uses Oracle DataAccess ver. 1.1. , VS 2008, .Net Framework 3.5 w/SP1 OracleConnection connection = new OracleConnection(ConnectionStringLogon); connection.Open(); OracleParameter selectParam = new OracleParameter(":applicationName", OracleDbType.Varchar2, 256); selectParam.Value = applicationName; if...
The error you are encountering is a `System.NullReferenceException` when calling `cmd.ExecuteScalar()`. This indicates that there is an attempt to use a reference that is not initialized (i.e., it is `null`). Let's look at a few common causes and possible solutions for this issue in your Oracle data access code. ### P...
21,101
[ { "from": "human", "value": "The application uses Oracle DataAccess ver. 1.1. , VS 2008, .Net Framework 3.5 w/SP1\nOracleConnection connection = new OracleConnection(ConnectionStringLogon);\nconnection.Open();\n\nOracleParameter selectParam = new OracleParameter(\":applicationName\", OracleDbType.Varchar2,...
I am trying to set the permissions of a folder and all of it's children on a vista computer. The code I have so far is this. public static void SetPermissions(string dir) { DirectoryInfo info = new DirectoryInfo(dir); DirectorySecurity ds = info.GetAccessControl(); ...
When working with folder permissions in Windows, especially on a Vista machine or any version of Windows, there are several considerations to keep in mind, especially regarding how permissions are applied, inheritance, and the context in which your code runs. Here are a few suggestions to troubleshoot and correct your ...
24,870
[ { "from": "human", "value": "I am trying to set the permissions of a folder and all of it's children on a vista computer. The code I have so far is this.\n public static void SetPermissions(string dir)\n {\n DirectoryInfo info = new DirectoryInfo(dir);\n DirectorySecurity ds = i...
I know that LDAP is used to provide some information and to help facilitate authorization. But what are the other usages of LDAP?
LDAP, or Lightweight Directory Access Protocol, is primarily used for accessing and managing directory information. Here are several key usages and applications of LDAP beyond just providing information and facilitating authorization: 1. **User Authentication**: LDAP is commonly used for authenticating users in applic...
26,099
[ { "from": "human", "value": "I know that LDAP is used to provide some information and to help facilitate authorization. \nBut what are the other usages of LDAP? \n" }, { "from": "gpt", "value": "LDAP, or Lightweight Directory Access Protocol, is primarily used for accessing and managing director...
I've seen some horrific code written in Perl, but I can't make head nor tail of this one: select((select(s),$|=1)[0]) It's in some networking code that we use to communicate with a server and I assume it's something to do with buffering (since it sets $|). But I can't figure out why there's multiple select calls or th...
The line of Perl code you provided is indeed a bit cryptic at first glance. Let's break it down step by step: ```perl select((select(s),$|=1)[0]) ``` 1. **Inner `select(s)`**: The first `select(s)` call is changing the default filehandle for output to the filehandle `s`. This means that subsequent output operations (...
28,503
[ { "from": "human", "value": "I've seen some horrific code written in Perl, but I can't make head nor tail of this one:\nselect((select(s),$|=1)[0])\n\nIt's in some networking code that we use to communicate with a server and I assume it's something to do with buffering (since it sets $|).\nBut I can't figur...
What's the most appropriate type used to store the duration time information of a video in sql server?
In SQL Server, the most appropriate data type to store the duration time information of a video would typically be `TIME` or a combination of `INT` for more specific cases. 1. **TIME**: If you want to store the duration in the format of hours, minutes, and seconds, the `TIME` data type is suitable. This type can store...
30,298
[ { "from": "human", "value": "What's the most appropriate type used to store the duration time information of a video in sql server?\n" }, { "from": "gpt", "value": "In SQL Server, the most appropriate data type to store the duration time information of a video would typically be `TIME` or a comb...
How do you support optimistic / pessimistic concurrency using NHibernate?
NHibernate provides support for both optimistic and pessimistic concurrency control to manage concurrent access to the database. Here's how you can implement both approaches: ### Optimistic Concurrency Control Optimistic concurrency assumes that multiple transactions can complete without affecting each other. When up...
11,763
[ { "from": "human", "value": "How do you support optimistic / pessimistic concurrency using NHibernate?\n" }, { "from": "gpt", "value": "NHibernate provides support for both optimistic and pessimistic concurrency control to manage concurrent access to the database. Here's how you can implement bo...
What software do you use to manage Scrum software development ? We've tried Tackle and VersionOne (both free) so far and they are good except for the fact that it's difficult to track work in progress. For example, if I have a task that I estimate will take me 8 hours to complete, I've done 4 hours of work with 4 ho...
There are several software tools that can effectively support Scrum software development and provide better work in progress (WIP) tracking. Here are a few suggestions that may suit your needs: 1. **Jira**: Jira is one of the most popular tools for Agile project management. It allows you to break down tasks into sub-t...
27,375
[ { "from": "human", "value": "What software do you use to manage Scrum software development ? \nWe've tried Tackle and VersionOne (both free) so far and they are good except for the fact that it's difficult to track work in progress. For example, if I have a task that I estimate will take me 8 hours to com...
Can anoyne recommend a good library that will let me easily read/write private member fields of a class? I was looking through apache commons, but couldnt see it. I must be getting blind ? Edit: Asking questions on the border of legalities always give these questions of "why"? I am writing several javarebel plugins for...
If you're looking for a library that allows you to easily read and write private member fields of a class in Java, you might want to consider using **Java Reflection**. However, if you prefer a more user-friendly abstraction over reflection, you can check out libraries like: 1. **Apache Commons Lang - ReflectionUtils*...
24,952
[ { "from": "human", "value": "Can anoyne recommend a good library that will let me easily read/write private member fields of a class? I was looking through apache commons, but couldnt see it. I must be getting blind ?\nEdit: Asking questions on the border of legalities always give these questions of \"why\"...
I am using Oracle SQL (in SQLDeveloper, using the SQL Worksheet). I would like to print a statement before my select, such as PRINT 'Querying Table1'; SELECT * from Table1; What do I use to Print / show text output? It's not Print, because that gives me the error: Bind Variable Table1 is NOT DECLARED. DBMS_OUTPUT.P...
In Oracle SQL, the `PRINT` command is not available like it is in some other SQL databases (e.g., SQL Server). Instead, you can use PL/SQL for this purpose, which allows you to write procedural code, including output statements. To display a message in SQL Developer before running your SELECT statement, you can use th...
26,624
[ { "from": "human", "value": "I am using Oracle SQL (in SQLDeveloper, using the SQL Worksheet). I would like to print a statement before my select, such as\nPRINT 'Querying Table1';\nSELECT * from Table1;\n\nWhat do I use to Print / show text output? It's not Print, because that gives me the error: Bind Va...
When using APIs handling asynchronous events in .Net I find myself unable to predict how the library will scale for large numbers of objects. For example, using the Microsoft.Office.Interop.UccApi library, when I create an endpoint it gets events when phone events happen. Now let's say I want to create 1000 endpoints. ...
When working with APIs that handle asynchronous events in .NET, especially those that are unmanaged like `Microsoft.Office.Interop.UccApi`, it's crucial to understand the threading and event handling model of the library to predict how well it will scale with a large number of objects. ### Key Points to Consider 1. *...
23,865
[ { "from": "human", "value": "When using APIs handling asynchronous events in .Net I find myself unable to predict how the library will scale for large numbers of objects.\nFor example, using the Microsoft.Office.Interop.UccApi library, when I create an endpoint it gets events when phone events happen. Now l...
I need to determine state of last build (success/failure) and I do it like this: report_url = 'http://.../ViewLatestBuildReport.aspx' success_marker = '<td class="header-title" colspan="2">BUILD SUCCESSFUL</td>' page = urllib.urlopen(report_url) if all(success_marker not in line for line in page): # build is not good...
To improve your approach to checking the state of the last build, you can use a more efficient and robust method. Instead of loading the entire HTML page, you can use the `requests` library to fetch the content and then look for the success marker in a more structured way. Here's a refined approach: 1. Use the `requ...
26,408
[ { "from": "human", "value": "I need to determine state of last build (success/failure) and I do it like this:\nreport_url = 'http://.../ViewLatestBuildReport.aspx'\nsuccess_marker = '<td class=\"header-title\" colspan=\"2\">BUILD SUCCESSFUL</td>'\npage = urllib.urlopen(report_url)\nif all(success_marker not...
What's better practice when defining several methods that return the same shape of data with different filters? Explicit method names or overloaded methods? For example. If I have some Products and I'm pulling from a database explicit way: public List<Product> GetProduct(int productId) { // return a List } public...
The choice between explicit method names and overloaded methods often boils down to readability, clarity, and maintainability of your code. Here's a breakdown of the two approaches, along with their pros and cons: ### Explicit Method Names **Example:** ```csharp public List<Product> GetProduct(int productId); public ...
25,495
[ { "from": "human", "value": "What's better practice when defining several methods that return the same shape of data with different filters? Explicit method names or overloaded methods?\nFor example. If I have some Products and I'm pulling from a database\nexplicit way:\npublic List<Product> GetProduct(int ...
Is Eclipse the best IDE for Java? If not, is there something better? I want to know and possibly try it out. Thanks.
Eclipse is one of the most popular Integrated Development Environments (IDEs) for Java development, but whether it's the "best" depends on your specific needs and preferences. Here are some alternatives to Eclipse that you might consider: ### 1. **IntelliJ IDEA** - **Overview**: Developed by JetBrains, IntelliJ IDEA i...
23,716
[ { "from": "human", "value": "Is Eclipse the best IDE for Java? \nIf not, is there something better? \nI want to know and possibly try it out. Thanks.\n" }, { "from": "gpt", "value": "Eclipse is one of the most popular Integrated Development Environments (IDEs) for Java development, but whether ...
Is it possible to subscribe to a Windows event that fires when Windows is going into or coming out of Sleep or Hibernate state? I need my application to be made aware when the computer is going to sleep to do some cleanup and avoid timing issues when it comes out of sleep.
Yes, it is possible to subscribe to Windows events that indicate when the system is entering or exiting sleep or hibernate states. This can be done using the Windows API, specifically the `WM_POWERBROADCAST` message, which is sent to applications when there is a change in power status. Here’s a high-level approach on...
26,023
[ { "from": "human", "value": "Is it possible to subscribe to a Windows event that fires when Windows is going into or coming out of Sleep or Hibernate state?\nI need my application to be made aware when the computer is going to sleep to do some cleanup and avoid timing issues when it comes out of sleep.\n" ...
For some odd reason the Elapsed event is firing twice, where it should definitely be firing once. And immediately after, the timer ceases to work... The code structure is somewhat like this: A certain object is defined to fire a certain event when a value it contains, which is constantly updated in 500-1500ms intervals...
From your description, it sounds like the issue you're facing with the `Elapsed` event firing twice may be due to the way the timer is being started, stopped, and reset in relation to the `vMonitor` events. Given that you have multiple threads updating the values, the race condition could also be a potential source of ...
26,074
[ { "from": "human", "value": "For some odd reason the Elapsed event is firing twice, where it should definitely be firing once.\nAnd immediately after, the timer ceases to work...\nThe code structure is somewhat like this:\nA certain object is defined to fire a certain event when a value it contains, which i...
I've recently decided that I just have to finally learn C/C++, and there is one thing I do not really understand about pointers or more precisely, their definition. How about these examples: int* test; int *test; int * test; int* test,test2; int *test,test2; int * test,test2; Now, to my understanding, the first three...
You've done a good job analyzing the different declarations of pointers in C/C++. Let's clarify your understanding of these pointer declarations step by step. ### Pointer Declaration Basics 1. **Basic Pointer Syntax**: In C/C++, the asterisk (`*`) is used to denote that a variable is a pointer to a type. The type com...
26,571
[ { "from": "human", "value": "I've recently decided that I just have to finally learn C/C++, and there is one thing I do not really understand about pointers or more precisely, their definition.\nHow about these examples:\n\nint* test;\nint *test;\nint * test;\nint* test,test2;\nint *test,test2;\nint * test,...
This is a problem that is affecting me. Although this description wasn´t written by me (seen at www.experts-exchange.com (1), one of the kind of sites stackoverflow was created because of) it applies 95% to the problem I´m having. Next time I won´t follow MS advice, The domain was working until I tried the suggested so...
It looks like you are dealing with a significant issue related to the File Replication Service (FRS) and the SYSVOL directory on your Windows Server 2003 SBS environment. Here’s a step-by-step approach you can take to resolve the situation, based on the details provided in your description: ### Step 1: Verify Basic Co...
27,376
[ { "from": "human", "value": "This is a problem that is affecting me. Although this description wasn´t written by me (seen at www.experts-exchange.com (1), one of the kind of sites stackoverflow was created because of) it applies 95% to the problem I´m having. Next time I won´t follow MS advice, The domain w...
select max(DELIVERY_TIMESTAMP) from DOCUMENTS; will return the time that the latest document was delivered. How do I return the other columns for the latest document? For example I want DOC_NAME for the document that was most recently delivered? I'm not sure how to form the WHERE clause.
To return additional columns for the latest document delivered, you can use a common table expression (CTE) or a subquery that gets the maximum `DELIVERY_TIMESTAMP`, and then join it with the original table to retrieve the other columns. Here's how you can do it using both methods: ### Method 1: Using a Subquery You c...
28,795
[ { "from": "human", "value": "select max(DELIVERY_TIMESTAMP) from DOCUMENTS; will return the time that the latest document was delivered. How do I return the other columns for the latest document? For example I want DOC_NAME for the document that was most recently delivered?\nI'm not sure how to form the WHE...
I have client application that uses WCF service to insert some data to backend database. Client application is going to call service on per event basis (it can be every hour or every second). I'm wondering what's the best way of calling that service. Should I create communication channel and keep it open all the time,...
When using WCF (Windows Communication Foundation) services, you have a few different strategies for managing communication channels, especially when your client application is going to make frequent calls to the service. Here are the two primary approaches you mentioned: ### 1. **Open and Close Channels for Each Call*...
25,989
[ { "from": "human", "value": "I have client application that uses WCF service to insert some data to backend database. Client application is going to call service on per event basis (it can be every hour or every second).\nI'm wondering what's the best way of calling that service. \nShould I create communica...
I'm generating and showing a new WinForms window on top of a Main Window. How can I achieve that the original (Main Window) keeps the focus? Setting the focus back after showing the new window does not solve my problem because I need to prevent the Main Window's title bar from flickering. The new window has to stay on ...
To show a new WinForms window on top of your main window without stealing focus from it and without causing the flickering of the main window's title bar, you'll need to create the new window in a way that it does not activate itself. One effective method is to use the `Show` method in conjunction with some additional ...
29,306
[ { "from": "human", "value": "I'm generating and showing a new WinForms window on top of a Main Window. How can I achieve that the original (Main Window) keeps the focus? Setting the focus back after showing the new window does not solve my problem because I need to prevent the Main Window's title bar from f...
I need to store the summer time (daylight saving time) change-over rules for different world regions in a database. I already have a way of storing regions and sub-regions (so the whole "half of Australia"/Arizona/Navaho problem is taken care of), but I'm wondering what the most efficient schema would be to accomplish...
When designing a schema to store daylight saving time (DST) change-over rules for different regions, it's important to consider both flexibility and ease of use, especially since this data might be accessed by multiple applications with varying capabilities. Here are a couple of schema options that could balance your n...
21,292
[ { "from": "human", "value": "I need to store the summer time (daylight saving time) change-over rules for different world regions in a database. I already have a way of storing regions and sub-regions (so the whole \"half of Australia\"/Arizona/Navaho problem is taken care of), but I'm wondering what the m...
I have a div that contains several child elements, one of which is a flash movie. When rolling over this div, I want it to change style to indicate it is rolled over. My problem is that the mouseover and mouseout events don't always trigger, especially if the user moves the mouse over the flash element too quickly. Any...
Dealing with mouse events when a Flash movie is involved can indeed be tricky because Flash can capture mouse events itself, causing issues for the parent elements. Here are several approaches you can take to ensure that your rollover effects work properly: ### 1. Use Mouse Events on the Container You can monitor mou...
22,329
[ { "from": "human", "value": "I have a div that contains several child elements, one of which is a flash movie.\nWhen rolling over this div, I want it to change style to indicate it is rolled over. My problem is that the mouseover and mouseout events don't always trigger, especially if the user moves the mou...
Is it possible in .NET to ascertain whether my application is closing due to Windows being given a shutdown command (as opposed to any old application closing) in order to either write out some temporary cache files or even block the shutdown long enough to prompt for user input? Whilst my current scope involves a Winf...
In .NET applications, there are ways to determine if your application is closing due to a system shutdown or due to normal application termination. This can be crucial for ensuring that you can perform necessary cleanup operations, such as writing temporary files, or to prompt the user before allowing the application t...
25,754
[ { "from": "human", "value": "Is it possible in .NET to ascertain whether my application is closing due to Windows being given a shutdown command (as opposed to any old application closing) in order to either write out some temporary cache files or even block the shutdown long enough to prompt for user input...
From day 1 of my programming career, I started with object-oriented programming. However, I'm interested in learning other paradigms (something which I've said here on SO a number of times is a good thing, but I haven't had the time to do). I think I'm not only ready, but have the time, so I'll be starting functional p...
Transitioning from object-oriented programming (OOP) to functional programming (FP) can indeed be a refreshing experience! F# is a great choice for exploring FP due to its powerful features and seamless integration with the .NET ecosystem. Here's a guide on how to structure and design applications in a functional style...
23,722
[ { "from": "human", "value": "From day 1 of my programming career, I started with object-oriented programming. However, I'm interested in learning other paradigms (something which I've said here on SO a number of times is a good thing, but I haven't had the time to do). I think I'm not only ready, but have t...
I have a series of text that contains mixed numbers (ie: a whole part and a fractional part). The problem is that the text is full of human-coded sloppiness: The whole part may or may not exist (ex: "10") The fractional part may or may not exist (ex: "1/3") The two parts may be separated by spaces and/or a hyphens (ex...
You can use the following regex pattern to match the mixed numbers you're describing: ```regex (?:(\d+)\s*[- ]?\s*(?:(\d+)\s*/\s*(\d+)|(?:\d+\s*/\s*\d+)?|(?:\d+)?)) ``` Let's break down this regex pattern: 1. `(?: ... )` - A non-capturing group. 2. `(\d+)` - Captures the whole number part (if it exists). 3. `\s*[- ]...
26,790
[ { "from": "human", "value": "I have a series of text that contains mixed numbers (ie: a whole part and a fractional part). The problem is that the text is full of human-coded sloppiness:\n\nThe whole part may or may not exist (ex: \"10\")\nThe fractional part may or may not exist (ex: \"1/3\")\nThe two part...
I have an XML file like <ns0:Employees xmlns:ns0="http://TestIndexMap.Employees"> <Employee FirstName="FirstName_0" LastName="LastName_1" dept="dept_2" empNumber="1"> <Schedules> <Schedule Date_join="2008-01-20" Date_end="2008-01-30" /> </Schedules> </Employee> <Employee FirstName="FirstName_0" Last...
To remove duplicates from your XML based on the attributes `FirstName`, `LastName`, `Date_join`, and `Date_end` using XSLT, you can utilize the `key` mechanism to group entries and filter out duplicates. Here's a step-by-step explanation of the XSLT stylesheet that accomplishes this: 1. **Define Keys**: Use the `xsl:...
20,030
[ { "from": "human", "value": "I have an XML file like\n<ns0:Employees xmlns:ns0=\"http://TestIndexMap.Employees\">\n <Employee FirstName=\"FirstName_0\" LastName=\"LastName_1\" dept=\"dept_2\" empNumber=\"1\">\n <Schedules>\n <Schedule Date_join=\"2008-01-20\" Date_end=\"2008-01-30\" />\n </Sched...
I have Visual Studio 2008 and the Windows SDK for Windows Server 2008 and .NET Framework 3.5 installed. I believe that is the latest platform SDK. I'm trying to build a signed dll to be installed in SxS. All the tutorials explain to use a tool called pktextract.exe which is part of the SDK, but I can't seem to find the...
In the Windows SDK for Windows Server 2008, `pktextract.exe` is indeed a tool that can be used to extract a public key token from a strong-named assembly. However, it seems that this tool may not be included in some SDK installations or may not be well-documented. If you cannot find `pktextract.exe`, there are alterna...
24,661
[ { "from": "human", "value": "I have Visual Studio 2008 and the Windows SDK for Windows Server 2008 and .NET Framework 3.5\ninstalled. I believe that is the latest platform SDK.\nI'm trying to build a signed dll to be installed in SxS.\nAll the tutorials explain to use a tool called pktextract.exe which is p...
Is there any way to do the equivalent of the following in a JSP without using scriptlet? <% response.setContentType("text/plain"); %> I can't simply use because I need to set the content-type in 2 places (each in a different branch of a ) and the JSP compiler will only allow one such directive. Also, I can't write tw...
In JSP, while traditional scriptlets (`<% ... %>`) are a common way to execute Java code, it's generally encouraged to avoid them for cleaner, more maintainable code. Instead, you can use JSP EL (Expression Language) or JSTL (JavaServer Pages Standard Tag Library) to achieve similar functionality without scriptlets. F...
26,561
[ { "from": "human", "value": "Is there any way to do the equivalent of the following in a JSP without using scriptlet?\n<% response.setContentType(\"text/plain\"); %>\n\nI can't simply use\nbecause I need to set the content-type in 2 places (each in a different branch of a ) and the JSP compiler will only a...
How do you insert/update a column through Linq To SQL and Linq To SQL use the default values? In particular I'm concerned with a timestamp field. I've tried setting that column to readonly and autogenerated, so it stopped trying to put in DateTime.MinValue, but it doesn't seem to be updating on updates.
In LINQ to SQL, handling default values for columns, such as a timestamp (or rowversion in SQL Server), can indeed be tricky, especially since you want the database to automatically manage those values. Here are some steps and considerations to ensure that the default values are applied correctly when performing update...
25,825
[ { "from": "human", "value": "How do you insert/update a column through Linq To SQL and Linq To SQL use the default values? In particular I'm concerned with a timestamp field.\nI've tried setting that column to readonly and autogenerated, so it stopped trying to put in DateTime.MinValue, but it doesn't seem...
I have a property called "IsSecureConnection" that is part of my object's interface. This makes sense for most implementations of the interface, however, in some implementations I would like to make the property ReadOnly. Should I omit this property from the object's interface even though it is required by all of th...
When designing interfaces, it's important to balance the contract they define with the flexibility needed for different implementations. If the `IsSecureConnection` property makes sense and is necessary for all implementations of the interface, but some implementations should treat it as read-only, you have a few optio...
26,995
[ { "from": "human", "value": "I have a property called \"IsSecureConnection\" that is part of my object's interface. This makes sense for most implementations of the interface, however, in some implementations I would like to make the property ReadOnly. \nShould I omit this property from the object's inter...
Is this doable in either IE7 or Firefox?
If you could provide more context or specify what you are trying to accomplish, I can better assist you with whether it is doable in Internet Explorer 7 (IE7) or Firefox. Each browser has its own capabilities and limitations, especially since IE7 is an older browser with less support for modern web standards compared t...
32,163
[ { "from": "human", "value": "Is this doable in either IE7 or Firefox?\n" }, { "from": "gpt", "value": "If you could provide more context or specify what you are trying to accomplish, I can better assist you with whether it is doable in Internet Explorer 7 (IE7) or Firefox. Each browser has its o...
What I am looking for is a way to call a method after another method has been invoked but before it is entered. Example: public class Test { public void Tracer ( ... ) { } public int SomeFunction( string str ) { return 0; } public void TestFun() { SomeFunction( "" ); } } In the example ab...
If you're looking to call a tracing method after a method has been invoked but before it actually executes, you're essentially looking to implement a form of method interception. While libraries like Castle's DynamicProxy or Aspect-Oriented Programming (AOP) frameworks are commonly used for this purpose, you can achiev...
23,791
[ { "from": "human", "value": "What I am looking for is a way to call a method after another method has been invoked but before it is entered. Example:\npublic class Test {\n\n public void Tracer ( ... )\n {\n }\n\n public int SomeFunction( string str )\n {\n return 0;\n }\n\n public void TestFun()\...
I am only one person working on project - so I am developer without PM above me. I finished portal, hovewer client from time to time attacks me with request such as "make font bigger" or change margin in css or make button which makes "xxx and yyy". There are simple task, sometimes only for few clicks, but it takes my...
Dealing with frequent, small requests can be challenging, especially when you're managing a project alone. Here are some strategies to help you manage these requests more effectively while still being responsive to your client: ### 1. **Set Clear Boundaries**: - **Define Working Hours**: Communicate your availabili...
27,531
[ { "from": "human", "value": "I am only one person working on project - so I am developer without PM above me. I finished portal, hovewer client from time to time attacks me with request such as \"make font bigger\" or change margin in css or make button which makes \"xxx and yyy\". \nThere are simple task, ...
We would like to have several internal web applications which use the same master page. Is there a way to store a master page in a common library referenced by all projects?
Yes, you can store a master page in a common library and reference it in multiple web applications. Here are a few approaches to achieve this, depending on your technology stack and architecture: ### 1. **Using a Class Library (ASP.NET Web Forms)** If you are using ASP.NET Web Forms, you can create a Class Library th...
27,946
[ { "from": "human", "value": "We would like to have several internal web applications which use the same master page. Is there a way to store a master page in a common library referenced by all projects?\n" }, { "from": "gpt", "value": "Yes, you can store a master page in a common library and re...
If I view the HTML generated by one of my Jasper reports in IE7 I see the following: <BR /><BR /> <A name="JR_PAGE_ANCHOR_0_1"> <TABLE style="WIDTH: 1000px" cellSpacing="0" cellPadding="0" bgColor="#ffffff" border="0"> <-- table body omitted --> </TABLE> The two BR tags are added via the JRHtmlExporterParameter.HTML_...
It appears that you're experiencing an issue with the unclosed anchor tag generated by Jasper Reports when exporting to HTML, which is causing formatting issues in Internet Explorer 7. Here are a few suggestions to address this problem: 1. **Modify HTML Exporter Settings**: If you are not using the anchor tag gener...
25,164
[ { "from": "human", "value": "If I view the HTML generated by one of my Jasper reports in IE7 I see the following: \n<BR /><BR />\n<A name=\"JR_PAGE_ANCHOR_0_1\">\n<TABLE style=\"WIDTH: 1000px\" cellSpacing=\"0\" cellPadding=\"0\" bgColor=\"#ffffff\" border=\"0\">\n<-- table body omitted -->\n</TABLE>\n\nThe...
I would like to add a custom menu item when you right-click a certain file extension in Visual Studio. There seem to be some helper open source projects to accomplish this, but I'd like to ask if anyone has ever used them, and how easy were they - and can you help me and provide a starting point? One I've researched is...
To add a custom menu item to the context menu for a specific file extension in Visual Studio, you can indeed use an extension like **ManagedMenuExtension** or create your own Visual Studio extension. Below, I'll give you a brief overview of how you might accomplish this using both approaches. ### Using ManagedMenuExte...
22,761
[ { "from": "human", "value": "I would like to add a custom menu item when you right-click a certain file extension in Visual Studio.\nThere seem to be some helper open source projects to accomplish this, but I'd like to ask if anyone has ever used them, and how easy were they - and can you help me and provid...
Is there a way to drop a validation that was set in Rails plugin (or included module)? Let's say I have some model with module included in it: class User < ActiveRecord::Base include SomeModuleWithValidations # How to cancel validates_presence_of :something here? end module SomeModuleWithValidations def self.inc...
To remove or override a validation in Rails that is added by a module, you can use a couple of different approaches. Here are a few methods you might consider: ### Method 1: Using `skip_validations` Rails provides a way to skip validations using `skip_validators`. However, this is not available directly on the model ...
28,222
[ { "from": "human", "value": "Is there a way to drop a validation that was set in Rails plugin (or included module)?\nLet's say I have some model with module included in it:\nclass User < ActiveRecord::Base\n include SomeModuleWithValidations\n # How to cancel validates_presence_of :something here?\nend\n\...
Is using SQL Express in a production environment a reasonable choice? I looked at Microsoft's comparison chart: https://www.microsoft.com/en-us/sql-server/sql-server-2019-comparison I would be using SQL Express with a small to mid-sized web site. I don't believe I would exceed the 4GB database size limit. Is SQL Expr...
Using SQL Server Express in a production environment can be a reasonable choice under certain circumstances, especially for small to mid-sized applications or web sites. Here are some considerations to keep in mind: ### Advantages of SQL Server Express: 1. **Cost-Effective**: SQL Server Express is free, making it a g...
27,942
[ { "from": "human", "value": "Is using SQL Express in a production environment a reasonable choice?\nI looked at Microsoft's comparison chart:\nhttps://www.microsoft.com/en-us/sql-server/sql-server-2019-comparison\nI would be using SQL Express with a small to mid-sized web site. I don't believe I would exce...
I have an EXE file that I should like to sign so that Windows will not warn the end user about an application from an "unknown publisher". I am not a Windows developer. The application in question is a screensaver generated from an application that generates screensaver applications. As such I have no influence on how ...
To sign your EXE file, you will indeed need a code signing certificate, and here's a simple explanation of how to get started: ### Steps to Sign an EXE File 1. **Obtain a Code Signing Certificate**: - **Purchase a Certificate**: Code signing certificates are typically issued by trusted Certificate Authorities (CAs...
25,894
[ { "from": "human", "value": "I have an EXE file that I should like to sign so that Windows will not warn the end user about an application from an \"unknown publisher\". I am not a Windows developer. The application in question is a screensaver generated from an application that generates screensaver applic...
I have the following class: public class ViewPage<TView,TPresenter> : Page where TView : IView where TPresenter : Presenter<TView> { public ViewPage() { if (!(this is TView)) throw new Exception(String.Format("The view must be of type {0}", typeof(TView))); IWindsorContaine...
To pass the current instance of `ViewPage` to the `TPresenter` using Windsor, you will need to modify the way you're registering components with the `IWindsorContainer`. Specifically, you'll want to register the `ViewPage` instance itself as a dependency for the `TPresenter`. Here's how you can do that: 1. Register t...
25,490
[ { "from": "human", "value": "I have the following class:\npublic class ViewPage<TView,TPresenter> : Page \n where TView : IView\n where TPresenter : Presenter<TView>\n{\n public ViewPage()\n {\n if (!(this is TView))\n throw new Exception(String.Format(\"The view must be of typ...
I'm having a problem, creating a fixed-size overall panel for a touchscreen GUI application that has to take up the entire screen. In a nutshell, the touchscreen is 800 x 600 pixels, and therefore I want the main GUI panel to be that size. When I start a new GUI project in NetBeans, I set the properties of the main pa...
It sounds like you're encountering a common issue when designing GUIs using layout managers in Java Swing, especially with the FreeDesign layout. Here are several suggestions to ensure that your main panel maintains the desired size of 800x600 pixels: ### 1. Use the `setPreferredSize` Method Make sure you use `setPre...
25,715
[ { "from": "human", "value": "I'm having a problem, creating a fixed-size overall panel for a touchscreen GUI application that has to take up the entire screen. In a nutshell, the touchscreen is 800 x 600 pixels, and therefore I want the main GUI panel to be that size.\nWhen I start a new GUI project in Net...
What is the best way to extract the MAC address from ifconfig's output? Sample output: bash-3.00# ifconfig eth0 eth0 Link encap:Ethernet HWaddr 1F:2E:19:10:3B:52 inet addr:127.0.0.66 Bcast:127.255.255.255 Mask:255.0.0.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 ...
To extract the MAC address from the output of `ifconfig`, you can use several command-line tools like `cut`, `awk`, `sed`, or `grep`. Each of these tools has its own strengths and weaknesses. Here's a quick rundown of how to use each method, along with their merits and demerits. ### 1. Using `awk` ```bash ifconfig eth...
28,216
[ { "from": "human", "value": "What is the best way to extract the MAC address from ifconfig's output?\nSample output:\nbash-3.00# ifconfig eth0 \neth0 Link encap:Ethernet HWaddr 1F:2E:19:10:3B:52 \n inet addr:127.0.0.66 Bcast:127.255.255.255 Mask:255.0.0.0 \n UP BROADCA...
If I do a Create Table If Not Exists, and a table with the same name exists with fewer rows (or columns), what would happen?
When you use the `CREATE TABLE IF NOT EXISTS` statement in SQL, the command checks to see if a table with the specified name already exists in the database. If a table with that name is found, the `CREATE TABLE` command will not execute, and no changes will be made to the existing table. Therefore, if there is alread...
27,710
[ { "from": "human", "value": "If I do a Create Table If Not Exists, and a table with the same name exists with fewer rows (or columns), what would happen?\n" }, { "from": "gpt", "value": "When you use the `CREATE TABLE IF NOT EXISTS` statement in SQL, the command checks to see if a table with the...
I've been wondering, what is the point of clog? As near as I can tell, clog is the same as cerr but with buffering so it is more efficient. Usually stderr is the same as stdout, so clog is the same as cout. This seems pretty lame to me, so I figure I must be misunderstanding it. If I have log messages going out to the ...
You're correct in noting that `clog` and `cerr` in C++ both serve the purpose of outputting error and logging messages, but they differ mainly in their buffering behavior. Let's break down your questions and concerns: ### 1. The Difference Between `clog` and `cerr` - **`cerr` (standard error stream)**: Unbuffered outp...
2,895
[ { "from": "human", "value": "I've been wondering, what is the point of clog? As near as I can tell, clog is the same as cerr but with buffering so it is more efficient. Usually stderr is the same as stdout, so clog is the same as cout. This seems pretty lame to me, so I figure I must be misunderstanding it....
I'm working on database designs for a project management system as personal project and I've hit a snag. I want to implement a ticket system and I want the tickets to look like the tickets in Trac. What structure would I use to replicate this system? (I have not had any success installing trac on any of my systems so I...
To create a ticket system similar to Trac, you can design a database structure that captures the essential information about tickets, along with a history of changes. Below is a suggested schema that you can adapt to meet your specific needs: ### Database Schema #### 1. `tickets` Table This table will store the curre...
20,162
[ { "from": "human", "value": "I'm working on database designs for a project management system as personal project and I've hit a snag.\nI want to implement a ticket system and I want the tickets to look like the tickets in Trac. What structure would I use to replicate this system? (I have not had any success...
As I understand the spec, a Base64 encoder a) takes the source binary, and pads it out with zeroes to be a multiple of 24 bytes long. b) it then transcodes it, six bits at a time, to the target set of 64 characters (A..Z, a..z, 0..9, +, -). If it finds the last two bytes (16 bits) have been zero-padded, the last two c...
You raise an interesting point about how a Base64 encoder distinguishes between actual zeros in the binary data and zeros that were added as padding to meet the encoding requirements. In typical Base64 encoding implementations, the encoder does not actually zero-pad the original binary data in memory. Instead, it proc...
29,234
[ { "from": "human", "value": "As I understand the spec, a Base64 encoder\na) takes the source binary, and pads it out with zeroes to be a multiple of 24 bytes long. \nb) it then transcodes it, six bits at a time, to the target set of 64 characters (A..Z, a..z, 0..9, +, -). If it finds the last two bytes (16 ...
This is a question that's been nagging me for some time. I always thought that C++ should have been designed so that the delete operator (without brackets) works even with the new[] operator. In my opinion, writing this: int* p = new int; should be equivalent to allocating an array of 1 element: int* p = new int[1]; ...
The distinction between `delete` and `delete[]` in C++ serves several important purposes beyond just memory optimization. Here are some of the key reasons why C++ was designed this way: 1. **Type Safety and Clarity**: C++ emphasizes type safety and clear intent in code. Using `new` for single objects and `new[]` for a...
26,268
[ { "from": "human", "value": "This is a question that's been nagging me for some time. I always thought that C++ should have been designed so that the delete operator (without brackets) works even with the new[] operator.\nIn my opinion, writing this:\nint* p = new int;\n\nshould be equivalent to allocating ...
In Team Foundation Server is there a way to have work items in one project linked to other projects so they show up in the reports in both. We are thinking about keeping release engineering items in their own project and want them linked to the project they are actaully for as well. Is this possible? So for instance I ...
Yes, in Team Foundation Server (TFS) and its successor Azure DevOps, it is possible to link work items across different projects. This functionality allows you to create relationships between work items, enabling you to effectively manage and report on tasks that may span multiple projects. ### Steps to Link Work Item...
28,423
[ { "from": "human", "value": "In Team Foundation Server is there a way to have work items in one project linked to other projects so they show up in the reports in both. We are thinking about keeping release engineering items in their own project and want them linked to the project they are actaully for as w...
I want to load the flex framework as an RSL (SWZ, using player caching) but I need to monkey patch a couple of bug fixes in the framework. A number of forums suggest this is not possible. Has anyone gotten this to work?
Loading the Flex framework as a Runtime Shared Library (RSL) using SWZ with player caching while applying monkey patches can be challenging. Here are some points to consider and potential strategies for achieving this: 1. **Understand the Limitations**: The main limitation of using RSLs is that they are cached and imm...
28,950
[ { "from": "human", "value": "I want to load the flex framework as an RSL (SWZ, using player caching) but I need to monkey patch a couple of bug fixes in the framework.\nA number of forums suggest this is not possible. Has anyone gotten this to work?\n" }, { "from": "gpt", "value": "Loading the F...
You often see, on sites like The Daily WTF, examples of overengineered code that should have just been a call to a built-in method within the .NET framework. What namespaces/classes should be considered essential knowledge for a developer starting his/her first .NET job? As per Joel Spolsky's instruction for these type...
Here are essential namespaces/classes in .NET that a developer should consider important knowledge: 1. **System.String** - Fundamental class for string manipulation. 2. **System.Collections.Generic.List<T>** - Dynamic array that supports strongly-typed collections. 3. **System.Linq.Enumerable** - Provides LINQ (La...
29,978
[ { "from": "human", "value": "You often see, on sites like The Daily WTF, examples of overengineered code that should have just been a call to a built-in method within the .NET framework.\nWhat namespaces/classes should be considered essential knowledge for a developer starting his/her first .NET job?\nAs pe...
When setting up a Home Directory on IIS6 properties for a web site there's an option to "Index this resource" which is checked on by default. Microsoft's site says: Grant this permission to allow Microsoft Indexing Service to include this folder in a full-text index of the Web site. When you grant this permis...
The "Index this resource" option in IIS 6 allows the Microsoft Indexing Service to create a full-text index for the files and content in the specified folder. Here are some details on when to enable this option, the types of queries users might perform, and the pros and cons of enabling or disabling this feature. ### ...
25,191
[ { "from": "human", "value": "When setting up a Home Directory on IIS6 properties for a web site there's an option to \"Index this resource\" which is checked on by default.\nMicrosoft's site says: \n\nGrant this\n permission to allow Microsoft Indexing\n Service to include this folder in a\n full-text in...
I'm porting a Java library to C#. I'm using Visual Studio 2008, so I don't have the discontinued Microsoft Java Language Conversion Assistant program (JLCA). My approach is to create a new solution with a similar project structure to the Java library, and to then copy the java code into a c# file and convert it to vali...
Porting a Java library to C# can be a challenging task due to the subtle differences between the two languages. Here are some rules-of-thumb and guidelines that can help you navigate these differences more effectively: ### General Language Differences 1. **Namespaces vs. Packages**: - In Java, you use `package` de...
24,165
[ { "from": "human", "value": "I'm porting a Java library to C#. I'm using Visual Studio 2008, so I don't have the discontinued Microsoft Java Language Conversion Assistant program (JLCA).\nMy approach is to create a new solution with a similar project structure to the Java library, and to then copy the java ...
I have a case that keeps coming up where I'm using a ListView or similar control with a simple array such as string[]. Is there a way to use the DataKeyNames property when you are binding to simple collections?
In ASP.NET Web Forms, the `DataKeyNames` property is typically used with data-bound controls like `GridView` or `ListView` to specify which field(s) of the data source will be treated as the primary key for each data item. However, when you're binding to simple collections like `string[]`, there isn't an inherent way t...
28,592
[ { "from": "human", "value": "I have a case that keeps coming up where I'm using a ListView or similar control with a simple array such as string[].\nIs there a way to use the DataKeyNames property when you are binding to simple collections?\n" }, { "from": "gpt", "value": "In ASP.NET Web Forms, ...
Can I put the painter into the class variables? : protected: QPainter *myPainter; ... void MyWidget::paintEvent(QPaintEvent *event) { myPainter = new QPainter(this);
Yes, you can declare a `QPainter` object as a class member variable (like `myPainter` in your example), but it's important to manage the lifetime of the `QPainter` object correctly. Typically, you should not create a `QPainter` using `new` and store it as a pointer. The `QPainter` class is designed to be stack-alloca...
28,880
[ { "from": "human", "value": "Can I put the painter into the class variables? :\nprotected:\nQPainter *myPainter;\n\n...\n\nvoid MyWidget::paintEvent(QPaintEvent *event)\n{\n myPainter = new QPainter(this);\n\n" }, { "from": "gpt", "value": "Yes, you can declare a `QPainter` object as a class ...
What is the best way to validate a crontab entry with PHP? Should I be using a regex, or an external library? I've got a PHP script that adds/removes entries from a crontab file, but want to have some way to verify that the time interval portion is in a valid format.
Validating a crontab entry in PHP can be approached in a few ways, but using a regular expression is one common method. However, using a library specifically designed for parsing and validating crontab entries can be more robust and less error-prone. ### Option 1: Regular Expression You can use a regex to validate th...
24,677
[ { "from": "human", "value": "What is the best way to validate a crontab entry with PHP? Should I be using a regex, or an external library? I've got a PHP script that adds/removes entries from a crontab file, but want to have some way to verify that the time interval portion is in a valid format.\n" }, {...
Full disclaimer: I'm a CS student, and this question is related to a recently assigned Java program for Object-Oriented Programming. Although we've done some console stuff, this is the first time we've worked with a GUI and Swing or Awt. We were given some code that created a window with some text and a button that rot...
Your implementation of handling multiple button actions using `actionPerformed` is perfectly valid and functional. However, as you noted, using a series of `if-else` statements can become cumbersome, especially as the number of buttons increases. Unfortunately, Java does not support switching on `String` values directl...
22,619
[ { "from": "human", "value": "Full disclaimer: I'm a CS student, and this question is related to a recently assigned Java program for Object-Oriented Programming. Although we've done some console stuff, this is the first time we've worked with a GUI and Swing or Awt. We were given some code that created a wi...
Internationalizing web apps always seems to be a chore. No matter how much you plan ahead for pluggable languages, there's always issues with encoding, funky phrasing that doesn't fit your templates, and other problems. I think it would be useful to get the SO community's input for a set of things that programmers sho...
Internationalizing web applications can indeed be a complex process, and there are several pitfalls to watch out for. Here’s a comprehensive list of considerations that can help streamline the process: ### 1. **Use Unicode (UTF-8) Everywhere** - Ensure that your application and database use UTF-8 encoding. This wil...
21,606
[ { "from": "human", "value": "Internationalizing web apps always seems to be a chore. No matter how much you plan ahead for pluggable languages, there's always issues with encoding, funky phrasing that doesn't fit your templates, and other problems.\nI think it would be useful to get the SO community's inpu...
I have started making a database and I have an 'ordered item' and a 'invoice' table. I would like to find out how I would add up the prices of the items that the customer picks. As well where abouts do you put this 'rule' on the database.
To achieve the task of adding up the prices of items from an 'ordered item' table in relation to an 'invoice' table, you will typically follow a relational database design and business logic. Here’s a step-by-step guide on how to set this up: ### 1. Define Your Tables **Ordered Item Table (e.g., `ordered_items`):** ...
24,321
[ { "from": "human", "value": "I have started making a database and I have an 'ordered item' and a 'invoice' table. I would like to find out how I would add up the prices of the items that the customer picks. As well where abouts do you put this 'rule' on the database. \n" }, { "from": "gpt", "val...
I have a fairly standard inheritance situation in my current LINQ-to-SQL project. I have a base class called 'Party' and classes called 'Individual' and 'Organisation' which inherit from it. What I want to achieve seems (and probably is) fairly simple. I want to return a list of 'Organisations' sorted by Company Name. ...
To achieve the sorting by the `CoName` property in a LINQ query where you have an inheritance hierarchy, you can cast the items in the query to the derived type `Organisation`. This allows you to access properties specific to that type. Here's how you can modify your query to sort the organisations by their `CoName` ...
28,082
[ { "from": "human", "value": "I have a fairly standard inheritance situation in my current LINQ-to-SQL project. I have a base class called 'Party' and classes called 'Individual' and 'Organisation' which inherit from it.\nWhat I want to achieve seems (and probably is) fairly simple. I want to return a list o...
I need to validate this simple pick list: <select name="<%= key %>"> <option value="ETC" SELECTED>Select an option...</option> <option value="ONE">Lorem ipsum</option> <option value="TWO">dolor sit amet</option> </select> So the user would never submit the form with the, excuse the repetition, "Select an o...
To ensure that users cannot submit the form with the "Select an option..." selected in your pick list, you can implement validation in both JavaScript and JSP. Here’s how to do it: ### JavaScript Validation You can use JavaScript to validate the selection before the form is submitted. Here’s a simple example of how t...
26,177
[ { "from": "human", "value": "I need to validate this simple pick list:\n<select name=\"<%= key %>\">\n <option value=\"ETC\" SELECTED>Select an option...</option>\n <option value=\"ONE\">Lorem ipsum</option>\n <option value=\"TWO\">dolor sit amet</option>\n</select>\n\nSo the user would never submi...
I'm in search of a JavaScript month selection tool. I'm already using jQuery on the website, so if it were a jQuery plugin, that would fit nicely. I'm open to other options, as well. Basically, I'm after a simplified version of the jQuery UI Date Picker. I don't care about the day of the month, just the month and year....
Yes, there are several jQuery plugins that can help you create a month and year selection tool that fits your requirements without the overhead of a full date picker. Here are a few options you might consider: ### 1. jQuery Month Picker A lightweight jQuery plugin called "jQuery Month Picker" allows you to select only...
20,962
[ { "from": "human", "value": "I'm in search of a JavaScript month selection tool. I'm already using jQuery on the website, so if it were a jQuery plugin, that would fit nicely. I'm open to other options, as well.\nBasically, I'm after a simplified version of the jQuery UI Date Picker. I don't care about the ...
Is there a built-in way to URL encode a string in Excel VBA or do I need to hand roll this functionality?
In Excel VBA, there isn't a built-in function specifically for URL encoding. However, you can create a custom function to handle URL encoding. URL encoding involves converting characters into a format that can be transmitted over the Internet, typically by replacing special characters with a "%" followed by two hexadec...
24,410
[ { "from": "human", "value": "Is there a built-in way to URL encode a string in Excel VBA or do I need to hand roll this functionality? \n" }, { "from": "gpt", "value": "In Excel VBA, there isn't a built-in function specifically for URL encoding. However, you can creat...
When there are one of more columns that reference another, I'm struggling for the best way to update that column while maintaining referential integrity. For example, if I have a table of labels and descriptions and two entries: Label | Description ------------------------------------ read | This item has been read RE...
Maintaining referential integrity while also enforcing case-insensitive uniqueness and making updates can be a bit tricky, but it’s certainly achievable in PostgreSQL. Below, I'll outline a process that you can follow to achieve your goal, as well as some strategies for working with your specific examples. ### Step 1:...
24,254
[ { "from": "human", "value": "When there are one of more columns that reference another, I'm struggling for the best way to update that column while maintaining referential integrity. For example, if I have a table of labels and descriptions and two entries:\nLabel | Description\n----------------------------...
%AX = (%AH + %AL) So why not %EAX = (%SOME_REGISTER + %AX) for some register %SOME_REGISTER?
In x86 assembly language and its architecture, the way registers are structured and utilized is defined by the CPU's architecture. The `%EAX` register is a 32-bit register in the x86 architecture, and it can be divided into two 16-bit segments: `%AH` (the high byte) and `%AL` (the low byte). Specifically, `%AX` is th...
25,964
[ { "from": "human", "value": "%AX = (%AH + %AL)\nSo why not %EAX = (%SOME_REGISTER + %AX) for some register %SOME_REGISTER? \n" }, { "from": "gpt", "value": "In x86 assembly language and its architecture, the way registers are structured and utilized is defined by the CPU's architecture. \n\nThe ...
How do I share state amongst TestMethods in MSTest. These tests would be run as Ordered Tests and in sequence. private TestContext testContext; public TestContext TestContext { get { return this.testContext; } set { this.testContext = value;} } [TestMethod] public void Subscri...
In MSTest, you can share state among test methods by using the `TestContext` to store properties. Your approach is on the right track, but I would recommend ensuring that you are handling the state properly to avoid potential issues, such as the state being reset between tests if they run in a different order or are ru...
23,247
[ { "from": "human", "value": "How do I share state amongst TestMethods in MSTest. These tests would be run as Ordered Tests and in sequence.\n private TestContext testContext;\n\n public TestContext TestContext\n {\n get { return this.testContext; }\n set { this.testContext = value;}\...
Having a problem trying to create a function, as part of a BizTalk helper class that returns a value of type (Microsoft.XLANGs.BaseTypes.XLANGMessage). The function code is as follows: public XLANGMessage UpdateXML (XLANGMessage inputFile) { XmlDocument xDoc = new XmlDocument(); XLANGMessage outputFile; xDoc =...
The issue you're facing is due to the fact that the `outputFile` variable is not initialized before you're trying to access it. In C#, you need to create an instance of the `XLANGMessage` before you can use it. `XLANGMessage` doesn't have a public constructor or a straightforward way to create an instance, as it is pa...
28,116
[ { "from": "human", "value": "Having a problem trying to create a function, as part of a BizTalk helper class that returns a value of type (Microsoft.XLANGs.BaseTypes.XLANGMessage). The function code is as follows:\npublic XLANGMessage UpdateXML (XLANGMessage inputFile)\n{\n XmlDocument xDoc = new XmlDocum...
I want to convert an instance of generic IDictionary<,> to non generic IDictionary. Can I do it without creating new instance of IDictionary? Is any framework support for this task? I tried wrapping the generic IDictionary<,> in a class that implements nongenetic IDictionary however I discovered that I then have to als...
In .NET, converting a generic `IDictionary<TKey, TValue>` to a non-generic `IDictionary` can be a bit tricky because the non-generic interface does not expose type parameters. However, you can achieve this without creating a new instance of `IDictionary` by creating a wrapper that implements `IDictionary`. This is inde...
14,950
[ { "from": "human", "value": "I want to convert an instance of generic IDictionary<,> to non generic IDictionary. Can I do it without creating new instance of IDictionary? Is any framework support for this task?\nI tried wrapping the generic IDictionary<,> in a class that implements nongenetic IDictionary ho...
I've found that given a form in a HTML page like this: <form name="form"> <input type="image" name="foo" src="somewhere.gif" alt="image" value="blah"/> <input type="text" name="bar" value="blah"/> </form> When accessing the elements via the DOM in Javascript, there is no element for the image input! ...
The behavior you're experiencing with the `<input type="image">` element not appearing in the `document.forms[0].elements` collection is indeed a historical quirk of how form elements are handled in some browsers, specifically in Firefox and Internet Explorer. ### Background on `<input type="image">` 1. **Type of Inp...
28,150
[ { "from": "human", "value": "I've found that given a form in a HTML page like this:\n<form name=\"form\">\n <input type=\"image\" name=\"foo\" \n src=\"somewhere.gif\" alt=\"image\" value=\"blah\"/>\n <input type=\"text\" name=\"bar\" value=\"blah\"/>\n</form>\n\nWhen accessing the elements via...
What is preferable, keeping a dataset in session or filling the dataset on each postback?
When deciding whether to keep a dataset in session or to fill it on each postback, there are several factors to consider. Both approaches have their pros and cons, and the best choice depends on the specifics of your application and its requirements. Here's a comparison to help you decide: ### Keeping Dataset in Sessi...
27,050
[ { "from": "human", "value": "What is preferable, keeping a dataset in session or filling the dataset on each postback?\n" }, { "from": "gpt", "value": "When deciding whether to keep a dataset in session or to fill it on each postback, there are several factors to consider. Both approaches have t...
I know that you can use a dummy "int" parameter on operator++ and operator-- to override the postfix versions of those operators, but I vaguely recall something about a dummy parameter that you could declare on a destructor. Does anyone know anything about that, and if so, what that dummy parameter did? This was in my ...
What you're recalling might be related to a technique that was sometimes used in older C++ environments, particularly in compilers like Turbo C++, to deal with destructor overloading, but it's important to clarify that this is not standard practice and can lead to confusion. In C++, destructors have a specific signatu...
30,409
[ { "from": "human", "value": "I know that you can use a dummy \"int\" parameter on operator++ and operator-- to override the postfix versions of those operators, but I vaguely recall something about a dummy parameter that you could declare on a destructor. Does anyone know anything about that, and if so, wha...
In our CMS, we have a place in which we enable users to play around with their site hierarchy - move pages around, add and remove pages, etc. We use drag & drop to implement moving pages around. Each move has to saved in th DB, and exported to many HTML files. If we do that in every move, it will slow down the users. ...
To automatically save user changes when they leave the page, you can use a combination of JavaScript and the `beforeunload` event. Here’s how you can implement this: 1. **Tracking Changes**: Implement a mechanism to track whether any changes have been made to the hierarchy. This could be a simple boolean variable (e.g...
25,065
[ { "from": "human", "value": "In our CMS, we have a place in which we enable users to play around with their site hierarchy - move pages around, add and remove pages, etc.\nWe use drag & drop to implement moving pages around. \nEach move has to saved in th DB, and exported to many HTML files. If we do that i...
What's the term for this design? object.method1().method2().method3() ..when all methods return *this? I found the term for this a while ago, but lost it meanwhile. I have no clue how to search for this on google :) Also if anyone can think of a better title for the question, feel free to change it. Thanks Update-Gish...
The term you are looking for is **"Method Chaining."** This design pattern allows multiple methods to be called on the same object in a single statement by returning the object itself (typically `this`) from each method. This can lead to more readable and concise code. Additionally, the concept you mentioned involving...
31,353
[ { "from": "human", "value": "What's the term for this design?\nobject.method1().method2().method3()\n\n..when all methods return *this?\nI found the term for this a while ago, but lost it meanwhile.\nI have no clue how to search for this on google :)\nAlso if anyone can think of a better title for the quest...
I have an app written in C# that lies on a network share. When I run it from a local drive, everything works fine. When I start it from the remote share, calls like try { System.Reflection.Assembly.GetExecutingAssembly(); System.IO.Directory.GetCurrentDirectory(); } throw a SecurityException 'Request failed'. ...
The behavior you're encountering is due to differences in how .NET handles security when running applications from local drives versus network shares. When running an application from a network location, .NET applies stricter security restrictions as part of its Code Access Security (CAS) model. Here are the main reas...
25,929
[ { "from": "human", "value": "I have an app written in C# that lies on a network share. When I run it from a local drive, everything works fine. When I start it from the remote share, calls like\ntry\n{\n System.Reflection.Assembly.GetExecutingAssembly();\n System.IO.Directory.GetCurrentDirectory();\n}...
I was loading a Bitmap Image from a File. When I tried to save the Image to another file I got the following error "A generic error occurred in GDI+". I believe this is because the file is locked by the image object. Ok so tried calling the Image.Clone function. This still locks the file. hmm. Next I try loading a Bit...
The "A generic error occurred in GDI+" error usually occurs when you try to work with an image file that is still open or locked by the GDI+ library. To avoid needing multiple copies of the file, you can use the following approaches: ### 1. Load the Image into Memory Instead of keeping a FileStream open, you can load...
27,197
[ { "from": "human", "value": "I was loading a Bitmap Image from a File. When I tried to save the Image to another file I got the following error \"A generic error occurred in GDI+\". I believe this is because the file is locked by the image object.\nOk so tried calling the Image.Clone function. This still l...
i want to get datetime for 2days before. i.e) how to subtract 2 days from datetime.now
In Python, you can use the `datetime` module to get the current date and time and then subtract days from it using `timedelta`. Here’s how you can subtract 2 days from the current datetime: ```python from datetime import datetime, timedelta # Get the current date and time now = datetime.now() # Subtract 2 days two_d...
31,419
[ { "from": "human", "value": "i want to get datetime for 2days before. i.e) how to subtract 2 days from datetime.now\n" }, { "from": "gpt", "value": "In Python, you can use the `datetime` module to get the current date and time and then subtract days from it using `timedelta`. Here’s how you can ...
I'm writing a query for an application that needs to list all the products with the number of times they have been purchased. I came up with this and it works, but I am not too sure how optimized it is. My SQL is really rusty due to my heavy usage of ORM's, But in this case a query is a much more elegant solution. Can ...
Your SQL query is mostly correct, but there are a few suggestions for optimization and clarity. Here are some points to consider: 1. **Subquery Usage**: Instead of using a subquery to filter the `orderitems` and `orders`, you could directly join these tables. This simplifies the query and may improve performance. 2. ...
25,901
[ { "from": "human", "value": "I'm writing a query for an application that needs to list all the products with the number of times they have been purchased.\nI came up with this and it works, but I am not too sure how optimized it is. My SQL is really rusty due to my heavy usage of ORM's, But in this case a q...
From a jsp is thrown a NullPointerException for example using <% null.toString(); %> This exception is not handled by the HandlerExceptionResolver, but thrown to the web container(tomcat) and converted into a code 500 error. How can I configure spring to get that error in my HandlerExceptionResolver ? Details: Spring...
Handling exceptions that occur in JSPs (or views) can be a bit challenging since these exceptions typically do not propagate through Spring's usual handling mechanism (like controllers do). However, there are several strategies you can employ to ensure that exceptions thrown in your JSP files can be caught and handled ...
25,547
[ { "from": "human", "value": "From a jsp is thrown a NullPointerException for example using <% null.toString(); %>\nThis exception is not handled by the HandlerExceptionResolver, but thrown to the web container(tomcat) and converted into a code 500 error.\nHow can I configure spring to get that error in my ...
I work at a small company and our production system uses a hand-rolled RESTful API, implemented in Java with JAXB. We now find that we're taking on customers who use Ruby on Rails, and I have to come up with a reference implementation to show customers how to use our API in Ruby. I'd love to be able to just tell them ...
To generate XML with namespaces in Ruby, you can utilize the built-in `Builder` library, which provides a simple way to construct XML documents programmatically. Unlike ActiveResource, which may not handle namespaces as required for your API, the Builder library gives you more control over the structure of the XML, inc...
25,499
[ { "from": "human", "value": "I work at a small company and our production system uses a hand-rolled RESTful API, implemented in Java with JAXB. We now find that we're taking on customers who use Ruby on Rails, and I have to come up with a reference implementation to show customers how to use our API in Rub...
Is there a best way to turn an integer into its month name in .net? Obviously I can spin up a datetime to string it and parse the month name out of there. That just seems like a gigantic waste of time.
In .NET, if you want to convert an integer representing a month (1 for January, 2 for February, etc.) into its corresponding month name without creating a `DateTime` object, you can use the `CultureInfo` class along with the `DateTimeFormatInfo`. Here’s how you can do it efficiently: ### Method 1: Using `CultureInfo` ...
26,641
[ { "from": "human", "value": "Is there a best way to turn an integer into its month name in .net?\nObviously I can spin up a datetime to string it and parse the month name out of there. That just seems like a gigantic waste of time.\n" }, { "from": "gpt", "value": "In .NET, if you want to conver...
I'm writing an application that does async loading of images onto the screen. I have it set up to be NOT concurrent (that is, it spawns a thread and executes them one at a time), so I've only overridden the [NSOperation main] function in my NSOperation subclass. Anyway, so when I add all of these operations, I want to...
It sounds like you're encountering a situation where you're not able to retrieve the operations from the `NSOperationQueue` when running on a physical device, while it works fine in the simulator. This discrepancy can sometimes happen due to how the queue operates under different environments, but here are a few things...
26,108
[ { "from": "human", "value": "I'm writing an application that does async loading of images onto the screen. I have it set up to be NOT concurrent (that is, it spawns a thread and executes them one at a time), so I've only overridden the [NSOperation main] function in my NSOperation subclass. \nAnyway, so whe...
I have a similar problem to this post. I need to display up to 1000 polygons on an embedded Google map. The polygons are in a SQL database, and I can render each one as a single KML file on the fly using a custom HttpHandler (in ASP.NET), like this http://alpha.foresttransparency.org/concession.1.kml . Even on my (ver...
Displaying a large number of polygons on an embedded Google Map can indeed present performance challenges. Here are some strategies you can consider for rendering markers instead of overlays beyond a certain zoom level, as well as suggestions for polygon simplification. ### 1. Strategy for Using Markers Instead of Ove...
25,535
[ { "from": "human", "value": "I have a similar problem to this post. I need to display up to 1000 polygons on an embedded Google map. The polygons are in a SQL database, and I can render each one as a single KML file on the fly using a custom HttpHandler (in ASP.NET), like this http://alpha.foresttransparenc...
I have a script that generates data in csv format which is sent to the user along with a set of headers that tell the browser it is a .csv file. Everything works great when users (left)click on the link to the script, they are presented with a download dialog with the filename ending in .csv and it suggests using excel...
The issue you're encountering with Firefox is related to how it handles the `Content-Disposition` header when the user chooses to "Save As" the file. To ensure that the file is always downloaded with the desired filename, regardless of whether the user left-clicks or right-clicks to save, you can make a slight adjustme...
29,042
[ { "from": "human", "value": "I have a script that generates data in csv format which is sent to the user along with a set of headers that tell the browser it is a .csv file. Everything works great when users (left)click on the link to the script, they are presented with a download dialog with the filename e...
How to validate iscontrolkeys in textbox keydown event in .net?
To validate control keys (such as `Ctrl`, `Shift`, `Alt`, arrow keys, etc.) in a TextBox's KeyDown event in a .NET WinForms application, you can check the `KeyCode` and `Modifiers` properties of the `KeyEventArgs` passed to the event handler. Here's a simple example of how to do this: 1. **Subscribe to the KeyDown Ev...
24,772
[ { "from": "human", "value": "How to validate iscontrolkeys in textbox keydown event in .net?\n" }, { "from": "gpt", "value": "To validate control keys (such as `Ctrl`, `Shift`, `Alt`, arrow keys, etc.) in a TextBox's KeyDown event in a .NET WinForms application, you can check the `KeyCode` and `...
Another question asked about determining odd/evenness in C, and the idiomatic (x & 1) approach was correctly flagged as broken for one's complement-based systems, which the C standard allows for. Do systems really exist in the 'real world' outside of computer museums? I've been coding since the 1970's and I'm pretty su...
One's complement systems, while largely historical, do exist in the realm of computer architecture and are still discussed in theoretical and educational contexts. However, in practical terms, they are exceedingly rare in modern computing environments. ### Historical Context: - One's complement representation was used...
27,907
[ { "from": "human", "value": "Another question asked about determining odd/evenness in C, and the idiomatic (x & 1) approach was correctly flagged as broken for one's complement-based systems, which the C standard allows for.\nDo systems really exist in the 'real world' outside of computer museums? I've been...
I'm trying to use tasklist to find out which process is consuming more than X percent of my CPU (to later kill it with taskkill.) How do I know what percent a time format represents? The documentations says: TASKLIST options /FI filter And one filter may be: CPUTIME eq, ne, gt, lt, ge, le ...
The `CPUTIME` filter in the `tasklist` command measures the total CPU time used by a process, represented in the format `hh:mm:ss`. This is not the same as CPU usage percentage. The `CPUTIME` is a cumulative value, indicating how long a process has been using the CPU in total, while CPU usage percentage indicates how m...
28,650
[ { "from": "human", "value": "I'm trying to use tasklist to find out which process is consuming more than X percent of my CPU (to later kill it with taskkill.) \nHow do I know what percent a time format represents?\nThe documentations says:\nTASKLIST options\n\n/FI filter \n\nAnd one filter ...
Here is a simplified version of my database model. I have two tables: "Image", and "HostingProvider" which look like this: [Image] id filename hostingprovider_id [HostingProvider] id base_url Image HostingproviderId is a many-to-one foreign key relationship to the HostingProvider table. (Each image has one hosting...
In NHibernate, you can achieve the desired mapping by creating a custom property in your `Image` class to represent the `base_url` of the associated `HostingProvider`. You can then use a `join` in your mapping file to include this property when querying the `Image` class. Here's how you can set this up: 1. **Update y...
25,991
[ { "from": "human", "value": "Here is a simplified version of my database model. I have two tables: \"Image\", and \"HostingProvider\" which look like this:\n[Image]\n\nid\nfilename\nhostingprovider_id\n\n[HostingProvider]\n\nid\nbase_url\n\nImage HostingproviderId is a many-to-one foreign key relationship ...
I'm relatively new to Mercurial and my team is trying it out right now as a replacement for Subversion. How can I commit and push a single file out to another repository while leaving other modifications in my working directory uncommitted (or at least not pushed to the other repository)? This happens for us with dat...
In Mercurial, there isn't a direct equivalent to Subversion's ability to commit and push a single file while keeping the rest of your changes uncommitted. However, you can achieve a similar result using a few different approaches. Here’s a straightforward method you can use without needing to clone your repository or d...
25,105
[ { "from": "human", "value": "I'm relatively new to Mercurial and my team is trying it out right now as a replacement for Subversion. \nHow can I commit and push a single file out to another repository while leaving other modifications in my working directory uncommitted (or at least not pushed to the other...
I've got a junk directory where I toss downloads, one-off projects, email drafts, and other various things that might be useful for a few days but don't need to be saved forever. To stop this directory from taking over my machine, I wrote a program that will delete all files older than a specified number of days and l...
In .NET, the standard file deletion methods like `System.IO.File.Delete` and `System.IO.FileInfo.Delete` do not remove read-only files as you've discovered. To delete a read-only file, you will first need to change its attributes so that it is no longer read-only. Once you have removed the read-only attribute, you can ...
28,807
[ { "from": "human", "value": "I've got a junk directory where I toss downloads, one-off projects, email drafts, and other various things that might be useful for a few days but don't need to be saved forever. To stop this directory from taking over my machine, I wrote a program that will delete all files ol...
Does anyone have an example of a pivot using a table with an XML column in it - specifically turning some of the elements in the xml column into a column in the pivot table? I'm trying to build one, but the syntax is killing me; xml in sql is damn hard to work with, compared to xml in C#. I suspect this is impossible, ...
Certainly! You can create a pivot table using data stored in an XML column, but it requires some careful extraction of the XML data using SQL's XML capabilities. Here's a simplified example of how to do this in SQL Server. Let's assume we have a table named `MyTable` with the following structure: ```sql CREATE TABLE ...
24,953
[ { "from": "human", "value": "Does anyone have an example of a pivot using a table with an XML column in it - specifically turning some of the elements in the xml column into a column in the pivot table? I'm trying to build one, but the syntax is killing me; xml in sql is damn hard to work with, compared to ...
I just spent half an one our to find out what caused the Error-Message "Ci is not defined" in my JavaScript code. I finally found the reason: It should be (jQuery): $("asd").bla(); It was: ("asd").bla(); (Dollar sign gone missing) Now after having fixed the problem I'd like to understand the message itself: What does...
The error message you received, specifically "Ci is not defined," can be a bit confusing. This message generally comes from how the JavaScript interpreter handles the code you've written. Here's a breakdown of what's happening: 1. **Your Code**: When you wrote `("asd").bla();`, you're using parentheses to create a st...
29,342
[ { "from": "human", "value": "I just spent half an one our to find out what caused the Error-Message \"Ci is not defined\" in my JavaScript code. I finally found the reason:\nIt should be (jQuery):\n$(\"asd\").bla();\n\nIt was:\n(\"asd\").bla();\n\n(Dollar sign gone missing)\nNow after having fixed the probl...