qid
int64
4
19.1M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
385,714
<p>When I am trying to cast <code>Object obj</code> to Type <code>T</code>, if it can not be cast then there is something wrong.</p> <p>And after I cast the object I will be looking for working with the cast object.</p> <p>Rather I will be expecting to get an exception at the place where I will be casting it than say where I will be using that object.</p> <p>In this sense, is it better to use <code>DirectCast</code> instead of <code>TryCast</code>? Or am I missing some other significance of using <code>TryCast</code>?</p>
[ { "answer_id": 385727, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 6, "selected": true, "text": "TryCast DirectCast TryCast T DirectCast TryCast OfType TryCast" }, { "answer_id": 385729, "author": "Jon Limj...
2008/12/22
[ "https://Stackoverflow.com/questions/385714", "https://Stackoverflow.com", "https://Stackoverflow.com/users/41968/" ]
385,730
<p>I have a number of projects in a solution file that have unit tests written for them and I want to set them up to be run by our continuous integration server. However, because many of the tests have been written poorly and have not been run regularly, there are many that are failing.</p> <p>I don't have the time at the moment to fix all of the tests, but I do believe there is value in having the existing tests run. What is the best way do deal with the failing unit tests?</p> <p>What I am currently doing is marking each failing test as Explicit and leaving a TODO comment.</p> <pre><code>[Test, Explicit] //TODO: Rewrite this test because it fails </code></pre> <p>Is there a better way of doing this? Or should I fix all the tests before including them in the tests that are run by the CIS?</p>
[ { "answer_id": 385734, "author": "Jon Limjap", "author_id": 372, "author_profile": "https://Stackoverflow.com/users/372", "pm_score": 4, "selected": true, "text": "[Test, Ignore(\"Test needs rewrite\")]\n" }, { "answer_id": 385758, "author": "krosenvold", "author_id": 236...
2008/12/22
[ "https://Stackoverflow.com/questions/385730", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39532/" ]
385,784
<p>In Silverlight 2 I'm using a usercontrol which inherits the datacontext of the page that it's embedded on. This datacontext contains question text, a question type and a collection of answers. In the user control is a listbox which is bound to the collection of answers. As shown below:</p> <pre><code>&lt;ListBox DataContext="{Binding}" x:Name="AnswerListBox" ItemContainerStyle="{StaticResource QuestionStyle}" Grid.Row="1" Width="Auto" Grid.Column="2" ItemsSource="{Binding Path=AnswerList}" BorderBrush="{x:Null}" /&gt; </code></pre> <p>This listbox has an associated style to display the answers in the form of radio buttons or checkboxes (which I would like to hide or show depending on the question type) as:</p> <pre><code>&lt;Style TargetType="ListBoxItem" x:Key="QuestionStyle"&gt; &lt;Setter Property="Template"&gt; &lt;Setter.Value&gt; &lt;ControlTemplate TargetType="ListBoxItem"&gt; &lt;StackPanel Background="Transparent" &gt; &lt;RadioButton Visibility="{Binding Path=QuestionType, Converter={StaticResource QuestionTypeConverter}, ConverterParameter='RadioButtonStyle'}" Height="auto" Margin="0,0,0,10" IsChecked="{TemplateBinding IsSelected}" IsHitTestVisible="False" Content="{Binding Path=AnswerText}"&gt; &lt;/RadioButton&gt; &lt;CheckBox Visibility="{Binding Path=QuestionType, Converter={StaticResource QuestionTypeConverter}, ConverterParameter='CheckBoxStyle'}" Height="auto" Margin="0,0,0,10" Content="{Binding Path=AnswerText}"&gt; &lt;/CheckBox&gt; &lt;/StackPanel&gt; &lt;/ControlTemplate&gt; &lt;/Setter.Value&gt; &lt;/Setter&gt; &lt;/Style&gt; </code></pre> <p>So my question is then: how do you access the parent data context in order to get the QuestionType (as this is a property on the user control datacontext itself, not a property on an AnswerItem in the AnswerList)?</p> <p>Alternatively is there a better way to switch styles dynamically in the xaml based on a binding value?</p>
[ { "answer_id": 509947, "author": "geofftnz", "author_id": 20122, "author_profile": "https://Stackoverflow.com/users/20122", "pm_score": 1, "selected": false, "text": "class ViewModel{\n ObservableCollection<ComboboxListItemType> DataForTheComboBoxList;\n ObservableCollection<MyData...
2008/12/22
[ "https://Stackoverflow.com/questions/385784", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36086/" ]
385,793
<p>What's the best way to programmatically start an application on login for Windows? I know you can do it by adding an item to the startup folder in the start menu, but I want to have an option in my application to turn it off and on.</p>
[ { "answer_id": 385797, "author": "kgiannakakis", "author_id": 24054, "author_profile": "https://Stackoverflow.com/users/24054", "pm_score": 4, "selected": true, "text": "Registry.SetValue(@\"HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run\",\n \"MyStartUp\"...
2008/12/22
[ "https://Stackoverflow.com/questions/385793", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23339/" ]
385,796
<p>The regular code snippet of syncing data with sync framework is this:</p> <pre><code>LocalDBSyncAgent syncAgent = new LocalDBSyncAgent(); Microsoft.Synchronization.Data.SyncStatistics syncStats = syncAgent.Synchronize(); </code></pre> <p>Do anynody knows a way to sync a subset of my tables. Note not the data inside each table but the decide which tables would be involved in the synchronization.</p> <p>Thanks Ariel</p>
[ { "answer_id": 386511, "author": "Bramha Ghosh", "author_id": 3268, "author_profile": "https://Stackoverflow.com/users/3268", "pm_score": 3, "selected": true, "text": "public class SampleSyncAgent : Microsoft.Synchronization.SyncAgent\n {\n\n public SampleSyncAgent()\n {\n\n ...
2008/12/22
[ "https://Stackoverflow.com/questions/385796", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11659/" ]
385,809
<p>I have a MS SQL table that I don't have any control over and I need to write to. This table has a int primary key that isn't automatically incremented. I can't use stored procs and I would like to use Linq to SQL since it makes other processing very easy.</p> <p>My current solution is to read the last value, increment it, try to use it, if I get a clash, increment it again and retry. </p> <p>Something along these lines:</p> <pre><code>var newEntity = new Log() { ID = dc.Logs.Max(l =&gt; l.ID) + 1, Note = "Test" }; dc.Logs.InsertOnSubmit(newEntity); const int maxRetries = 10; int retries = 0; bool success = false; while (!success &amp;&amp; retries &lt; maxRetries) { try { dc.SubmitChanges(); success = true; } catch (SqlException) { retries++; newEntity.ID = dc.Logs.Max(l =&gt; l.ID); } } if (retries &gt;= maxRetries) { throw new Exception("Bummer..."); } </code></pre> <p>Does anyone have a better solution?</p> <p>EDIT: Thanks to <a href="https://stackoverflow.com/questions/385809/correctly-incrementing-values-using-linq-to-sql#385814">Jon</a>, I simplified the max ID calculation. I was still in SQL thinking mode.</p>
[ { "answer_id": 385814, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 3, "selected": true, "text": "var maxId = dc.Logs.Max(s => s.ID);\n" }, { "answer_id": 385848, "author": "alextansc", "author_id": 1958...
2008/12/22
[ "https://Stackoverflow.com/questions/385809", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11063/" ]
385,824
<p>Of all these methods what's being run and in what order?? I guess the first question to ask is whats being run first?</p> <p><strong>And why does th.start() start run()?</strong></p> <pre><code>import java.applet.*; import java.awt.*; import javax.swing.JFrame; public class BallApplet extends Applet implements Runnable { int x_pos = 10; int y_pos = 100; int radius = 20; private Image dbImage; private Graphics dbG; public void init() { // setBackground(Color.BLUE); } public void start() { Thread th = new Thread (this); th.start(); } public void stop() {} public void destroy() {} public void run() { // 20 second delay per frame refresh (animation doesn't // need to be perfectly continuous) Thread.currentThread().setPriority(Thread.MIN_PRIORITY); while (true) { x_pos++; repaint(); try { Thread.sleep(20); } catch (InterruptedException ex) { System.out.println("Caught!"); } Thread.currentThread().setPriority(Thread.MAX_PRIORITY); } } public void update(Graphics g) { // implements double buffering // drawing on doublebufferImage, note the dbG=dbImage.getGraphics(), so everything dbG.whatever() is // drawing on the Image's graphics which is later drawn with g.drawImage() // initialize buffer if (dbImage == null) { dbImage = createImage (this.getSize().width, this.getSize().height); dbG = dbImage.getGraphics(); } // clear screen in background dbG.setColor(getBackground()); // gets background color dbG.fillRect(0, 0, this.getSize().width, this.getSize().height); // draw elements in background dbG.setColor(getForeground()); paint(dbG); // draw image on the screen g.drawImage(dbImage, 0, 0, this); } public void paint(Graphics g) { g.setColor(Color.RED); g.fillOval(x_pos-radius, y_pos-radius, 2*radius, 2*radius); } } </code></pre>
[ { "answer_id": 385833, "author": "Alnitak", "author_id": 6782, "author_profile": "https://Stackoverflow.com/users/6782", "pm_score": 3, "selected": true, "text": "init() start() Thread run() paint() run() repaint() update()" }, { "answer_id": 385843, "author": "Eugene Yokota"...
2008/12/22
[ "https://Stackoverflow.com/questions/385824", "https://Stackoverflow.com", "https://Stackoverflow.com/users/51518/" ]
385,837
<p>In the past I've written sites in ASP.NET just to get nice reusable templating via master pages (layouts) and user controls (partials). I'm talking about sites that have no more complicated code in them than simple variable substitution in templates - I'm just using it to keep my HTML organized. It's great to be able to define the basic layout of your page in one file, and then just fill in the holes for each individual page, re-using some common bits as user controls.</p> <p>However, I'd rather not continue using Windows hosting, so I'd like to write static pages in PHP, which runs everywhere. In the past I've written myself a poor-man's user control for PHP that just unpacks an array and includes a template, but that's clunky and still requires me to put PHP includes all over my pages. I feel like Smarty or one of the other big templating languages for PHP is overkill for just organizing some "static" pages.</p> <p>I've considered just doing the pages in Ruby on Rails because I really like HAML/SASS and the layout/partial model, but having a whole rails app for static content seems silly. But I haven't found anything that seems just right in PHP. Can any PHP gurus recommend anything? I want something more sophisticated than "include" but I don't really need much. That said, something that could give me layouts/partials AND HAML/SASS would be heaven. I've looked at <a href="http://phammable.org/" rel="nofollow noreferrer">phammable</a> but it doesn't look like it solves the layout/partial problem.</p> <p>Again, I'm not looking for something as complex as Smarty, and I don't want a full CMS. I just want something that will let me properly modularize the HTML of my site. We're talking one step beyond static HTML here.</p>
[ { "answer_id": 1813695, "author": "user220623", "author_id": 220623, "author_profile": "https://Stackoverflow.com/users/220623", "pm_score": 2, "selected": true, "text": "<h:define name=\"header\">\n some header contents\n</h:define>\n\n...\n\n<h:header />\n\n<h:include file=\"middle_pa...
2008/12/22
[ "https://Stackoverflow.com/questions/385837", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11284/" ]
385,841
<p>Is it better to use NGEN an ASP.NET application when we know it is not going to change much? Or is the JIT good enough?</p> <p>The only reason I asked was because <a href="http://www.codeguru.com/columns/experts/article.php/c4651" rel="nofollow noreferrer">this article by Jeffrey Richter</a> in 2002 says :</p> <blockquote> <p>And, of course, Microsoft is working quite hard at improving the CLR and its JIT compiler so that it runs faster, produces more optimized code, and uses memory more efficiently. These improvements will take time. For developers that can't wait, the .NET Framework redistributable includes a utility called NGen.exe.</p> </blockquote>
[ { "answer_id": 937971, "author": "foson", "author_id": 22539, "author_profile": "https://Stackoverflow.com/users/22539", "pm_score": 3, "selected": false, "text": "C:\\Windows\\Microsoft.NET\\Framework\\v2.0.50727\\Temporary ASP.NET Files" } ]
2008/12/22
[ "https://Stackoverflow.com/questions/385841", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
385,853
<p>I have an application with a view containing several subviews. The subviews did not implement any touchesbegins logic. The Superview implemented all touchesbegins logic and manipulated each subview respectively if it was touched (determined by hit testing). </p> <p>I have since been converting my subviews to layers. My problem now is that if I touch a layer, the hosting view of the superlayer never gets the touchesbegins method called. However if I touch the background, the touchesbegin method fires.</p> <p>I understood from documentation that layers cannot handle events, if this is so why would it block events to the hosting view?</p> <p>Thanks for any help, can't get my head around this.</p> <p>-Corey</p>
[ { "answer_id": 386216, "author": "Ben Gottlieb", "author_id": 6694, "author_profile": "https://Stackoverflow.com/users/6694", "pm_score": 2, "selected": true, "text": "userInteractionEnabled" } ]
2008/12/22
[ "https://Stackoverflow.com/questions/385853", "https://Stackoverflow.com", "https://Stackoverflow.com/users/48311/" ]
385,861
<p>Our whole system is being designed around REST and are now considering how processes which are quite clearly RPC in intent can be mapped to RESTful resources without using verbs in the URL. Our remote procedure call is used to rebuild our search index when a content listing has been modified elsewhere.</p> <p>What we are thinking about doing is this:</p> <p>POST /index_updates</p> <p><code>&lt;indexUpdate&gt;&lt;contentId&gt;123&lt;/contentId&gt;&lt;/indexUpdate&gt;</code></p> <p>Nothing wrong with that in itself, but the smell is this resource which has been created does not return the URL of the newly created resource e.g. /index_updates/1234 which we can then access with a GET.</p> <p>The indexing engine we are using does have a log mechanism, so in theory we could return a URL to a index_update resource so as to allow a GET to retrieve the resource, but to be honest we're not interested in the resource as this is nothing more than an RPC in disguise.</p> <p>So my question is whether RESTfulness is expressed in structure or intent. I feel the structure of what I have outlined is restful, but the intent is not.</p> <p>Does anyone have an comments or advice?</p> <p>Thanks,</p> <p>Chris</p>
[ { "answer_id": 734800, "author": "Mark Renouf", "author_id": 758, "author_profile": "https://Stackoverflow.com/users/758", "pm_score": 2, "selected": false, "text": "201 Created\nLocation: /index_updates/a9283b734e\n <index_update><percent_complete>89</percent_complete></index_update>\n...
2008/12/22
[ "https://Stackoverflow.com/questions/385861", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37196/" ]
385,890
<p>I have created a one-time subscription in SSRS report manager 2008. However I keep getting duplicate emails sent out by the subscription. The interval between each email is about 30 minutes. </p> <p>I have checked SQL agent job and it looks the SQL agent job is created correctly. It just runs once and after that the next run time is cleared. </p> <p>I also checked SMTP service on local machine by testing code. SMTP works fine for test email without duplicate. So I guess probably it is something wrong in SSRS. Any advice on where I can look into? </p>
[ { "answer_id": 419570, "author": "Ken Yao", "author_id": 42356, "author_profile": "https://Stackoverflow.com/users/42356", "pm_score": 3, "selected": true, "text": "<system.diagnostics>\n <switches>\n <add name=\"DefaultTraceSwitch\" value=\"3\" />\n </switches> </system.dia...
2008/12/22
[ "https://Stackoverflow.com/questions/385890", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42356/" ]
385,895
<p>What is the preferred naming convention for Django model classes?</p>
[ { "answer_id": 385951, "author": "Ben", "author_id": 11522, "author_profile": "https://Stackoverflow.com/users/11522", "pm_score": 3, "selected": false, "text": "Person\nTelephoneNumber\n Category\n" }, { "answer_id": 386054, "author": "Baishampayan Ghose", "author_id": 8...
2008/12/22
[ "https://Stackoverflow.com/questions/385895", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1897/" ]
385,907
<p>I have to write a Java Client to connect to an SSL server. The server uses openssl certificate, and is configured to do Client Auth.</p> <p>I can't seem to locate any useful resources online that can help me (who doesn't know anything about openssl and much about SSL) to understand who to go about implementing my Client Side.</p> <p>Help!</p>
[ { "answer_id": 387639, "author": "erickson", "author_id": 3474, "author_profile": "https://Stackoverflow.com/users/3474", "pm_score": 2, "selected": false, "text": "KeyStore tks = KeyStore.getInstance(KeyStore.getDefaultType());\ntks.load(...); /* Load the trust key store with root CAs. ...
2008/12/22
[ "https://Stackoverflow.com/questions/385907", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29860/" ]
385,910
<p>I am new to Silverlight 2.0 and I am actually trying to deploy the Silverlight as webpart in Sharepoint 2007.</p> <p>I have done the following Installations:</p> <ol> <li>VS 2008 with SP1</li> <li>Silverlight 2.0 SDK and exe</li> <li>Silverlight Tools for VS 2008</li> <li>MOSS 2007</li> </ol> <p>I have created the sample Silverlight application and got the xap file from the bin directory of the solution.</p> <p>Then I wrote a standard Sharepoint webpart with a reference to both <code>Web.Extensions</code> and <code>Microsoft.Silverlight</code> dll's:</p> <pre><code>using System; using System.Runtime.InteropServices; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Serialization; using System.Web.UI.SilverlightControls; using Microsoft.SharePoint; using Microsoft.SharePoint.WebControls; using Microsoft.SharePoint.WebPartPages; namespace SLWeb_Part1 { [Guid("c890f832-05d2-4724-ae25-5f34c827c6c2")] public class SLWeb_Part1 : System.Web.UI.WebControls.WebParts.WebPart { public SLWeb_Part1() { } [WebBrowsable(true), Personalizable(PersonalizationScope.User), WebDescription("Location of the Silverlight XAP package"), WebDisplayName("XAP Location")] public string XAPSource { get; set; } [WebBrowsable(true), Personalizable(PersonalizationScope.User), WebDescription("Silverlight Controld ID "), WebDisplayName("Control ID")] public string ControlID { get; set; } protected override void OnLoad(EventArgs e) { base.OnLoad(e); ScriptManager scriptManager = ScriptManager.GetCurrent(this.Page); if (scriptManager == null) { scriptManager = new ScriptManager(); this.Controls.Add(scriptManager); } } protected override void CreateChildControls() { base.CreateChildControls(); Silverlight sl = new Silverlight(); sl.Source = XAPSource; sl.ID = ControlID; sl.Width = new Unit(400); sl.Height = new Unit(400); this.Controls.Add(sl); } } </code></pre> <p>I also deployed the same to the Sharepoint site, then I made an entry to the Sharepoint site's <code>web.config</code> file to include the Silverlight and Web.Extension assembly's like:</p> <pre><code>&lt;add assembly="System.Web.Silverlight, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /&gt; </code></pre> <p>Then I included <code>application/x-silverlight-app</code> as MIME type for the web application in IIS.</p> <p>After doing all this... I was able to browse the site as usual, but I couldnt see the Silverlight component running.... and it is not throwing any error also...</p> <p>Can anybody help me to solve this problem at the earliest? Do I miss any steps in the configuration?</p> <p>Thanks in advance.</p>
[ { "answer_id": 387399, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 0, "selected": false, "text": "<script src=\"/ScriptResource.axd?d=Un3ROg6ZO8lU8fUlhDz-soUWbkyxgh5pk-teueIPxbpft-XX1Z5TrN4P3iF-wiGinTLoxOt5mA420kQULjqoDnUjO5...
2008/12/22
[ "https://Stackoverflow.com/questions/385910", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
385,912
<p>I need to convert a passed in argument (single object or collection) to an Array. I don't know what the argument is. If it is an Array already, I want to leave it, otherwise create a one-element array from it. I'm looking to <strong>allow both <code>method(:objs =&gt; obj)</code> and <code>method(:objs =&gt; [obj1, obj2])</code></strong></p> <p>This seems to be the best way (Array#to_a returns self):</p> <pre><code>arg = arg.to_a </code></pre> <p>But the ruby docs say <strong><code>Object#to_a</code> will soon be obsolete</strong>. Is there convenient replacement?</p> <p>Anything more succinct than this?</p> <pre><code>arg = arg.respond_to?(:to_a) ? arg.to_a : [arg] </code></pre>
[ { "answer_id": 385937, "author": "Jonathan Lonowski", "author_id": 15031, "author_profile": "https://Stackoverflow.com/users/15031", "pm_score": 2, "selected": false, "text": "Object.to_a to_a Hash.to_a self.to_a #=> -:1: warning: default `to_a' will be obsolete\n\"hello\".to_a ...
2008/12/22
[ "https://Stackoverflow.com/questions/385912", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13216/" ]
385,913
<p>Why wasn't the Java "throws" clause (in method declaration) included in C#?</p>
[ { "answer_id": 397732, "author": "Thomas Danecker", "author_id": 9632, "author_profile": "https://Stackoverflow.com/users/9632", "pm_score": 1, "selected": false, "text": "TryParse" } ]
2008/12/22
[ "https://Stackoverflow.com/questions/385913", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38325/" ]
385,916
<p>I want to copy a file to a FTP server using wxFTP, but I would like to do this without blocking the UI, and much better, while displaying a progress bar. Can I do this without extra thread?</p> <p>I'm using wxLua, but I can adapt a solution written in any language as long as it uses a wxWidgets binding.</p>
[ { "answer_id": 385938, "author": "Joachim Sauer", "author_id": 40342, "author_profile": "https://Stackoverflow.com/users/40342", "pm_score": 0, "selected": false, "text": "canRead()" } ]
2008/12/22
[ "https://Stackoverflow.com/questions/385916", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14443/" ]
385,919
<p>I face a problem when I try to get value from primary table in my mapping file.</p> <p>My tables:</p> <pre><code>CREATE TABLE Customer ( [CustomerId] INT PRIMARY KEY, [FullName] NVARCHAR(50) NOT NULL ) CREATE TABLE CustomerOrder ( [CustomerOrderId] INT PRIMARY KEY, [CustomerId] INT, [TransactionDate] DATETIME ) </code></pre> <p>My classes:</p> <pre><code>public class CustomerOrder { public class Id {get; set;} public class CustomerName {get; set;} public class TransactionDate {get; set;} } ... </code></pre> <p>How can I get FullName value and map to CustomerName property in my CustomerOrder fluent interface mapping class?</p>
[ { "answer_id": 386073, "author": "James Gregory", "author_id": 27206, "author_profile": "https://Stackoverflow.com/users/27206", "pm_score": 2, "selected": true, "text": "public class CustomerOrder\n{\n public int Id { get; set; }\n public Customer Customer { get; set; }\n}\n\npublic c...
2008/12/22
[ "https://Stackoverflow.com/questions/385919", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35700/" ]
385,925
<p>When you run a JUnit 4 ParameterizedTest with the Eclipse TestRunner, the graphical representation is rather dumb: for each test you have a node called <code>[0]</code>, <code>[1]</code>, etc. Is it possible give the tests <code>[0]</code>, <code>[1]</code>, etc. explicit names? Implementing a <code>toString</code> method for the tests does not seem to help.</p> <p>(This is a follow-up question to <a href="https://stackoverflow.com/questions/358802/junit-test-with-dynamic-number-of-tests">JUnit test with dynamic number of tests</a>.)</p>
[ { "answer_id": 386082, "author": "bruno conde", "author_id": 31136, "author_profile": "https://Stackoverflow.com/users/31136", "pm_score": 3, "selected": false, "text": "Parameterized public class MyParameterized extends TestClassRunner {\n @Retention(RetentionPolicy.RUNTIME)\n @Ta...
2008/12/22
[ "https://Stackoverflow.com/questions/385925", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21499/" ]
385,928
<p>I want to show a modeless dialog on the screen and display some information in it.</p> <p>However if I use it the following way, it has some problems:</p> <pre><code>function() { showdialog(XXX). //heavy work. update the dialog.. //heavy work. update the dialog... } </code></pre> <p>It seems the dialog displayed, but it does not draw any information in it. It only draw all information when the function is over.</p> <p>How can I modify the modeless dialog so it will display the information immediately?</p>
[ { "answer_id": 385979, "author": "jussij", "author_id": 14738, "author_profile": "https://Stackoverflow.com/users/14738", "pm_score": 3, "selected": false, "text": "void ProcessMessages()\n{\n MSG msg;\n CWinApp* pApp = AfxGetApp();\n while (PeekMessage(&msg, NULL, 0, 0, PM_NORE...
2008/12/22
[ "https://Stackoverflow.com/questions/385928", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25749/" ]
385,945
<p>I want to capture all the requests going to <code>*.jpg</code> files on my server. To do so, I have created an HttpHandler whose code is as follows:</p> <pre><code>using System; using System.Collections.Generic; using System.Text; using System.Web; using System.IO; using System.Globalization; namespace MyHandler { public class NewHandler : IHttpHandler { public NewHandler() {} public void ProcessRequest(System.Web.HttpContext ctx) { HttpRequest req = ctx.Request; string path = req.PhysicalPath; string extension = null; string contentType = null; extension = Path.GetExtension(path).ToLower(); switch (extension) { case ".gif": contentType = "image/gif"; break; case ".jpg": contentType = "image/jpeg"; break; case ".png": contentType = "image/png"; break; default: throw new NotSupportedException("Unrecognized image type."); } if (!File.Exists(path)) { ctx.Response.Status = "Image not found"; ctx.Response.StatusCode = 404; } else { ctx.Response.Write("The page request is " + ctx.Request.RawUrl.ToString()); StreamWriter sw = new StreamWriter(@"C:\requestLog.txt", true); sw.WriteLine("Page requested at " + DateTime.Now.ToString() + ctx.Request.RawUrl); sw.Close(); ctx.Response.StatusCode = 200; ctx.Response.ContentType = contentType; ctx.Response.WriteFile(path); } } public bool IsReusable{get {return true;}} } } </code></pre> <p>After compiling this and adding it to my web application's <code>Bin</code> directory as a deference, I added the following in my <code>web.config</code> file:</p> <pre><code>&lt;system.web&gt; &lt;httpHandlers&gt; &lt;add verb="*" path="*.jpg" type="MyHandler.NewHandler,MyHandler"/&gt; &lt;/httpHandlers&gt; &lt;/system.web&gt; </code></pre> <p>Then I also modified the IIS settings <code>Home Directory -&gt; Application Configuration</code> and added <code>aspnet_isapi.dll</code> for the <code>.jpg</code> extension.</p> <p>In the Handler, I have tried to write some stuff in the log file which I am creating in the C drive, but it is not writing to the log file and I am unable to find the bug.</p>
[ { "answer_id": 385953, "author": "splattne", "author_id": 6461, "author_profile": "https://Stackoverflow.com/users/6461", "pm_score": 2, "selected": false, "text": "<httpHandlers>\n <add verb=\"\" path=\".jpg\" type=\"MyHandler.NewHandler,MyHandler\"/>\n</httpHandlers> \n <httpHandlers...
2008/12/22
[ "https://Stackoverflow.com/questions/385945", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
385,959
<p>Lets say you have a model like the following:</p> <pre><code>class Stock &lt; ActiveRecord::Base # Positions BUY = 1 SELL = 2 end </code></pre> <p>And in that class as an attribute of type integer called 'position' that can hold any of the above values. What is the Rails best practice for converting those integer values into human readable strings? </p> <p>a) Use a helper method, but then you're force to make sure that you keep the helper method and model in sync</p> <pre><code>def stock_position_to_s(position) case position when Stock::BUY 'buy' when Stock::SELL 'sell' end '' end </code></pre> <p>b) Create a method in the model, which sort of breaks a clean MVC approach.</p> <pre><code>class Stock &lt; ActiveRecord::Base def position_as_string ...snip end end </code></pre> <p>c) A newer way using the new I18N stuff in Rails 2.2? </p> <p>Just curious what other people are doing when they have an integer column in the database that needs to be output as a user friendly string. </p> <p>Thanks, Kenny</p>
[ { "answer_id": 385990, "author": "DanSingerman", "author_id": 43965, "author_profile": "https://Stackoverflow.com/users/43965", "pm_score": 0, "selected": false, "text": "stock.position.name\n" }, { "answer_id": 389189, "author": "maurycy", "author_id": 48541, "author...
2008/12/22
[ "https://Stackoverflow.com/questions/385959", "https://Stackoverflow.com", "https://Stackoverflow.com/users/48321/" ]
385,960
<p>Say I have the following code:</p> <pre><code>function One() {} One.prototype.x = undefined; function Two() {} var o = new One(); var t = new Two(); </code></pre> <p><code>o.x</code> and <code>t.x</code> will both evaluate to <code>undefined</code>. <code>o.hasOwnProperty('x')</code> and <code>t.hasOwnProperty('x')</code> will both return false; the same goes for <code>propertyIsEnumerable</code>. Two questions:</p> <ul> <li>Is there any way to tell that o.x is defined and set to <code>undefined</code>?</li> <li>Is there ever any reason to? (should the two be semantically equivalent?)</li> </ul> <p>A small caveat: doing (for propName in o) loop will yield 'x' as one of the strings, while doing it in t will not - so there IS a difference in how they're represented internally (at least in Chrome).</p>
[ { "answer_id": 385962, "author": "Claudiu", "author_id": 15055, "author_profile": "https://Stackoverflow.com/users/15055", "pm_score": 0, "selected": false, "text": "var definedProperties = [];\nfor (var prop in o) definedProperties.push(prop);\n\nif (o.x === undefined && contains(prop, ...
2008/12/22
[ "https://Stackoverflow.com/questions/385960", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15055/" ]
385,975
<p>What do you consider "best practice" when it comes to error handling errors in a consistent way in a C library.</p> <p>There are two ways I've been thinking of:</p> <p>Always return error code. A typical function would look like this:</p> <pre><code>MYAPI_ERROR getObjectSize(MYAPIHandle h, int* returnedSize); </code></pre> <p>The always provide an error pointer approach:</p> <pre><code>int getObjectSize(MYAPIHandle h, MYAPI_ERROR* returnedError); </code></pre> <p>When using the first approach it's possible to write code like this where the error handling check is directly placed on the function call:</p> <pre><code>int size; if(getObjectSize(h, &amp;size) != MYAPI_SUCCESS) { // Error handling } </code></pre> <p>Which looks better than the error handling code here. </p> <pre><code>MYAPIError error; int size; size = getObjectSize(h, &amp;error); if(error != MYAPI_SUCCESS) { // Error handling } </code></pre> <p>However, I think using the return value for returning data makes the code more readable, It's obvious that something was written to the size variable in the second example.</p> <p>Do you have any ideas on why I should prefer any of those approaches or perhaps mix them or use something else? I'm not a fan of global error states since it tends to make multi threaded use of the library way more painful.</p> <p>EDIT: C++ specific ideas on this would also be interesting to hear about as long as they are not involving exceptions since it's not an option for me at the moment...</p>
[ { "answer_id": 385998, "author": "Alnitak", "author_id": 6782, "author_profile": "https://Stackoverflow.com/users/6782", "pm_score": 3, "selected": false, "text": "stdio" }, { "answer_id": 386008, "author": "Ilya", "author_id": 6807, "author_profile": "https://Stackov...
2008/12/22
[ "https://Stackoverflow.com/questions/385975", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11758/" ]
385,986
<p>I would like to cache my most database heavy actions in my asp.net-mvc site. In my research I have found </p> <ul> <li><a href="http://haacked.com/archive/2008/11/05/donut-caching-in-asp.net-mvc.aspx" rel="noreferrer">donut caching</a> on Phil's blog</li> <li><a href="http://weblogs.asp.net/rashid/archive/2008/03/28/asp-net-mvc-action-filter-caching-and-compression.aspx" rel="noreferrer">Caching/compressing</a> filters on Kazi's blog</li> <li>Scott Hansleman's podcast about how they cached things in SO.</li> </ul> <p>But I don't feel I get it yet.<br> I want to be able to cache my POST request depending on several pars. These pars are in an object. So I would like to cache the result of the following request:</p> <pre><code>public ActionResult AdvancedSearch(SearchBag searchBag) </code></pre> <p>Where searchBag is an object that holds (a bunch) of optional search parameters. My views themselves are light (as they should be), but the data access can be rather time consuming, depending on what fields are filled in in the search bag.</p> <p>I have the feeling I should be caching on my datalayer, rather then on my actions.<br> How am I supposed to use the VaryByParam in the OutputCache attribute?</p>
[ { "answer_id": 388175, "author": "Matthew", "author_id": 20162, "author_profile": "https://Stackoverflow.com/users/20162", "pm_score": 7, "selected": true, "text": "System.Web.HttpContext.Current.Cache" }, { "answer_id": 47410405, "author": "Nikki", "author_id": 1434834, ...
2008/12/22
[ "https://Stackoverflow.com/questions/385986", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11333/" ]
386,006
<p>I have the table (Product_Id, category priority, atribute1, atribute2...) in MS Access, and I am trying to make a query that orders the data grouped by Category and ordered by the highest priority. Priority can be Null, so it should be placed at the end. Example: Table</p> <pre><code>1, 100, 2, atr1, atr2 2, 300, , atr1, atr2 3, 100, 5, atr1, atr2 4, 200, 9, atr1, atr2 5, 100, , atr1, atr2 6, 200, 1, atr1, atr2 </code></pre> <p>Result expected in Query:</p> <pre><code>6, 200, 1, atr1, atr2 4, 200, 9, atr1, atr2 1, 100, 2, atr1, atr2 3, 100, 5, atr1, atr2 5, 100, , atr1, atr2 2, 300, , atr1, atr2 </code></pre>
[ { "answer_id": 386025, "author": "Unsliced", "author_id": 2902, "author_profile": "https://Stackoverflow.com/users/2902", "pm_score": 0, "selected": false, "text": "select t1.* \nfrom myTable t1 \njoin \n( \n\n select category, min(coalesce(priority, 1000)) weight\n from my...
2008/12/22
[ "https://Stackoverflow.com/questions/386006", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
386,017
<p>I have methods with <strong>more than one parameter</strong> that are guarded against bad input by throwing ArgumentNullExceptions and ArgumentExceptions whenever any parameter is null.</p> <p>So there are two obvious ways to test this:</p> <ul> <li>One test per Parameter using the [ExpectedException] attribute</li> <li>One test for all parameters using multiple try{} catch blocks</li> </ul> <p>The try catch thing would look like that:</p> <pre><code>try { controller.Foo(null, new SecondParameter()); Assert.Fail("ArgumentNullException wasn't thrown"); } catch (ArgumentNullException) {} </code></pre> <p>With one little problem. If the test passes, Assert.Fail never gets called and will therefore be highlighted as not covered test code (by NCover).</p> <p>I know this isn't actually a problem, since it's the business code I want 100% coverage of, not the test code. Still I am curious if there is a way to compress multiple Exception throwing calls into one Testcase without having dead LoCs?</p>
[ { "answer_id": 386037, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 3, "selected": false, "text": "public void ExpectException<T>(Action action) where T : Exception\n{\n try\n {\n action();\n Assert....
2008/12/22
[ "https://Stackoverflow.com/questions/386017", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21699/" ]
386,034
<p>If I'd like to control the IP phone from my web application, how should I begin?</p> <p>Let's say I have a standalone IP phone connected to the provider of IP telephony services. On the other side I have a server-side web application for the sales support. I'd like to initiate a call on my phone from this web application, on the other side I'd like to get for instance a popup with a customer's data on the web browser, when my customer is calling me. </p> <p>In old era we had a <a href="http://en.wikipedia.org/wiki/Computer_telephony_integration" rel="nofollow noreferrer">CTI</a> (Computer Telephony Integration) standards like JTAPI and TAPI for that, what are the common standards (if any) in the era of IP telephony today?</p>
[ { "answer_id": 386037, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 3, "selected": false, "text": "public void ExpectException<T>(Action action) where T : Exception\n{\n try\n {\n action();\n Assert....
2008/12/22
[ "https://Stackoverflow.com/questions/386034", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25956/" ]
386,039
<p>I have a problem. I need to host grid with controls in ScrollViewer to prevent textbox from being either truncated or collapsed to zero-with at the UI. Also I want the with of textbox to be expanded when user change windows width. I'm setting Window's content to following code</p> <pre><code>&lt;DockPanel&gt; &lt;TreeView DockPanel.Dock="Left" Width="150"/&gt; &lt;ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto"&gt; &lt;Grid&gt; &lt;Grid.ColumnDefinitions&gt; &lt;ColumnDefinition Width="Auto"/&gt; &lt;ColumnDefinition /&gt; &lt;/Grid.ColumnDefinitions&gt; &lt;Grid.RowDefinitions&gt; &lt;RowDefinition Height="Auto"/&gt; &lt;/Grid.RowDefinitions&gt; &lt;TextBlock Text="Name" Margin="5" VerticalAlignment="Center"/&gt; &lt;TextBox Grid.Column="1" Text="Some Name" Margin="5" VerticalAlignment="Center" MinWidth="200"/&gt; &lt;/Grid&gt; &lt;/ScrollViewer&gt; &lt;/DockPanel&gt; </code></pre> <p>All work fine, but when user types very long text in TextBox it is being expanded and horizontal scroll appears. Is there any easy way to limit TextBox maximum width and allow it to be expanded only when user changes window size.</p>
[ { "answer_id": 387338, "author": "Robert Macnee", "author_id": 19273, "author_profile": "https://Stackoverflow.com/users/19273", "pm_score": 6, "selected": true, "text": "<DockPanel>\n <TreeView Width=\"150\" DockPanel.Dock=\"Left\"/>\n <ScrollViewer HorizontalScrollBarVisibility=\...
2008/12/22
[ "https://Stackoverflow.com/questions/386039", "https://Stackoverflow.com", "https://Stackoverflow.com/users/47856/" ]
386,040
<p>ORACLE does not permit NULL values in any of the columns that comprise a primary key. It appears that the same is true of most other "enterprise-level" systems.</p> <p>At the same time, most systems also allow <em>unique</em> contraints on nullable columns.</p> <p>Why is it that unique constraints can have NULLs but primary keys can not? Is there a fundamental logical reason for this, or is this more of a technical limitation?</p>
[ { "answer_id": 386061, "author": "Tomalak", "author_id": 18771, "author_profile": "https://Stackoverflow.com/users/18771", "pm_score": 9, "selected": true, "text": "NULL = NULL A B A B AB A B" }, { "answer_id": 16124563, "author": "zxq9", "author_id": 988678, "author_...
2008/12/22
[ "https://Stackoverflow.com/questions/386040", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33080/" ]
386,042
<p>I want to have a checkbox for terms and conditions, label of which should contain a link to a page with, well, terms and conditions.</p> <p>The following field will have the label with the tags escaped.</p> <pre><code>BooleanField(label="I agree to &lt;a href='terms-conditions.html'&gt;terms&amp;conditions&lt;/a&gt;") </code></pre>
[ { "answer_id": 386065, "author": "scunliffe", "author_id": 6144, "author_profile": "https://Stackoverflow.com/users/6144", "pm_score": 4, "selected": true, "text": "<label>I agree to terms&conditions</label>\n <label>I agree to terms&conditions</label> (<a href=\"terms-conditions.html\">...
2008/12/22
[ "https://Stackoverflow.com/questions/386042", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5978/" ]
386,044
<p>JavaScript does funky automatic conversions with objects:</p> <pre><code>var o = {toString: function() {return "40"; }}; print(o + o); print((o+1)+o); print((o*2) + (+o)); </code></pre> <p>will print:</p> <pre><code>4040 40140 120 </code></pre> <p>This is because +, if any of the arguments are objects/strings, will try to convert all the arguments to strings then concatenate them. If all arguments are numbers, it adds them together. * and unary + convert objects to numbers using toString (as well as valueOf, not shown here).</p> <p>What does JavaScript do for the ++ operator?</p>
[ { "answer_id": 386048, "author": "Claudiu", "author_id": 15055, "author_profile": "https://Stackoverflow.com/users/15055", "pm_score": 2, "selected": false, "text": "var a = {toString: function() {return \"40\"; }};\nnl(typeof a);\nnl(typeof +a);\nnl(typeof a);\nnl(typeof (a++));\nnl(a);...
2008/12/22
[ "https://Stackoverflow.com/questions/386044", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15055/" ]
386,046
<p>I am writing a website with PHP. Since it will need to be accessed by anyone on the network to access the internet I have to create a mobile version. How do I best check if it's a mobile device? I don't want to have a switch statement with 50 devices at the end since I don't only want to support the iPhone.</p> <p>Is there a PHP class I could use?</p>
[ { "answer_id": 701925, "author": "jb.", "author_id": 37522, "author_profile": "https://Stackoverflow.com/users/37522", "pm_score": 2, "selected": false, "text": "import re\n\n# Some mobile browsers which look like desktop browsers.\nRE_MOBILE = {\n \"iphone\" : re.compile(\"ip(hone|od...
2008/12/22
[ "https://Stackoverflow.com/questions/386046", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19929/" ]
386,063
<p>Im writing a .net webforms app. It has a number of classes, for example users, bookings etc. At the moment I have a number of manager classes, say bookingManager, that manage these classes. For example when creating a new booking, you call the add method in the bookingManager, and pass a booking. It then checks the booking is valid, checkis it doesn't conflict, and if it does not, adds it to the db. I have similar managers for the other classes, however ones such as the user manager don't do alot more than take the user and add to the DB. So my question is, is this the best way to be doing this sort of thing, or is there a pattern or method thats better suited to this?</p>
[ { "answer_id": 386109, "author": "caltuntas", "author_id": 36474, "author_profile": "https://Stackoverflow.com/users/36474", "pm_score": 2, "selected": false, "text": "buttonClicked(Eventargs...)\n{\n presenter.Save();\n}\n public void Save()\n{\n bookingService.Save(view.Name,view.D...
2008/12/22
[ "https://Stackoverflow.com/questions/386063", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8768/" ]
386,064
<p>I want to create a lst file from a sql script</p> <p>Here is my code:</p> <pre><code>BEGIN DECLARE loc_bia_foracid GAM.foracid%TYPE; loc_fba_foracid GAM.foracid%TYPE; out_spool VARCHAR2(32000); BEGIN loc_bia_foracid:= '&amp;loc_bia_foracid'; loc_fba_foracid:= '&amp;loc_fba_foracid'; out_spool := out_spool || '|' || loc_bia_foracid; out_spool := out_spool || '|' || loc_fba_foracid; END; </code></pre> <p>If I don't give the no of characters for <code>out_spool</code> it gives me an error. And I want my lst file to be more than 32k characters. Also I need to know how do I define it in a stored procedure.</p>
[ { "answer_id": 386858, "author": "darreljnz", "author_id": 10538, "author_profile": "https://Stackoverflow.com/users/10538", "pm_score": 0, "selected": false, "text": "CREATE OR REPLACE FUNCTION make_lst(\n pis_bia_foracid IN GAM.foracid%TYPE,\n pis_fba_foracid IN GAM.foracid%TYPE)\nRE...
2008/12/22
[ "https://Stackoverflow.com/questions/386064", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
386,066
<p>I'm implementing a locking and copy protection system for my software. I've shut every hole that would allow someone to break my lock (well, that's a little too optimistic, I know!) but the last thing is this:</p> <p>I hear crackers can change Windows DLLs like Kernel32.dll in a way that the API I use returns a value which is specified by the cracker. I need to prevent this.</p> <p>At first I thought I could make a hash value for every DLL I use, and check that hash against the calculated hash of the client DLL to see if the file is changed. That won't work since there are many different versions of the DLL for different versions of Windows, and every hotfix and Service Pack provided by Microsoft could change the file.</p> <p>Then I realized I could check the signature of the file to make sure it has a valid Microsoft signature. Now there are 2 questions:</p> <ol> <li>Does Microsoft sign Windows DLLs? How can I find some info on this signature?</li> <li>Is a Public key provided to validate the signature? How do I use this key to validate the file?</li> </ol> <p>Any walkthroughs are greatly appreciated. My app is written using Visual Basic.NET.</p> <p>Thanks guys.</p>
[ { "answer_id": 386606, "author": "HTTP 410", "author_id": 13118, "author_profile": "https://Stackoverflow.com/users/13118", "pm_score": 4, "selected": true, "text": "C:\\Windows\\system32>sigcheck kernel32.dll\nSigcheck v1.5\nCopyright (C) 2004-2008 Mark Russinovich\nSysinternals - www.s...
2008/12/22
[ "https://Stackoverflow.com/questions/386066", "https://Stackoverflow.com", "https://Stackoverflow.com/users/41389/" ]
386,067
<p>Using ASP.net, how do you write ANSI characters to a text file?</p> <p>I need to write this file's text to the web browser. Do they support ANSI?</p>
[ { "answer_id": 386119, "author": "Aleris", "author_id": 20417, "author_profile": "https://Stackoverflow.com/users/20417", "pm_score": 2, "selected": false, "text": "FileStream fs = new FileStream(fileName,\n FileMode.CreateNew, FileAccess.Write, FileShare.None);\nStreamWriter ...
2008/12/22
[ "https://Stackoverflow.com/questions/386067", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22162/" ]
386,076
<p>I have a book coming on F#, but at the moment I am pretty uninformed, so I thought I'd ask. From very little I know of F#, I am struggling to see what it gains me over C# bar a possible syntactic neatness. There seems nothing conceptually new, or that isn't do-able in piian C#</p> <p>I did Forth way back when (20 years ago nearly!) and I already incorporate passing function delegates as parameters into methods (been doing that sort of thing forever, it seems). </p> <p>Stylistically I am not keen on anonymous methods - is that going to be an issue?</p> <p>Though I suppose syntactic neatness is not to be sniffed at :-)</p>
[ { "answer_id": 471986, "author": "MichaelGG", "author_id": 27012, "author_profile": "https://Stackoverflow.com/users/27012", "pm_score": 3, "selected": false, "text": " let snd (a,b) = b\n val snd : 'a * 'b -> 'b\n static Tb snd<Ta, Tb>(Tuple<Ta, Tb> x) { return x.B; }\n" } ]
2008/12/22
[ "https://Stackoverflow.com/questions/386076", "https://Stackoverflow.com", "https://Stackoverflow.com/users/41557/" ]
386,079
<p>I would like to use an SQL Server table as an action queue. So whenever the table is non-empty, I'd like some sort of notification to my <a href="http://www.visualdataflex.com/" rel="nofollow noreferrer">VDF</a> application, in order to avoid constantly polling the database. VDF relies on using <a href="http://en.wikipedia.org/wiki/X86_calling_conventions#stdcall" rel="nofollow noreferrer">stdcall</a>, the standard calling convention for the Win 32 API, or COM/ActiveX. Another solution that could work for me is to simply run an exe file when the table is non-empty.</p> <p>Are there any events in SQL Server that could be used here? And how would you go about channeling such an event to be used by VDF (as described above)?</p>
[ { "answer_id": 388780, "author": "seanyboy", "author_id": 1726, "author_profile": "https://Stackoverflow.com/users/1726", "pm_score": 1, "selected": false, "text": "{ Published = True }\n{ Description = \"Test the service is alive - returns 'Hello World'\" }\nFunction HelloWorld Return...
2008/12/22
[ "https://Stackoverflow.com/questions/386079", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18651/" ]
386,083
<p>I am trying to use <a href="https://stackoverflow.com/questions/46663/how-do-you-send-email-from-a-java-app-using-gmail#47452">Bill the Lizard's code</a> to send an email using Google Apps. I am getting this error: </p> <pre><code>Exception in thread "main" javax.mail.SendFailedException: Sending failed; nested exception is: javax.mail.MessagingException: 530 5.7.0 Must issue a STARTTLS command first. f3sm9277120nfh.74 at javax.mail.Transport.send0(Transport.java:219) at javax.mail.Transport.send(Transport.java:81) at SendMailUsingAuthentication.postMail(SendMailUsingAuthentication.java:81) at SendMailUsingAuthentication.main(SendMailUsingAuthentication.java:44) </code></pre> <p>Bill's code contains the next line, which seems related to the error: </p> <pre><code> props.put("mail.smtp.starttls.enable","true"); </code></pre> <p>However, it does not help.</p> <p>These are my import statements: </p> <pre><code>import java.util.Properties; import javax.mail.Authenticator; import javax.mail.Message; import javax.mail.MessagingException; import javax.mail.PasswordAuthentication; import javax.mail.Session; import javax.mail.Transport; import javax.mail.internet.InternetAddress; import javax.mail.internet.MimeMessage; </code></pre> <p>Does anyone know about this error?</p>
[ { "answer_id": 386166, "author": "Zach Scrivena", "author_id": 20029, "author_profile": "https://Stackoverflow.com/users/20029", "pm_score": 2, "selected": false, "text": "private static void send(\n final String username,\n final String password,\n final String reci...
2008/12/22
[ "https://Stackoverflow.com/questions/386083", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2138/" ]
386,088
<p>I am using the following code to attempt to read a large file (280Mb) into a byte array from a UNC path</p> <pre><code>public void ReadWholeArray(string fileName, byte[] data) { int offset = 0; int remaining = data.Length; log.Debug("ReadWholeArray"); FileStream stream = new FileStream(fileName, FileMode.Open, FileAccess.Read); while (remaining &gt; 0) { int read = stream.Read(data, offset, remaining); if (read &lt;= 0) throw new EndOfStreamException (String.Format("End of stream reached with {0} bytes left to read", remaining)); remaining -= read; offset += read; } } </code></pre> <p>This is blowing up with the following error.</p> <pre><code>System.IO.IOException: Insufficient system resources exist to complete the requested </code></pre> <p>If I run this using a local path it works fine, in my test case the UNC path is actually pointing to the local box.</p> <p>Any thoughts what is going on here ?</p>
[ { "answer_id": 2480004, "author": "John Saunders", "author_id": 76337, "author_profile": "https://Stackoverflow.com/users/76337", "pm_score": 1, "selected": false, "text": "FileStream using public void ReadWholeArray(string fileName, byte[] data)\n{\n int offset = 0;\n int remainin...
2008/12/22
[ "https://Stackoverflow.com/questions/386088", "https://Stackoverflow.com", "https://Stackoverflow.com/users/983/" ]
386,094
<p>the following js works fine in FF2 but in IE6 the dropdown always selects one option to early, IE -> testix2 vs. FF2 -> testix3 If we add an alertBox somewhere in the script, it also works fine in IE6. But how to solve this without an alertBox?</p> <p>tia</p> <pre><code>&lt;script language="JavaScript" type="text/javascript"&gt; &lt;!-- function Entry(value, name, selected) { this.value = value; this.name = name; this.selected = selected; } //--&gt; &lt;/script&gt; &lt;select id="selSeaShells"&gt; &lt;/select&gt; &lt;script language="JavaScript" type="text/javascript"&gt; &lt;!-- var productCategoryLevel2 = new Array(); productCategoryLevel2.push(new Entry('Hallo1', 'testix1', false)); productCategoryLevel2.push(new Entry('Hallo2', 'testix2', false)); productCategoryLevel2.push(new Entry('Hallo3', 'testix3', true)); var i = 0; for (i in productCategoryLevel2) { var optL2 = document.createElement('option'); optL2.selected = true; optL2.text = productCategoryLevel2[i].name; optL2.value = productCategoryLevel2[i].value; if (productCategoryLevel2[i].selected == true) { productCategoryLevel2[i].selected = true; optL2.selected = true; } else { optL2.selected = false; } try { document.getElementById("selSeaShells").add(optL2, null); } catch(ex3) { document.getElementById("selSeaShells").add(optL2); } } //--&gt; &lt;/script&gt; </code></pre>
[ { "answer_id": 386127, "author": "Tom Haigh", "author_id": 22224, "author_profile": "https://Stackoverflow.com/users/22224", "pm_score": 3, "selected": true, "text": "var i = 0;\nfor (i in productCategoryLevel2) {\n var optL2 = document.createElement('option');\n\n optL2.text = pro...
2008/12/22
[ "https://Stackoverflow.com/questions/386094", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28968/" ]
386,107
<p>I've written my first JQuery plugin and one of it's dependancies is an external css stylesheet. Do you think this is an acceptable strategy to include this in the distributable or should I embed style information in the plugin itself? Should I ship with no style information at all? The visual elements of the plugin make no sense without the stylesheet, and I'd like to allow users to obviously tweak the look and feel too. Just not sure what is the best approach to take.</p>
[ { "answer_id": 386210, "author": "kgiannakakis", "author_id": 24054, "author_profile": "https://Stackoverflow.com/users/24054", "pm_score": 3, "selected": true, "text": "jquery.js\nlicence.txt\nreadme.txt\nui\\*.js\nthemes\\*.css\ntests\\\ndemos\\\n" } ]
2008/12/22
[ "https://Stackoverflow.com/questions/386107", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39655/" ]
386,111
<p>My app needs to play some audio files and I want to fade-out the iPod sound, play my file, and then as soon as my audio stops playing fade-in iPod again (just like iPhone handles iPod music when an incoming call comes in)</p> <p>I'm setting up my app's Audio Session to be kAudioSessionCategory_MediaPlayback and then just before I play my file I call AudioSessionSetActive (true) then when my file ends playing I call AudioSessionSetActive (false)</p> <p>What happens is that the iPod audio fades-out with the AudioSessionSetActive (true) call, but it never fades-in again after I call AudioSessionSetActive (false)</p> <p>I'm using AVFoundation class to play my audio, I audioPlayerDidFinishPlaying in my delegate method and that's where I call AudioSessionSetActive (false).</p> <p>What am I missing here? Why doesn't the iPod fade-in when I deactive my audio session? Do I have the wrong Audio Session Category for this?</p>
[ { "answer_id": 1003642, "author": "Aleksandar Vacić", "author_id": 108859, "author_profile": "https://Stackoverflow.com/users/108859", "pm_score": 2, "selected": false, "text": "#import <MediaPlayer/MediaPlayer.h>\n...\n[[MPMusicPlayerController iPodMusicPlayer] pause]\n...(play your aud...
2008/12/22
[ "https://Stackoverflow.com/questions/386111", "https://Stackoverflow.com", "https://Stackoverflow.com/users/44091/" ]
386,115
<p>I've been coding in Ruby for sometime now, but I don't understand when to use:</p> <pre><code>def self.METHOD_NAME end </code></pre> <p>or just:</p> <pre><code>def METHOD_NAME end </code></pre> <p>In any Rails model. Is "self" a modifier like private in Java? When should I use it and when not?. Thanks a ton.</p>
[ { "answer_id": 386132, "author": "DanSingerman", "author_id": 43965, "author_profile": "https://Stackoverflow.com/users/43965", "pm_score": 8, "selected": true, "text": "def self.method_name\nend\n def method_name\nend\n" }, { "answer_id": 386164, "author": "krusty.ar", "...
2008/12/22
[ "https://Stackoverflow.com/questions/386115", "https://Stackoverflow.com", "https://Stackoverflow.com/users/44916/" ]
386,122
<p>I would like to know if there is a function to correctly escape string literals for filter expressions. e.g.:</p> <pre><code>DataTable.Select(String.Format(&quot;[name] = '{0}'&quot;, MyName)) </code></pre> <p>If MyName contains ' or a number of other key characters an exception is generated. The <a href="http://msdn.microsoft.com/en-us/library/system.data.datacolumn.expression.aspx" rel="nofollow noreferrer">Microsoft documentation</a> indicates that these charaters should be correctly escaped, however there is a bit of confusion on how this is to be done.</p> <p>I have tried replacing ' with ' and also ['] as indicated in the documentation, however the query still fails.</p>
[ { "answer_id": 2928226, "author": "Rory", "author_id": 8479, "author_profile": "https://Stackoverflow.com/users/8479", "pm_score": 5, "selected": false, "text": "private string EscapeLikeValue(string value)\n{\n StringBuilder sb = new StringBuilder(value.Length);\n for (int i = 0; ...
2008/12/22
[ "https://Stackoverflow.com/questions/386122", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31395/" ]
386,131
<p>I want to keep viewstate of a specific page in session but following code block does not help me, what might I be missing?</p> <p>So here is the code-behind file content of my page;</p> <pre><code> public partial class ConfigurationEditorWebForm : PageBase { protected void Page_Load(object sender, EventArgs e) { } protected override bool VerifyAccess() { return true; } protected override PageStatePersister PageStatePersister { get { return new SessionPageStatePersister(this); } } } </code></pre>
[ { "answer_id": 484656, "author": "Nick Berardi", "author_id": 17, "author_profile": "https://Stackoverflow.com/users/17", "pm_score": 2, "selected": false, "text": "protected override PageStatePersister PageStatePersister\n{\n get\n {\n return new SessionPageStatePersister(t...
2008/12/22
[ "https://Stackoverflow.com/questions/386131", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35012/" ]
386,142
<p>Can anyone provide a good example of IHttpHnalder for handling Image Type. I want to resize the image that's hosted on my server</p>
[ { "answer_id": 415988, "author": "peSHIr", "author_id": 50846, "author_profile": "https://Stackoverflow.com/users/50846", "pm_score": 1, "selected": false, "text": "BlobStreams IHttpHandler" } ]
2008/12/22
[ "https://Stackoverflow.com/questions/386142", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
386,150
<p>Drupal Aggregator core module is a useful one but suffers many problems. There are many talking about improving it in Drupal 7.</p> <p>Right now I'm using Aggregator module which comes with Drupal 6. I'm building an aggregation site, and there is one BIG problem. Sometimes feeds contain HTML tags attributes (e.g. style, dir, title), but Aggregator's input format filter ignores SOME attributes (e.g. style and dir) and allows others (class and href). Without some attributes feeds look very missy. Aggregator contains it's own input format, it doesn't use other inputs formats (and this makes the problem harder!).</p> <p>The question is how can I allow some HTML tags' attributes to appear in feeds.</p> <p>P.S. last thing to do is modifying Aggregator's core files</p>
[ { "answer_id": 3653501, "author": "Daniel Canet", "author_id": 440848, "author_profile": "https://Stackoverflow.com/users/440848", "pm_score": 0, "selected": false, "text": "<?php\nfunction aggregator_filter_xss($value) {\n return filter_xss($value, preg_split('/\\s+|<|>/', variable_get...
2008/12/22
[ "https://Stackoverflow.com/questions/386150", "https://Stackoverflow.com", "https://Stackoverflow.com/users/44100/" ]
386,151
<p>I want to convert strings to bit-fields.Also,convert them to binary and then use. Need help with this..help me ..</p>
[ { "answer_id": 386188, "author": "Greg", "author_id": 24181, "author_profile": "https://Stackoverflow.com/users/24181", "pm_score": 2, "selected": false, "text": ">>> from struct import *\n>>> pack('hhl', 1, 2, 3)\n'\\x00\\x01\\x00\\x02\\x00\\x00\\x00\\x03'\n>>> unpack('hhl', '\\x00\\x01...
2008/12/22
[ "https://Stackoverflow.com/questions/386151", "https://Stackoverflow.com", "https://Stackoverflow.com/users/46646/" ]
386,155
<p>I'm doing some research in code generation from xsd schema files. My requirements:</p> <ul> <li>Must generate C# 2.0 code (or above), using generic collections where needed.</li> <li>Must generate comments from the xsd comments</li> <li>Must generate fully serializable code.</li> <li>Should be able to generate resuable basetypes when generating from multiple xsd's with the same includes.</li> </ul> <p>(see also my other questions: <a href="https://stackoverflow.com/questions/374600/how-can-i-generate-multiple-classes-from-xsds-with-common-includes">How can I generate multiple classes from xsd’s with common includes?</a> and <a href="https://stackoverflow.com/questions/374086/how-can-i-generate-comments-from-xsdocumentation-tags-in-a-wsdl">How can I generate comments from xs:documentation tags in a wsdl?</a></p> <p>I have found the following options:</p> <ol> <li>Use xsd.exe (supplied with the SDK and Visual Studio)</li> <li>XSDCodeGen from <a href="http://www.clariusconsulting.net/blogs/kzu/archive/2004/05/14/XsdCodeGenTool.aspx" rel="noreferrer">Daniel Cazzulino</a> </li> <li><a href="http://www.codeplex.com/Xsd2Code" rel="noreferrer">Xsd2Code</a></li> <li><a href="http://www.bware.biz/CodeXS/" rel="noreferrer">CodeXS</a></li> <li><a href="http://www.microsoft.com/downloads/details.aspx?familyid=89e6b1e5-f66c-4a4d-933b-46222bb01eb0&amp;displaylang=en" rel="noreferrer">XsdObjectGen</a> by Microsoft</li> <li><a href="http://www.dotnetjunkies.com/WebLog/ram-marappan/default.aspx" rel="noreferrer">XSDClassGen</a> (Seems to be missing in action)</li> </ol> <p>Did I miss any? Because (1), (2) and (5) do not generate 2.0 code, and I have problems with serializing code from (3). What do you use when generating code?</p>
[ { "answer_id": 4731379, "author": "Xcalibur", "author_id": 317739, "author_profile": "https://Stackoverflow.com/users/317739", "pm_score": 7, "selected": true, "text": "@echo off\n\nset XsdPath=C:\\schemas\nset OutPath=%XsdPath%\\Code\nset ExePath=C:\\Progra~1\\Xsd2Code\nset Namespace=In...
2008/12/22
[ "https://Stackoverflow.com/questions/386155", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6399/" ]
386,162
<p>If i SELECT a row for updating in MS SQL Server, and want to have it locked till i either update or cancel, which option is better :-</p> <p>1) Use a query hint like UPDLOCK 2) Use REPEATABLE READ isolation level for the transaction 3) any other option.</p> <p>Thanks, Chak.</p>
[ { "answer_id": 386301, "author": "HTTP 410", "author_id": 13118, "author_profile": "https://Stackoverflow.com/users/13118", "pm_score": 3, "selected": false, "text": "BEGIN TRAN\n\nSELECT *\nFROM authors AU\nWITH (HOLDLOCK, ROWLOCK)\nWHERE AU.au_id = '274-80-9391'\n\n/* Do all your ...
2008/12/22
[ "https://Stackoverflow.com/questions/386162", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
386,174
<p>Steps:<br /> - Installed Mysql Server 2005 <br /> - Downloaded Mysql++, built both debug and release version.<br /> - Ran install.hta and selected a directory<br /> - Added library/include directory in MSVC++ 2008<br /> - Included mysql++.h in my application<br /> - Moved .dll files (libMYSQL.dll and mysqlpp.dll and mysqlpp_d.dll) to Debug folder.<br /></p> <p>Relevant code:<br /></p> <pre><code>#include "mysql++.h" class Database { private: mysqlpp::Connection* conn; public: ~Database(); bool Connect(char* ip, char* user, char* pass, char* db); }; bool Database::Connect(char* ip, char* user, char* pass, char* db) { conn = new mysqlpp::Connection(false); return conn-&gt;connect(db, ip, user, pass); } Database::~Database() { if(conn) { delete[] conn; } } </code></pre> <p>Problem:</p> <pre><code>Database db; db.Connect("127.0.0.1", "root", "mypassword", "mydb"); </code></pre> <p>This will <em>always</em> return to false, even though I am using the exact same credentials with MySQL Administrator and logging in correctly.</p> <p>Help :(</p>
[ { "answer_id": 414081, "author": "Martin York", "author_id": 14065, "author_profile": "https://Stackoverflow.com/users/14065", "pm_score": 2, "selected": false, "text": "mysqlpp::Connection* conn;\n mysqlpp::Connection conn;\n * Constructor\n* Copy Constructor\n* Assignment Operator\n* D...
2008/12/22
[ "https://Stackoverflow.com/questions/386174", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
386,183
<p>i have a sub with this signature</p> <pre><code>Public Sub Save(ByVal obj As IPta) </code></pre> <p>now i want the create a instance of Generic.PtaDao(of T) with the type of obj, which could be anything that inherits from my base class Pta</p> <p>how can i do that? i already found a c# example <a href="https://stackoverflow.com/questions/307984/declare-a-generic-type-instance-dynamically">Declare a generic type instance dynamically</a></p> <p>but i dont understand how to implement this in my case.</p> <p>tia</p> <p>-edit-</p> <p>to clearify</p> <p>lets pretend obj is a object of type Address (Address inherits from Pta so it implements IPta)</p> <p>now i want to create a new PtaDao object that takes Address objects for example</p> <pre><code>Dim AddressDao as New Generic.PtaDao(of Address) </code></pre> <p>but i want to do this dynamically so if obj is of type UserGroup it should create a PtaDao(of UserGroup)</p>
[ { "answer_id": 386267, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 3, "selected": true, "text": "Public Sub Save(Of T As { IPta, New })(ByVal obj As T)\n Dim foo As New T\n ' Do more stuff here\nEnd Sub\n" }, ...
2008/12/22
[ "https://Stackoverflow.com/questions/386183", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12406/" ]
386,189
<p>Is there any way that I could get the source of a website (as a string preferably), let's say www.google.com, from some c# code inside code behind of asp.net website?</p> <p>edit: of course i mean html code - in every browser you can view it using "view <strong>source</strong>" in context menu.</p>
[ { "answer_id": 386217, "author": "Darin Dimitrov", "author_id": 29407, "author_profile": "https://Stackoverflow.com/users/29407", "pm_score": 4, "selected": true, "text": "class Program\n{\n static void Main(string[] args)\n {\n using (WebClient client = new WebClient())\n ...
2008/12/22
[ "https://Stackoverflow.com/questions/386189", "https://Stackoverflow.com", "https://Stackoverflow.com/users/40872/" ]
386,200
<p>So my goal here is to have a single search field in an application that will be able to search multiple tables and return results.</p> <p>For example, two of these tables are "performers" and "venues" and there are the following performers: "John Andrews","Andrew Smith","John Doe" and the following venues: "St. Andrew's Church","City Hall". Is there a way to somehow return the first two performers and the first venue for a search of "Andrew"?</p> <p>My first thought was to somehow get all the tables aggregated into a single table with three columns; "SearchableText","ResultType","ResultID". The first column would contain whatever I want searched (e.g. Performer name), the second would say what is being shown (e.g. Performer) and the third would say the item's ID (note: all my tables have auto-incrementing primary keys for ease). The question for this idea is it possible to somehow do this dynamically or do I have to add code to have a table that automatically fills whenever a new row is updated/added/deleted from the performers and venues table (perhaps via trigger?).</p> <p>My application is written in MSAccess (I know, I know, but I have no choice) on top of a SQL Server backend. I'd prefer this happen through MSAccess so I don't have to have a "searchme" table sitting on my SQL Server but any good result is acceptable :)</p>
[ { "answer_id": 388134, "author": "David-W-Fenton", "author_id": 9787, "author_profile": "https://Stackoverflow.com/users/9787", "pm_score": 0, "selected": false, "text": " SELECT tblPerson.PersonID, tblPerson.LastName & \", \" & tblPerson.FirstName, \"Person\"\n FROM tblPerson \n WHER...
2008/12/22
[ "https://Stackoverflow.com/questions/386200", "https://Stackoverflow.com", "https://Stackoverflow.com/users/428190/" ]
386,211
<p>I posted this <a href="https://stackoverflow.com/questions/385442/linq-submitchanges-not-updating-certain-fields">question</a> yesterday evening, which has led me to discover a <strong>huge</strong> problem!</p> <p>I have a decimal column in my database called Units, anytime I set the value of the column to a NON ZERO, and SubmitChanges the column updates with the new value. If I try to set the value of the column to ZERO, the SubmitChanges does not update the column.</p> <pre><code>data.Units = this.ReadProperty&lt;decimal&gt;(UnitsProperty); data.UnitPrice = this.ReadProperty&lt;decimal&gt;(UnitPriceProperty); data.Price = this.ReadProperty&lt;decimal&gt;(PriceProperty); </code></pre> <p>I've taken a look at the DataContext log and I can see that the field with the ZERO value is not included in the query. Even if I try to hard code the change Linq ignores it.</p> <pre><code>data.Units = 0; data.UnitPrice = 0; data.Price = 0; </code></pre> <p>Needless to say this is killing me! Any ideas why this happening?</p> <p><strong>Solution</strong></p> <p>I figured out my problem with the help of the SO community. My problem was being caused by the fact when I created my entity to attach, the default value of the column was set to zero, so when it tried to assign the value to zero ... LinqToSql says hey ... nothing changed, so I am not updating the value.</p> <p>What I am doing now ... just to make it work is the following:</p> <pre><code>ctx.DataContext.InvoiceItems.Attach(data, true); </code></pre> <p>That seems to force all the values to write themselves to the database. This works for now.</p>
[ { "answer_id": 386367, "author": "Gaspar Nagy", "author_id": 26530, "author_profile": "https://Stackoverflow.com/users/26530", "pm_score": 2, "selected": false, "text": "using (DataClasses1DataContext ctx = new DataClasses1DataContext())\n{\n var obj = ctx.DecimalColumnTables.First();...
2008/12/22
[ "https://Stackoverflow.com/questions/386211", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1768/" ]
386,220
<p>I have a bunch of compile time asserts, such as:</p> <pre><code>CASSERT(isTrue) or CASSERT2(isTrue, prefix_) </code></pre> <p>When compiling with GCC I get many warnings like <code>'prefix_LineNumber' defined but not used</code>. Is there a way I can hide warnings for compile time asserts? I had no luck searching the GCC documentation. I thought I might have the var automatically used globally inside the same macro but I couldn't think of any way to do it.</p> <p>Does anyone know of a way to hide that warning in GCC?</p>
[ { "answer_id": 386237, "author": "Tamas Czinege", "author_id": 8954, "author_profile": "https://Stackoverflow.com/users/8954", "pm_score": 2, "selected": false, "text": "-Wunused-label" }, { "answer_id": 386273, "author": "Community", "author_id": -1, "author_profile"...
2008/12/22
[ "https://Stackoverflow.com/questions/386220", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
386,252
<p>I want to keep the class simple and not defined a constructor so i can do Pt data = {0, 5}; so i figured the best way convert Pt_t from a short to long or vice versa is to do something like this.</p> <pre><code>template &lt;class T&gt; struct Pt_t { T x, y; template &lt;class T2&gt; operator Pt_t&lt;T2&gt;() { Pt_t pt = {x, y}; return pt; } }; </code></pre> <p>The compiler doesnt like this and calls operator Pt_t on return pt; thus getting a stack overflow. How do i prevent this? the only solution i can think of is having Pt_t use constructors removing Pt_t pt = {1, 2}; which i prefer to keep if i can.</p>
[ { "answer_id": 386262, "author": "Lasse V. Karlsen", "author_id": 267, "author_profile": "https://Stackoverflow.com/users/267", "pm_score": 1, "selected": false, "text": "Pt_t<T2> Pt_t" }, { "answer_id": 386263, "author": "eduffy", "author_id": 7536, "author_profile":...
2008/12/22
[ "https://Stackoverflow.com/questions/386252", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
386,265
<p>At the root of my d: drive, TortoiseSVN is showing the question mark decorators on all the folders. The d: drive is not a SVN working copy. How do I remove the decorators?</p>
[ { "answer_id": 386279, "author": "Ken Gentle", "author_id": 8709, "author_profile": "https://Stackoverflow.com/users/8709", "pm_score": 5, "selected": true, "text": "c:\\*\n c:\\cygwin\\home\\me\\workspaces\\*\nc:\\dev\\*\nd:\\development\\*\n" } ]
2008/12/22
[ "https://Stackoverflow.com/questions/386265", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6013/" ]
386,281
<p>I have an HTML page with multiple checkboxes.</p> <p>I need one more checkbox by the name "select all". When I select this checkbox all checkboxes in the HTML page must be selected. How can I do this?</p>
[ { "answer_id": 386303, "author": "Can Berk Güder", "author_id": 2119, "author_profile": "https://Stackoverflow.com/users/2119", "pm_score": 8, "selected": false, "text": "<script language=\"JavaScript\">\nfunction toggle(source) {\n checkboxes = document.getElementsByName('foo');\n for...
2008/12/22
[ "https://Stackoverflow.com/questions/386281", "https://Stackoverflow.com", "https://Stackoverflow.com/users/48094/" ]
386,294
<p>What is the maximum length of a valid email address? Is it defined by any standard?</p>
[ { "answer_id": 574698, "author": "Dominic Sayers", "author_id": 63349, "author_profile": "https://Stackoverflow.com/users/63349", "pm_score": 11, "selected": true, "text": "Path = \"<\" [ A-d-l \":\" ] Mailbox \">\"\n" }, { "answer_id": 66187864, "author": "HoldOffHunger", ...
2008/12/22
[ "https://Stackoverflow.com/questions/386294", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20305/" ]
386,304
<p>I am working on a migration project, here we are migrating large set of C++ libraries from Mainframe to Solaris. We have complted migration sucessfully, but while running the application, some places it crashes with 'signal SEGV (no mapping at the fault address)'. </p> <p>Since the application supports on windows also, we checked with purify on windows. There are no memory leaks in the application and it works fine on windows.</p> <p>Can any one suggests, what could be the other reasons which may create this type of errors. Any tools for tracing this type of errors?</p>
[ { "answer_id": 386320, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 0, "selected": false, "text": "map<string,CDBBindParam,less<string> >m_BindMap;\n\n\n\nCNumString ns(CNumStringTraits(0,2,'0'));\nns = m_BindMap.size();\nstr...
2008/12/22
[ "https://Stackoverflow.com/questions/386304", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
386,307
<p>I have an access database with many tables. I am looking for a field which may or may not exist in one or many of the tables. How do I check if it exists or not? (without querying each table of course)</p>
[ { "answer_id": 386326, "author": "Paul Mitchell", "author_id": 38966, "author_profile": "https://Stackoverflow.com/users/38966", "pm_score": -1, "selected": false, "text": "SELECT * FROM sysobjects WHERE xtype = 'U' AND name = 'myTable'\n SELECT \n DISTINCT\n so.[name] AS 'Table',\...
2008/12/22
[ "https://Stackoverflow.com/questions/386307", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31132/" ]
386,308
<p>When creating a criteria for NHibernate all criteria are added as <code>AND</code>.</p> <p>For instance:</p> <pre><code>session.CreateCriteria(typeof(someobject)) .Add(critiera) .Add(other_criteria) </code></pre> <p>then end result will be</p> <pre><code>SELECT ... FROM ... WHERE criteria **AND** other_criteria </code></pre> <p>I would like to tell NHibernate to add the criterias as "OR"</p> <pre><code>SELECT ... FROM ... WHERE criteria **OR** other_criteria </code></pre> <p>Any help is appreciated</p>
[ { "answer_id": 386329, "author": "Jon Limjap", "author_id": 372, "author_profile": "https://Stackoverflow.com/users/372", "pm_score": 2, "selected": false, "text": "Restrictions.or session.CreateCriteria(typeof(someobject))\n .Add(critiera)\n .Add(other_criteria);\n other_criteria ...
2008/12/22
[ "https://Stackoverflow.com/questions/386308", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30719/" ]
386,315
<p>I am in the process of refactoring our BI layers to make our code more "loosely coupled" and I was interested to hear what you guys thought might be interesting improvements to make?</p> <p>At present, our API is something like the following:-</p> <pre><code>// Fetch a collection of objects ProductCollection prods = Product.GetProducts(); // Load an individual object, make change and save it back Product p = new Product(); if(p.Load(productID)) { p.Name = "New Name"; p.Save(); } </code></pre> <p>As you can see, our methods for fetching collections of objects/loading individual objects and saving changes are all built into the "Model" class. Each of our Model classes inherits from an ObjectBase base class which includes DB access functions and change tracking so when someone changes a value through a property the object is automatically marked dirty and notifications are fired to whatever object (UI) has subscribed to those events. </p> <p>What I would like to do is use the "Repository pattern" so that we can abstract the Database implementation away from the Model. However, much of the code I have been looking at seems to suggest that the "Model" class should not contain any intelligence and should just be a container for data. Instead, the logic should be applied through the use of services. Does this then mean to accomplish the above I would need to do something like</p> <pre><code>List&lt;Product&gt; prods = ProductService.GetProducts(); Product p = ProductService.GetSingleProduct(productID); p.Name = "New Name"; ProductService.SaveProduct(p); </code></pre> <p>This seems a more complex way of doing it and makes it harder to encapsulate functionality within business objects.</p> <p>Can someone explain why this is a better way of doing it or maybe have I misunderstood the concepts?</p> <p>Thanks</p> <p>James</p>
[ { "answer_id": 386443, "author": "Marco Tolk", "author_id": 23764, "author_profile": "https://Stackoverflow.com/users/23764", "pm_score": 4, "selected": true, "text": "Repository.Save(ObjectOfAnyType);\n" } ]
2008/12/22
[ "https://Stackoverflow.com/questions/386315", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38911/" ]
386,319
<p>Hi I'm trying to fix a bit of test html to work with opera/chrome. It's using the <a href="http://www.alistapart.com/articles/holygrail" rel="nofollow noreferrer">holygrail box model from matt levine</a>. </p> <p>In IE and firefox it looks like</p> <p><a href="http://img187.imageshack.us/img187/4049/writedn1.jpg" rel="nofollow noreferrer">correct layout http://img187.imageshack.us/img187/4049/writedn1.jpg</a></p> <p>In chrome, opera and safari it pushes the sidebar element down. I've played with the margin and paddings but it still doesn't work. am I missing something?</p> <p><a href="http://img73.imageshack.us/img73/6279/wrongpx8.jpg" rel="nofollow noreferrer">wrong layout http://img73.imageshack.us/img73/6279/wrongpx8.jpg</a></p> <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"&gt; &lt;html&gt; &lt;head&gt; &lt;style type="text/css"&gt; body { min-width:500px; padding: 0 106px; } #center, #left, #right,#sidebar,#main { position:relative; float:left; } #center { width:100%; background:#CCC; } #left { width:106px; margin-left: -100%; right:106px; background:#C0C; } #right { width:106px; margin-right: -106px; background:#CC0; } #header{ width:100%; background:#0CC; } #footer{ width:100%; background:#A0E; clear:both; } #content{ padding-right:330px; background:#F00; } #main{ width:100%; padding:5px 15px; } #sidebar{ width:300px; margin-right: -300px; background:#33C; } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="center"&gt; &lt;div id="header"&gt;header&lt;/div&gt; &lt;div id="content"&gt; &lt;div id="main"&gt; copy &lt;/div&gt; &lt;div id="sidebar"&gt; side &lt;/div&gt; &lt;/div&gt; &lt;div id="footer"&gt;footer&lt;/div&gt; &lt;/div&gt; &lt;div id="left"&gt; left &lt;/div&gt; &lt;div id="right"&gt; right &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
[ { "answer_id": 386501, "author": "zenazn", "author_id": 46848, "author_profile": "https://Stackoverflow.com/users/46848", "pm_score": 3, "selected": true, "text": "#content{\n padding-right:300px;\n background:#F00;\n}\n#main{\n padding:5px 15px;\n width: 100%;\n ...
2008/12/22
[ "https://Stackoverflow.com/questions/386319", "https://Stackoverflow.com", "https://Stackoverflow.com/users/253/" ]
386,321
<p>I am html page with 5 checkboxes</p> <p>My requirement is to have one morecheckboxes "Select All" which is used to select all 5 checkboxes.</p> <p>Thanks in advance</p> <p><strong>Closed</strong> as exact duplicate of <a href="https://stackoverflow.com/questions/386281/how-to-implement-select-all-check-box-in-html">this question</a>.</p>
[ { "answer_id": 386332, "author": "Mark Carpenter", "author_id": 47645, "author_profile": "https://Stackoverflow.com/users/47645", "pm_score": 2, "selected": false, "text": "function CheckAll(value){\n document.getElementByID(\"CheckBox1\").checked = value;\n document.getElementByID...
2008/12/22
[ "https://Stackoverflow.com/questions/386321", "https://Stackoverflow.com", "https://Stackoverflow.com/users/48094/" ]
386,341
<p>I have a ticks value of 28000000000 which should be 480 minutes but how can I be sure? How do I convert a ticks value to minutes?</p>
[ { "answer_id": 386351, "author": "thinkbeforecoding", "author_id": 47001, "author_profile": "https://Stackoverflow.com/users/47001", "pm_score": 5, "selected": false, "text": "TimeSpan duration = new TimeSpan(tickCount)\ndouble minutes = duration.TotalMinutes;\n" }, { "answer_id"...
2008/12/22
[ "https://Stackoverflow.com/questions/386341", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
386,345
<p>Socket has a constructor that takes a winsock SOCKET as parameter and stores it in a private variable:</p> <pre><code>Socket::Socket(SOCKET s) { this-&gt;s = s; } </code></pre> <p>I'm trying to make a class "GameSocket" that will parse data from my Socket class:</p> <pre><code>class GameSocket : public Socket { protected: void ParseData(unsigned char* data, int size); }; </code></pre> <p>Next to these classes, I have a "Server" class that creates new sockets when needed:</p> <pre><code>GameSocket* Server::Accept() { SOCKET a = accept(s, 0, 0); if(a==SOCKET_ERROR) { return 0; } else { return new GameSocket(a); } } </code></pre> <p>However, this gives me an error on the last "else":</p> <pre><code>error C2664: 'GameSocket::GameSocket' : cannot convert parameter 1 from 'SOCKET' to 'const GameSocket &amp;' </code></pre> <p>I must be missing something with constructors when dealing with derived classes...</p> <p>Don't go too hard on me, I'm relatively new to C++ and OOP</p>
[ { "answer_id": 386365, "author": "David Allan Finch", "author_id": 27417, "author_profile": "https://Stackoverflow.com/users/27417", "pm_score": 4, "selected": true, "text": "class GameSocket : public Socket {\n\npublic:\n\n // you need to add\n GameSocket(SOCKET s) : Socket(s) {}\...
2008/12/22
[ "https://Stackoverflow.com/questions/386345", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
386,374
<p>What is the best way to encrypt a value in INI file?</p> <p>Using Encryption/Decryption key??</p>
[ { "answer_id": 386595, "author": "Dutch Masters", "author_id": 42037, "author_profile": "https://Stackoverflow.com/users/42037", "pm_score": 2, "selected": false, "text": "import random\nimport base64\ndef tinycode(key, text, reverse=False):\n \"(de)crypt stuff\"\n rand = random.Ra...
2008/12/22
[ "https://Stackoverflow.com/questions/386374", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
386,377
<p>I'm trying to produce a pretty simple XML schema for an XML similar to the following:</p> <pre><code>&lt;messages&gt; &lt;item&gt; &lt;important_tag&gt;&lt;/important_tag&gt; &lt;/item&gt; &lt;item&gt; &lt;important_tag&gt;&lt;/important_tag&gt; &lt;tag2&gt;&lt;/tag2&gt; &lt;/item&gt; &lt;item&gt; &lt;tag2&gt;&lt;/tag2&gt; &lt;tag3&gt;&lt;/tag3&gt; &lt;/item&gt; &lt;/messages&gt; </code></pre> <p>The idea is that <code>&lt;important_tag&gt;</code> will have a specific definition AND it may or may not appear under <code>&lt;item&gt;</code>. It may also appear more than once. Additionally, there may be other tags before or after <code>&lt;important_tag&gt;</code> that I can not name in advance.</p> <p>I would like to give a specific definition for <code>&lt;important_tag&gt;</code>. For example, define attributes that it must contain. What I mean is that <strong>if</strong> important_tag is present it must conform to my definition. Any other tag doesn't have to conform to any definition.</p> <p>I tried using the following scheme:</p> <pre><code>&lt;xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt; &lt;xs:element name="messages"&gt; &lt;xs:complexType&gt; &lt;xs:sequence&gt; &lt;xs:element ref="item" maxOccurs="unbounded"/&gt; &lt;/xs:sequence&gt; &lt;/xs:complexType&gt; &lt;/xs:element&gt; &lt;xs:element name="item"&gt; &lt;xs:complexType&gt; &lt;xs:sequence&gt; &lt;xs:element ref="important_tag" minOccurs="0"/&gt; &lt;xs:any minOccurs="0"/&gt; &lt;/xs:sequence&gt; &lt;/xs:complexType&gt; &lt;/xs:element&gt; &lt;xs:element name="important_tag"&gt; &lt;xs:complexType&gt; &lt;xs:simpleContent&gt; ... specific definitions for important_tag ... &lt;/xs:simpleContent&gt; &lt;/xs:complexType&gt; &lt;/xs:element&gt; &lt;/xs:schema&gt; </code></pre> <p>This results in an error saying that the schema is ambiguous.</p> <p>The exact error message is: </p> <pre><code>cos-nonambig: '&lt;xs:element ref="important_tag"&gt;' makes the content model non-deterministic against '&lt;xs:any&gt;'. Possible causes: name equality, overlapping occurrence or substitution groups. </code></pre> <p>I'm using Altova's XML Spy.</p> <p>How do I solve this?</p> <p>Thanks, Dana</p>
[ { "answer_id": 407546, "author": "13ren", "author_id": 50979, "author_profile": "https://Stackoverflow.com/users/50979", "pm_score": 4, "selected": true, "text": "<xs:element ref=\"important_tag\" minOccurs=\"0\"/>\n<xs:any minOccurs=\"0\"/>\n <important_tag> <important_tag></important...
2008/12/22
[ "https://Stackoverflow.com/questions/386377", "https://Stackoverflow.com", "https://Stackoverflow.com/users/48369/" ]
386,378
<p>Answers provided have all been great, I mentioned in the comments of Alnitak's answer that I would need to go take a look at my CSV Generation script because for whatever reason it wasn't outputting UTF-8. </p> <p>As was correctly pointed out, it WAS outputting UTF-8 - the problem existed with Ye Olde Microsoft Excel which wasn't picking up the encoding the way I would have liked.</p> <p>My existing CSV generation looked something like:</p> <pre><code>// Create file and exit; $filename = $file."_".date("Y-m-d_H-i",time()); header("Content-type: application/vnd.ms-excel"); header("Content-disposition: csv" . date("Y-m-d") . ".csv"); header( "Content-disposition: filename=".$filename.".csv"); echo $csv_output; </code></pre> <p>It now looks like:</p> <pre><code>// Create file and exit; $filename = $file."_".date("Y-m-d_H-i",time()); header("Content-type: text/csv; charset=ISO-8859-1"); header("Content-disposition: csv" . date("Y-m-d") . ".csv"); header("Content-disposition: filename=".$filename.".csv"); echo iconv('UTF-8', 'ISO-8859-1', $csv_output); </code></pre> <h2>-------------------------------------------------------</h2> <p><strong>ORIGINAL QUESTION</strong></p> <p>Hi,</p> <p>I've got a form which collects data, form works ok but I've just noticed that if someone types or uses a '£' symbol, the MySQL DB ends up with '£'.</p> <p>Not really sure where or how to stop this from happening, code and DB information to follow:</p> <p><strong>MySQL details</strong></p> <pre><code>mysql&gt; SHOW COLUMNS FROM fraud_report; +--------------+--------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +--------------+--------------+------+-----+---------+----------------+ | id | mediumint(9) | | PRI | NULL | auto_increment | | crm_number | varchar(32) | YES | | NULL | | | datacash_ref | varchar(32) | YES | | NULL | | | amount | varchar(32) | YES | | NULL | | | sales_date | varchar(32) | YES | | NULL | | | domain | varchar(32) | YES | | NULL | | | date_added | datetime | YES | | NULL | | | agent_added | varchar(32) | YES | | NULL | | +--------------+--------------+------+-----+---------+----------------+ 8 rows in set (0.03 sec) </code></pre> <p><strong>PHP Function</strong></p> <pre><code>function processFraudForm($crm_number, $datacash_ref, $amount, $sales_date, $domain, $agent_added) { // Insert Data to DB $sql = "INSERT INTO fraud_report (id, crm_number, datacash_ref, amount, sales_date, domain, date_added, agent_added) VALUES (NULL, '$crm_number', '$datacash_ref', '$amount', '$sales_date', '$domain', NOW(), '$agent_added')"; $result = mysql_query($sql) or die (mysql_error()); if ($result) { $outcome = "&lt;div id=\"success\"&gt;Emails sent and database updated.&lt;/div&gt;"; } else { $outcome = "&lt;div id=\"error\"&gt;Something went wrong!&lt;/div&gt;"; } return $outcome; } </code></pre> <p><strong>Example DB Entry</strong></p> <pre><code>+----+------------+--------------+---------+------------+--------------------+---------------------+------------------+ | id | crm_number | datacash_ref | amount | sales_date | domain | date_added | agent_added | +----+------------+--------------+---------+------------+--------------------+---------------------+------------------+ | 13 | 100xxxxxxx | 10000000 | £10.93 | 18/12/08 | blargh.com | 2008-12-22 10:53:53 | agent.name | </code></pre>
[ { "answer_id": 386396, "author": "Alnitak", "author_id": 6782, "author_profile": "https://Stackoverflow.com/users/6782", "pm_score": 5, "selected": true, "text": "0x00a3 0xc2 0xa3" }, { "answer_id": 4150271, "author": "Ben", "author_id": 439008, "author_profile": "htt...
2008/12/22
[ "https://Stackoverflow.com/questions/386378", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42428/" ]
386,380
<p>I've a table with a lot of registers (more than 2 million). It's a transaction table but I need a report with a lot of joins. Whats the best practice to index that table because it's consuming too much time.</p> <p>I'm paging the table using the storedprocedure paging method but I need an index because when I want to export the report I need to get the entire query without pagination and to get the total records I need a select all.</p> <p>Any help?</p>
[ { "answer_id": 386602, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 1, "selected": false, "text": " SELECT \n TBL.*\n FROM\n FOREINGDATABASE..TABLENAME TBL\n LEFT JOIN Status S \n ...
2008/12/22
[ "https://Stackoverflow.com/questions/386380", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
386,465
<p>I'm looking to rewrite a pretty intensive CRUD type ASP.NET page to utilize ajax calls (specifically jQuery ajax). My concern in doing this is that the user may be on this page longer than the forms authentication timeout. Because of this, I'm thinking that I should extend the forms authentication ticket with each ajax call (basically how it does in a normal web forms submit model). So the questions:</p> <p>Is this even a valid concern? If so, would writing a jQuery plugin to extend the forms authentication timeout be possible? Does one already exist? Would using ASP.NET AJAX be a better approach?</p> <p>Any comments\help would be appreciated.</p>
[ { "answer_id": 387021, "author": "Trick Jarrett", "author_id": 12073, "author_profile": "https://Stackoverflow.com/users/12073", "pm_score": -1, "selected": false, "text": "$.ajax('ajax.php',{timeout: 60000},function (data) {\nalert(data);\n}\n" }, { "answer_id": 7231326, "au...
2008/12/22
[ "https://Stackoverflow.com/questions/386465", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17692/" ]
386,476
<p>I have a table where I'm storing Lat/Long coordinates, and I want to make a query where I want to get all the records that are within a distance of a certain point.</p> <p>This table has about 10 million records, and there's an index over the Lat/Long fields</p> <p>This does not need to be precise. Among other things, I'm considering that 1 degree Long == 1 degree Lat, which I know is not true, but the ellipse I'm getting is good enough for this purpose.</p> <p>For my examples below, let's say the point in question is [40, 140], and my radius, in degrees, is 2 degrees.</p> <p>I've tried this 2 ways: </p> <hr> <p>1) I created a UDF to calculate the Square of the Distance between 2 points, and I'm running that UDF in a query.</p> <pre><code>SELECT Lat, Long FROM Table WHERE (Lat BETWEEN 38 AND 42) AND (Long BETWEEN 138 AND 142) AND dbo.SquareDistance(Lat, Long, 40, 140) &lt; 4 </code></pre> <p>I'm filtering by a square first, to speed up the query and let SQL use the index, and then refining that to match only the records that fall within the circle with my UDF.</p> <hr> <p>2) Run the query to get the square (same as before, but without the last line), feed ALL those records to my ASP.Net code, and calculate the circle in the ASP.Net side (same idea, calculate the square of the distance to save the Sqrt call, and compare to the square of my radius).</p> <hr> <p>To my suprise, calculating the circle in the .Net side is about 10 times faster than using the UDF, which leads me to believe that I'm doing something horribly wrong with that UDF...</p> <p>This is the code I'm using:</p> <pre><code>CREATE FUNCTION [dbo].[SquareDistance] (@Lat1 float, @Long1 float, @Lat2 float, @Long2 float) RETURNS float AS BEGIN -- Declare the return variable here DECLARE @Result float DECLARE @LatDiff float, @LongDiff float SELECT @LatDiff = @Lat1 - @Lat2 SELECT @LongDiff = @Long1 - @Long2 SELECT @Result = (@LatDiff * @LatDiff) + (@LongDiff * @LongDiff) -- Return the result of the function RETURN @Result END </code></pre> <p>Am I missing something here?<br> Shouldn't using a UDF within SQL Server be much faster than feeding about 25% more records than necessary to .Net, with the overhead of the DataReader, the communication between processes and whatnot?</p> <p>Is there something I'm doing horribly wrong in that UDF that makes it run slow?<br> Is there any way to improve it?</p> <p>Thank you very much!</p>
[ { "answer_id": 386522, "author": "George Mastros", "author_id": 1408129, "author_profile": "https://Stackoverflow.com/users/1408129", "pm_score": 3, "selected": true, "text": "CREATE FUNCTION [dbo].[SquareDistance] \n(@Lat1 float, @Long1 float, @Lat2 float, @Long2 float)\nRETURNS float\n...
2008/12/22
[ "https://Stackoverflow.com/questions/386476", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3314/" ]
386,484
<p>I don't want my window to be resized either "only horizontally" or "only vertically." Is there a property I can set on my window that can enforce this, or is there a nifty code-behind trick I can use?</p>
[ { "answer_id": 387110, "author": "Gant", "author_id": 12460, "author_profile": "https://Stackoverflow.com/users/12460", "pm_score": 4, "selected": false, "text": "<Window x:Class=\"TestWPF.Window1\"\n xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"\n xmlns:x=\"h...
2008/12/22
[ "https://Stackoverflow.com/questions/386484", "https://Stackoverflow.com", "https://Stackoverflow.com/users/47645/" ]
386,487
<p>How do I best capture the HTML (in my instance, for logging) rendered by an aspx-page?</p> <p>I dont want to have to write back to the page using Response.Write, since it messes up my site layout.</p> <p>Using the Response.OutputStream or Response.Output's stream results in an ArgumentException ({System.ArgumentException: Stream was not readable.)</p>
[ { "answer_id": 386502, "author": "annakata", "author_id": 13018, "author_profile": "https://Stackoverflow.com/users/13018", "pm_score": 2, "selected": false, "text": "public class ObserverStream : Stream\n{\n private byte[] buffer = null;\n private Stream observed = null;\n\n public O...
2008/12/22
[ "https://Stackoverflow.com/questions/386487", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33067/" ]
386,493
<p>There is one aspect of TDD which I never fully understood.</p> <p>Suppose somebody asked you to implement a simple Stack object. If you've done your design properly, you will come to a very minimal and clean API. Suppose: <code>push()</code>, <code>pop()</code> and <code>isEmpty()</code>. Anything more than that is over-killing the demand, and allowing the user too much room to mess with your code.</p> <p>So now let's suppose you want to unit test your code. How do you go about doing this if all your public methods are just the three shown above? Those methods will take your testing only so far.</p> <p>So either you add private methods, which do not help you at all since they are not visible to your unit test case. Or you make those methods public and there goes your minimalistic API which you worked on so hard. Now the user is going to mess with your Stack and the bugs will be sure to come.</p> <p>How do you handle this dilemma of opening public methods for testing vs. a clean and simple API?</p> <p><strong>Edit:</strong> just to point in the right direction, It would be nice to get technical pointers (such as "use this hack to expose private methods", etc...) but I am much more intrested in more generic answers as to what of the two concepts is more important, and how you approach this subject.</p>
[ { "answer_id": 386586, "author": "James Gregory", "author_id": 27206, "author_profile": "https://Stackoverflow.com/users/27206", "pm_score": 2, "selected": false, "text": "[Test]\npublic void new_instance_should_be_empty()\n{\n var stack = new Stack();\n\n Assert.That(stack.IsEmpty(), ...
2008/12/22
[ "https://Stackoverflow.com/questions/386493", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24545/" ]
386,495
<p>How do you determine if a letter is in the range from A-Z or Digit 0-9? We are getting some corrupted data "I_999Š=ÄÖÆaðøñòòñ".</p> <p>I thought I could use Char.IsLetterOrDigit("Š") to ID the corrupted data from "I_999Š", but unexpectedly this is returning true. I need to trap this, any thoughts?</p>
[ { "answer_id": 386528, "author": "P Daddy", "author_id": 36388, "author_profile": "https://Stackoverflow.com/users/36388", "pm_score": 1, "selected": false, "text": "For Each m As Match In Regex.Matches(\"I_999Š=ÄÖÆaðøñòòñ\", \"[^A-Z0-9]\")\n '' Found a bad character\nNext\n For Each ...
2008/12/22
[ "https://Stackoverflow.com/questions/386495", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38349/" ]
386,500
<p>How can I initialize a list containing generic objects whose types can be different?</p> <p>For example, I have the following:</p> <pre><code>this.Wheres = new List&lt;Where&lt;&gt;&gt;(); </code></pre> <p>As you know, &lt;> is not valid syntax. However, sometimes the type passed to Where will be a string and sometimes it will be DateTime, etc. I tried using object as the initialized type, but that doesn't work either.</p>
[ { "answer_id": 386508, "author": "Sergio", "author_id": 32037, "author_profile": "https://Stackoverflow.com/users/32037", "pm_score": 1, "selected": false, "text": "this.Wheres = new List<Object>();\n" }, { "answer_id": 386514, "author": "Jon Skeet", "author_id": 22656, ...
2008/12/22
[ "https://Stackoverflow.com/questions/386500", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31516/" ]
386,506
<p>I am having a problem with binding values in my ActionScript components. I basically want to set the value of a a variable in my component to a value in the model, and have the component variable automatically update when the model value is updated. I think that I just don't fully understand how data binding works in Flex - this is not a problem when using MXML components, but, when using ActionScript classes, the binding does not work.</p> <p>This is the code I'm using, where the values are not binding:</p> <pre><code>package { public class Type1Lists extends TwoLists { public function Type1Lists() { super(); super.availableEntities = super.composite.availableType1Entities; super.selectedEntities = super.composite.selectedType1Entities; } } } package { public class Type2Lists extends TwoLists { public function Type2Lists() { super(); super.availableEntities = super.composite.availableType2Entities; super.selectedEntities = super.composite.selectedType2Entities; } } } /* TwoLists.mxml */ &lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml"&gt; &lt;mx:Script&gt; &lt;![CDATA[ public var __model:ModelLocator = ModelLocator.getInstance(); public var composite:Composite = __model.selectedComposite; [Bindable] public var availableEntities:ArrayCollection; [Bindable] public var selectedEntities:ArrayCollection; ]]&gt; &lt;/mx:Script&gt; &lt;mx:List id="availableEntitiesList" dataProvider="{availableEntities}" /&gt; &lt;mx:List id="selectedEntitiesList" dataProvider="{selectedEntities}" /&gt; &lt;/mx:HBox&gt; </code></pre>
[ { "answer_id": 474866, "author": "Eric Belair", "author_id": 31298, "author_profile": "https://Stackoverflow.com/users/31298", "pm_score": 2, "selected": true, "text": "/* Type1Lists.mxml */\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<TwoLists xmlns:mx=\"http://www.adobe.com/2006/mxml\...
2008/12/22
[ "https://Stackoverflow.com/questions/386506", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31298/" ]
386,520
<p>Just as the title says, I see a lot of editors touting macro recording as a feature but cannot find a way to take advantage of these functions myself. So what can you use it for? The type where you can record mouse movement and/or keystrokes? Is it really that helpful to people out there? Specifically, I deal with Eclipse which has a number of built in "fill in" functions, so I really don't see what the advantages could be.</p>
[ { "answer_id": 386541, "author": "Charlie Martin", "author_id": 35092, "author_profile": "https://Stackoverflow.com/users/35092", "pm_score": 3, "selected": true, "text": "C-x ( C-n C-a C-x ) C-x e C-u C-x e" }, { "answer_id": 386551, "author": "rjzii", "author_id": 1185,...
2008/12/22
[ "https://Stackoverflow.com/questions/386520", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16631/" ]
386,544
<p>Just wondering if there is any best practice for DAL to represent null value (from a nullable column).</p> <p>We currently have our own in-house DAL and are representing null value with int.MinValue. However, this rise concerns with developers thinking that when comparing values, we are purposely imposing another "added" value onto int.MinValue and the fact that int.MinValue is used for null value in a DAL layer is confusing. So other come up with the NullValue from .net 2.0, but we found out that there are performance and syntax issue related to this approach too:</p> <ul> <li><a href="http://www.zorched.net/2005/11/17/net-nullable-types-and-dbnull-expose-design-flaws/" rel="nofollow noreferrer">zorched.net: .NET Nullable Types and DBNull Expose Design Flaws</a></li> <li><a href="http://blogs.msdn.com/bclteam/archive/2005/06/30/433852.aspx" rel="nofollow noreferrer">BCL Team Blog: Nullable Performance</a></li> <li><a href="http://www.megasolutions.net/cSharp/Webservice-with-optional-parameters-65795.aspx" rel="nofollow noreferrer">megasolutions.net: Webservice with optional parameters</a></li> <li><a href="http://www.dotnet2themax.com/blogs/fbalena/PermaLink,guid,1638cc2f-b9a5-4654-a2ab-2e484b80d290.aspx" rel="nofollow noreferrer">dotnet2themax.com: Inconsistent behavior of C# nullable types</a></li> </ul> <p>So, what's your take in this? How does other well-known ORM take care of null values? Is there even a best practice around this issue?</p>
[ { "answer_id": 386557, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 3, "selected": false, "text": "Nullable<int> int?" }, { "answer_id": 386967, "author": "Robert Rossney", "author_id": 19403, "autho...
2008/12/22
[ "https://Stackoverflow.com/questions/386544", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31206/" ]
386,554
<p>for a paper I'm looking for an <em>real-life</em> C function which uses volatile variables. That in itself is not hard to find, but I am looking for a function in which the value of the volatile variable must change <strong>during</strong> the course of the execution of the function, for a particular branch of the function to be reached. Something like this:</p> <pre><code>typedef struct { unsigned :6; unsigned FLAG1 :1; unsigned FLAG2 :1; } __attribute__ ((packed)) REGISTER; volatile REGISTER * io_ = 0x1234; int write_to_io() { while (io_-&gt;FLAG1) {}; //io_-&gt;FLAG1 is now 0 io_-&gt;FLAG2 = 1; sleep(10); if (io-&gt;FLAG1) return 1; //io-&gt;FLAG1 has changed from 0 to 1 else return 0; //io-&gt;FLAG1 has not changed } </code></pre> <p>It would be sufficient if different bits of the structure changed during the execution of the function, but my main criterion is that for a certain branch to be reached, the value of a volatile variable changes <strong>during</strong> the execution of the function.</p> <p>I'd be very grateful for any real-life examples. I haven't been able to find many examples using volatile on the web.</p>
[ { "answer_id": 386917, "author": "Johannes Schaub - litb", "author_id": 34509, "author_profile": "https://Stackoverflow.com/users/34509", "pm_score": 3, "selected": true, "text": "static int volatile busTimeoutSeen;\n\nint busTimeoutISR(int irq) {\n busTimeoutSeen = 1;\n return 1; /* ...
2008/12/22
[ "https://Stackoverflow.com/questions/386554", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21369/" ]
386,555
<p>We have a large enterprise consisting of many apps both old and new backed by Oracle 10G. When blocking sessions or deadlocks occur and we get trace reports it would be super handy to be able to have embedded some details in the sql so that we know both what app, and specifically where it was executed from. In addition to helping speed up the resolution time, it can help us find places where business processes were stepping on each other. We have a few thoughts on how this could be achieved, but I am curious if this is already a solved problem. Any thoughts or details on any successful (or otherwise) attempts would be appreciated.</p>
[ { "answer_id": 386669, "author": "Mr. Shiny and New 安宇", "author_id": 7867, "author_profile": "https://Stackoverflow.com/users/7867", "pm_score": 0, "selected": false, "text": "String sql = \"SELECT * FROM USERS WHERE ID = ?\";\nConnection con = getConnection();\nPreparedStatement ps = c...
2008/12/22
[ "https://Stackoverflow.com/questions/386555", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9192/" ]
386,559
<p>I need to delete a temporary file from my C++ windows application (developed in Borland C++ Builder). Currently I use a simple:</p> <pre><code>system("del tempfile.tmp"); </code></pre> <p>This causes a console window to flash in front of my app and it doesn't look very professional. How do I do this without the console window? </p>
[ { "answer_id": 386565, "author": "Paul Stephenson", "author_id": 5536, "author_profile": "https://Stackoverflow.com/users/5536", "pm_score": 5, "selected": true, "text": "#include <windows.h>" }, { "answer_id": 386572, "author": "SmacL", "author_id": 22564, "author_pr...
2008/12/22
[ "https://Stackoverflow.com/questions/386559", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2079/" ]
386,576
<p>I'm working on a multilingual flex application that has to run in 27+ languages, including asian, hebrew and arabic, as well as all european languages.</p> <p>We work with an embedded font (Myriad Pro) and have plenty of styles in a css that make use of that embedded font. We've tested with a modified version of Myriad including all non western unicode chars taken from Arial Unicode and it works ok, but the weight of the swf is unacceptable.</p> <p>We have this two lines in our css..</p> <pre><code>@font-face { src: url("MyriadPro-Semibold.otf"); fontFamily: "Default Font"; fontWeight: bold; advancedAntiAliasing: true; } @font-face { src: url("MyriadPro-Regular.otf"); fontFamily: "Default Font"; advancedAntiAliasing: true; } </code></pre> <p>and the rest of stlyes use the "Default Font" when needed.</p> <p>What is the best solution for implementing the multilingual apps with runtime loading fonts, while maintaining the current stylesheet?</p> <hr> <p>Yes, the languages are downloaded from the server when the user changes the language, but not the font.</p> <p>My concern is, if I have to download an asian font different from Myriad, how can say to flash, hey my "Default Font" is now this asian font. And if i have to display the language names, how can I display the asian names, without changing the list style...</p> <p>It's not easy.</p>
[ { "answer_id": 402446, "author": "Brandon", "author_id": 23133, "author_profile": "https://Stackoverflow.com/users/23133", "pm_score": 1, "selected": false, "text": "fontWeight=bold fontWeight=normal StyleManager.getStyleDeclaration(\"Button\").\n setStyle(\"color\",\"Blue\");...
2008/12/22
[ "https://Stackoverflow.com/questions/386576", "https://Stackoverflow.com", "https://Stackoverflow.com/users/48375/" ]
386,583
<p>I have a Java Applet (JApplet). This Applet uses a JComponent(PanelAux) to show values and images that change periodically. But the applet doesn't refresh itself. What can I do to refresh my applet? </p> <pre><code>//--------------------------------------------RUN public void run() while (true) { try { myThread.sleep(1000); } catch (InterruptedException e){ } repaint(); } } //--------------------------------------------PAINT public void paint(Graphics g) { dim = new Dimension(image.getWidth(this)+50,image.getHeight(this)+50); this.resize(dim); this.setMaximumSize(dim); this.setMinimumSize(dim); PanelAux panel = new PanelAux(image); //JComponent add(panel); super.paint(g); } </code></pre> <p>Thank you</p>
[ { "answer_id": 386605, "author": "Joachim Sauer", "author_id": 40342, "author_profile": "https://Stackoverflow.com/users/40342", "pm_score": 2, "selected": false, "text": "paint()" }, { "answer_id": 386673, "author": "coobird", "author_id": 17172, "author_profile": "h...
2008/12/22
[ "https://Stackoverflow.com/questions/386583", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
386,604
<p>I have a program where I generate bitstreams, of about 80 to 150 bits or so, which I would like to compress, because I'm going to turn them into some kind of ASCII string so people can transmit them around.</p> <p>Does anyone know of a good, free bit-aware compressor that might work on such a stream? My main problem with the "standard options" is this stream should really be treated as bits, not bytes, else the structure is lost, and their overhead swamps any gain.</p> <p>Addition:</p> <p>The reason I want to compress these streams is because users are going to be cutting+pasting them, probably using something like base64 encoding, so saving some data is helpful.</p> <p>Here is an example, for those who would like to see it. I'll add formatting to make it easier to read:</p> <pre><code>110 110 - This is a 6x6 grid (the maximum is 7x7, so we only need 3 bits!) 000000 011110 010010 010010 011110 000000 - This is one layout grid 000000 000000 001000 000100 000000 000000 - This is the second layout grid </code></pre> <p>Now we list some pieces</p> <pre><code>010 11111111 - A piece is a 3-bit colour code, then an 8-bit list of 'on / off' bits. 001 10101010 - Another bit! 001 10101010 - Another, identical bit! </code></pre> <p>The reason I say this should be considered 'as bits' is that there is obvious compression options when viewed as a bitstream (in particular, usually many 0s in the 'grid's), which disappear when you consider it as a byte-stream.</p>
[ { "answer_id": 395705, "author": "afeldspar", "author_id": 33904, "author_profile": "https://Stackoverflow.com/users/33904", "pm_score": 2, "selected": false, "text": "N N" } ]
2008/12/22
[ "https://Stackoverflow.com/questions/386604", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27074/" ]
386,609
<p>I have a text file with dos elements - hex(00) for example. I need to read it and convert it. I have tried to use <code>utf8toansi</code>, but this removes the whole line with hex(00). Are there any way to convert to text in the whole file ? I am using <code>win32</code>, <code>RadStudio2007</code>, <code>Delphi</code>.</p>
[ { "answer_id": 386654, "author": "mghie", "author_id": 30568, "author_profile": "https://Stackoverflow.com/users/30568", "pm_score": 2, "selected": false, "text": "procedure TForm1.Button1Click(Sender: TObject);\nvar\n FileStream: TStream;\n MemStream: TMemoryStream;\n P: PChar;\n s:...
2008/12/22
[ "https://Stackoverflow.com/questions/386609", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15138/" ]
386,612
<p>I'm learning how to use Greasemonkey, and was wondering what the <code>@namespace</code> metadata id is for. </p> <p>Does it have to be a web address? Or can it be a folder/directory on my computer? </p> <p>Does it even need to be filled in?</p>
[ { "answer_id": 386616, "author": "Joachim Sauer", "author_id": 40342, "author_profile": "https://Stackoverflow.com/users/40342", "pm_score": 7, "selected": true, "text": "foobar foobar http://somesite.com/ foobar http://anothersite.com mailto:someone@example.com" }, { "answer_id"...
2008/12/22
[ "https://Stackoverflow.com/questions/386612", "https://Stackoverflow.com", "https://Stackoverflow.com/users/41718/" ]
386,624
<p>I want to implement in my MFC application project this logic, which written in C# looks like:</p> <pre><code>XmlSerializer ser = new XmlSerializer(typeof(A_CLASS)); StringBuilder sb = new StringBuilder(); XmlWriterSettings sett = new XmlWriterSettings(); sett.Indent = true; sett.IndentChars = "\t"; using (XmlWriter sw = XmlWriter.Create(sb, sett)) { ser.Serialize(sw, A_CLASS_Instance); } </code></pre> <p>How can I write this in C++?</p>
[ { "answer_id": 386696, "author": "Reunanen", "author_id": 19254, "author_profile": "https://Stackoverflow.com/users/19254", "pm_score": 1, "selected": false, "text": "xml_oarchive xml_iarchive" } ]
2008/12/22
[ "https://Stackoverflow.com/questions/386624", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
386,652
<p>What are the tips/techniques when you need to persist classes with inheritance to relational database that doesn't support inheritance?</p> <p>Say I have this classic example:</p> <pre><code>Person -&gt; Employee -&gt; Manager -&gt; Team lead -&gt; Developer -&gt; Customer -&gt; PrivilegedCustomer -&gt; EnterpriseCustomer </code></pre> <p>What are the available techniques to design the database? Pros and cons of each?</p> <p>p.s. I have searched and found several question regarding database inheritance but most were about changing to a database engine that supports it natively. But let's say I'm stuck with SQL Server 2005... what are my options?</p>
[ { "answer_id": 386683, "author": "cliff.meyers", "author_id": 41754, "author_profile": "https://Stackoverflow.com/users/41754", "pm_score": 5, "selected": false, "text": "vehicle car airplane vehicle_id vehicle wingspan Airplane Car wingspan NULL" } ]
2008/12/22
[ "https://Stackoverflow.com/questions/386652", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3055/" ]
386,655
<p>Has anyone ever had code in Python, that turned out not to perform fast enough?</p> <p>I mean, you were forced to <em>choose another language</em> because of it?</p> <p>We are investigating using Python for a couple of larger projects, and my feeling is that in most cases, Python is plenty fast enough for most scenarios (compared to say, Java) because it relies on optimized C routines.</p> <p>I wanted to see if people had instances where they started out in Python, <strong>but</strong> ended up having to go with something else because of performance.</p> <p>Thanks. </p>
[ { "answer_id": 501942, "author": "RSabet", "author_id": 49219, "author_profile": "https://Stackoverflow.com/users/49219", "pm_score": 2, "selected": false, "text": "os.listdir os.stat" } ]
2008/12/22
[ "https://Stackoverflow.com/questions/386655", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42037/" ]
386,656
<p>Each client is identified by a hash, passed along with every request to the server. What's the best way to handle tracking a users session in this case?</p> <p>I'm using restful_authentication for user accounts etc. A large percentage of requests are expected to originate without a user account but just the unique hash.</p> <p>My understanding of the way handles sessions is limited so please bear that in mind. :)</p>
[ { "answer_id": 387213, "author": "zenazn", "author_id": 46848, "author_profile": "https://Stackoverflow.com/users/46848", "pm_score": 1, "selected": false, "text": "session session session[:user] = currently_logged_in_user.id\n# ... next request ...\nsession[:user] # returns the currentl...
2008/12/22
[ "https://Stackoverflow.com/questions/386656", "https://Stackoverflow.com", "https://Stackoverflow.com/users/46758/" ]
386,662
<p>I've been working on some data transformation tasks in SSIS. Visual Studio has gotten better in 2008 in it's usability, but I find there are some things that annoy me (i.e. When I delete something in the Package Explorer it refreshs the whole screen bringing me back to the top of the tree. Also, lack of some keyboard shortcuts.) Is there any other DTSx package editors out there or plug-ins for VS, and are they worth the trouble?</p>
[ { "answer_id": 387213, "author": "zenazn", "author_id": 46848, "author_profile": "https://Stackoverflow.com/users/46848", "pm_score": 1, "selected": false, "text": "session session session[:user] = currently_logged_in_user.id\n# ... next request ...\nsession[:user] # returns the currentl...
2008/12/22
[ "https://Stackoverflow.com/questions/386662", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37726/" ]
386,664
<p>I'm having a hard time with the setup statement in Python's timeit.Timer(stmt, setup_stmt). I appreciate any help to get me out of this tricky problem:</p> <p>So my sniplet looks like this:</p> <pre><code>def compare(string1, string2): # compare 2 strings if __name__ = '__main__': str1 = "This string has \n several new lines \n in the middle" str2 = "This string hasn't any new line, but a single quote ('), in the middle" t = timeit.Timer('compare(p1, p2)', "from __main__ import compare; p1=%s, p2=%s" % (str1,str2)) </code></pre> <p>I don't know how to escape the metacharacter in the variable str1, str2 without changing their meaning in the setup statement: </p> <pre><code>"from __main__ import compare; p1=%s, p2=%s" % (str1,str2) </code></pre> <p>I tried various combination but always have the following errors: SyntaxError: can't assign to literal<br> SyntaxError: EOL while scanning single-quoted string<br> SyntaxError: invalid syntax</p>
[ { "answer_id": 386718, "author": "S.Lott", "author_id": 10661, "author_profile": "https://Stackoverflow.com/users/10661", "pm_score": 4, "selected": true, "text": "t = timeit.Timer('compare(p1, p2)', \"from __main__ import compare; p1=%r; p2=%r\" % (str1,str2))\n %r" }, { "answer...
2008/12/22
[ "https://Stackoverflow.com/questions/386664", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8203/" ]
386,709
<p>Is this valid and correct?</p> <pre><code>RewriteRule ^myOldPage.html$ /index.php#info [R] </code></pre> <p>I'm specifically interested about the <code>#info</code> part.</p>
[ { "answer_id": 386739, "author": "adam", "author_id": 33604, "author_profile": "https://Stackoverflow.com/users/33604", "pm_score": 0, "selected": false, "text": "RewriteRule ^myOldPage.html$ /index.php?info=true [R]\n" }, { "answer_id": 386764, "author": "Chris Van Opstal", ...
2008/12/22
[ "https://Stackoverflow.com/questions/386709", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9021/" ]