instruction
stringlengths
14
27.6k
completion
stringlengths
3
38.3k
__original_row_idx
int64
0
50k
conversations
listlengths
2
2
Recently I ran into this error in my web application: java.lang.OutOfMemoryError: PermGen space It's a typical Hibernate/JPA + IceFaces/JSF application running on Tomcat 6 and JDK 1.6. Apparently this can occur after redeploying an application a few times. What causes it and what can be done to avoid it? How do I fix...
The `java.lang.OutOfMemoryError: PermGen space` error occurs when the Permanent Generation (PermGen) memory space in the Java Virtual Machine (JVM) is exhausted. The PermGen space is used to store the metadata related to classes, methods, and static objects. In a typical web application, this space can fill up due to v...
7,095
[ { "from": "human", "value": "Recently I ran into this error in my web application:\n\njava.lang.OutOfMemoryError: PermGen space\n\nIt's a typical Hibernate/JPA + IceFaces/JSF application running on Tomcat 6 and JDK 1.6.\nApparently this can occur after redeploying an application a few times.\nWhat causes it...
Looking to do a very small, quick 'n dirty side project. I like the fact that the Google App Engine is running on Python with Django built right in - gives me an excuse to try that platform... but my question is this: Has anyone made use of the app engine for anything other than a toy problem? I see some good example a...
Google App Engine (GAE) has been used successfully for various applications beyond simple toy projects, ranging from small startups to established businesses. Here are some insights into its usability for real-world applications: ### Success Stories: 1. **Scalability**: Many companies appreciate GAE's ability to scale...
8,300
[ { "from": "human", "value": "Looking to do a very small, quick 'n dirty side project. I like the fact that the Google App Engine is running on Python with Django built right in - gives me an excuse to try that platform... but my question is this:\nHas anyone made use of the app engine for anything other tha...
I would like to call python script files from my c++ program. I am not sure that the people I will distribute to will have python installed.
If you want to call Python scripts from a C++ program but are concerned that your users may not have Python installed, you have a few options to consider: ### 1. **Embed Python Interpreter** You can embed the Python interpreter in your C++ application using the Python/C API. This method requires you to include the Pyt...
7,911
[ { "from": "human", "value": "I would like to call python script files from my c++ program.\nI am not sure that the people I will distribute to will have python installed.\n" }, { "from": "gpt", "value": "If you want to call Python scripts from a C++ program but are concerned that your users may ...
I'd be interested in some before-and-after c# examples, some non-idiomatic vs idiomatic examples. Non-c# examples would be fine as well if they get the idea across. Thanks.
Sure! Let's go through some before-and-after examples in C# to illustrate the difference between non-idiomatic and idiomatic C# code. The focus will be on clarity, conciseness, and leveraging C# features effectively. ### Example 1: Using Loops to Filter Collections **Non-Idiomatic C#:** ```csharp List<int> numbers = ...
3,947
[ { "from": "human", "value": "I'd be interested in some before-and-after c# examples, some non-idiomatic vs idiomatic examples. Non-c# examples would be fine as well if they get the idea across. Thanks.\n" }, { "from": "gpt", "value": "Sure! Let's go through some before-and-after examples in C# t...
What's the best way to make an element of 100% minimum height across a wide range of browsers ? In particular if you have a layout with a header and footer of fixed height, how do you make the middle content part fill 100% of the space in between with the footer fixed to the bottom ?
To create a layout with a header, a footer, and a middle content area that fills the remaining space between them, you can use a combination of CSS Flexbox and some specific properties for a reliable cross-browser solution. Here's a step-by-step guide to achieving this: 1. **HTML Structure**: Create a simple HTML str...
4,026
[ { "from": "human", "value": "\nWhat's the best way to make an element of 100% minimum height across a\n wide range of browsers ?\n\nIn particular if you have a layout with a header and footer of fixed height,\nhow do you make the middle content part fill 100% of the space in between with the footer fixed t...
How do I enable external access to MySQL Server? I can connect locally but I cannot connect from another box on the network. I just tried grant all privileges on *.* to root@'%' identified by '*****' with grant option; And restarted MySQL Server with no success.
To enable external access to your MySQL Server, there are several steps you need to follow. Here's a guide to help you troubleshoot and configure MySQL for external connections: ### 1. **Check MySQL Configuration** Ensure that MySQL is configured to listen on all interfaces (or the specific interface you want to use)...
6,835
[ { "from": "human", "value": "How do I enable external access to MySQL Server? I can connect locally but I cannot connect from another box on the network.\nI just tried\ngrant all privileges on *.* to root@'%' identified by '*****' with grant option;\n\nAnd restarted MySQL Server with no success.\n" }, {...
What do search engine bots use as a starting point? Is it DNS look-up or do they start with some fixed list of well-know sites? Any guesses or suggestions?
Search engine bots, often referred to as web crawlers or spiders, typically have a few different methods for starting their crawling process. Here are the main approaches: 1. **Seed URLs**: Most search engine bots start their crawling activities with a predefined list of seed URLs. These can include well-known sites, ...
6,751
[ { "from": "human", "value": "What do search engine bots use as a starting point? Is it DNS look-up or do they start with some fixed list of well-know sites? Any guesses or suggestions?\n" }, { "from": "gpt", "value": "Search engine bots, often referred to as web crawlers or spiders, typically ha...
I need to manually migrate modified stored procedures from a DEV SQL Server 2005 database instance to a TEST instance. Except for the changes I'm migrating, the databases have the same schemas. How can I quickly identify which stored procedures have been modified in the DEV database for migration to the TEST instance...
To identify modified stored procedures in a SQL Server 2005 database, you can query the system catalog views to get the last modified date of stored procedures. The `sys.objects` and `sys.procedures` catalog views contain the information you need. Specifically, you can look at the `modify_date` column to find out when ...
4,616
[ { "from": "human", "value": "I need to manually migrate modified stored procedures from a DEV SQL Server 2005 database instance to a TEST instance. Except for the changes I'm migrating, the databases have the same schemas. How can I quickly identify which stored procedures have been modified in the DEV da...
I'm using Eclipse 3.4 (Ganymede) with CDT 5 on Windows. When the integrated spell checker doesn't know some word, it proposes (among others) the option to add the word to a user dictionary. If the user dictionary doesn't exist yet, the spell checker offers then to help configuring it and shows the "General/Editors/Text...
To resolve the issue with the spell checker in Eclipse 3.4 (Ganymede) where it states that "The selected spelling engine does not exist," you can follow these steps: 1. **Install Java Development Tools (JDT)**: As you've discovered, installing the Java Development Tools (JDT) can resolve the issue by providing the nec...
6,080
[ { "from": "human", "value": "I'm using Eclipse 3.4 (Ganymede) with CDT 5 on Windows.\nWhen the integrated spell checker doesn't know some word, it proposes (among others) the option to add the word to a user dictionary.\nIf the user dictionary doesn't exist yet, the spell checker offers then to help configu...
What object do you query against to select all the table names in a schema in Oracle?
In Oracle, you can query the `USER_TABLES`, `ALL_TABLES`, or `DBA_TABLES` data dictionary views to select all the table names in a specific schema. 1. **USER_TABLES**: Shows all tables owned by the currently logged-in user (schema). ```sql SELECT table_name FROM user_tables; ``` 2. **ALL_TABLES**: Shows all ...
9,622
[ { "from": "human", "value": "What object do you query against to select all the table names in a schema in Oracle?\n" }, { "from": "gpt", "value": "In Oracle, you can query the `USER_TABLES`, `ALL_TABLES`, or `DBA_TABLES` data dictionary views to select all the table names in a specific schema.\...
I use Virtual PC to create fresh environments for testing my installer. But I must be doing something wrong because a VPC image with Vista or XP inside is taking around 15GB of disk space (that includes VS2005/S2008 installed in them). To create a new copy for testing I copy and paste the folder that has the .vhd, .vm...
Yes, there are more efficient approaches to manage your Virtual PC images without needing to copy the entire virtual machine folder each time. Here are some strategies that can help reduce the time and disk space required for your testing environments: 1. **Use Differencing Disks**: Instead of copying the entire virtu...
7,924
[ { "from": "human", "value": "I use Virtual PC to create fresh environments for testing my installer. But I must be doing something wrong because a VPC image with Vista or XP inside is taking around 15GB of disk space (that includes VS2005/S2008 installed in them). \nTo create a new copy for testing I copy a...
I've been given sudo access on one of our development RedHat linux boxes, and I seem to find myself quite often needing to redirect output to a location I don't normally have write access to. The trouble is, this contrived example doesn't work: sudo ls -hal /root/ > /root/test.out I just receive the response: -bash: /...
The reason you encounter the "Permission denied" error when trying to redirect output to `/root/test.out` using your command is due to the way shell redirection works in Bash. The redirection happens before the command is executed, so the shell attempts to open the output file as your current user (who presumably does ...
9,628
[ { "from": "human", "value": "I've been given sudo access on one of our development RedHat linux boxes, and I seem to find myself quite often needing to redirect output to a location I don't normally have write access to.\nThe trouble is, this contrived example doesn't work:\nsudo ls -hal /root/ > /root/test...
I'm writing a Java application that runs on Linux (using Sun's JDK). It keeps creating /tmp/hsperfdata_username directories, which I would like to prevent. Is there any way to stop java from creating these files?
The `/tmp/hsperfdata_username` directories are created by the Java Virtual Machine (JVM) to store performance data for the JVM. This is typically related to Java's use of the `hotspot` performance monitoring features, which create these files to enable tools like `jconsole`, `jvisualvm`, and others to monitor JVM perfo...
8,874
[ { "from": "human", "value": "I'm writing a Java application that runs on Linux (using Sun's JDK). It keeps creating /tmp/hsperfdata_username directories, which I would like to prevent. Is there any way to stop java from creating these files?\n" }, { "from": "gpt", "value": "The `/tmp/hsperfdata_...
The gnuplot docs have this to say about fonts: Five basic fonts are supported directly by the gd library. These are `tiny` (5x8 pixels), `small` (6x12 pixels), `medium`, (7x13 Bold), `large` (8x16) or `giant` (9x15 pixels). But when i try to use one: gnuplot> set terminal png font tiny I get: Could...
The issue you're encountering when trying to use the built-in fonts (`tiny`, `small`, `medium`, `large`, `giant`) in gnuplot is likely due to the fact that these fonts are not available in the environment you are using. The fonts listed in the gnuplot documentation are often associated with the gd library, but they mig...
8,269
[ { "from": "human", "value": "The gnuplot docs have this to say about fonts:\n Five basic fonts are supported directly by the gd library. These are\n `tiny` (5x8 pixels), `small` (6x12 pixels), `medium`, (7x13 Bold), \n `large` (8x16) or `giant` (9x15 pixels).\nBut when i try to use one:\n gnuplo...
What's the simplest SQL statement that will return the duplicate values for a given column and the count of their occurrences in an Oracle database table? For example: I have a JOBS table with the column JOB_NUMBER. How can I find out if I have any duplicate JOB_NUMBERs, and how many times they're duplicated?
To find duplicate values in a specific column and count their occurrences in an Oracle database table, you can use the `GROUP BY` clause along with the `HAVING` clause. For your example with the `JOBS` table and the `JOB_NUMBER` column, you can use the following SQL statement: ```sql SELECT JOB_NUMBER, COUNT(*) AS C...
7,391
[ { "from": "human", "value": "What's the simplest SQL statement that will return the duplicate values for a given column and the count of their occurrences in an Oracle database table?\nFor example: I have a JOBS table with the column JOB_NUMBER. How can I find out if I have any duplicate JOB_NUMBERs, and h...
What libraries can I use to build a GUI for an Erlang application? Please one option per answer.
One option for building a GUI for an Erlang application is **wxErlang**. This is a binding to the wxWidgets library, which allows you to create native-looking GUI applications across different platforms.
9,872
[ { "from": "human", "value": "What libraries can I use to build a GUI for an Erlang application? Please one option per answer.\n" }, { "from": "gpt", "value": "One option for building a GUI for an Erlang application is **wxErlang**. This is a binding to the wxWidgets library, which allows you to ...
I noticed that you can call Queue.Synchronize to get a thread-safe queue object, but the same method isn't available on Queue<T>. Does anyone know why? Seems kind of weird.
The `Queue` class in .NET provides a method called `Queue.Synchronize` that returns a thread-safe wrapper around a non-generic queue. This was designed for legacy applications where thread safety was a concern. The non-generic `Queue` class is not strongly typed, and developers often need to ensure that access to it fr...
7,321
[ { "from": "human", "value": "I noticed that you can call Queue.Synchronize to get a thread-safe queue object, but the same method isn't available on Queue<T>. Does anyone know why? Seems kind of weird.\n" }, { "from": "gpt", "value": "The `Queue` class in .NET provides a method called `Queue.S...
For some reason when I attempt to make a request to an Ajax.net web service with the ScriptService attribute set, an exception occurs deep inside the protocol class which I have no control over. Anyone seen this before? Here is the exact msg: System.IndexOutOfRangeException: Index was outside the bounds of the array. ...
The `IndexOutOfRangeException` you are encountering within an Ajax-enabled web service using the `ScriptService` attribute may indicate an issue related to how the service is being accessed or how the parameters are being handled. Here are several steps and tips you can follow to troubleshoot and potentially resolve th...
4,691
[ { "from": "human", "value": "For some reason when I attempt to make a request to an Ajax.net web service with the ScriptService attribute set, an exception occurs deep inside the protocol class which I have no control over. Anyone seen this before?\nHere is the exact msg:\nSystem.IndexOutOfRangeException: I...
I was wondering if anyone could point to an Open Source date utility class that is fairly robust. I find myself rolling my own when I want to do a lot of things I take for granted in C# and Java. For instance I did find a decent example of a DateDiff() function that I tore apart and another DatePart() function. Another...
If you're looking for a robust open-source date utility class, there are several libraries available in different programming languages that provide extensive functionality for handling dates and times. Here are a few suggestions across different platforms: ### JavaScript Libraries 1. **date-fns**: - [GitHub Repos...
5,207
[ { "from": "human", "value": "I was wondering if anyone could point to an Open Source date utility class that is fairly robust. I find myself rolling my own when I want to do a lot of things I take for granted in C# and Java. For instance I did find a decent example of a DateDiff() function that I tore apart...
I'm starting work on a program which is perhaps most naturally described as a batch of calculations on database tables, and will be executed once a month. All input is in Oracle database tables, and all output will be to Oracle database tables. The program should stay maintainable for many years to come. It seems strai...
Choosing between PL/SQL and a more general-purpose programming language like C# for your batch processing task involves a few considerations, including performance, maintainability, developer expertise, and the specific nature of your calculations. Here's a breakdown of the key factors to help you decide: ### Advantag...
4,588
[ { "from": "human", "value": "I'm starting work on a program which is perhaps most naturally described as a batch of calculations on database tables, and will be executed once a month. All input is in Oracle database tables, and all output will be to Oracle database tables. The program should stay maintainab...
I am interested in choosing a good structure for an online message board-type application. I will use SO as an example, as I think it's an example that we are all familiar with, but my question is more general; it is about how to achieve the right balance between organization and flexibility in online message boards. ...
Your question touches on a common challenge in the design of online message boards and community platforms: balancing organization with flexibility. Let's delve into the different approaches and their implications for user experience. ### 1. **Tagging Systems: Flexibility with Limitations** - **Advantages**: - **Wid...
6,023
[ { "from": "human", "value": "I am interested in choosing a good structure for an online message board-type application. I will use SO as an example, as I think it's an example that we are all familiar with, but my question is more general; it is about how to achieve the right balance between organization a...
If you have a situation where a TCP connection is potentially too slow and a UDP 'connection' is potentially too unreliable what do you use? There are various standard reliable UDP protocols out there, what experiences do you have with them? Please discuss one protocol per reply and if someone else has already mentione...
One reliable UDP protocol worth discussing is **QUIC (Quick UDP Internet Connections)**. Developed by Google, QUIC is designed to provide a reliable transport layer over UDP and aims to improve performance, particularly in terms of latency and connection establishment times compared to TCP. ### Key Features of QUIC: 1...
8,028
[ { "from": "human", "value": "If you have a situation where a TCP connection is potentially too slow and a UDP 'connection' is potentially too unreliable what do you use? There are various standard reliable UDP protocols out there, what experiences do you have with them?\nPlease discuss one protocol per repl...
We had a need for a document management solution and were hoping SharePoint 2007 would satisfy our needs. We felt our needs were relatively simple. We needed to manage versioning, have searching capabilities, and having an approval workflow. SharePoint handled these three aspects great out of the box. However, we also ...
It sounds like you're dealing with a challenging situation in SharePoint 2007 regarding document management, particularly in relation to footers reflecting accurate versioning information. Here are a few suggestions that might help you work around the limitations you've faced: ### 1. **Event Receivers with Custom Logi...
7,272
[ { "from": "human", "value": "We had a need for a document management solution and were hoping SharePoint 2007 would satisfy our needs. We felt our needs were relatively simple. We needed to manage versioning, have searching capabilities, and having an approval workflow.\nSharePoint handled these three aspec...
I would like a panel in GWT to fill the page without actually having to set the size. Is there a way to do this? Currently I have the following: public class Main implements EntryPoint { public void onModuleLoad() { HorizontalSplitPanel split = new HorizontalSplitPanel(); //split.setSize("250...
In GWT (Google Web Toolkit), you can create a panel that fills the page without explicitly setting the size by using CSS for layout styling. You can achieve this by making sure that the RootPanel takes up the full height and width of the browser window. Here's how you can modify your code to accomplish this: 1. Make s...
5,383
[ { "from": "human", "value": "I would like a panel in GWT to fill the page without actually having to set the size. Is there a way to do this? Currently I have the following:\npublic class Main implements EntryPoint\n{\n public void onModuleLoad()\n {\n HorizontalSplitPanel split = new Horizo...
I have an asp.NET webapplication running in our datacenter in which we want the customer to logon with single sign-on. This would be very easy if we could use the IIS integrated security. However we can't do this. We don't have a trust to the domain controller of the customer. ANd we want to website to be available to...
In scenarios where you need to implement Single Sign-On (SSO) with Windows Authentication without a direct trust relationship between domains, and where your application is accessible from both the internet and within a client's network, there are indeed a few strategies you might consider. Here are some potential opti...
6,268
[ { "from": "human", "value": "I have an asp.NET webapplication running in our datacenter in which we want the customer to logon with single sign-on. This would be very easy if we could use the IIS integrated security. However we can't do this. We don't have a trust to the domain controller of the customer. ...
I have a dataset that I have modified into an xml document and then used a xsl sheet to transform into an Excel xml format in order to allow the data to be opened programatically from my application. I have run into two problems with this: Excel is not the default Windows application to open Excel files, therefore wh...
To ensure that your XML data opens in Excel and avoids the default behavior of launching the XML in Internet Explorer, you have a few options. Here's a clean approach using C# without having to set Excel as the default application for opening XML files. ### 1. Use a Temporary File with the Correct Extension One simpl...
3,981
[ { "from": "human", "value": "I have a dataset that I have modified into an xml document and then used a xsl sheet to transform into an Excel xml format in order to allow the data to be opened programatically from my application. I have run into two problems with this:\n\nExcel is not the default Windows ap...
Is there a .NET Control Similar to the Access 2007 Split Form? Or has anyone built such a control? I upgraded a small personal Name and Address DB to Access 2007 and noticed the Form had a property called “Default View” which can be set to “Split Form”. “Split Form” mode has a GridView and a Form together in one contro...
In .NET, there is no built-in control that directly replicates the functionality of an Access 2007 Split Form, which features a grid view alongside a detail form. However, you can achieve similar functionality by combining existing controls in a WinForms or WPF application. ### WinForms Approach In a WinForms applica...
4,617
[ { "from": "human", "value": "Is there a .NET Control Similar to the Access 2007 Split Form?\nOr has anyone built such a control?\nI upgraded a small personal Name and Address DB to Access 2007 and noticed the Form had a property called “Default View” which can be set to “Split Form”. “Split Form” mode has a...
I find that the .NET event model is such that I'll often be raising an event on one thread and listening for it on another thread. I was wondering what the cleanest way to marshal an event from a background thread onto my UI thread is. Based on the community suggestions, I've used this: // earlier in the code mCoolObj...
You are on the right track with your approach to marshalling events from a background thread to the UI thread in a Windows Forms application. However, there are some improvements you could make to make your code cleaner and easier to maintain. ### Updated Approach You can leverage `BeginInvoke` instead of `Invoke`, w...
5,305
[ { "from": "human", "value": "I find that the .NET event model is such that I'll often be raising an event on one thread and listening for it on another thread. I was wondering what the cleanest way to marshal an event from a background thread onto my UI thread is.\nBased on the community suggestions, I've ...
My scheduled reports in SQL server won't run. I checked the logs and found the job that was failing. The error message in the log was: 'EXECUTE AS LOGIN' failed for the requested login 'NT AUTHORITY\NETWORK SERVICE'. The step failed. I'm using SQL authentication for the report so it shouldn't be issues with the p...
The error message you're seeing indicates that there is a problem with the permissions associated with the `NT AUTHORITY\NETWORK SERVICE` account when executing a job in SQL Server. Here are some steps you can take to troubleshoot and resolve this issue: ### 1. Check SQL Server Agent Service Account - The SQL Server A...
4,358
[ { "from": "human", "value": "My scheduled reports in SQL server won't run. I checked the logs and found the job that was failing. The error message in the log was:\n\n'EXECUTE AS LOGIN' failed for the requested login 'NT AUTHORITY\\NETWORK \n SERVICE'. The step failed. \n\nI'm using SQL authentication for ...
Saw a post about hidden features in C# but not a lot of people have written linq/lambdas example so... I wonder... What's the coolest (as in the most elegant) use of the C# LINQ and/or Lambdas/anonymous delegates you have ever saw/written? Bonus if it has went into production too!
LINQ (Language Integrated Query) and lambda expressions have made working with collections in C# not only more elegant but also expressive. Here are a few examples that showcase the power and elegance of LINQ and lambdas in real-world scenarios. ### 1. Grouping and Summing One of the most elegant uses of LINQ is to g...
2,237
[ { "from": "human", "value": "Saw a post about hidden features in C# but not a lot of people have written linq/lambdas example so... I wonder...\n\nWhat's the coolest (as in the most elegant) use of the C# LINQ and/or Lambdas/anonymous delegates you have ever saw/written?\n\nBonus if it has went into product...
Like it says.
It looks like you might want to discuss something specific. Could you please provide more details or clarify what you're referring to? I'm here to help!
12,021
[ { "from": "human", "value": "Like it says.\n" }, { "from": "gpt", "value": "It looks like you might want to discuss something specific. Could you please provide more details or clarify what you're referring to? I'm here to help!" } ]
It is obviously possible to hide individual data points in an Excel line chart. Select a data point. Right click -> Format Data Point... Select Patterns Tab Set Line to None How do you accomplish the same thing in VBA? Intuition tells me there should be a property on the Point object Chart.SeriesCollection(<index>)...
In VBA, you can hide individual data points in an Excel line chart by setting the line style of that specific data point to "none." While there is no direct property for a data point to hide it, you can achieve this by manipulating the `Format` properties of the point. Here’s a simple VBA code snippet to hide a specif...
7,417
[ { "from": "human", "value": "It is obviously possible to hide individual data points in an Excel line chart.\n\nSelect a data point. \nRight click -> Format Data Point... \nSelect Patterns\nTab Set Line to None\n\nHow do you accomplish the same thing in VBA? Intuition tells me there should be a property on ...
I've been trying to get into F# on and off for a while but I keep getting put off. Why? Because no matter which 'beginners' resource I try to look at I see very simple examples that start using the operator ->. However, nowhere have I found as yet that provides a clear simple explanation of what this operator means. ...
It's great that you're exploring F#! The `->` operator in F# can indeed be a bit confusing if you're new to functional programming and F# syntax. Let’s break it down. ### What is the `->` Operator? In F#, the `->` operator is primarily used to define function types and is also used in pattern matching. Let's clarify ...
6,932
[ { "from": "human", "value": "I've been trying to get into F# on and off for a while but I keep getting put off. Why?\nBecause no matter which 'beginners' resource I try to look at I see very simple examples that start using the operator ->.\nHowever, nowhere have I found as yet that provides a clear simple...
I have Flex Builder 3 installed on two Windows machines and the same project on both of them. On one computer, the CSS styles I defined are shown in design view; on the other computer they are not applied. Is there any reason why it might not work on one?
There could be several reasons why CSS styles are not being applied in the design view of Flex Builder 3 on one of your Windows machines. Here are some troubleshooting steps you can follow to identify and potentially resolve the issue: 1. **Check CSS File Path**: Ensure that the path to your CSS file is correct in bot...
6,770
[ { "from": "human", "value": "I have Flex Builder 3 installed on two Windows machines and the same project on both of them. On one computer, the CSS styles I defined are shown in design view; on the other computer they are not applied. Is there any reason why it might not work on one?\n" }, { "from":...
I need to create a batch file which starts multiple console applications in a Windows .cmd file. This can be done using the start command. However, the command has a path in it. I also need to pass paramaters which have spaces as well. How to do this? E.g. batch file start "c:\path with spaces\app.exe" param1 "param...
To create a batch file (.cmd or .bat) that starts multiple console applications while handling paths and parameters with spaces correctly, you'll need to ensure that both the executable path and the parameters are quoted properly. The `start` command syntax should be followed, especially when dealing with paths contain...
7,249
[ { "from": "human", "value": "I need to create a batch file which starts multiple console applications in a Windows .cmd file. This can be done using the start command.\nHowever, the command has a path in it. I also need to pass paramaters which have spaces as well. How to do this?\nE.g. batch file\nstart...
For a while we were using a tool called CodeVeil. I'm just wondering if there are better alternatives out there. Edit: Before more people misunderstand the question, I'm aware that a determined cracker would probably be able to defeat any of these tools. I'm not too concerned about them though. These tools are just...
When it comes to protecting your code and preventing casual unauthorized access or theft, there are several alternatives to CodeVeil that you might consider. Each of these tools has its own strengths and weaknesses, so it’s essential to choose one that best fits your needs. Here are some alternatives: 1. **Dotfuscator...
7,091
[ { "from": "human", "value": "For a while we were using a tool called CodeVeil. I'm just wondering if there are better alternatives out there.\nEdit: Before more people misunderstand the question, I'm aware that a determined cracker would probably be able to defeat any of these tools. I'm not too concerne...
I'm trying to get an event to fire whenever a choice is made from a JComboBox. The problem I'm having is that there is no obvious addSelectionListener() method. I've tried to use actionPerformed(), but it never fires. Short of overriding the model for the JComboBox, I'm out of ideas. How do I get notified of a selectio...
To get notified of a selection change in a `JComboBox`, you can indeed use the `ActionListener`. The `JComboBox` fires an action event whenever the selected item changes. Here's how you can do that: 1. Add an `ActionListener` to your `JComboBox`. 2. Implement the `actionPerformed` method to handle the selection change...
6,719
[ { "from": "human", "value": "I'm trying to get an event to fire whenever a choice is made from a JComboBox.\nThe problem I'm having is that there is no obvious addSelectionListener() method.\nI've tried to use actionPerformed(), but it never fires.\nShort of overriding the model for the JComboBox, I'm out o...
In the process of developing my first WCF service and when I try to use it I get "Method not Allowed" with no other explanation. I've got my interface set up with the ServiceContract and OperationContract: [OperationContract] void FileUpload(UploadedFile file); Along with the actual method: public void Fi...
The "Method Not Allowed" error you are encountering typically arises because the HTTP method being used to call the service does not match what the service is expecting. In the case of WCF services, especially when dealing with operations that may involve sending data, the proper HTTP methods must be used. When workin...
5,869
[ { "from": "human", "value": "In the process of developing my first WCF service and when I try to use it I get \"Method not Allowed\" with no other explanation. \nI've got my interface set up with the ServiceContract and OperationContract:\n [OperationContract]\n void FileUpload(UploadedFile file);\n\n...
I writing a web site that uses Active Directory to validate users. I don't have access to an Active Directory instance that I can edit in any way. I've heard that some people are using Active Directory Application Mode (ADAM) to create AD data to be used in Unit and Integration Testing. Has anyone else done this? Are t...
Using Active Directory Application Mode (ADAM), now known as Active Directory Lightweight Directory Services (AD LDS), can indeed be a viable option for unit and integration testing when you don't have access to a full Active Directory instance. Here's an overview of the approach, along with resources, benefits, and po...
4,460
[ { "from": "human", "value": "I writing a web site that uses Active Directory to validate users. I don't have access to an Active Directory instance that I can edit in any way.\nI've heard that some people are using Active Directory Application Mode (ADAM) to create AD data to be used in Unit and Integration...
My colleague has found himself in an "interesting" situation. He is working on a Silverlight (2.0) prototype that needs to call existing web services in the enterprise and bind the returned data to data-display controls. The thing is, the web services return .NET DataSets (they are not about to change existing implemen...
You're correct that Silverlight does not natively support .NET DataSets, which can create challenges when trying to interact with existing web services that return them. Here are some potential workarounds and solutions: ### 1. **Create a Middleware Service**: As you suggested, creating a middleware web service that ...
8,051
[ { "from": "human", "value": "My colleague has found himself in an \"interesting\" situation. He is working on a Silverlight (2.0) prototype that needs to call existing web services in the enterprise and bind the returned data to data-display controls. The thing is, the web services return .NET DataSets (the...
Why does the following code not work as I was expecting? <?php $data = array( array('Area1', null, null), array(null, 'Section1', null), array(null, null, 'Location1'), array('Area2', null, null), array(null, 'Section2', null), array(null, null, 'Location2') ); $root = array(); foreach ($data as...
The issue in your code arises due to the way you're referencing the `$area` and `$section` variables. When you're using the reference operator `&`, it doesn't actually create a separate instance of `$area` and `$section` for each iteration of the loop. Instead, it keeps referencing the same variable, which leads to the...
5,913
[ { "from": "human", "value": "Why does the following code not work as I was expecting?\n<?php\n$data = array(\n array('Area1', null, null),\n array(null, 'Section1', null),\n array(null, null, 'Location1'),\n array('Area2', null, null),\n array(null, 'Section2', null),\n array(null, null, '...
Here's a very simple Prototype example. All it does is, on window load, an ajax call which sticks some html into a div. <html> <head> <script type="text/javascript" src="scriptaculous/lib/prototype.js"></script> <script type="text/javascript"> Event.observe(window, 'load', function(){ ...
Your understanding of asynchronous programming, especially in the context of AJAX calls, is indeed a common source of confusion. Let's break it down for clarity. ### Key Concepts 1. **Asynchronous Nature of AJAX**: - When you make an AJAX call using `new Ajax.Request`, the request is sent to the server, and while ...
6,143
[ { "from": "human", "value": "Here's a very simple Prototype example.\nAll it does is, on window load, an ajax call which sticks some html into a div.\n<html>\n <head>\n <script type=\"text/javascript\" src=\"scriptaculous/lib/prototype.js\"></script>\n <script type=\"text/javascript\">\n ...
I have a list with 2 text fields, and a choice field. How do I use the Lists.asmx web service to insert a new item? I can make a web reference to the lists.asmx service, so you can assume that this is known. I would like a complete example including code and the XML for the CAML query. Ideally the sample would use C#.
To insert a new item into a SharePoint list using the Lists.asmx web service in C#, you can follow the steps below. In this example, we will demonstrate how to use the `UpdateListItems` method to insert a new item. Here’s a complete example: ### Step 1: Create the Web Reference In your Visual Studio project, add a we...
4,832
[ { "from": "human", "value": "I have a list with 2 text fields, and a choice field. How do I use the Lists.asmx web service to insert a new item? I can make a web reference to the lists.asmx service, so you can assume that this is known.\nI would like a complete example including code and the XML for the CAM...
I run an ASP.NET website solution with a few other projects in it. I've known that MSBuild projects are capable of this, but is it the best way? Are they easy to create? Is nAnt, CruiseControl.NET or any other solution better? When I build the site (using Web Deployment Projects), can I automate part of the build so th...
When it comes to automating builds for an ASP.NET website solution, there are several options, including MSBuild, NAnt, and Continuous Integration tools like CruiseControl.NET. Here’s a breakdown of the options you mentioned, along with guidance on how to address your specific requirements regarding excluding folders f...
4,939
[ { "from": "human", "value": "I run an ASP.NET website solution with a few other projects in it. I've known that MSBuild projects are capable of this, but is it the best way? Are they easy to create? Is nAnt, CruiseControl.NET or any other solution better?\nWhen I build the site (using Web Deployment Project...
A few months back my team switched our source control over to Apache Subversion from Visual SourceSafe, and we haven't been happier. Recently I've been looking at Team Foundation Server, and at least on the surface, it seems very impressive. There is some great integration with Visual Studio, and lots of great tools...
When comparing Apache Subversion (SVN) and Team Foundation Server (TFS), it's essential to consider the specific needs of your team and the features each system offers. Below are some key points to help you evaluate both systems based on practical experiences: ### 1. **Version Control Functionality:** - **Apache Su...
4,970
[ { "from": "human", "value": "A few months back my team switched our source control over to Apache Subversion from Visual SourceSafe, and we haven't been happier. \nRecently I've been looking at Team Foundation Server, and at least on the surface, it seems very impressive. There is some great integration w...
How can you cascade filter the attributes of more dimensions in a SSAS cube, viewed in Excel 2007. For example, if we have a cube Sales with the dimension Time and dimension Client, once the dimension Time is filtered to show only the sales from a particular date, if "Client.ClientName" is chosen as a filter in the fil...
To achieve a cascading filter effect in Excel 2007 when working with an SSAS (SQL Server Analysis Services) cube, you can follow these general steps to ensure that the clients displayed in the filter area are limited to those who made sales on the selected date: 1. **Connect to the SSAS Cube:** - Open Excel 2007. ...
6,389
[ { "from": "human", "value": "How can you cascade filter the attributes of more dimensions in a SSAS cube, viewed in Excel 2007.\nFor example, if we have a cube Sales with the dimension Time and dimension Client, once the dimension Time is filtered to show only the sales from a particular date, if \"Client.C...
I save stuff in an Isolated Storage file (using class IsolatedStorageFile). It works well, and I can retrieve the saved values when calling the saving and retrieving methods in my DAL layer from my GUI layer. However, when I try to retrieve the same settings from another assembly in the same project, it gives me a File...
The issue you're facing stems from the way isolated storage works in .NET. The isolated storage is scoped to the application domain, assembly, and user context, which means that files created in isolated storage using one assembly will not be accessible from another assembly unless the same scope is used. When you cal...
7,078
[ { "from": "human", "value": "I save stuff in an Isolated Storage file (using class IsolatedStorageFile). It works well, and I can retrieve the saved values when calling the saving and retrieving methods in my DAL layer from my GUI layer. However, when I try to retrieve the same settings from another assembl...
I've got an interesting design question. I'm designing the security side of our project, to allow us to have different versions of the program for different costs and also to allow Manager-type users to grant or deny access to parts of the program to other users. Its going to web-based and hosted on our servers. I'm ...
When designing an access control system that involves a large number of resources and user groups, both options you've presented have their pros and cons. Let's break them down in terms of performance, complexity, and maintainability. ### Option A: Presence Indicates Access - **How It Works**: An entry in the access t...
3,220
[ { "from": "human", "value": "I've got an interesting design question. I'm designing the security side of our project, to allow us to have different versions of the program for different costs and also to allow Manager-type users to grant or deny access to parts of the program to other users. Its going to ...
Is it possible to create a REST web service using ASP.NET 2.0? The articles and blog entries I am finding all seem to indicate that ASP.NET 3.5 with WCF is required to create REST web services with ASP.NET. If it is possible to create REST web services in ASP.NET 2.0 can you provide an example. Thanks!
Yes, it is possible to create a RESTful web service using ASP.NET 2.0, although it may not have the built-in capabilities and enhancements found in later versions like ASP.NET 3.5 with WCF. In ASP.NET 2.0, you can create a basic REST service by leveraging HTTP verbs (GET, POST, PUT, DELETE) through the ASP.NET `HttpHa...
4,115
[ { "from": "human", "value": "Is it possible to create a REST web service using ASP.NET 2.0? The articles and blog entries I am finding all seem to indicate that ASP.NET 3.5 with WCF is required to create REST web services with ASP.NET.\nIf it is possible to create REST web services in ASP.NET 2.0 can you p...
I have users who are using "secure-wave" security. Evidently it is some sort of white-listing application monitor. With my click-once application, the name of the folders that are used are runtime generated, so the administrators are not able to properly whitelist the application and its files. Any suggestions?
When dealing with application whitelisting solutions like "SecureWave," which restrict the execution of unauthorized applications, it's important to devise strategies to ensure that your ClickOnce application runs smoothly. Given that your application generates runtime folders with dynamic names, here are several sugge...
7,827
[ { "from": "human", "value": "I have users who are using \"secure-wave\" security. Evidently it is some sort of white-listing application monitor. \nWith my click-once application, the name of the folders that are used are runtime generated, so the administrators are not able to properly whitelist the appl...
Grails makes it very easy to configure datasources for different environments (development, test, production) in its DataSources.groovy file, but there seems to be no facility for configuring multiple datasources in one environment. What to I do if I need to access several databases from the same Grails application?
In Grails, while the `DataSource.groovy` file is commonly used to configure a single data source for each environment, you can indeed configure multiple data sources within the same environment. You can achieve this by adding additional data source configurations in the same `DataSource.groovy` file. Here’s how to con...
5,313
[ { "from": "human", "value": "Grails makes it very easy to configure datasources for different environments (development, test, production) in its DataSources.groovy file, but there seems to be no facility for configuring multiple datasources in one environment. What to I do if I need to access several datab...
I have 1 process that receives incoming connection from port 1000 in 1 linux server. However, 1 process is not fast enough to handle all the incoming request. I want to run multiple processes in the server but with 1 end-point. In this way, the client will only see 1 end-point/process not multiple. I have checked LVS a...
To achieve load balancing with multiple processes handling incoming connections on a single server while presenting a single endpoint to clients, you can consider the following approaches: ### 1. **Using Nginx with a Reverse Proxy Setup** Nginx can act as a reverse proxy that forwards incoming requests to multiple wor...
1,634
[ { "from": "human", "value": "I have 1 process that receives incoming connection from port 1000 in 1 linux server. However, 1 process is not fast enough to handle all the incoming request.\nI want to run multiple processes in the server but with 1 end-point. In this way, the client will only see 1 end-point/...
I have a NAT configured to run when loading up my favorite Linux distribution in VitualBox. This allows outgoing connections to work successfully. How do I allow incoming connections to this box, like, say, Web traffic? The IP address is 10.0.2.15. A ping request from my main box results in a Timeout.
When using NAT in VirtualBox, the VM is able to make outgoing connections, but it is generally not set up to accept incoming connections from the host or other networks. To allow incoming connections to your VM, you have a couple of options: ### Option 1: Use Port Forwarding with NAT 1. **Open VirtualBox Manager.** 2...
4,807
[ { "from": "human", "value": "I have a NAT configured to run when loading up my favorite Linux distribution in VitualBox. This allows outgoing connections to work successfully.\nHow do I allow incoming connections to this box, like, say, Web traffic? The IP address is 10.0.2.15. A ping request from my main b...
I read that the unit of granularity for static fields in .Net are per AppDomain, not per process. Is it possible to create a process-wide singleton object?
In .NET, static fields are indeed scoped per AppDomain. However, if you want to create a singleton object that is shared across multiple AppDomains or processes, you typically have to use other methods. ### Options for Creating a Process-Wide Singleton 1. **Using a Mutex**: You can use a named mutex to synchronize ac...
8,353
[ { "from": "human", "value": "I read that the unit of granularity for static fields in .Net are per AppDomain, not per process. Is it possible to create a process-wide singleton object?\n" }, { "from": "gpt", "value": "In .NET, static fields are indeed scoped per AppDomain. However, if you want ...
Are there any prebuilt modules for this? Is there an event thats called everytime a page is loaded? I'm just trying to secure one of my more important admin sections.
It sounds like you're looking to implement some security measures in a web application, particularly for an admin section. The specifics can vary depending on the framework or technology stack you’re using (e.g., WordPress, Django, Laravel, etc.), but here are some general guidelines and concepts that might be helpful:...
7,318
[ { "from": "human", "value": "Are there any prebuilt modules for this? Is there an event thats called everytime a page is loaded? I'm just trying to secure one of my more important admin sections.\n" }, { "from": "gpt", "value": "It sounds like you're looking to implement some security measures i...
This is probably a silly question, but curiosity has gotten the better of me. I've been seeing code lately that seems to "reverse" the order of expressions for relational operators e.g.: if (0 == someVariable) As opposed to what I normally see/write: if (someVariable == 0) To me, the second method seems more readable...
That's not a silly question at all! The style of writing relational expressions in code can indeed vary between developers, and both approaches are valid. However, there are a few points worth discussing about the differences between the two styles, specifically the "reverse" order you mentioned (`0 == someVariable`) v...
7,609
[ { "from": "human", "value": "This is probably a silly question, but curiosity has gotten the better of me. I've been seeing code lately that seems to \"reverse\" the order of expressions for relational operators e.g.:\nif (0 == someVariable)\n\nAs opposed to what I normally see/write:\nif (someVariable == 0...
Is there a good way to find out which exceptions a procedure/function can raise in Delphi (including it's called procedures/functions)? In Java you always have to declare which exceptions that can be thrown, but this is not the case in Delphi, which could lead to unhandled exceptions. Are there any code analysis tool...
In Delphi, unlike Java, there is no built-in mechanism to declare exceptions that a function or procedure can raise. This can lead to situations where exceptions are unhandled, resulting in application crashes. However, there are several approaches you can take to analyze and manage exceptions in Delphi code: ### 1. *...
6,904
[ { "from": "human", "value": "Is there a good way to find out which exceptions a procedure/function can raise in Delphi (including it's called procedures/functions)? \nIn Java you always have to declare which exceptions that can be thrown, but this is not the case in Delphi, which could lead to unhandled exc...
We're using the Eclipse CDT 5 C++ IDE on Windows to develop a C++ application on a remote AIX host. Eclipse CDT has the ability to perform remote debugging using gdbserver. Unfortunately, gdbserver is not supported on AIX. Is anyone familiar with a way to debug remotely using Eclipse CDT without gdbserver? Perhaps us...
While gdbserver is indeed not supported on AIX, you can still set up a remote debugging environment using Eclipse CDT and gdb over an SSH connection. Here’s how you can achieve that: ### Prerequisites: 1. **Eclipse CDT** installed on your local Windows machine. 2. **gdb** installed on your AIX remote host. 3. **SSH ac...
6,044
[ { "from": "human", "value": "We're using the Eclipse CDT 5 C++ IDE on Windows to develop a C++ application on a remote AIX host. \nEclipse CDT has the ability to perform remote debugging using gdbserver. Unfortunately, gdbserver is not supported on AIX. \nIs anyone familiar with a way to debug remotely usin...
As the title says on a website is it possible to tell if a user has viewed a portion of the page?
Yes, it is possible to determine if a user has viewed a portion of a webpage using various methods, primarily through JavaScript and web analytics tools. Here are some common approaches: 1. **Intersection Observer API**: This is a modern and efficient way to detect when an element enters or exits the viewport (the vis...
8,880
[ { "from": "human", "value": "As the title says on a website is it possible to tell if a user has viewed a portion of the page?\n" }, { "from": "gpt", "value": "Yes, it is possible to determine if a user has viewed a portion of a webpage using various methods, primarily through JavaScript and web...
I have a noobish question for any graphics programmer. I am confused how some games (like Crysis) can support both DirectX 9 (in XP) and 10 (in Vista)? What I understand so far is that if you write a DX10 app, then it can only runs in Vista. Maybe they have 2 code bases -- one written in DX9 and another in DX10? But is...
Your question is a great one and gets into some important concepts in game development and graphics programming! The support for multiple graphics APIs like DirectX 9 and DirectX 10 in a game like Crysis is indeed a common scenario, especially around the time when DirectX 10 was introduced and Windows Vista was becomin...
5,706
[ { "from": "human", "value": "I have a noobish question for any graphics programmer.\nI am confused how some games (like Crysis) can support both DirectX 9 (in XP) and 10 (in Vista)?\nWhat I understand so far is that if you write a DX10 app, then it can only runs in Vista.\nMaybe they have 2 code bases -- on...
How can I show a web page in a transparent window and have the white part of the web page also transparent.
Creating a transparent window that displays a web page with transparent areas, including the white parts, can be quite complex and has some limitations depending on the technologies used. Below are general approaches you might consider depending on your use case: ### 1. Using Electron If you're building a desktop appl...
5,441
[ { "from": "human", "value": "How can I show a web page in a transparent window and have the white part of the web page also transparent.\n" }, { "from": "gpt", "value": "Creating a transparent window that displays a web page with transparent areas, including the white parts, can be quite complex...
I've worked with T-SQL for years but I've just moved to an organisation that is going to require writing some Oracle stuff, probably just simple CRUD operations at least until I find my feet. I'm not going to be migrating databases from one to the other simply interacting with existing Oracle databases from an Applicat...
While there isn't a perfect one-to-one translation tool for converting T-SQL to Oracle SQL due to differences in syntax and behavior between the two SQL dialects, there are some utilities and approaches you can use to assist you in the transition: 1. **SQL Translation Tools**: - **SQLines**: This tool provides SQL ...
7,702
[ { "from": "human", "value": "I've worked with T-SQL for years but I've just moved to an organisation that is going to require writing some Oracle stuff, probably just simple CRUD operations at least until I find my feet. I'm not going to be migrating databases from one to the other simply interacting with e...
In Oracle, what is the difference between : CREATE TABLE CLIENT ( NAME VARCHAR2(11 BYTE), ID_CLIENT NUMBER ) and CREATE TABLE CLIENT ( NAME VARCHAR2(11 CHAR), -- or even VARCHAR2(11) ID_CLIENT NUMBER )
In Oracle, the difference between using `BYTE` and `CHAR` in the context of defining a `VARCHAR2` column affects how the maximum length of the string is interpreted, particularly in relation to multi-byte character sets. ### Differences: 1. **`VARCHAR2(n BYTE)`**: - This definition specifies that the maximum lengt...
6,681
[ { "from": "human", "value": "In Oracle, what is the difference between :\nCREATE TABLE CLIENT\n(\n NAME VARCHAR2(11 BYTE),\n ID_CLIENT NUMBER\n)\n\nand\nCREATE TABLE CLIENT\n(\n NAME VARCHAR2(11 CHAR), -- or even VARCHAR2(11)\n ID_CLIENT NUMBER\n)\n\n" }, { "from": "gpt", "value": "In Oracle, th...
For debugging and testing I'm searching for a JavaScript shell with auto completion and if possible object introspection (like ipython). The online JavaScript Shell is really nice, but I'm looking for something local, without the need for an browser. So far I have tested the standalone JavaScript interpreter rhino, spi...
If you're looking for a local JavaScript shell with features like auto-completion and object introspection, you have a few options to consider: 1. **Node.js with REPL**: The Node.js environment includes a Read-Eval-Print Loop (REPL) that provides basic auto-completion and command history. While it may not be as advanc...
6,137
[ { "from": "human", "value": "For debugging and testing I'm searching for a JavaScript shell with auto completion and if possible object introspection (like ipython). The online JavaScript Shell is really nice, but I'm looking for something local, without the need for an browser.\nSo far I have tested the st...
I sometimes need to modify OSS code or other peoples' code (usually C-based, but sometimes C++/Java) and find myself "grep"ing headers for types, function declarations etc. as I follow code flow and try to understand the system. Is there a good tool that exists to aid in code browsing. I'd love to be able to click on...
Absolutely, there are several tools and IDEs that can greatly enhance your code browsing experience on Linux. Here are some popular options: 1. **Visual Studio Code**: Although you mentioned "just use Visual Studio," VS Code is a lightweight but powerful editor available on Linux that supports various programming lang...
7,997
[ { "from": "human", "value": "I sometimes need to modify OSS code or other peoples' code (usually C-based, but sometimes C++/Java) and find myself \"grep\"ing headers for types, function declarations etc. as I follow code flow and try to understand the system. Is there a good tool that exists to aid in code...
Will the code below work if the clock on the server is ahead of the clock on the client? Response.Cache.SetExpires(DateTime.Now.AddSeconds(-1)) EDIT: the reason I ask is on one of our web apps some users are claiming they are seeing the pages ( account numbers, etc ) from a user that previously used that machine. Yet...
The line of code you provided: ```csharp Response.Cache.SetExpires(DateTime.Now.AddSeconds(-1)); ``` is intended to set the expiration time of the response to one second in the past, effectively instructing the client (browser) that the response is already expired and should not be cached. However, whether this works...
7,306
[ { "from": "human", "value": "Will the code below work if the clock on the server is ahead of the clock on the client?\nResponse.Cache.SetExpires(DateTime.Now.AddSeconds(-1))\n\nEDIT: the reason I ask is on one of our web apps some users are claiming they are seeing the pages ( account numbers, etc ) from a ...
What is the maximum size for a MySQL table? Is it 2 million at 50GB? 5 million at 80GB? At the higher end of the size scale, do I need to think about compressing the data? Or perhaps splitting the table if it grew too big?
The maximum size of a MySQL table can vary depending on several factors, including the storage engine being used, the file system, and the MySQL version. Here’s a general overview: ### Maximum Table Size 1. **InnoDB Storage Engine**: - The maximum table size for an InnoDB table is 64TB (terabytes) on a file-per-t...
6,920
[ { "from": "human", "value": "What is the maximum size for a MySQL table? Is it 2 million at 50GB? 5 million at 80GB?\nAt the higher end of the size scale, do I need to think about compressing the data? Or perhaps splitting the table if it grew too big?\n" }, { "from": "gpt", "value": "The maximu...
Are there any tools that can tell me what percentage of a XSL document get actually executed during tests? UPDATE I could not find anything better than Oxygen's XSL debugger and profiler, so I'm accepting Mladen's answer.
Yes, there are various tools and approaches you can use to measure the execution coverage of an XSLT document during tests. Here are a few options: 1. **Oxygen XML Editor**: As you mentioned, Oxygen provides a robust XSLT debugger and profiler that can help you track the execution of your XSLT stylesheets and see whic...
8,285
[ { "from": "human", "value": "Are there any tools that can tell me what percentage of a XSL document get actually executed during tests?\nUPDATE\nI could not find anything better than Oxygen's XSL debugger and profiler, so I'm accepting Mladen's answer.\n" }, { "from": "gpt", "value": "Yes, there...
Is it possible to turn off the query re-formatting that happens when you edit a query for a database in Visual Studio? (i.e. r-click a data source and select New Query) This is happening when we are writing sql queries against a sql compact 3.5 database. Its rather irritating when your carefully indented and formatted ...
In Visual Studio, when you edit SQL queries, it can automatically reformat the code, which can be frustrating, especially if you have a specific formatting style that you prefer. Unfortunately, there isn't a built-in option specifically to disable automatic formatting for SQL queries. However, you can try the following...
9,480
[ { "from": "human", "value": "Is it possible to turn off the query re-formatting that happens when you edit a query for a database in Visual Studio? (i.e. r-click a data source and select New Query)\nThis is happening when we are writing sql queries against a sql compact 3.5 database.\nIts rather irritating ...
Has anyone else found VIM's syntax highlighting of Javascript sub-optimal? I'm finding that sometimes I need to scroll around in order to get the syntax highlighting adjusted, as sometimes it mysteriously drops all highlighting. Are there any work-arounds or ways to fix this? I'm using vim 7.1.
Vim 7.1 is quite an old version, and some of the issues you're experiencing with JavaScript syntax highlighting could be due to bugs or limitations in that version. However, there are several things you can try to improve the situation: ### 1. Upgrade Vim: Consider upgrading to a newer version of Vim if possible. Many...
6,617
[ { "from": "human", "value": "Has anyone else found VIM's syntax highlighting of Javascript sub-optimal? I'm finding that sometimes I need to scroll around in order to get the syntax highlighting adjusted, as sometimes it mysteriously drops all highlighting.\nAre there any work-arounds or ways to fix this? I...
Anyone know if it is possible? And got any sample code for this? Or any other java API that can do this?
It seems like you are looking for assistance with a specific task in Java, but your question is a bit vague regarding what exactly you want to accomplish. Could you provide more details about what you are trying to do? This will help me provide you with the most relevant information or sample code. For example, are yo...
10,850
[ { "from": "human", "value": "Anyone know if it is possible?\nAnd got any sample code for this?\nOr any other java API that can do this?\n" }, { "from": "gpt", "value": "It seems like you are looking for assistance with a specific task in Java, but your question is a bit vague regarding what exac...
What is your favorite Visual Studio keyboard shortcut? I'm always up for leaving my hands on the keyboard and away from the mouse! One per answer please.
One of my favorite Visual Studio keyboard shortcuts is **Ctrl + K, Ctrl + D**. This shortcut formats the entire document, making your code cleaner and more readable without having to navigate through the menu. It’s a great way to maintain code style and organization with just a few keystrokes!
11,462
[ { "from": "human", "value": "What is your favorite Visual Studio keyboard shortcut? I'm always up for leaving my hands on the keyboard and away from the mouse! \nOne per answer please.\n" }, { "from": "gpt", "value": "One of my favorite Visual Studio keyboard shortcuts is **Ctrl + K, Ctrl + D*...
Is there a unicode debug visualizer in Visual Studio 2008? I have a xml file that I'm pretty sure is in unicode. When I open it in wordpad, it shows the japanese characters correctly. When I read the file into a string using File.ReadAllText (UTF8), all the japanese characters show up as blocks in the string visualizer...
Visual Studio 2008 does not have a dedicated Unicode debug visualizer, but there are a few steps you can take to ensure that you're reading and displaying your Unicode XML file correctly. 1. **Verify Encoding**: Ensure that you know the encoding of your XML file. If it's in a different encoding than UTF-8 (like UTF-16...
8,063
[ { "from": "human", "value": "Is there a unicode debug visualizer in Visual Studio 2008? I have a xml file that I'm pretty sure is in unicode. When I open it in wordpad, it shows the japanese characters correctly. When I read the file into a string using File.ReadAllText (UTF8), all the japanese characters s...
There doesn't appear to be any Perl libraries that can open, manipulate, and re-save PDF documents that use the newer PDF version (1.5 and above I believe) that use a cross-reference stream rather than table. Does anyone know of any unix/linux-based utilities to convert a PDF to an older version? Or perhaps there's a...
If you're looking to manipulate PDF documents and specifically deal with versions 1.5 and above, you have a few options: ### 1. **Using `pdftk`** `pdftk` (PDF Toolkit) is a versatile command-line utility that can be used for various PDF manipulations. While it doesn't specifically convert PDF versions, it can flatten...
8,393
[ { "from": "human", "value": "There doesn't appear to be any Perl libraries that can open, manipulate, and re-save PDF documents that use the newer PDF version (1.5 and above I believe) that use a cross-reference stream rather than table. Does anyone know of any unix/linux-based utilities to convert a PDF t...
I am looking for a simple unpatented one-way encryption algorithm, preferably in c. I would like to use it to validate passwords.
When it comes to password storage and validation, it's crucial to use secure hashing algorithms rather than simple encryption. A hashing algorithm is a one-way function that converts input data into a fixed-size string of characters, which is typically a digest that represents the data. For password hashing, it is rec...
7,623
[ { "from": "human", "value": "I am looking for a simple unpatented one-way encryption algorithm, preferably in c.\nI would like to use it to validate passwords.\n" }, { "from": "gpt", "value": "When it comes to password storage and validation, it's crucial to use secure hashing algorithms rather ...
I've been playing around with OpenGL ES development on Android. OpenGL ES applications seem to run slowly in the Emulator on my development machine. Does this reflect likely performance of actual hardware? I'm concerned about spending too much time developing an application if the graphics performance is going to be sl...
The performance of OpenGL ES applications in the Android Emulator can be significantly slower than on actual hardware. This is due to several factors: 1. **Emulator Overhead**: The emulator runs a complete Android environment on top of your host operating system. This introduces additional overhead, which can slow dow...
8,033
[ { "from": "human", "value": "I've been playing around with OpenGL ES development on Android. OpenGL ES applications seem to run slowly in the Emulator on my development machine. Does this reflect likely performance of actual hardware? I'm concerned about spending too much time developing an application if t...
In Kathleen Dollard's 2008 blog post, she presents an interesting reason to use nested classes in .net. However, she also mentions that FxCop doesn't like nested classes. I'm assuming that the people writing FxCop rules aren't stupid, so there must be reasoning behind that position, but I haven't been able to find it.
Kathleen Dollard's mention of nested classes in .NET highlights their benefits, particularly in encapsulation and organization of code. Nested classes can help logically group classes that are only used in one place, improving code readability and maintenance. However, the critique from tools like FxCop regarding neste...
7,512
[ { "from": "human", "value": "In Kathleen Dollard's 2008 blog post, she presents an interesting reason to use nested classes in .net. However, she also mentions that FxCop doesn't like nested classes. I'm assuming that the people writing FxCop rules aren't stupid, so there must be reasoning behind that posit...
I would like to extract a reduced collection of "meaningful" tags (10 max) out of an english text of any size. http://tagcrowd.com/ is quite interesting but the algorithm seems very basic (just word counting) Is there any other existing algorithm to do this?
Yes, there are several algorithms and techniques that can be used to extract meaningful tags or keywords from a text. Here are a few more sophisticated methods compared to simple word counting: 1. **TF-IDF (Term Frequency-Inverse Document Frequency)**: This is a statistical measure that evaluates how important a word ...
6,271
[ { "from": "human", "value": "I would like to extract a reduced collection of \"meaningful\" tags (10 max) out of an english text of any size. \nhttp://tagcrowd.com/ is quite interesting but the algorithm seems very basic (just word counting)\nIs there any other existing algorithm to do this?\n" }, { ...
I am creating the validation dynamically and have hit a 256 character limit. My validation looks something like this: Level 1, Level 2, Level 3, Level 4..... Is there any way to get around the character limit other then pointing at a range? The validation is already being produced in VBA. Increasing the limit is the e...
In Excel, data validation formulas have a character limit of 256 characters. If you're dynamically generating a validation list and hitting this limit, there are several strategies you can use to work around this restriction: 1. **Use Named Ranges**: Instead of directly writing the list into the validation, you can cr...
6,310
[ { "from": "human", "value": "I am creating the validation dynamically and have hit a 256 character limit. My validation looks something like this:\nLevel 1, Level 2, Level 3, Level 4.....\n\nIs there any way to get around the character limit other then pointing at a range?\nThe validation is already being p...
Google / Youtube has an API for Youtube for javascript and Actionscript 2. Unfortunately this API is not compatible with Actionscript 3 without a wrapper - which google does not themselves provide. Has anybody got an actionscript 3 wrapper they can make available?
As of my last update in October 2023, Google had not provided an official ActionScript 3 wrapper for their YouTube API. However, you can create your own wrapper or find community-contributed libraries that may meet your needs. Here are some steps you can take to create a simple ActionScript 3 wrapper for the YouTube A...
7,006
[ { "from": "human", "value": "Google / Youtube has an API for Youtube for javascript and Actionscript 2.\nUnfortunately this API is not compatible with Actionscript 3 without a wrapper - which google does not themselves provide.\nHas anybody got an actionscript 3 wrapper they can make available?\n" }, { ...
we all writing code for single processor. i wonder when we all are able to write code on multi processors? what do we need (software tools, logic, algorithms) for this switching? edit: in my view, as we do many task parallely, same way we need to convert those real life solutions(algorithms) to computer lang. just as O...
The transition from single-processor coding to multi-processor (or multi-core) programming involves several considerations in terms of software tools, logic, algorithms, and development paradigms. Here are the main aspects to consider: ### 1. Understanding Parallelism - **Types of Parallelism**: Learn about different...
6,297
[ { "from": "human", "value": "we all writing code for single processor.\ni wonder when we all are able to write code on multi processors?\nwhat do we need (software tools, logic, algorithms) for this switching?\nedit: in my view, as we do many task parallely, same way we need to convert those real life solut...
Before I do this I figured I would ask if it was the best way. Each "Vendor" object has a "Bucket" object. In my repeater I need to display some properties from Vendor and some from Bucket, also some images populated by FileSystem that are linked to the vendor. I figured the best way to do this is bind the repeater wit...
Your approach of using the `ItemDataBound` event to populate the images and buckets based on the vendor object is a common pattern in ASP.NET Web Forms. It allows you to maintain a clear separation between your data binding logic and your presentation logic. Here are some considerations to ensure that your implementati...
7,491
[ { "from": "human", "value": "Before I do this I figured I would ask if it was the best way. Each \"Vendor\" object has a \"Bucket\" object. In my repeater I need to display some properties from Vendor and some from Bucket, also some images populated by FileSystem that are linked to the vendor. I figured the...
I know that you can make a virtual network interface in Windows (see here), and in Linux it is also pretty easy with ip-aliases, but does something similar exist for Mac OS X? I've been looking for loopback adapters, virtual interfaces and couldn't find a good solution. You can create a new interface in the networking ...
In macOS, you can create virtual network interfaces using the `ifconfig` command and also create loopback interfaces that can be used for testing and development purposes. While macOS does not have an explicit GUI feature for creating virtual network interfaces, you can achieve this via the terminal. Here's how you can...
7,968
[ { "from": "human", "value": "I know that you can make a virtual network interface in Windows (see here), and in Linux it is also pretty easy with ip-aliases, but does something similar exist for Mac OS X? I've been looking for loopback adapters, virtual interfaces and couldn't find a good solution.\nYou can...
Using MAPI functions from within managed code is officially unsupported. Apparently, MAPI uses its own memory management and it crashes and burns within managed code (see here and here) All I want to do is launch the default e-mail client with subject, body, AND one or more attachments. So I've been looking into MAPIS...
Using MAPI functions like `MAPISendDocuments` from managed code can indeed be tricky, and many developers have raised concerns about stability and compatibility. Here are some points to consider based on experiences in the community and best practices: ### Pros of Using `MAPISendDocuments` - **Attachments Support**: A...
6,484
[ { "from": "human", "value": "Using MAPI functions from within managed code is officially unsupported. Apparently, MAPI uses its own memory management and it crashes and burns within managed code (see here and here)\nAll I want to do is launch the default e-mail client with subject, body, AND one or more att...
Has anyone found a good compression format for MS Sqlserver databases? If so, what do you use and are you pleased with how it performs? My company frequently will compress a database snapshot from one of our clients and download it so we have a local copy for testing and dev purposes. We tried zip in the past, but onc...
When it comes to compressing MS SQL Server databases, several formats and tools can be considered for their effectiveness in terms of compression ratio and speed. Here are some options that you might find useful, especially for handling large database files: 1. **7-Zip (with LZMA or LZMA2)**: - 7-Zip is a popular c...
3,145
[ { "from": "human", "value": "Has anyone found a good compression format for MS Sqlserver databases? If so, what do you use and are you pleased with how it performs? \nMy company frequently will compress a database snapshot from one of our clients and download it so we have a local copy for testing and dev p...
I recently had to solve this problem and find I've needed this info many times in the past so I thought I would post it. Assuming the following table def, how would you write a query to find all differences between the two? table def: CREATE TABLE feed_tbl ( code varchar(15), name varchar(40), status char(1), update c...
Your approach to finding the differences between the two tables `feed_tbl` and `data_tbl` is thoughtful and well-structured. However, there are a few minor adjustments needed to ensure the SQL syntax is correct and that it accurately captures the differences between the two tables. Here’s a refined version of your que...
2,926
[ { "from": "human", "value": "I recently had to solve this problem and find I've needed this info many times in the past so I thought I would post it. Assuming the following table def, how would you write a query to find all differences between the two?\ntable def:\nCREATE TABLE feed_tbl\n(\ncode varchar(15...
What's the best practice for making sure that certain ajax calls to certain pages are only accepted from authenticated users? For example: Let's say that I have a main page called blog.php (I know, creativity abounds). Let's also say that there is a page called delete.php which looks for the parameter post_id and then...
To secure your AJAX calls and ensure that only authenticated users can access certain actions (like deleting a post), there are several best practices you should implement. Here’s a comprehensive approach to enhance the security of your AJAX calls in the scenario you described: ### 1. **Session Management and Authenti...
2,941
[ { "from": "human", "value": "What's the best practice for making sure that certain ajax calls to certain pages are only accepted from authenticated users?\nFor example:\nLet's say that I have a main page called blog.php (I know, creativity abounds). Let's also say that there is a page called delete.php whi...
I'm testing the VB function below that I got from a Google search. I plan to use it to generate hash codes for quick string comparison. However, there are occasions in which two different strings have the same hash code. For example, these strings "122Gen 1 heap size (.NET CLR Memory w3wp):mccsmtpteweb025.208333333333...
The function you provided for generating hash codes indeed has limitations that can lead to hash collisions, where different input strings yield the same hash code. Here are the issues with the current implementation and suggestions for improvements. ### Issues with the Current Hash Function 1. **Basic Hashing Method...
4,956
[ { "from": "human", "value": "I'm testing the VB function below that I got from a Google search. I plan to use it to generate hash codes for quick string comparison. However, there are occasions in which two different strings have the same hash code. For example, these strings\n\"122Gen 1 heap size (.NET CL...
I started an application in Google App Engine right when it came out, to play with the technology and work on a pet project that I had been thinking about for a long time but never gotten around to starting. The result is BowlSK. However, as it has grown, and features have been added, it has gotten really difficult t...
Restructuring your application to improve organization and maintainability is a great move, especially as your project grows. Here’s a suggested structure along with explanations on how to effectively implement it: ### Suggested Directory Structure ``` /bowlsk /appdef /indexes /src /bowlsk ...
6,350
[ { "from": "human", "value": "I started an application in Google App Engine right when it came out, to play with the technology and work on a pet project that I had been thinking about for a long time but never gotten around to starting. The result is BowlSK. However, as it has grown, and features have bee...
How do people usually detect the MIME type of an uploaded file using ASP.NET?
In ASP.NET, detecting the MIME type of an uploaded file can be achieved through several methods. Here are some common approaches: ### 1. Using the `HttpPostedFile` Class When a file is uploaded via a form, it is accessible as an `HttpPostedFile` object. You can retrieve the MIME type from the `ContentType` property of...
6,120
[ { "from": "human", "value": "How do people usually detect the MIME type of an uploaded file using ASP.NET?\n" }, { "from": "gpt", "value": "In ASP.NET, detecting the MIME type of an uploaded file can be achieved through several methods. Here are some common approaches:\n\n### 1. Using the `HttpP...
I have a string, say '123', and I want to convert it to the integer 123. I know you can simply do some_string.to_i, but that converts 'lolipops' to 0, which is not the effect I have in mind. I want it to blow up in my face when I try to convert something invalid, with a nice and painful Exception. Otherwise, I can't di...
If you want to convert a string to an integer in Ruby and raise an exception for any invalid input (instead of returning `0` for non-numeric strings), you can use the `Integer()` method. This method will raise an `ArgumentError` if the string cannot be converted to a valid integer. Here's how you can do it: ```ruby b...
10,074
[ { "from": "human", "value": "I have a string, say '123', and I want to convert it to the integer 123.\nI know you can simply do some_string.to_i, but that converts 'lolipops' to 0, which is not the effect I have in mind. I want it to blow up in my face when I try to convert something invalid, with a nice an...
I'm trying to debug into a C dll that is invoked on a Windows Mobile device using CeRapiInvoke() (Technically RAPI.Invoke() from OpenNETCF) from a Windows box. I'm very familiar with attaching to a process that is already running to debug a loaded dll (I've done it many time with Windows Mobile services) but I can't s...
It sounds like you've made significant progress in identifying the correct process to attach to for debugging your C DLL on a Windows Mobile device. For others who may encounter a similar situation, here's a brief overview of what you might consider when debugging a DLL invoked via `CeRapiInvoke()` or `RAPI.Invoke()`. ...
7,233
[ { "from": "human", "value": "I'm trying to debug into a C dll that is invoked on a Windows Mobile device using CeRapiInvoke() (Technically RAPI.Invoke() from OpenNETCF) from a Windows box. I'm very familiar with attaching to a process that is already running to debug a loaded dll (I've done it many time wi...
I want to include a batch file rename functionality in my application. A user can type a destination filename pattern and (after replacing some wildcards in the pattern) I need to check if it's going to be a legal filename under Windows. I've tried to use regular expression like [a-zA-Z0-9_]+ but it doesn't include man...
To check if a filename is legal under Windows, you need to consider several factors beyond just the character set. Here are the main points to consider when checking for valid filenames in Windows: 1. **Character Limitations**: Windows filenames cannot contain the following characters: - `\` - `/` - `:` - ...
1,977
[ { "from": "human", "value": "I want to include a batch file rename functionality in my application. A user can type a destination filename pattern and (after replacing some wildcards in the pattern) I need to check if it's going to be a legal filename under Windows. I've tried to use regular expression like...
Actually, this question seems to have two parts: How to implement pattern matching? How to implement send and receive (i.e. the Actor model)? For the pattern matching part, I've been looking into various projects like App and Prop. These look pretty nice, but couldn't get them to work on a recent version (4.x) of g+...
Implementing pattern matching and the Actor model in C++ can be a challenge due to the language's nature and lack of built-in support for these paradigms. However, it is possible to achieve this functionality through thoughtful design and implementation. Below are some ideas on how to implement both aspects more robust...
2,547
[ { "from": "human", "value": "Actually, this question seems to have two parts:\n\nHow to implement pattern matching?\nHow to implement send and receive (i.e. the Actor model)?\n\nFor the pattern matching part, I've been looking into various projects like App and Prop. These look pretty nice, but couldn't ge...
The built-in PHP extension for SOAP doesn't validate everything in the incoming SOAP request against the XML Schema in the WSDL. It does check for the existence of basic entities, but when you have something complicated like simpleType restrictions the extension pretty much ignores their existence. What is the best way...
To validate a SOAP request against the XML Schema defined in the WSDL, you can take the following approach: 1. **Extract the WSDL and XML Schema**: Start by fetching the WSDL file for your SOAP service. The WSDL file contains definitions for the services, messages, and types used, including XML Schema definitions. 2....
6,691
[ { "from": "human", "value": "The built-in PHP extension for SOAP doesn't validate everything in the incoming SOAP request against the XML Schema in the WSDL. It does check for the existence of basic entities, but when you have something complicated like simpleType restrictions the extension pretty much igno...
I've been tasked (by my wife) with creating a program to allow her to track the family trees on both sides of our family. Does anyone know of a cost-effective (free) control to represent this type of information? What I'm looking for is a modified org-chart type chart/tree. The modification is that any node should hav...
Creating a family tree representation where each individual can have two parent nodes (like a mother and father) can indeed be a bit challenging with standard org-chart controls, as most of them are designed for a single-parent structure. However, there are a few approaches and tools you can consider that are cost-effe...
4,500
[ { "from": "human", "value": "I've been tasked (by my wife) with creating a program to allow her to track the family trees on both sides of our family.\nDoes anyone know of a cost-effective (free) control to represent this type of information?\nWhat I'm looking for is a modified org-chart type chart/tree. T...
I am having a problem with the speed of accessing an association property with a large number of records. I have an XAF app with a parent class called MyParent. There are 230 records in MyParent. MyParent has a child class called MyChild. There are 49,000 records in MyChild. I have an association defined between MyPare...
To address the performance issue in your XAF application, especially regarding the delay when accessing the `MyChildren` collection, you can consider several strategies to improve the speed of loading associated values. Here are some suggestions: ### 1. Optimize Query Execution Ensure that you are using efficient que...
3,539
[ { "from": "human", "value": "I am having a problem with the speed of accessing an association property with a large number of records.\nI have an XAF app with a parent class called MyParent.\nThere are 230 records in MyParent.\nMyParent has a child class called MyChild.\nThere are 49,000 records in MyChild....
I find myself writing delegates occasionally for really simple functions (take no arguments and return void for example) and am wondering if anyone knows someplace that has compiled a list of all the predefined delegates already available in the .NET framework so I can reuse them? To be clear I am looking for something...
Yes, .NET provides several predefined delegate types that can help simplify your code and avoid the need to define custom delegates for common patterns. Below is a list of some of the most commonly used predefined delegates in the .NET Framework: ### Common Predefined Delegates in .NET 1. **Action** - Represents a...
5,606
[ { "from": "human", "value": "I find myself writing delegates occasionally for really simple functions (take no arguments and return void for example) and am wondering if anyone knows someplace that has compiled a list of all the predefined delegates already available in the .NET framework so I can reuse the...
I have read that using database keys in a URL is a bad thing to do. For instance, My table has 3 fields: ID:int, Title:nvarchar(5), Description:Text I want to create a page that displays a record. Something like ... http://server/viewitem.aspx?id=1234 First off, could someone elaborate on why this is a bad thing to ...
Using database keys, such as primary keys, directly in a URL can be considered a bad practice for several reasons: ### Reasons why using primary keys in URLs can be problematic: 1. **Security and Exposure of Internal Structure**: Exposing primary keys in URLs can leak information about the internal structure of your ...
4,788
[ { "from": "human", "value": "I have read that using database keys in a URL is a bad thing to do.\nFor instance,\nMy table has 3 fields: ID:int, Title:nvarchar(5), Description:Text\nI want to create a page that displays a record. Something like ...\nhttp://server/viewitem.aspx?id=1234\n\n\nFirst off, could ...
If I have an IEnumerator variable is it possible to have a lambda function that takes it, advances it with MoveNext() and returns the Current value every single time its called?
Yes, it is possible to create a lambda function that takes an `IEnumerator` and advances it with `MoveNext()` while returning the `Current` value each time it is called. However, you'll need to handle the case where the enumerator has reached the end of its collection. Here's an example of how you might implement this...
7,993
[ { "from": "human", "value": "If I have an IEnumerator variable is it possible to have a lambda function that takes it, advances it with MoveNext() and returns the Current value every single time its called?\n" }, { "from": "gpt", "value": "Yes, it is possible to create a lambda function that tak...