instruction
stringlengths
14
27.6k
completion
stringlengths
3
38.3k
__original_row_idx
int64
0
50k
conversations
listlengths
2
2
In a C program (p1), how to launch a dynamically constructed command (and its arguments) that reads its standard input from p1's standard output? Note that: A method other than this stdout --> stdin piping is also OK provided it is PORTABLE across Windows and Linux. I cannot use C++, Java, Perl, Ruby, Python, etc her...
To launch a dynamically constructed command in a C program that reads from `p1`'s standard output, you can use `popen`, which provides a portable way to create a pipe to a process, allowing you to send data to its standard input. This method works on both Linux and Windows (with the use of MinGW). Here's a simple exam...
23,243
[ { "from": "human", "value": "In a C program (p1), how to launch a dynamically constructed command (and its arguments) that reads its standard input from p1's standard output?\nNote that: \n\nA method other than this stdout -->\nstdin piping is also OK provided\nit is PORTABLE across Windows and\nLinux.\nI c...
Which Eclipse package should I choose for Python development with PyDev? Nothing on the Eclipse homepage tells me what to choose, and the PyDev documentation assumes I already have Eclipse installed. Does it matter which Eclipse package I choose?
When choosing an Eclipse package for Python development with PyDev, you have a few options, but it is essential to select a version that meets your needs without unnecessary overhead. ### Recommended Eclipse Package for PyDev 1. **Eclipse IDE for Java Developers**: This package is a good choice as it includes the ess...
24,857
[ { "from": "human", "value": "Which Eclipse package should I choose for Python development with PyDev?\nNothing on the Eclipse homepage tells me what to choose, and the PyDev documentation assumes I already have Eclipse installed. Does it matter which Eclipse package I choose?\n" }, { "from": "gpt", ...
I am trying to use a third party DLL that wants an int** as one of the parameters to the method. It describes the parameter as the address of the pointer that will point to the memory allocation. Sorry for any confusion. The parameter is two-way I think. The DLL is for talking to an FPGA board and the method is sett...
When working with a third-party DLL that requires an `int**` parameter, it typically means that the function expects a pointer to a pointer, which can be used to manage memory allocated within the function. In your case, the DLL method is likely intended to allocate an array of integers and provide the address of that ...
21,102
[ { "from": "human", "value": "I am trying to use a third party DLL that wants an int** as one of the parameters to the method. It describes the parameter as the address of the pointer that will point to the memory allocation.\nSorry for any confusion. The parameter is two-way I think. The DLL is for talki...
Given any arbitrary, one-line string, my goal is to render it into a bitmap representation. However, I have no means of finding out its dimensions beforehand, so I am reduced to getting the glyph range's bounding rect and resizing my canvas if it's not large enough. Unfortunately, if the canvas is not wide enough for...
To prevent the layout manager from wrapping text in a bitmap rendering, you can use the following approaches, depending on the framework or library you are using to render the text: 1. **Set the Width of the Text Container Explicitly**: If your layout manager allows it, set the width of the text container or canvas to...
24,849
[ { "from": "human", "value": "Given any arbitrary, one-line string, my goal is to render it into a bitmap representation. However, I have no means of finding out its dimensions beforehand, so I am reduced to getting the glyph range's bounding rect and resizing my canvas if it's not large enough. Unfortunat...
I want to be able to do the following: $normal_array = array(); $array_of_arrayrefs = array(&$normal_array); // Here I want to access the $normal_array reference **as a reference**, // but that doesn't work obviously. How to do it? end($array_of_arrayrefs)["one"] = 1; // choking on this one print $normal_array[...
In PHP, when you want to modify a variable via a reference stored in an array, you need to ensure that you are actually manipulating the variable directly through the reference. The issue in your code arises from trying to use `end()` which returns the value of the last element of the array, but in this case, it does n...
23,660
[ { "from": "human", "value": "I want to be able to do the following:\n$normal_array = array();\n$array_of_arrayrefs = array(&$normal_array);\n\n// Here I want to access the $normal_array reference **as a reference**,\n// but that doesn't work obviously. How to do it?\nend($array_of_arrayrefs)[\"one\"] ...
If I have a native C++ windows program (i.e. the entry point is WinMain) how do I view output from console functions like std::cout?
In a Windows GUI application (which typically uses `WinMain` as the entry point), console output functions like `std::cout` won't appear in a console window by default, since GUI applications do not have a console associated with them. However, there are several methods to view output from `std::cout` or other console ...
23,536
[ { "from": "human", "value": "If I have a native C++ windows program (i.e. the entry point is WinMain) how do I view output from console functions like std::cout?\n" }, { "from": "gpt", "value": "In a Windows GUI application (which typically uses `WinMain` as the entry point), console output func...
I am probably overlooking something really simple here but I am trying to redirect all bad URLs to an action that filters the URL based on conditions and then either 301 redirects to a suitable page or issues a 404 page. To this end I have a route like this at the end of my route table: routes.MapRoute("Error", "{*url}...
The issue you're experiencing with IIS6 not routing URLs that don't include `.mvc` is common, as IIS6 does not automatically map all incoming requests to the ASP.NET runtime, particularly for file extensions like `.php` or other non-MVC URLs. Here’s a step-by-step approach to ensure that all URLs, regardless of their ...
22,229
[ { "from": "human", "value": "I am probably overlooking something really simple here but I am trying to redirect all bad URLs to an action that filters the URL based on conditions and then either 301 redirects to a suitable page or issues a 404 page.\nTo this end I have a route like this at the end of my rou...
I'm using mysqldump to replicate a database between accounts on a particular machine. Everything works just great, except when we get to our defined views. Because the dump includes a line like the following ... /*!50013 DEFINER=`user_a`@`localhost` SQL SECURITY DEFINER */ ... when loading the dump into mysql on use...
The issue you are facing stems from how MySQL handles view definitions and their `DEFINER` clause. When you create a view with a specific user as the definer, that user needs the required privileges to execute or create the view when restoring it in another account. If the definer's privileges are greater than those of...
21,076
[ { "from": "human", "value": "I'm using mysqldump to replicate a database between accounts on a particular machine. Everything works just great, except when we get to our defined views. Because the dump includes a line like the following ...\n/*!50013 DEFINER=`user_a`@`localhost` SQL SECURITY DEFINER */\n\...
I tried: DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); Document doc = db.parse(f); Node mapNode = getMapNode(doc); System.out.print("\r\n elementName "+ mapNode.getNodeName());//This works fine. Element e = (Element) mapNode; //This is where the erro...
The issue you're encountering with the `ClassCastException` when casting `mapNode` to `Element` suggests that `mapNode` is not actually an instance of `Element`. It could be a different type of `Node`, such as a `Text` node or a `Comment`, which would lead to the cast failing. The fact that it works on your local machi...
20,406
[ { "from": "human", "value": "I tried:\nDocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();\n\nDocumentBuilder db = dbf.newDocumentBuilder();\nDocument doc = db.parse(f);\nNode mapNode = getMapNode(doc);\nSystem.out.print(\"\\r\\n elementName \"+ mapNode.getNodeName());//This works fine.\n\nEl...
I have a WCF service running on the IIS with a ServiceHostFactory. It's running fine with the WSHttpBinding but because of the speed and everything being on the same network (no firewalls) i want to speed up things a bit using the NetTcpBinding instead. When i try to do that i get this error: Could not connect to net....
It looks like you're trying to use NetTcpBinding for your WCF service but are encountering issues with establishing a connection and configuration. Here are several steps you can follow to troubleshoot and properly configure your WCF service to use NetTcpBinding. ### 1. Check Your Service Configuration Make sure your...
21,615
[ { "from": "human", "value": "I have a WCF service running on the IIS with a ServiceHostFactory. It's running fine with the WSHttpBinding but because of the speed and everything being on the same network (no firewalls) i want to speed up things a bit using the NetTcpBinding instead.\nWhen i try to do that i ...
Our base Masterpage has something like the following <head runat="server"> <title></title> <script type="text/javascript" src="<%= Page.ResolveClientURL("~/javascript/actions.js")%>"></script> <script type="text/javascript" src="<%= Page.ResolveClientURL("~/javascript/jquery/jquery-1.2.6.min.js")%>"></scrip...
The error you're encountering occurs because ASP.NET does not allow modifying the control collection (like adding controls or elements) in the MasterPage when code blocks (`<% ... %>`) are used. When you create a hierarchy of MasterPages, using code blocks directly in the base MasterPage can lead to this error when the...
19,661
[ { "from": "human", "value": "Our base Masterpage has something like the following\n <head runat=\"server\">\n <title></title>\n\n <script type=\"text/javascript\" src=\"<%= Page.ResolveClientURL(\"~/javascript/actions.js\")%>\"></script>\n <script type=\"text/javascript\" src=\"<%= Page.ResolveClient...
I've just updated my ruby installation on my gentoo server to ruby 1.8.6 patchlevel 287 and have started getting an error on one of my eRuby apps. The error given in the apache error_log file is: [error] mod_ruby: /usr/lib/ruby/1.8/cgi.rb:774: superclass mismatch for class Cookie (TypeError) The strange thing is that ...
The error message you're seeing indicates that there is a problem with class inheritance in your Ruby application, specifically with the `Cookie` class in the `cgi.rb` library. This kind of error usually occurs when there are conflicting definitions of a class or when the class is being redefined incorrectly in the cod...
17,954
[ { "from": "human", "value": "I've just updated my ruby installation on my gentoo server to ruby 1.8.6 patchlevel 287 and have started getting an error on one of my eRuby apps. The error given in the apache error_log file is:\n[error] mod_ruby: /usr/lib/ruby/1.8/cgi.rb:774: superclass mismatch for class Cook...
Quite a few comments to answers in a different post, Where are the best locations to write an error log in Windows?, gave me the impression that a lot of things regarding standard folders (%APPDATA%; %TEMP%) in Windows Vista are different from Windows XP, which should of course be taken into account when developing sof...
When considering whether to rewrite modules in your project to make them ready for Windows Vista, there are several factors to weigh: 1. **User Base**: If your company's users are primarily on Windows XP and there's little indication they will upgrade soon, it may not be an immediate concern to make your software comp...
23,276
[ { "from": "human", "value": "Quite a few comments to answers in a different post, Where are the best locations to write an error log in Windows?, gave me the impression that a lot of things regarding standard folders (%APPDATA%; %TEMP%) in Windows Vista are different from Windows XP, which should of course ...
Often when making changes to a VS2008 ASP.net project we get a message like: BC30560: 'mymodule_ascx' is ambiguous in the namespace 'ASP'. This goes away after a recompile or sometimes just waiting 10 seconds and refreshing the page. Any way to get rid of it?
The error message you're seeing, `BC30560: 'mymodule_ascx' is ambiguous in the namespace 'ASP'`, indicates that there are multiple definitions of the same user control (in this case, `mymodule.ascx`) within the ASP.NET project. This can occur for several reasons, particularly in development environments where changes a...
20,197
[ { "from": "human", "value": "Often when making changes to a VS2008 ASP.net project we get a message like:\nBC30560: 'mymodule_ascx' is ambiguous in the namespace 'ASP'.\nThis goes away after a recompile or sometimes just waiting 10 seconds and refreshing the page. \nAny way to get rid of it?\n" }, { ...
Someone told me about swamp diagrams explaning that they were useful to predict code quality by measuring the rate of incoming defects and outgoing fixes on a given product. Unfortunately, I am unable to find additional information on those diagrams and I am wondering if it is a jargon term specific to one company. Can...
Swamp diagrams are a visual representation used to assess and communicate the quality of software code, particularly in terms of defects and fixes over time. While not an officially standardized term in software engineering, the concept is often used in some organizations or teams to visualize the health of their codeb...
22,634
[ { "from": "human", "value": "Someone told me about swamp diagrams explaning that they were useful to predict code quality by measuring the rate of incoming defects and outgoing fixes on a given product.\nUnfortunately, I am unable to find additional information on those diagrams and I am wondering if it is ...
I want to record user states and then be able to report historically based on the record of changes we've kept. I'm trying to do this in SQL (using PostgreSQL) and I have a proposed structure for recording user changes like the following. CREATE TABLE users ( userid SERIAL NOT NULL PRIMARY KEY, name VARCHAR(40), ...
Your proposed table structure is a good starting point for tracking user statuses over time. However, there are a few potential improvements you could make to ensure that your system works effectively and efficiently for historical queries. Let's address your questions one by one. ### 1) Is this the best way to struct...
21,316
[ { "from": "human", "value": "I want to record user states and then be able to report historically based on the record of changes we've kept. I'm trying to do this in SQL (using PostgreSQL) and I have a proposed structure for recording user changes like the following.\nCREATE TABLE users (\n userid SERIAL N...
I have an application which takes a string value of the form %programfiles%\directory\tool.exe from its application config file. I want to make this into a useable filename so that I can call System.Diagnostics.Process.Start(filename) and have it execute the application. I'm curently getting a System.ComponentModel.W...
To convert the `%programfiles%` environment variable (and potentially other similar variables) in a string like `%programfiles%\directory\tool.exe` to a usable file path in your application, you will need to expand the environment variables using the `Environment.ExpandEnvironmentVariables` method in C#. This will repl...
22,826
[ { "from": "human", "value": "I have an application which takes a string value of the form %programfiles%\\directory\\tool.exe from its application config file.\nI want to make this into a useable filename so that I can call \nSystem.Diagnostics.Process.Start(filename)\n\nand have it execute the application....
As above, anyone tried that before on Windows 2008 server? If yes, how is everything go? Stable enough for production use?
It seems like your question is referring to a specific application or technology, but you haven't mentioned what it is. If you're asking about a particular application or configuration running on Windows Server 2008, the stability and suitability for production use would depend on several factors, including: 1. **Appl...
18,870
[ { "from": "human", "value": "As above, anyone tried that before on Windows 2008 server? If yes, how is everything go? Stable enough for production use?\n" }, { "from": "gpt", "value": "It seems like your question is referring to a specific application or technology, but you haven't mentioned wha...
Suppose that you are writing or maintaining a piece of code that uses some API that you are not 100% familiar with. How do you decide whether to read the documentation of a certain call target, and how much time to spend reading it? How do you decide not to read it? (Let's assume you can read it by opening the HTML do...
Deciding whether to read the documentation of an API call and how much time to invest in it involves several factors. Here’s a structured approach to guide your decision-making: ### 1. **Context and Purpose** - **Understand the Context**: Assess your current task or problem. What are you trying to achieve with this...
21,908
[ { "from": "human", "value": "Suppose that you are writing or maintaining a piece of code that uses some API that you are not 100% familiar with.\nHow do you decide whether to read the documentation of a certain call target, and how much time to spend reading it? How do you decide not to read it? \n(Let's as...
I'm passing /file:c:\myfile.doc and I'm getting back "/file:c:\myfile.doc" instead of "C:\myfile.doc", could someone please advise where I am going wrong? if (entry.ToUpper().IndexOf("FILE") != -1) { //override default log location MyFileLocation = entry.Split(new...
The issue you're experiencing is due to the way you are splitting the `entry` string and how you're handling the substring. Let's break it down and fix it. In your current code, you have: ```csharp if (entry.ToUpper().IndexOf("FILE") != -1) { //override default log location MyFileLocation = entry.Split(new ch...
22,916
[ { "from": "human", "value": "I'm passing /file:c:\\myfile.doc and I'm getting back \"/file:c:\\myfile.doc\" instead of \"C:\\myfile.doc\", could someone please advise where I am going wrong?\n if (entry.ToUpper().IndexOf(\"FILE\") != -1)\n {\n //override default log loca...
I have an <img> in an HTML document that I would like to highlight as though the user had highlighted it using the mouse. Is there a way to do that using JavaScript? I only need it to work in Mozilla, but any and all information is welcome. EDIT: The reason I want to select the image is actually not so that it appears ...
To simulate highlighting an `<img>` element in a way that resembles text selection, you can use the `document.createRange()` and `window.getSelection()` methods in JavaScript. This can allow you to programmatically select the image, enabling actions like copying to the clipboard using XPCOM (in Mozilla Firefox). Here'...
21,696
[ { "from": "human", "value": "I have an <img> in an HTML document that I would like to highlight as though the user had highlighted it using the mouse. Is there a way to do that using JavaScript?\nI only need it to work in Mozilla, but any and all information is welcome.\nEDIT: The reason I want to select th...
I'm seeing this exception message coming from XslCompiledTransform.Transform(), but after handling the exception the XSL transform still appears to have been successful. The full exception message is: Token Text in state EndRootElement would result in an invalid XML document. Make sure that the ConformanceLevel ...
The exception message you are seeing from `XslCompiledTransform.Transform()` indicates that the generated XML may not be conforming to the expected XML structure based on the XSLT stylesheet's context. Specifically, the message suggests that your XSLT may be attempting to produce an XML document when it is instead prod...
21,551
[ { "from": "human", "value": "I'm seeing this exception message coming from XslCompiledTransform.Transform(), but after handling the exception the XSL transform still appears to have been successful. The full exception message is:\n\nToken Text in state EndRootElement\n would result in an invalid XML\n doc...
After switching back and forth between several scripting languages this week, I found myself thinking how similar they all are. Yet I'm always reaching for Google (or nowadays SO) to remember details like what the local equivalents of "instanceof" and "endswith" are, or the right syntax to declare an interface, or wha...
Creating a scripting language that allows for the free mixing of syntax and function names from Python, Ruby, PHP, Perl, shell scripting, and JavaScript presents several significant challenges. Below are some of the most critical conflicts and issues that would need to be addressed in such a language: ### 1. **Syntax ...
20,904
[ { "from": "human", "value": "After switching back and forth between several scripting languages this week, I found myself thinking how similar they all are. Yet I'm always reaching for Google (or nowadays SO) to remember details like what the local equivalents of \"instanceof\" and \"endswith\" are, or the...
What is the maximum number of threads you can create in a C# application? And what happens when you reach this limit? Is an exception of some kind thrown?
In C#, the maximum number of threads that can be created in an application is primarily limited by the underlying operating system and system resources, rather than a strict limit imposed by the .NET framework itself. Each thread consumes system memory and resources, so the actual limit depends on factors such as: 1. ...
25,026
[ { "from": "human", "value": "What is the maximum number of threads you can create in a C# application? And what happens when you reach this limit? Is an exception of some kind thrown?\n" }, { "from": "gpt", "value": "In C#, the maximum number of threads that can be created in an application is...
I seem to be getting breakpoints from other programmers when checking out code... Where is the list of breakpoints saved by Visual Studio? In the vbproj file? vbproj.user file? documents and settings? are they meant to be specific to the solution, the project, the user, the computer they are set on? Thanks!
In Visual Studio, breakpoints are stored in the `.suo` (Solution User Options) file associated with the solution, rather than in the `.vbproj` or `.vbproj.user` files. Here are some key points about where and how breakpoints are saved: 1. **Location of Breakpoint Data**: - The breakpoints are stored in a hidden fi...
24,338
[ { "from": "human", "value": "I seem to be getting breakpoints from other programmers when checking out code...\nWhere is the list of breakpoints saved by Visual Studio? In the vbproj file? vbproj.user file? documents and settings? are they meant to be specific to the solution, the project, the user, the com...
I'm doing a personal organizer for learning purposes, and i've never worked with XML so i'm not sure if my solution is the best. Here's the basic structure for the XML file i came with: <calendar> <year value="2008"> <month value="october"> <day value="16"> <activity name="mike's...
Your XML structure looks like a solid starting point for organizing a calendar with activities. Here are a few suggestions and considerations to enhance the structure and ensure it meets your needs: ### Suggestions for Improvement 1. **Attribute vs. Element**: - Instead of putting the `activity description` as te...
21,774
[ { "from": "human", "value": "I'm doing a personal organizer for learning purposes, and i've never worked with XML so i'm not sure if my solution is the best. Here's the basic structure for the XML file i came with:\n<calendar>\n <year value=\"2008\">\n <month value=\"october\">\n <day v...
I have a storyboard(1) that does some basic animations in 2 seconds. I want the storyboard(1) to do all the property animations I have set it up to do (this all works fine). But at 3 seconds into the storyboard(1) I want to begin storyboard(2) and exit storyboard(1) without user interaction at all. Only thing I've se...
To achieve the effect of automatically triggering `Storyboard(2)` at 3 seconds into `Storyboard(1)`, you can use a `Storyboard.Completed` event to start `Storyboard(2)` when `Storyboard(1)` reaches that point in its timeline. Below is an example of how you can do this in XAML and VB.NET. ### XAML Example This example...
19,463
[ { "from": "human", "value": "I have a storyboard(1) that does some basic animations in 2 seconds. I want the storyboard(1) to do all the property animations I have set it up to do (this all works fine). But at 3 seconds into the storyboard(1) I want to begin storyboard(2) and exit storyboard(1) without us...
I'm using Visual Studio 2008 for an ASP .Net application, and Visual Studio keeps adding blank lines to my aspx file whenever I save, switch to design mode and back to code view, switch to split mode, or switch between files. Before I save, I will have: </ContentTemplate></asp:UpdatePanel> ...
This issue with Visual Studio 2008 adding blank lines to your ASPX files is known to occur, particularly with ASP.NET Web Forms and can be caused by a few factors. Here are some steps you can take to troubleshoot and resolve this problem: 1. **Check Code Formatting Settings**: - Go to `Tools` -> `Options` -> `Text ...
18,794
[ { "from": "human", "value": "I'm using Visual Studio 2008 for an ASP .Net application, and Visual Studio keeps adding blank lines to my aspx file whenever I save, switch to design mode and back to code view, switch to split mode, or switch between files. Before I save, I will have:\n ...
Very simple question, is there any cloud server enviroments avaliable these days for us .NET guys that rivals Amazons ec2? EDIT: PDC 2008 looks like there are some very interesting info, and only 4 days 2 hours to wait :-). Looks like I need to get saving fast for the conference fee though.
Yes, there are several cloud server environments available for .NET developers that can rival Amazon EC2. Here are a few options: 1. **Microsoft Azure**: As the cloud service created by Microsoft, Azure is highly integrated with .NET technologies. It offers various services, including virtual machines, app services, a...
25,822
[ { "from": "human", "value": "Very simple question, is there any cloud server enviroments avaliable these days for us .NET guys that rivals Amazons ec2? \nEDIT: \nPDC 2008 looks like there are some very interesting info, and only 4 days 2 hours to wait :-). Looks like I need to get saving fast for the confe...
How do I set the code page to UTF-8 in a C Windows program? I have a third party library that uses fopen to open files. I can use wcstombs to convert my Unicode filenames to the current code page, however if the user has a filename with a character outside the code page then this breaks. Ideally I would just call _setm...
You are correct that the `_setmbcp(65001)` function call does not support UTF-8 in the Microsoft C runtime library. While `_setmbcp` allows setting the multi-byte character code page, setting it to UTF-8 (code page 65001) can lead to undefined behavior and issues with third-party libraries that expect the multibyte cha...
19,584
[ { "from": "human", "value": "How do I set the code page to UTF-8 in a C Windows program?\nI have a third party library that uses fopen to open files. I can use wcstombs to convert my Unicode filenames to the current code page, however if the user has a filename with a character outside the code page then th...
I've got a php script. Most of the time the script returns html, which is working fine, but on one occasion (parameter ?Format=XML) the script returns XML instead of HTML. Is there any way to change the returned mime type of the php output on the fly from text/html to text/xml or application/xml?
Yes, you can change the MIME type of the PHP output on the fly by using the `header()` function in PHP. This allows you to specify the content type of the response based on the parameters passed to the script. Here's a simple example of how you could implement this in your PHP script: ```php <?php // Check if the 'Fo...
20,134
[ { "from": "human", "value": "I've got a php script. Most of the time the script returns html, which is working fine, but on one occasion (parameter ?Format=XML) the script returns XML instead of HTML.\nIs there any way to change the returned mime type of the php output on the fly from text/html to text/xml ...
I'm using the MIDP 2.0 (JSR 118) and I just noticed that there is no reader for strings in J2ME. Does anyone know how you are supposed to read Strings from an InputStream or InputStreamReader in a platform independent way (i.e. between two java enabled cell phones of different models)?
In MIDP 2.0 (JSR 118), there isn't a built-in class for reading strings directly from an `InputStream` or `InputStreamReader`. However, you can implement a method to read strings from an `InputStream` by using a `ByteArrayOutputStream` to capture the bytes and then converting them into a string. Here's a common approa...
25,228
[ { "from": "human", "value": "I'm using the MIDP 2.0 (JSR 118) and I just noticed that there is no reader for strings in J2ME.\nDoes anyone know how you are supposed to read Strings from an InputStream or InputStreamReader in a platform independent way (i.e. between two java enabled cell phones of different ...
I need to design a small project for generating excel reports in .NET, which will be sent to users to use. The excel reports will contain PivotTables. I don't have much experience with them, but I can think of three implementation alternatives: Set a query for it, populate it, send it disconnected. This way the user w...
When designing a small project for generating Excel reports with PivotTables in .NET, the choice of implementation will depend on the balance between performance, usability, and the specific needs of your users. Let's analyze the alternatives you've provided and consider the pros and cons of each: ### 1. Disconnected ...
15,837
[ { "from": "human", "value": "I need to design a small project for generating excel reports in .NET, which will be sent to users to use.\nThe excel reports will contain PivotTables.\nI don't have much experience with them, but I can think of three implementation alternatives:\n\nSet a query for it, populate ...
We have a Windows machine running SQL Server 2005, and we need to be able to run some database queries on it from a Linux box. What are some of the recommended ways of doing this? Ideally, we would want a command-line utility similar to sqlcmd on Windows.
To run queries against SQL Server 2005 from a Linux machine, you have several options. Here are some recommended methods: 1. **FreeTDS**: FreeTDS is an open-source implementation of the Tabular Data Stream protocol that SQL Server uses. You can use FreeTDS to connect to SQL Server from Linux. It comes with a command-l...
18,295
[ { "from": "human", "value": "We have a Windows machine running SQL Server 2005, and we need to be able to run some database queries on it from a Linux box. What are some of the recommended ways of doing this? Ideally, we would want a command-line utility similar to sqlcmd on Windows.\n" }, { "from...
Using the following code I get a nice formatted string: Request.QueryString.ToString Gives me something like: &hello=world&microsoft=sucks But when I use this code to clone the collection to another object (of the same type) I get the Type() back from the ToString() method instead. System.Collections.Specialized.Name...
When you call `ToString()` on a `NameValueCollection`, it doesn't produce a formatted string of the key-value pairs. Instead, it returns the type of the object, which is why you're seeing that unexpected output. To create a formatted string similar to what `Request.QueryString.ToString()` produces, you can use the `St...
23,809
[ { "from": "human", "value": "Using the following code I get a nice formatted string:\nRequest.QueryString.ToString \n\nGives me something like: &hello=world&microsoft=sucks\nBut when I use this code to clone the collection to another object (of the same type) I get the Type() back from the ToString() method...
I'm using the following regex to capture a fixed width "description" field that is always 50 characters long: (?.{50}) My problem is that the descriptions sometimes contain a lot of whitespace, e.g. "FLUID COMPRESSOR " Can somebody provide a regex that: Trims all whitespace off the en...
You can achieve your goal using a combination of regex patterns. The regex pattern to capture your fixed-width "description" field can remain similar, but you'll need to apply additional transformations to handle the whitespace issues you mentioned. Here’s a step-by-step approach to what you can do: 1. **Capture the ...
21,883
[ { "from": "human", "value": "I'm using the following regex to capture a fixed width \"description\" field that is always 50 characters long:\n(?.{50})\n\nMy problem is that the descriptions sometimes contain a lot of whitespace, e.g.\n\"FLUID COMPRESSOR \"\n\nCan somebody pro...
I have always wondered WHaT tHE HecK?!? is the difference between JScript and JavaScript.
Great question! While JScript and JavaScript are often used interchangeably in casual conversation, they actually refer to different things, though they are closely related. ### JavaScript: 1. **Origin**: JavaScript was created by Brendan Eich in 1995 at Netscape. It was originally named "Mocha," then "LiveScript," be...
24,526
[ { "from": "human", "value": "I have always wondered WHaT tHE HecK?!? is the difference between JScript and JavaScript.\n" }, { "from": "gpt", "value": "Great question! While JScript and JavaScript are often used interchangeably in casual conversation, they actually refer to different things, tho...
I've read all the advice on const-correctness in C++ and that it is important (in part) because it helps the compiler to optimize your code. What I've never seen is a good explanation on how the compiler uses this information to optimize the code, not even the good books go on explaining what happens behind the curtain...
Const-correctness in C++ is indeed a crucial aspect of writing robust and efficient code. It signals to the compiler (and to developers) the intended usage of objects, specifically which objects are not going to change state. This allows for various optimizations by the compiler, although the specifics can vary based o...
20,234
[ { "from": "human", "value": "I've read all the advice on const-correctness in C++ and that it is important (in part) because it helps the compiler to optimize your code. What I've never seen is a good explanation on how the compiler uses this information to optimize the code, not even the good books go on e...
Tcl/Tk is a simple way to script small GUIs. Can anyone give a nice example with a button and a text widget. When the button is pressed should a shell command be executed and the output piped to the text widget. If you have other nice and clean examples for useful tasks, please add them too.
Certainly! Below is an example of a simple Tcl/Tk GUI application that includes a button and a text widget. When you press the button, it executes a shell command (in this case, `ls` to list files in the current directory) and displays the output in the text widget. ### Example Tcl/Tk Script ```tcl #!/usr/bin/env wis...
19,199
[ { "from": "human", "value": "Tcl/Tk is a simple way to script small GUIs.\nCan anyone give a nice example with a button and a text widget. When the button is pressed should a shell command be executed and the output piped to the text widget.\nIf you have other nice and clean examples for useful tasks, pleas...
I have the problem, to get a failed run-time check in Visual C++ 2008 because of casting a too big number to a smaller type. The failure is in an external dll, so I can not fix it there. So how can I switch off this run time check for an external project.
In Visual C++ 2008, the runtime check for overflow (which leads to the failed runtime check you are encountering) can be modified by adjusting the project settings. Since you cannot modify the external DLL directly, you can take steps to change the way your application interacts with it. To disable the runtime error c...
25,042
[ { "from": "human", "value": "I have the problem, to get a failed run-time check in Visual C++ 2008 because of casting a too big number to a smaller type. The failure is in an external dll, so I can not fix it there. So how can I switch off this run time check for an external project.\n" }, { "from":...
For C#, I have often used CodeSmith and lately the T4 generator which is part of Visual Studio. I'm looking for something similar for Java, in particular an Eclipse add-in since I do all my Java development using the Eclipse IDE.
For Java development in Eclipse, you have a few options that are similar to CodeSmith and T4 templates in C#. Here are some popular code generation tools and frameworks you can consider: 1. **JOOQ (Java Object Oriented Querying)**: - While primarily a database access library, JOOQ includes code generation capabilit...
22,401
[ { "from": "human", "value": "For C#, I have often used CodeSmith and lately the T4 generator which is part of Visual Studio.\nI'm looking for something similar for Java, in particular an Eclipse add-in since I do all my Java development using the Eclipse IDE.\n" }, { "from": "gpt", "value": "For...
My workplace filters our internet traffic by forcing us to go through a proxy, and unfortunately sites such as IT Conversations and Libsyn are blocked. However, mp3 files in general are not filtered, if they come from sites not on the proxy's blacklist. So is there a website somewhere that will let me give it a URL an...
It sounds like you’re in a tricky situation with the strict internet filtering at your workplace. Here are a few approaches you could consider to access the MP3 files without running into proxy issues: 1. **Use a Podcast Aggregator App**: Many podcast apps allow you to download episodes for offline listening. If you c...
24,033
[ { "from": "human", "value": "My workplace filters our internet traffic by forcing us to go through a proxy, and unfortunately sites such as IT Conversations and Libsyn are blocked. However, mp3 files in general are not filtered, if they come from sites not on the proxy's blacklist.\nSo is there a website s...
The TImageList of Delphi 2009 has support for PNG images by adding them in the imagelist editor. Is there any way to extract a TPngImage from a TImagelist and preserving the alpha channel? What I want to do is actually to extract the images from one TImageList, make a disabled version of them and then add them to anoth...
In Delphi 2009, you can indeed work with `TImageList` to extract images and manipulate them, including preserving the alpha channel. To extract a `TPngImage` from a `TImageList`, you will typically need to create a temporary bitmap, extract the image into this bitmap, and then convert it into a `TPngImage`. Below is an...
21,031
[ { "from": "human", "value": "The TImageList of Delphi 2009 has support for PNG images by adding them in the imagelist editor. Is there any way to extract a TPngImage from a TImagelist and preserving the alpha channel?\nWhat I want to do is actually to extract the images from one TImageList, make a disabled ...
I would like to send mail from a script on a Windows Server 2003 Standard Edition. I think the server setup is pretty much out of the box. The mail server is an Exchange one, and when you're on the internal network you can use plain old SMTP. I have done it from my machine with Perl, but unfortunately Perl is not avail...
You can send an email from a Windows Server 2003 machine using a VBScript. Since you've mentioned that you don't want to install additional software and are already familiar with `wscript`, here’s how you can do it. ### Step 1: Create the VBScript Open Notepad (or any text editor) and paste the following script. This...
22,236
[ { "from": "human", "value": "I would like to send mail from a script on a Windows Server 2003 Standard Edition. I think the server setup is pretty much out of the box.\nThe mail server is an Exchange one, and when you're on the internal network you can use plain old SMTP. I have done it from my machine with...
This may not be the correct way to use controllers, but I did notice this problem and hadn't figured out a way to correct it. public JsonResult SomeControllerAction() { //The current method has the HttpContext just fine bool currentIsNotNull = (this.HttpContext == null); //which is false //creating a...
You're correct in noticing that creating a new instance of a controller directly, as you did with `SomeOtherController controller = new SomeOtherController();`, does not properly set up the controller's `HttpContext`. When you create a controller this way, you're bypassing the ASP.NET MVC framework's mechanisms that co...
22,487
[ { "from": "human", "value": "This may not be the correct way to use controllers, but I did notice this problem and hadn't figured out a way to correct it. \npublic JsonResult SomeControllerAction() {\n\n //The current method has the HttpContext just fine\n bool currentIsNotNull = (this.HttpContext == ...
Is there a way to listen for a javascript function to exit? A trigger that could be setup when a function has completed? I am attempting to use a user interface obfuscation technique (BlockUI) while an AJAX object is retrieving data from the DB, but the function doesn't necessarily execute last, even if you put it at t...
You're correct in noting that JavaScript is asynchronous in nature, especially when dealing with AJAX calls. In your example, since the AJAX call does not block execution, the `unblockUI()` function is executed immediately after `ajaxCall()` is invoked, leading to the behavior you're observing. To handle this properly...
20,023
[ { "from": "human", "value": "Is there a way to listen for a javascript function to exit? A trigger that could be setup when a function has completed?\nI am attempting to use a user interface obfuscation technique (BlockUI) while an AJAX object is retrieving data from the DB, but the function doesn't necessa...
I fill a collection one single time when my J2EE webapp starts. Then, several thread may access it at same time but only to read it. I know using a synchronized collection is mandatory for parallels write but do I still need it for parallels read ?
In Java, when multiple threads are reading from a collection and there are no modifications being made to that collection (i.e., no writes), you generally do not need to synchronize the reads. However, there are important considerations to keep in mind: 1. **Immutable Collections**: If the collection is immutable (i.e...
22,278
[ { "from": "human", "value": "I fill a collection one single time when my J2EE webapp starts.\nThen, several thread may access it at same time but only to read it.\nI know using a synchronized collection is mandatory for parallels write but do I still need it for parallels read ?\n" }, { "from": "gpt...
How do you access the items collection of a combo box in a specific row in a DataGridView? I'm populating the combo as follows: Dim VATCombo As New DataGridViewComboBoxColumn With VATCombo .HeaderText = "VAT Rate" .Name = .HeaderText Dim VATCol As Ne...
In order to access and set a default value for a `DataGridViewComboBoxColumn` in a specific row of a `DataGridView`, you need to set the value of the cell in the corresponding row and column. You can do this by handling the `DataGridView` events or directly after adding a new row. Here’s how you can accomplish both tas...
24,276
[ { "from": "human", "value": "How do you access the items collection of a combo box in a specific row in a DataGridView?\nI'm populating the combo as follows:\n Dim VATCombo As New DataGridViewComboBoxColumn\n With VATCombo\n .HeaderText = \"VAT Rate\"\n .Nam...
I'm cheap and don't want to pay for ReSharper or TestDriven.NET, is there a free visual Studio addin for NUnit?
Yes, there are several free options for integrating NUnit into Visual Studio without needing to pay for tools like ReSharper or TestDriven.NET. Here are a couple of recommendations: 1. **NUnit3TestAdapter**: This is a free Visual Studio extension that allows you to run NUnit tests directly from the Test Explorer in Vi...
25,088
[ { "from": "human", "value": "I'm cheap and don't want to pay for ReSharper or TestDriven.NET, is there a free visual Studio addin for NUnit?\n" }, { "from": "gpt", "value": "Yes, there are several free options for integrating NUnit into Visual Studio without needing to pay for tools like ReSharp...
I'm working on a system were a user can edit existing objects ("Filter" domain objects to be exact) through a GUI. As a UI hint, we only want to enable the save button if the user really modified something to the object. I was wondering if anyone had any experience with this problem and what the best way would be to ap...
Your approach of using an `isDirty()` flag on the domain object is a common and effective way to track changes in a GUI application. Here are some suggestions and refinements that might help you implement this system more effectively: 1. **Deep Copy of Original Object**: Instead of just a shallow copy of the original ...
20,456
[ { "from": "human", "value": "I'm working on a system were a user can edit existing objects (\"Filter\" domain objects to be exact) through a GUI. As a UI hint, we only want to enable the save button if the user really modified something to the object. I was wondering if anyone had any experience with this p...
I was looking at how some site implemented rounded corners, and the CSS had these odd tags that I've never really seen before. -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; I googled it, and they seem to be Firefox...
The CSS properties you've encountered are vendor prefixes that were used in the early stages of implementing specific CSS features in different web browsers. These prefixes were necessary when new features were still being developed and standardized. Let's break them down: 1. **`-moz-`**: This prefix was used for Mozi...
23,588
[ { "from": "human", "value": "I was looking at how some site implemented rounded corners, and the CSS had these odd tags that I've never really seen before.\n-moz-border-radius-topright: 5px;\n-webkit-border-top-right-radius: 5px; \n-moz-border-radius-bottomright: 5px;\n-webkit-border-bottom-right-radius: 5p...
I seem to be seeing more 'for' loops over iterators in questions & answers here than I do for_each(), transform(), and the like. Scott Meyers suggests that stl algorithms are preferred, or at least he did in 2001. Of course, using them often means moving the loop body into a function or function object. Some may fee...
The question of whether to prefer STL algorithms over hand-rolled loops in C++ is a nuanced one, and there are several factors to consider. Here's a summary of the key points to help guide your decision: ### Advantages of STL Algorithms 1. **Expressiveness and Readability**: STL algorithms (like `std::for_each`, `std...
21,941
[ { "from": "human", "value": "I seem to be seeing more 'for' loops over iterators in questions & answers here than I do for_each(), transform(), and the like. Scott Meyers suggests that stl algorithms are preferred, or at least he did in 2001. Of course, using them often means moving the loop body into a f...
Is there a significance to the word "salt" for a password salt?
Yes, the term "salt" in the context of password security has a specific significance. A "salt" is a random value that is added to a password before it is hashed. The primary purpose of salting is to enhance security and prevent various types of attacks, particularly those that exploit pre-computed hash tables (like rai...
25,660
[ { "from": "human", "value": "Is there a significance to the word \"salt\" for a password salt?\n" }, { "from": "gpt", "value": "Yes, the term \"salt\" in the context of password security has a specific significance. A \"salt\" is a random value that is added to a password before it is hashed. Th...
When using before_filter :login_required to protect a particular page, the link_to_unless_current method in the application layout template renders the "Login" link for the login page as a hyperlink instead of just text. The "Login" text/link problem only occurs when redirected to the Login Page via the before_filter m...
The behavior you're experiencing with the `link_to_unless_current` method in your Rails application is likely due to the way the `before_filter` (or `before_action` in newer versions) handles the request lifecycle and how the current URL is set during a redirect. When you use `before_filter :login_required` to protect...
23,802
[ { "from": "human", "value": "When using before_filter :login_required to protect a particular page, the link_to_unless_current method in the application layout template renders the \"Login\" link for the login page as a hyperlink instead of just text.\nThe \"Login\" text/link problem only occurs when redire...
In ASP.NET, when building a web server control in a class library that includes an HttpHandler is there a way to automatically register the handler without having to manually edit the web application's web.config file? I have a class library that contains a CompositeControl. In the composite control I have an Image con...
Automatically registering an `HttpHandler` in a web application without requiring manual edits to the `web.config` file is a challenge in ASP.NET, as the configuration system is designed to be explicitly modified by developers. However, there are some strategies you can employ to streamline this process and minimize th...
18,519
[ { "from": "human", "value": "In ASP.NET, when building a web server control in a class library that includes an HttpHandler is there a way to automatically register the handler without having to manually edit the web application's web.config file?\nI have a class library that contains a CompositeControl. In...
Yes that sounds backwards. I want to create an area or frame in my Silverlight app to host another page from my site. I've seen it done before but I can't seem to find any examples. This way I can control the entire page layout using SL but still use existing aspx pages. thanks
In Silverlight, you can host an HTML page or ASPX page using the `WebBrowser` control. This allows you to embed a web page within your Silverlight application while maintaining the ability to control the overall layout through Silverlight. Below is an example of how you can achieve this. ### Step 1: Create a Silverlig...
21,839
[ { "from": "human", "value": "Yes that sounds backwards. I want to create an area or frame in my Silverlight app to host another page from my site. I've seen it done before but I can't seem to find any examples.\nThis way I can control the entire page layout using SL but still use existing aspx pages.\nthank...
I'm calling a function that returns a string, but it's only actually returning the first character of the string it's supposed to be returning. Here's a sample piece of code to recreate the issue I'm experiencing: Public Function GetSomeStringValue(Value as Integer) As String ... Code Goes here Return Some_Mult...
If your function `GetSomeStringValue` is only returning the first character of the string that it's supposed to return, there could be a few potential causes for this behavior. Let's explore some of the common issues: 1. **Variable Scope or String Manipulation**: Ensure that `Some_Multicharacter_string` is properly as...
20,772
[ { "from": "human", "value": "I'm calling a function that returns a string, but it's only actually returning the first character of the string it's supposed to be returning.\nHere's a sample piece of code to recreate the issue I'm experiencing:\nPublic Function GetSomeStringValue(Value as Integer) As String\...
I want a true deep copy. In Java, this was easy, but how do you do it in C#?
In C#, creating a true deep copy of an object is not as straightforward as in Java, mainly because C# does not provide a built-in method for deep copying objects. However, you can achieve deep copying in a few different ways: ### 1. Manual Deep Copy The most common way is to implement the `ICloneable` interface and m...
22,538
[ { "from": "human", "value": "I want a true deep copy. In Java, this was easy, but how do you do it in C#?\n" }, { "from": "gpt", "value": "In C#, creating a true deep copy of an object is not as straightforward as in Java, mainly because C# does not provide a built-in method for deep copying obj...
Eg. ConnectionDetails cd = new ConnectionDetails (); cd.ProviderName = "System.Data.OleDb"; cd.DataSource = "serverAddress"; cd.Catalog = "database"; cd.UserId = "userId"; cd.Password = "password"; string connectionString = cs.CreateConnectionString(); // Should return: // "Provider=SQLOLEDB;Data Source=serverAddress;...
To programmatically retrieve the connection string provider property based on an invariant database provider name (like `System.Data.OleDb`), you can utilize `DbProviderFactories` to get the right factory and use its `DbConnectionStringBuilder` to build your connection string. However, as you observed, the `DbConnectio...
23,657
[ { "from": "human", "value": "Eg.\nConnectionDetails cd = new ConnectionDetails ();\ncd.ProviderName = \"System.Data.OleDb\";\ncd.DataSource = \"serverAddress\";\ncd.Catalog = \"database\";\ncd.UserId = \"userId\";\ncd.Password = \"password\";\n\nstring connectionString = cs.CreateConnectionString();\n// Sho...
Given a credit card number and no additional information, what is the best way in PHP to determine whether or not it is a valid number? Right now I need something that will work with American Express, Discover, MasterCard, and Visa, but it might be helpful if it will also work with other types.
To determine if a credit card number is valid, you can use the Luhn algorithm, which is a simple checksum formula used to validate a variety of identification numbers, including credit card numbers. Additionally, you can check the card type based on the starting digits and length of the card number. Here’s a simple PH...
19,028
[ { "from": "human", "value": "Given a credit card number and no additional information, what is the best way in PHP to determine whether or not it is a valid number?\nRight now I need something that will work with American Express, Discover, MasterCard, and Visa, but it might be helpful if it will also work ...
I'm loading an image from a file, and I want to know how to validate the image before it is fully read from the file. string filePath = "image.jpg"; Image newImage = Image.FromFile(filePath); The problem occurs when image.jpg isn't really a jpg. For example, if I create an empty text file and rename it to image.jpg, ...
To validate whether a file is a valid image before fully loading it into memory, you can create a couple of helper functions that check the file's format using the `Image` class in C#. The `Image` class can attempt to create an image object from the stream or file path, and you can catch any exceptions that may occur d...
23,069
[ { "from": "human", "value": "I'm loading an image from a file, and I want to know how to validate the image before it is fully read from the file.\nstring filePath = \"image.jpg\";\nImage newImage = Image.FromFile(filePath);\n\nThe problem occurs when image.jpg isn't really a jpg. For example, if I create ...
Trying to answer to another post whose solution deals with IP addresses and netmasks, I got stuck with plain bitwise arithmetic. Is there a standard way, in Python, to carry on bitwise AND, OR, XOR, NOT operations assuming that the inputs are "32 bit" (maybe negative) integers or longs, and that the result must be a lo...
In Python, the bitwise operations behave differently than in C, especially when dealing with integers. In C, unsigned integers can wrap around, while in Python, integers can be negative when they exceed the maximum value of a signed integer. To ensure that you get the expected results similar to unsigned 32-bit intege...
23,053
[ { "from": "human", "value": "Trying to answer to another post whose solution deals with IP addresses and netmasks, I got stuck with plain bitwise arithmetic.\nIs there a standard way, in Python, to carry on bitwise AND, OR, XOR, NOT operations assuming that the inputs are \"32 bit\" (maybe negative) integer...
I know that tan(angle) gets me the tangent. But how do I do the "reverse tangent" so that I can get the angle given the length of both sides of the right triangle? I'm assuming there is a method for this in math.h?
Yes, you are correct! In mathematics, the "reverse tangent" is called the arctangent, and it is used to find the angle from the tangent ratio. In the C standard library, you can use the `atan` function, which computes the arctangent of a value. However, if you need the angle in degrees instead of radians, you can conve...
25,453
[ { "from": "human", "value": "I know that tan(angle) gets me the tangent. But how do I do the \"reverse tangent\" so that I can get the angle given the length of both sides of the right triangle?\nI'm assuming there is a method for this in math.h?\n" }, { "from": "gpt", "value": "Yes, you are cor...
Is it really necessary to release COM components from Office PIA, when you don't need them anymore by invoking Marshal.ReleaseComObject(..)? I found various and contradictory advices on this topic on the web. In my opinion, since Outlook PIA is always returning a new references to its interfaces as returning values fro...
When working with Office Primary Interop Assemblies (PIAs), such as those for Outlook, it's important to understand how COM interop and reference counting work in .NET. Here are some key points to consider regarding the release of COM components: 1. **COM Interoperability**: When you interact with COM objects, such as...
23,060
[ { "from": "human", "value": "Is it really necessary to release COM components from Office PIA, when you don't need them anymore by invoking Marshal.ReleaseComObject(..)?\nI found various and contradictory advices on this topic on the web. In my opinion, since Outlook PIA is always returning a new references...
I have implemented a python webserver. Each http request spawns a new thread. I have a requirement of caching objects in memory and since its a webserver, I want the cache to be thread safe. Is there a standard implementatin of a thread safe object cache in python? I found the following http://freshmeat.net/projects/l...
Certainly! In Python, you can achieve thread-safe caching using the `threading` module to manage locks or using existing libraries that provide thread-safe cache implementations. Here are a couple of options: ### Option 1: Using `threading.Lock` You can create a simple thread-safe cache using a dictionary and a lock ...
21,314
[ { "from": "human", "value": "I have implemented a python webserver. Each http request spawns a new thread.\nI have a requirement of caching objects in memory and since its a webserver, I want the cache to be thread safe. Is there a standard implementatin of a thread safe object cache in python? I found the ...
I have a 30000x14000 sparse matrix in MATLAB (version 7), which I need to use in another program. Calling save won't write this as ASCII (not supported). Calling full() on this monster results in an Out of Memory error. How do I export it?
To export a large sparse matrix in MATLAB to an ASCII format without running out of memory, you can consider writing it in a compressed format that captures the non-zero entries along with their indices. Here's how you can do that: ### Method: Exporting Non-zero Entries of a Sparse Matrix 1. **Use the `find` function...
23,515
[ { "from": "human", "value": "I have a 30000x14000 sparse matrix in MATLAB (version 7), which I need to use in another program. Calling save won't write this as ASCII (not supported). Calling full() on this monster results in an Out of Memory error.\nHow do I export it?\n" }, { "from": "gpt", "v...
I'm looking for a database of commonly installed Windows software. At minimum I need the name of the software and the executable name, but it'd also be nice to have the publisher and the common installation path, etc. Basically, I'd like to be able to query it to find all the software by Adobe and the associated execut...
Creating or finding a comprehensive database of installed Windows software can be quite challenging, as such information can change frequently and may not be consistently compiled. However, here are several approaches you can consider to gather the data you need: ### 1. **Existing Databases & Repositories:** - **Ninit...
22,111
[ { "from": "human", "value": "I'm looking for a database of commonly installed Windows software. At minimum I need the name of the software and the executable name, but it'd also be nice to have the publisher and the common installation path, etc. Basically, I'd like to be able to query it to find all the so...
I'm fairly new to JavaScript. Given a local machine's folder path (Windows), I was wondering how you can extract the names of all the possible folders in the current path, without the knowledge of how many folders there are or what they are called. Thank you very much in advance.
To extract the names of all folders in a specified directory on a Windows machine using JavaScript, you'll need to use Node.js, as it provides the necessary modules for file system operations. Here's a step-by-step guide on how to do this: ### 1. Install Node.js If you haven't already installed Node.js, you can down...
23,867
[ { "from": "human", "value": "I'm fairly new to JavaScript. \nGiven a local machine's folder path (Windows), I was wondering how you can extract the names of all the possible folders in the current path, without the knowledge of how many folders there are or what they are called.\nThank you very much in adva...
Is there code in VBA I can wrap a function with that will let me know the time it took to run, so that I can compare the different running times of functions?
Yes, you can easily measure the execution time of a function in VBA by wrapping it with some timing code. You can use the `Timer` function, which returns the number of seconds elapsed since midnight. Here’s a basic example of how you can create a wrapper to time the execution of a function: ```vba Function TimeExecuti...
21,134
[ { "from": "human", "value": "Is there code in VBA I can wrap a function with that will let me know the time it took to run, so that I can compare the different running times of functions?\n" }, { "from": "gpt", "value": "Yes, you can easily measure the execution time of a function in VBA by wrap...
So in my documentation it says: public event TreeViewPlusNodeCheckedEventHandler NodeChecked() You can use this event to run cause a method to run whenever the check-box for a node is checked on the tree. So how do I add a method to my code behind file that will run when a node is checked? The method I want to run...
To respond to the `NodeChecked` event in your C# code, you'll need to subscribe to the event and connect it to the `TOCNodeCheckedServer` method you defined. Below is a step-by-step guide to accomplishing this in your code-behind file: ### Step 1: Subscribe to the Event You will need to subscribe to the `NodeChecked`...
21,764
[ { "from": "human", "value": "So in my documentation it says:\n\npublic event TreeViewPlusNodeCheckedEventHandler NodeChecked()\nYou can use this event to run cause a method to run whenever the\n check-box for a node is checked on the tree.\n\nSo how do I add a method to my code behind file that will run wh...
I have a web service which takes quite some time to complete execution, and i am calling this web service asynchronously. I also want to implement an Abort functionality which will abort the web service method. Currently, i am observing that even if I dispose the requesting Web Service object, the web service completes...
To implement an abort functionality for a long-running web service operation, you need to take a more deliberate approach since simply disposing of the requesting client object will not terminate the server-side processing. Here are some strategies you can consider: ### 1. Use a Cancellation Token If your web service...
11,731
[ { "from": "human", "value": "I have a web service which takes quite some time to complete execution, and i am calling this web service asynchronously. I also want to implement an Abort functionality which will abort the web service method. Currently, i am observing that even if I dispose the requesting Web ...
I'm trying to order items based on an attribute value: <xsl:apply-templates select="Question"> <xsl:sort order="ascending" select="@Value"></xsl:sort> </xsl:apply-templates> This does order them, but I could have values like 1,2,3, ... 10, 11, ... 20 and it will order them 1,10,11, ... 2,20... 3. etc. I could also...
To achieve the sorting you described, where numeric values are sorted first and then alphabetic values (and to ensure that numeric sorting respects numerical values rather than lexicographic), you can use multiple `<xsl:sort>` elements. Here’s how you can sort by the numeric part of the attribute first and then by the...
21,701
[ { "from": "human", "value": "I'm trying to order items based on an attribute value:\n<xsl:apply-templates select=\"Question\">\n <xsl:sort order=\"ascending\" select=\"@Value\"></xsl:sort>\n</xsl:apply-templates>\n\nThis does order them, but I could have values like 1,2,3, ... 10, 11, ... 20 and it will ...
I have a project here that connects to an in-production database and grabs tables and views. The code I've inherited connects to a SQL Server database via a SqlConnection, with the user's provided credentials and the database location they provide. When data is required, it uses the connection and a SQL string to creat...
It sounds like you're facing a few interrelated challenges with the current setup of your application, particularly in how data is retrieved and displayed. Let's address a few key points and provide some recommendations to improve performance and flexibility. ### Issues and Solutions 1. **Switching to DataGridView:**...
22,661
[ { "from": "human", "value": "I have a project here that connects to an in-production database and grabs tables and views. The code I've inherited connects to a SQL Server database via a SqlConnection, with the user's provided credentials and the database location they provide. When data is required, it uses...
SVN merging is very time consuming (especially on large code bases) and error prone. Eclipse and Netbeans plugins don't serve me very well. At the moment I'm using a combination of manual "svn merge" and the graphical diff Meld. Are there better alternatives (non-win32)?
If you're looking for alternatives to improve your SVN merging experience in a non-Windows environment, there are several tools and approaches you might consider. Here are some options: 1. **SourceTree**: While primarily a Git client, SourceTree can also handle SVN repositories. It provides a user-friendly interface t...
24,359
[ { "from": "human", "value": "SVN merging is very time consuming (especially on large code bases) and error prone. Eclipse and Netbeans plugins don't serve me very well. At the moment I'm using a combination of manual \"svn merge\" and the graphical diff Meld. Are there better alternatives (non-win32)?\n" ...
Which other restrictions are there on names (beside the obvious uniqueness within a scope)? Where are those defined?
In programming languages and systems, naming conventions and restrictions can vary widely based on the language and context (like databases, file systems, etc.). Here are some common restrictions on names, along with general definitions on where these rules might be found: ### Common Restrictions on Names: 1. **Lengt...
20,910
[ { "from": "human", "value": "Which other restrictions are there on names (beside the obvious uniqueness within a scope)?\nWhere are those defined?\n" }, { "from": "gpt", "value": "In programming languages and systems, naming conventions and restrictions can vary widely based on the language and ...
I'm trying to get a background image of a HTML element (body, div, etc.) to stretch its entire width and height. Not having much luck. Is it even possible or do I have to do it some other way besides it being a background image? My current css is: body { background-position: left top; background-image: url(_ima...
Yes, it's definitely possible to make a background image stretch to cover the entire width and height of an HTML element using CSS. To achieve that, you can use the `background-size` property with the value `cover`. This will scale the background image to cover the entire area of the element, while maintaining its aspe...
24,072
[ { "from": "human", "value": "I'm trying to get a background image of a HTML element (body, div, etc.) to stretch its entire width and height.\nNot having much luck. Is it even possible or do I have to do it some other way besides it being a background image?\nMy current css is:\nbody {\n background-posit...
I have a filter attribute that I'd like to be applied to every action on my controller. Is there a built in mechanism to support this? Right now, I'm manually adding the filter to each action, but that's error prone and tedious. If there isn't support for controller level filter attributes, is there a better way to ...
In ASP.NET Core, you can apply filters at the controller level by decorating the controller class itself with a filter attribute. This allows the filter to be applied to all actions within that controller, which is a much more efficient and less error-prone approach than applying the filter to each action method indivi...
24,810
[ { "from": "human", "value": "I have a filter attribute that I'd like to be applied to every action on my controller. Is there a built in mechanism to support this? Right now, I'm manually adding the filter to each action, but that's error prone and tedious. If there isn't support for controller level fil...
How do you deal with the different XP themes when designing a WinForms UI? Do you avoid hard coded color values or just accept that your UI will not look good on non standard themes? For instance, I have a light blue gradient panel that looks good against the standard control background color but would clash with other...
When designing a WinForms UI, particularly in a context where different Windows XP themes may be applied, it is essential to consider how your application's appearance will adapt to various themes. Here are some best practices to ensure a consistent and visually appealing UI: ### 1. Use System Colors: Instead of hard-...
19,506
[ { "from": "human", "value": "How do you deal with the different XP themes when designing a WinForms UI? Do you avoid hard coded color values or just accept that your UI will not look good on non standard themes?\nFor instance, I have a light blue gradient panel that looks good against the standard control b...
How do you manipulate GUID's when doing Windows programming in C or C++?
In Windows programming, a GUID (Globally Unique Identifier) is often used for identifying interfaces, classes, and objects uniquely. GUIDs are defined in the Windows API, and working with them typically involves creating, manipulating, and using these identifiers in various applications. Here's a concise guide on how ...
14,252
[ { "from": "human", "value": "How do you manipulate GUID's when doing Windows programming in C or C++?\n" }, { "from": "gpt", "value": "In Windows programming, a GUID (Globally Unique Identifier) is often used for identifying interfaces, classes, and objects uniquely. GUIDs are defined in the Win...
I have a query that looks like this: public IList<Post> FetchLatestOrders(int pageIndex, int recordCount) { DatabaseDataContext db = new DatabaseDataContext(); return (from o in db.Orders orderby o.CreatedDate descending select o) .Skip(pageIndex * recordCount) .T...
It looks like you've made a great optimization to your LINQ query by using `DataLoadOptions` to eagerly load the associated `Customer` entity along with the `Orders`. This will indeed reduce the number of SQL queries generated, as it retrieves both orders and their corresponding customers in a single SQL query. Here’s...
18,407
[ { "from": "human", "value": "I have a query that looks like this:\npublic IList<Post> FetchLatestOrders(int pageIndex, int recordCount)\n{\n DatabaseDataContext db = new DatabaseDataContext();\n return (from o in db.Orders\n orderby o.CreatedDate descending\n select o)\n ...
What kind of optimization patterns can be used to improve the performance of the garbage collector? My reason for asking is that I do a lot of embedded software using the Compact Framework. On slow devices the garbage collection can become a problem, and I would like to reduce the times the garbage collector kicks in,...
Improving garbage collector performance is particularly important in environments with constrained resources, such as embedded systems or legacy devices. Your thoughts already touch on several important strategies, and here are some additional optimization patterns you can consider to enhance garbage collection perform...
19,873
[ { "from": "human", "value": "What kind of optimization patterns can be used to improve the performance of the garbage collector? \nMy reason for asking is that I do a lot of embedded software using the Compact Framework. On slow devices the garbage collection can become a problem, and I would like to reduce...
I'm interested in writing software that depends on being able to identify that there is a face in a picture (or video frame). It doesn't have to ID the face - so no metrics other than: Is there a human face in the picture (or more than one) Where, approximately, are the eyes and mouth or nose tip (whatever it keyed o...
You're in luck! There are several open-source libraries and frameworks that can help you detect faces in images or video frames. Here are a few popular options you can consider: ### 1. OpenCV **OpenCV (Open Source Computer Vision Library)** is one of the most widely used libraries for computer vision tasks. It include...
17,566
[ { "from": "human", "value": "I'm interested in writing software that depends on being able to identify that there is a face in a picture (or video frame). It doesn't have to ID the face - so no metrics other than:\n\nIs there a human face in the picture (or more than one)\nWhere, approximately, are the eye...
Is it possible for a generic interface's type to be based on a specific parent class? For example: public interface IGenericFace<T : BaseClass> { } Obviously the above code doesn't work but if it did, what I'm trying to tell the compiler is that T must be a sub-class of BaseClass. Can that be done, are there plans fo...
In C#, you can indeed restrict a generic type parameter to a specific base class by using a generic constraint. However, your syntax is slightly off. Here’s the correct way to declare a generic interface where the type parameter must inherit from a specific base class: ```csharp public class BaseClass { // Base cl...
24,547
[ { "from": "human", "value": "Is it possible for a generic interface's type to be based on a specific parent class?\nFor example:\npublic interface IGenericFace<T : BaseClass>\n{\n}\n\nObviously the above code doesn't work but if it did, what I'm trying to tell the compiler is that T must be a sub-class of B...
Why is the following code "crashing" in PHP? $normal_array = array(); $array_of_arrayrefs = array( &$normal_array ); end( $array_of_arrayrefs )["one"] = 1; // choking on this one The expected result is that the final code line appends $normal_array with key one having value 1 but there is no output what so ever...
The issue you're encountering in your code arises from how you're using the `end()` function along with the array reference and trying to access the array with `["one"]`. Let's break down the code step by step: ```php $normal_array = array(); $array_of_arrayrefs = array( &$normal_array ); end( $array_of_arrayre...
23,026
[ { "from": "human", "value": "Why is the following code \"crashing\" in PHP?\n$normal_array = array();\n$array_of_arrayrefs = array( &$normal_array );\n\nend( $array_of_arrayrefs )[\"one\"] = 1; // choking on this one\n\nThe expected result is that the final code line appends $normal_array with key one...
When I go back to school after Thanksgiving, I'll be taking a course in CS Theory covering topics such as deterministic and nondeterministic finite state machines, turing machines, pushdown automata and a few other things. However, I haven't found a good application that can produce a visual representation of them as w...
If you're looking for tools to visualize and test concepts in computational theory such as finite state machines, Turing machines, and pushdown automata, there are several alternatives to jFlap that you might find helpful: 1. **Automata Tutor**: - This online tool allows you to create and test automata, including f...
21,470
[ { "from": "human", "value": "When I go back to school after Thanksgiving, I'll be taking a course in CS Theory covering topics such as deterministic and nondeterministic finite state machines, turing machines, pushdown automata and a few other things. However, I haven't found a good application that can pro...
I'm looking for some programming guides to C# GUI design. I come from the Java camp (where I can happily hand-code Swing/AWT GUIs) and thus don't have a clue where to start :( Also, what difference (if any) is there between the Windows Presentation Foundation and WinForms?
Welcome to C#! Transitioning from Java to C# GUI design can be quite straightforward, especially with your background in hand-coding GUIs with Swing/AWT. Below are some resources and explanations regarding GUI frameworks in C#. ### C# GUI Design Resources 1. **Microsoft Documentation** - The official [C# documenta...
13,689
[ { "from": "human", "value": "I'm looking for some programming guides to C# GUI design. I come from the Java camp (where I can happily hand-code Swing/AWT GUIs) and thus don't have a clue where to start :(\nAlso, what difference (if any) is there between the Windows Presentation Foundation and WinForms?\n" ...
Are the two events the same or are there differences that we should take note when coding the keyboard presses?
To provide a helpful answer, I would need more context about the two events you are referring to. Are these events related to specific keyboard actions, user inputs, or something else? If you can clarify the types of events you are comparing, I can offer more precise information about whether they are the same or if th...
27,689
[ { "from": "human", "value": "Are the two events the same or are there differences that we should take note when coding the keyboard presses?\n" }, { "from": "gpt", "value": "To provide a helpful answer, I would need more context about the two events you are referring to. Are these events related...
I have an SDI that I'm loading Excel into using OLE. I want to add a toolbar to this that I can use to have a very prominent and evident "import" button (and a few others). The toolbars I add through MFC are all hidden or otherwise removed from the interface when Excel becomes active. Is there a way to keep a toolbar...
To maintain a toolbar in your MFC application while an OLE object (like an embedded Excel sheet) is active, you can take the following approach. MFC by default will not allow toolbars to remain visible when an OLE control takes focus, but you can work around this by manipulating the MFC framework. Here’s a step-by-step...
20,853
[ { "from": "human", "value": "I have an SDI that I'm loading Excel into using OLE. I want to add a toolbar to this that I can use to have a very prominent and evident \"import\" button (and a few others). The toolbars I add through MFC are all hidden or otherwise removed from the interface when Excel become...
I recently asked a question about tracing Linq-to-Entities I think that one of the answers was not right, as they refer to using the DataContext. Is there a DataContext for LINQ-to-Entities? If so, how do I get it?
In LINQ to Entities, the equivalent of the `DataContext` used in LINQ to SQL is the `DbContext`. The `DbContext` class is part of the Entity Framework and is used to manage the interaction between your application and the database, including querying and saving data. ### Creating a DbContext To use a `DbContext`, you...
21,448
[ { "from": "human", "value": "I recently asked a question about tracing Linq-to-Entities\nI think that one of the answers was not right, as they refer to using the DataContext. Is there a DataContext for LINQ-to-Entities? If so, how do I get it?\n" }, { "from": "gpt", "value": "In LINQ to Entitie...
Second Life is fun to play with, and some developers are creating content there, but I was wondering what useful resources (if any) are available in Second Life for professional software developers. Discussion groups Education/training Vendor support Development-related presentations or demos Professional contacts To...
Second Life (SL) can serve as a unique platform for professional software developers to connect, learn, and share knowledge. While it's primarily a virtual world for social interaction and gaming, there are several resources and opportunities available for developers looking to enhance their professional skills. Here a...
22,091
[ { "from": "human", "value": "Second Life is fun to play with, and some developers are creating content there, but I was wondering what useful resources (if any) are available in Second Life for professional software developers.\n\nDiscussion groups\nEducation/training\nVendor support\nDevelopment-related pr...
I have a stored procedure that returns 80 columns, and 300 rows. I want to write a select that gets 2 of those columns. Something like SELECT col1, col2 FROM EXEC MyStoredProc 'param1', 'param2' When I used the above syntax I get the error: "Invalid Column Name". I know the easiest solution would be to change th...
Unfortunately, SQL Server does not allow you to directly select columns from the result set of a stored procedure in the way you are trying to do. However, you can achieve your goal by using a temporary table or table variable to capture the results of the stored procedure, and then select the columns you need from tha...
21,243
[ { "from": "human", "value": "I have a stored procedure that returns 80 columns, and 300 rows. I want to write a select that gets 2 of those columns. Something like \nSELECT col1, col2 FROM EXEC MyStoredProc 'param1', 'param2'\n\nWhen I used the above syntax I get the error: \n\n\"Invalid Column Name\".\n\...
Context: So, I am attempting to build a ridiculously complex domain model. Talking with the users, there are multiple ways the system will be used (For example: one way is from the perspective of the employee; another way is from the perspective of the employer). In actuality, they are multiple applications reusing...
It's a common challenge in domain modeling to account for multiple perspectives, especially in systems that serve different user roles (like employees and employers). Here are some ideas to consider, along with rebuttals to potential concerns: ### Perspectives in Domain Modeling 1. **Multiple Models for Different Per...
21,762
[ { "from": "human", "value": "Context:\n So, I am attempting to build a ridiculously complex domain model. Talking with the users, there are multiple ways the system will be used (For example: one way is from the perspective of the employee; another way is from the perspective of the employer). In actuali...
Currently I'm writing it in clear text oops!, it's an in house program so it's not that bad but I'd like to do it right. How should I go about encrypting this when writing to the registry and how do I decrypt it? OurKey.SetValue("Password", textBoxPassword.Text);
Storing sensitive data like passwords in the Windows Registry should be done with caution, even if it's an in-house program. Using encryption is a good way to secure this information. Below, I'll outline a method to encrypt the password before writing it to the registry and then decrypt it when you need to read it back...
20,555
[ { "from": "human", "value": "Currently I'm writing it in clear text oops!, it's an in house program so it's not that bad but I'd like to do it right. How should I go about encrypting this when writing to the registry and how do I decrypt it?\nOurKey.SetValue(\"Password\", textBoxPassword.Text);\n\n" }, ...
If I have two tables... Category and Pet. Is there a way in LINQ to SQL to make the result of the joined query map to a another strongly typed class (such as: PetWithCategoryName) so that I can strongly pass it to a MVC View? I currently have Category and Pet classes... should I make another one? Maybe I missing somet...
Yes, you can definitely map the result of a joined query to another strongly typed class in LINQ to SQL. This is a common approach in ASP.NET MVC applications when you need to pass a specific model to the view. To achieve this, you should create a new class, for example, `PetWithCategoryName`, that will hold the prope...
21,084
[ { "from": "human", "value": "If I have two tables... Category and Pet. \nIs there a way in LINQ to SQL to make the result of the joined query map to a another strongly typed class (such as: PetWithCategoryName) so that I can strongly pass it to a MVC View?\nI currently have Category and Pet classes... shoul...
Besides the dynamic nature of Python (and the syntax), what are some of the major features of the Python language that Java doesn't have, and vice versa?
Both Python and Java are powerful programming languages with their unique features, strengths, and design philosophies. Below are some of the major features of Python that Java doesn't have, and vice versa: ### Features of Python that Java Doesn't Have 1. **Dynamic Typing**: Python uses dynamic typing, which allows v...
15,931
[ { "from": "human", "value": "Besides the dynamic nature of Python (and the syntax), what are some of the major features of the Python language that Java doesn't have, and vice versa?\n" }, { "from": "gpt", "value": "Both Python and Java are powerful programming languages with their unique featur...
I bumped into a strange situation with MSBuild just now. There's a solution which has three projects: LibX, LibY and Exe. Exe references LibX. LibX in its turn references LibY, has some content files, and also references to a third-party library (several pre-built assemblies installed in both GAC and local lib folder)....
This issue is not uncommon when dealing with MSBuild and project references in Visual Studio, especially with complex dependencies involving multiple projects and third-party libraries. Here's a breakdown of what's likely happening and why you're observing this behavior: ### Understanding the Behavior 1. **Project Re...
19,596
[ { "from": "human", "value": "I bumped into a strange situation with MSBuild just now. There's a solution which has three projects: LibX, LibY and Exe. Exe references LibX. LibX in its turn references LibY, has some content files, and also references to a third-party library (several pre-built assemblies ins...
What's the best way of capturing an mp3 stream coming off of http and saving it to disk with python? Thus far I've tried target = open(target_path, "w") conn = urllib.urlopen(stream_url) while True: target.write(conn.read(buf_size)) This gives me data but its garbled or wont play in mp3 players.
To properly capture and save an MP3 stream from an HTTP source in Python, you should ensure that you are opening the file in binary mode and reading the data in chunks. This is important because MP3 files are binary files, and reading or writing them in text mode can corrupt the data. Here's an example using the `requ...
24,847
[ { "from": "human", "value": "What's the best way of capturing an mp3 stream coming off of http and saving it to disk with python?\nThus far I've tried\ntarget = open(target_path, \"w\")\nconn = urllib.urlopen(stream_url)\nwhile True:\n target.write(conn.read(buf_size))\n\nThis gives me data but its garbl...
I have to write a component that re-creates SQL Server tables (structure and data) in an Oracle database. This component also has to take new data entered into the Oracle database and copy it back into SQL Server. Translating the data types from SQL Server to Oracle is not a problem. However, a critical difference be...
The issue you're facing regarding the treatment of blank strings and NULL values in SQL Server and Oracle is indeed a common challenge when migrating data between these two systems. Unfortunately, there isn’t a configuration option in Oracle that will change this behavior—Oracle will always treat empty strings as NULL....
21,248
[ { "from": "human", "value": "I have to write a component that re-creates SQL Server tables (structure and data) in an Oracle database. This component also has to take new data entered into the Oracle database and copy it back into SQL Server.\nTranslating the data types from SQL Server to Oracle is not a p...
Microsoft SQL Server and MySQL have an INFORMATION_SCHEMA table that I can query. However it does not exist in an MS Access database. Is there an equivalent I can use?
In Microsoft Access, there isn't an `INFORMATION_SCHEMA` like there is in SQL Server or MySQL, but you can retrieve metadata about database objects through the Access object model or by querying system tables. ### Accessing Metadata in MS Access 1. **Using the Access Object Model**: You can use VBA to access metadata...
23,910
[ { "from": "human", "value": "Microsoft SQL Server and MySQL have an INFORMATION_SCHEMA table that I can query. However it does not exist in an MS Access database.\nIs there an equivalent I can use?\n" }, { "from": "gpt", "value": "In Microsoft Access, there isn't an `INFORMATION_SCHEMA` like the...
I used to be able to do the following in Preview 3 <%=Html.BuildUrlFromExpression<AController>(c => c.AnAction(par1, par2)%> How am I supposed to create urls in a strongly typed way with the MVC Beta? The only thing so far I have found is <%= Html.ActionLink("aName", "ActionName", "ControllerName")%> This is not str...
In ASP.NET MVC, while you can use `Html.ActionLink` for generating URLs, it is not strongly typed and can lead to potential issues when you refactor your code (like renaming actions or controllers). Fortunately, there is a way to achieve strongly typed URLs using `Expression` trees. As of the MVC 5 and onwards, the co...
24,668
[ { "from": "human", "value": "I used to be able to do the following in Preview 3\n<%=Html.BuildUrlFromExpression<AController>(c => c.AnAction(par1, par2)%>\n\nHow am I supposed to create urls in a strongly typed way with the MVC Beta?\nThe only thing so far I have found is \n<%= Html.ActionLink(\"aName\", \"...