qid
int64
1
82.4k
question
stringlengths
27
22.5k
answers
stringlengths
509
252k
date
stringlengths
10
10
metadata
stringlengths
108
162
82,323
<p>I have a 3 column grid in a window with a GridSplitter on the first column. I want to set the MaxWidth of the first column to a third of the parent Window or Page <code>Width</code> (or <code>ActualWidth</code>) and I would prefer to do this in XAML if possible.</p> <p>This is some sample XAML to play with in XamlPad (or similar) which shows what I'm doing. </p> <pre><code>&lt;Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" &gt; &lt;Grid&gt; &lt;Grid.ColumnDefinitions&gt; &lt;ColumnDefinition x:Name="Column1" Width="200"/&gt; &lt;ColumnDefinition x:Name="Column2" MinWidth="50" /&gt; &lt;ColumnDefinition x:Name="Column3" Width="{ Binding ElementName=Column1, Path=Width }"/&gt; &lt;/Grid.ColumnDefinitions&gt; &lt;Label Grid.Column="0" Background="Green" /&gt; &lt;GridSplitter Grid.Column="0" Width="5" /&gt; &lt;Label Grid.Column="1" Background="Yellow" /&gt; &lt;Label Grid.Column="2" Background="Red" /&gt; &lt;/Grid&gt; &lt;/Page&gt; </code></pre> <p>As you can see, the right column width is bound to the width of the first column, so when you slide the left column using the splitter, the right column does the same :) If you slide the left column to the right, eventually it will slide over half the page/window and over to the right side of the window, pushing away column 2 and 3. </p> <p>I want to prevent this by setting the MaxWidth of column 1 to a third of the window width (or something like that). I can do this in code behind quite easily, but how to do it in "XAML Only"?</p> <p><strong><em>EDIT:</strong> David Schmitt suggested to use SharedSizeGroup instead of binding, which is an excellent suggestion. My sample code would look like this then:</em></p> <pre><code>&lt;Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" &gt; &lt;Grid IsSharedSizeScope="True"&gt; &lt;Grid.ColumnDefinitions&gt; &lt;ColumnDefinition x:Name="Column1" SharedSizeGroup="ColWidth" Width="40"/&gt; &lt;ColumnDefinition x:Name="Column2" MinWidth="50" Width="*" /&gt; &lt;ColumnDefinition x:Name="Column3" SharedSizeGroup="ColWidth"/&gt; &lt;/Grid.ColumnDefinitions&gt; &lt;Label Grid.Column="0" Background="Green" /&gt; &lt;GridSplitter Grid.Column="0" Width="5" /&gt; &lt;Label Grid.Column="1" Background="Yellow" /&gt; &lt;Label Grid.Column="2" Background="Red" /&gt; &lt;/Grid&gt; &lt;/Page&gt; </code></pre>
[{'answer_id': 85173, 'author': 'Thomas', 'author_id': 9970, 'author_profile': 'https://Stackoverflow.com/users/9970', 'pm_score': 0, 'selected': False, 'text': '<p>Too lazy to actually write it up myself, but you should be able to use a mathematical converter and bind to your parent windows width (either by name, or with a RelativeSource ancestor search). </p>\n\n<pre><code>//I know I borrowed this from someone, sorry I forgot to add a comment from whom\npublic class ScaledValueConverter : IValueConverter\n{\n public Object Convert(Object value, Type targetType, Object parameter, System.Globalization.CultureInfo culture)\n {\n Double scalingFactor = 0;\n if (parameter != null)\n {\n Double.TryParse((String)(parameter), out scalingFactor);\n }\n\n if (scalingFactor == 0.0d)\n {\n return Double.NaN;\n }\n\n return (Double)value * scalingFactor;\n }\n\n public Object ConvertBack(Object value, Type targetType, Object parameter, System.Globalization.CultureInfo culture)\n {\n throw new Exception("The method or operation is not implemented.");\n }\n}\n</code></pre>\n'}, {'answer_id': 157780, 'author': 'Christopher Bennage', 'author_id': 6855, 'author_profile': 'https://Stackoverflow.com/users/6855', 'pm_score': 4, 'selected': True, 'text': '<p>I think the XAML-only approach is somewhat circuitous, but here is a way to do it.</p>\n\n<pre><code>&lt;Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" \n xmlns:sys="clr-namespace:System;assembly=mscorlib"\n xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" &gt;\n\n &lt;!-- This contains our real grid, and a reference grid for binding the layout--&gt;\n &lt;Grid x:Name="Container"&gt;\n\n &lt;!-- hidden because it\'s behind the grid below --&gt;\n &lt;Grid x:Name="LayoutReference"&gt;\n &lt;Grid.ColumnDefinitions&gt;\n &lt;ColumnDefinition Width="*"/&gt;\n &lt;ColumnDefinition Width="*"/&gt;\n &lt;ColumnDefinition Width="*"/&gt;\n &lt;/Grid.ColumnDefinitions&gt;\n &lt;!-- We need the border, because the column doesn\'t have an ActualWidth --&gt;\n &lt;Border x:Name="ReferenceBorder" \n Background="Black" /&gt;\n &lt;Border Background="White" Grid.Column="1" /&gt;\n &lt;Border Background="Black" Grid.Column="2" /&gt;\n &lt;/Grid&gt;\n\n &lt;!-- I made this transparent, so we can see the reference --&gt;\n &lt;Grid Opacity="0.9"&gt;\n &lt;Grid.ColumnDefinitions&gt;\n &lt;ColumnDefinition x:Name="Column1" \n MaxWidth="{Binding ElementName=ReferenceBorder,Path=ActualWidth}"/&gt;\n &lt;ColumnDefinition x:Name="Column2" \n MinWidth="50" /&gt;\n &lt;ColumnDefinition x:Name="Column3" \n Width="{ Binding ElementName=Column1, Path=Width }"/&gt;\n &lt;/Grid.ColumnDefinitions&gt;\n\n &lt;Label Grid.Column="0" Background="Green"/&gt;\n &lt;GridSplitter Grid.Column="0" Width="5" /&gt;\n &lt;Label Grid.Column="1" Background="Yellow" /&gt;\n &lt;Label Grid.Column="2" Background="Red" /&gt;\n &lt;/Grid&gt;\n &lt;/Grid&gt;\n\n&lt;/Page&gt;\n</code></pre>\n'}]
2008/09/17
['https://Stackoverflow.com/questions/82323', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/6415/']
82,332
<p>I am using C# to process a message in my Outlook inbox that contains attachments. One of the attachments is of type olEmbeddeditem. I need to be able to process the contents of that attachment. From what I can tell I need to save the attachment to disk and use CreateItemFromTemplate which would return an object. </p> <p>The issue I have is that an olEmbeddeditem can be any of the Outlook object types MailItem, ContactItem, MeetingItem, etc. How do you know which object type a particular olEmbeddeditem attachment is going to be so that you know the object that will be returned by CreateItemFromTemplate?</p> <p>Alternatively, if there is a better way to get olEmbeddeditem attachment contents into an object for processing I'd be open to that too.</p>
[{'answer_id': 96403, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 1, 'selected': False, 'text': '<p>I found the following code on Google Groups for determining the type of an Outlook object:</p>\n\n<pre><code>Type t = SomeOutlookObject.GetType();\nstring messageClass = t.InvokeMember("MessageClass",\n BindingFlags.Public | \n BindingFlags.GetField | \n BindingFlags.GetProperty,\n null,\n SomeOutlookObject,\n new object[]{}).ToString();\nConsole.WriteLine("\\tType: " + messageClass);\n</code></pre>\n\n<p>I don\'t know if that helps with an olEmbedded item, but it seems to identify regular messages, calendar items, etc.</p>\n'}, {'answer_id': 13089961, 'author': 'Duane Wright', 'author_id': 1759318, 'author_profile': 'https://Stackoverflow.com/users/1759318', 'pm_score': 0, 'selected': False, 'text': '<p>Working with email attachments that are also emails which in turn contains user defined properties that I want to access, then I perform the following steps:</p>\n\n<pre><code>Outlook.Application mailApplication = new Outlook.Application();\nOutlook.NameSpace mailNameSpace = mailApplication.GetNamespace(“mapi”);\n// make sure it is an embedded item\nIf(myAttachment.Type == Outlook.OlAttachmentType.olEmbeddeditem)\n{\n myAttachment.Type.SaveAsFile(“temp.msg”);\n Outlook.MailItem attachedEmail = (Outlook.MailItem)mailNameSpace.OpenSharedItem(“temp.msg”);\n String customProperty = attachedEmail.PropertyAccessor.GetProperty(\n “http://schemas.microsoft.com/mapi/string/{00020329-0000-0000-c000-000000000046}/myProp\n}\n</code></pre>\n\n<p>If you open the MailItem using, then I will not have access to the properties as mentioned above:</p>\n\n<pre><code>Outlook.MailItem attachedEmail = (Outlook.MailItem)mailApplication.CreateFromTemplate(“temp.msg”); \n</code></pre>\n'}]
2008/09/17
['https://Stackoverflow.com/questions/82332', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/8391/']
82,340
<p>Tomcat (version 5 here) stores session information in memory. When clustering this information is periodically broadcast to other servers in the cluster to keep things in sync. You can use a database store to make sessions persistant but this information is only written periodically as well and is only really used for failure-recovery rather than actually replacing the in-memory sessions.</p> <p>If you don't want to use sticky sessions (our configuration doesn't allow it unfortunately) this raises the problem of the sessions getting out of sync.</p> <p>In other languages, web frameworks tend to allow you to use a database as the primary session store. Whilst this introduces a potential scaling issue it does make session management very straightforward. I'm wondering if there's a way to get tomcat to use a database for sessions in this way (technically this would also remove the need for any clustering configuration in the tomcat server.xml).</p>
[{'answer_id': 82384, 'author': 'Joe Skora', 'author_id': 14057, 'author_profile': 'https://Stackoverflow.com/users/14057', 'pm_score': 2, 'selected': False, 'text': '<p>Take a look at <a href="http://www.terracotta.org/" rel="nofollow noreferrer">Terracotta</a>, I think it can address your scaling issues without a major application redesign.</p>\n'}, {'answer_id': 82392, 'author': 'Olaf Kock', 'author_id': 13447, 'author_profile': 'https://Stackoverflow.com/users/13447', 'pm_score': 3, 'selected': True, 'text': '<p>There definitely is a way. Though I\'d strongly vote for sticky sessions - saves so much load for your servers/database (unless something fails)...</p>\n\n<p><a href="http://tomcat.apache.org/tomcat-5.5-doc/config/manager.html" rel="nofollow noreferrer">http://tomcat.apache.org/tomcat-5.5-doc/config/manager.html</a> has information about SessionManager configuration and setup for Tomcat. Depending on your exact requirements you might have to implement your own session manager, but this starting point should provide some help.</p>\n'}, {'answer_id': 3358787, 'author': 'Chris', 'author_id': 59198, 'author_profile': 'https://Stackoverflow.com/users/59198', 'pm_score': 2, 'selected': False, 'text': "<p>I've always been a fan of the Rails sessions technique: store the sessions (zipped+encrypted+signed) in the user's cookie. That way you can do load balancing to your hearts content, and not have to worry about sticky sessions, or hitting the database for your session data, etc. I'm just not sure you could implement that easily in a java app without some sort of rewriting of your session-access code. Anyway just a thought.</p>\n"}, {'answer_id': 5632298, 'author': 'MartinGrotzke', 'author_id': 130167, 'author_profile': 'https://Stackoverflow.com/users/130167', 'pm_score': 2, 'selected': False, 'text': '<p>Another alternative would be the <a href="http://code.google.com/p/memcached-session-manager/" rel="nofollow">memcached-session-manager</a>, a memcached based session failover and session replication solution for tomcat 6.x / 7.x. It supports both sticky sessions and non-sticky sessions.</p>\n\n<p>I created this project to get the best of performance and reliability and to be able to scale out by just adding more tomcat and memcached nodes.</p>\n'}]
2008/09/17
['https://Stackoverflow.com/questions/82340', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/15687/']
82,345
<p>What are the various charting tools that are available for displaying charts on a web page using ASP.NET?</p> <p>I know about commercial tools such as Dundas and Infragistics.</p> <p>I could have "googled" this but I want to know the various tools that SO participants have used? Any free charting tools that are available are also welcome to be mentioned. </p>
[{'answer_id': 82351, 'author': 'itsmatt', 'author_id': 7862, 'author_profile': 'https://Stackoverflow.com/users/7862', 'pm_score': 1, 'selected': False, 'text': "<p>Hey - don't know if this works for ASP.NET but I've used the ZedGraph tool for my winforms apps and it is really nice.</p>\n"}, {'answer_id': 82358, 'author': 'Catch22', 'author_id': 15428, 'author_profile': 'https://Stackoverflow.com/users/15428', 'pm_score': 0, 'selected': False, 'text': "<p>If you use SQL Server, then SQL Server reporting services is not bad. It includes a free version of Dundas chart controls which allows you to do basic charting. There are are couple of issues with presentation and making it Firefox friendly but it's a pretty simple solution. - If you've SQL Server of course!</p>\n"}, {'answer_id': 82363, 'author': 'Mike Becatti', 'author_id': 6617, 'author_profile': 'https://Stackoverflow.com/users/6617', 'pm_score': 0, 'selected': False, 'text': '<p>We have used <a href="http://demos.telerik.com/aspnet/prometheus/Chart/Examples/Overview/DefaultCS.aspx" rel="nofollow noreferrer">Telerik\'s RadChart</a> and MSSQL Reporting Services. </p>\n'}, {'answer_id': 82366, 'author': 'RB.', 'author_id': 15393, 'author_profile': 'https://Stackoverflow.com/users/15393', 'pm_score': 1, 'selected': False, 'text': '<p>ZedGraph works superbly in ASP .NET, and is a superb charting package. Really flexible, and makes attractive graphs. The graphs are generated as static images (PNG by default) and it automatically deletes old ones.</p>\n\n<p>Also, it is widely supported, has a great wiki, and a decent code-project tutorial (<a href="http://www.codeproject.com/KB/graphics/zedgraph.aspx" rel="nofollow noreferrer">http://www.codeproject.com/KB/graphics/zedgraph.aspx</a>).</p>\n'}, {'answer_id': 82367, 'author': 'Paul van Brenk', 'author_id': 1837197, 'author_profile': 'https://Stackoverflow.com/users/1837197', 'pm_score': 2, 'selected': False, 'text': '<p>I like <a href="http://code.google.com/apis/chart/" rel="nofollow noreferrer">google charts</a>, but check the license before using.</p>\n'}, {'answer_id': 82386, 'author': 'Ben', 'author_id': 11522, 'author_profile': 'https://Stackoverflow.com/users/11522', 'pm_score': 1, 'selected': False, 'text': '<p>I used <a href="http://www.advsofteng.com/" rel="nofollow noreferrer">Chart Director</a> for a medium sized project, and loved it. It\'s incredibly feature-rich, has pretty good documentation, and an amazingly good support forum -- it\'s one of those ones where you ask a question, and a guy who works for the company that produces the software almost invariably answers it within a few hours. I used it with PHP and MySQL, but as far as I know it works with ASP.NET as well.</p>\n'}, {'answer_id': 82387, 'author': 'kaybenleroll', 'author_id': 277, 'author_profile': 'https://Stackoverflow.com/users/277', 'pm_score': 2, 'selected': False, 'text': '<p>If you do not mind using Flash to display your graphs, <a href="http://teethgrinder.co.uk/open-flash-chart/" rel="nofollow noreferrer">Open Flash Charts</a> supports a lot of languages. This was also the choice used for the Stackoverflow reputation tracker piece as <a href="https://stackoverflow.com/questions/6936/using-what-ive-learned-from-stackoverflow-html-scraper">mentioned in this question</a></p>\n'}, {'answer_id': 82443, 'author': 'Rob Wells', 'author_id': 2974, 'author_profile': 'https://Stackoverflow.com/users/2974', 'pm_score': 1, 'selected': False, 'text': '<p>You might like to take a look at the new <a href="http://code.google.com/apis/visualization/" rel="nofollow noreferrer">Google Visualization API</a>. Saw a presentation on this at yesterday\'s Google Dev. Day in London and it looked very interesting.</p>\n\n<p>While it is currently only able to work with data retrieved from Google Spreadsheets, expanding it to handle data retrieval from other sources is a high priority for the Viz. team.</p>\n\n<p>HTH.</p>\n\n<p>cheers,</p>\n\n<p>Rob</p>\n'}, {'answer_id': 82474, 'author': 'Jon Cage', 'author_id': 15369, 'author_profile': 'https://Stackoverflow.com/users/15369', 'pm_score': 1, 'selected': False, 'text': '<p>What about using <a href="http://solutoire.com/flotr/" rel="nofollow noreferrer">Flotr</a>? The syntax is pretty clean and you can produce some pretty nifty graphs (Check out <a href="http://solutoire.com/flotr/docs/" rel="nofollow noreferrer">some examples</a>) with minimal effort.</p>\n'}, {'answer_id': 85673, 'author': 'JasonS', 'author_id': 1865, 'author_profile': 'https://Stackoverflow.com/users/1865', 'pm_score': 0, 'selected': False, 'text': "<p>I would look no farther than Dundas if you have the cha-ching to pay for it. I've used it on several projects and not found a better option. Cheaper with better licensing, yes, but not better in terms of functionality.</p>\n"}, {'answer_id': 222846, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 0, 'selected': False, 'text': '<p>For free flash charting, you may look at <a href="http://www.fusioncharts.com/free" rel="nofollow noreferrer">FusionCharts Free</a>. Or, if you want more professional and are ready to shell out $$$, look at <a href="http://www.fusioncharts.com" rel="nofollow noreferrer">FusionCharts v3</a></p>\n'}, {'answer_id': 4370772, 'author': 'Win32', 'author_id': 532842, 'author_profile': 'https://Stackoverflow.com/users/532842', 'pm_score': 1, 'selected': False, 'text': '<p>If you need to build charts FAST then have a look at this rocket:</p>\n\n<p>dsec.com/csp_charts.png</p>\n\n<p>You can call the chart server from your ASP.Net scripts.</p>\n'}]
2008/09/17
['https://Stackoverflow.com/questions/82345', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4021/']
82,349
<p>It seems like the methods of Ruby's Net::HTTP are all or nothing when it comes to reading the body of a web page. How can I read, say, the just the first 100 bytes of the body? </p> <p>I am trying to read from a content server that returns a short error message in the body of the response if the file requested isn't available. I need to read enough of the body to determine whether the file is there. The files are huge, so I don't want to get the whole body just to check if the file is available.</p>
[{'answer_id': 82564, 'author': 'user9385', 'author_id': 9385, 'author_profile': 'https://Stackoverflow.com/users/9385', 'pm_score': -1, 'selected': False, 'text': "<p>You can't. But why do you need to? Surely if the page just says that the file isn't available then it won't be a huge page (i.e. by definition, the file won't be there)?</p>\n"}, {'answer_id': 82579, 'author': 'Jean', 'author_id': 7898, 'author_profile': 'https://Stackoverflow.com/users/7898', 'pm_score': 2, 'selected': False, 'text': "<p>Are you sure the content server only returns a short error page?</p>\n\n<p>Doesn't it also set the <code>HTTPResponse</code> to something appropriate like 404. In which case you can trap the <code>HTTPClientError</code> derived exception (most likely <code>HTTPNotFound</code>) which is raised when accessing <code>Net::HTTP.value()</code>. </p>\n\n<p>If you get an error then your file wasn't there if you get 200 the file is starting to download and you can close the connection.</p>\n"}, {'answer_id': 82663, 'author': 'Nathan de Vries', 'author_id': 11109, 'author_profile': 'https://Stackoverflow.com/users/11109', 'pm_score': 2, 'selected': False, 'text': "<p>To read the body of an HTTP request in chunks, you'll need to use <code>Net::HTTPResponse#read_body</code> like this:</p>\n\n<pre><code>http.request_get('/large_resource') do |response|\n response.read_body do |segment|\n print segment\n end\nend\n</code></pre>\n"}, {'answer_id': 82711, 'author': 'Ian Dickinson', 'author_id': 6716, 'author_profile': 'https://Stackoverflow.com/users/6716', 'pm_score': 4, 'selected': False, 'text': '<p>Shouldn\'t you just use an HTTP <code>HEAD</code> request (Ruby <code>Net::HTTP::Head</code> method) to see if the resource is there, and only proceed if you get a 2xx or 3xx response? This presumes your server is configured to return a 4xx error code if the document is not available. I would argue this was the correct solution. </p>\n\n<p>An alternative is to request the HTTP head and look at the <code>content-length</code> header value in the result: if your server is correctly configured, you should easily be able to tell the difference in length between a short message and a long document. Another alternative: set the <code>content-range</code> header field in the request (which again assumes that the server is behaving correctly WRT the HTTP spec).</p>\n\n<p>I don\'t think that solving the problem in the client <em>after</em> you\'ve sent the GET request is the way to go: by that time, the network has done the heavy lifting, and you won\'t really save any wasted resources.</p>\n\n<p>Reference: <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html" rel="nofollow noreferrer" title="http method headers">http header definitions</a></p>\n'}, {'answer_id': 84008, 'author': 'Roman', 'author_id': 12695, 'author_profile': 'https://Stackoverflow.com/users/12695', 'pm_score': 2, 'selected': False, 'text': '<p>I wanted to do this once, and the only thing that I could think of is monkey patching the <code>Net::HTTP#read_body</code> and <code>Net::HTTP#read_body_0</code> methods to accept a length parameter, and then in the former just pass the length parameter to the <code>read_body_0</code> method, where you can read only as much as length bytes.</p>\n'}, {'answer_id': 8597488, 'author': 'Dustin Frazier', 'author_id': 1072414, 'author_profile': 'https://Stackoverflow.com/users/1072414', 'pm_score': 4, 'selected': False, 'text': '<p>This is an old thread, but the question of how to read only a portion of a file via HTTP in Ruby is still a mostly unanswered one according to my research. Here\'s a solution I came up with by monkey-patching Net::HTTP a bit:</p>\n\n<pre><code>require \'net/http\'\n\n# provide access to the actual socket\nclass Net::HTTPResponse\n attr_reader :socket\nend\n\nuri = URI("http://www.example.com/path/to/file")\nbegin\n Net::HTTP.start(uri.host, uri.port) do |http|\n request = Net::HTTP::Get.new(uri.request_uri)\n # calling request with a block prevents body from being read\n http.request(request) do |response|\n # do whatever limited reading you want to do with the socket\n x = response.socket.read(100);\n # be sure to call finish before exiting the block\n http.finish\n end\n end\nrescue IOError\n # ignore\nend\n</code></pre>\n\n<p>The rescue catches the IOError that\'s thrown when you call HTTP.finish prematurely.</p>\n\n<p>FYI, the socket within the <code>HTTPResponse</code> object isn\'t a true <code>IO</code> object (it\'s an internal class called <code>BufferedIO</code>), but it\'s pretty easy to monkey-patch that, too, to mimic the <code>IO</code> methods you need. For example, another library I was using (exifr) needed the <code>readchar</code> method, which was easy to add:</p>\n\n<pre><code>class Net::BufferedIO\n def readchar\n read(1)[0].ord\n end\nend\n</code></pre>\n'}]
2008/09/17
['https://Stackoverflow.com/questions/82349', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3298/']
82,350
<p>I am using VirtualPc 2007 more and more, the one annoyance is "Alt-Tab".</p> <p>What I want is to be able to use alt-tab to iterate through all of the applications in the host pc and virtual(s) as if they were one long list. Is there a setting or program to do this?</p>
[{'answer_id': 82395, 'author': 'Rick Kierner', 'author_id': 11771, 'author_profile': 'https://Stackoverflow.com/users/11771', 'pm_score': 4, 'selected': True, 'text': '<p>No. If the VPC is in full screen mode, alt+tab works only within the context of the VPC. If the VPC Screen is not focused, you will get the collection of applications that are in the Host (including the instance of VPC)</p>\n'}, {'answer_id': 82426, 'author': 'JosephStyons', 'author_id': 672, 'author_profile': 'https://Stackoverflow.com/users/672', 'pm_score': 1, 'selected': False, 'text': '<p>Sadly, no. This is possible in Parallels on the Mac, in what they call "Coherence" mode. But Virtual PC does not support that kind of integration.</p>\n'}, {'answer_id': 389097, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 1, 'selected': False, 'text': '<p>No. If the VPC is in full screen mode, alt+tab works only within the context of the VPC. However, you may find the "Host key+DOWN ARROW" shortcut useful. This minimizes the virtual machine and allows you to alt-tab on the host again.</p>\n'}]
2008/09/17
['https://Stackoverflow.com/questions/82350', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5189/']
82,359
<p>I've just inherited some old Struts code.</p> <p>If Struts (1.3) follows the MVC pattern, how do the Action classes fill the View with variables to render in HTML ?</p> <p>So far, I've seen the Action classes push variables in <code>(1)</code> the HTTP request with</p> <pre><code>request.setAttribute("name", user.getName()) </code></pre> <p><code>(2)</code> in ActionForm classes, using methods specific to the application:</p> <pre><code>UserForm form = (UserForm) actionForm; form.setUserName(user.getName()); </code></pre> <p>and <code>(3)</code> a requestScope variable, that I see in the JSP layer (the view uses JSP), but I can't see in the Action classes.</p> <pre><code>&lt;p style='color: red'&gt;&lt;c:out value='${requestScope.userName}' /&gt;&lt;/p&gt; </code></pre> <p>So, which of these is considered old-school, and what's the recommended way of pushing variables in the View in Struts ?</p>
[{'answer_id': 82512, 'author': 'Arno', 'author_id': 13685, 'author_profile': 'https://Stackoverflow.com/users/13685', 'pm_score': 1, 'selected': False, 'text': '<p>My Struts days are long over, but as far as I remember we used to place one view-specific bean (which would work as a holder for fine-graner beans or collections of beans) into the request scope within our Action.perform() implementation. This view-specific bean would then be rendered by the view.</p>\n'}, {'answer_id': 82517, 'author': 'Olaf Kock', 'author_id': 13447, 'author_profile': 'https://Stackoverflow.com/users/13447', 'pm_score': 1, 'selected': True, 'text': "<p>As <code>Struts 1.3</code> is considered old-school, I'd recommend to go with the flow and use the style that already is used throughout the application you inherited.</p>\n\n<p>If all different styles are already used, pick the most used one. After that, pick your personal favourite. Mine would be 1 or 3 - the form (2) is usually best suited for data that will eventually be rendered inside some form controls. If this is the case - use the form, otherwise - don't.</p>\n"}]
2008/09/17
['https://Stackoverflow.com/questions/82359', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/15649/']