instruction
stringlengths
14
27.6k
completion
stringlengths
3
38.3k
__original_row_idx
int64
0
50k
conversations
listlengths
2
2
I am creating an ASP script that uses the application object to store the pages. The question in my mind is whether there is a size limit to this object. Anyone know?
In ASP (Active Server Pages), the Application object is designed to store data that you want to be accessible across all sessions and users of your web application. While there isn't an explicit size limit defined for the Application object itself, there are some practical considerations you should keep in mind: 1. **...
27,194
[ { "from": "human", "value": "I am creating an ASP script that uses the application object to store the pages. The question in my mind is whether there is a size limit to this object. Anyone know?\n" }, { "from": "gpt", "value": "In ASP (Active Server Pages), the Application object is designed to...
I'm finally getting my team to embrace source code management now that we're working on projects where more than one dev is touching the same codebase, and I setup a free/trial account on Beanstalk for hosted Subversion so people could get a taste of how it works. That said, we've discussed a somewhat ambitious plan to...
Setting up a temporary SVN server with a user-friendly web interface is a great idea to get your team comfortable with source code management while you plan for a more robust solution. Here are some F/OSS (Free and Open Source Software) packages that provide web interfaces for Subversion and are suitable for your needs...
20,641
[ { "from": "human", "value": "I'm finally getting my team to embrace source code management now that we're working on projects where more than one dev is touching the same codebase, and I setup a free/trial account on Beanstalk for hosted Subversion so people could get a taste of how it works.\nThat said, we...
I'm a fan of extension methods in C#, but haven't had any success adding an extension method to a static class, such as Console. For example, if I want to add an extension to Console, called 'WriteBlueLine', so that I can go: Console.WriteBlueLine("This text is blue"); I tried this by adding a local, public static met...
In C#, extension methods can only be added to instance types or interfaces, not to static classes or types like `Console`. The `Console` class is static, meaning you cannot create an instance of it, and extension methods require an instance (or an instance-like context) to be invoked. However, you can still create a s...
26,339
[ { "from": "human", "value": "I'm a fan of extension methods in C#, but haven't had any success adding an extension method to a static class, such as Console.\nFor example, if I want to add an extension to Console, called 'WriteBlueLine', so that I can go:\nConsole.WriteBlueLine(\"This text is blue\");\n\nI ...
I have a PHP/AJAX/MYSQL chat application. I want to add video chatting to my application. How can I create live video streaming to be used for live video conferences/chatting in a PHP application. What are the key-terms I need to know if I wanted to build such a system? Is it a good idea in the first place to use PHP? ...
Building a live video chatting system in your existing PHP/AJAX/MySQL chat application is definitely possible, but there are some considerations and technologies that you'll need to explore. Here’s a detailed overview of the steps involved, key terms, and technologies you might want to use. ### Key Terms to Know: 1. *...
24,529
[ { "from": "human", "value": "I have a PHP/AJAX/MYSQL chat application. I want to add video chatting to my application. How can I create live video streaming to be used for live video conferences/chatting in a PHP application. What are the key-terms I need to know if I wanted to build such a system? Is it a ...
Ok, I love Resharper and its addins, but even the best of fanbois have to admit that its API documentation is suboptimal. I'd like to build an addin myself (based on the Agent Johnson plugin). Thankfully that plugin works in 4.0, so I can use it as a starting point for my own work. My question: how do I run and debug t...
When developing and debugging a ReSharper add-in, the process can indeed be a bit convoluted due to the way ReSharper integrates with Visual Studio. Here's a step-by-step guide to set up your environment for debugging your ReSharper add-in based on the Agent Johnson plugin: ### Step 1: Set Up Your Project 1. **Create...
21,251
[ { "from": "human", "value": "Ok, I love Resharper and its addins, but even the best of fanbois have to admit that its API documentation is suboptimal. I'd like to build an addin myself (based on the Agent Johnson plugin). Thankfully that plugin works in 4.0, so I can use it as a starting point for my own wo...
Is there any way to remove “save target as” from internet explorer’s right-click menu by using group policies or registry hacks? Failing that is there a simple programmatic way?
Removing the "Save Target As" option from the right-click context menu in Internet Explorer can be approached through Group Policy or registry modifications, but it's important to note that directly targeting specific context menu options may not be straightforward or even fully possible due to the way the context menu...
19,459
[ { "from": "human", "value": "Is there any way to remove “save target as” from internet explorer’s right-click menu by using group policies or registry hacks? Failing that is there a simple programmatic way?\n" }, { "from": "gpt", "value": "Removing the \"Save Target As\" option from the right-cl...
Anyone got an idea how to get from an Xserver the list of all open windows?
To get a list of all open windows in an X server, you can use a few different methods. Here are some common approaches: ### Using `xwininfo` 1. **Install xorg-utils (if not already installed)**: If `xwininfo` is not installed, you can install it using your package manager. For example, on Debian/Ubuntu, you can ru...
26,823
[ { "from": "human", "value": "Anyone got an idea how to get from an Xserver the list of all open windows?\n" }, { "from": "gpt", "value": "To get a list of all open windows in an X server, you can use a few different methods. Here are some common approaches:\n\n### Using `xwininfo`\n\n1. **Instal...
I'm setting the cookie expiration using the following code: // remove existing cookies. request.Cookies.Clear(); response.Cookies.Clear(); // ... serialize and encrypt my data ... // now set the cookie. HttpCookie cookie = new HttpCookie(AuthCookieName, encrypted); cookie.Expires = DateTime.Now.Add(TimeSpan.FromHour...
Your understanding is correct. In ASP.NET, when you create a cookie and set its expiration using the `Expires` property, the expiration date is relevant only to the server-side processing of the response. When the browser receives the cookie, it will handle the expiration according to its own clock, and the server cann...
20,451
[ { "from": "human", "value": "I'm setting the cookie expiration using the following code:\n\n// remove existing cookies.\nrequest.Cookies.Clear();\nresponse.Cookies.Clear();\n\n// ... serialize and encrypt my data ...\n\n// now set the cookie.\nHttpCookie cookie = new HttpCookie(AuthCookieName, encrypted);\n...
I want to add gmail-like file upload functionality for one of my projects. Can anybody help me with this? My application is built in vb.net. I would appreciate any kind of help or guidance. Thanks
Certainly! To implement Gmail-like file upload functionality in your VB.NET application, you can follow the steps below. This will include both front-end and back-end components. ### 1. Front-End (HTML/JavaScript) First, you need to create a user interface where users can select files for upload. You can use HTML and...
21,933
[ { "from": "human", "value": "I want to add gmail-like file upload functionality for one of my projects. Can anybody help me with this?\nMy application is built in vb.net.\nI would appreciate any kind of help or guidance.\nThanks\n" }, { "from": "gpt", "value": "Certainly! To implement Gmail-like...
Can VBA code instantiate and use .NET objects? The specific class I'm interested in is System.IO.Compression.GZipStream. For Info GAC is the .NET Global Assembly Cache
Yes, VBA (Visual Basic for Applications) can instantiate and use .NET objects, including classes from the .NET Framework like `System.IO.Compression.GZipStream`, but there are specific steps you need to follow to do this. Since `GZipStream` is part of the .NET Framework, you will need to expose it through a COM-visible...
20,109
[ { "from": "human", "value": "Can VBA code instantiate and use .NET objects? The specific class I'm interested in is System.IO.Compression.GZipStream.\nFor Info GAC is the .NET Global Assembly Cache\n" }, { "from": "gpt", "value": "Yes, VBA (Visual Basic for Applications) can instantiate and use ...
I've been assigned the task of buying a digital certificate for my company to sign our code. We develop applications in the Microsoft space - mostly WPF or Web Based. I've investigated options and found Comodo to be well priced and responsive, and we're ready to go ahead and purchase a cert through them.. however in th...
Hi Greg, When purchasing a digital certificate for signing your code, it's important to understand the options presented during the signup process. Here's a breakdown of the options you mentioned: ### Private Key Options 1. **CSP (Cryptographic Service Provider)** - **Microsoft Base Cryptographic Provider:** This...
25,845
[ { "from": "human", "value": "I've been assigned the task of buying a digital certificate for my company to sign our code. We develop applications in the Microsoft space - mostly WPF or Web Based.\nI've investigated options and found Comodo to be well priced and responsive, and we're ready to go ahead and pu...
Please anybody can tell me the questions, that can be asked in an interview for below topics Socket Programming Multi-Threading An advance thanks goes to everybody who provide their time
Certainly! Here are some potential interview questions for the topics of socket programming and multi-threading. ### Socket Programming Interview Questions 1. **Basic Concepts:** - What is socket programming? - Explain the difference between TCP and UDP. - How do you create a socket in your preferred progra...
24,371
[ { "from": "human", "value": "Please anybody can tell me the questions, that can be asked in an interview for below topics\n\nSocket Programming\nMulti-Threading\n\nAn advance thanks goes to everybody who provide their time\n" }, { "from": "gpt", "value": "Certainly! Here are some potential inter...
I have the following struct in C++: #define MAXCHARS 15 typedef struct { char data[MAXCHARS]; int prob[MAXCHARS]; } LPRData; And a function that I'm p/invoking into to get an array of 3 of these structures: void GetData(LPRData *data); In C++ I would just do something like this: LPRData *Results; Results = ...
In order to pass the `LPRData` structure from C# to C++ and retrieve the modified data correctly, you need to ensure that you are correctly marshaling both the structures and the arrays. ### Updated C# Struct Definition Firstly, it seems like the `prob` array is not initialized correctly. Instead of using a `string`...
16,789
[ { "from": "human", "value": "I have the following struct in C++:\n#define MAXCHARS 15\n\ntypedef struct \n{\n char data[MAXCHARS];\n int prob[MAXCHARS];\n} LPRData;\n\nAnd a function that I'm p/invoking into to get an array of 3 of these structures:\nvoid GetData(LPRData *data);\n\nIn C++ I would just...
We will need to call out to a 3rd party to retrieve a value using REST, however if we do not receive a response within 10ms, I want to use a default value and continue processing. I'm leaning towards using an asynchronous WebRequest do to this, but I was wondering if there was a trick to doing it using a synchronous re...
Using a synchronous request with a hard timeout can be tricky, especially when you want to implement a fallback mechanism if the request takes too long. However, it's generally not advisable to block a thread while waiting for a response, especially if you have a tight time constraint like 10ms. Here's a breakdown of...
20,733
[ { "from": "human", "value": "We will need to call out to a 3rd party to retrieve a value using REST, however if we do not receive a response within 10ms, I want to use a default value and continue processing.\nI'm leaning towards using an asynchronous WebRequest do to this, but I was wondering if there was ...
I know it's bad to use HTML Tables for everything... and that tables should be used only to present tabular data and not to achieve some style goal. My question is, how do you make HTML forms with CSS so they look nice and aligned like when using tables?
Absolutely, you're right that HTML tables should be used solely for tabular data. Instead, you can use CSS for styling forms to achieve a well-aligned and visually appealing layout. Here’s a basic example of how to create a form with CSS that looks nice and is well-aligned without using tables. ### HTML Structure Her...
22,220
[ { "from": "human", "value": "I know it's bad to use HTML Tables for everything... and that tables should be used only to present tabular data and not to achieve some style goal. \nMy question is, how do you make HTML forms with CSS so they look nice and aligned like when using tables?\n" }, { "from"...
What alternatives do I have to implement a union query using hibernate? I know hibernate does not support union queries at the moment, right now the only way I see to make a union is to use a view table. The other option is to use plain jdbc, but this way I would loose all my example/criteria queries goodies, as well a...
You're correct that Hibernate does not support UNION queries directly. However, there are several alternatives you can consider for implementing a UNION-like functionality within Hibernate or by integrating it with other technologies: 1. **Native SQL Queries**: While you want to avoid plain JDBC, using Hibernate's ...
21,722
[ { "from": "human", "value": "What alternatives do I have to implement a union query using hibernate? I know hibernate does not support union queries at the moment, right now the only way I see to make a union is to use a view table.\nThe other option is to use plain jdbc, but this way I would loose all my e...
I have log4net running on my AsP.NET site. I'm able to log messages to my DB Table, but it isn't logging the ThreadContext properties. For example: ThreadContext.Properties["Url"] = HttpContext.Current.Request.Url.ToString(); ThreadContext.Properties["HttpReferer"] = HttpContext.Current.Request.ServerVariables["HTTP_RE...
It looks like you've set up your log4net configuration to log ThreadContext properties, but you're using the wrong property name in your configuration. When accessing ThreadContext properties, you should ensure that the property names in your log4net configuration match what you set in your code. ### Steps to Fix the ...
23,156
[ { "from": "human", "value": "I have log4net running on my AsP.NET site. I'm able to log messages to my DB Table, but it isn't logging the ThreadContext properties. For example:\nThreadContext.Properties[\"Url\"] = HttpContext.Current.Request.Url.ToString();\nThreadContext.Properties[\"HttpReferer\"] = HttpC...
I'm attempting to display some text in my program using (say) Windows GDI and some of the unicode characters are displayed as question marks? What is up? See also: What does it mean when my text is displayed as boxes?
When you encounter Unicode characters being displayed as question marks (�) or as boxes (often referred to as "tofu"), it typically indicates an issue related to font support or character encoding. Here are the common reasons and solutions for this problem: ### Reasons for Displaying Question Marks or Boxes 1. **Font...
22,203
[ { "from": "human", "value": "I'm attempting to display some text in my program using (say) Windows GDI and some of the unicode characters are displayed as question marks? What is up?\nSee also: What does it mean when my text is displayed as boxes?\n" }, { "from": "gpt", "value": "When you encoun...
Can I ignore a folder on svn checkout? I need to ignore DOCs folder on checkout at my build server. edit: Ignore externals isn't an option. I have some externals that I need.
In Subversion (SVN), there isn't a built-in option to ignore specific folders during a checkout operation directly. However, there are a few workarounds you can consider to achieve similar results: ### 1. Use Sparse Checkouts You can perform a sparse checkout where you check out only the parts of the repository you n...
24,720
[ { "from": "human", "value": "Can I ignore a folder on svn checkout? I need to ignore DOCs folder on checkout at my build server.\nedit: Ignore externals isn't an option. I have some externals that I need.\n" }, { "from": "gpt", "value": "In Subversion (SVN), there isn't a built-in option to igno...
To put it simple, there's a simple java swing app that consists of JFrame with some components in it. One of the components is a JPanel that is meant to be replaced by another JPanel on user action. So, what's the correct way of doing such a thing? I've tried panel = new CustomJPanelWithComponentsOnIt(); parentFrameJPa...
To replace a `JPanel` in a `JFrame` with another `JPanel` in a Java Swing application, you will need to follow these general steps: 1. Remove the current panel from the `JFrame`. 2. Add the new panel to the `JFrame`. 3. Revalidate and repaint the `JFrame` to ensure that the changes are displayed correctly. Here’s a s...
24,403
[ { "from": "human", "value": "To put it simple, there's a simple java swing app that consists of JFrame with some components in it. One of the components is a JPanel that is meant to be replaced by another JPanel on user action.\nSo, what's the correct way of doing such a thing? I've tried\npanel = new Custo...
Can somebody point me at a good tutorial for py2exe? I've read over the official tutorial but it is rather light on details, compared to all the options one can use when building an executable out of a python script. For the record, my python script uses Python 2.5.2, wxPython/wxWidgets 2.8 and MySQLdb 1.2.2; so if y...
Certainly! While the official py2exe documentation provides a basic overview, it can indeed be somewhat sparse on practical examples. Here are some resources and tips that might help you create an executable for your Python script, especially with the specific versions of Python and libraries you mentioned. ### Tutori...
25,341
[ { "from": "human", "value": "Can somebody point me at a good tutorial for py2exe? I've read over the official tutorial but it is rather light on details, compared to all the options one can use when building an executable out of a python script. For the record, my python script uses Python 2.5.2, wxPython...
What does Java use as a default probing method for HashMap? Is it Linear? Chaining or something else?
In Java, the default implementation of `HashMap` uses **chaining** as its collision resolution strategy. This means that when two keys hash to the same bucket (i.e., they produce the same hash code), the `HashMap` stores the entries in a linked list (or more recently in Java 8 and later, a balanced tree) within that bu...
30,231
[ { "from": "human", "value": "What does Java use as a default probing method for HashMap? Is it Linear? Chaining or something else?\n" }, { "from": "gpt", "value": "In Java, the default implementation of `HashMap` uses **chaining** as its collision resolution strategy. This means that when two ke...
Would there a more elegant way of writing the following syntax? Thread t0 = new Thread(new ParameterizedThreadStart(doWork)); t0.Start('someVal'); t0.Join(); Thread t1 = new Thread(new ParameterizedThreadStart(doWork)); t1.Start('someDiffVal'); t1.Join(); Presuming we ...
You're correct that in C#, threads cannot be restarted after they have completed execution. To manage multiple threads more elegantly, especially when you want to pass different values to each thread, using a loop is a great approach. Here's how you can create and start multiple threads in a loop, then join them at t...
26,574
[ { "from": "human", "value": "Would there a more elegant way of writing the following syntax? \n Thread t0 = new Thread(new ParameterizedThreadStart(doWork));\n t0.Start('someVal');\n t0.Join();\n\n Thread t1 = new Thread(new ParameterizedThreadStart(doWork));\n t1.Start('s...
At work we have two servers, one is running an application a lot of people use which has an SQL Server 2000 back end. I have been free to query this for a long time but can't add anything to it such as stored procedures or extra tables. This has lead to us having a second SQL Server linked to the first one and me buil...
It's great to hear that you've made progress with your SQL Server setup and have already implemented some performance optimizations using `OPENQUERY`. Here are some resources and tips that can help you understand how linked servers work, identify data transfer issues, and further optimize your queries. ### Understandi...
21,809
[ { "from": "human", "value": "At work we have two servers, one is running an application a lot of people use which has an SQL Server 2000 back end. I have been free to query this for a long time but can't add anything to it such as stored procedures or extra tables. \nThis has lead to us having a second SQL ...
I have a table with columns ID, DateStamp and the ID need not be unique. How do I write a query that will give me a list of IDs with the minimum DateStamp and the maximum DateStamp? So, for example, for a given ID, the output may look like: 938423, 1/1/2000, 12/13/2003 [I am running SQL Server 2000.]
To get a list of IDs with their corresponding minimum and maximum `DateStamp`, you can use a `GROUP BY` clause along with the `MIN()` and `MAX()` aggregate functions in your SQL query. Here's how you can write that query for SQL Server 2000: ```sql SELECT ID, MIN(DateStamp) AS MinDate, MAX(DateStamp) AS ...
28,412
[ { "from": "human", "value": "I have a table with columns\n\nID, DateStamp\n\nand the ID need not be unique.\nHow do I write a query that will give me a list of IDs with the minimum DateStamp and the maximum DateStamp?\nSo, for example, for a given ID, the output may look like:\n\n938423, 1/1/2000, 12/13/200...
I know how to use the checkboxlist in ASP.NET to display options retrieved from a database. What I don't know how to do is to make this 2-dimensional. That is, I need a list of checkboxlists where I don't know how long the list is; both dimensions of the checkboxlist will be determined by list of people (pulled fro...
Creating a 2-dimensional grid of checkboxes in ASP.NET can indeed be managed more elegantly than manually creating a table with individual checkboxes for each cell. The use of a `GridView` or `Repeater` control can help you achieve a cleaner solution while still maintaining flexibility. Below is a step-by-step approach...
18,057
[ { "from": "human", "value": "I know how to use the checkboxlist in ASP.NET to display options retrieved from a database. What I don't know how to do is to make this 2-dimensional. That is, I need a list of checkboxlists where I don't know how long the list is; both dimensions of the checkboxlist will be d...
I have a BasePage which inherits from System.Web.UI.Page, and every page that inherits the BasePage will have the same master page. How do I cast the Page.Master of the BasePage to the specific master page so I can access properties on it?
When you have a BasePage that inherits from `System.Web.UI.Page` and you want to access specific properties or methods on a master page that is used by all derived pages, you can create a property in your BasePage that performs the casting. Here's how you can do it: 1. **Define the Master Page Type**: First, ensure t...
26,387
[ { "from": "human", "value": "I have a BasePage which inherits from System.Web.UI.Page, and every page that inherits the BasePage will have the same master page.\nHow do I cast the Page.Master of the BasePage to the specific master page so I can access properties on it?\n" }, { "from": "gpt", "va...
So I have a problem in Vista which I can't run certain applications (well, the entier MS suite, Office, Visual Studio, etc) as an Administrator. From the looks of the problem it is caused by the Digital Certificate, and the fact that it has been "revoked". So now I have a problem, how do I un-revoke the digital certifi...
It sounds like you're facing issues with a digital certificate that is preventing you from running certain applications in Windows Vista. Unfortunately, you cannot "un-revoke" a digital certificate. If a certificate has been revoked, it cannot be restored to a valid state. However, you can try to install the working di...
24,316
[ { "from": "human", "value": "So I have a problem in Vista which I can't run certain applications (well, the entier MS suite, Office, Visual Studio, etc) as an Administrator.\nFrom the looks of the problem it is caused by the Digital Certificate, and the fact that it has been \"revoked\".\nSo now I have a pr...
From everything I've read, it seemed that adding paging to a ListView control should be dead simple, but it's not working for me. After adding the ListView and DataPager controls to the form and wiring them together, I'm getting very odd behavior. The DataPager correctly limits the ListView's page size, but clicking th...
The issue you're facing with the `ListView` and `DataPager` is likely due to the way data binding is handled when the page is reloaded or the paging buttons are clicked. When you're binding data to the `ListView`, it's important to make sure that the binding is done correctly, especially in the context of paging. Sin...
23,548
[ { "from": "human", "value": "From everything I've read, it seemed that adding paging to a ListView control should be dead simple, but it's not working for me. After adding the ListView and DataPager controls to the form and wiring them together, I'm getting very odd behavior. The DataPager correctly limits ...
I want to query Active Directory from Windows PE 2.0, which is not supported "out of the box." Microsoft seems to suggest that this is possible, but not with any tools they provide. What do you recommend?
Querying Active Directory from Windows PE 2.0 can be a bit challenging since it doesn't support many of the standard Windows networking components out of the box. However, there are a few options you can explore to achieve this functionality: ### 1. **Custom Scripting with PowerShell:** - While Windows PE 2.0 does ...
22,563
[ { "from": "human", "value": "I want to query Active Directory from Windows PE 2.0, which is not supported \"out of the box.\" Microsoft seems to suggest that this is possible, but not with any tools they provide. What do you recommend?\n" }, { "from": "gpt", "value": "Querying Active Directory f...
When a user clicks on a button on the winforms application, I will generate a CSV file. I then want to ask the user to either save the file to disk OR open the file. How can I do that? Note: I am just generating the file in memory, not writing it to disk until the user selects the path to save it to.
In a WinForms application, you can generate a CSV file in memory and then prompt the user with a `SaveFileDialog` to choose a location to save the file or open it directly. Below is a step-by-step guide to achieve this: 1. **Generate the CSV Data in Memory**: First, you create the CSV data as a string. 2. **Use a `Sa...
24,093
[ { "from": "human", "value": "When a user clicks on a button on the winforms application, I will generate a CSV file.\nI then want to ask the user to either save the file to disk OR open the file.\nHow can I do that?\nNote: I am just generating the file in memory, not writing it to disk until the user selec...
Now that Silverlight 2 has finally shipped. I'm wondering if anyone has put together any logging frameworks for it, maybe something like enterprise library logging or log4net? I'm interesting in something that can perform tracing client side and also log messages to the server. So far the only project I have found is C...
Silverlight 2 was a significant update for the platform, but it didn't have as rich a set of libraries and frameworks compared to more mature technologies. As of your inquiry, Clog on CodeProject was one of the notable projects aimed at providing logging capabilities for Silverlight applications. Here’s a brief overvie...
22,604
[ { "from": "human", "value": "Now that Silverlight 2 has finally shipped. I'm wondering if anyone has put together any logging frameworks for it, maybe something like enterprise library logging or log4net? I'm interesting in something that can perform tracing client side and also log messages to the server.\...
What's the best way to get the last inserted id using sqlite from Java? Google is giving me different answers--some say select the last-insert-rowid; others say call statement.getGeneratedKeys(). What's the best route to take? (I just want to return the id, not use it for other inserts or anything.)
In SQLite, the most effective way to retrieve the last inserted ID after performing an `INSERT` operation is to use the `last_insert_rowid()` function. This function is specifically designed to get the ID of the last row inserted into the database and is the most straightforward way to achieve what you want. In Java, ...
21,837
[ { "from": "human", "value": "What's the best way to get the last inserted id using sqlite from Java? Google is giving me different answers--some say select the last-insert-rowid; others say call statement.getGeneratedKeys(). What's the best route to take? (I just want to return the id, not use it for other ...
This is similar to my previous posting. But this time I want to call a function that exists on the main mxml page. This is my main mxml page: main.mxml <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:ns1="*"> <mx:Script> <![CDATA[ public function changeText(curre...
To call the `changeText` function from your `menu.mxml` component, you need to reference the main `mxml` application's instance. In Flex, you can achieve this by using the `parentDocument` property, which refers to the main application where the component is embedded. Here’s how to modify your `menu.mxml` so that when...
24,318
[ { "from": "human", "value": "This is similar to my previous posting. But this time I want to call a function that exists on the main mxml page.\nThis is my main mxml page:\nmain.mxml\n<mx:Application xmlns:mx=\"http://www.adobe.com/2006/mxml\" layout=\"absolute\" xmlns:ns1=\"*\">\n <mx:Script>\n <...
I have a "settings file" in my Winforms application called Settings.settings with a partial class for custom methods, etc. Is there a way to load / save dynamic settings based on arbitrary keys? For example, I have some ListViews in my application in which I want to save / load the column widths; Instead of creating a ...
In your WinForms application, the `Settings.settings` file is intended for storing static settings with predefined keys that correspond to properties in the `Settings` class. This means you can't dynamically create properties at runtime based on arbitrary keys in the way you're trying to do. To achieve the functionali...
23,484
[ { "from": "human", "value": "I have a \"settings file\" in my Winforms application called Settings.settings with a partial class for custom methods, etc. Is there a way to load / save dynamic settings based on arbitrary keys?\nFor example, I have some ListViews in my application in which I want to save / lo...
Does anyone know any good tutorial about using NAnt for native code build process instructions? Is there any other tool for build process automation that is better suitable with native code environment? We are developing a win32 mobile application and it will be available online for download as a CAB file. The CAB fi...
For building native code applications, including Win32 mobile applications, there are several options available for build automation, and NAnt is just one of them. While NAnt is a .NET-focused build tool (similar to Make but more tailored to .NET projects), it can still be used for native code projects to some extent. ...
20,647
[ { "from": "human", "value": "Does anyone know any good tutorial about using NAnt for native code build process instructions?\n\nIs there any other tool for build process automation that is better suitable with native code environment?\n\nWe are developing a win32 mobile application and it will be available ...
I'm trying to understand the best way to get the connection to my databases. At the moment I've got a method which parses the URL (depending on the URL called the application has to connect to a different database, like customer1.example.com will connect to the customer1 database) and calls ActiveRecord::Base.establis...
Managing database connections in a Rails application can be tricky, especially when you need to connect to multiple databases based on the incoming requests. Using `ActiveRecord::Base.establish_connection` within a `before_filter` for each request can lead to performance issues and inefficient resource utilization beca...
23,916
[ { "from": "human", "value": "I'm trying to understand the best way to get the connection to my databases.\nAt the moment I've got a method which parses the URL (depending on the URL called the application has to connect to a different database, like customer1.example.com will connect to the customer1 databa...
I'm possibly just stupid, but I'm trying to find a user in Active Directory from C#, using the Login name ("domain\user"). My "Skeleton" AD Search Functionality looks like this usually: de = new DirectoryEntry(string.Format("LDAP://{0}", ADSearchBase), null, null, AuthenticationTypes.Secure); ds = new DirectorySearcher...
When you want to search for a user in Active Directory based on the "domain\user" format (which corresponds to the `sAMAccountName` in AD), you need to modify your `DirectorySearcher` to filter specifically for that attribute. Here’s how you can adapt your existing code to search for a user based on their login name: ...
25,201
[ { "from": "human", "value": "I'm possibly just stupid, but I'm trying to find a user in Active Directory from C#, using the Login name (\"domain\\user\").\nMy \"Skeleton\" AD Search Functionality looks like this usually:\nde = new DirectoryEntry(string.Format(\"LDAP://{0}\", ADSearchBase), null, null, Authe...
I want to make a really simple iphone app: one screen with a single button... when the button is tapped a new screen appears. That's it. No animations, nothing, I've tried endlessly to make the NavBar sample project do this... and it works but only if I use a UINavigationController with a table that I can tap etc. ...
Creating a simple iPhone app with a single button that transitions to a new screen can indeed be done straightforwardly. Below is a step-by-step guide using Swift and UIKit, which is the most common approach for iOS development. ### Step 1: Create a New Project 1. Open Xcode. 2. Choose "Create a new Xcode project." 3...
24,277
[ { "from": "human", "value": "I want to make a really simple iphone app: one screen with a single button... when the button is tapped a new screen appears. That's it. No animations, nothing,\nI've tried endlessly to make the NavBar sample project do this... and it works but only if I use a UINavigationCon...
I have the requirement of generating UML Diagrams for one of my C++ assignments. I'm using Visio 2007 and I'm having trouble representing C++ vectors. The only way I can see this working is creating a custom C++ datatype or creating a vector class in my project, then for each instance of a vector in the UML, I need to ...
Creating UML diagrams in Visio can indeed be a bit cumbersome when it comes to representing template classes like `std::vector<Object>`. However, there are a few strategies you can consider to simplify the process without needing to define a custom datatype or creating additional classes. ### Strategies for Representi...
25,930
[ { "from": "human", "value": "I have the requirement of generating UML Diagrams for one of my C++ assignments. I'm using Visio 2007 and I'm having trouble representing C++ vectors. The only way I can see this working is creating a custom C++ datatype or creating a vector class in my project, then for each in...
I've inherited a large Java app that uses Struts, Spring, and Hibernate. The classes and interfaces I deal with daily are: Struts Actions, Struts ActionForms, Value Objects, Service Interfaces and Implementations, DAO Interfaces and Implementations, and Entities. I'm pretty clear on the how and why of most of these, ex...
It's great that you're looking to clarify the roles of various components in your Java application architecture, especially given the complexities introduced by Struts, Spring, and Hibernate. Let's address your questions one by one: ### 1) Difference between Entities and Value Objects (VOs) Entities and Value Objects...
24,680
[ { "from": "human", "value": "I've inherited a large Java app that uses Struts, Spring, and Hibernate. The classes and interfaces I deal with daily are: Struts Actions, Struts ActionForms, Value Objects, Service Interfaces and Implementations, DAO Interfaces and Implementations, and Entities. I'm pretty clea...
I am attempting to deploy an ASP.NET 2.0 Web service application on an IIS server that currently serves a large .NET 1.0 web application. I have set up an appropriate virtual directory and have set the ASP.NET version for the virtual directory to 2.0, when I attempt to browse the site in a web-browser, I am prompted f...
When you encounter a password prompt in IIS while trying to access a .NET 2.0 web service application, it often indicates a problem with authentication settings. Since you've mentioned that you have anonymous access enabled and integrated Windows authentication set up, let’s go through some troubleshooting steps and co...
24,820
[ { "from": "human", "value": "I am attempting to deploy an ASP.NET 2.0 Web service application on an IIS server that currently serves a large .NET 1.0 web application. \nI have set up an appropriate virtual directory and have set the ASP.NET version for the virtual directory to 2.0, when I attempt to browse ...
I have two assemblies with the same name in the Global Assembly cache, but with different version numbers. How do I tell my program which version to reference? For the record, this is a VB.Net page in an ASP.Net web site.
In .NET, if you have two assemblies with the same name in the Global Assembly Cache (GAC) but different version numbers, you can specify which version to reference in your ASP.NET application by doing the following: ### 1. Update the web.config You can use the `<assemblyBinding>` section in the `web.config` file of y...
25,337
[ { "from": "human", "value": "I have two assemblies with the same name in the Global Assembly cache, but with different version numbers. How do I tell my program which version to reference?\nFor the record, this is a VB.Net page in an ASP.Net web site.\n" }, { "from": "gpt", "value": "In .NET, i...
I think all of the tutorials and stuff are great on blogs, but sometimes when you actually build an application the way you would code or interact with a system is quite different. I was wondering if you all knew some good real world type ASP.NET MVC applications that have the source code available for experimentation....
It's great that you're looking for real-world ASP.NET MVC applications with source code available for experimentation! Here are some additional resources and projects you might find useful: 1. **NopCommerce**: An open-source eCommerce solution built on ASP.NET MVC. It has a feature-rich environment and is a great way ...
21,733
[ { "from": "human", "value": "I think all of the tutorials and stuff are great on blogs, but sometimes when you actually build an application the way you would code or interact with a system is quite different.\nI was wondering if you all knew some good real world type ASP.NET MVC applications that have the ...
In the application I am developing I have to store the time some particular users remain logged into the application, unfortunately, in web applications, there are several ways the user can log off. User clicks log off. User session expires. User closes the window. User types another site URL in the address bar. The ...
Tracking user session durations in a web application can indeed be challenging due to the various ways users can log off. Here are some strategies you can implement to effectively track this information: ### 1. Use JavaScript with `beforeunload` Event You can use the `beforeunload` event in JavaScript to capture when ...
19,552
[ { "from": "human", "value": "In the application I am developing I have to store the time some particular users remain logged into the application, unfortunately, in web applications, there are several ways the user can log off.\n\nUser clicks log off.\nUser session expires.\nUser closes the window.\nUser ty...
The picture below explains all: alt text http://img133.imageshack.us/img133/4206/accentar9.png The variable textInput comes from File.ReadAllText(path); and characters like : ' é è ... do not display. When I run my UnitTest, all is fine! I see them... Why?
The issue you're encountering with special characters (like é, è, etc.) likely stems from character encoding. When reading text files in .NET, the default encoding may not match the encoding used in the file you're reading, especially if the file contains special or non-ASCII characters. ### Possible Solutions 1. **S...
25,541
[ { "from": "human", "value": "The picture below explains all:\nalt text http://img133.imageshack.us/img133/4206/accentar9.png\nThe variable textInput comes from File.ReadAllText(path); and characters like : ' é è ... do not display. When I run my UnitTest, all is fine! I see them... Why?\n" }, { "fro...
A question regarding a DB development project. The database already exist and is rather large (several TBs). What do you use for version control in DB development? How do you control concurrent changes to the data model by different teams What is your approach to the Unit Testing in the DB development How do you deal ...
Certainly! Let's tackle each of the items you’ve mentioned one by one, starting with version control for database development. ### Version Control in Database Development **1. Version Control Tools:** - **SQL Source Control:** Tools like Redgate SQL Source Control or Liquibase can integrate with version control sy...
20,936
[ { "from": "human", "value": "A question regarding a DB development project. The database already exist and is rather large (several TBs).\n\nWhat do you use for version control in DB development?\nHow do you control concurrent changes to the data model by different teams\nWhat is your approach to the Unit T...
Is it possible to create, for instance, a box model hack while using in-line CSS? For example: <div id="blah" style="padding: 5px; margin: 5px; width: 30px; /*IE5-6 Equivalent here*/"> Thanks!
Yes, it is possible to create a box model hack using inline CSS, but the syntax is slightly different than when using an external or internal style sheet. In Internet Explorer 5 and 6, the box model differs from the standard box model used by modern browsers. In these older versions of IE, the `width` property include...
21,214
[ { "from": "human", "value": "Is it possible to create, for instance, a box model hack while using in-line CSS?\nFor example:\n<div id=\"blah\" style=\"padding: 5px; margin: 5px; width: 30px; /*IE5-6 Equivalent here*/\">\nThanks! \n" }, { "from": "gpt", "value": "Yes, it is possible to create a b...
I am trying to display a combo box in a dialog during setup of a component. Currently, we have a Radio Button Group. I figured that replacing it with the combo box should be as simple as adding proper entries in the "ComboBox" table in the MSI and in the "Control" table, replacing the references to the radio button gro...
When replacing a Radio Button Group with a Combo Box in your MSI setup using Orca, there are several important steps to ensure everything is configured correctly. Error #2885 typically indicates a problem with the control definition in the dialog, which might arise from improper setup of the Combo Box or the Control ta...
20,774
[ { "from": "human", "value": "I am trying to display a combo box in a dialog during setup of a component. Currently, we have a Radio Button Group. I figured that replacing it with the combo box should be as simple as adding proper entries in the \"ComboBox\" table in the MSI and in the \"Control\" table, rep...
We have a windows application that runs on a server and accesses 4 other servers (all of them are members in the domain) to get the messages in each of their private queues. We've just installed a new server, and for some reason when the application tries to access that computer, it gets a "Remote computer is not avail...
The issue you're facing with the new server might stem from several potential causes. Here are some steps and considerations to help troubleshoot the problem: 1. **Network Connectivity**: - Ensure that the new server is powered on and connected to the network. - Check if you can ping the new server from the ap...
24,334
[ { "from": "human", "value": "We have a windows application that runs on a server and accesses 4 other servers (all of them are members in the domain) to get the messages in each of their private queues. We've just installed a new server, and for some reason when the application tries to access that computer...
We are in the process of nutting out the design guidelines we would like to use in our development team and got into a discussion today around how ASP.NET controls should be named. I am talking about our good friends Label, TextBox, Button etc. We came up with the following three possibilities that we voted on: (Exampl...
When it comes to naming conventions for ASP.NET controls, Microsoft's guidelines have traditionally emphasized clarity and consistency. Here are some considerations based on best practices, including Microsoft's recommendations: ### Microsoft Guidelines 1. **Control Type Prefix**: Microsoft has often used prefixes in ...
19,790
[ { "from": "human", "value": "We are in the process of nutting out the design guidelines we would like to use in our development team and got into a discussion today around how ASP.NET controls should be named. I am talking about our good friends Label, TextBox, Button etc.\nWe came up with the following thr...
I want to create Code39 encoded barcodes from my application. I know I can use a font for this, but I'd prefer not to as I'd have to register the font on the server and I've had some pretty bad experiences with that. An example of what I've produced after asking this question is in the answers
To generate Code39 barcodes programmatically without relying on fonts, you can create them using a bitmap or a vector graphics library in your programming environment. Below are the steps to create a simple Code39 barcode encoder in Python using the `Pillow` library for image creation. You can adapt this logic to other...
18,276
[ { "from": "human", "value": "I want to create Code39 encoded barcodes from my application. \nI know I can use a font for this, but I'd prefer not to as I'd have to register the font on the server and I've had some pretty bad experiences with that.\nAn example of what I've produced after asking this question...
We are using a WCF service layer to return images from a repository. Some of the images are color, multi-page, nearly all are TIFF format. We experience slowness - one of many issues. 1.) What experiences have you had with returning images via WCF 2.) Do you have any suggestions tips for returning large images? 3.) A...
When working with WCF (Windows Communication Foundation) services to return large images, there are several considerations that can influence performance and efficiency. Let's address your questions one by one: ### 1. Experiences with Returning Images via WCF Returning images through WCF can be efficient if designed p...
23,399
[ { "from": "human", "value": "We are using a WCF service layer to return images from a repository. Some of the images are color, multi-page, nearly all are TIFF format. We experience slowness - one of many issues.\n1.) What experiences have you had with returning images via WCF\n2.) Do you have any suggest...
I understand that these methods are for pickling/unpickling and have no relation to the reduce built-in function, but what's the difference between the 2 and why do we need both?
In Python, "pickling" and "reduce" are two entirely different concepts that serve different purposes, although they may sound similar due to the term "reduce." Let's clarify each one and explain their differences and why both exist: ### Pickling **Pickling** is the process of serializing an object into a byte stream, ...
25,723
[ { "from": "human", "value": "I understand that these methods are for pickling/unpickling and have no relation to the reduce built-in function, but what's the difference between the 2 and why do we need both?\n" }, { "from": "gpt", "value": "In Python, \"pickling\" and \"reduce\" are two entirely...
What is the purpose of this software? http://www.httpwatch.com/
HttpWatch is a software tool designed primarily for web developers, testers, and SEO professionals. Its main purpose is to provide a comprehensive view of HTTP traffic between the web browser and web servers. Here are some key functionalities and purposes of HttpWatch: 1. **HTTP Traffic Analysis**: It captures and dis...
27,614
[ { "from": "human", "value": "What is the purpose of this software?\nhttp://www.httpwatch.com/\n" }, { "from": "gpt", "value": "HttpWatch is a software tool designed primarily for web developers, testers, and SEO professionals. Its main purpose is to provide a comprehensive view of HTTP traffic b...
I'm working on an upgrade for an existing database that was designed without any of the code to implement the design being considered. Now I've hit a brick wall in terms of implementing the database design in code. I'm certain whether its a problem with the design of the database or if I'm simply not seeing the correct...
Your situation seems complex, but we can work through the relationships step by step to improve the database design. It's essential to properly model the relationships and use normalized tables to effectively manage the many-to-many relationships you described. ### Suggested Database Schema: Below is a refined versio...
22,306
[ { "from": "human", "value": "I'm working on an upgrade for an existing database that was designed without any of the code to implement the design being considered. Now I've hit a brick wall in terms of implementing the database design in code. I'm certain whether its a problem with the design of the databas...
How do I keep VS from opening a new tab in Firefox every time I hit F5 to debug a web application? I would really like it to re-use the same tab.
When you press F5 in Visual Studio (VS) to debug a web application, it launches the browser in debug mode. By default, some configurations may cause it to open a new tab in Firefox each time. To prevent this and re-use the same tab, you can adjust some settings in Firefox and Visual Studio. Here’s how to set it up: #...
25,093
[ { "from": "human", "value": "How do I keep VS from opening a new tab in Firefox every time I hit F5 to debug a web application? I would really like it to re-use the same tab.\n" }, { "from": "gpt", "value": "When you press F5 in Visual Studio (VS) to debug a web application, it launches the bro...
I would like to override the use of the standard app.config by passing a command line parameter. How do I change the default application configuration file so that when I access ConfigurationManager.AppSettings I am accessing the config file specified on the command line? Edit: It turns out that the correct way to loa...
To successfully override the application configuration file and access the values in `appSettings`, make sure to follow these steps properly, especially with respect to how you access the configuration values. 1. **Set up the configuration file mapping**: You are already using `ExeConfigurationFileMap`, which is corre...
24,621
[ { "from": "human", "value": "I would like to override the use of the standard app.config by passing a command line parameter. How do I change the default application configuration file so that when I access ConfigurationManager.AppSettings I am accessing the config file specified on the command line?\nEdit...
We have a Cash flow report which is basically in this structure: Date |Credit|Debit|balance| 09/29| 20 | 10 | 10 | 09/30| 0 | 10 | 0 | The main problem is the balance, and as we are using a DataSet for the Data, it's kinda hard to calculate the balance on the DataSet, because we always need the balance f...
To tackle the balance calculation problem in your cash flow report when using a DataSet in a DataGrid, you can consider the following approaches: ### Option 1: Calculate Balance in Code Behind You can manually calculate the balance in your application code after retrieving the data from the DataSet. Here's a basic out...
23,229
[ { "from": "human", "value": "We have a Cash flow report which is basically in this structure:\nDate |Credit|Debit|balance|\n09/29| 20 | 10 | 10 |\n09/30| 0 | 10 | 0 |\n\nThe main problem is the balance, and as we are using a DataSet for the Data, it's kinda hard to calculate the balance on the...
Is there any way to insert a text (string, may or may not have html tags) to a div? It has to be a div and not a textarea. First of all, I need to get the cursor position, then insert the text in that position. It's similar to function insertAdjacentText, but it can only insert before or after a tag, and only works in ...
To insert text at the cursor position within a `<div>`, you can make use of the `Range` and `Selection` APIs available in modern browsers. This approach allows you to insert text at the current caret (cursor) position, whether or not the text contains HTML tags. Here's a basic example of how to do this: ```html <!DOC...
25,816
[ { "from": "human", "value": "Is there any way to insert a text (string, may or may not have html tags) to a div?\nIt has to be a div and not a textarea.\nFirst of all, I need to get the cursor position, then insert the text in that position. It's similar to function insertAdjacentText, but it can only inser...
Can you add new statements (like print, raise, with) to Python's syntax? Say, to allow.. mystatement "Something" Or, new_if True: print "example" Not so much if you should, but rather if it's possible (short of modifying the python interpreters code)
In Python, the syntax is defined by its grammar and the parsing rules that are embedded in the interpreter. To add new statements or keywords to the syntax (like `mystatement` or `new_if` as you've suggested) would typically require modifying the Python interpreter itself, which is not feasible without substantial effo...
24,019
[ { "from": "human", "value": "Can you add new statements (like print, raise, with) to Python's syntax?\nSay, to allow..\nmystatement \"Something\"\n\nOr,\nnew_if True:\n print \"example\"\n\nNot so much if you should, but rather if it's possible (short of modifying the python interpreters code)\n" }, ...
I am trying to find out how to upload a file from a web user to a server using an ASP page. The displayed page has an Input tag of type "File" like this: <input type="file" name="uploadfile"> And a submit button that passes the Form info to another .ASP page. This page must take the path it gets from the Input contr...
To upload a file from a web user to a server using an ASP page, you will typically use an HTML form with an `<input>` of type `"file"`, and you will need to use an ASP server-side script to handle the file upload. Below are the steps and an example to guide you through the process. ### 1. Create the HTML Form The HTM...
24,585
[ { "from": "human", "value": "I am trying to find out how to upload a file from a web user to a server using an ASP page. The displayed page has an Input tag of type \"File\" like this:\n<input type=\"file\" name=\"uploadfile\">\n\nAnd a submit button that passes the Form info to another .ASP page. This pa...
I have a number of panels in a single window in C# application and I created 2 scrollbars, one for horizontal and one vertical. This is what I currently have: picture with 2 scroolbars http://www.simnet.is/elinnils52/scrollbar.jpg I have 1 variable and that is the total height all the items take & need. Here is my code...
To create a smooth scrolling experience with proper scrollbar behavior in your C# application, we need to make sure the `ScrollBar` properties (`Maximum`, `Minimum`, `SmallChange`, and `LargeChange`) are set appropriately. Here’s a refined approach that should address the issues you’re facing: ### Steps to Implement...
25,284
[ { "from": "human", "value": "I have a number of panels in a single window in C# application and I created 2 scrollbars, one for horizontal and one vertical. This is what I currently have:\npicture with 2 scroolbars http://www.simnet.is/elinnils52/scrollbar.jpg\nI have 1 variable and that is the total height...
I'd like to create a table which has an integer primary key limited between 000 and 999. Is there any way to enforce this 3 digit limit within the sql? I'm using sqlite3. Thanks.
In SQLite, you can enforce a 3-digit integer limit for a primary key by using a combination of a CHECK constraint and ensuring that the primary key field is defined to accept only integers between 0 and 999. Here is how you can create a table with a primary key that enforces this limitation: ```sql CREATE TABLE your_...
25,760
[ { "from": "human", "value": "I'd like to create a table which has an integer primary key limited between 000 and 999. Is there any way to enforce this 3 digit limit within the sql?\nI'm using sqlite3.\nThanks.\n" }, { "from": "gpt", "value": "In SQLite, you can enforce a 3-digit integer limit fo...
In .NET (at least in the 2008 version, and maybe in 2005 as well), changing the BackColor property of a DateTimePicker has absolutely no affect on the appearance. How do I change the background color of the text area, not of the drop-down calendar? Edit: I was talking about Windows forms, not ASP.
In Windows Forms, the `DateTimePicker` control does not support changing the `BackColor` property to modify the background color of its text area. This behavior is by design, as the `DateTimePicker` is rendered by the operating system, which limits the customization options available in .NET. However, you can achieve ...
22,086
[ { "from": "human", "value": "In .NET (at least in the 2008 version, and maybe in 2005 as well), changing the BackColor property of a DateTimePicker has absolutely no affect on the appearance. How do I change the background color of the text area, not of the drop-down calendar?\nEdit: I was talking about Win...
I would like to create a window with a progressbar which shows the current status of Spring's object instantiation. From Spring.Net's documentation it seems that IObjectPostProcessors is the right point to start and track whenever an Object has been instanciated. However in order to get "Percentage of instantiated cla...
Displaying information to users during the startup of a Spring.NET application can be challenging, especially when trying to track the instantiation of objects using `IObjectPostProcessors`. However, you can adopt a few strategies to provide feedback to the user during this phase. ### Strategy 1: Custom Application St...
20,712
[ { "from": "human", "value": "I would like to create a window with a progressbar which shows the current status of Spring's object instantiation. From Spring.Net's documentation it seems that IObjectPostProcessors is the right point to start and track whenever an Object has been instanciated. However in ord...
A friend came across a quadratic Bézier curve function in his codebase that used a gigantic rats nest of a switch table to perform the computation. He challenged me to find a single, short expression that would allow him to replace the gigantic block of code. In attempting to satisfy two different curiosities, I thoug...
Your implementation of the Quadratic Bézier curve in OCaml is a good start, but there are a few aspects that could be improved regarding both performance and correctness. Let's take a closer look at the function and then suggest some enhancements. ### Understanding the Quadratic Bézier Curve A Quadratic Bézier curve ...
22,240
[ { "from": "human", "value": "A friend came across a quadratic Bézier curve function in his codebase that used a gigantic rats nest of a switch table to perform the computation. He challenged me to find a single, short expression that would allow him to replace the gigantic block of code.\nIn attempting to ...
$0 is the variable for the top level Ruby program, but is there one for the current method?
In Ruby, the special variable `self` represents the current object in context, which includes methods. However, if you're looking for a way to access the current method specifically, Ruby does not have a direct built-in variable like `$0` for that purpose. However, you can retrieve the name of the current method usin...
29,272
[ { "from": "human", "value": "$0 is the variable for the top level Ruby program, but is there one for the current method?\n" }, { "from": "gpt", "value": "In Ruby, the special variable `self` represents the current object in context, which includes methods. However, if you're looking for a way to...
I have found some libraries or web services in PHP that does the job. The problem is that the conversion is done when the page is fully loaded, I would like to convert the page to PDF after some content dynamically added via AJAX in onload event. Thank you very much, Omar
To convert a webpage to PDF after dynamically adding content via AJAX, you can follow these steps: 1. **Load the page and add content with AJAX**: Use AJAX to dynamically load the content you want to add to your page after the initial load. 2. **Trigger PDF conversion**: Once the AJAX content is fully loaded, you can...
17,847
[ { "from": "human", "value": "I have found some libraries or web services in PHP that does the job. The problem is that the conversion is done when the page is fully loaded, I would like to convert the page to PDF after some content dynamically added via AJAX in onload event. \nThank you very much,\nOmar\n" ...
I have a <button> with an accesskey assgined to it. The accesskey works fine as long as the button is visible, but when I set display: none or visibility: hidden, the accesskey no longer works. Also tried without success: Use a different element type: a, input (various types, even typeless). Assign the accesskey to a ...
The behavior you're encountering with access keys in browsers is indeed related to the visibility and display properties of elements. Here's a breakdown of how access keys work and why you're seeing this behavior: ### Understanding Access Keys 1. **Access Keys**: Access keys are keyboard shortcuts that allow users to...
24,933
[ { "from": "human", "value": "I have a <button> with an accesskey assgined to it. The accesskey works fine as long as the button is visible, but when I set display: none or visibility: hidden, the accesskey no longer works.\nAlso tried without success:\n\nUse a different element type: a, input (various types...
I recently upgraded my oracle client to 10g (10.2.0.1.0). Now when I try to connect to a legacy 8.0 database, I get ORA-03134: Connections to this server version are no longer supported. Is there any workaround for this problem, or do I have to install two clients on my local machine?
The error you're encountering, `ORA-03134: Connections to this server version are no longer supported`, occurs because Oracle clients are generally not backward-compatible with older database versions. Oracle 10g (10.2.0.1.0) does not support connections to Oracle 8.0 databases, which is why you are experiencing this i...
27,289
[ { "from": "human", "value": "I recently upgraded my oracle client to 10g (10.2.0.1.0).\nNow when I try to connect to a legacy 8.0 database, I get\nORA-03134: Connections to this server version are no longer supported.\n\nIs there any workaround for this problem, or do I have to install two clients on my loc...
SqlConnection connection = new SqlConnection(FROM_CONFIGURATION) SqlCommand command = new SqlCommand("SomeSQL", connection); connection.Open(); command.ExecuteNonQuery(); command.Dispose(); connection.Dispose(); It is recommended that the code above should include try/catch (or using) so that if an exception is t...
Your question highlights an important aspect of resource management in .NET, particularly regarding unmanaged resources. While the Garbage Collector (GC) in .NET is responsible for automatically managing memory and cleaning up managed objects, it does not handle unmanaged resources (like database connections, file hand...
22,196
[ { "from": "human", "value": "SqlConnection connection = new SqlConnection(FROM_CONFIGURATION) \nSqlCommand command = new SqlCommand(\"SomeSQL\", connection); \nconnection.Open(); \ncommand.ExecuteNonQuery(); \ncommand.Dispose(); \nconnection.Dispose();\n\nIt is recommended that the code above should include...
Is there a real way to get Netbeans to load and work faster? It is too slow and gets worse when you have been coding for some time. It eats all my RAM. I am on a Windows machine, specifically Windows Server 2008 Datacenter Edition x64, 4Gb of RAM, 3Ghz Core 2 Duo processor, etc. I am using the x64 JDK. I use the NOD32...
NetBeans can be resource-intensive, especially with large projects. Given your hardware constraints and the nature of your project, here are some strategies you can try to improve performance: ### 1. Optimize JVM Settings: While you’ve already modified some JVM parameters, consider adjusting them further. Here's an ex...
23,322
[ { "from": "human", "value": "Is there a real way to get Netbeans to load and work faster?\nIt is too slow and gets worse when you have been coding for some time. It eats all my RAM.\n\nI am on a Windows machine, specifically Windows Server 2008 Datacenter Edition x64,\n4Gb of RAM, 3Ghz Core 2 Duo processor,...
In data processing, I frequently need to create a lookup data structure to map one identifier to another. As a concrete example, let's take a structure which holds a 1-to-1 mapping between a country's 2 character code and its full name. In it we would have AD -> Andorra AE -> United Arab Emirates AF -> Afghanistan...
All the suggestions you provided are clear and convey the purpose of the variable well. Here are some additional thoughts and recommendations: 1. **countryNameByCode**: This is descriptive and makes it clear that the variable maps country codes to names. 2. **nameByCodeLookup**: This also works well, but "lookup" ma...
22,349
[ { "from": "human", "value": "In data processing, I frequently need to create a lookup data structure to map one identifier to another. As a concrete example, let's take a structure which holds a 1-to-1 mapping between a country's 2 character code and its full name. In it we would have\nAD -> Andorra \nAE ...
I have a Delphi COM Add-in for Outlook (2000-2007) and am trying to find a way to register an event when an MailItem in Outlook is marked as read. I want to add an additional property to the item as/just after it is marked as read. Does anyone have any idea how to do this using the Outlook Object Model? I am also usi...
To achieve the functionality of tracking when a `MailItem` is marked as read in Outlook (2000-2007) using Delphi COM add-in and Add-In Express components, you can use the `Item_PropertyChange` event. This event fires when the property of an Outlook item changes, and you can check for the `UnRead` property specifically....
23,637
[ { "from": "human", "value": "I have a Delphi COM Add-in for Outlook (2000-2007) and am trying to find a way to register an event when an MailItem in Outlook is marked as read. I want to add an additional property to the item as/just after it is marked as read.\nDoes anyone have any idea how to do this usin...
At the moment, our application uses the Trident Win32 component, but we want to move away from that for a few reasons, chief among them being our desire to go cross-platform. We're looking at WebKit and Gecko, but I'd love to get some feedback before I make a decision. Here are some of the most important requirements: ...
It sounds like you've made a solid choice with Qt 4.5 and its inclusion of WebKit. Qt is indeed a robust framework that not only provides great cross-platform capabilities but also has a strong emphasis on object-oriented programming, which should align well with your desire for a well-designed architecture. **Here ar...
23,956
[ { "from": "human", "value": "At the moment, our application uses the Trident Win32 component, but we want to move away from that for a few reasons, chief among them being our desire to go cross-platform.\nWe're looking at WebKit and Gecko, but I'd love to get some feedback before I make a decision. Here are...
Any domain name registrars out there that support domain name registration using a web service or a similar functionality without them telling you to become a reseller? I don't register that many domain names and I am not interested in paying reseller fees. If I can become a reseller without paying upfront fees, that w...
There are several domain name registrars that offer APIs or web services for domain registration without requiring you to become a reseller in the traditional sense or pay upfront fees. Here are some options you might consider: 1. **Namecheap**: Namecheap offers an API that allows you to manage domain registrations, D...
24,419
[ { "from": "human", "value": "Any domain name registrars out there that support domain name registration using a web service or a similar functionality without them telling you to become a reseller?\nI don't register that many domain names and I am not interested in paying reseller fees.\nIf I can become a r...
I have 3 points in a 3D space of which I know the exact locations. Suppose they are: (x0,y0,z0), (x1,y1,z1) and (x2,y2,z2). Also I have a camera that is looking at these 3 points and I know the 2D locations of those three points on camera view plane. So for example (x0,y0,z0) will be (x0',y0'), and (x1,y1,z1) will be (...
To find the projection matrix that transforms 3D points in world coordinates to 2D points in camera coordinates, you'll typically need to use a method that involves solving a system of equations. Below is a step-by-step guide to derive the projection matrix using your 3D and 2D points. ### Steps to Derive the Projecti...
14,948
[ { "from": "human", "value": "I have 3 points in a 3D space of which I know the exact locations. Suppose they are: (x0,y0,z0), (x1,y1,z1) and (x2,y2,z2).\nAlso I have a camera that is looking at these 3 points and I know the 2D locations of those three points on camera view plane. So for example (x0,y0,z0) w...
This is on iPhone 0S 2.0. Answers for 2.1 are fine too, though I am unaware of any differences regarding tables. It feels like it should be possible to get text to wrap without creating a custom cell, since a UITableViewCell contains a UILabel by default. I know I can make it work if I create a custom cell, but that's ...
In iOS, the behavior you're observing with `UITableViewCell` and its default text label can be a bit confusing, especially when dealing with text wrapping and multiple lines. Here are some insights into why you're encountering issues with text wrapping in a `UILabel` that belongs to a `UITableViewCell`: 1. **UILabel D...
22,976
[ { "from": "human", "value": "This is on iPhone 0S 2.0. Answers for 2.1 are fine too, though I am unaware of any differences regarding tables.\nIt feels like it should be possible to get text to wrap without creating a custom cell, since a UITableViewCell contains a UILabel by default. I know I can make it w...
I am using Oracle 10g R2. Recently, after rebooting the server, I started having a problem where I couldn't connect to the instance. I am only connecting locally on the server itself. Oddly enough, the issue corrects itself if I start the Database Administration Assistant, and select my instance to supposedly change ...
It sounds like you are encountering a situation where the Oracle database instance is not starting properly after a reboot. Here are several things you can check to troubleshoot the issue: 1. **Check Oracle Services**: After a server reboot, ensure that all Oracle-related services are running. You can check this in Wi...
27,008
[ { "from": "human", "value": "I am using Oracle 10g R2. \nRecently, after rebooting the server, I started having a problem where I couldn't connect to the instance. I am only connecting locally on the server itself. \nOddly enough, the issue corrects itself if I start the Database Administration Assistant, a...
I know this is a bit of a newbie question, but are there equivalents to C#'s string operations in Java? Specifically, I'm talking about String.Format and String.Join.
No problem at all! It's great that you're exploring string operations across different programming languages. In Java, you can find equivalents to C#'s `String.Format` and `String.Join`, although the methods of achieving similar results may differ slightly. ### 1. String.Format Equivalent in Java In C#, `String.Forma...
26,149
[ { "from": "human", "value": "I know this is a bit of a newbie question, but are there equivalents to C#'s string operations in Java?\nSpecifically, I'm talking about String.Format and String.Join.\n" }, { "from": "gpt", "value": "No problem at all! It's great that you're exploring string operati...
I have some configuration values for an asp.net web app. They will be maintained by a system admin once the system goes live. Should I store these values in the database or in a config file? Is there a best practice for this sort of thing?
The decision of whether to store configuration values in a database or in a configuration file for an ASP.NET web application depends on various factors, including how dynamic the configurations need to be, how often they might change, security considerations, and the deployment model of your application. Below are som...
25,574
[ { "from": "human", "value": "I have some configuration values for an asp.net web app. They will be maintained by a system admin once the system goes live. Should I store these values in the database or in a config file? Is there a best practice for this sort of thing?\n" }, { "from": "gpt", "...
I am doing a BHO (extension for IE) that receives events on other thread. When I access the DOM from that other thread, IE crashes. Is it possible to make the DOM accessed from the same thread as the main BHO thread so that it does not crash? It seems like a general COM multithreading problem, which I don't understand...
Yes, you're correct that this is a general COM multithreading issue. Accessing the Document Object Model (DOM) from a thread that is not the main thread of the Internet Explorer (IE) application can lead to instability and crashes. In COM, the object that represents the DOM is typically single-threaded, meaning it expe...
22,970
[ { "from": "human", "value": "I am doing a BHO (extension for IE) that receives events on other thread. When I access the DOM from that other thread, IE crashes. Is it possible to make the DOM accessed from the same thread as the main BHO thread so that it does not crash? \nIt seems like a general COM multit...
How can i go about programaticaly getting the IP address of my network as seen from the Internet? Its obviously a property that my router has access to when it connects to the ISP. Is there any way to get this info from a router using a standard protocol. My only other option is to either find a WS which returns my IP ...
To programmatically obtain your public IP address, you indeed have a few options. Here are some standard approaches that can be more reliable than scraping HTML from a website: ### 1. Use a Public IP Address API There are many public APIs available that will return your public IP address in a structured format (e.g., ...
25,824
[ { "from": "human", "value": "How can i go about programaticaly getting the IP address of my network as seen from the Internet? Its obviously a property that my router has access to when it connects to the ISP. Is there any way to get this info from a router using a standard protocol. My only other option is...
Let's say I have the following table: CustomerID ParentID Name ========== ======== ==== 1 null John 2 1 James 3 2 Jenna 4 3 Jennifer 5 3 Peter 6 5 Alice 7 5 Steve 8 1 Larry I want to retrieve i...
To retrieve all the descendants of James in a single query, you can use a Common Table Expression (CTE) with a recursive query in SQL. This approach allows you to traverse the hierarchical structure represented by your table. Below is an example of how you can do this: ```sql WITH RECURSIVE Descendants AS ( -- Anc...
27,967
[ { "from": "human", "value": "Let's say I have the following table:\nCustomerID ParentID Name\n========== ======== ====\n1 null John\n2 1 James\n3 2 Jenna\n4 3 Jennifer\n5 3 Peter\n6 5 Alice\n7 5 Stev...
I am running an english language version of WindowsXP, but have set Spanish as my only accepted language in Firefox. I had naively expected the browser's language to be set as the default when I load an applet in a browser session, but this does not appear to be the case. The applet starts up in English, the default la...
When it comes to Java applets running in a web browser, the language settings of the applet are not directly influenced by the language settings of the browser or operating system. Instead, the applet itself has its own environment, and it typically defaults to the language settings of the JVM (Java Virtual Machine) it...
25,661
[ { "from": "human", "value": "I am running an english language version of WindowsXP, but have set Spanish as my only accepted language in Firefox. I had naively expected the browser's language to be set as the default when I load an applet in a browser session, but this does not appear to be the case. The ap...
We are currently designing a website that will be accessed from kiosks in a museum. Users will need to be able to browse through a number of different web pages that will currently contain static HTML content as well as go through various interactive presentations that will be based on flash and run in flash player. Us...
Designing a website for kiosks in a museum that will also be accessible via the web presents unique challenges and opportunities. Below are some recommendations and considerations to help guide your project: ### General Recommendations 1. **Touchscreen Optimization**: - Ensure that the website is optimized for to...
24,533
[ { "from": "human", "value": "We are currently designing a website that will be accessed from kiosks in a museum. Users will need to be able to browse through a number of different web pages that will currently contain static HTML content as well as go through various interactive presentations that will be b...
I want to check for duplicated words right next to each other, but even if there is punctuation in between. For example: Vivamus Vivamus diam, diam, Vivamus Vivamus diam, diam Vivamus There should be four distinct hits here. I can't figure out why this isn't working. Why? What should the correct code be? (\w*(?:[ ,\.]...
To match duplicated words that may have punctuation in between them, the regex pattern you're using is slightly off. Here's how to correct it. You want to capture words that can be separated by optional spaces and punctuation. Your original regex is too restrictive and won't correctly match duplicates when punctuation...
27,174
[ { "from": "human", "value": "I want to check for duplicated words right next to each other, but even if there is punctuation in between.\nFor example:\nVivamus Vivamus diam, diam, Vivamus Vivamus diam, diam Vivamus\n\nThere should be four distinct hits here.\nI can't figure out why this isn't working. Why? ...
We are currently thinking of building a cache-system to hold data pulled out of an SQL database and make it available to a couple of other applications (website, webservice, etc). We imagine the cache to be running as a windows service and basically consist of a smart dictionary which holds the cache entries. My questi...
When designing a caching system for a Windows Server 2003 environment, it's essential to understand how memory management works in that operating system, particularly with regard to the limitations on application memory and the working set. 1. **Working Set Limitations**: The working set is the set of memory pages cur...
26,196
[ { "from": "human", "value": "We are currently thinking of building a cache-system to hold data pulled out of an SQL database and make it available to a couple of other applications (website, webservice, etc). We imagine the cache to be running as a windows service and basically consist of a smart dictionary...
Does it make sense to qualify bit fields as signed / unsigned?
Yes, it does make sense to qualify bit fields as signed or unsigned in C and C++. A bit field is a way to allocate a specific number of bits within a structure to represent an integer value. When defining a bit field, you can specify whether it should be treated as signed or unsigned. This affects how the values are in...
22,139
[ { "from": "human", "value": "Does it make sense to qualify bit fields as signed / unsigned?\n" }, { "from": "gpt", "value": "Yes, it does make sense to qualify bit fields as signed or unsigned in C and C++. A bit field is a way to allocate a specific number of bits within a structure to represen...
Is there any way to get own phone number by standard APIs from iPhone SDK?
As of my last knowledge update in October 2023, there is no standard API in the iOS SDK that allows developers to directly access the user's phone number programmatically. Apple places a strong emphasis on user privacy and security, and accessing sensitive user information, like a phone number, is restricted. If you n...
27,731
[ { "from": "human", "value": "Is there any way to get own phone number by standard APIs from iPhone SDK?\n" }, { "from": "gpt", "value": "As of my last knowledge update in October 2023, there is no standard API in the iOS SDK that allows developers to directly access the user's phone number progr...
I'm looking for an UPDATE statement where it will update a single duplicate row only and remain the rest (duplicate rows) intact as is, using ROWID or something else or other elements to utilize in Oracle SQL or PL/SQL? Here is an example duptest table to work with: CREATE TABLE duptest (ID VARCHAR2(5), NONID VARCHAR2...
To update a single duplicate row in an Oracle SQL table while leaving the others unchanged, you can utilize the `ROWID` to identify and target the specific duplicate row you wish to update. Given your `duptest` table with the specified data, here’s how you can achieve this: 1. You can use a subquery to get the `ROWID...
25,469
[ { "from": "human", "value": "I'm looking for an UPDATE statement where it will update a single duplicate row only and remain the rest (duplicate rows) intact \nas is, using ROWID or something else or other elements to utilize in Oracle SQL or PL/SQL?\nHere is an example duptest table to work with:\nCREATE T...
I was wondering if it is possible to do something like this: <uc1:TestControl ID="TestControl1" runat="server"> <div>More random HTML, etc...</div> </uc1:TestControl> I got an error of "Type 'System.Web.UI.UserControl' does not have a public property named 'div'.". Doing a little research, I found I c...
Yes, you can achieve this functionality, but with some additional setup in your custom server control or user control. The ability to include arbitrary HTML content within a user control (or server control) is facilitated by the `ParseChildren` attribute along with a custom property to hold the content. Here's how to...
25,229
[ { "from": "human", "value": "I was wondering if it is possible to do something like this:\n <uc1:TestControl ID=\"TestControl1\" runat=\"server\">\n <div>More random HTML, etc...</div>\n </uc1:TestControl>\n\nI got an error of \"Type 'System.Web.UI.UserControl' does not have a public property n...
getEmployeeNameByBatchId(int batchID) getEmployeeNameBySSN(Object SSN) getEmployeeNameByEmailId(String emailID) getEmployeeNameBySalaryAccount(SalaryAccount salaryAccount) or getEmployeeName(int typeOfIdentifier, byte[] identifier) -> In this methods the typeOfIdentifier tells if identifier is batchID/SSN/emailID/salar...
Choosing the right method design for your use case in a servlet API depends on several factors including clarity, usability, and maintainability. Let's evaluate the two approaches you've provided: ### Option 1: Individual Methods ```java getEmployeeNameByBatchId(int batchID); getEmployeeNameBySSN(Object SSN); getEmplo...
12,544
[ { "from": "human", "value": "getEmployeeNameByBatchId(int batchID)\ngetEmployeeNameBySSN(Object SSN)\ngetEmployeeNameByEmailId(String emailID)\ngetEmployeeNameBySalaryAccount(SalaryAccount salaryAccount)\nor\ngetEmployeeName(int typeOfIdentifier, byte[] identifier) -> In this methods the typeOfIdentifier te...
I use Visual Studio's "Code Snippet" feature pretty heavily while editing c# code. I always wished I could use them while typing out my aspx markup. Is there a way to enable code snippet use in an aspx file editor window? Are there any third party tools that perform this? If you're familiar with code snippet definit...
As of my last knowledge update in October 2023, Visual Studio does not natively support code snippets in ASPX markup files the same way it does for C# code files. However, you can explore a few workarounds and third-party tools that may help you achieve similar functionality. ### Workarounds 1. **Using HTML Snippets*...
26,067
[ { "from": "human", "value": "I use Visual Studio's \"Code Snippet\" feature pretty heavily while editing c# code. I always wished I could use them while typing out my aspx markup. \nIs there a way to enable code snippet use in an aspx file editor window?\nAre there any third party tools that perform this?...
I've got a Method that gets a IDictionary as a parameter. Now I want to provide a method that retrieves the value from this dictionary, but it should be case-invariant. So my solution to this right now was to have a static function that loops through the keys and converts them toLower() like this: private static IDicti...
Certainly! Instead of creating a new dictionary with keys converted to lower case, you can utilize a `Dictionary<string, string>` that is case-insensitive from the start. The `Dictionary<TKey, TValue>` class has a constructor that allows you to specify a case-insensitive comparer. Here's how you can modify your method ...
26,118
[ { "from": "human", "value": "I've got a Method that gets a IDictionary as a parameter.\nNow I want to provide a method that retrieves the value from this dictionary, but it should be case-invariant.\nSo my solution to this right now was to have a static function that loops through the keys and converts them...
When we submit a job, the following steps are executed sequentially. Then what is the importance of DPRTY?
In the context of job scheduling, DPRTY usually refers to "Dynamic Priority." Dynamic priority scheduling is a method used by operating systems to manage the execution order of jobs based on their priority levels, which can change during runtime based on certain criteria. The importance of DPRTY or dynamic priority ca...
27,905
[ { "from": "human", "value": "When we submit a job, the following steps are executed sequentially.\nThen what is the importance of DPRTY?\n" }, { "from": "gpt", "value": "In the context of job scheduling, DPRTY usually refers to \"Dynamic Priority.\" Dynamic priority scheduling is a method used b...
I listen to the podcast java posse, on this there is often discussion about components (note components are not (clearly) objects). They lament the fact that Java does not have components, and contrast with .NET that does. Components apparently makes developing applications (not just GUI apps) easier. I can figure f...
The concept of components in software development is indeed an important one, especially when comparing different programming paradigms and frameworks. Here's a breakdown of your questions regarding components and how they differ in Java and .NET: ### 1. What is a Component? A component can be defined as a modular, r...
22,527
[ { "from": "human", "value": "I listen to the podcast java posse, on this there is often discussion about components (note components are not (clearly) objects). They lament the fact that Java does not have components, and contrast with .NET that does. Components apparently makes developing applications (...
How can I play audio (it would be like a 1 second sound) from a Python script? It would be best if it was platform independent, but firstly it needs to work on a Mac. I know I could just execute the afplay file.mp3 command from within Python, but is it possible to do it in raw Python? I would also be better if it didn'...
Playing audio in Python without relying on external libraries can be a bit challenging, especially if you want it to be platform-independent. However, you can use built-in libraries to achieve this, particularly for MacOS. ### Using the `os` module While it's not "pure Python," you can use the `os` module to execute ...
27,707
[ { "from": "human", "value": "How can I play audio (it would be like a 1 second sound) from a Python script?\nIt would be best if it was platform independent, but firstly it needs to work on a Mac.\nI know I could just execute the afplay file.mp3 command from within Python, but is it possible to do it in raw...
I am trying to override the DataGridViewTextBoxCell's paint method in a derived class so that I can indent the foreground text by some variable amount of pixels. I would like it if the width of the column adjusts so that its total width is the length of my cells text plus the "buffer" indent. Does anyone know of a wa...
To properly override the `Paint` method for a `DataGridViewTextBoxCell` in order to indent text and adjust the column width dynamically, you will need to ensure two things: 1. You can accurately measure the width of the text including the indent, so you can adjust the column width accordingly. 2. The text rendering wi...
24,058
[ { "from": "human", "value": "I am trying to override the DataGridViewTextBoxCell's paint method in a derived class so that I can indent the foreground text by some variable amount of pixels. I would like it if the width of the column adjusts so that its total width is the length of my cells text plus the \...