instruction
stringlengths
14
27.6k
completion
stringlengths
3
38.3k
__original_row_idx
int64
0
50k
conversations
listlengths
2
2
I realize that literally it translates to Java Enterprise Edition. But what I'm asking is what does this really mean? When a company requires Java EE experience, what are they really asking for? Experience with EJBs? Experience with Java web apps? I suspect that this means something different to different people and ...
You're right that "Java EE" (now known as Jakarta EE) can mean different things to different organizations and individuals. However, there are some common themes and expectations that tend to emerge when companies list "Java EE experience" in their job requirements. Here’s a breakdown of what that might entail: 1. **F...
7,099
[ { "from": "human", "value": "I realize that literally it translates to Java Enterprise Edition. But what I'm asking is what does this really mean? When a company requires Java EE experience, what are they really asking for? Experience with EJBs? Experience with Java web apps? \nI suspect that this means so...
I'm creating an installer for a website that uses a custom event log source. I would like our WiX based installer to create that event log source during installation. Does anyone know the best way to do this using the WiX framework.
Creating a custom event log source during installation using the WiX Toolset involves using a combination of WiX XML elements and possibly a custom action if additional setup is required. Below are the steps to achieve this: ### 1. Define the Event Log Source in WiX WiX provides a way to create event log sources thro...
5,901
[ { "from": "human", "value": "I'm creating an installer for a website that uses a custom event log source. I would like our WiX based installer to create that event log source during installation.\nDoes anyone know the best way to do this using the WiX framework.\n" }, { "from": "gpt", "value": "...
I need to index up to 500,000 entries for fastest read. The index needs to be rebuilt periodically , on disk. I am trying to decide between a simple file like a hash on disk or a single table in an embedded database. I have no need for an RDBMS engine.
When deciding between a simple hash file on disk and a single table in an embedded database for indexing up to 500,000 entries with an emphasis on fast reads and the ability to rebuild the index periodically, there are several factors to consider: ### 1. **Read Performance** - **Hash File**: A simple hash file can pro...
7,814
[ { "from": "human", "value": "I need to index up to 500,000 entries for fastest read. The index needs to be rebuilt periodically , on disk. I am trying to decide between a simple file like a hash on disk or a single table in an embedded database. I have no need for an RDBMS engine. \n" }, { "fro...
I would like to create a file format for my app like Quake, OO, and MS Office 07 have. Basically a uncompressed zip folder, or tar file. I need this to be cross platform (mac and windows). Can I do something via command prompt and bash?
Creating a custom file format for your application that behaves like an uncompressed zip or tar file is certainly achievable. You can choose to use existing formats (like zip or tar) or create a specific format that your application will recognize. Below are steps for both approaches, along with command-line examples. ...
5,438
[ { "from": "human", "value": "I would like to create a file format for my app like Quake, OO, and MS Office 07 have.\nBasically a uncompressed zip folder, or tar file.\nI need this to be cross platform (mac and windows).\nCan I do something via command prompt and bash?\n" }, { "from": "gpt", "val...
I need some help with ASP.NET MVC routes. I need to create 2 routes for a cms type application. One route will be for category level URLS, and the other route will be for the actual page content. categories, always ends in a '/' www.example.com/category/ www.example.com/category/subcategory/ www.example.com/category...
Sure! You can define custom routes in your ASP.NET MVC application to handle these specific URL patterns. Below, I will outline how you can create two custom routes in the `RouteConfig` class that fits your requirements for a CMS application. ### Step 1: Define the Routes in `RouteConfig` Open the `RouteConfig.cs` fi...
6,130
[ { "from": "human", "value": "I need some help with ASP.NET MVC routes. I need to create 2 routes for a cms type application. One route will be for category level URLS, and the other route will be for the actual page content.\n\ncategories, always ends in a '/'\nwww.example.com/category/\nwww.example.com/c...
I need to query an Exchange server to find all messages having a certain value in PR_SEARCH_KEY. Do I have to open every mailbox and iterate through it or is there a faster solution? Edit: This is for a program that needs to prepend something to the subject line of all copies of a message I got through a journal mailbo...
To query an Exchange server for messages with a specific `PR_SEARCH_KEY` without opening every mailbox individually, you can use a more efficient approach by leveraging Exchange Web Services (EWS) or the Microsoft Graph API, if available in your environment. ### Using Exchange Web Services (EWS) 1. **Use EWS Managed ...
5,929
[ { "from": "human", "value": "I need to query an Exchange server to find all messages having a certain value in PR_SEARCH_KEY. Do I have to open every mailbox and iterate through it or is there a faster solution?\nEdit: This is for a program that needs to prepend something to the subject line of all copies o...
I have the following tables, the groups table which contains hierarchically ordered groups and group_member which stores which groups a user belongs to. groups --------- id parent_id name group_member --------- id group_id user_id ID PARENT_ID NAME --------------------------- 1 NULL Cerebra 2 1 ...
Yes, you can retrieve the visible groups for a user in a single SQL query using a Common Table Expression (CTE) with recursive capabilities that MySQL supports (from version 8.0). Here is a query that should give you the results you want: ```sql WITH RECURSIVE group_hierarchy AS ( SELECT g.id AS group_id FROM ...
8,572
[ { "from": "human", "value": "I have the following tables, the groups table which contains hierarchically ordered groups and group_member which stores which groups a user belongs to. \ngroups\n---------\nid \nparent_id\nname\n\ngroup_member\n---------\nid\ngroup_id\nuser_id\n\nID PARENT_ID NAME\n---------...
Okay, here's the scenario. I have a utility that processes tons of records, and enters information to the Database accordingly. It works on these records in multi-threaded batches. Each such batch writes to the same log file for creating a workflow trace for each record. Potentially, we could be making close to a milli...
Given the scenario you've described, here are some considerations and potential optimizations for using a local log file versus a database for logging purposes: ### 1. **Concurrency Issues** - **Local Log File**: When multiple threads write to the same log file, you risk log messages being interleaved and difficult...
7,560
[ { "from": "human", "value": "Okay, here's the scenario. I have a utility that processes tons of records, and enters information to the Database accordingly.\nIt works on these records in multi-threaded batches. Each such batch writes to the same log file for creating a workflow trace for each record. Potent...
I need to write a function that receives a property as a parameter and execute its getter. If I needed to pass a function/delegate I would have used: delegate RET FunctionDelegate<T, RET>(T t); void func<T, RET>(FunctionDelegate function, T param, ...) { ... return function.Invoke(param); } Is there a similar...
In C#, you cannot directly pass properties like you would with delegates, but you can achieve a similar effect using `Func<T>` for getting properties and `Action<T>` for setting them. This allows you to encapsulate the getter and setter behavior in delegates. Here's a simple implementation to demonstrate how to create...
8,645
[ { "from": "human", "value": "I need to write a function that receives a property as a parameter and execute its getter.\nIf I needed to pass a function/delegate I would have used:\ndelegate RET FunctionDelegate<T, RET>(T t);\n\nvoid func<T, RET>(FunctionDelegate function, T param, ...)\n{\n ...\n retu...
How do I create a self-signed certificate for code signing using the Windows SDK?
Creating a self-signed certificate for code signing using the Windows SDK can be accomplished using the `makecert.exe` tool or PowerShell commands. Below are the steps for both methods: ### Method 1: Using `makecert.exe` 1. **Install Windows SDK**: Ensure that the Windows SDK is installed on your system. You can down...
4,465
[ { "from": "human", "value": "How do I create a self-signed certificate for code signing using the Windows SDK?\n" }, { "from": "gpt", "value": "Creating a self-signed certificate for code signing using the Windows SDK can be accomplished using the `makecert.exe` tool or PowerShell commands. Belo...
I have written a site in Prototype but want to switch to jQuery. Any ideas on how best make the switch?
Switching from Prototype to jQuery can be a significant change, but with careful planning, you can transition smoothly. Here are some steps and tips to help you make the switch effectively: ### 1. Understand Differences Before you start, familiarize yourself with the fundamental differences between Prototype and jQuer...
7,008
[ { "from": "human", "value": "I have written a site in Prototype but want to switch to jQuery. Any ideas on how best make the switch?\n" }, { "from": "gpt", "value": "Switching from Prototype to jQuery can be a significant change, but with careful planning, you can transition smoothly. Here are s...
I have not seen much support for Grails to develop facebook apps.I was just wondering if people around are developing facebook apps on grails
Grails is a powerful web application framework that leverages the Groovy programming language and is built on top of the Spring framework. While it's primarily used for building web applications, it can certainly be used to develop Facebook applications, although it may not be as commonly used as other frameworks like ...
7,666
[ { "from": "human", "value": "I have not seen much support for Grails to develop facebook apps.I was just wondering if people around are developing facebook apps on grails \n" }, { "from": "gpt", "value": "Grails is a powerful web application framework that leverages the Groovy programming langua...
I have experience writing console and network client/server applications in C and C++, but I know next to nothing about using the win32 visual API, MFC, Qt, wxWidgets, etc. Where is a good place to start, and what method should I specialize in, so as to be future ready and robust?
Given your background in writing console and network client/server applications in C and C++, you have a strong foundation to build upon for GUI development. Here’s a guide to help you get started with the Win32 Visual API and several popular frameworks: ### Learning Resources 1. **Books and Documentation:** - **W...
5,695
[ { "from": "human", "value": "I have experience writing console and network client/server applications in C and C++, but I know next to nothing about using the win32 visual API, MFC, Qt, wxWidgets, etc. Where is a good place to start, and what method should I specialize in, so as to be future ready and robu...
I want to perform cascade delete for some tables in my database, but I'm interested in what happens in case there's a failure when deleting something. Will everything rollback?
In a relational database, whether or not everything rolls back during a cascade delete operation depends on several factors, including the transaction settings and the specific database management system (DBMS) you are using. ### General Behavior: 1. **Atomic Transactions**: Most modern relational databases support t...
9,146
[ { "from": "human", "value": "I want to perform cascade delete for some tables in my database, but I'm interested in what happens in case there's a failure when deleting something. Will everything rollback?\n" }, { "from": "gpt", "value": "In a relational database, whether or not everything rolls...
I'd like to build a query string based on values taken from 5 groups of radio buttons. Selecting any of the groups is optional so you could pick set A or B or both. How would I build the querystring based on this? I'm using VB.NET 1.1 The asp:Radiobuttonlist control does not like null values so I'm resorting to normal ...
Building a query string from radio button selections in ASP.NET using VB.NET is a common task, and your current approach is a good start. However, there are a few adjustments and best practices you could follow to ensure that the query string is constructed correctly and cleanly. Here’s how you can modify your existin...
7,218
[ { "from": "human", "value": "I'd like to build a query string based on values taken from 5 groups of radio buttons.\nSelecting any of the groups is optional so you could pick set A or B or both. How would I build the querystring based on this? I'm using VB.NET 1.1\nThe asp:Radiobuttonlist control does not l...
I am using a FTPS connection to send a text file [this file will contain EDI(Electronic Data Interchange) information]to a mailbox INOVIS.I have configured the system to open a FTPS connection and using the PUT command I write the file to a folder on the FTP server. The problem is: what mode of file transfer should I...
When transferring files using FTPS (File Transfer Protocol Secure), it’s important to choose the correct transfer mode to ensure that your files are transmitted correctly. There are two modes for transferring files: **ASCII mode** and **Binary mode**. ### Transfer Modes 1. **ASCII Mode**: - This mode is generally ...
6,773
[ { "from": "human", "value": "I am using a FTPS connection to send a text file\n[this file will contain EDI(Electronic Data Interchange) information]to a mailbox INOVIS.I have configured the system to open a FTPS connection and using the PUT command I write the file to a folder on the FTP server.\nThe prob...
The following program is very simple: it outputs a single dot each half a second. If it recieves a SIGQUIT, it proceeds to output ten Qs. If it recieves a SIGTSTP (Ctrl-Z), it outputs ten Zs. If it recieves a SIGTSTP while printing Qs, it will print ten Zs after it's done with the ten Qs. This is a good thing. However,...
The issue you're encountering stems from how the signal handling interacts with the sleep function and the execution flow of your program. Specifically, when a signal handler is executing, the normal flow of your program is interrupted. If a new signal arrives while the handler is running (especially if it takes a whil...
7,864
[ { "from": "human", "value": "The following program is very simple: it outputs a single dot each half a second. If it recieves a SIGQUIT, it proceeds to output ten Qs. If it recieves a SIGTSTP (Ctrl-Z), it outputs ten Zs.\nIf it recieves a SIGTSTP while printing Qs, it will print ten Zs after it's done with ...
is it possible to create java application that will work as background process on symbian smartphones?
Yes, it is possible to create a Java application that runs as a background process on Symbian smartphones, but there are several important considerations: 1. **Platform Support**: Symbian OS supports Java through the Java ME (Micro Edition) platform. However, the capabilities of Java ME are limited compared to standar...
10,605
[ { "from": "human", "value": "is it possible to create java application that will\nwork as background process on symbian smartphones?\n" }, { "from": "gpt", "value": "Yes, it is possible to create a Java application that runs as a background process on Symbian smartphones, but there are several i...
Is there a place to find all possible uses of the syscmd method in MS Access? I know Microsoft has a developer reference, but I have found there are many other uses for this method that are not listed here.
The `SysCmd` method in Microsoft Access is quite versatile and is used for various purposes such as displaying messages, getting system information, and managing the user interface. While the Microsoft Developer Network (MSDN) documentation provides a good starting point, it may not cover every possible use case or all...
7,635
[ { "from": "human", "value": "Is there a place to find all possible uses of the syscmd method in MS Access? I know Microsoft has a developer reference, but I have found there are many other uses for this method that are not listed here.\n" }, { "from": "gpt", "value": "The `SysCmd` method in Micr...
Where is a good place to start with making an application in .NET that communicates through OPC?
Creating an application in .NET that communicates through OPC (OLE for Process Control) is a great choice, especially in industrial automation and control systems. Here’s a structured approach to get you started: ### 1. **Understand OPC Standards** - Familiarize yourself with the different versions of OPC: OPC Clas...
7,308
[ { "from": "human", "value": "Where is a good place to start with making an application in .NET that communicates through OPC?\n" }, { "from": "gpt", "value": "Creating an application in .NET that communicates through OPC (OLE for Process Control) is a great choice, especially in industrial autom...
I'm going to be starting a project soon that requires support for large-ish binary files. I'd like to use Ruby on Rails for the webapp, but I'm concerned with the BLOB support. In my experience with other languages, frameworks, and databases, BLOBs are often overlooked and thus have poor, difficult, and/or buggy functi...
Ruby on Rails does provide support for handling binary data, including BLOBs, particularly when using ActiveRecord in conjunction with PostgreSQL or MySQL. Here’s a breakdown of how Rails handles BLOBs and some considerations to keep in mind: ### ActiveRecord Support for BLOBs 1. **Data Type**: - For PostgreSQL, y...
6,590
[ { "from": "human", "value": "I'm going to be starting a project soon that requires support for large-ish binary files. I'd like to use Ruby on Rails for the webapp, but I'm concerned with the BLOB support. In my experience with other languages, frameworks, and databases, BLOBs are often overlooked and thus ...
Is there an efficient method of converting an integer into the written numbers, for example: string Written = IntegerToWritten(21); would return "Twenty One". Is there any way of doing this that doesn't involve a massive look-up table?
Yes, you can convert an integer into its written form without relying on a massive lookup table by using a structured approach. Below is an example implementation in C# that handles numbers from 0 to 9999. This method breaks down the number into manageable components (thousands, hundreds, tens, and units) and converts ...
945
[ { "from": "human", "value": "Is there an efficient method of converting an integer into the written numbers, for example:\nstring Written = IntegerToWritten(21);\n\nwould return \"Twenty One\".\nIs there any way of doing this that doesn't involve a massive look-up table?\n" }, { "from": "gpt", "...
I've just created my first Preview 5 error and it doesn't seem to place nice with Resharper. All the C# in the Views are coming up with errors, things like <%= Html.Password("currentPassword") %> has the "currentPassword" highlighted with the following error: Argument type "System.String" is not assignable parameter t...
It looks like you're encountering some issues with ReSharper interpreting your Razor view code in ASP.NET MVC. This can sometimes happen if the project isn't set up correctly or if there are compatibility issues between versions of ReSharper and the version of .NET or ASP.NET MVC you are using. Here are a few steps yo...
8,313
[ { "from": "human", "value": "I've just created my first Preview 5 error and it doesn't seem to place nice with Resharper. All the C# in the Views are coming up with errors, things like <%= Html.Password(\"currentPassword\") %> has the \"currentPassword\" highlighted with the following error: Argument type ...
I'm looking to locate a good resource (book or otherwise) on safety critical systems development techniques/methodologies, especially something that will cover both hardware and software . I have a sound working knowledge of C/C++, so even if it is just code on SourceForge etc I would still appreciate a link to it to h...
When it comes to safety-critical systems development, there are several resources that encompass both hardware and software methodologies. Here’s a selection of books, standards, and online resources that you may find helpful: ### Books: 1. **"Real-Time Systems: Theory and Practice" by Jane W. S. Liu** - This book ...
7,763
[ { "from": "human", "value": "I'm looking to locate a good resource (book or otherwise) on safety critical systems development techniques/methodologies, especially something that will cover both hardware and software . I have a sound working knowledge of C/C++, so even if it is just code on SourceForge etc I...
Does anybody know a "technique" to discover memory leaks caused by smart pointers? I am currently working on a large project written in C++ that heavily uses smart pointers with reference counting. Obviously we have some memory leaks caused by smart pointers, that are still referenced somewhere in the code, so that the...
Certainly! Memory leaks caused by smart pointers, particularly those arising from circular references in C++, can be quite tricky to track down. Below are steps you can take to create an algorithm to help you discover such leaks, specifically focusing on grouping call stacks related to smart pointers' reference countin...
4,249
[ { "from": "human", "value": "Does anybody know a \"technique\" to discover memory leaks caused by smart pointers? I am currently working on a large project written in C++ that heavily uses smart pointers with reference counting. Obviously we have some memory leaks caused by smart pointers, that are still re...
I couldn't find a decent ThreadPool implementation for Ruby, so I wrote mine (based partly on code from here: http://web.archive.org/web/20081204101031/http://snippets.dzone.com:80/posts/show/3276 , but changed to wait/signal and other implementation for ThreadPool shutdown. However after some time of running (having 1...
The deadlock you're encountering in your Ruby `ThreadPool` implementation likely stems from how you are using locks and condition variables. Let's analyze the relevant parts of your code to identify potential issues. ### Potential Deadlock Issue 1. **Waiting for New Jobs**: In your `Worker` class, when a worker threa...
7,683
[ { "from": "human", "value": "I couldn't find a decent ThreadPool implementation for Ruby, so I wrote mine (based partly on code from here: http://web.archive.org/web/20081204101031/http://snippets.dzone.com:80/posts/show/3276 , but changed to wait/signal and other implementation for ThreadPool shutdown. How...
I want to ditch my current editor. I feel I need something else. That do not expose my hands to the risk of RSI. I need to see why I should change editor. And it would be nice to believe, that I will be coding when I'm 80 years old. All the big guys out there are using Vim. The only Emacs guy I know are RMS. Paul Graha...
It's great that you're considering your options for code editors with an eye towards long-term sustainability and health, especially regarding RSI (Repetitive Strain Injury). Choosing an editor that aligns with your goals and coding style is important. Here are some points to consider when thinking about switching from...
7,877
[ { "from": "human", "value": "I want to ditch my current editor. I feel I need something else. That do not expose my hands to the risk of RSI. I need to see why I should change editor. And it would be nice to believe, that I will be coding when I'm 80 years old.\nAll the big guys out there are using Vim. The...
Essentially I have a PHP page that calls out some other HTML to be rendered through an object's method. It looks like this: MY PHP PAGE: // some content... <?php $GLOBALS["topOfThePage"] = true; $this->renderSomeHTML(); ?> // some content... <?php $GLOBALS["topOfThePage"] = false; $this->renderSomeHT...
In your situation with Magento and its caching mechanisms, it sounds like you're trying to render HTML that behaves differently based on its position on the page, but the caching is interfering with the expected outcome. Here’s a breakdown of your situation and some possible solutions. ### Understanding Caching in Mag...
7,990
[ { "from": "human", "value": "Essentially I have a PHP page that calls out some other HTML to be rendered through an object's method. It looks like this:\nMY PHP PAGE:\n// some content...\n\n<?php\n $GLOBALS[\"topOfThePage\"] = true;\n $this->renderSomeHTML();\n?>\n\n// some content...\n\n<?php\n $G...
I've been having some trouble parsing various types of XML within flash (specifically FeedBurner RSS files and YouTube Data API responses). I'm using a URLLoader to load a XML file, and upon Event.COMPLETE creating a new XML object. 75% of the time this work fine, and every now and again I get this type of exception: T...
Parsing XML in Flash can be tricky, especially when working with data that may be large or streamed from a remote source. The error you’re encountering suggests that the XML is not being fully received or parsed before you attempt to access its contents. Here are some strategies and best practices you can employ to ens...
7,591
[ { "from": "human", "value": "I've been having some trouble parsing various types of XML within flash (specifically FeedBurner RSS files and YouTube Data API responses). I'm using a URLLoader to load a XML file, and upon Event.COMPLETE creating a new XML object. 75% of the time this work fine, and every now ...
I have seen the references to VistaDB over the years and with tools like SQLite, Firebird, MS SQL et. al. I have never had a reason to consider it. What are the benefits of paying for VistaDB vs using another technology? Things I have thought of: 1. Compact Framework Support. SQLite+MSSQL support the CF. 2. Need migr...
VistaDB is a .NET embedded database that has been around for a while, and it offers some distinct features that may make it appealing in certain situations. Here are some benefits of using VistaDB compared to other technologies like SQLite, Firebird, or MS SQL: ### 1. **.NET Integration** - **Native .NET Data Types**:...
7,449
[ { "from": "human", "value": "I have seen the references to VistaDB over the years and with tools like SQLite, Firebird, MS SQL et. al. I have never had a reason to consider it.\nWhat are the benefits of paying for VistaDB vs using another technology? Things I have thought of:\n1. Compact Framework Support....
I was wondering what people thought of using properties as object initializers in C#. For some reason it seems to break the fundamentals of what constructors are used for. An example... public class Person { string firstName; string lastName; public string FirstName { get { return firstName; } ...
Using object initializers in C# can indeed seem to break from the traditional use of constructors at first glance, but it's a feature that has its advantages and fits well with the language's design principles. Let's delve into the implications and reasoning behind this feature. ### Advantages of Object Initializers ...
7,759
[ { "from": "human", "value": "I was wondering what people thought of using properties as object initializers in C#. For some reason it seems to break the fundamentals of what constructors are used for.\nAn example...\npublic class Person\n{\n string firstName;\n string lastName;\n\n public string Fi...
(This question is over 6 years old and probably no longer has any relevance.) Our system uses Zend WinEnabler. Do you use it? Is it obsolete? Should we stop using it? Is it known to cause handle/memory leaks? Here is an (old) introduction to it: PHP Creators Unveil New Product that Makes PHP Truly Viable for Wind...
Zend WinEnabler was introduced to make it easier to run PHP applications in Windows environments by providing a bridge between Windows and PHP's native functionality. However, as of my last knowledge update in October 2023, the relevance and support for Zend WinEnabler have waned over the years. Here are some considera...
6,281
[ { "from": "human", "value": "(This question is over 6 years old and probably no longer has any relevance.)\nOur system uses Zend WinEnabler. \n\nDo you use it? \nIs it obsolete? \nShould we stop using it? \nIs it known to cause handle/memory leaks?\n\nHere is an (old) introduction to it: PHP Creators Unveil...
Where can I download the JSSE and JCE source code for the latest release of Java? The source build available at https://jdk6.dev.java.net/ does not include the javax.crypto (JCE) packages nor the com.sun.net.ssl.internal (JSSE) packages. Not being able to debug these classes makes solving SSL issues incredibly difficu...
To obtain the source code for Java Secure Socket Extension (JSSE) and Java Cryptography Extension (JCE), you typically want to download the source code for the entire JDK (Java Development Kit) as these packages are part of it. Here’s how you can do that: ### 1. Downloading from the OpenJDK The best source for JSSE a...
5,888
[ { "from": "human", "value": "Where can I download the JSSE and JCE source code for the latest release of Java? The source build available at https://jdk6.dev.java.net/ does not include the javax.crypto (JCE) packages nor the com.sun.net.ssl.internal (JSSE) packages.\nNot being able to debug these classes m...
I've created a python object, but I want to send signals on it. I made it inherit from gobject.GObject, but there doesn't seem to be any way to create a new signal on my object.
To create signals in a class that inherits from `gobject.GObject`, you need to use the `gobject` library's mechanism for signal definitions. The signal should be defined using the `gobject.GObject.signal_new` method before you can emit it. Here's a step-by-step guide on how to create and use signals in a GObject subcl...
7,195
[ { "from": "human", "value": "I've created a python object, but I want to send signals on it. I made it inherit from gobject.GObject, but there doesn't seem to be any way to create a new signal on my object.\n" }, { "from": "gpt", "value": "To create signals in a class that inherits from `gobjec...
When trying to enter a SQL query with parameters using the Oracle OLE DB provider I get the following error: Parameters cannot be extracted from the SQL command. The provider might not help to parse parameter information from the command. In that case, use the "SQL command from variable" access mode, in which the enti...
The error you're encountering indicates that the OLE DB provider for Oracle is having trouble extracting parameter information from your SQL command. This can happen for a number of reasons, often related to the way the SQL command is structured or how parameters are defined. To address the issue, you can follow thes...
5,902
[ { "from": "human", "value": "When trying to enter a SQL query with parameters using the Oracle OLE DB provider I get the following error:\n\nParameters cannot be extracted from the SQL command. The provider might not help to parse parameter information from the command. In that case, use the \"SQL command f...
I am relatively new to JavaScript and am trying to understand how to use it correctly. If I wrap JavaScript code in an anonymous function to avoid making variables public the functions within the JavaScript are not available from within the html that includes the JavaScript. On initially loading the page the JavaScrip...
Certainly! It sounds like you're trying to structure your JavaScript code properly while ensuring that certain functionalities are accessible when your HTML loads. Let's break down how to achieve this while keeping your code organized and ensuring everything works smoothly. ### 1. Using an IIFE (Immediately Invoked Fu...
7,142
[ { "from": "human", "value": "I am relatively new to JavaScript and am trying to understand how to use it correctly.\nIf I wrap JavaScript code in an anonymous function to avoid making variables public the functions within the JavaScript are not available from within the html that includes the JavaScript. \n...
I looking for a way, specifically in PHP that I will be guaranteed to always get a unique key. I have done the following: strtolower(substr(crypt(time()), 0, 7)); But I have found that once in a while I end up with a duplicate key (rarely, but often enough). I have also thought of doing: strtolower(substr(crypt(uniqid...
To guarantee unique keys in PHP, you have several options that can greatly reduce the likelihood of collisions and ensure that you always get a unique identifier. Below are a few approaches that you can consider: ### 1. **Using `bin2hex` with Random Bytes:** One of the simplest and most effective ways to generate a un...
7,167
[ { "from": "human", "value": "I looking for a way, specifically in PHP that I will be guaranteed to always get a unique key.\nI have done the following:\nstrtolower(substr(crypt(time()), 0, 7));\n\nBut I have found that once in a while I end up with a duplicate key (rarely, but often enough).\nI have also th...
I've read in several places that the rectangle functions in emacs are very useful. I've read a bit about them, and I can't quite figure why. I mean, when you want to kill a paragraph, you mark the first row/column and then the last one, and that's actually a rectangle, right? But you can still use the normal kill... S...
Rectangles in Emacs can indeed be a bit confusing at first, but they offer powerful capabilities that go beyond the basic operations you might be accustomed to with standard text manipulation. Here are some reasons why rectangle functions can be useful and the kinds of transformations you can perform with them: ### 1....
6,649
[ { "from": "human", "value": "I've read in several places that the rectangle functions in emacs are very useful. I've read a bit about them, and I can't quite figure why. I mean, when you want to kill a paragraph, you mark the first row/column and then the last one, and that's actually a rectangle, right? B...
I once worked with an architect who banned the use of SQL views. His main reason was that views made it too easy for a thoughtless coder to needlessly involve joined tables which, if that coder tried harder, could be avoided altogether. Implicitly he was encouraging code reuse via copy-and-paste instead of encapsulati...
Your experience reflects a common debate in database design and development regarding the use of SQL views versus stored procedures and the approach to code reuse. Let's delve into the pros and cons of SQL views, performance considerations, and when they are appropriate. ### Pros of Using SQL Views: 1. **Encapsulation...
4,704
[ { "from": "human", "value": "I once worked with an architect who banned the use of SQL views. His main reason was that views made it too easy for a thoughtless coder to needlessly involve joined tables which, if that coder tried harder, could be avoided altogether. Implicitly he was encouraging code reuse ...
I've started a conversion of a project to Moose and the first thing I noticed was that my critic/tidy tests go to hell. Moose, Tidy and Critic don't seem to like each other as much as they used to. Are there docs anywhere on how to make critic/tidy be more appreciative of the Moose dialect? What do most Moose users do?...
When using Moose in Perl, it’s common to encounter some friction with code quality tools like Perl::Critic and Perl::Tidy. Moose introduces its own set of idioms and patterns that may not align perfectly with the expectations of these tools, leading to warnings or failures that could feel excessive. Here are some stra...
8,451
[ { "from": "human", "value": "I've started a conversion of a project to Moose and the first thing I noticed was that my critic/tidy tests go to hell. Moose, Tidy and Critic don't seem to like each other as much as they used to.\nAre there docs anywhere on how to make critic/tidy be more appreciative of the M...
How can I restore a mysql database that was dropped using a "drop database" command? I have access to binary logs which should make this type of rollback possible.
Restoring a MySQL database that was dropped using the `DROP DATABASE` command can be done using binary logs, provided that you have binary logging enabled and that the relevant binary log files are still available. Here are the general steps to perform the restoration: ### Step-by-Step Guide to Restore a Dropped MySQL...
7,765
[ { "from": "human", "value": "How can I restore a mysql database that was dropped using a \"drop database\" command? I have access to binary logs which should make this type of rollback possible.\n" }, { "from": "gpt", "value": "Restoring a MySQL database that was dropped using the `DROP DATABASE...
When providing a link to a PDF file on a website, is it possible to include information in the URL (request parameters) which will make the PDF browser plugin (if used) jump to a particular bookmark instead of just opening at the beginning? Something like: http://www.somehost.com/user-guide.pdf?bookmark=chapter3 ? If n...
Yes, you can include information in the URL to make a PDF viewer open to a particular page or bookmark, but the implementation and support can vary depending on the PDF viewer and browser. ### Jumping to a Specific Page You can open a PDF file to a specific page using a URL fragment. The syntax for this is: ``` http...
10,466
[ { "from": "human", "value": "When providing a link to a PDF file on a website, is it possible to include information in the URL (request parameters) which will make the PDF browser plugin (if used) jump to a particular bookmark instead of just opening at the beginning?\nSomething like: http://www.somehost.c...
As I put together each asp.net page It's clear that most of the time I could use the standard HTML tags just as easily as the web forms controls. When this is the case what is the lure of the webforms controls?
ASP.NET Web Forms controls provide several advantages over standard HTML tags, even though you can often achieve similar functionality using plain HTML. Here are some reasons why developers might choose Web Forms controls: 1. **State Management**: - Web Forms controls automatically manage the state of their data ac...
8,131
[ { "from": "human", "value": "As I put together each asp.net page It's clear that most of the time I could use the standard HTML tags just as easily as the web forms controls. When this is the case what is the lure of the webforms controls?\n" }, { "from": "gpt", "value": "ASP.NET Web Forms cont...
I talked to a friend of mine and he told me that it's possible to create an image in an image editor (gimp/photoshop) and then use it as a button . He said that's the way applications that have great GUIs do it. He also said that there is a file describing which parts of the image make up the button. Is this possible ...
Your friend is not crazy; what he described is a common approach used in UI design and development. Here's a breakdown of the concepts involved: ### Creating Images for Buttons 1. **Image Creation**: You can design images (like buttons) using graphic design software such as GIMP or Photoshop. This allows for high cust...
10,321
[ { "from": "human", "value": "I talked to a friend of mine and he told me that it's possible to create an image in an image editor (gimp/photoshop) and then use it as a button . He said that's the way applications that have great GUIs do it. \nHe also said that there is a file describing which parts of the i...
I've seen several examples of code like this: if not someobj: #do something But I'm wondering why not doing: if someobj == None: #do something Is there any difference? Does one have an advantage over the other?
Yes, there is a difference between `if not someobj:` and `if someobj is None:` in Python, and the choice between them depends on what you are trying to achieve. ### `if not someobj:` - This checks for the "truthiness" of `someobj`. In Python, certain values are considered "falsy" and will evaluate to `False` in a bool...
9,834
[ { "from": "human", "value": "I've seen several examples of code like this:\nif not someobj:\n #do something\n\nBut I'm wondering why not doing:\nif someobj == None:\n #do something\n\nIs there any difference? Does one have an advantage over the other?\n" }, { "from": "gpt", "value": "Yes, ...
I'm looking for publications about the history of the internet browsers. Papers, articles, blog posts whatever. Cannot find anything on ACM IEEE etc. and my blog search also didn't reveal anything remarkable.
While finding specific academic publications on the history of internet browsers can be challenging, there are several resources you might find useful for your research. Here are some suggestions: 1. **Books**: - "How We Got to Now: Six Innovations That Made the Modern World" by Steven Johnson includes discussions...
7,833
[ { "from": "human", "value": "I'm looking for publications about the history of the internet browsers. Papers, articles, blog posts whatever. Cannot find anything on ACM IEEE etc. and my blog search also didn't reveal anything remarkable.\n" }, { "from": "gpt", "value": "While finding specific ac...
CSS Attribute selectors allow the selection of elements based on attribute values. Unfortunately, I've not used them in years (mainly because they're not supported by all modern browsers). However, I remember distinctly that I was able to use them to adorn all external links with an icon, by using a code similar to the...
To select all `<a>` tags whose `href` attribute starts with "http", you can use the CSS attribute selector that includes a prefix. Specifically, you would use the `^=` operator, which selects elements with an attribute that begins with a specific value. Here's the correct way to write the CSS rule for your use case: ...
10,746
[ { "from": "human", "value": "CSS Attribute selectors allow the selection of elements based on attribute values. Unfortunately, I've not used them in years (mainly because they're not supported by all modern browsers). However, I remember distinctly that I was able to use them to adorn all external links wit...
I am trying to program a small server+client in Javascript on Firefox, using XPCOM. To get the HTTP message in Javascript, I am using the nsIScriptableInputStream interface. This f**ing component through the read() method randomly cut the message and I cannot make it reliable. Is anybody know a solution to get reliably...
It sounds like you're encountering issues with reading HTTP messages using `nsIScriptableInputStream` in your XPCOM-based server/client implementation in JavaScript for Firefox. The `read()` method can sometimes read partial messages, especially if the incoming data is larger than what can be handled in a single read o...
8,120
[ { "from": "human", "value": "I am trying to program a small server+client in Javascript on Firefox, using XPCOM.\nTo get the HTTP message in Javascript, I am using the nsIScriptableInputStream interface.\nThis f**ing component through the read() method randomly cut the message and I cannot make it reliable....
I am using VS2005 VC++ for unmanaged C++. I have VSTS and am trying to use the code coverage tool to accomplish two things with regards to unit tests: See how much of my referenced code under test is getting executed See how many methods of my code under test (if any) are not unit tested at all Setting up the VSTS co...
You're encountering a common issue when working with code coverage in C++ using Visual Studio. The C++ compiler's optimization techniques, especially when methods are not invoked, can lead to functions being eliminated from the compiled output, making it difficult to assess coverage accurately. Here are a few strategi...
8,401
[ { "from": "human", "value": "I am using VS2005 VC++ for unmanaged C++. I have VSTS and am trying to use the code coverage tool to accomplish two things with regards to unit tests:\n\nSee how much of my referenced code under test is getting executed\nSee how many methods of my code under test (if any) are no...
I've worked on a variety of systems as a programmer, some with Oracle, some with MySQL. I keep hearing people say that Oracle is more stable, more robust, and more secure. Is this the case? If so in what ways and why? For the purposes of this question, consider a small-medium sized production DB, perhaps 500,000 record...
The comparisons between Oracle Database and MySQL often center on several factors, including stability, robustness, and security. Whether one is "better" than the other can depend on the specific use case, workload, and requirements of the application. Here are some key considerations regarding each aspect you've menti...
7,900
[ { "from": "human", "value": "I've worked on a variety of systems as a programmer, some with Oracle, some with MySQL. I keep hearing people say that Oracle is more stable, more robust, and more secure. Is this the case?\nIf so in what ways and why?\nFor the purposes of this question, consider a small-medium ...
I've seen numerous people mentions that you shouldn't use widths and padding or margins on the same element with CSS. Why is that?
The advice to avoid using widths, padding, and margins on the same element in CSS is primarily related to how the box model works and the potential for unexpected layout behavior. Here's a breakdown of the reasons: 1. **Box Model**: In CSS, the box model defines how the size of elements is calculated. By default, an e...
7,326
[ { "from": "human", "value": "I've seen numerous people mentions that you shouldn't use widths and padding or margins on the same element with CSS. Why is that?\n" }, { "from": "gpt", "value": "The advice to avoid using widths, padding, and margins on the same element in CSS is primarily related ...
I created a C++ console app and just want to capture the cout/cerr statements in the Output Window within the Visual Studio 2005 IDE. I'm sure this is just a setting that I'm missing. Can anyone point me in the right direction?
To capture `cout` and `cerr` output in the Output Window of Visual Studio 2005, you'll need to ensure that the output is redirected to the Output Window instead of the console. By default, `cout` and `cerr` write to the console, but you can change this behavior using the Windows API. Here's a step-by-step guide on how...
8,333
[ { "from": "human", "value": "I created a C++ console app and just want to capture the cout/cerr statements in the Output Window within the Visual Studio 2005 IDE. I'm sure this is just a setting that I'm missing. Can anyone point me in the right direction?\n" }, { "from": "gpt", "value": "To cap...
I have a PS/2 touchpad which I would like to write a driver for (I'm just a web guy so this is unfamiliar territory to me). The touchpad comes with a Windows XP driver, which apparently sends messages to enable/disable tap-to-click. I'm trying to find out what message it is sending but I'm not sure how to start. Would ...
Writing a driver for a PS/2 touchpad can be a complex task, especially if you're not familiar with low-level programming and device communication. To intercept the messages sent to the PS/2 bus and understand how the existing driver works, you can use a few different approaches. ### Tools You Can Use 1. **Sniffing To...
6,803
[ { "from": "human", "value": "I have a PS/2 touchpad which I would like to write a driver for (I'm just a web guy so this is unfamiliar territory to me). The touchpad comes with a Windows XP driver, which apparently sends messages to enable/disable tap-to-click. I'm trying to find out what message it is send...
I am attempting to update a project from ASP.NET MVC Preview 3 to Preview 5 and it seems that Controller.ReadFromRequest(string key) has been removed from the Controller class. Does anyone know of any alternatives to retrieving information based on an identifier from a form?
In ASP.NET MVC, the method `Controller.ReadFromRequest(string key)` was indeed removed in later previews, including Preview 5. To retrieve information from form data in your controller, you can use the `Request.Form` collection directly or use model binding. Here are a couple of alternatives for accessing form data: ...
10,188
[ { "from": "human", "value": "I am attempting to update a project from ASP.NET MVC Preview 3 to Preview 5 and it seems that Controller.ReadFromRequest(string key) has been removed from the Controller class. Does anyone know of any alternatives to retrieving information based on an identifier from a form?\n" ...
Using the method Application.Restart() in C# should restart the current application: but it seems that this is not always working. Is there a reason for this Issue, can somebody tell me, why it doesn't work all the time?
The `Application.Restart()` method in C# is designed to restart the current application, but there are several reasons why it might not work as expected in certain scenarios. Here are some common factors that can cause issues with `Application.Restart()`: 1. **Threading Issues**: If `Application.Restart()` is called f...
8,732
[ { "from": "human", "value": "Using the method Application.Restart() in C# should restart the current application: but it seems that this is not always working.\nIs there a reason for this Issue, can somebody tell me, why it doesn't work all the time?\n" }, { "from": "gpt", "value": "The `Applica...
What is the difference between a pointer variable and a reference variable?
In programming, particularly in languages like C++ that support both pointers and references, there are distinct differences between pointer variables and reference variables. Here's a breakdown of the key differences: ### Pointer Variable 1. **Definition**: A pointer variable stores the memory address of another vari...
7,576
[ { "from": "human", "value": "What is the difference between a pointer variable and a reference variable?\n" }, { "from": "gpt", "value": "In programming, particularly in languages like C++ that support both pointers and references, there are distinct differences between pointer variables and ref...
I have the following enum declared: public enum TransactionTypeCode { Shipment = 'S', Receipt = 'R' } How do I get the value 'S' from a TransactionTypeCode.Shipment or 'R' from TransactionTypeCode.Receipt ? Simply doing TransactionTypeCode.ToString() gives a string of the Enum name "Shipment" or "Receipt" so it doesn...
In C#, enums are typically defined with integral values, and they cannot be assigned char values directly like in your example. To achieve the desired behavior where you want to get a character representation ('S' for `Shipment` and 'R' for `Receipt`), you can use a combination of an enum and a custom attribute or a se...
9,616
[ { "from": "human", "value": "I have the following enum declared:\n public enum TransactionTypeCode { Shipment = 'S', Receipt = 'R' }\n\nHow do I get the value 'S' from a TransactionTypeCode.Shipment or 'R' from TransactionTypeCode.Receipt ?\nSimply doing TransactionTypeCode.ToString() gives a string of the ...
If one were to use TiddlyWiki as a personal database for notes and code snippets, how would you go about keeping it in sync between multiple machines. Would a svn/cvs etc work. How would you handle merges?
Using TiddlyWiki as a personal database for notes and code snippets is a great choice due to its flexibility and ease of use. To keep it in sync between multiple machines, you have a few different options, each with its own pros and cons. Here are some methods you could consider: ### 1. **Using Git** **Pros:** - Git ...
3,854
[ { "from": "human", "value": "If one were to use TiddlyWiki as a personal database for notes and code snippets, how would you go about keeping it in sync between multiple machines. Would a svn/cvs etc work. How would you handle merges?\n" }, { "from": "gpt", "value": "Using TiddlyWiki as a person...
I have a free standing set of files not affiliated with any C# project at all that reside in a complicated nested directory structure. I want to add them in that format to a different directory in an ASP.NET web application I am working on; while retaining the same structure. So, I copied the folder into the target loc...
In Visual Studio 2008, adding an existing folder structure with files while maintaining the hierarchy can be a bit tricky because the "Add Existing Item" option does not preserve the original folder structure directly. However, you can achieve this by using a simple workaround. Here’s how you can do it: 1. **Copy the ...
8,904
[ { "from": "human", "value": "I have a free standing set of files not affiliated with any C# project at all that reside in a complicated nested directory structure.\nI want to add them in that format to a different directory in an ASP.NET web application I am working on; while retaining the same structure. S...
I'm having an issue with my regex. I want to capture <% some stuff %> and i need what's inside the <% and the %> This regex works quite well for that. $matches = preg_split("/<%[\s]*(.*?)[\s]*%>/i",$markup,-1,(PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE)); I also want to catch &amp;% some stuff %&amp;gt; so I n...
To create a regular expression that captures both `<% ... %>` and `&amp;lt;% ... %&amp;gt;` without disrupting the functionality of `preg_split`, you can adjust your regex pattern. Since `preg_split` will treat capturing groups differently, we can use a single regex pattern that matches both scenarios. You can use th...
8,965
[ { "from": "human", "value": "I'm having an issue with my regex.\nI want to capture <% some stuff %> and i need what's inside the <% and the %>\nThis regex works quite well for that.\n$matches = preg_split(\"/<%[\\s]*(.*?)[\\s]*%>/i\",$markup,-1,(PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE));\n\nI also ...
The pages in question contain a lot of javascript and CSS. How well are these supported by mobile platforms generally? Is there a browser emulator (or equivalent tool) to assist testing?
JavaScript and CSS are generally well-supported across most modern mobile platforms and browsers. However, the extent of support can vary based on the specific browser and its version. Here's an overview of their support: ### JavaScript Support - **Modern Browsers:** Most modern mobile browsers (like Chrome, Safari, F...
8,970
[ { "from": "human", "value": "The pages in question contain a lot of javascript and CSS. How well are these supported by mobile platforms generally?\nIs there a browser emulator (or equivalent tool) to assist testing?\n" }, { "from": "gpt", "value": "JavaScript and CSS are generally well-supporte...
Assuming network access is sporadic with no central server, what would be the best way to use git to keep three or more branches in sync? Is there a way to extract just my deltas, email those, and merge them on the other end?
Using Git in a scenario where network access is sporadic and there's no central server can be challenging, but it is possible to maintain multiple branches in sync with some manual intervention. Here’s an approach that you can follow to keep your branches in sync and share changes effectively: ### Overview of the Appr...
4,629
[ { "from": "human", "value": "Assuming network access is sporadic with no central server, what would be the best way to use git to keep three or more branches in sync? Is there a way to extract just my deltas, email those, and merge them on the other end?\n" }, { "from": "gpt", "value": "Using Gi...
I'm trying to implement some retry logic if there is an exception in my code. I've written the code and now I'm trying to get Rhino Mocks to simulate the scenario. The jist of the code is the following: class Program { static void Main(string[] args) { MockRepository repo = new MockRepos...
The issue you're encountering is due to the way the mocks are set up in Rhino Mocks. When you call `SetupResult.For(provider.Execute(23))`, you are setting up the expectation for a method call on the mock. The first setup throws an exception, and because it matches any call to `Provider.Execute(23)` due to `IgnoreArgum...
8,238
[ { "from": "human", "value": "I'm trying to implement some retry logic if there is an exception in my code. I've written the code and now I'm trying to get Rhino Mocks to simulate the scenario. The jist of the code is the following:\nclass Program\n {\n static void Main(string[] args)\n {\n ...
I have the following XAML: <TextBlock Text="{Binding ElementName=EditListBox, Path=SelectedItems.Count}" Margin="0,0,5,0"/> <TextBlock Text="items selected"> <TextBlock.Style> <Style TargetType="{x:Type TextBlock}"> <Style.Triggers> <DataTrigger Binding="{Binding ElementName=...
The issue you're encountering stems from how the `Text` property is set on the `TextBlock`. In your XAML, you're trying to change the `Text` property of the second `TextBlock` through a `DataTrigger`, but it seems that the `Setter` is not updating the `Text` property as expected. The `TextBlock` can be tricky when usi...
10,508
[ { "from": "human", "value": "I have the following XAML: \n<TextBlock Text=\"{Binding ElementName=EditListBox, Path=SelectedItems.Count}\" Margin=\"0,0,5,0\"/>\n<TextBlock Text=\"items selected\">\n <TextBlock.Style>\n <Style TargetType=\"{x:Type TextBlock}\">\n <Style.Triggers>\n ...
Which Visual Studio template should be used for a ASP.NET web site, the Web Site template or the Project | Web Application template?
When deciding between the **Web Site template** and the **Web Application template** in Visual Studio for creating an ASP.NET web application, the choice largely depends on your requirements and the nature of your project. Here’s a breakdown of each option: ### Web Application Template - **Project Structure**: This te...
10,291
[ { "from": "human", "value": "Which Visual Studio template should be used for a ASP.NET web site, the Web Site template or the Project | Web Application template?\n" }, { "from": "gpt", "value": "When deciding between the **Web Site template** and the **Web Application template** in Visual Studio...
I am developing a website that will manage data for multiple entities. No data is shared between entities, but they may be owned by the same customer. A customer may want to manage all their entities from a single "dashboard". So should I have one database for everything, or keep the data seperated into individual d...
Choosing the right database architecture for your website is a crucial decision that can significantly impact performance, maintenance, and development complexity. Below, I'll explore the pros and cons of each approach you've mentioned, and provide some guidance on best practices. ### 1. Single Database for Everything...
2,533
[ { "from": "human", "value": "I am developing a website that will manage data for multiple entities. No data is shared between entities, but they may be owned by the same customer. A customer may want to manage all their entities from a single \"dashboard\". So should I have one database for everything, o...
A product that I am working on collects several thousand readings a day and stores them as 64k binary files on a NTFS partition (Windows XP). After a year in production there is over 300000 files in a single directory and the number keeps growing. This has made accessing the parent/ancestor directories from windows e...
Managing a large number of files in a single directory on an NTFS partition can be quite challenging, especially with the limitations of older systems like Windows XP. Here are several suggestions to optimize your setup: 1. **Directory Structure**: - Instead of storing all files in a single directory, consider res...
9,406
[ { "from": "human", "value": "A product that I am working on collects several thousand readings a day and stores them as 64k binary files on a NTFS partition (Windows XP). After a year in production there is over 300000 files in a single directory and the number keeps growing. This has made accessing the p...
Is there an easy way to read an entire Access file (.mdb) into a DataSet in .NET (specifically C# or VB)? Or at least to get a list of tables from an access file so that I can loop through it and add them one at a time into a DataSet?
Yes, you can read an entire Access file (.mdb) into a DataSet in .NET, and you can also get a list of tables from the Access database. Below are steps and sample code in C# and VB.NET to accomplish both tasks. ### Step 1: Add Reference to `System.Data.OleDb` First, ensure you have a reference to `System.Data` in your...
5,851
[ { "from": "human", "value": "Is there an easy way to read an entire Access file (.mdb) into a DataSet in .NET (specifically C# or VB)?\nOr at least to get a list of tables from an access file so that I can loop through it and add them one at a time into a DataSet?\n" }, { "from": "gpt", "value":...
I have been working on some legacy C++ code that uses variable length structures (TAPI), where the structure size will depend on variable length strings. The structures are allocated by casting array new thus: STRUCT* pStruct = (STRUCT*)new BYTE[sizeof(STRUCT) + nPaddingSize]; Later on however the memory is freed usin...
Yes, using `new[]` to allocate memory and `delete` to free it is incorrect in C++, and it can lead to undefined behavior, including potential memory leaks or crashes. The `new` and `delete` operators are used for single object allocation and deallocation, while `new[]` and `delete[]` are for array allocation and deallo...
8,206
[ { "from": "human", "value": "I have been working on some legacy C++ code that uses variable length structures (TAPI), where the structure size will depend on variable length strings. The structures are allocated by casting array new thus:\nSTRUCT* pStruct = (STRUCT*)new BYTE[sizeof(STRUCT) + nPaddingSize];\...
What is the difference between the AddRange and Concat functions on a generic List? Is one recommended over the other?
`AddRange` and `Concat` are both methods that can be used to combine collections in C#, but they are used in different contexts and have different purposes when it comes to `List<T>`. ### `AddRange` - **Usage**: `AddRange` is a method of the `List<T>` class in C#. It is used to add all the elements of a specified col...
7,788
[ { "from": "human", "value": "What is the difference between the AddRange and Concat functions on a generic List? Is one recommended over the other?\n" }, { "from": "gpt", "value": "`AddRange` and `Concat` are both methods that can be used to combine collections in C#, but they are used in differ...
I have a link on a long HTML page. When I click it, I wish a div on another part of the page to be visible in the window by scrolling into view. A bit like EnsureVisible in other languages. I've checked out scrollTop and scrollTo but they seem like red herrings. Can anyone help?
Certainly! To scroll a specific `div` into view when a link is clicked, you can use JavaScript to handle the click event and use the `scrollIntoView()` method. This method will scroll the page to make the specified element visible in the viewport. Here’s an example of how to set this up: ### HTML Structure Assuming ...
7,800
[ { "from": "human", "value": "I have a link on a long HTML page. When I click it, I wish a div on another part of the page to be visible in the window by scrolling into view.\nA bit like EnsureVisible in other languages.\nI've checked out scrollTop and scrollTo but they seem like red herrings.\nCan anyone h...
In a SharePoint list I want an auto number column that as I add to the list gets incremented. How best can I go about this?
In SharePoint, you cannot directly create an auto-incrementing number column like you might in a traditional database. However, you can achieve similar functionality using a few different methods. Here are some common approaches: ### 1. **Using Power Automate (Flow)** You can create a Power Automate flow that trigger...
6,850
[ { "from": "human", "value": "In a SharePoint list I want an auto number column that as I add to the list gets incremented. How best can I go about this?\n" }, { "from": "gpt", "value": "In SharePoint, you cannot directly create an auto-incrementing number column like you might in a traditional d...
I'm working with the SerialPort class in the Compact Framework, but I can't recive more than 2047 bytes. Exists any limit for the amount of bytes that I can recive? or How can I setup the object? I was trying with the WriteBufferSize and ReadBufferSize properties but they didn't work.
In the .NET Compact Framework, the `SerialPort` class has certain limitations, and it sounds like you're encountering a restriction on the amount of data you can receive. ### Understanding the Limits 1. **Receive Buffer Size**: The default receive buffer size in the Compact Framework may limit you to a certain number...
7,822
[ { "from": "human", "value": "I'm working with the SerialPort class in the Compact Framework, but I can't recive more than 2047 bytes. Exists any limit for the amount of bytes that I can recive? or How can I setup the object? I was trying with the WriteBufferSize and ReadBufferSize properties but they didn't...
So I have a "large" number of "very large" ASCII files of numerical data (gigabytes altogether), and my program will need to process the entirety of it sequentially at least once. Any advice on storing/loading the data? I've thought of converting the files to binary to make them smaller and for faster loading. Should ...
When dealing with large ASCII files containing numerical data, you have several considerations for efficient storage, loading, and processing. Here are some strategies and tips that may help: ### 1. **Convert to Binary Format** Converting your ASCII files to a binary format is often a good idea for both storage size a...
6,108
[ { "from": "human", "value": "So I have a \"large\" number of \"very large\" ASCII files of numerical data (gigabytes altogether), and my program will need to process the entirety of it sequentially at least once.\nAny advice on storing/loading the data? I've thought of converting the files to binary to mak...
Sight is one of the senses most programmers take for granted. Most programmers would spend hours looking at a computer monitor (especially during times when they are in the zone), but I know there are blind programmers (such as T.V. Raman who currently works for Google). If you were a blind person (or slowly becoming b...
I would use a powerful screen reader that is well-integrated with my development tools, such as JAWS or NVDA. A good screen reader can provide auditory feedback for code structure, errors, and navigation, allowing me to effectively interact with my code and development environment. It's essential to ensure that the scr...
13,066
[ { "from": "human", "value": "Sight is one of the senses most programmers take for granted. Most programmers would spend hours looking at a computer monitor (especially during times when they are in the zone), but I know there are blind programmers (such as T.V. Raman who currently works for Google).\nIf you...
I have quite a big solution here with a lot of different web applications and sites, around 10-15 of them. When I attach VS2008 to any process (most likely Nunit.exe or something similar) I get one Cassini process per website/application in the solution. Is there a quick way to get rid of this behaviour in VS or do I ...
When you attach Visual Studio 2008 to a process, it can start multiple instances of the Cassini web server (the ASP.NET Development Server) for each web application in your solution. This behavior is often due to the way Visual Studio handles projects in solutions, especially when they are set up to use Cassini for deb...
10,085
[ { "from": "human", "value": "I have quite a big solution here with a lot of different web applications and sites, around 10-15 of them. \nWhen I attach VS2008 to any process (most likely Nunit.exe or something similar) I get one Cassini process per website/application in the solution. Is there a quick way t...
I got a little curious after reading this /. article over hijacking HTTPS cookies. I tracked it down a bit, and a good resource I stumbled across lists a few ways to secure cookies here. Must I use adsutil, or will setting requireSSL in the httpCookies section of web.config cover session cookies in addition to all othe...
To secure your cookies, particularly with respect to session cookies, you're correct to consider settings like `requireSSL` in the `httpCookies` section of your `web.config`. Setting `requireSSL="true"` ensures that cookies are only sent over HTTPS connections, which mitigates the risk of them being intercepted by atta...
7,493
[ { "from": "human", "value": "I got a little curious after reading this /. article over hijacking HTTPS cookies. I tracked it down a bit, and a good resource I stumbled across lists a few ways to secure cookies here. Must I use adsutil, or will setting requireSSL in the httpCookies section of web.config cove...
I am the maintainer of a site that has allegedly 'lost' the source code to a flash swf file. How do I decompile this source? Are there any programs online or offline that I could use?
Decompiling a Flash SWF file to recover its source code can be done using several tools, although the effectiveness of decompilation can vary depending on the complexity of the original file and how it was compiled. Here are some options you can consider for decompiling SWF files: ### Offline Tools 1. **JPEXS Free Fl...
8,841
[ { "from": "human", "value": "I am the maintainer of a site that has allegedly 'lost' the source code to a flash swf file. How do I decompile this source?\nAre there any programs online or offline that I could use?\n" }, { "from": "gpt", "value": "Decompiling a Flash SWF file to recover its sour...
I have a public facing application deployed with Flex. I want to switch to using the cached framework (.swz) but need to know if for my user base this is an effective solution or not (most users will only visit the site once and its just not worth it). What I want to do is track whether or not a user has loaded the .sw...
To effectively determine whether users are loading the `.swz` or `.swf` files during their session, you can consider implementing client-side tracking along with some server-side analytics. Here are a few approaches to gather the data you need without overly complicating your setup: ### 1. Client-Side Tracking Using A...
7,436
[ { "from": "human", "value": "I have a public facing application deployed with Flex. I want to switch to using the cached framework (.swz) but need to know if for my user base this is an effective solution or not (most users will only visit the site once and its just not worth it).\nWhat I want to do is trac...
Our EPOS system copies data by compressing the database into a zip file, and manually copying to each till, using shared directories. Each branched is liked to the main location, using VPN which can be problematic, but is required for the file sharing to work correctly. Since our database system currently does not sup...
Your current approach using a zip file for database updates can indeed be cumbersome, especially with potential issues stemming from the VPN connections and manual processes. Here are a few alternative solutions to consider, as well as recommendations for migration based on your needs: ### Alternative Solutions 1. **...
6,401
[ { "from": "human", "value": "Our EPOS system copies data by compressing the database into a zip file, and manually copying to each till, using shared directories. \nEach branched is liked to the main location, using VPN which can be problematic, but is required for the file sharing to work correctly.\nSince...
In my .NET/Forms app I have a DataGridView which is bound to a DataTable. The user selects a row of the DataGridView by double-clicking and does some interaction with the app. After that the content of the row is updated programmatically. When the user selects a new row the changes on the previous one are automagically...
To trigger the update of the DataGridView's bound DataTable without requiring the user to select a new row, you can manually call the `EndEdit` method on the `DataGridView`'s current cell. This will commit any changes made to the currently selected row. Here's how you can do it: 1. First, ensure that you are modifying...
7,495
[ { "from": "human", "value": "In my .NET/Forms app I have a DataGridView which is bound to a DataTable. The user selects a row of the DataGridView by double-clicking and does some interaction with the app. After that the content of the row is updated programmatically.\nWhen the user selects a new row the cha...
I'm looking for a good, clean way to go around the fact that PHP5 still doesn't support multiple inheritance. Here's the class hierarchy: Message -- TextMessage -------- InvitationTextMessage -- EmailMessage -------- InvitationEmailMessage The two types of Invitation* classes have a lot in common; i'd lov...
In PHP, since multiple inheritance is not supported, a common approach to handle scenarios where multiple classes have overlapping behavior or properties is to use interfaces and traits. Both of these allow you to share functionality across classes without requiring a strict hierarchical relationship. Here's how you ca...
9,775
[ { "from": "human", "value": "I'm looking for a good, clean way to go around the fact that PHP5 still doesn't support multiple inheritance. Here's the class hierarchy:\nMessage\n -- TextMessage\n -------- InvitationTextMessage\n -- EmailMessage\n -------- InvitationEmailMessage \nThe two types of In...
I have multiple users running attachemate on a Windows 2003 server. I want to kill attachemate.exe started by user_1 without killing attachemate.exe started by user_2. I want to use VBScript.
You can use VBScript to kill a specific instance of a process running under a particular user. However, VBScript does not natively have the ability to interact with other user sessions, which can make this a bit tricky. Below is a script that can be used to identify and terminate the `attachemate.exe` process belongi...
8,725
[ { "from": "human", "value": "I have multiple users running attachemate on a Windows 2003 server. I want to kill attachemate.exe started by user_1 without killing attachemate.exe started by user_2.\nI want to use VBScript.\n" }, { "from": "gpt", "value": "You can use VBScript to kill a specific ...
I am using setInterval(fname, 10000); to call a function every 10 seconds in JavaScript. Is it possible to stop calling it on some event? I want the user to be able to stop the repeated refresh of data.
Yes, you can stop a function from being called repeatedly using `setInterval` by using `clearInterval`. When you set an interval, `setInterval` returns an interval ID that you can use to clear the interval later. You can call `clearInterval` on that ID to stop the repeated execution of the function. Here’s a simple ex...
10,488
[ { "from": "human", "value": "I am using setInterval(fname, 10000); to call a function every 10 seconds in JavaScript. Is it possible to stop calling it on some event? \nI want the user to be able to stop the repeated refresh of data.\n" }, { "from": "gpt", "value": "Yes, you can stop a function ...
I have a wildcard subdomain enabled and dynamically parse the URL by passing it as-is to my index.php (ex. somecity.domain.com). Now, I wish to create a few subdomains that are static where I can install different application and not co-mingle with my current one (ex. blog.domain.com). My .htaccess currently reads: R...
Yes, you can modify your `.htaccess` file to accommodate both wildcard subdomains that pass URLs to your `index.php` file and static subdomains that can serve their own applications. You can achieve this by adding conditions to your rewrite rules. Here's how you can modify your `.htaccess` to include exceptions for yo...
7,942
[ { "from": "human", "value": "I have a wildcard subdomain enabled and dynamically parse the URL by passing it as-is to my index.php (ex. somecity.domain.com). \nNow, I wish to create a few subdomains that are static where I can install different application and not co-mingle with my current one (ex. blog.do...
I'm trying to keep dependencies to a minimum for a program I contribute to, it's a small text editor. GTK Textview doesn't seem to come with a built-in undo function. Is there any reference implementation I've been missing on so far? Is everyone writing their own undo function for their TextView widgets? I'll be happy ...
You're right that GTK's `TextView` does not come with a built-in undo functionality out of the box. While you can implement your own undo functionality using the `TextBuffer`, many developers prefer to create their own implementation based on the specifics of their applications. Here's a basic example of how you might...
8,343
[ { "from": "human", "value": "I'm trying to keep dependencies to a minimum for a program I contribute to, it's a small text editor.\nGTK Textview doesn't seem to come with a built-in undo function. Is there any reference implementation I've been missing on so far? Is everyone writing their own undo function ...
I am searching for a host for a new commercial website. Among other things, I'd like to know what the various OS - Webserver combinations have in terms of vulnerabilities. What are the vulnerabilities of Windows 2003 + Apache?
Windows Server 2003 and Apache can pose several vulnerabilities, primarily due to the end-of-life status of Windows Server 2003 and potential misconfigurations. Here’s a breakdown of the vulnerabilities associated with this combination: ### 1. End-of-Life Support: - **No Security Updates:** Windows Server 2003 reached...
7,927
[ { "from": "human", "value": "I am searching for a host for a new commercial website. Among other things, I'd like to know what the various OS - Webserver combinations have in terms of vulnerabilities. What are the vulnerabilities of Windows 2003 + Apache?\n" }, { "from": "gpt", "value": "Windows...
I'm using VS2005 in a solution with a mix of VB and C# in different projects. I use this solution on several different computers and XML comments with both /// (c#) and ''' (VB) have been fine for months. all of a sudden, on my main development machine, they've stopped working in VB. They still work in C#. They work in...
It sounds like you're experiencing an issue with XML comments in VB.NET specifically for one solution in Visual Studio 2005. Here are a few steps you can try to troubleshoot and potentially resolve the problem: 1. **Check Project Properties**: - Right-click on your VB project in the Solution Explorer and select **P...
9,850
[ { "from": "human", "value": "I'm using VS2005 in a solution with a mix of VB and C# in different projects.\nI use this solution on several different computers and XML comments with both /// (c#) and ''' (VB) have been fine for months.\nall of a sudden, on my main development machine, they've stopped working...
What experience have you had with introducing a Ribbon style control to legacy MFC applications? I know it exists in the new VC2008 Feature Pack, but changing compilers from VC2005 is a big deal for our source base and integration to our environment, Intel FORTRAN, ClearCase, many 3rd libraries. There are quiet a few ...
Introducing a Ribbon style control into legacy MFC applications can indeed be a challenging task, especially when you are dealing with older environments like VC2005, as well as integration with additional tools like Intel Fortran and ClearCase. ### Experience with Ribbon Controls in Legacy MFC Applications 1. **Tran...
8,499
[ { "from": "human", "value": "What experience have you had with introducing a Ribbon style control to legacy MFC applications? \nI know it exists in the new VC2008 Feature Pack, but changing compilers from VC2005 is a big deal for our source base and integration to our environment, Intel FORTRAN, ClearCase, ...
I'm getting near completely different objects from the same WSDL file when I try to Add a Web Reference depending if I am using Express or Pro version of the vs2008 .NET IDE. 1) Why is this happening? I'd expect the WSDL's to act the same across platforms--clearly they are not! 2) How do I determine what tool/wizard th...
The differences you're observing when adding a Web Reference in Visual Studio 2008 (both Express and Pro versions) can be attributed to a couple of factors, particularly related to how each version of Visual Studio handles WSDL processing, and the default settings for the tooling used under the hood. ### 1) Why is thi...
8,170
[ { "from": "human", "value": "I'm getting near completely different objects from the same WSDL file when I try to Add a Web Reference depending if I am using Express or Pro version of the vs2008 .NET IDE.\n1) Why is this happening? I'd expect the WSDL's to act the same across platforms--clearly they are not!...
I want to do the following imports in a class. import org.eclipse.jdt.core.dom.*; import org.eclipse.jdt.core.compiler.CharOperation; import org.eclipse.jdt.core.compiler.IProblem; import org.eclipse.jdt.internal.compiler.ClassFile; import org.eclipse.jdt.internal.compiler.CompilationResult; import org.eclips...
To use the Java Development Tools (JDT) libraries in your Eclipse project, you'll need to include the necessary JDT JAR files in your project's build path. Here's a step-by-step guide on how to do this: ### Step 1: Create a New Java Project (if you haven't already) 1. Open Eclipse. 2. Go to `File` > `New` > `Java Proj...
8,943
[ { "from": "human", "value": "I want to do the following imports in a class.\nimport org.eclipse.jdt.core.dom.*; \nimport org.eclipse.jdt.core.compiler.CharOperation; \nimport org.eclipse.jdt.core.compiler.IProblem; \nimport org.eclipse.jdt.internal.compiler.ClassFile; \nimport org.eclipse.jdt.internal.c...
I have a start of a webapp that I wrote without using the Object Oriented features of PHP. I don't really know if it is worth it to go back and rewrite the parts I have finished. Is object oriented PHP worth rewriting all or part of a decent working app?
Deciding whether to refactor your existing PHP web application to use Object-Oriented Programming (OOP) principles is a common dilemma for developers. Here are some considerations to help you make that decision: ### Benefits of Using OOP in PHP: 1. **Organization**: OOP allows you to organize your code better by grou...
8,209
[ { "from": "human", "value": "I have a start of a webapp that I wrote without using the Object Oriented features of PHP.\nI don't really know if it is worth it to go back and rewrite the parts I have finished. Is object oriented PHP worth rewriting all or part of a decent working app?\n" }, { "from":...
I would like to do the equivalent of: object result = Eval("1 + 3"); string now = Eval("System.DateTime.Now().ToString()") as string Following Biri s link, I got this snippet (modified to remove obsolete method ICodeCompiler.CreateCompiler(): private object Eval(string sExpression) { CSharpCodeProvider c = new ...
Your code snippet for evaluating C# expressions at runtime is almost complete. However, there are a few improvements and considerations that you should take into account. 1. **Security Risks**: Evaluating code dynamically can lead to serious security vulnerabilities, especially if you're executing user-provided expres...
5,747
[ { "from": "human", "value": "I would like to do the equivalent of:\nobject result = Eval(\"1 + 3\");\nstring now = Eval(\"System.DateTime.Now().ToString()\") as string\n\nFollowing Biri s link, I got this snippet (modified to remove obsolete method ICodeCompiler.CreateCompiler():\nprivate object Eval(str...
What’s the difference between Response.Write() and Response.Output.Write()?
In ASP.NET, both `Response.Write()` and `Response.Output.Write()` are used to send output to the response stream, but they have some differences in terms of functionality and usage. ### `Response.Write()` - **Usage**: This method is a straightforward way to write a string to the response output. - **Simplicity**: It ...
11,453
[ { "from": "human", "value": "What’s the difference between Response.Write() and Response.Output.Write()? \n" }, { "from": "gpt", "value": "In ASP.NET, both `Response.Write()` and `Response.Output.Write()` are used to send output to the response stream, but they have some differences in terms of ...
Does anyone have any experience with how well web services build with Microsoft's WCF will scale to a large number of users? The level I'm thinking of is in the region of 1000+ client users connecting to a collection of WCF services providing the business logic for our application, and these talking to a database - sim...
When considering the scalability of WCF (Windows Communication Foundation) services, there are several factors and best practices to keep in mind to ensure that your application can handle a large number of concurrent users efficiently. Here are some key considerations, lessons learned, and potential gotchas: ### Scal...
7,698
[ { "from": "human", "value": "Does anyone have any experience with how well web services build with Microsoft's WCF will scale to a large number of users?\nThe level I'm thinking of is in the region of 1000+ client users connecting to a collection of WCF services providing the business logic for our applicat...
Has anyone considered using something along the lines of the Amazon SimpleDB data store as their backend database? SQL Server hosting (at least in the UK) is expensive so could something like this along with cloud file storage (S3) be used for building apps that could grow with your application. Great in theory but wou...
Yes, many developers and companies have indeed considered using Amazon SimpleDB, along with other cloud services like S3, as part of their backend architecture for applications. While Amazon SimpleDB itself is not as widely adopted as some other NoSQL solutions (like DynamoDB, MongoDB, or Firebase), it does serve speci...
7,392
[ { "from": "human", "value": "Has anyone considered using something along the lines of the Amazon SimpleDB data store as their backend database?\nSQL Server hosting (at least in the UK) is expensive so could something like this along with cloud file storage (S3) be used for building apps that could grow with...
In C# you can get the original error and trace the execution path (stack trace) using the inner exception that is passed up. I would like to know how this can be achieved using the error handling try/catch in sql server 2005 when an error occurs in a stored procedure nested 2 or 3 levels deep. I am hoping that funct...
In SQL Server, particularly in versions like SQL Server 2005, you can manage error handling and propagate error information from nested stored procedures back to a top-level procedure. While SQL Server doesn't have an exact equivalent of C# exceptions and inner exceptions, you can use the `TRY...CATCH` construct along ...
6,703
[ { "from": "human", "value": "In C# you can get the original error and trace the execution path (stack trace) using the inner exception that is passed up. I would like to know how this can be achieved using the error handling try/catch in sql server 2005 when an error occurs in a stored procedure nested 2 o...
I want to start developing for Windows Mobile Devices, as I plan to buy one next week. (pay day) So far most of my PDA experience is with Palm OS (m100, m105, Zire 71 and T3). For Palm there are a few good utilities for programming, mainly PocketC and OnboardC. These let you program and test on the road. I would use Po...
If you're looking to develop for Windows Mobile devices and want something similar to PocketC for on-device development, your options are somewhat limited, especially considering your preference for C or C++. While you mentioned that you're aware of PocketC CE and PythonCE, here are a few alternatives you might conside...
9,135
[ { "from": "human", "value": "I want to start developing for Windows Mobile Devices, as I plan to buy one next week. (pay day)\nSo far most of my PDA experience is with Palm OS (m100, m105, Zire 71 and T3). For Palm there are a few good utilities for programming, mainly PocketC and OnboardC. These let you pr...
I'm troubleshooting a problem with creating Vista shortcuts. I want to make sure that our Installer is reading the Programs folder from the right registry key. It's reading it from: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\Programs And it's showing this directory for Programs:...
Yes, the registry path you mentioned is indeed correct for accessing the Programs folder for the current user in Windows Vista. In Windows Vista and later versions, the path to the user-specific Start Menu Programs folder is stored in: ``` HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Fo...
9,369
[ { "from": "human", "value": "I'm troubleshooting a problem with creating Vista shortcuts.\nI want to make sure that our Installer is reading the Programs folder from the right registry key.\nIt's reading it from:\nHKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders\\Prog...
Need some advice on working out the team velocity for a sprint. Our team normally consists of about 4 developers and 2 testers. The scrum master insists that every team member should contribute equally to the velocity calculation i.e. we should not distinguish between developers and testers when working out how much we...
In situations like yours, where there is a clear distinction between the roles of developers and testers, and the team is not fully cross-functional, it's essential to adjust your approach to velocity calculation and sprint planning to reflect your team's actual capacity and dynamics. Here are some suggestions: 1. **R...
6,059
[ { "from": "human", "value": "Need some advice on working out the team velocity for a sprint.\nOur team normally consists of about 4 developers and 2 testers. The scrum master insists that every team member should contribute equally to the velocity calculation i.e. we should not distinguish between developer...