instruction
stringlengths
14
27.6k
completion
stringlengths
3
38.3k
__original_row_idx
int64
0
50k
conversations
listlengths
2
2
I am currently looking at developing a mobile apps for the S60 platform and is specifically looking at PyS60. It seems to suggest that the it can be compiled into native .sis files without the need for an embedded python interpreter. Reading through the documentations I could not find any statements where this is expli...
Yes, you are correct that PyS60 allows you to develop mobile applications for the S60 platform using Python. One of the key advantages of using PyS60 is that it can compile your Python scripts into native .sis files, which are the installation packages used by Symbian OS devices. This means that your application can be...
46,434
[ { "from": "human", "value": "I am currently looking at developing a mobile apps for the S60 platform and is specifically looking at PyS60. It seems to suggest that the it can be compiled into native .sis files without the need for an embedded python interpreter. Reading through the documentations I could no...
I want to index a computed column in my database table which uses a number of user defined functions. However I just learned that my column is non-deterministic. Without indexing its going to be way to slow to run queries that I need. What's the best way of tracing through user defined functions to determine whether th...
In SQL Server, for a computed column to be indexed, it must be deterministic, which means that the same input will always produce the same output. If your computed column uses user-defined functions (UDFs), those functions must also be deterministic for the entire expression to be considered deterministic. ### Determi...
44,617
[ { "from": "human", "value": "I want to index a computed column in my database table which uses a number of user defined functions. However I just learned that my column is non-deterministic.\nWithout indexing its going to be way to slow to run queries that I need.\nWhat's the best way of tracing through use...
I am trying to synchronize the horizontal scroll position of 2 WPF DataGrid controls. I am subscribing to the ScrollChanged event of the first DataGrid: <toolkit:DataGrid x:Name="SourceGrid" ScrollViewer.ScrollChanged="SourceGrid_ScrollChanged"> I have a second DataGrid: <toolkit:DataGrid x:Name="TargetGrid"> In the ...
Synchronizing the horizontal scroll position of two WPF DataGrids can indeed be a bit challenging, especially when you are dealing with frozen columns. Since DataGrid itself does not implement `IScrollInfo`, we need to dig a bit deeper to find a way to synchronize their scroll positions. ### Solution To achieve horiz...
45,372
[ { "from": "human", "value": "I am trying to synchronize the horizontal scroll position of 2 WPF DataGrid controls.\nI am subscribing to the ScrollChanged event of the first DataGrid:\n<toolkit:DataGrid x:Name=\"SourceGrid\" ScrollViewer.ScrollChanged=\"SourceGrid_ScrollChanged\">\n\nI have a second DataGrid...
If a form in Access DB is set as hidden. Then how to unhide it? so that we can manipulate the form programmentically using vb.net. Thank you.
To unhide a hidden form in an Access database programmatically using VB.NET, you will typically need to use the Access Automation Object Model. The following steps outline the process to unhide a hidden form in an Access database from VB.NET: 1. **Add a Reference to the Access Library**: You need to add a reference to...
48,141
[ { "from": "human", "value": "If a form in Access DB is set as hidden. Then how to unhide it? so that we can manipulate the form programmentically using vb.net.\nThank you.\n" }, { "from": "gpt", "value": "To unhide a hidden form in an Access database programmatically using VB.NET, you will typic...
Not sure if this is intended behavior or a bug or a wrong function that I'm using, but the problem is that PathCombine() returns a wrong path on a Vista box. The relative path is (as exported by the WMP to a playlist): ..\..\..\Public\Music\Sample Music\Amanda.wma The path it's relative to is: C:\Users\userX\Music\Play...
It looks like you're encountering an issue related to how the `PathCombine()` function processes relative paths on Windows Vista. The expected behavior of `PathCombine()` is to combine a base path with a relative path, but it can be affected by the specifics of the provided paths. In your case, the relative path is `....
45,240
[ { "from": "human", "value": "Not sure if this is intended behavior or a bug or a wrong function that I'm using, but the problem is that PathCombine() returns a wrong path on a Vista box.\nThe relative path is (as exported by the WMP to a playlist):\n..\\..\\..\\Public\\Music\\Sample Music\\Amanda.wma\nThe p...
I have a classic 3-tier ASP.Net 3.5 web application with forms that display business objects and allow them to be edited. Controls on the form correspond to a property of the underlying business object. The user will have read/write, readonly, or no access to the various controls depending on his/her role. Very convent...
Certainly! Managing access to controls based on user roles can become cumbersome if handled directly in the code-behind for each control. Here are some object-oriented best practices to create a more elegant and maintainable solution: ### 1. **Role-Based Access Control (RBAC) Policy** Instead of directly checking user...
45,798
[ { "from": "human", "value": "I have a classic 3-tier ASP.Net 3.5 web application with forms that display business objects and allow them to be edited. Controls on the form correspond to a property of the underlying business object. The user will have read/write, readonly, or no access to the various control...
How do you plot bar charts in gnuplot with text labels?
To create bar charts in Gnuplot with text labels, you can use the `set style data` to specify the bar style and then use the `plot` command to add the data along with the text labels. Below is an example of how to create a simple bar chart with text labels. ### Step-by-Step Example 1. **Prepare Data**: First, you nee...
45,215
[ { "from": "human", "value": "How do you plot bar charts in gnuplot with text labels?\n" }, { "from": "gpt", "value": "To create bar charts in Gnuplot with text labels, you can use the `set style data` to specify the bar style and then use the `plot` command to add the data along with the text la...
This is a follow-up question to this one. Take a look at these two examples: var number1 = new Number(3.123); number1 = number1.toFixed(2); alert(number1); var number2 = 3.123; number2 = number2.toFixed(2); alert(number2); I realize they both end up with the same value, but is it correct thinking to refer to a meth...
Great question! Let's break down the concepts involved in JavaScript when dealing with primitive values and their methods. In JavaScript, primitive values (such as numbers, strings, booleans, etc.) are not objects by themselves, but JavaScript provides a mechanism that allows you to access methods associated with thes...
46,904
[ { "from": "human", "value": "This is a follow-up question to this one.\nTake a look at these two examples: \nvar number1 = new Number(3.123);\nnumber1 = number1.toFixed(2); \nalert(number1);\n\nvar number2 = 3.123;\nnumber2 = number2.toFixed(2);\nalert(number2);\n\nI realize they both end up with the same v...
We all know that premature optimization is the root of all evil because it leads to unreadable/unmaintainable code. Even worse is pessimization, when someone implements an "optimization" because they think it will be faster, but it ends up being slower, as well as being buggy, unmaintainable, etc. What is the most ri...
One of the most ridiculous examples of pessimization I’ve encountered involved a simple string concatenation operation in a large codebase. Initially, the code used a straightforward method of concatenating strings using the `+` operator in a loop, which was readable and easy to understand: ```python result = "" for i...
47,918
[ { "from": "human", "value": "We all know that premature optimization is the root of all evil because it leads to unreadable/unmaintainable code. Even worse is pessimization, when someone implements an \"optimization\" because they think it will be faster, but it ends up being slower, as well as being buggy...
I'm deserializing a class called Method using .NET Serialization. Method contains a list of objects implementing IAction. I originally used the [XmlInclude] attribute to specify all classes which implement IAction. But now, I'd like to change my program to load all the dll's in a directory and strip out the classes wh...
In .NET Serialization, particularly with XML serialization, the `[XmlInclude]` attribute is a way to specify derived types that may be present in a base class's list during serialization and deserialization. However, if you can't modify the implementing classes to include the `[XmlInclude]` attribute (which is common w...
49,180
[ { "from": "human", "value": "I'm deserializing a class called Method using .NET Serialization. Method contains a list of objects implementing IAction. I originally used the [XmlInclude] attribute to specify all classes which implement IAction. \nBut now, I'd like to change my program to load all the dll's i...
Is it possible to create an HTML email signature for Outlook 2003 or above that doesn't reference external images? That is, using those special "cid" reference but embed the image itself in the signature and not on the file system or network. This is for an web application that generates a "standard" email signature ba...
Creating an HTML email signature with embedded images using CID (Content-ID) references can be done, but it does require specific handling for each image that you want to embed. Here’s a brief explanation of how you can achieve this in Outlook 2003 and above: ### Steps to Create an HTML Email Signature with Embedded I...
48,821
[ { "from": "human", "value": "Is it possible to create an HTML email signature for Outlook 2003 or above that doesn't reference external images?\nThat is, using those special \"cid\" reference but embed the image itself in the signature and not on the file system or network.\nThis is for an web application t...
I've been developing an internal website for a portfolio management tool. There is a lot of text data, company names etc. I've been really impressed with some search engines ability to very quickly respond to queries with "Did you mean: xxxx". I need to be able to intelligently take a user query and respond with not ...
Creating a "Did you mean?" feature in your portfolio management tool can significantly enhance the user experience by helping them find the correct terms when they make typographical errors or use synonyms. Here’s a structured approach to implement this feature in your ASP.NET application: ### Step 1: Build a Dictiona...
46,133
[ { "from": "human", "value": "I've been developing an internal website for a portfolio management tool. There is a lot of text data, company names etc. I've been really impressed with some search engines ability to very quickly respond to queries with \"Did you mean: xxxx\".\nI need to be able to intellige...
Vim is acting slow when I scroll. The cursor skips some lines when I'm pressing j/k continually. I'm using xterm and urxvt. In both vim acts like this. This happens locally, with small or big files. I do use Control + F/B they work just fine. EDIT: ttyfast in small files did the trick but in bigger is the same. When ru...
It sounds like you're experiencing performance issues with Vim when scrolling through files, especially when using the `j` and `k` keys. Since you've already identified that using `ttyfast` improves performance with smaller files, but not with larger ones, the issue might be related to your Vim configuration or the ter...
44,714
[ { "from": "human", "value": "Vim is acting slow when I scroll. The cursor skips some lines when I'm pressing j/k continually.\nI'm using xterm and urxvt. In both vim acts like this.\nThis happens locally, with small or big files. I do use Control + F/B they work just fine.\nEDIT: ttyfast in small files did ...
Is there any good way to unit test destructors? Like say I have a class like this (contrived) example: class X { private: int *x; public: X() { x = new int; } ~X() { delete x; } int *getX() {return x;} const int *getX() const {return x;} }; Is there any good wa...
Testing destructors, especially in classes that manage dynamic memory, can indeed be challenging. The difficulty arises because once the object is destroyed, you typically cannot check the state of its members directly. However, there are several strategies you can employ to effectively test destructors without clutter...
46,807
[ { "from": "human", "value": "Is there any good way to unit test destructors? Like say I have a class like this (contrived) example:\nclass X\n{\nprivate:\n int *x;\n\npublic:\n X()\n {\n x = new int;\n }\n\n ~X()\n {\n delete x;\n }\n\n int *getX() {return x;}\n c...
In linux, if I have a file I'm sharing with a group, and I put the file on a USB memory stick, for example, and copy it to a computer that doesn't have the same group or users, does the file have no permissions for anyone on that new computer? What if I bring a linux file that only lets user X to read it to a windows ...
When you copy files between different operating systems, the way permissions and ownership are handled can vary significantly. Here’s a breakdown of what happens in each scenario you mentioned: ### Copying a Linux file to another Linux machine 1. **Same User/Group**: If you copy a file from one Linux machine to anoth...
45,381
[ { "from": "human", "value": "In linux, if I have a file I'm sharing with a group, and I put the file on a USB memory stick, for example, and copy it to a computer that doesn't have the same group or users, does the file have no permissions for anyone on that new computer? What if I bring a linux file that ...
Is there any way in Linq to check to see if a record of a parent exists in its children? I have a table that has a foreign key relationship with 12 other tables. All I want to do is see if any records in those child tables depend on the parent, so I can delete it without causing errors with FK constraints. Thanks guy...
Certainly! In LINQ, you can check for the existence of related records in child tables before attempting to delete a record from a parent table. While you've created an extension method to handle this, you can also streamline this process using a more generalized approach that checks all related tables in a more concis...
49,367
[ { "from": "human", "value": "Is there any way in Linq to check to see if a record of a parent exists in its children? \nI have a table that has a foreign key relationship with 12 other tables. All I want to do is see if any records in those child tables depend on the parent, so I can delete it without causi...
I have a multi-browser page that shows vertical text. As an ugly hack to get text to render vertically in all browsers I've created a custom page handler that returns a PNG with the text drawn vertically. Here's my basic code (C#3, but small changes to any other version down to 1): Font f = GetSystemConfiguredFont(); /...
The issue you're experiencing with the jagged edges of the text in your PNG images can often be related to how GDI+ handles anti-aliasing and the format of the bitmap you're creating. Below are steps to improve the rendering quality of your vertical text and achieve the desired transparency. ### Key Changes: 1. **Ena...
49,360
[ { "from": "human", "value": "I have a multi-browser page that shows vertical text.\nAs an ugly hack to get text to render vertically in all browsers I've created a custom page handler that returns a PNG with the text drawn vertically.\nHere's my basic code (C#3, but small changes to any other version down t...
I'm trying to adhere to the VS2005 code analysis rules for a new project. I have this method: public void Dispose() { Console.WriteLine("Dispose() called"); Dispose( true ); GC.SuppressFinalize(this); } (The console call will become a log4net call at some point, and we're always interested in logging disp...
The issue you're facing is due to the way that the `Dispose()` method is structured and how code analysis rules are evaluated in Visual Studio 2005. The `CA1063` rule indicates that your `Dispose()` implementation should adhere to a specific pattern that helps ensure the class is properly disposed of. The problem here...
47,869
[ { "from": "human", "value": "I'm trying to adhere to the VS2005 code analysis rules for a new project. I have this method:\npublic void Dispose()\n{\n Console.WriteLine(\"Dispose() called\");\n Dispose( true );\n GC.SuppressFinalize(this);\n}\n\n(The console call will become a log4net call at some...
I'm trying to develop some SharePoint workflows for the company I work for, and I'm not too familiar with the ins and outs of the technology. Normally when I want to familiarize myself with something, I just play with it, look at the properties, find all the methods, etc. When I fire up Visual Studio and try to crea...
Yes, developing SharePoint workflows typically requires some specific setup, especially in terms of referencing the necessary assemblies like `Microsoft.SharePoint.dll`. Here are a few key points to help you understand how to work with SharePoint workflows effectively in a multi-developer environment: ### 1. **Develop...
48,153
[ { "from": "human", "value": "I'm trying to develop some SharePoint workflows for the company I work for, and I'm not too familiar with the ins and outs of the technology. Normally when I want to familiarize myself with something, I just play with it, look at the properties, find all the methods, etc. \nWh...
I'm trying to create a horizontal navigation bar in css with 5 evenly spaced links. The html hopefully will remain like this: <div id="footer"> <ul> <li><a href="one.html">One</a></li> <li><a href="two.html">Two</a></li> <li><a href="three.html">Three</a></li> <li><a href="four.html"...
The spacing you're experiencing between your list items (`<li>`) is likely caused by the whitespace between the inline-block elements, as well as the vertical alignment of those elements. When using `display: inline-block`, any space (including newlines or spaces in your HTML) between the elements will create an additi...
46,966
[ { "from": "human", "value": "I'm trying to create a horizontal navigation bar in css with 5 evenly spaced links. The html hopefully will remain like this:\n<div id=\"footer\">\n <ul>\n <li><a href=\"one.html\">One</a></li>\n <li><a href=\"two.html\">Two</a></li>\n <li><a href=\"three...
How could I add a config element in config file in Net 2.0 that would be placed under existing structure that is defined in different assembly? In my case I have some core library that creates root section (and already some other settings) in config file (using company name for name of the root element, section). In ot...
To add a new configuration element under an existing structure defined in a different assembly using .NET Framework 2.0, you can extend the existing configuration by creating a custom configuration section and merging it into the existing structure. This approach will allow you to add your specific settings without dup...
41,608
[ { "from": "human", "value": "How could I add a config element in config file in Net 2.0 that would be placed under existing structure that is defined in different assembly?\nIn my case I have some core library that creates root section (and already some other settings) in config file (using company name for...
been searching for a quick example of sorting a IQueryable (Using Linq To SQL) using a Aggregate value. I basically need to calculate a few derived values (Percentage difference between two values etc) and sort the results by this. i.e. return rows.OrderBy(Function(s) CalcValue(s.Visitors, s.Clicks)) I want to call an ...
In LINQ to SQL, you cannot use `IComparer` or `IComparable` directly for sorting since the LINQ to SQL provider needs to translate your query into SQL. This means you should use lambda expressions or the methods provided by LINQ to perform sorting. To achieve your goal of sorting `IQueryable<Statistic>` by a calculate...
49,862
[ { "from": "human", "value": "been searching for a quick example of sorting a IQueryable (Using Linq To SQL) using a Aggregate value.\nI basically need to calculate a few derived values (Percentage difference between two values etc) and sort the results by this.\ni.e.\nreturn rows.OrderBy(Function(s) CalcVal...
One-to-one relations within nhibernate can be lazyloaded either "false" or "proxy". I was wondering if anyone knows a way to do a lazy one-to-one mapping. I worked out a hack to achieve the same result by using a lazy set mapped to a private field, and having the public property return the first result of that set. It ...
In NHibernate, implementing a lazy-loading mechanism for a one-to-one relationship can indeed be a bit tricky, especially since one-to-one associations typically do not support lazy loading natively as one-to-many or many-to-one associations do. However, there are ways to achieve a similar effect while maintaining code...
49,561
[ { "from": "human", "value": "One-to-one relations within nhibernate can be lazyloaded either \"false\" or \"proxy\". I was wondering if anyone knows a way to do a lazy one-to-one mapping.\nI worked out a hack to achieve the same result by using a lazy set mapped to a private field, and having the public pro...
I have two services that require an XPathDocument. I want to be able to define named instances of XPathDocumnet to use in the configuration of the two services. I also want to be able to tell StuctureMap which constructor of XPathDocument to use. When I try to get an instance of XPathDocument it tells me that it can't ...
To configure StructureMap to use named instances of `XPathDocument` with constructors that require a `string uri` for XML files, you can make use of the `CtorArg` method to correctly specify the arguments needed for the constructor. However, in your current configuration, it looks like you're using `EqualToAppSetting`...
44,307
[ { "from": "human", "value": "I have two services that require an XPathDocument. I want to be able to define named instances of XPathDocumnet to use in the configuration of the two services. I also want to be able to tell StuctureMap which constructor of XPathDocument to use. When I try to get an instance of...
What is the C++ equivalent to GetObject in JavaScript and VBScript? The closest match I found to my question is: http://codewiz51.blogspot.com/2008/06/vb-script-getobject-c-api-cogetobject.html However the sample use an unexisting interface and asking for the IUnknown returns null. Did someone have an example that work...
In JavaScript and VBScript, the `GetObject` function is used to access an existing object (such as a COM object) that is registered in the system. In C++, there is no direct equivalent to `GetObject`, but you can use COM (Component Object Model) to achieve similar functionality. Below is a simplified example of how to...
43,958
[ { "from": "human", "value": "What is the C++ equivalent to GetObject in JavaScript and VBScript?\nThe closest match I found to my question is:\nhttp://codewiz51.blogspot.com/2008/06/vb-script-getobject-c-api-cogetobject.html\nHowever the sample use an unexisting interface and asking for the IUnknown returns...
How do I make gdb print functions of interest as they are called, indented according to how deep in the stack they are? I want to be able to say something like (made up): (gdb) trace Foo* Bar* printf And have gdb print all functions which begin with Foo or Bar, as they are called. Kind of like gnu cflow, except using ...
To achieve the functionality you want in GDB, you can use the built-in tracing feature combined with a few custom commands. Below is a step-by-step guide that will help you trace function calls according to your specifications: ### Step 1: Setting Up a GDB Script You can create a GDB script to define commands for tra...
46,627
[ { "from": "human", "value": "How do I make gdb print functions of interest as they are called, indented according to how deep in the stack they are?\nI want to be able to say something like (made up):\n(gdb) trace Foo* Bar* printf\n\nAnd have gdb print all functions which begin with Foo or Bar, as they are ...
In a .NET 1.0 C# application, I wish to display a list of files and folders in a listview control. I want to programmatically retrieve from windows the icons for the files or folders to display them appropriately in the list view. At present, I am using the Windows API Shell32.dll, but am having problems with the alpha...
To retrieve and display icons for files and folders in a .NET application while correctly handling the alpha channel, you can follow this approach, which improves upon your existing code. The main issue with black backgrounds in icons often arises from how you are handling the icon handles after retrieving them from th...
47,012
[ { "from": "human", "value": "In a .NET 1.0 C# application, I wish to display a list of files and folders in a listview control. I want to programmatically retrieve from windows the icons for the files or folders to display them appropriately in the list view.\nAt present, I am using the Windows API Shell32....
I'm trying to write a (sh -bourne shell) script that processes lines as they are written to a file. I'm attempting to do this by feeding the output of tail -f into a while read loop. This tactic seems to be proper based on my research in Google as well as this question dealing with a similar issue, but using bash. From...
The behavior you're experiencing is due to how `tail -f` works in conjunction with the `while read` loop. The `tail -f` command will keep running indefinitely, following the file for new lines, and will not terminate when the file is deleted. Instead, it will continue to wait for additional data to appear. To create a...
40,836
[ { "from": "human", "value": "I'm trying to write a (sh -bourne shell) script that processes lines as they are written to a file. I'm attempting to do this by feeding the output of tail -f into a while read loop. This tactic seems to be proper based on my research in Google as well as this question dealing w...
I have an ASP.Net hosted website which displays a list of results as a DataGrid or ASP.Net Repeater with paging of results. If one scrolls quickly through the pages by pressing the Previous/Next tabs sometimes an HttpUnhandledException is thrown and the debug page rendered instead of the next listing of results. The de...
The issue you're encountering with `HttpUnhandledException` and the `Invalid postback or callback argument` error often arises due to the event validation mechanism in ASP.NET. This mechanism ensures that the data posted back to the server comes from the original page state, which helps prevent cross-site scripting (XS...
46,856
[ { "from": "human", "value": "I have an ASP.Net hosted website which displays a list of results as a DataGrid or ASP.Net Repeater with paging of results.\nIf one scrolls quickly through the pages by pressing the Previous/Next tabs sometimes an HttpUnhandledException is thrown and the debug page rendered inst...
I am having an VB Script. I need to log the error information in a file. I need to log every information like error number error description and in which sub routine does the error occured. Please provide some code
Certainly! You can create a logging function in your VBScript that captures error information, including the error number, error description, and the name of the subroutine where the error occurred. Below is an example of how you might implement this: ```vbscript Option Explicit ' Function to log error details to a f...
33,172
[ { "from": "human", "value": "I am having an VB Script. I need to log the error information in a file. I need to log every information like error number error description and in which sub routine does the error occured.\nPlease provide some code\n" }, { "from": "gpt", "value": "Certainly! You can...
I have a simple row that I edit using LINQ. It has about 30 columns, including a primary key numeric sequence. When an UPDATE is performed through LINQ, the UPDATE statement includes all the columns of the table (for concurrency checking). I'm wondering how inefficient this is - if not negligibiel. Since there is an i...
The inefficiency you're experiencing with your LINQ-to-SQL update can indeed arise from the way that LINQ handles updates by checking all fields for concurrency. When you perform an update, LINQ will include all the columns in the `UPDATE` statement, which can lead to performance issues if the table has many columns (l...
47,555
[ { "from": "human", "value": "I have a simple row that I edit using LINQ. It has about 30 columns, including a primary key numeric sequence.\nWhen an UPDATE is performed through LINQ, the UPDATE statement includes all the columns of the table (for concurrency checking). \nI'm wondering how inefficient this i...
I am outputting RTF from a word processor component. This is working well, but there is a specific situation that is failing in that it causes Word 2000 to corrupt the document. Word 2007 is fine with the RTF though, which implies they fixed something. However, I need to be able to output RTF which will work with any v...
The issue you're facing with RTF compatibility between Word 2000 and Word 2007 likely stems from how RTF handles list formatting and paragraph resets. Since Word 2000 is more sensitive to RTF specifications, it's crucial to ensure that your RTF code explicitly resets the list formatting without causing Word 2000 to mis...
44,816
[ { "from": "human", "value": "I am outputting RTF from a word processor component. This is working well, but there is a specific situation that is failing in that it causes Word 2000 to corrupt the document. Word 2007 is fine with the RTF though, which implies they fixed something. However, I need to be able...
I have a web page that loads some data via a SQL query into a datagrid. I was asked to add a new column. During testing I discovered that pulling this extra column of data from the database slows the query down substantially. What used to be a sub-second query now takes about 3-4 seconds. I've checked the database and...
Certainly! What you’re trying to achieve is a great way to improve user experience by reducing the initial load time while still providing the additional data when it’s needed. Below are the steps to implement this approach using AJAX. I’ll assume you are using a technology stack that includes HTML, JavaScript (possibl...
43,029
[ { "from": "human", "value": "I have a web page that loads some data via a SQL query into a datagrid. I was asked to add a new column. During testing I discovered that pulling this extra column of data from the database slows the query down substantially. What used to be a sub-second query now takes about 3-...
I have an application that uses many different .NET managed DLL's as objects (each DLL implements a common interface). Each DLL also has a version number in the file name. Suppose I create the object "Shape~01.dll." The application will use that DLL but it can't be replaced while the application is running. So, if I...
Yes, there are several strategies you can use to make your application more flexible and allow for dynamic loading and unloading of plugins or modules without requiring a restart or rebuild of the main application. Here are some approaches to consider: ### 1. **Use a Plugin Architecture with Dependency Injection** You...
46,962
[ { "from": "human", "value": "I have an application that uses many different .NET managed DLL's as objects (each DLL implements a common interface). Each DLL also has a version number in the file name.\nSuppose I create the object \"Shape~01.dll.\" The application will use that DLL but it can't be replaced...
I use some wx.ListCtrl classes in wx.LC_REPORT mode, augmented with ListCtrlAutoWidthMixin. The problem is: When user double clicks the column divider (to auto resize column), column width is set to match the width of contents. This is done by the wx library and resizes column to just few pixels when the control is emp...
In wxPython, you can indeed face challenges when trying to manage column widths dynamically, especially when you want to ensure that a column doesn't shrink below a certain minimum width, even when empty. Below, I'll provide a solution that combines the use of events and some custom logic to enforce a minimum width for...
48,543
[ { "from": "human", "value": "I use some wx.ListCtrl classes in wx.LC_REPORT mode, augmented with ListCtrlAutoWidthMixin.\nThe problem is: When user double clicks the column divider (to auto resize column), column width is set to match the width of contents. This is done by the wx library and resizes column ...
Does anyone know any good .net libraries for working with PDAs and such? I mainly looking for something that will allow me to copy files to/from devices and do some registry work on the device. The PDAs are running windows mobile 5 & 6 I have been using the OpenNETCF.Desktop.Communication.RAPI library in a couple of...
When working with PDAs running Windows Mobile 5 and 6, there are a few libraries and tools that can help you manage file transfers and registry access. Here are some options to consider in addition to the OpenNETCF.Desktop.Communication.RAPI library: 1. **Microsoft Windows Mobile SDK**: The SDK provides tools and libr...
44,775
[ { "from": "human", "value": "Does anyone know any good .net libraries for working with PDAs and such? \nI mainly looking for something that will allow me to copy files to/from devices and do some registry work on the device. The PDAs are running windows mobile 5 & 6\nI have been using the OpenNETCF.Deskto...
I need to use the ReSharper Unit Test Runner to run my MSTest Unit Tests on VS 2008. I have heard of using "Gallio" to do this but I don't know what Gallio is (it seemed like some all purpose VS extensibility framework). Does anyone know the best way to run MSTest Unit Tests using ReSharper Test Runner?
ReSharper is a powerful tool for .NET development that includes a built-in unit test runner supporting various test frameworks, including MSTest. However, as of the last updates, there can be some limitations with older versions of Visual Studio (like VS 2008) when it comes to integrating with some testing frameworks. ...
44,736
[ { "from": "human", "value": "I need to use the ReSharper Unit Test Runner to run my MSTest Unit Tests on VS 2008. I have heard of using \"Gallio\" to do this but I don't know what Gallio is (it seemed like some all purpose VS extensibility framework). Does anyone know the best way to run MSTest Unit Tests...
I would like to hear of the experiences of classic vb developers who migrated their applications to delphi rather than vb.net. How has it worked out? Are you glad or sorry that you didn't move to vb.net?
Migrating from classic Visual Basic (VB) to Delphi rather than VB.NET is an interesting choice that some developers have made. Here are some common experiences and insights from those who have taken this path: ### Positive Experiences: 1. **Performance**: Many developers have noted that Delphi applications tend to hav...
44,982
[ { "from": "human", "value": "I would like to hear of the experiences of classic vb developers who migrated their applications to delphi rather than vb.net. How has it worked out? Are you glad or sorry that you didn't move to vb.net? \n" }, { "from": "gpt", "value": "Migrating from classic Visual...
i have the following javascript code: http://www.nomorepasting.com/getpaste.php?pasteid=22561 Which works fine(the makewindows function has been changed to show it is a php variable), however the html contains unicode characters, and will only be assigned characters leading up to the first unicode character. If I make ...
It sounds like you are dealing with a character encoding issue when fetching data from your MySQL database and rendering it in your PHP application. Here’s a concise summary of what might have happened and how to address such issues. ### Problem Explanation When your HTML output contains Unicode characters and is bein...
47,312
[ { "from": "human", "value": "i have the following javascript code:\nhttp://www.nomorepasting.com/getpaste.php?pasteid=22561\nWhich works fine(the makewindows function has been changed to show it is a php variable), however the html contains unicode characters, and will only be assigned characters leading up...
When deploying the application to the device, the program will quit after a few cycles with the following error: Program received signal: "EXC_BAD_ACCESS". The program runs without any issue on the iPhone simulator, it will also debug and run as long as I step through the instructions one at a time. As soon as I let i...
Yes, encountering the `EXC_BAD_ACCESS` error can be quite frustrating, particularly when it occurs on a physical device but not in the simulator. This error is typically indicative of attempting to access memory that has been deallocated or that you do not have permission to access. Here are some strategies and debuggi...
42,420
[ { "from": "human", "value": "When deploying the application to the device, the program will quit after a few cycles with the following error:\nProgram received signal: \"EXC_BAD_ACCESS\".\n\nThe program runs without any issue on the iPhone simulator, it will also debug and run as long as I step through the ...
How can I set a custom background color of a button? Interface Builder doesn't seem to have an interface to do this. Is it only available programmatically? If so, can you provide an example, please?
In Interface Builder (IB), you can customize the appearance of UIButton, including the background color, directly in the Attributes Inspector. However, if you prefer to do this programmatically or need more customization, you can certainly set the background color of a button in code. Here's how to set the background ...
46,143
[ { "from": "human", "value": "How can I set a custom background color of a button? \nInterface Builder doesn't seem to have an interface to do this. \nIs it only available programmatically? \nIf so, can you provide an example, please?\n" }, { "from": "gpt", "value": "In Interface Builder (IB), yo...
How can I count how many previous FootNoteReference nodes there are in an xml doc such as this... <MyDoc> <title>&lt;Big Title&gt;</title> <head>Objective</head> <head2>&lt;Heading&gt;</head2> <head>Introduction</head> <Para> asdf asdf asdf asd<FootNoteReference />asdf asdf asfd asfd </Para> <head>Overview</head> ...
To count the number of `FootNoteReference` nodes that precede a given `FootNoteReference` node in an XML document, regardless of the nesting level, you can utilize XPath expressions. Since XPath operates in a hierarchical manner, you can make use of the `//` operator to find all preceding `FootNoteReference` nodes in t...
46,246
[ { "from": "human", "value": "How can I count how many previous FootNoteReference nodes there are in an xml doc such as this...\n<MyDoc>\n<title>&lt;Big Title&gt;</title>\n<head>Objective</head>\n<head2>&lt;Heading&gt;</head2>\n<head>Introduction</head>\n<Para>\n asdf asdf asdf asd<FootNoteReference />asd...
I need to send PUT and DELETE along with POST, GET to a REST API how can I do it?
To interact with a REST API using various HTTP methods such as POST, GET, PUT, and DELETE, you can use libraries in different programming languages to make HTTP requests. Below are examples of how to accomplish this in a few popular programming languages using their respective libraries. ### Using Python with `request...
43,825
[ { "from": "human", "value": "I need to send PUT and DELETE along with POST, GET to a REST API how can I do it?\n" }, { "from": "gpt", "value": "To interact with a REST API using various HTTP methods such as POST, GET, PUT, and DELETE, you can use libraries in different programming languages to m...
I'm trying to get a Server application to expose some status information using WCF. In particular I'm after using WCF services with RESTful "API". I'm hitting somewhat of a wall when it comes to consuming the REST api from a silverlight app/page that I want to have as an additional type of client... So far I've been su...
It appears you're facing challenges with consuming a WCF RESTful service from a Silverlight application due to the lack of support for `WebChannelFactory`. You're correct that Silverlight does not provide a straightforward way to work with WCF RESTful services. However, there are several approaches you can consider to ...
48,228
[ { "from": "human", "value": "I'm trying to get a Server application to expose some status information using WCF.\nIn particular I'm after using WCF services with RESTful \"API\".\nI'm hitting somewhat of a wall when it comes to consuming the REST api from a silverlight\napp/page that I want to have as an ad...
Every time I click on a link it opens in Internet Explorer but I want it to open in another window of my web browser. Details: I created a tabbed web browser which is using a tab control. Other Controls would be a normal web browser.
To change the behavior so that links open in another window of your tabbed web browser instead of Internet Explorer, you'll need to handle the link-click event properly. This is typically done by intercepting the navigation request and directing it to a new tab or window within your application. Here’s a general guide...
48,203
[ { "from": "human", "value": "Every time I click on a link it opens in Internet Explorer but I want it to open in another window of my web browser.\nDetails: \nI created a tabbed web browser which is using a tab control. Other Controls would be a normal web browser.\n" }, { "from": "gpt", "value"...
I'm not entirely sure if this is possible, but does anyone know how, or if you can make calls to a SOAP web service from SQL Server? Seems like it might be good performance-wise in the area of data sync applications. I feel like this might be a long shot though. Thanks.
Yes, it is possible to call a SOAP web service from SQL Server, although it's not the most common approach. SQL Server does not natively support direct SOAP calls, but you can achieve this by using SQL CLR (Common Language Runtime) integration or through SQL Server Agent jobs that leverage external scripts or applicati...
41,946
[ { "from": "human", "value": "I'm not entirely sure if this is possible, but does anyone know how, or if you can make calls to a SOAP web service from SQL Server? Seems like it might be good performance-wise in the area of data sync applications. I feel like this might be a long shot though.\nThanks.\n" ...
As I continue my quest of learning functional programming, I've come to wonder if there may be alternatives to my default "procedural" way of thinking. To be more specific, I'm looking at a function I wrote. Here is what it does: Swap two elements of an unordered list of numbers, such that one of the elements is now...
Great to hear that you're diving into functional programming! Transforming a procedural or imperative approach into a more functional style often involves focusing on immutability, higher-order functions, and recursion rather than mutable state and iteration. Let's take a look at your algorithm and how we might refac...
45,711
[ { "from": "human", "value": "As I continue my quest of learning functional programming, I've come\nto wonder if there may be alternatives to my default \"procedural\" way\nof thinking. To be more specific, I'm looking at a function I\nwrote. Here is what it does:\nSwap two elements of an unordered list of n...
What is the best way to load static data files containing game level maps on the iPhone? I have seen some use XML files, but that seems like overkill in my situation as the data files merely determine the layout of the game's level, ie where obstructions will go. Also, what project directory should they be stored in?...
When it comes to loading static data files for game level maps on the iPhone, the best approach generally depends on your specific requirements, but here are a few recommended methods: ### 1. **JSON Files** JSON is a lightweight and easy-to-read data interchange format that is perfect for representing simple hierarchi...
44,438
[ { "from": "human", "value": "What is the best way to load static data files containing game level maps on the iPhone? I have seen some use XML files, but that seems like overkill in my situation as the data files merely determine the layout of the game's level, ie where obstructions will go. Also, what pr...
We have various reporting services reports which are scheduled to automatically generate reports and email them to a distribution list. This works really well but they appear to come from MSRepSvc@ourdomain.com. This is all well and good but the PHB would like them to look like they are coming from OurGroup@ourdomain....
In SQL Server Reporting Services (SSRS) 2005, the default behavior for email subscriptions is that the reports are sent from the account of the SQL Server Agent service, which is often configured to use a specific service account (like `MSRepSvc@ourdomain.com` in your case). Unfortunately, SSRS 2005 doesn't offer granu...
49,326
[ { "from": "human", "value": "We have various reporting services reports which are scheduled to automatically generate reports and email them to a distribution list. This works really well but they appear to come from MSRepSvc@ourdomain.com. \nThis is all well and good but the PHB would like them to look lik...
How can I make Emacs show blank spaces (like a space, a tab, a line-jump, etc). Many other editors like Kate and Eclipse have this feature and I find it very useful to see when code is indent-broken because of mix of spaces and tabs (particularly Python).
In Emacs, you can enable the display of whitespace characters like spaces, tabs, and line breaks by using the built-in `whitespace-mode` or `global-whitespace-mode`. This is particularly useful for detecting mixed spaces and tabs in your code, especially in languages like Python where indentation is significant. Here’...
49,540
[ { "from": "human", "value": "How can I make Emacs show blank spaces (like a space, a tab, a line-jump, etc). Many other editors like Kate and Eclipse have this feature and I find it very useful to see when code is indent-broken because of mix of spaces and tabs (particularly Python).\n" }, { "from":...
All i am trying to automatically update the assembly information of a project using AssemblyInfo task, before build however the target appears to do nothing (no failure/error) just no update/creation Below is the build.proj file I am using (obviously some contents altered) Can anyone help? <?xml version="1.0" encodin...
It looks like you are attempting to use the `AssemblyInfo` task to update assembly information in your project, but it seems the task is not executing as expected. Let's break down the possible reasons why the `AssemblyInfo` task may not be updating the assembly info as desired: ### Common Issues and Solutions 1. **F...
43,203
[ { "from": "human", "value": "All \ni am trying to automatically update the assembly information of a project using AssemblyInfo task, before build however the target appears to do nothing (no failure/error) just no update/creation\nBelow is the build.proj file I am using (obviously some contents altered) \n...
I have a table that has 8 million records, with many fields, including lat/long values, and it has an index over the Lat/Long fields. I'm making a query to find the records that fall within a square around a point (to later refine into a circle), which is kind of: SELECT Lat,Long FROM Data WHERE (Lat BETWEEN 1 AND 2) A...
Your assumption that the difference in performance could be related to how SQL Server is managing memory is reasonable, especially since you’ve observed such a notable difference between your development machine and the production server. Here are a few things to consider and steps to potentially improve the performanc...
48,753
[ { "from": "human", "value": "I have a table that has 8 million records, with many fields, including lat/long values, and it has an index over the Lat/Long fields.\nI'm making a query to find the records that fall within a square around a point (to later refine into a circle), which is kind of:\nSELECT Lat,L...
Got a little problem with a Seam application I'm working on and I was wondering if anyone knows a way round it. I've got a form in my application that uses AJAX to show certain input boxes depending on an item in a dropdown box. The code works fine except for setting the ID's in my input boxes. It looks like JSF doe...
In JSF (JavaServer Faces), the `id` attribute of a component must be a literal value, and you can't use EL (Expression Language) to set the ID dynamically in the way you are attempting. However, there are a few workarounds that you can consider: ### Workaround 1: Use `ui:repeat` with a Static ID Prefix You can set a s...
49,352
[ { "from": "human", "value": "Got a little problem with a Seam application I'm working on and I was wondering if anyone knows a way round it. I've got a form in my application that uses AJAX to show certain input boxes depending on an item in a dropdown box. The code works fine except for setting the ID's ...
Are there any ways to secure stored procedure consistency at the software level, so as to be sure that they're going to do what they're expected to do? I'm reluctant to use sprocs because reading and modifying them is so easy as long as you have administrative access to the computer and a copy of Management Studio Expr...
Yes, your concerns about stored procedure (sproc) security and consistency are quite valid. When clients have administrative access to the database server, they can potentially modify stored procedures to behave in ways that could compromise data integrity, security, or application functionality. Here are several strat...
47,375
[ { "from": "human", "value": "Are there any ways to secure stored procedure consistency at the software level, so as to be sure that they're going to do what they're expected to do?\nI'm reluctant to use sprocs because reading and modifying them is so easy as long as you have administrative access to the com...
I was reading this post the other night about the inner workings of the Array, and learned a lot from the answers posted, especially from Jonathan Holland's one. So the reason you give a size to an array beforehand is so that space will need to be reserved beforehand, so that elements in the array will be placed next e...
In JavaScript, arrays are dynamic, meaning that you don't need to specify a fixed size when you create them. This flexibility is managed internally by the JavaScript engine, which handles memory allocation and resizing behind the scenes. Here's how it works: 1. **Dynamic Resizing**: When you create an empty array (`v...
49,902
[ { "from": "human", "value": "I was reading this post the other night about the inner workings of the Array, and learned a lot from the answers posted, especially from Jonathan Holland's one.\nSo the reason you give a size to an array beforehand is so that space will need to be reserved beforehand, so that e...
I have a situation where I'm populating a gridview with a bound data source, and want two additional rows at the very bottom; one to show the sum of values in the columns and one to show the average of values in the columns. I can quite easily calculate these values by aggregating information taken from the rowDataBou...
To add additional rows for the sum and average of values in a GridView, you can achieve this by handling the `RowDataBound` event to calculate the necessary totals and then adding those rows in the `RowCreated` event or at the end of the data binding process. Here is a step-by-step approach to achieve this: ### Step 1...
43,719
[ { "from": "human", "value": "I have a situation where I'm populating a gridview with a bound data source, and want two additional rows at the very bottom; one to show the sum of values in the columns and one to show the average of values in the columns. I can quite easily calculate these values by aggregat...
I've created a login submit form in HTML but for some reason user/password autocompletion does not work like I expect in firefox. This is what happens in Firefox: I give username and password and click on the login button Firefox prompts me if I would like to remember the password. I press 'remember' and login works. ...
It seems like you're experiencing issues with the username and password fields not being auto-filled in Firefox, despite the password manager saving the credentials. This can happen due to various reasons related to how form fields are defined and structured in HTML. Below are some suggestions and improvements to help ...
44,489
[ { "from": "human", "value": "I've created a login submit form in HTML but for some reason user/password autocompletion does not work like I expect in firefox.\nThis is what happens in Firefox:\n\nI give username and password and click on the login button\nFirefox prompts me if I would like to remember the p...
I'm trying to setup an alert to let me know via email (SMTP) when free disk space on one of my servers is less than a specified value. To do this I'm using PerfMon alerts, as described at MSFT Technet. I have the alert working and writing to the system log, but when I try to set it to 'Run Program' it fails. The log al...
When configuring Performance Monitor (PerfMon) alerts to run a program, there are a few important considerations that might affect the success of your C# application when it's triggered by an alert. Here are some steps to troubleshoot and resolve the issue: 1. **Permissions**: - Ensure that the user account under w...
45,326
[ { "from": "human", "value": "I'm trying to setup an alert to let me know via email (SMTP) when free disk space on one of my servers is less than a specified value. To do this I'm using PerfMon alerts, as described at MSFT Technet. I have the alert working and writing to the system log, but when I try to set...
We recently had a project where we released beta of a big web app on our client's server. Our client requested us to do bug fixes as they come, and we tried to do it same way. Normally while building an app on our prototype server is way easier, as I just have to issue simple 'svn up' command which takes a second. But...
Certainly! Automating the deployment process can significantly improve efficiency and reduce the chances of errors when applying bug fixes or updates to a production environment. Here are some potential solutions you might consider: ### 1. **Use Version Control and Deployment Tools** Even if the production server doe...
40,778
[ { "from": "human", "value": "We recently had a project where we released beta of a big web app on our client's server. Our client requested us to do bug fixes as they come, and we tried to do it same way. Normally while building an app on our prototype server is way easier, as I just have to issue simple 's...
A couple of months ago, the MRU list in Visual Studio stopped working. Neither the File menu or the start page shows any recently opened projects or solutions. I honestly have no clue what I did to cause this, but perhaps someone who knows more about the murky depths of VS might be able to hazard a guess at what cause...
It sounds like you're experiencing an issue with the Most Recently Used (MRU) list in Visual Studio 2008. Since the registry key for the MRU list is empty, it indicates that Visual Studio is not able to store recently opened projects or solutions. Here are several potential steps you can take to troubleshoot and hopefu...
48,455
[ { "from": "human", "value": "A couple of months ago, the MRU list in Visual Studio stopped working. Neither the File menu or the start page shows any recently opened projects or solutions. I honestly have no clue what I did to cause this, but perhaps someone who knows more about the murky depths of VS migh...
I like .NET webcontrols and you manipulate things, that's common consensus, but XML and XSL is so great, because you have UI logic that is platform & language-independent, so one day I change the app to php, java or whatever and i can reuse all the presentation logic. Moreover, XSL has the possibility to call .NET (or...
Using XML and XSLT (eXtensible Stylesheet Language Transformations) for presentation logic has its advantages, especially in terms of platform independence and the ability to separate content from presentation. However, there are several reasons why XML/XSLT may not be as commonly used in modern web development compare...
49,310
[ { "from": "human", "value": "I like .NET webcontrols and you manipulate things, that's common consensus, but XML and XSL is so great, because you have UI logic that is platform & language-independent, so one day I change the app to php, java or whatever and i can reuse all the presentation logic. \nMoreover...
I have an enum public enum FileExtentions { mp3, mpeg } And I have a FileInfo of which I want to check if the extension is in the previous enum. I was hoping I could do a FileExtensions.Any(e=>e.ToString().Equals(file.Extension)); But that would have been too awesome. Any ideas?
You can achieve this using the `Enum.GetValues` method to get all the values of your enum and then check if the file extension matches any of those values. Here's how you can do it: ```csharp using System; using System.IO; using System.Linq; public enum FileExtensions { mp3, mpeg } class Program { static...
49,838
[ { "from": "human", "value": "I have an enum \npublic enum FileExtentions {\n mp3,\n mpeg\n}\n\nAnd I have a FileInfo of which I want to check if the extension is in the previous enum.\nI was hoping I could do a \nFileExtensions.Any(e=>e.ToString().Equals(file.Extension));\n\nBut that would have been t...
I'm working with PHP & mySQL. I've finally got my head around source control and am quite happy with the whole development (testing) v production v repository thing for the PHP part. My new quandary is what to do with the database. Do I create one for the test environment and one for the production environment? I cu...
It's great that you've made progress with source control for your PHP application! When it comes to managing databases for different environments, it's essential to maintain a clear separation between production and testing (or development) databases. Here are some considerations and recommendations: ### 1. **Separate...
47,112
[ { "from": "human", "value": "I'm working with PHP & mySQL. I've finally got my head around source control and am quite happy with the whole development (testing) v production v repository thing for the PHP part.\nMy new quandary is what to do with the database. Do I create one for the test environment and...
I'm trying to decide how to allow users to register for my website... there's openID, clickpass, facebook connect, google friend connect, etc, or the good old fashioned in-house "enter a username, email, password, etc." Looking briefly at How to set-up OpenID it seems like a lot of work to get openID working. Does anyo...
When deciding on user registration methods for your website, there are several factors to consider, including user experience, development effort, and security. Here's an overview of the options you mentioned, along with some insights based on common experiences in the industry: ### 1. **In-house Registration (Usernam...
45,723
[ { "from": "human", "value": "I'm trying to decide how to allow users to register for my website... there's openID, clickpass, facebook connect, google friend connect, etc, or the good old fashioned in-house \"enter a username, email, password, etc.\"\nLooking briefly at How to set-up OpenID it seems like a ...
I'm looking for some design help here. I'm doing work for a client that requires me to store data about their tens of thousands of employees. The data is being given to me in Excel spreadsheets, one for each city/country in which they have offices. I have a database that contains a spreadsheets table and a data tabl...
It sounds like you're dealing with a complex data management scenario, especially given the need to track changes while also preventing redundancy in your database. Here are a few alternative strategies you might consider that could help you strike a balance between automation, data integrity, and efficient storage: #...
44,741
[ { "from": "human", "value": "I'm looking for some design help here.\nI'm doing work for a client that requires me to store data about their tens of thousands of employees. The data is being given to me in Excel spreadsheets, one for each city/country in which they have offices. \nI have a database that co...
HI, I m doing the folling stuff in the jsp code I need to do it using Struts or using JSTL tag can any body have relevant idea please share.. The following is my JSP code <% Object category = request.getAttribute("categoryDetails"); Hashtable<String, Hashtable<String, In...
To convert your JSP code to use Struts (with JSP) and JSTL tags, you'll want to follow a few steps. This will involve creating a more maintainable and clean separation of your Java logic from your JSP presentation. Struts utilizes Action classes and Forms to handle request data, while JSTL allows you to iterate and acc...
48,609
[ { "from": "human", "value": "HI,\nI m doing the folling stuff in the jsp code I need to do it using Struts or using JSTL tag can any body have relevant idea please share..\nThe following is my JSP code\n<%\n\n Object category = request.getAttribute(\"categoryDetails\");\n ...
I am experimenting with the new multiprocessing module in Python 2.6. I am creating several processes each with its own multiprocessor.JoinableQueue instance. Each process spawns one or more worker threads (subclasses of threading.Thread) which share the JoinableQueue instance (passed in through each Thread's __init_...
It seems like you are encountering a race condition due to the way the `JoinableQueue` in the `multiprocessing` module is being used in conjunction with threads. The error message `ValueError: task_done() called too many times` indicates that the `task_done()` method is being called more times than `get()` has been cal...
48,838
[ { "from": "human", "value": "I am experimenting with the new multiprocessing module in Python 2.6. I am creating several processes each with its own multiprocessor.JoinableQueue instance. Each process spawns one or more worker threads (subclasses of threading.Thread) which share the JoinableQueue instance...
RUP in the dialogue with Scrum There is a relation between Agile and RUP. Actually I though that Agile development was a type of RUP. In the article from IBM above you can see that they are fitting the model to RUP. Does someone has any practical explanation of the relation between these three interesting concepts....
The relationship between Agile methodologies, the Rational Unified Process (RUP), and Scrum can be understood in the context of software development frameworks and their adaptability to project needs. Here's a practical explanation of the interactions among these three concepts: ### 1. **Rational Unified Process (RUP)...
48,096
[ { "from": "human", "value": "RUP in the dialogue with Scrum\nThere is a relation between Agile and RUP. Actually I though that Agile development was a type of RUP. In the article from IBM above you can see that they are fitting the model to RUP. \nDoes someone has any practical explanation of the relatio...
I have a 32-bit Windows/Qt application using Postgres plugin. Recently, I've been intrigued to turn the app into a 64-bit app. So I checked the Qt docs for instructions, built Qt and its libraries into 64-bit successfully. Now the problem is Postgres does not provide libraries for 64-bit Windows! Obviously, the Qt Post...
Converting your Qt application from a 32-bit to a 64-bit build while still requiring the Postgres database presents challenges, especially when the libraries you need are not available in 64-bit versions. Here are several potential solutions and their pros and cons: ### Option 1: Use a 32-bit DLL for Postgres You can ...
48,388
[ { "from": "human", "value": "I have a 32-bit Windows/Qt application using Postgres plugin. Recently, I've been intrigued to turn the app into a 64-bit app. So I checked the Qt docs for instructions, built Qt and its libraries into 64-bit successfully. Now the problem is Postgres does not provide libraries f...
I find the standard Powershell display of errors (red text, multi-line display) a bit distracting. Is it possible to customize this?
Yes, you can customize the way PowerShell displays errors to make it less distracting. Here are several methods you can use to change the appearance of error messages in PowerShell: ### 1. Change the Error Message Format You can modify how error messages are displayed by creating a custom error handler. For example, ...
48,383
[ { "from": "human", "value": "I find the standard Powershell display of errors (red text, multi-line display) a bit distracting. Is it possible to customize this?\n" }, { "from": "gpt", "value": "Yes, you can customize the way PowerShell displays errors to make it less distracting. Here are sever...
I was thinking of using these styles for easier cell rollover effects in a datagrid, but I can't seem to get these styles working on anything other than the most basic of tag. Is the <a> anchor tag the only element in HTML to support styles like hover, active, visited?
No, the `<a>` anchor tag is not the only element in HTML that supports pseudo-classes like `:hover`, `:active`, and `:visited`. Any HTML element can utilize these pseudo-classes, allowing you to create various interactive styles on different elements. Here are the most common pseudo-classes you can use with various el...
48,883
[ { "from": "human", "value": "I was thinking of using these styles for easier cell rollover effects in a datagrid, but I can't seem to get these styles working on anything other than the most basic of tag.\nIs the <a> anchor tag the only element in HTML to support styles like hover, active, visited?\n" }, ...
Is there a (good) documentation about the format of the eclipse workspace files (.location, x.tree, ...)? I need this to programatically create a workspace for automated builds. Unfortunately I have to do this job from a .NET program, so I can't use any Eclipse classes to do this! (We manage our Linux C++ projects usin...
The Eclipse workspace files, such as `.location` and `*.workspace` files, are not well-documented officially by the Eclipse Foundation. However, I can provide you with an overview of these files and how you might be able to work with them programmatically. ### Overview of Workspace Files 1. **.location**: - This f...
44,395
[ { "from": "human", "value": "Is there a (good) documentation about the format of the eclipse workspace files (.location, x.tree, ...)?\nI need this to programatically create a workspace for automated builds. Unfortunately I have to do this job from a .NET program, so I can't use any Eclipse classes to do th...
I have some forms that communicate with server using AJAX for real reasons: cascade combos, suggestions, multiple correlated selections (e.g. I have {elementary} knowledge of {French} [add], and {good} knowledge of {German} [add]...). I also have some regular fields that I handle trough get. Thing is that once I've ma...
Using AJAX for all form submissions, even when there's no immediate reason for it, can offer several advantages, but there are also considerations to keep in mind. Here’s a breakdown of the pros and cons: ### Pros of Using AJAX for All Form Submissions 1. **User Experience**: AJAX allows for a smoother user experienc...
46,886
[ { "from": "human", "value": "I have some forms that communicate with server using AJAX for real reasons: cascade combos, suggestions, multiple correlated selections (e.g. I have {elementary} knowledge of {French} [add], and {good} knowledge of {German} [add]...). I also have some regular fields that I handl...
Anyone know how to take the awesome method mentioned in this tutorial and have the stylesheet tags generate with absolute URLs?
If you're looking to modify the way stylesheet tags are generated in your project so that they use absolute URLs instead of relative ones, you would generally want to look at the code that generates those tags. The specifics can depend on the context, framework, or language you're using. However, here’s a general app...
49,560
[ { "from": "human", "value": "Anyone know how to take the awesome method mentioned in this tutorial and have the stylesheet tags generate with absolute URLs?\n" }, { "from": "gpt", "value": "If you're looking to modify the way stylesheet tags are generated in your project so that they use absolut...
I am looking for a clear definition of what a "tokenizer", "parser" and "lexer" are and how they are related to each other (e.g., does a parser use a tokenizer or vice versa)? I need to create a program will go through c/h source files to extract data declaration and definitions. I have been looking for examples and c...
Certainly! The concepts of tokenizers, lexers, and parsers are fundamental in the fields of programming languages and compiler design. Let’s break down each term and their relationships to each other. ### 1. Tokenizer (or Lexer) **Definition**: A tokenizer, often referred to as a lexer, is the component of a compiler...
47,074
[ { "from": "human", "value": "I am looking for a clear definition of what a \"tokenizer\", \"parser\" and \"lexer\" are and how they are related to each other (e.g., does a parser use a tokenizer or vice versa)? I need to create a program will go through c/h source files to extract data declaration and defin...
I am using VMware Workstation 6.5 on Windows Vista x64. I would like to automate some of the VM management tasks. I know that there is a COM API (http://www.vmware.com/support/developer/vix-api/) available which I could use directly. Is there a C# wrapper for this COM API? Thanks, Arnie
Yes, there are several C# wrappers available for the VMware VIX API, which can help you automate VM management tasks in VMware Workstation. One popular choice is the **VixNet** library, which provides a managed .NET interface to the VIX API. Here are the steps to get started: 1. **Download the VIX API**: Ensure you h...
47,598
[ { "from": "human", "value": "I am using VMware Workstation 6.5 on Windows Vista x64. I would like to automate some of the VM management tasks. I know that there is a COM API (http://www.vmware.com/support/developer/vix-api/) available which I could use directly.\nIs there a C# wrapper for this COM API?\nTha...
We user JIRA for bug tracking and release management and we have started using greenhopper for project management inside of JIRA but one thing that it lacks is the idea of user stories versus tasks in those users stories. Does anyone recommend other task board like agile project management tools that fully support use...
There are several agile project management tools that can help you manage user stories and tasks more effectively than JIRA with Greenhopper alone. Below are a few recommendations along with some feedback on Targetprocess: ### 1. **Targetprocess** - **Overview**: Targetprocess is designed for visual project management...
45,486
[ { "from": "human", "value": "We user JIRA for bug tracking and release management and we have started using greenhopper for project management inside of JIRA but one thing that it lacks is the idea of user stories versus tasks in those users stories. Does anyone recommend other task board like agile projec...
There was a C program written for a contest that was formatted in ASCII art as a Japanese character. When compiled and ran it printed out another program formatted in a different Japanese character, then another, then finally it printed out the first again. I was looking for the code to that and could not find it on t...
It sounds like you're referring to a piece of code that is structured as an ASCII art representation of a Japanese character and exhibits a behavior known as a "quine," where the program outputs its own source code (or in this case, outputs different programs in a loop). While I can't provide you with the specific code...
47,568
[ { "from": "human", "value": "There was a C program written for a contest that was formatted in ASCII art as a Japanese character. When compiled and ran it printed out another program formatted in a different Japanese character, then another, then finally it printed out the first again.\nI was looking for t...
I'm writing a programmer's text editor (yes another one) in Perl called Kephra, which is also a CPAN module of course and bundled with Module::Install. Recently I saw that Module::Build has gone into core, so if I switch I could reduce dependencies. Is there any other reason to switch?
Switching from `Module::Install` to `Module::Build` for your Perl project has several advantages, especially since `Module::Build` is now part of the Perl core. Here are some reasons to consider the switch: 1. **Reduced Dependencies**: As you mentioned, moving to `Module::Build` will eliminate the need for `Module::In...
46,364
[ { "from": "human", "value": "I'm writing a programmer's text editor (yes another one) in Perl called Kephra, which is also a CPAN module of course and bundled with Module::Install. Recently I saw that Module::Build has gone into core, so if I switch I could reduce dependencies. Is there any other reason to ...
I'd like to add a custom title to one of the predefined UITabBarItems. Whenever I select the particular instance I like in Interface Builder -- if I modify the the title it gets preset back to a 'custom' identifier. Ideally I'd like the book icon from the 'Bookmarks' identifier with my own custom title. Is this level o...
In UIKit, when you're using `UITabBarItem`, there are some limitations when it comes to customizing predefined items, such as those that are part of the system-provided icons (like Bookmarks). When you select a tab bar item with a predefined system image, the title can be changed, but as you've noticed, it often revert...
43,491
[ { "from": "human", "value": "I'd like to add a custom title to one of the predefined UITabBarItems. Whenever I select the particular instance I like in Interface Builder -- if I modify the the title it gets preset back to a 'custom' identifier. Ideally I'd like the book icon from the 'Bookmarks' identifier ...
When one thinks of Ada, one usually thinks of avionics. What I'm interested in are some other applications of Ada? Where is it used? Are there any shipped applications written in Ada? For example, are there CRUD apps written in it? Or games? Etc.
Ada is a high-level programming language known for its strong typing, modularity, and reliability, particularly in safety-critical and mission-critical systems. While it is indeed prominently used in avionics, there are various other applications and domains where Ada is utilized: ### 1. **Embedded Systems** - Ada ...
47,095
[ { "from": "human", "value": "When one thinks of Ada, one usually thinks of avionics.\nWhat I'm interested in are some other applications of Ada? Where is it used? Are there any shipped applications written in Ada?\nFor example, are there CRUD apps written in it? Or games? Etc.\n" }, { "from": "gpt",...
I need to achieve the following: Two 2D quads appear as though they are stacked one on top of the other (like two halves of the same texture) but are in fact seperated on the z axis by n coordinates. So that if a 3D object passes between them one half appears in front of the object and the other behind. Could i achieve...
To achieve the effect you’re describing—where two 2D quads appear to be stacked but are actually separated in the Z-axis—you can certainly use a combination of orthographic projection for the quads and perspective projection for the 3D objects. ### Here's how you can do it: 1. **Setup the Quads**: - Create two qua...
47,655
[ { "from": "human", "value": "I need to achieve the following:\nTwo 2D quads appear as though they are stacked one on top of the other (like two halves of the same texture) but are in fact seperated on the z axis by n coordinates. So that if a 3D object passes between them one half appears in front of the ob...
We have a project in Team Foundation Server (TFS) that has a non-English character (š) in it. When trying to script a few build-related things, we've stumbled upon a problem; we can't pass the š letter to the command-line tools. The command prompt or what not else messes it up, and the tf.exe utility can't find the spe...
When dealing with Unicode characters in command-line utilities such as `tf.exe` in a Windows environment, it can be a challenge, especially if you're using non-ASCII characters like `š`. Here are several strategies you can use to successfully pass Unicode characters to command-line tools in Windows: ### 1. Change the ...
49,256
[ { "from": "human", "value": "We have a project in Team Foundation Server (TFS) that has a non-English character (š) in it. When trying to script a few build-related things, we've stumbled upon a problem; we can't pass the š letter to the command-line tools. The command prompt or what not else messes it up, ...
Say I have a bitmap image, is it possible to iterate through all the individual bytes in the image? If yes, how?
Yes, it is possible to iterate through all the individual bytes in a bitmap (BMP) image. A BMP file consists of a header followed by pixel data, and you can read and manipulate it at the byte level using programming languages like Python, C, or others. Here’s a general outline of how you can do it using Python, along w...
46,451
[ { "from": "human", "value": "Say I have a bitmap image, is it possible to iterate through all the individual bytes in the image? If yes, how?\n" }, { "from": "gpt", "value": "Yes, it is possible to iterate through all the individual bytes in a bitmap (BMP) image. A BMP file consists of a header...
How would you access the cache from a jQuery ajax call? I'm using jquery to do some data verification and quick data access. I have a static web-method that jquery is calling via json to return a value. I don't want to call to the database everytime so I'd like to cache the data I'm hitting, but I can't determine how ...
To access cache from a jQuery AJAX call in an ASP.NET application, you have a few options. You can't directly access the server-side cache from JavaScript, but you can create an intermediary in your ASP.NET code to manage this for you. Here's a general approach to achieve your goal: ### Step 1: Create Your Static Meth...
48,011
[ { "from": "human", "value": "How would you access the cache from a jQuery ajax call? \nI'm using jquery to do some data verification and quick data access. I have a static web-method that jquery is calling via json to return a value. I don't want to call to the database everytime so I'd like to cache the da...
What would be the best way to display & program simple game board (say chess, checkers and such) in C#? In terms of controls and underlying game logic. An idea that came to my mind was to use Picture Box (or class inheriting from it) with Board & Field classes. Is that a decent solution after all? How would I separ...
Using a `PictureBox` for displaying a game board like chess or checkers can work, but there are more efficient and flexible methods in C# Windows Forms that could enhance both the graphics and logic separation. Here’s a comprehensive way to approach this, considering your idea of using `Board` and `Field` classes. ###...
42,221
[ { "from": "human", "value": "What would be the best way to display & program simple game board (say chess, checkers and such) in C#? In terms of controls and underlying game logic. \nAn idea that came to my mind was to use Picture Box (or class inheriting from it) with Board & Field classes. \n\nIs that a d...
I have an ASP.Net 3.5 website running in IIS 6 on Windows Server 2003 R2. It is a relatively small internal application that probably serves less than ten users at any given time. The server has 4 Gig of memory and shows that 3+ Gig is available while the site is active. Just minutes after restarting the web applicat...
The issue you are experiencing with Performance Monitor (PerfMon) showing an extremely high number of active sessions in your ASP.NET application could be attributed to several factors. Here are some insights and steps to investigate and resolve the situation: ### Possible Reasons for High Active Sessions Count 1. **S...
47,800
[ { "from": "human", "value": "I have an ASP.Net 3.5 website running in IIS 6 on Windows Server 2003 R2. It is a relatively small internal application that probably serves less than ten users at any given time. The server has 4 Gig of memory and shows that 3+ Gig is available while the site is active.\nJust...
I'm a newbie Cocoa developer and I'm developing my first application. I want to read a unique identifier from any window of any application - whether it's Cocoa or Carbon. Cocoa applications make their window IDs available to AppleScript (although I'm sure there's a much better way to do this through a proper Objective...
To access the unique window identifiers for windows belonging to other applications (both Cocoa and Carbon), you can utilize Core Graphics. The `HIWindowGetCGWindowID` function is a Carbon API that gives you the ability to get a window's ID, but it can only be called on windows that your application has direct access t...
47,306
[ { "from": "human", "value": "I'm a newbie Cocoa developer and I'm developing my first application. I want to read a unique identifier from any window of any application - whether it's Cocoa or Carbon. Cocoa applications make their window IDs available to AppleScript (although I'm sure there's a much better ...
In designing any desktop applications, are there any general rules on how much memory should the application uses? For heavy-weight applications, those can be easily understood or at least profiled such as Firefox or Google Chrome. But for smaller utilities or line-of-business application, how much is an acceptable amo...
When designing desktop applications, especially for environments with constrained resources like Windows XP, there are several considerations regarding memory usage and performance. While there's no one-size-fits-all number for acceptable memory usage, there are some general guidelines and best practices to help you ma...
40,814
[ { "from": "human", "value": "In designing any desktop applications, are there any general rules on how much memory should the application uses?\nFor heavy-weight applications, those can be easily understood or at least profiled such as Firefox or Google Chrome. But for smaller utilities or line-of-business ...
I have a div tag styled through CSS. I set the padding to 10px (padding:10px), it works just as I wanted in Firefox and IE7, but in IE6 it adds additional padding at the bottom (about 2-3px I think). Anyone has idea about what's happening here? [update] I just noticed this, the div tag I'm talking about has a backgrou...
The issue you're experiencing in Internet Explorer 6 with the additional padding at the bottom of your `.user-info` div, particularly when using a background image, is likely due to a combination of how IE6 handles box models and rendering quirks. Here are a few suggestions to help you resolve the problem: 1. **Add `...
47,767
[ { "from": "human", "value": "I have a div tag styled through CSS. I set the padding to 10px (padding:10px), it works just as I wanted in Firefox and IE7, but in IE6 it adds additional padding at the bottom (about 2-3px I think). Anyone has idea about what's happening here?\n[update]\nI just noticed this, t...
I tried playing a .wav file using pyaudio. It works great on windows, but doesn't work in Ubuntu when another device is using sound. The error is "IOError: [Errorno Invalid output device (no default output device)] -9996 Is there another library I could try to use? Another method?
Yes, you can try using other libraries for playing audio in Ubuntu. Here are a few alternatives that you can use: ### 1. **SoundDevice** The `sounddevice` library is a great alternative that allows you to play audio using NumPy arrays, and it can handle various sound devices on Linux. You can install it via pip: ```b...
46,465
[ { "from": "human", "value": "I tried playing a .wav file using pyaudio. It works great on windows, but doesn't work in Ubuntu when another device is using sound.\n\nThe error is \"IOError: [Errorno\n Invalid output device (no default\n output device)] -9996\n\nIs there another library I could try to use? ...
I have a really simple Java class that effectively decorates a Map with input validation, with the obvious void set() and String get() methods. I'd like to be able to effectively call those methods and handle return values and exceptions from outside the JVM, but still on the same machine Update: the caller I have in m...
When you want to expose a Java class to be called from outside the JVM on the same machine (or potentially remotely), you have several options. Each approach has its own pros and cons, particularly in terms of performance, ease of implementation, and flexibility. Here's a rundown of your main options: ### 1. **Java RM...
45,648
[ { "from": "human", "value": "I have a really simple Java class that effectively decorates a Map with input validation, with the obvious void set() and String get() methods.\nI'd like to be able to effectively call those methods and handle return values and exceptions from outside the JVM, but still on the s...
I have a Windows Console App hosting a WCF service that reads from an MSMQ. When the message size gets to around 7k to 8k the service reads it (i.e. it disappears from the Q) but the appropriate function isn't called. No exceptions thrown. Anybody have any clues about what's happening or where to look to resolve this?
When dealing with a WCF service that reads messages from MSMQ, if you notice that messages of size around 7k to 8k are not triggering the appropriate function but are disappearing from the queue, there are several areas to investigate that might help you resolve this issue: ### 1. **Message Size Limitations** - MSM...
45,109
[ { "from": "human", "value": "I have a Windows Console App hosting a WCF service that reads from an MSMQ. When the message size gets to around 7k to 8k the service reads it (i.e. it disappears from the Q) but the appropriate function isn't called. No exceptions thrown. Anybody have any clues about what's hap...
I have many requires and includes and i was wondering if there's something that can help me look at the whole of php code when a webpage is loaded. the reason i'm asking is that after fiddling with some code i cannot put any php code anymore as it will not be "sensed" by the compiler. like if i put anything inside the ...
When you're dealing with a PHP application that has many `require` and `include` statements, tracking down where issues arise can sometimes be complex, especially if your PHP code stops functioning as expected. Here are some strategies you can use to diagnose and fix issues: ### 1. **Check Your Error Reporting Setting...
47,481
[ { "from": "human", "value": "I have many requires and includes and i was wondering if there's something that can help me look at the whole of php code when a webpage is loaded. the reason i'm asking is that after fiddling with some code i cannot put any php code anymore as it will not be \"sensed\" by the c...
If I have an embedded browser in a windows form, is it possible to initiate a javascript method from the container application?
Yes, it is possible to initiate a JavaScript method from a Windows Forms application that contains an embedded browser. If you're using the `WebBrowser` control, you can call JavaScript functions from your C# code using the `InvokeScript` method. Here’s how you can do that: ### Example Steps 1. **Set Up the WebBrowse...
49,559
[ { "from": "human", "value": "If I have an embedded browser in a windows form, is it possible to initiate a javascript method from the container application? \n" }, { "from": "gpt", "value": "Yes, it is possible to initiate a JavaScript method from a Windows Forms application that contains an em...
I have just discovered that if generating assemblies via Reflection.Emit, the .NET framework keeps references in a static member that prevents Reflection.Emit classes not to be GC'ed. I cannot use DynamicMethod due to limitations. I also generate a lot of assemblies (incremental compiler of IronScheme) over the cours...
Using a separate AppDomain to handle code generation in .NET can indeed be an effective way to manage memory, especially when you're generating a large number of assemblies via Reflection.Emit. However, there are several factors to consider when evaluating the performance and feasibility of this approach. ### Performa...
47,501
[ { "from": "human", "value": "I have just discovered that if generating assemblies via Reflection.Emit, the .NET framework keeps references in a static member that prevents Reflection.Emit classes not to be GC'ed. \nI cannot use DynamicMethod due to limitations. I also generate a lot of assemblies (incremen...
Could somebody point me to an example how to search for phrases with Lucene.net? Let's say I have in my index a document with field "name", value "Jon Skeet". Now I want to be able to find that document when searching for "jon skeet".
To search for phrases using Lucene.NET, you will typically want to utilize the `QueryParser` or `MultiFieldQueryParser` to construct your search query. Lucene.NET is case-insensitive by default when it comes to searching, assuming you have indexed the text in a case-insensitive manner (e.g., using the `StandardAnalyzer...
45,559
[ { "from": "human", "value": "Could somebody point me to an example how to search for phrases with Lucene.net?\nLet's say I have in my index a document with field \"name\", value \"Jon Skeet\". Now I want to be able to find that document when searching for \"jon skeet\".\n" }, { "from": "gpt", "v...
I had telephone interview question yesterday. The interviewer asked me if I had faced any challenging debugging issue? I told him I once faced a problem debugging someone else's code and it took me 3-4 days to solve that. I used Windbg, symbols and a crash dump to solve the problem. Now is this enough to tell? What is...
Your experiences and answers to the interview questions reflect a solid understanding of debugging and multi-threading concepts, but there are a few aspects you might want to expand on in future interviews to provide a more complete picture of your skills and experiences. ### 1. Challenging Debugging Issue: When discu...
41,961
[ { "from": "human", "value": "I had telephone interview question yesterday.\nThe interviewer asked me if I had faced any challenging debugging issue?\nI told him I once faced a problem debugging someone else's code and it took me 3-4 days to solve that. I used Windbg, symbols and a crash dump to solve the pr...
Can a desktop application designed for the Windows platform (for example, using MS Visual Studio ) run on a Linux platform too? If so, please give some suggestions on what should be done to prepare for this.
Running a Windows desktop application directly on a Linux platform is not straightforward due to differences in operating systems, APIs, and system architectures. However, there are a few approaches you can take to enable a Windows application to run on Linux: ### 1. **Using Wine** Wine is a compatibility layer that a...
48,863
[ { "from": "human", "value": "Can a desktop application designed for the Windows platform (for example, using MS Visual Studio ) run on a Linux platform too? If so, please give some suggestions on what should be done to prepare for this. \n" }, { "from": "gpt", "value": "Running a Windows deskto...
Is it possible for me to turn on audit logging on my mysql database? I basically want to monitor all queries for an hour, and dump the log to a file.
Yes, it is possible to enable audit logging in MySQL to monitor and log all queries. MySQL provides a few different ways to log queries, but one of the most commonly used methods for auditing purposes is by using the general query log. ### Steps to Enable General Query Logging 1. **Check Current Settings**: First, ch...
49,368
[ { "from": "human", "value": "Is it possible for me to turn on audit logging on my mysql database?\nI basically want to monitor all queries for an hour, and dump the log to a file.\n" }, { "from": "gpt", "value": "Yes, it is possible to enable audit logging in MySQL to monitor and log all queries...