qid
int64
4
22.2M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
264,685
<p>In CSS, with:</p> <pre><code>@page { @top-right { content: "Page " counter(page) " of " counter(pages); } } </code></pre> <p>I can have page numbers displayed at the top of every page when the page is printed. This works great. But now, how can I make it so the page number starts with 2 instead of 1? Can I do that by modifying the CSS rule above?</p>
[ { "answer_id": 264706, "author": "Treb", "author_id": 22114, "author_profile": "https://Stackoverflow.com/users/22114", "pm_score": -1, "selected": false, "text": "counter(page+1)" }, { "answer_id": 275099, "author": "schnaader", "author_id": 34065, "author_profile": ...
2008/11/05
[ "https://Stackoverflow.com/questions/264685", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5295/" ]
264,687
<p>You launch a java program from a console (maybe using a .bat script). I don't want the console to remain visible, I want to hide it.</p> <p>Is there a simple way to do this ? Without JNI ?</p>
[ { "answer_id": 264699, "author": "Lukman", "author_id": 34586, "author_profile": "https://Stackoverflow.com/users/34586", "pm_score": 3, "selected": false, "text": "start program" }, { "answer_id": 2780929, "author": "t3hnar", "author_id": 301517, "author_profile": "h...
2008/11/05
[ "https://Stackoverflow.com/questions/264687", "https://Stackoverflow.com", "https://Stackoverflow.com/users/155796/" ]
264,689
<p>So I want to trigger an event (pausing/unpausing some media) whenever the user presses spacebar anywhere in the my Swing app.</p> <p>Since there are so many controls and panels that could have focus, its not really possible to add keyevents to them all(not to mention gross).</p> <p>So I found </p> <pre><code>KeyboardFocusManager.getCurrentKeyboardFocusManager().addKeyEventDispatcher() </code></pre> <p>which is awesome, you can register global keypress pre-handlers. There's a major problem though - spaces will be typed all the time in input fields, table cells, etc, and I obviously dont want to trigger the pause event then!</p> <p>So any ideas? Perhaps there is way to detect globally whether the cursor is focused on something that allows text input, without having to check through a list of all the editable controls(vomit!)? </p>
[ { "answer_id": 266144, "author": "ykaganovich", "author_id": 10026, "author_profile": "https://Stackoverflow.com/users/10026", "pm_score": 1, "selected": false, "text": "KEY_EVENT_MASK" }, { "answer_id": 267044, "author": "dalyons", "author_id": 16925, "author_profile...
2008/11/05
[ "https://Stackoverflow.com/questions/264689", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16925/" ]
264,702
<p>I have built an application that uses SQL Express 2005 and I want to deploy it, but the problem is that anyone who has SQL Management Studio(or something like that) installed on his computer, can connect to my database and change it. Is there anyway to prevent end-users from seeing or editing the content of my database, even those with the Administrator privileges? </p>
[ { "answer_id": 264721, "author": "Ed Guiness", "author_id": 4200, "author_profile": "https://Stackoverflow.com/users/4200", "pm_score": 1, "selected": false, "text": "WITH ENCRYPTION\n" } ]
2008/11/05
[ "https://Stackoverflow.com/questions/264702", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34623/" ]
264,711
<p>Traditional logfile analytics tools (awstats, statcounter) or general web analytics (google analytics, yahoo web analytics) are not suitable for analyzing traffic on servlets. Is there a good alternative to log messages using a logging framework (log4j for example) and to write a custom analytics software for these?</p>
[ { "answer_id": 264721, "author": "Ed Guiness", "author_id": 4200, "author_profile": "https://Stackoverflow.com/users/4200", "pm_score": 1, "selected": false, "text": "WITH ENCRYPTION\n" } ]
2008/11/05
[ "https://Stackoverflow.com/questions/264711", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28578/" ]
264,714
<p>I am trying to use a business object that I am passing to the report.rdlc. The properties in my object are not directly exposed. The properties I require are embedded within another object inside the top level object. As this is a WCF project I can't control what goes on at the server end. I am just able to request these objects or Insert/Update/Delete their info from the database. It is done in this way as the back end can use multiple flavors of database. </p> <p>Here is what I can see after adding my business object as a <code>DataSource</code>:</p> <pre><code>-BusinessObject -CustomerInfo -ClientName -ColumnName -DisplayName -FieldName -IsNull -KeyColumn -SenondKeyColumn -StringValue -ClientID -ColumnName -DisplayName -FieldName -IntValue -IsNull -KeyColumn -SenondKeyColumn +ClientAddress +Instrument +Telephone </code></pre> <p>etc etc</p> <p>I need to be able to display, for example, the <code>ClientName.StringValue</code> field. If I drag the field I want onto the report I get: </p> <pre><code>=First(Fields!StringValue.Value) </code></pre> <p>This doesn't display anything when the report is run, I assume because it can't qualify what <code>StringValue</code> it is talking about and there could be many. </p> <p>If I try dragging the <code>ClientName</code> object I get:</p> <pre><code>=First(Fields!ContactName.Value) </code></pre> <p>However this gives:</p> <pre><code>#ERROR </code></pre> <p>When the report is run.</p> <p>I would have thought you could use:</p> <pre><code>=First(Fields!ClientName.StringValue.Value) </code></pre> <p>but this won't even let me build.</p>
[ { "answer_id": 274748, "author": "Matt Johnson", "author_id": 34628, "author_profile": "https://Stackoverflow.com/users/34628", "pm_score": 2, "selected": true, "text": "=First(Fields!ClientName.Value.StringValue, \"BusinessObject_CustomerInfo\")\n" } ]
2008/11/05
[ "https://Stackoverflow.com/questions/264714", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34628/" ]
264,720
<p>I am using a GDI+ Graphic to draw a 4000*3000 image to screen, but it is really slow. It takes about 300ms. I wish it just occupy less than 10ms.</p> <pre><code>Bitmap *bitmap = Bitmap::FromFile("XXXX",...); </code></pre> <p>//-------------------------------------------- // this part takes about 300ms, terrible!</p> <pre><code>int width = bitmap-&gt;GetWidth(); int height = bitmap-&gt;GetHeight(); DrawImage(bitmap,0,0,width,height); </code></pre> <p>//------------------------------------------</p> <p>I cannot use CachedBitmap, because I want to edit the bitmap later.</p> <p>How can I improve it? Or is any thing wrong? </p> <p>This native GDI function also draws the image into the screen, and it just take 1 ms:</p> <pre><code>SetStretchBltMode(hDC, COLORONCOLOR); StretchDIBits(hDC, rcDest.left, rcDest.top, rcDest.right-rcDest.left, rcDest.bottom-rcDest.top, 0, 0, width, height, BYTE* dib, dibinfo, DIB_RGB_COLORS, SRCCOPY); </code></pre> <p>//--------------------------------------------------------------</p> <p>If I want to use StretchDIBits, I need to pass BITMAPINFO, But how can I get BITMAPINFO from a Gdi+ Bitmap Object? I did the experiment by FreeImage lib, I call StretchDIBits using FreeImageplus object, it draw really fast. But now I need to draw Bitmap, and write some algorithm on Bitmap's bits array, how can I get BITMAPINFO if I have an Bitmap object? It's really annoying -___________-|</p>
[ { "answer_id": 265615, "author": "Cybis", "author_id": 32998, "author_profile": "https://Stackoverflow.com/users/32998", "pm_score": 4, "selected": false, "text": "Bitmap bmp = new Bitmap(...)\nTextureBrush myBrush = new TextureBrush(bmp)\n\nprivate void Paint(object sender, PaintEventAr...
2008/11/05
[ "https://Stackoverflow.com/questions/264720", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25749/" ]
264,744
<p>What is the best way to structure a VB.NET <a href="http://en.wikipedia.org/wiki/Windows_Forms" rel="nofollow noreferrer">Windows Forms</a> application so that code can be reused and the application can be extended easily?</p> <p>I used to create lots of new forms. This lead to lots of repeated code and forms which did similar things.</p> <p>Now, for forms which do similar jobs, such as view/edit/delete items from a specific database table, I create a form with the required controls, have the form create an instance of a class with parameters such as a collection of the controls and a string containing the database table name. Then the individual controls call functions of the class.</p> <p>Advanced forms will inherit and extend this basic form class.</p> <ol> <li>Has there already been work done in this area?</li> <li>Are there books / articles available which discuss the options available on this topic?</li> </ol>
[ { "answer_id": 265219, "author": "RS Conley", "author_id": 7890, "author_profile": "https://Stackoverflow.com/users/7890", "pm_score": 2, "selected": false, "text": "ThisForm.ThisButton(<args>)" } ]
2008/11/05
[ "https://Stackoverflow.com/questions/264744", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
264,745
<p>Imagine the following</p> <p>A type T has a field Company. When executing the following method it works perfectly:</p> <pre><code>Type t = typeof(T); t.GetProperty("Company") </code></pre> <p>Whith the following call I get null though</p> <pre><code>Type t = typeof(T); t.GetProperty("company", BindingFlags.IgnoreCase) </code></pre> <p>Anybody got an idea?</p>
[ { "answer_id": 264748, "author": "leppie", "author_id": 15541, "author_profile": "https://Stackoverflow.com/users/15541", "pm_score": 6, "selected": false, "text": "BindingFlags.Public | BindingFlags.Instance" }, { "answer_id": 264752, "author": "Pop Catalin", "author_id"...
2008/11/05
[ "https://Stackoverflow.com/questions/264745", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11333/" ]
264,747
<p>Is there any way to find out what exceptions might be thrown by any method in .NET code? Ideally I want to see what might be thrown and choose which ones I want to handle. I guess I want the information you'd get from the throws clause in java. </p> <p>The situation is I'm doing a linq query on an xml document from the network and want to know what could go wrong. I could open up the assembly in reflector and have a look but I thought there might be an easier way. </p>
[ { "answer_id": 264755, "author": "Marc Gravell", "author_id": 23354, "author_profile": "https://Stackoverflow.com/users/23354", "pm_score": 6, "selected": true, "text": "/// <exception.../>" } ]
2008/11/05
[ "https://Stackoverflow.com/questions/264747", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13028/" ]
264,763
<p>I am using msbuild to build a C++ project and I want to suppress the 'Post-Build Event'. I have tried the following properties with no success:</p> <pre><code>/property:PostBuildEvent= /property:VCPostBuildEventTool= </code></pre> <p>Neither will make any difference and the post build events are still executed.</p> <p>Does anyone know how to suppress these (and potentially other) events using msbuild?</p>
[ { "answer_id": 277742, "author": "Sunlight", "author_id": 33650, "author_profile": "https://Stackoverflow.com/users/33650", "pm_score": 0, "selected": false, "text": "SKIP_POST_BUILD_EVENTS" }, { "answer_id": 489354, "author": "leftend", "author_id": 11460, "author_pr...
2008/11/05
[ "https://Stackoverflow.com/questions/264763", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9236/" ]
264,764
<p>I'm currently working on a WebSphere 6.1 Web Project.</p> <p>In my java code, how can i get the current running application port?</p>
[ { "answer_id": 265080, "author": "McDowell", "author_id": 304, "author_profile": "https://Stackoverflow.com/users/304", "pm_score": 3, "selected": true, "text": "protected void doGet(HttpServletRequest request,\n HttpServletResponse response) throws ServletException, IOException {...
2008/11/05
[ "https://Stackoverflow.com/questions/264764", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2937/" ]
264,766
<p>My code works great in IE8, Firefox and Safari. But it doesn't work properly in Opera. What happens is that the DIV is hidden but the space occupied by the DIV remains to appear in my web-page.</p> <pre><code>&lt;div style=" z-index:-1;height :380; width:760; position:relative; text-align:center" id="new-add"&gt; &lt;object id="banner-flash" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" width="769" height="382" top="0"&gt; &lt;param name="movie" value="exp.swf" /&gt; &lt;param name="quality" value="high" /&gt; &lt;param name="bgcolor" value="#ffffff" /&gt; &lt;param name="wmode" value="transparent" /&gt; &lt;embed src="exp.swf" wmode="transparent" quality="high" bgcolor="#ffffff" width="780" height="382" name="mymoviename" align="" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"&gt; &lt;/embed&gt; &lt;/object&gt; &lt;/div&gt; &lt;div id="fechar-link" style=" font-family: Verdana,Arial,Helvetica,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal; text-decoration: none; text-align:center" &gt; &lt;a href="#" onclick=" document.getElementById('new-add').style.height =0; document.getElementById('banner-flash').style.height =0; document.getElementById('fechar-link').style.height = 0; document.getElementById('new-add').style.visibility ='hidden'; document.getElementById('banner-flash').style.visibility ='hidden'; document.getElementById('fechar-link').style.visibility ='hidden'; " &gt;Close&lt;/a&gt; &lt;/div&gt; </code></pre> <p>What do I need to do, so the space occupied by the DIV disappears?</p> <p>Thanks</p>
[ { "answer_id": 264774, "author": "Romain Linsolas", "author_id": 26457, "author_profile": "https://Stackoverflow.com/users/26457", "pm_score": 0, "selected": false, "text": "document.getElementById(\"xxx\").display = \"none\";\n" } ]
2008/11/05
[ "https://Stackoverflow.com/questions/264766", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2019426/" ]
264,771
<p>How to put a File path control in VBA front panel? I want the user to be able to select the browse button and select the file path rather than putting up dialog boxes all over the place. I need the user to select three or more file paths.</p>
[ { "answer_id": 264808, "author": "fwzgekg", "author_id": 34116, "author_profile": "https://Stackoverflow.com/users/34116", "pm_score": 2, "selected": false, "text": "Application.FileDialog(msoFileDialogOpen)" }, { "answer_id": 3770658, "author": "nghmuon", "author_id": 45...
2008/11/05
[ "https://Stackoverflow.com/questions/264771", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13440/" ]
264,807
<p>How do you stop race conditions in MySQL? the problem at hand is caused by a simple algorithm:</p> <ol> <li>select a row from table</li> <li>if it doesn't exist, insert it</li> </ol> <p>and then either you get a duplicate row, or if you prevent it via unique/primary keys, an error.</p> <p>Now normally I'd think transactions help here, but because the row doesn't exist, the transaction don't actually help (or am I missing something?).</p> <p>LOCK TABLE sounds like an overkill, especially if the table is updated multiple times per second.</p> <p>The only other solution I can think of is GET_LOCK() for every different id, but isn't there a better way? Are there no scalability issues here as well? And also, doing it for every table sounds a bit unnatural, as it sounds like a very common problem in high-concurrency databases to me. </p>
[ { "answer_id": 1310487, "author": "xvga", "author_id": 160596, "author_profile": "https://Stackoverflow.com/users/160596", "pm_score": 0, "selected": false, "text": "$exists = $success = false;\ndo{\n $exists = check();// select a row in the table \n if (!$exists)\n $success = create_re...
2008/11/05
[ "https://Stackoverflow.com/questions/264807", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8437/" ]
264,813
<p>We would like to have the FormsCookieName of FormsCookiePath change per instance of our application. We have an application which has multiple instances on 1 server/domainname. Because of this we can only work in 1 application at the same time, since the cookies will overwrite eachother. Same for the Sessions btw.</p> <p>Is there a way to dynamicly, for example in the Global.asax Application_Start, change this name? This would be usefull as we keep a license name in each application which could be used as the basis for the CookieName.</p> <p>We already work with Web.config and extra files to overwrite Web.config values in external files using: <code>&lt;appSettings file="Web.AppSettings.Config"&gt;</code></p> <p>But this requires manual actions which can be forgotten and are redundant since the settings can be retrieved from the database.</p> <p>Thanks.</p>
[ { "answer_id": 5606765, "author": "Ron", "author_id": 175938, "author_profile": "https://Stackoverflow.com/users/175938", "pm_score": 2, "selected": false, "text": "\nprotected void Application_Start(object sender, EventArgs e)\n{\n // determine unique cookie name per application\n str...
2008/11/05
[ "https://Stackoverflow.com/questions/264813", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2104/" ]
264,817
<p>I have code similar to the following in many places:</p> <pre><code>var dbParams = db.ReadParams(memberID, product, GetSubscriptionFields()); Debug.Assert(dbParams.Count == 4); _memberCode = dbParams[0]; _password = dbParams[1]; _userName = dbParams[2]; _reasonCode = dbParams[3]; </code></pre> <p>ReadParams() returns an array of strings, the number of strings depending on the GetSubscriptionFields() function. I could use dbParams[] directly in my code, but I find it more helpful to give meaningful names to each of the values in the array. Is there a way I can get all the results directly, without going through the array?</p> <p>I am looking for something like:</p> <pre><code>db.ReadParams(memberID, product, out _memberCode, out _password, out _userName, out _reasonCode); </code></pre> <p>or</p> <pre><code>Tuple&lt;_memberCode, _password, _userName, _reasonCode&gt; = db.ReadParams(memberID, product); </code></pre> <p>Of course, it has to be legal C# code :)</p>
[ { "answer_id": 264849, "author": "Ed Guiness", "author_id": 4200, "author_profile": "https://Stackoverflow.com/users/4200", "pm_score": 2, "selected": true, "text": "dbParams[MEMBER_CODE]\ndbParams[PASSWORD]\ndbParams[USERNAME]\ndbParams[REASON_CODE]\n" }, { "answer_id": 264855, ...
2008/11/05
[ "https://Stackoverflow.com/questions/264817", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31793/" ]
264,822
<p>I have a gradient image as a background for a table header(9x18pix). This image is called through a selector class. When the header content grows to 2 lines(vertical height increases), the bg image is tiling vertically and looks ugly. How can I stretch the bg image vertically without tiling?</p>
[ { "answer_id": 264847, "author": "Mecki", "author_id": 15809, "author_profile": "https://Stackoverflow.com/users/15809", "pm_score": 2, "selected": false, "text": "background-repeat: repeat-x;\n" }, { "answer_id": 494733, "author": "Community", "author_id": -1, "autho...
2008/11/05
[ "https://Stackoverflow.com/questions/264822", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34642/" ]
264,823
<p>Pretty simple question: When i have a persistable object, it usually has a property called ID (for abstract classes).</p> <p>So .. is the naming convention ID or Id?</p> <p>eg.</p> <pre><code>public int ID { get; set; } </code></pre> <p>or</p> <pre><code>public int Id { get; set; } </code></pre> <p>cheers :)</p> <p>PS. This is for .NET btw. FXCop conformat would be a bonus.</p>
[ { "answer_id": 264840, "author": "Mecki", "author_id": 15809, "author_profile": "https://Stackoverflow.com/users/15809", "pm_score": 3, "selected": false, "text": "getResourceURL\n" }, { "answer_id": 782457, "author": "Community", "author_id": -1, "author_profile": "h...
2008/11/05
[ "https://Stackoverflow.com/questions/264823", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30674/" ]
264,825
<p>There is a console Java application which is supposed to run until it is stopped by <kbd>Ctrl</kbd>+<kbd>C</kbd> or closing the console window. How that application can be programmed to execute a clean up code before exit?</p>
[ { "answer_id": 264833, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 5, "selected": true, "text": "class ShutdownHook extends Thread\n{\n public void run()\n {\n // perform shutdown actions\n }\n}\n\n// Then, s...
2008/11/05
[ "https://Stackoverflow.com/questions/264825", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31993/" ]
264,826
<p>How can I rename a Virtual Directory (or Web Application) in IIS 6.0/7.0 using VBScript?</p>
[ { "answer_id": 6680232, "author": "David", "author_id": 842853, "author_profile": "https://Stackoverflow.com/users/842853", "pm_score": 2, "selected": false, "text": "applicationHost.config" } ]
2008/11/05
[ "https://Stackoverflow.com/questions/264826", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
264,828
<p>My servlet application includes a number of library .jars, some of which contain embedded log4j.xml or log4j.properties files. I'd like to ensure that log4j finds my log4j.xml first! I've tried searching for some specification of the priorities of the various classpath elements in a servlet (e.g. does WEB-INF/classes always precede WEB-INF/lib?), or some way to configure or tweak the servlet's classloader so that a given resource directory appears early in the classpath. So far, I've drawn a blank. Any suggestions on ensuring that a servlet .war file loads the correct log4j.xml via the classloader?</p>
[ { "answer_id": 264880, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 2, "selected": false, "text": "Log4jConfigListener" }, { "answer_id": 265378, "author": "matt b", "author_id": 4249, "author_profile": "h...
2008/11/05
[ "https://Stackoverflow.com/questions/264828", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6716/" ]
264,857
<p>I have a simple database:</p> <pre><code>ARTICLE ---------- ArticleId (PK), ArticleTitle ..other stuff... USER-ARTICLE ------------ ArchiveId (PK), UserId, ArticleId ..other stuff... </code></pre> <p>The <code>articleId</code>'s are foreign keys. </p> <p>I want to be able to delete a user article row by <code>UserArticleId</code> using the following code,</p> <pre><code>UserArticle myobjtodelete = PersonalArchiveDb.UserArticles.Single(ua =&gt; ua.ArchiveId == 3); PersonalArchiveDb.UserArticles.DeleteOnSubmit(myobjtodelete); PersonalArchiveDb.SubmitChanges(); </code></pre> <p><sup>(Yes I'm aware I can do the statement inside the delete rather than retrieving the object, it was for debugging purposes to make sure the object definitely exists - it does.)</sup></p> <p>When the debugger hits the <code>SubmitChanges()</code> line, I get a runtime error:</p> <blockquote> <p>Specified cast is not valid.</p> </blockquote> <p>Here is the stack trace,</p> <blockquote> <p>at System.Data.Linq.IdentityManager .StandardIdentityManager .SingleKeyManager`2.TryCreateKeyFromValues(Object[] values, V&amp; v) at System.Data.Linq.IdentityManager.StandardIdentityManager.IdentityCache`2.Find(Object[] keyValues) at System.Data.Linq.IdentityManager.StandardIdentityManager.Find(MetaType type, Object[] keyValues) at System.Data.Linq.CommonDataServices.GetCachedObject(MetaType type, Object[] keyValues) at System.Data.Linq.ChangeProcessor.GetOtherItem(MetaAssociation assoc, Object instance) at System.Data.Linq.ChangeProcessor.BuildEdgeMaps() at System.Data.Linq.ChangeProcessor.SubmitChanges(ConflictMode failureMode) at System.Data.Linq.DataContext.SubmitChanges(ConflictMode failureMode)<br> at System.Data.Linq.DataContext.SubmitChanges() at Driver_SOC_ASO.Controls.PersonalArchive.ArchiveListing.grdArchive_RowDeleting(Object sender, GridViewDeleteEventArgs e) in C:\work\Driver.Net\Driver-SOC-ASO\Driver-SOC-ASO\Controls\PersonalArchive\ArchiveListing.ascx.cs:line 78 at System.Web.UI.WebControls.GridView.OnRowDeleting(GridViewDeleteEventArgs e) at System.Web.UI.WebControls.GridView.HandleDelete(GridViewRow row, Int32 rowIndex) at System.Web.UI.WebControls.GridView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup) at System.Web.UI.WebControls.GridView.RaisePostBackEvent(String eventArgument) at System.Web.UI.WebControls.GridView.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)<br> at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)</p> </blockquote> <p>I am at a loss, any ideas?</p>
[ { "answer_id": 718301, "author": "Rony", "author_id": 51326, "author_profile": "https://Stackoverflow.com/users/51326", "pm_score": 0, "selected": false, "text": "ArticleId" } ]
2008/11/05
[ "https://Stackoverflow.com/questions/264857", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3193/" ]
264,907
<p>I am running a Solr instance on Jetty and when I search using the Solr admin panel, it returns the entire document. What should I do to get only specified fields from each Solr document returned by the search?</p>
[ { "answer_id": 289882, "author": "Andrew Ingram", "author_id": 15687, "author_profile": "https://Stackoverflow.com/users/15687", "pm_score": 8, "selected": true, "text": "/?q=query&fl=field1,field2,field3\n" }, { "answer_id": 48007913, "author": "Nanda Kumar", "author_id"...
2008/11/05
[ "https://Stackoverflow.com/questions/264907", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2220518/" ]
264,909
<p>do you have idea, if there would be some nice way to browse/log JMS queues? (I'm using OpenJMS)</p> <p>For topics I can just add one consumer more and that's about it but with queues I haven't finished with a solution yet. I would like to log all the messages in certain queues and topics without "popping" them from the queue (so that the logger counld browse queues "invisible").</p> <p>With <strong>javax.jms.QueueBrowser</strong> i can get a snapshot of the queues but that doesn't seem to provide "listener solution" - reading all the messages on the queues on infinite loop again and again and hoping that no messages happen to be both written and consumed before my snapshots - that didn't sound like a good solution.</p> <p>Another option would be to create two queues for each "logical queue" - one for logger and one for the actual use - logger would then forward the messages to the "actual queue" - that could maybe work but there could be better solution?</p> <p>So if somebody has a solution to get all messages in a queue by an "invisible" logger or some nice other solution for the logging, that'd be cool.</p>
[ { "answer_id": 289882, "author": "Andrew Ingram", "author_id": 15687, "author_profile": "https://Stackoverflow.com/users/15687", "pm_score": 8, "selected": true, "text": "/?q=query&fl=field1,field2,field3\n" }, { "answer_id": 48007913, "author": "Nanda Kumar", "author_id"...
2008/11/05
[ "https://Stackoverflow.com/questions/264909", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28482/" ]
264,914
<p>Being used to (and potentially spoiled by) <code>MSSQL</code>, I'm wondering how I can get at tables size in <code>Oracle</code> 10g. I have googled it so I'm now aware that I may not have as easy an option as <code>sp_spaceused</code>. Still the potential answers I got are most of the time outdated or don't work. Probably because I'm no DBA on the schema I'm working with.</p> <p>Would anyone have solutions and or recommendations?</p>
[ { "answer_id": 264975, "author": "Tony Andrews", "author_id": 18747, "author_profile": "https://Stackoverflow.com/users/18747", "pm_score": 3, "selected": false, "text": "begin\n dbms_stats.gather_table_stats('MYSCHEMA','MYTABLE');\nend;\n/\n" }, { "answer_id": 265536, "aut...
2008/11/05
[ "https://Stackoverflow.com/questions/264914", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11477/" ]
264,917
<p>I want to create own header.jsp file instead of the one included in the JBoss Portal 2.6 but have to support the locale set by the user.</p> <p>The original header.jsp does not contain any i18n and I don't know how to do it, especially how to get the actual locale.</p>
[ { "answer_id": 569501, "author": "johnbr", "author_id": 376254, "author_profile": "https://Stackoverflow.com/users/376254", "pm_score": 1, "selected": false, "text": "<%@ taglib uri=\"http://java.sun.com/jsp/jstl/fmt\" prefix=\"fmt\" %>\n\n<%\n locale = request.getLocale() // get the ...
2008/11/05
[ "https://Stackoverflow.com/questions/264917", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25326/" ]
264,924
<p>We have a page that ordinarily has two elements arranged side-by-side. Despite exploring a few angles for this, we can't seem to make it work. We're not averse to using JavaScript, it just feels that a CSS based solution ought to be possible. Is there a way of using just CSS (and possibly extra markup if necessary) to make <code>element2</code> centre when it appears on its own?</p> <h1>Examples</h1> <p>Sometimes we have two elements, side by side.</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div id="container"&gt; &lt;div id="element1"&gt;content&lt;/div&gt; &lt;div id="element2"&gt;content&lt;/div&gt; &lt;/div&gt;</code></pre> </div> </div> </p> <p>But in some conditions only <code>element2</code> is on the page e.g.:</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div id="container"&gt; &lt;div id="element2"&gt;content&lt;/div&gt; &lt;/div&gt;</code></pre> </div> </div> </p>
[ { "answer_id": 264980, "author": "philnash", "author_id": 28376, "author_profile": "https://Stackoverflow.com/users/28376", "pm_score": 4, "selected": true, "text": "div#element2{\n width:100px;\n margin:0 auto;\n}\ndiv#element1{\n width:50px;\n float:left;\n}\ndiv#element1 + div#ele...
2008/11/05
[ "https://Stackoverflow.com/questions/264924", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2977/" ]
264,930
<p>I'm still working with this huge list of URLs, all the help I have received has been great.</p> <p>At the moment I have the list looking like this (17000 URLs though):</p> <ul> <li><code>http://www.example.com/page?CONTENT_ITEM_ID=1</code></li> <li><code>http://www.example.com/page?CONTENT_ITEM_ID=3</code></li> <li><code>http://www.example.com/page?CONTENT_ITEM_ID=2</code></li> <li><code>http://www.example.com/page?CONTENT_ITEM_ID=1</code></li> <li><code>http://www.example.com/page?CONTENT_ITEM_ID=2</code></li> <li><code>http://www.example.com/page?CONTENT_ITEM_ID=3</code></li> <li><code>http://www.example.com/page?CONTENT_ITEM_ID=3</code></li> </ul> <p>I can filter out the duplicates no problem with a couple of methods, awk etc. What I am really looking to do it take out the duplicate URLs but at the same time taking a count of how many times the URL exists in the list and printing the count next to the URL with a pipe separator. After processing the list it should look like this:</p> <div class="s-table-container"> <table class="s-table"> <thead> <tr> <th>url</th> <th>count</th> </tr> </thead> <tbody> <tr> <td><code>http://www.example.com/page?CONTENT_ITEM_ID=1</code></td> <td>2</td> </tr> <tr> <td><code>http://www.example.com/page?CONTENT_ITEM_ID=2</code></td> <td>2</td> </tr> <tr> <td><code>http://www.example.com/page?CONTENT_ITEM_ID=3</code></td> <td>3</td> </tr> </tbody> </table> </div> <p>What method would be the fastest way to achieve this?</p>
[ { "answer_id": 264942, "author": "S.Lott", "author_id": 10661, "author_profile": "https://Stackoverflow.com/users/10661", "pm_score": 2, "selected": false, "text": "from collections import defaultdict\nmyFile = open( \"urlFile\", \"ru\" )\nfq= defaultdict( int )\nfor n in myFile:\n fq...
2008/11/05
[ "https://Stackoverflow.com/questions/264930", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30786/" ]
264,937
<p>Currently i have this method:</p> <pre><code>static boolean checkDecimalPlaces(double d, int decimalPlaces){ if (d==0) return true; double multiplier = Math.pow(10, decimalPlaces); double check = d * multiplier; check = Math.round(check); check = check/multiplier; return (d==check); } </code></pre> <p>But this method fails for <code>checkDecmialPlaces(649632196443.4279, 4)</code> probably because I do base 10 math on a base 2 number.</p> <p>So how can this check be done correctly?</p> <p>I thought of getting a string representation of the double value and then check that with a regexp - but that felt weird.</p> <p><strong>EDIT:</strong> Thanks for all the answers. There are cases where I really get a double and for those cases I implemented the following: </p> <pre><code>private static boolean checkDecimalPlaces(double d, int decimalPlaces) { if (d == 0) return true; final double epsilon = Math.pow(10.0, ((decimalPlaces + 1) * -1)); double multiplier = Math.pow(10, decimalPlaces); double check = d * multiplier; long checkLong = (long) Math.abs(check); check = checkLong / multiplier; double e = Math.abs(d - check); return e &lt; epsilon; } </code></pre> <p>I changed the <code>round</code> to a truncation. Seems that the computation done in <code>round</code> increases the inaccuracy too much. At least in the failing testcase.<br> As some of you pointed out if I could get to the 'real' string input I should use <code>BigDecimal</code> to check and so I have done: </p> <pre><code>BigDecimal decimal = new BigDecimal(value); BigDecimal checkDecimal = decimal.movePointRight(decimalPlaces); return checkDecimal.scale() == 0; </code></pre> <p>The <code>double</code> value I get comes from the Apache POI API that reads excel files. I did a few tests and found out that although the API returns <code>double</code> values for numeric cells I can get a accurate representation when I immediately format that <code>double</code> with the <code>DecimalFormat</code>: </p> <pre><code>DecimalFormat decimalFormat = new DecimalFormat(); decimalFormat.setMaximumIntegerDigits(Integer.MAX_VALUE); // don't use grouping for numeric-type cells decimalFormat.setGroupingUsed(false); decimalFormat.setDecimalFormatSymbols(new DecimalFormatSymbols(Locale.US)); value = decimalFormat.format(numericValue); </code></pre> <p>This also works for values that can't be represented exactly in binary format.</p>
[ { "answer_id": 264947, "author": "paxdiablo", "author_id": 14860, "author_profile": "https://Stackoverflow.com/users/14860", "pm_score": 2, "selected": false, "text": "return (d==check);\n" }, { "answer_id": 264952, "author": "Ned Batchelder", "author_id": 14343, "aut...
2008/11/05
[ "https://Stackoverflow.com/questions/264937", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5271/" ]
264,950
<p>I am using a machine on which I do not have root access and would like to access files on a Samba server in random access mode. I know I can transfer the files in their entirety using smbclient but the files are very large (>1GB) and I would rather just treat them as remote files on which I can do random access.</p> <p>The problem as noted is that I don't have root access to this machine (a Linux box) so I can't mount the remote Samba file system. </p> <p>Is there a user-level solution that will let me randomly access the contents of a file on a Samba server? Seems it should be possible to do everything that the kernel file system client is doing but from a user-level application.</p> <p>I only need read-only access btw and the remote file is guaranteed not to change.</p>
[ { "answer_id": 264963, "author": "xsl", "author_id": 11387, "author_profile": "https://Stackoverflow.com/users/11387", "pm_score": 0, "selected": false, "text": "smbmount" }, { "answer_id": 268478, "author": "Dave Griffiths", "author_id": 15379, "author_profile": "htt...
2008/11/05
[ "https://Stackoverflow.com/questions/264950", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15379/" ]
264,951
<p>I'm just in the middle of revisiting maven. Our team had a bad experience when we last looked at this, as it was during the period when maven was rearchitecting from 1.x to 2.x, so a lot of the dependencies we needed hadn't been moved across to the new repositories. However, I have the time to reconsider now.</p> <p>I am interested in using maven and either LaTeX or DocBook for creating documentation, and I was wondering if anyone had any experiences to share, project/module structure, good plugins to use, etc...</p> <p>Many thanks :-)</p> <p>Edit:</p> <p>Just to clarify, I was looking to write a technical article/book, and my desired artifact would probably be a PDF.</p>
[ { "answer_id": 265015, "author": "lindelof", "author_id": 1428, "author_profile": "https://Stackoverflow.com/users/1428", "pm_score": -1, "selected": false, "text": "<plugin>\n <groupId>org.codehaus.mojo</groupId>\n <artifactId>exec-maven-plugin</artifactId>\n <executions>\n <execu...
2008/11/05
[ "https://Stackoverflow.com/questions/264951", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3295/" ]
264,962
<p>I need to search a string in the string array. I dont want to use any for looping in it</p> <pre><code>string [] arr = {"One","Two","Three"}; string theString = "One" </code></pre> <p>I need to check whether theString variable is present in arr.</p>
[ { "answer_id": 264970, "author": "Marc Gravell", "author_id": 23354, "author_profile": "https://Stackoverflow.com/users/23354", "pm_score": 7, "selected": false, "text": "bool has = arr.Contains(var); // .NET 3.5\n" }, { "answer_id": 264974, "author": "ZombieSheep", "auth...
2008/11/05
[ "https://Stackoverflow.com/questions/264962", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22162/" ]
265,018
<p>How can I create unicode console application with Delphi 2009?</p> <p>If I do like this:</p> <pre><code>{$APPTYPE CONSOLE} uses SysUtils; begin writeln('öüğşç سيمانتت'); end. </code></pre> <p>I get the following:</p> <pre><code>ougsc ??????? </code></pre>
[ { "answer_id": 265036, "author": "Michał Niklas", "author_id": 22595, "author_profile": "https://Stackoverflow.com/users/22595", "pm_score": 0, "selected": false, "text": "my_app.exe > unicode_file.txt\n" }, { "answer_id": 266305, "author": "mghie", "author_id": 30568, ...
2008/11/05
[ "https://Stackoverflow.com/questions/265018", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
265,051
<p>A co-worker recently ran into a situation where a query to look up security permissions was taking ~15 seconds to run using an = comparison on UserID (which is a UNIQUEIDENTIFIER). Needless to say, the users were less than impressed.</p> <p>Out of frustration, my co-worker changed the = comparison to use a LIKE and the query sped up to under 1 second.</p> <p>Without knowing anything about the data schema (I don't have access to the database or execution plans), what could potentially cause this change in performance?</p> <p>(Broad and vague question, I know)</p>
[ { "answer_id": 265064, "author": "Cade Roux", "author_id": 18255, "author_profile": "https://Stackoverflow.com/users/18255", "pm_score": 1, "selected": false, "text": "LIKE" }, { "answer_id": 265107, "author": "Mike Burton", "author_id": 22225, "author_profile": "http...
2008/11/05
[ "https://Stackoverflow.com/questions/265051", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11780/" ]
265,062
<p>I'm looking for an example of how to load an image from file and print it on a page using WPF. I'm having a hard time finding good information about WPF printing.</p>
[ { "answer_id": 265127, "author": "MojoFilter", "author_id": 93, "author_profile": "https://Stackoverflow.com/users/93", "pm_score": 0, "selected": false, "text": "...\nPrintDialog printer = new PrintDialog();\n\nif (printer.ShowDialog()) {\n printer.PrintVisual(myVisual, \"A Page Title\...
2008/11/05
[ "https://Stackoverflow.com/questions/265062", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18153/" ]
265,073
<p>I'm trying to make a PHP script, I have the script finished but it takes like 10 minutes to finish the process it is designed to do. This is not a problem, however I presume I have to keep the page loaded all this time which is annoying. Can I have it so that I start the process and then come back 10mins later and just view the log file it has generated?</p>
[ { "answer_id": 265088, "author": "Greg", "author_id": 24181, "author_profile": "https://Stackoverflow.com/users/24181", "pm_score": 2, "selected": false, "text": "ignore_user_abort()" }, { "answer_id": 265090, "author": "bastiandoeen", "author_id": 371953, "author_pro...
2008/11/05
[ "https://Stackoverflow.com/questions/265073", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26823/" ]
265,074
<p>I'm using event delegation to listen for events lower in the DOM, but it's not working for an onchange event on a select box. Does the onchange event propagate or bubble up the DOM?</p> <p>Googling has failed in finding a conclusive answer.</p>
[ { "answer_id": 265112, "author": "scunliffe", "author_id": 6144, "author_profile": "https://Stackoverflow.com/users/6144", "pm_score": -1, "selected": false, "text": "<div id=\"foo\">\n <select onchange=\"alert('hi');\">\n <option>Hello</option>\n <option>World</option>\n </selec...
2008/11/05
[ "https://Stackoverflow.com/questions/265074", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21030/" ]
265,089
<p>I would like to display the up time of the machine my code is running, how can I do that?</p>
[ { "answer_id": 265115, "author": "Bogdan", "author_id": 24022, "author_profile": "https://Stackoverflow.com/users/24022", "pm_score": 2, "selected": false, "text": "using System.Diagnostics;\n..........\nPerformanceCounter perfc = new PerformanceCounter(\"System\",\"System Up Time\");\np...
2008/11/05
[ "https://Stackoverflow.com/questions/265089", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14441/" ]
265,096
<p>I'm trying to use <code>System.DirectoryServices</code> in a web site project and I'm getting this error:</p> <blockquote> <p>The type or namespace name 'DirectoryServices' does not exist in the namespace 'System' (are you missing an assembly reference?)</p> </blockquote> <p>My project has a reference to <code>System.DirectoryServices</code> in <code>web.config</code>: </p> <pre><code>&lt;add assembly="System.DirectoryServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/&gt; </code></pre> <p>And I do have <code>using System.DirectoryServices</code> in the files where I want to use it.</p> <p>Does anybody have a clue where to look for the problem?</p>
[ { "answer_id": 265133, "author": "Mitch Wheat", "author_id": 16076, "author_profile": "https://Stackoverflow.com/users/16076", "pm_score": 3, "selected": false, "text": "<compilation debug=\"true\">\n <assemblies>\n <add assembly=\"System.DirectoryServices, Version=2.0.0.0, ...
2008/11/05
[ "https://Stackoverflow.com/questions/265096", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12111/" ]
265,097
<p>Is there a built in VB.NET function to format a number as an Ordinal or do I have to write my own?</p> <p><a href="https://stackoverflow.com/questions/20156/ordinals-in-c">There isn't in C# so I'm thinking there isn't :(</a> </p>
[ { "answer_id": 265142, "author": "Binary Worrier", "author_id": 18797, "author_profile": "https://Stackoverflow.com/users/18797", "pm_score": 4, "selected": false, "text": "Public Function AddOrdinal(ByVal num As Integer) as String\n Select Case (num Mod 100)\n Case 11 To 13\n ...
2008/11/05
[ "https://Stackoverflow.com/questions/265097", "https://Stackoverflow.com", "https://Stackoverflow.com/users/982/" ]
265,102
<p>I have to read CSV files line by line which can be 10 to 20 Meg. <code>file()</code> is useless and I have to find the quickest way.</p> <p>I have tried with <code>fgets()</code>, which runs fine, but I don't know if it reads a small block each time I call it, or if it caches a bigger one and optimize file I/O. Do I have to try the <code>fread()</code> way, parsing EOL by myself?</p>
[ { "answer_id": 265111, "author": "Greg", "author_id": 24181, "author_profile": "https://Stackoverflow.com/users/24181", "pm_score": 1, "selected": false, "text": "fgets()" }, { "answer_id": 265132, "author": "Treb", "author_id": 22114, "author_profile": "https://Stack...
2008/11/05
[ "https://Stackoverflow.com/questions/265102", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8404/" ]
265,106
<p>I've been working on a project called <a href="http://www.codeplex.com/axial" rel="nofollow noreferrer">Axial</a> that converts MSIL (compiled C# or VB.NET) to JavaScript. There are a few samples of working code, but some common situations don't work properly. (The current release doesn't work in production mode and the SVN code doesn't work in debug mode but is much cleaner.) I've heard from quite a few people that they hate writing JavaScript, so I know the project has some merit, but I'd guess that attitude is less prevalent among the SO community.</p> <p>Assume the product works perfectly and smoothly, so your JavaScript works 100% of the time and a Visual Studio plug-in makes sure you're using the product correctly. Is this something you or your organization would use? What features other than straight code translation would interest you?</p>
[ { "answer_id": 265111, "author": "Greg", "author_id": 24181, "author_profile": "https://Stackoverflow.com/users/24181", "pm_score": 1, "selected": false, "text": "fgets()" }, { "answer_id": 265132, "author": "Treb", "author_id": 22114, "author_profile": "https://Stack...
2008/11/05
[ "https://Stackoverflow.com/questions/265106", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23427/" ]
265,117
<p>OK, I have just been reading and trying for the last hour to import a CSV file from access into MySQL, but I can not get it to do it correctly, no matter what I try.</p> <p>My table is like so:</p> <pre><code>+-----------------+------------- | Field | Type +-----------------+------------- | ARTICLE_NO | varchar(20) | ARTICLE_NAME | varchar(100) | SUBTITLE | varchar(20) | CURRENT_BID | varchar(20) | START_PRICE | varchar(20) | BID_COUNT | varchar(20) | QUANT_TOTAL | varchar(20) | QUANT_SOLD | varchar(20) | STARTS | datetime | ENDS | datetime | ORIGIN_END | datetime | SELLER_ID | varchar(20) | BEST_BIDDER_ID | varchar(20) | FINISHED | varchar(20) | WATCH | varchar(20) | BUYITNOW_PRICE | varchar(20) | PIC_URL | varchar(20) | PRIVATE_AUCTION | varchar(20) | AUCTION_TYPE | varchar(20) | INSERT_DATE | datetime | UPDATE_DATE | datetime | CAT_1_ID | varchar(20) | CAT_2_ID | varchar(20) | ARTICLE_DESC | varchar(20) | DESC_TEXTONLY | varchar(20) | COUNTRYCODE | varchar(20) | LOCATION | varchar(20) | CONDITIONS | varchar(20) | REVISED | varchar(20) | PAYPAL_ACCEPT | tinyint(4) | PRE_TERMINATED | varchar(20) | SHIPPING_TO | varchar(20) | FEE_INSERTION | varchar(20) | FEE_FINAL | varchar(20) | FEE_LISTING | varchar(20) | PIC_XXL | tinyint(4) | PIC_DIASHOW | tinyint(4) | PIC_COUNT | varchar(20) | ITEM_SITE_ID | varchar(20) </code></pre> <p>Which should be fine, and my data is currently semicolon delimited, an example of a row from my csv file is thus:</p> <pre><code>"110268889894";"ORIGINAL 2008 ED HARDY GÜRTEL* MYSTERY LOVE * M *BLACK";"";0,00 €;0,00 €;0;1;0;8.7.2008 17:18:37;5.11.2008 16:23:37;6.10.2008 17:23:37;29;0;0;0;125,00 €;"";0;2;6.10.2008 16:21:51;6.10.2008 14:19:08;80578;0;;0;77;"";0;0;1;0;-1;0,00 €;0,00 €;0,00 €;0;0;0;77 "110293328957";"Orig. Ed Hardy Shirt - Tank Top - Gr. XS- OVP/NEU";"";25,05 €;0,00 €;7;1;0;27.9.2008 06:26:27;6.10.2008 18:26:21;6.10.2008 18:26:21;49;0;0;0;0,00 €;"";0;1;6.10.2008 16:21:56;6.10.2008 16:33:20;31058;0;;0;77;"";1;0;0;0;-1;0,00 €;0,00 €;0,00 €;0;0;0;77 </code></pre> <p>I am using a simple PHP page to output the table data, and it is completely wrong. The problem is not with the PHP page as a simple table with just text displays perfectly. I am wondering if I have selected incorrect field types or the columns do not match up, but I see no reason this would be the case. Could something be happening because the data is trying to be displayed as HTML?</p> <p>I have tried to keep this question as specific as possible, and am not asking for people to do it for me as others have suggested, but I honestly can not see where the problem is.</p> <p>edit: When trying to display the data through PHP, at the moment the page is completely black with some table cells having borders and others not, othertimes when trying different delimiters, the fields do not match the columns. The starts field has never displayed correctly.</p> <p>I am loading the file from a CSV file with this command: </p> <pre><code>LOAD DATA LOCAL INFILE 'C:/Dokumente und Einstellungen/hom/Desktop/tblAuction.txt' INTO TABLE Auctions FIELDS TERMINATED BY '\"' LINES TERMINATED BY '\n'; </code></pre> <p>It looks fine in the DB as far as I have been able to tell, apart from the starts field, which is not the main problem at the moment.</p> <p>edit2: I have serialized the result, and this is what was output to the screen:</p> <pre><code>i:0; </code></pre> <p>I have absolutely no idea what that means.</p> <p>edit3: I had tried updating the terminated by a delimiter, and after changing \" to ; the problem still remains of data not being put into the correct columns etc.., I don't understand what I have missed.</p>
[ { "answer_id": 265150, "author": "Treb", "author_id": 22114, "author_profile": "https://Stackoverflow.com/users/22114", "pm_score": 1, "selected": true, "text": "echo serialize($result);" }, { "answer_id": 265174, "author": "Ted Elliott", "author_id": 16501, "author_p...
2008/11/05
[ "https://Stackoverflow.com/questions/265117", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1246613/" ]
265,122
<p>Can I find out when the last INSERT, UPDATE or DELETE statement was performed on a table in an Oracle database and if so, how?</p> <p>A little background: The Oracle version is 10g. I have a batch application that runs regularly, reads data from a single Oracle table and writes it into a file. I would like to skip this if the data hasn't changed since the last time the job ran.</p> <p>The application is written in C++ and communicates with Oracle via OCI. It logs into Oracle with a "normal" user, so I can't use any special admin stuff.</p> <p>Edit: Okay, "Special Admin Stuff" wasn't exactly a good description. What I mean is: I can't do anything besides SELECTing from tables and calling stored procedures. Changing anything about the database itself (like adding triggers), is sadly not an option if want to get it done before 2010.</p>
[ { "answer_id": 265298, "author": "dub", "author_id": 30022, "author_profile": "https://Stackoverflow.com/users/30022", "pm_score": 4, "selected": false, "text": "AUDIT INSERT ON user.table\n" }, { "answer_id": 265507, "author": "Justin Cave", "author_id": 10397, "auth...
2008/11/05
[ "https://Stackoverflow.com/questions/265122", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1733/" ]
265,123
<p>What is the best way to implement connection pooling in hsqldb, without compromising on the speed?</p>
[ { "answer_id": 266055, "author": "Chochos", "author_id": 10165, "author_profile": "https://Stackoverflow.com/users/10165", "pm_score": 3, "selected": true, "text": "DataSource" } ]
2008/11/05
[ "https://Stackoverflow.com/questions/265123", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12649/" ]
265,138
<p>I'm working with Eclipse Version 3.2.1 Build M20060921-0945 on a MS-Windows 2000 SP4 using a JDK 1.5.0-12.<br> I takes my locale that is es-AR and sets all menu and context in Spanish which I don't like. So I had included in eclipse.ini file one parameter <em>"-nl en"</em>.<br> Since that, <em>"References..."</em> feature in both <em>"Search"</em> and contextual menu stopped working. I removed parameter and ran eclipse with <em>"-clean"</em> but still not working. I don't have any other clue about what is happening. Thank you all in advance.<br> Beto</p>
[ { "answer_id": 1648360, "author": "Ferry", "author_id": 199465, "author_profile": "https://Stackoverflow.com/users/199465", "pm_score": 5, "selected": false, "text": "<WORKSPACE>/.metadata/.plugins/org.eclipse.jdt.core" }, { "answer_id": 6598216, "author": "Tillmann", "au...
2008/11/05
[ "https://Stackoverflow.com/questions/265138", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
265,140
<p><a href="http://www.springsource.org/extensions/se-workflow" rel="noreferrer">Spring Workflow</a> has now been published.</p> <ul> <li>Have you tried it yet? For what kind of scenario?</li> <li>What is your impression? How do you find it stacks up against other workflow libs?</li> <li>Found any good docs or tutorials?</li> </ul>
[ { "answer_id": 467127, "author": "SenoCtar", "author_id": 56174, "author_profile": "https://Stackoverflow.com/users/56174", "pm_score": 3, "selected": true, "text": "public final void afterPropertiesSet() throws Exception {\n if (this.flowInstanceDescriptorPersisters == null) {\n ...
2008/11/05
[ "https://Stackoverflow.com/questions/265140", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20065/" ]
265,146
<p>I currently have a 32 bit dll that was created with Visual Studio 2003 in C++ using <a href="http://en.wikipedia.org/wiki/Managed_Extensions_for_C%2B%2B" rel="nofollow noreferrer">Managed Extensions</a>. I'm now trying to compile a 64 bit version without having to upgrade to C++/CLI. I've been following the tutorial at <a href="http://www.eggheadcafe.com/forumarchives/vclanguage/Aug2005/post23130822.asp" rel="nofollow noreferrer">this location</a>. I'm getting the following error:</p> <blockquote> <p> fatal error C1197: cannot reference 'c:\windows\microsoft.net\framework\v1.1.4322\mscorlib.dll' as the progam has already referenced 'c:\windows\microsoft.net\framework\v2.0.50727\mscorlib.dll'</p> </blockquote> <p>I can't figure out what is referencing the .NET 2.0 version of the dll.</p>
[ { "answer_id": 265167, "author": "UberJumper", "author_id": 34395, "author_profile": "https://Stackoverflow.com/users/34395", "pm_score": 1, "selected": false, "text": "#using \"C:\\Windows\\Microsoft.NET\\Framework\\v1.1.4322\\mscorlib.dll\n" } ]
2008/11/05
[ "https://Stackoverflow.com/questions/265146", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9539/" ]
265,160
<p>I need a java api, that cannot use JMF, to play video interpreted by the SO codecs but i want to retrieve the each frames in java code. Somebody know some?</p>
[ { "answer_id": 58000052, "author": "zakgof", "author_id": 2519698, "author_profile": "https://Stackoverflow.com/users/2519698", "pm_score": 0, "selected": false, "text": "IVelvetVideoLib lib = VelvetVideoLib().getInstance();\ntry (IDemuxer demuxer = lib.demuxer(new File(\"/some/path/exam...
2008/11/05
[ "https://Stackoverflow.com/questions/265160", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
265,166
<p>I need to pause for maybe 500 miliseconds before I submit a form. Here is what I have so far:</p> <pre><code> $(".rowqty input").bind("keyup", function() { $("#ViewCartPage form").animate({ opacity: 1.0 }, 3000).submit() }); </code></pre> <p>so when someone changes the quantity of the input field it submits the form, but I want it to wait for a slight amount of time incase they need a moment to type 2 or 3 numbers. </p> <p>As you can see I tried the animate function to try and delay things but with no luck.</p> <p>I know I could use this: <a href="http://blog.mythin.net/projects/jquery.php" rel="nofollow noreferrer">http://blog.mythin.net/projects/jquery.php</a></p> <p>I'd rather not add another JS to my site if there is a way around it.</p> <p>EDIT: Actually the pause plugin above is not working for me either.</p>
[ { "answer_id": 265172, "author": "Chris Van Opstal", "author_id": 7264, "author_profile": "https://Stackoverflow.com/users/7264", "pm_score": 3, "selected": true, "text": "$(\".rowqty input\").bind(\"keyup\", function() { setTimeout(\"$('#ViewCartPage form').submit()\", 500 });\n" }, ...
2008/11/05
[ "https://Stackoverflow.com/questions/265166", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34548/" ]
265,171
<p>Is there a way that I can get a full crash dump when my application crashes suddenly? </p> <p>The problem is that I suspect that it's due to unmanaged code that kills the .net framework itself, and because of that, unless there's a debugger attached to the application at the moment of the crash, the application doesn't even gets a chance to handle the crash.</p> <p>I can't attach a debugger and wait, because the crash happens randomly and we have many installed locations, so I'm wondering if it's possible to do this without attaching a debugger.</p> <p>Edit: I'm aware of Microsoft Debugging SDK, and I also just found out about DebugDiag. I'd like to do this without having to attach to the application each time, as it's usually in the middle of a sale and I don't have time to attach the debugger and explore the stack trace. DebugDiag does seem to let me setup a rule for this, but it seems to only work on already running processes, rather than waiting for some process to launch.</p>
[ { "answer_id": 9836043, "author": "EdChum", "author_id": 704848, "author_profile": "https://Stackoverflow.com/users/704848", "pm_score": 0, "selected": false, "text": "HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows NT\\CurrentVersion\\AeDebug" } ]
2008/11/05
[ "https://Stackoverflow.com/questions/265171", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16172/" ]
265,175
<p>Any idea anyone? Is it possible that we specify the name of the form input field? How to go about doing that?</p>
[ { "answer_id": 265191, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 2, "selected": false, "text": "<h:form id=\"searchForm\">\n <h:inputText id=\"searchField\" ... />\n</h:form>\n" }, { "answer_id": 265210, "aut...
2008/11/05
[ "https://Stackoverflow.com/questions/265175", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
265,180
<p>Is there any security issue if let say in one application we do a hidden post to another application to make use of that application functionality?</p>
[ { "answer_id": 265191, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 2, "selected": false, "text": "<h:form id=\"searchForm\">\n <h:inputText id=\"searchField\" ... />\n</h:form>\n" }, { "answer_id": 265210, "aut...
2008/11/05
[ "https://Stackoverflow.com/questions/265180", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
265,192
<p>I have the following code:</p> <pre><code>Using cmd As SqlCommand = Connection.CreateCommand cmd.CommandText = "UPDATE someTable SET Value = @Value" cmd.CommandText &amp;= " WHERE Id = @Id" cmd.Parameters.AddWithValue("@Id", 1234) cmd.Parameters.AddWithValue("@Value", "myValue") cmd.ExecuteNonQuery End Using </code></pre> <p>I wonder if there is any way to get the final SQL statment as a String, which should look like this:</p> <pre class="lang-sql prettyprint-override"><code>UPDATE someTable SET Value = "myValue" WHERE Id = 1234 </code></pre> <p>If anyone wonders why I would do this:</p> <ul> <li>for logging (failed) statements</li> <li>for having the possibility to copy &amp; paste it to the Enterprise Manager for testing purposes</li> </ul>
[ { "answer_id": 265253, "author": "Tomalak", "author_id": 18771, "author_profile": "https://Stackoverflow.com/users/18771", "pm_score": 6, "selected": false, "text": "CommandText" }, { "answer_id": 265261, "author": "Kon", "author_id": 22303, "author_profile": "https:/...
2008/11/05
[ "https://Stackoverflow.com/questions/265192", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6297/" ]
265,208
<p>I have a list of integers in C#. I wish to remove duplicates. In C++ I would run it through the std::sort and then std::unique algorithms for a very efficient way of obtaining the unique list.</p> <p>What's the best way to do the same thing in C#? In other words, I'm looking for a more elegant way to do the following code:</p> <pre><code> private static int[] unique(int[] ids) { IDictionary&lt;int, object&gt; d = new Dictionary&lt;int, object&gt;(); foreach(int i in ids) d[i] = null; int[] results = new int[d.Count]; int j = 0; foreach(int id in d.Keys) results[j++] = id; return results; } </code></pre>
[ { "answer_id": 265214, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 4, "selected": true, "text": "int[] x = new[] { 1, 4, 23, 4, 1 };\nint[] distinct = x.Distinct().ToArray();\n// distinct is now { 1, 4, 23 } (but not n...
2008/11/05
[ "https://Stackoverflow.com/questions/265208", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34685/" ]
265,218
<p>I'm looking for a way to implement a referral system for my web site.</p> <p>Initially I went with <a href="http://mysite.com/?affid=0001" rel="nofollow noreferrer">http://mysite.com/?affid=0001</a> and used the affid in the query string affid value to record referrals. The problem with this is that from some common Google search phrases the link with the affid appears before the standard link in a Google search, meaning that affiliates will wrongly get credited for customers who have Googled our site.</p> <p>I also heard that having multiple different links that refer to the same page (eg. <a href="http://mysite.com/?affid=0001" rel="nofollow noreferrer">http://mysite.com/?affid=0001</a> and <a href="http://mysite.com/?affid=0002" rel="nofollow noreferrer">http://mysite.com/?affid=0002</a>) causes Google to reduce your ranking. Is this true?</p> <p>Does anyone have a solution to these problems?</p>
[ { "answer_id": 265262, "author": "Keltex", "author_id": 28260, "author_profile": "https://Stackoverflow.com/users/28260", "pm_score": 1, "selected": false, "text": "<meta name=\"ROBOTS\" content=\"NOINDEX, FOLLOW\"/>\n" }, { "answer_id": 265300, "author": "Jonathan S.", "...
2008/11/05
[ "https://Stackoverflow.com/questions/265218", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34632/" ]
265,228
<p>I have some function to find a value:</p> <pre><code>struct FindPredicate { FindPredicate(const SomeType&amp; t) : _t(t) { } bool operator()(SomeType&amp; t) { return t == _t; } private: const SomeType&amp; _t; }; bool ContainsValue(std::vector&lt;SomeType&gt;&amp; v, SomeType&amp; valueToFind) { return find_if(v.begin(), v.end(), FindPredicate(valueToFind)) != v.end(); } </code></pre> <p>Now I would like to write a function that checks if all members of a vector satisfy that predicate:</p> <pre><code>bool AllSatisfy(std::vector&lt;SomeType&gt;&amp; v) { /* ... */ } </code></pre> <p>One solution is to use the <code>std::count_if</code> algorithm.</p> <p>Does anyone know a solution that involves negating the predicate?</p>
[ { "answer_id": 265307, "author": "Luc Touraille", "author_id": 20984, "author_profile": "https://Stackoverflow.com/users/20984", "pm_score": 5, "selected": true, "text": "unary_function<SomeType, bool>" }, { "answer_id": 265323, "author": "Greg Rogers", "author_id": 5963,...
2008/11/05
[ "https://Stackoverflow.com/questions/265228", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17650/" ]
265,251
<p>I've found an issue with ASP.NET that I know at least has stumped one other person out there. We were trying to use an HttpModule to handle wildcard requests to a web application. The generated url is dynamic and could potentially be several hundred characters long. Unfortunately there appears to be a limitation in the aspnet_isapi.dll file that limits the length of the path in the url to MAX_PATH which is hardcoded at 260 chars. </p> <p>Has anyone else ran into this and found a way around this limit? Query string parameters are not an option. </p> <p>Thanks, Greg Ballard</p>
[ { "answer_id": 5585672, "author": "lmingle", "author_id": 145836, "author_profile": "https://Stackoverflow.com/users/145836", "pm_score": 3, "selected": false, "text": "<httpRuntime maxUrlLength=\"1000\" relaxedUrlToFileSystemMapping=\"true\" />\n" }, { "answer_id": 35320241, ...
2008/11/05
[ "https://Stackoverflow.com/questions/265251", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
265,258
<p>I am doing 2^1000 and I am getting this:</p> <p>1.07151e+301</p> <p>Is there any way to actually turn this into a proper number without the e+301, or at least can anyone show me where I can see how to turn this in to a real number, by some way working with the e+301 part?</p>
[ { "answer_id": 265272, "author": "Alnitak", "author_id": 6782, "author_profile": "https://Stackoverflow.com/users/6782", "pm_score": 3, "selected": false, "text": "% perl -Mbigint -e 'print 2**1000'\n1071508607186267320948425049060001810561404811705533607443750388370351051124936122493198...
2008/11/05
[ "https://Stackoverflow.com/questions/265258", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8715/" ]
265,293
<p>I have an ASP.Net MVC Ajax.BeginForm that submits and updates my page properly when I click the submit button. </p> <p>The problem is I need additional events to do the same thing, like when they change the text of an input. The additonal events do properly submit the form but they circumvent the onsubmit javascript generated on the form tag by the Ajax.BeginForm.</p> <p>Here is the form tag generated by Ajax.BeingForm:</p> <pre><code>&lt;form action="/Store/UpdateCart" method="post" onsubmit="Sys.Mvc.AsyncForm.handleSubmit(this, new Sys.UI.DomEvent(event), { insertionMode: Sys.Mvc.InsertionMode.replace, updateTargetId: 'updatedContent' });"&gt; </code></pre> <p>And here is the jQuery to bind my other events that need to submit the form via Ajax:</p> <pre><code> $("#ShippingType, #ViewCart .ddl").bind("change", function() { $("#ViewCartPage form").submit() }); </code></pre> <p>Any ideas on how to get these additional events to trigger onsubmit like I need it too?</p>
[ { "answer_id": 265473, "author": "Andrew Stanton-Nurse", "author_id": 29813, "author_profile": "https://Stackoverflow.com/users/29813", "pm_score": 0, "selected": false, "text": "$(\"#ShippingType, #ViewCart .ddl\").bind(\"change\", function() { $(\"#ViewCartPage form\").onsubmit({ preve...
2008/11/05
[ "https://Stackoverflow.com/questions/265293", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34548/" ]
265,302
<p>First some background. I am trying to run <a href="http://www.communityengine.org/" rel="nofollow noreferrer">Community Engine</a> on a fresh install of Ubuntu. CE is a open src social networking plugin running on Rails. I was able to get CE up and running on my windows box w/o issue. I have decided to use Ubuntu 8.10 as my development environment now, and am stuck on this issue. I have researched this for the last couple nights and am still stuck.</p> <p>What happens is, when i get to this step of the instruction (<a href="http://github.com/bborn/communityengine/tree/master" rel="nofollow noreferrer">found here</a>):</p> <pre><code> Generate the community engine migrations: $ script/generate plugin_migration </code></pre> <p>I get the following error:</p> <pre><code>myuser@compy:~/Projects/MyProject$ script/generate plugin_migration /home/myuser/Projects/MyProject/config/../vendor/plugins/engines/boot.rb:4: This version of the engines plugin requires Rails 2.1.1 or later! (RuntimeError) from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' from /home/myuser/Projects/MyProject/config/environment.rb:12 from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' from /home/myuser/Projects/MyProject/vendor/rails/railties/lib/commands/generate.rb:1 from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' from script/generate:3 </code></pre> <p>Here's my version of ruby:</p> <pre><code>myuser@compy:~/Projects/MyProject$ ruby -v ruby 1.8.7 (2008-08-11 patchlevel 72) [i486-linux] </code></pre> <p>and my installed gems:</p> <pre><code>myuser@compy:~/Projects/MyProject$ gem list *** LOCAL GEMS *** actionmailer (2.2.0, 2.1.2, 2.1.1) actionpack (2.2.0, 2.1.2, 2.1.1) activerecord (2.2.0, 2.1.2, 2.1.1) activeresource (2.2.0, 2.1.2, 2.1.1) activesupport (2.2.0, 2.1.2, 2.1.1) aws-s3 (0.5.1) builder (2.1.2) capistrano (2.5.0) cgi_multipart_eof_fix (2.5.0) daemons (1.0.10) fastthread (1.0.1) gem_plugin (0.2.3) haml (2.0.4) highline (1.4.0) hpricot (0.6.164) htmlentities (4.0.0) mime-types (1.15) mongrel (1.1.5) net-scp (1.0.1) net-sftp (2.0.1) net-ssh (2.0.4) net-ssh-gateway (1.0.0) rails (2.2.0, 2.1.2, 2.1.1) &lt;--- clearly I have rails 2.1.1 or greater rake (0.8.3) RedCloth (4.1.0) rmagick (2.7.1) sqlite3-ruby (1.2.4) xml-simple (1.0.11) </code></pre> <p>I got this error when i only had rails 2.1.1 as well.</p> <p>Yes, I have way more gems than i need for CE, but in trying to track this down, this is what i ended up with. I have a sneaking suspicion that whatever the issue is, it's dumb and i should of caught it. But at this point, I've grown very frustrated with what was a simple process on an XP box.</p> <p>I have asked this question in the Community Engine google group, however, I have a feeling that this is more related to my setup of Ruby and Rails on my machine than to CE itself.</p> <p>Help would be appreciated.</p>
[ { "answer_id": 266520, "author": "Orion Edwards", "author_id": 234, "author_profile": "https://Stackoverflow.com/users/234", "pm_score": 3, "selected": false, "text": "config/environment.rb" } ]
2008/11/05
[ "https://Stackoverflow.com/questions/265302", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23458/" ]
265,305
<p>How do I go about performing AES encryption on a GUID?</p> <p>On the clients computer we will store a GUID and their public key, and our internal servers will have the private key and their guid.</p> <p>Is this all the necessary inputs to generate the AES encryption?</p>
[ { "answer_id": 265352, "author": "Jesse C. Slicer", "author_id": 3312, "author_profile": "https://Stackoverflow.com/users/3312", "pm_score": 0, "selected": false, "text": "private static readonly byte[] rgbKey = Encoding.UTF8.GetBytes(\"Ni=9OE=$i+62eprIuDr@ewOu5I9r34Ro\"); // change to y...
2008/11/05
[ "https://Stackoverflow.com/questions/265305", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39677/" ]
265,324
<p>Ok, I am importing and parsing csv files in a C# app. I started out doing a simple ReadLine() and splitting on commas but it turns out some of the text fields have commas in them. So I started to roll my own splitting function. Fortunately, it was only a few minutes before the "Hey stupid, someone's probably already done this?" light came on and, after a few minutes of searching, realized I could just do an OleDb connection to the directory and import them that way. That worked like a champ, until I ran into a few files with commas and parentheses in the file names. Then it blew up. Any suggestions on getting it to import from files like that? And no, I have no control over the input file names. Some will probably be read directly from CD, so I can't temporarily change the file name.</p>
[ { "answer_id": 265346, "author": "Treb", "author_id": 22114, "author_profile": "https://Stackoverflow.com/users/22114", "pm_score": 1, "selected": false, "text": "Path.GetTempFileName()" } ]
2008/11/05
[ "https://Stackoverflow.com/questions/265324", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19038/" ]
265,335
<p>My table has the following schema:</p> <p>id, parent_id, text</p> <p>Given the following data I would like to return an xml hierarchy:</p> <p>Data: (1,null,'x'), (2,1,'y'), (3,1,'z'), (4,2,'a')</p> <p>XML:<br> [row text="x"]<br> [row text="y"]<br> [row text="a"/]<br> [/row]<br> [row text="z"/]<br> [/row] </p> <hr> <p>Added: the hierachy has no maximum depth</p>
[ { "answer_id": 265359, "author": "S.Lott", "author_id": 10661, "author_profile": "https://Stackoverflow.com/users/10661", "pm_score": -1, "selected": false, "text": "for top in cursor( nodes where each parent==null ):\n build_tree( top )\n\ndef build_tree( parent ):\n emit opening...
2008/11/05
[ "https://Stackoverflow.com/questions/265335", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2133/" ]
265,339
<p>I'd like to automate the FTP download of a database backup file using PowerShell. The file name includes the date so I can't just run the same FTP script every day. Is there a clean way to do this built into PowerShell or using the .NET framework?</p> <p>I want to use a secure FTP session.</p>
[ { "answer_id": 265402, "author": "PabloG", "author_id": 394, "author_profile": "https://Stackoverflow.com/users/394", "pm_score": 3, "selected": false, "text": "$source = \"ftp://ftp.microsoft.com/ResKit/win2000/dureg.zip\"\n$target = \"c:\\temp\\dureg.zip\"\n$WebClient = New-Object Syst...
2008/11/05
[ "https://Stackoverflow.com/questions/265339", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18891/" ]
265,351
<p>I'm using System.Windows.SplashScreen to add a splash screen to my WinForms app (it has a lot of WPF controls, but the 'main window' is still a System.Windows.Forms.Form object). When the splash screen closes the whole app goes as well.</p> <p>Can I stop it taking the whole app with it?</p>
[ { "answer_id": 265399, "author": "Wilka", "author_id": 1367, "author_profile": "https://Stackoverflow.com/users/1367", "pm_score": 0, "selected": false, "text": "form.ShowDialog();\n" } ]
2008/11/05
[ "https://Stackoverflow.com/questions/265351", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1367/" ]
265,361
<p>I am trying to get a simple demo started with ActiveMQ that will demonstrate a TCP to TCP route. I am coding the endpoints and routes in a camel context in my activemq.xml configuration file.</p> <pre><code>&lt;camelContext id="camel" xmlns="http://activemq.apache.org/camel/schema/spring"&gt; &lt;package&gt;org.myorg.codec&lt;/package&gt; &lt;endpoint id="listener_A" uri="mina:tcp://localhost:42000?sync=false&amp;amp;textline=true"/&gt; &lt;endpoint id="listener_B" uri="mina:tcp://localhost:42001?sync=false&amp;amp;textline=true"/&gt; &lt;route&gt; &lt;from uri="activemq:listener_A"/&gt; &lt;to uri="activemq:listener_B"/&gt; &lt;/route&gt; &lt;route&gt; &lt;from uri="activemq:listener_B"/&gt; &lt;to uri="activemq:listener_A"/&gt; &lt;/route&gt; &lt;/camelContext&gt; </code></pre> <p>Any idea why this doesn't work?</p> <p>The AMQ server does not seem to be opening a listening port.</p> <p>Edit: The intent here, as a simple demonstation, is to connect to ActiveMQ with two telnet terminals (A and B) and be able to route messages from one to another through the message queue server. Later, I may try filtering or routing based on content.</p>
[ { "answer_id": 265539, "author": "James Strachan", "author_id": 2068211, "author_profile": "https://Stackoverflow.com/users/2068211", "pm_score": 2, "selected": true, "text": "<route>\n <from ref=\"listener_A\"/>\n <to ref=\"listener_B\"/>\n</route>\n" }, { "answer_id": 270690,...
2008/11/05
[ "https://Stackoverflow.com/questions/265361", "https://Stackoverflow.com", "https://Stackoverflow.com/users/445087/" ]
265,362
<p>Is there any way to create - manipulate calendar events in Exchange Server 2003 ? I'm using VB.NET 2005. I don't want to use MAPI because everytime I will have to type user name and passwords. Is there any other way ? I used redemption.dll but everytime I want to add for eg. a calendar event it displays the login screen.</p> <p>Any suggestions ?</p> <p>Appreciate your help</p> <p>Thank you</p>
[ { "answer_id": 265539, "author": "James Strachan", "author_id": 2068211, "author_profile": "https://Stackoverflow.com/users/2068211", "pm_score": 2, "selected": true, "text": "<route>\n <from ref=\"listener_A\"/>\n <to ref=\"listener_B\"/>\n</route>\n" }, { "answer_id": 270690,...
2008/11/05
[ "https://Stackoverflow.com/questions/265362", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
265,370
<p>what is the best way to convert a UTF-16 files to UTF-8? I need to use this in a cmd script.</p>
[ { "answer_id": 265444, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 4, "selected": false, "text": "using System;\nusing System.IO;\nusing System.Text;\n\nclass FileConverter\n{\n static void Main(string[] args)\n {\n ...
2008/11/05
[ "https://Stackoverflow.com/questions/265370", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5363/" ]
265,371
<p>I'm working on an app that takes data from our DB and outputs an xml file using the FOR XML AUTO, ELEMENTS on the end of the generated query, followed by an XSLT to transform it the way we want. However in a particular case where we are generating some data using an sql scalar function, it always puts that element into a sub-table node named the same as the table node it's already in (so say it's a table xyz, it'd be <code>print("&lt;xyz&gt;&lt;node1&gt;&lt;/node1&gt;&lt;xyz&gt;&lt;generated-node-from-function&gt;&lt;/generated-node-from-function&gt;&lt;/xyz&gt;");</code></p> <p>No matter what I try (even directly manipulating a copy of the sql as generated by the app) it always seems to create this extra node layer, which causes problems later when we try to process this xml to extract the data later. Is there any particular property causing the xml generator in sql server to work this way, and is there any way to prevent it so I can keep the generated data node on the same level as the rest of the data for the table it's associated with?</p> <p>Edit: renamed columns/tables in some cases but otherwise should be the same sql.</p> <pre><code>SELECT * FROM (SELECT column1,column2,column3,iduser,jstart,jstop,jbatchperiod,jinactive,processed,column4,lock,column5,batchticketmicr,machineid,sjobopex,szopexrefid,jreceived,jstartopex,jstopopex,idspecialmicr,idp2batchoriginal,stateflags,bcrossrefid,bidentifier1,bidentifier2,bidentifier3,bidentifier4,bidentifier5,idexport,idimport,rsahash FROM table1) table1 LEFT JOIN (SELECT column21,ienvelope,isort,column1,idtemplate,processed,column4,lock,envelopetypecode,szqueuesvisitedunique,exportdate,jcompleted,status,ipriority,idbankaccount,iprioritybeforerzbump,fstoredrecondata,cscountyid,column10,column11,checkbox1,checkbox2,column12,column13,column14,xxxempfein,column15,column16,originalenvelopeid,column17,column18,xxxoag,trackingnumber,csldc,ecrossrefid,postmark,routingflags,eidentifier1,eidentifier2,eidentifier3,eidentifier4,eidentifier5,idexport FROM envelope) envelope ON table1.column1=Envelope.column1 LEFT JOIN (SELECT column21,column22,isort,column23,processed,side,pagetypecode,rawmicrline,rawscanline,rawbarcode,exportid,szlocandconf,szlocandconfpagefields,idformtemplate,szparms,rawmarksense,audittrail,audittrailelectronic,pixheight,pixwidth,ocrattemptcounter,idspecialmicr,idpageexception,pagemodifierflags,column10,csldc,rejectdate,rejectuser,rejectqueue,fsupervisorreject,xxxempno,xxxtraceno,xxxemplcnt,checkbox1,keyword,templatealtered,templateflags,pidentifier1,pidentifier2,pidentifier3,pidentifier4,pidentifier5,isscanlinevalid,idexport,clickcount FROM Table2) Table2 ON Envelope.column21=Page.column21 LEFT JOIN (select column22, column21, dbo.Fileimagepath(column21, column22) as path from Table2) Fileimg ON Table2.column21=FileImg.column21 AND Table2.column22=FileImg.column22 WHERE Envelope.column21 = 8 FOR XML AUTO, ELEMENTS </code></pre> <p>Another edit: basically FileImg's results are getting wrapped in an extra set of Table2 tags inside existing table2 tab with the rest of the data.</p> <p>Yet another Edit: Testing against another database with the same sql it worked correctly, it appears there is a bad setting in my database or the stored proc is different <em>goes to investigate farther</em>.</p> <p>If that doesn't work I'll try some of the other suggestions above, thanks for the help so far :)</p>
[ { "answer_id": 265640, "author": "splattne", "author_id": 6461, "author_profile": "https://Stackoverflow.com/users/6461", "pm_score": 1, "selected": false, "text": "SELECT table1.column1, table1.column2, ..., envelope.column21, ...\nFROM table1 LEFT JOIN envelope on table1.column1 = en...
2008/11/05
[ "https://Stackoverflow.com/questions/265371", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3326/" ]
265,379
<p>Here's the scenario:</p> <p>You have an ASP.Net application supported by a Microsoft SQL Server database, and for this example there won't be any caching.</p> <p>For each page in your web application, what's more efficient:</p> <p>Attempting to condense everything you need into one (or a few) stored procedure calls that return multiple tables with all of the data you need (which you save into a dataset),</p> <p><em>or</em> </p> <p>to make each call separate (reading each call via a datareader), depending on how it logically makes sense.</p> <p>The reason I ask is I always end up doing things the 2nd way: creating simple methods that connect to the database and grab some data for each little task I have (i.e. a method for populating a specific dropdown, another for the main information for the page, etc).</p> <p>My concern is that what ends up happening when a page is requested, if I look at the SQL Profiler for the server, there will end up being up to 10 or so calls for that single page request. Is that excessive? In my mind it seems like it would be more efficient to condense data gathering by pages opposed to by tasks. Anyone have any experience with this?</p>
[ { "answer_id": 265928, "author": "sykespro", "author_id": 34444, "author_profile": "https://Stackoverflow.com/users/34444", "pm_score": 0, "selected": false, "text": "protected void Page_Load(object sender, EventArgs e)\n{\n DataSet ds = PicklistHelper.GetPicklistData(\n new String...
2008/11/05
[ "https://Stackoverflow.com/questions/265379", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30006/" ]
265,392
<p>I have long been wondering why lazy evaluation is useful. I have yet to have anyone explain to me in a way that makes sense; mostly it ends up boiling down to "trust me".</p> <p>Note: I do not mean memoization. </p>
[ { "answer_id": 265408, "author": "Romain Linsolas", "author_id": 26457, "author_profile": "https://Stackoverflow.com/users/26457", "pm_score": 3, "selected": false, "text": "if (conditionOne && conditionTwo) {\n doSomething();\n}\n" }, { "answer_id": 265433, "author": "Charl...
2008/11/05
[ "https://Stackoverflow.com/questions/265392", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25573/" ]
265,398
<p>I have an application that uses <code>window.open()</code> to generate dynamic popups. Unfortunately, I've had trouble creating the content of the new windows using the standard DOM functions (<code>createElement</code>, <code>appendChild</code>), and I've gone to using <code>document.write()</code> to generate the page.</p> <p>Concretely, how can I go from this:</p> <pre><code>function writePopup() { var popup = window.open("", "popup", "height=400px, width=400px"); var doc = popup.document; doc.write("&lt;html&gt;"); doc.write("&lt;head&gt;"); doc.write("&lt;title&gt;Written Popup&lt;/title&gt;"); doc.write("&lt;/head&gt;"); doc.write("&lt;body&gt;"); doc.write("&lt;p&gt;Testing Write&lt;/p&gt;"); doc.write("&lt;/body&gt;"); doc.write("&lt;/html&gt;"); doc.close(); } </code></pre> <p>To a function that creates the same popup using the DOM? </p> <p>Edit: I did consider using an absolutely positioned element to simulate a popup, and though it looks better, the users need to be able to print the information being shown.</p>
[ { "answer_id": 265409, "author": "tvanfosson", "author_id": 12950, "author_profile": "https://Stackoverflow.com/users/12950", "pm_score": 2, "selected": true, "text": "function writePopup(){\n var popup = window.open(\"\", \"_blank\", \"height=400px, width=400px\");\n var doc = pop...
2008/11/05
[ "https://Stackoverflow.com/questions/265398", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32771/" ]
265,403
<p>I'm using jQuery to handle all my ajax needs for an ASP.NET site coded in VB. When I use the built in $.ajax function to POST to a code-behind function and there is an exception, it simply exits the function, and shows an error on the client side.</p> <p>Besides making debugging difficult when coding, the bigger issue is that the Application_Error function in Global.asax isn't firing when those exceptions occur. This is making it almost impossible to track production errors.</p> <p>Why would it not bubble up to Application_Error? Is the answer to wrap the code-behind function in a Catch statement?</p> <p>jQuery ajax function:</p> <pre><code>$.ajax({ type: "POST", url: "page.aspx/GetData", data: "{'param':'" + param_value + "'}", contentType: "application/json; charset=utf-8", dataType: "json", success: function(msg) { processData(msg); }, error: function(XMLHttpRequest, textStatus, errorThrown) { alert("Error: " + textStatus + " - " + errorThrown); } }); </code></pre> <p>VB.NET function:</p> <pre><code>&lt;Script.Services.ScriptMethod()&gt; _ &lt;WebMethod()&gt; _ Public Shared Function GetData(ByVal param As Integer) As String 'Parse some data Return data End Function </code></pre>
[ { "answer_id": 350284, "author": "Josiah I.", "author_id": 12322, "author_profile": "https://Stackoverflow.com/users/12322", "pm_score": 1, "selected": false, "text": "error: function(XMLHttpRequest, textStatus, errorThrown) {\n alert(\"Error: \" + XMLHttpRequest.responseText);\n}\n" ...
2008/11/05
[ "https://Stackoverflow.com/questions/265403", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12322/" ]
265,423
<p>I have to build an HTML table that shows data for users versus pages visited. It seems klunky to use for and/or foreach loops, but I can't think of anything better. I'm using PHP, but I would assume that this is language agnostic.</p>
[ { "answer_id": 265461, "author": "Kent Fredric", "author_id": 15614, "author_profile": "https://Stackoverflow.com/users/15614", "pm_score": 3, "selected": true, "text": "$tableformat = '<table><thead>%s</thead><tbody>%s</tbody></table>';\n$rowformat = '<tr>%s</tr>'; \n$cellformat = '<...
2008/11/05
[ "https://Stackoverflow.com/questions/265423", "https://Stackoverflow.com", "https://Stackoverflow.com/users/572/" ]
265,425
<p>An XML attribute declared as xs:boolean can acceptable be "true", "false", "0" or "1". However, in .NET, Boolean.Parse() will only accept "true" or "false". If it sees a "0" or "1", it throws a "Bad Format" exception.</p> <p>So, given that, what's the best way to parse such a value into a Boolean?</p> <p>(Unfortunately, I'm limited to .NET 2.0 solutions, but if v3.5 offers something, I'd love to hear about it.)</p>
[ { "answer_id": 265440, "author": "mdb", "author_id": 8562, "author_profile": "https://Stackoverflow.com/users/8562", "pm_score": 2, "selected": false, "text": "CBool" }, { "answer_id": 265450, "author": "Panos", "author_id": 8049, "author_profile": "https://Stackoverf...
2008/11/05
[ "https://Stackoverflow.com/questions/265425", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12725/" ]
265,457
<p>Is there any BNF grammar for regular expression?</p>
[ { "answer_id": 32760631, "author": "n611x007", "author_id": 611007, "author_profile": "https://Stackoverflow.com/users/611007", "pm_score": 4, "selected": false, "text": "BNF Grammar of Regular Expressions\n\nFollowing the precedence rules given previously, a BNF grammar for Perl-style r...
2008/11/05
[ "https://Stackoverflow.com/questions/265457", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23051/" ]
265,478
<p>I have some HTML and jQuery that slides a <code>div</code> up and down to show or hide` it when a link is clicked:</p> <pre class="lang-html prettyprint-override"><code>&lt;ul class="product-info"&gt; &lt;li&gt; &lt;a href="#"&gt;YOU CLICK THIS TO SHOW/HIDE&lt;/a&gt; &lt;div class="toggle"&gt; &lt;p&gt;CONTENT TO SHOW/HIDE&lt;/p&gt; &lt;/div&gt; &lt;/li&gt; &lt;/ul&gt; </code></pre> <pre class="lang-js prettyprint-override"><code>$('div.toggle').hide(); $('ul.product-info li a').click(function(event){ $(this).next('div').slideToggle(200); } </code></pre> <p>My question is: How do I use <code>preventDefault()</code> to stop the link acting as a link and adding "#" to the end of my URL &amp; jumping to the top of the page?</p> <p>I can't figure out the right syntax, I just keep getting an error saying </p> <blockquote> <p>preventDefault() is not a function.</p> </blockquote>
[ { "answer_id": 265499, "author": "Davide Gualano", "author_id": 28582, "author_profile": "https://Stackoverflow.com/users/28582", "pm_score": 9, "selected": true, "text": "$('div.toggle').hide();\n$('ul.product-info li a').click(function(event) {\n event.preventDefault();\n $(this)...
2008/11/05
[ "https://Stackoverflow.com/questions/265478", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26107/" ]
265,481
<p>We moved our Visual C++ 2003 solution to Visual 2005 and now we have problems deploying to clean XP machines.</p> <p>Our solution has a DLL project and a command line executable which uses this DLL. Both projects create and embed manifest files.</p> <p>Our installer also copies the VC8 CRT runtimes from the C:\Programme\Microsoft Visual Studio 8\VC\redist\x86\Microsoft.VC80.CRT\ to the install dir.</p> <p>When we install on a clean Windows XP, we see the error message "Application has failed to start ... application configuration is incorrect."</p> <p>Putting the exe in Depends.exe, says:</p> <pre><code>Error: The Side-by-Side configuration information for "c:\program files\MySoftware\vc8\BENCHMARK.EXE" contains errors. This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem (14001). Error: The Side-by-Side configuration information for "c:\program files\MySoftware\vc8\MYLIB-VC8.DLL" contains errors. This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem (14001). Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module. </code></pre> <p>Event viewer logs:</p> <pre><code>Dependent Assembly Microsoft.VC80.CRT could not be found and Last Error was The referenced assembly is not installed on your system. Resolve Partial Assembly failed for Microsoft.VC80.CRT. Reference error message: The referenced assembly is not installed on your system. Generate Activation Context failed for C:\Program Files\MySoftware\vc8\Benchmark.exe. Reference error message: The operation completed successfully. </code></pre> <p>I've read copying the msvcp80.dll,msvcr80.dll,msvcm80.dll and Microsoft.VC80.CRT.manifest to application folder is sufficient.</p> <p>What am I doing wrong ?</p>
[ { "answer_id": 331440, "author": "gengmao", "author_id": 70742, "author_profile": "https://Stackoverflow.com/users/70742", "pm_score": 2, "selected": false, "text": "C/C++ -> Code Generation -> Runtime Library: Multi-threaded (/MT)\n" } ]
2008/11/05
[ "https://Stackoverflow.com/questions/265481", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23000/" ]
265,484
<p>I think the field type should be string of variable length (VARCHAR), but what length should I use? </p> <p>To clarify: I want to pick a size that would be able to store <em>average</em> URL, and don't really care about maximum possible.</p>
[ { "answer_id": 265509, "author": "scunliffe", "author_id": 6144, "author_profile": "https://Stackoverflow.com/users/6144", "pm_score": 1, "selected": false, "text": "javascript:var foo='bar';...alert('Hello World');\n" } ]
2008/11/05
[ "https://Stackoverflow.com/questions/265484", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28098/" ]
265,494
<p>I have a website which uses themes. Depending on the url (if it is A.something.com or B.something.com, where A and B represent clients), I will load a different theme. The intention is to use one codebase for different clients. I have an app_themes folder, several themes inside, for different clients, and different CSS files for each theme (for business reasons the CSS file is the same for each theme, but duplicated). So my code looks like this:</p> <p>Public Overrides Property StyleSheetTheme() As String</p> <pre><code> Get Dim myHost As String = Request.Url.Host Return myHost End Get Set(ByVal value As String) End Set End Property Protected Sub Page_PreInit(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreInit If Request.Url.Host.Contains("Savills") Then Page.Theme = "Savills" ElseIf Request.Url.Host.Contains("localhost") Then Page.Theme = "localhost" ElseIf Request.Url.Host.Contains("test.concepglobal.com") Then Page.Theme = "test.concepglobal.com" ElseIf Request.Url.Host.Contains("concepglobal") Then Page.Theme = "concepglobal" End If End Sub </code></pre> <p>My app_themes folder structure:</p> <p>App_Themes:</p> <p>localhost:</p> <p>Default.css</p> <p>Savills</p> <p>Savills.css</p> <p>However, everytime I load the site, the css is not picked up. So I don't get the h1 style I designed in the css (it is in there), but only the graphics specified in the aspx page.</p> <p>My source when running the site:</p> <p> (loading the site at that url).</p> <p>Confusingly, there is another link to the same css:</p> <p></p> <p>What am I doing wrong?</p> <p>Thanks </p>
[ { "answer_id": 265513, "author": "DOK", "author_id": 27637, "author_profile": "https://Stackoverflow.com/users/27637", "pm_score": 2, "selected": false, "text": "<location path=\"App_Themes\">\n <system.web>\n <authorization>\n <allow users=\"?\" />\n </authorization>...
2008/11/05
[ "https://Stackoverflow.com/questions/265494", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32484/" ]
265,505
<p>how do you go about saving images and displaying them from a SQL Server Image field when using ASP.NET MVC?</p> <p>Many thanks Nick</p>
[ { "answer_id": 271804, "author": "Simon Steele", "author_id": 4591, "author_profile": "https://Stackoverflow.com/users/4591", "pm_score": 0, "selected": false, "text": "public void RenderImage(int imageId)\n{\n // TODO: Replace this with your API to get the image blob data.\n byte[...
2008/11/05
[ "https://Stackoverflow.com/questions/265505", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5463/" ]
265,508
<p>I need a dropdown list on my page that will allow a user to select their state. Since this is probably a control that will be used elsewhere, I thought it would be a good idea to create an MVC View User Control that could be reused.</p> <p>I was thinking the control would look something like this:</p> <pre><code>&lt;select name="" id=""&gt; &lt;option value="AL"&gt;Alabama&lt;/option&gt; &lt;option value="AK"&gt;Alaska&lt;/option&gt; &lt;/select&gt; </code></pre> <p>And the code in my view would be something like:</p> <pre><code>&lt;%= Html.RenderPartial("StateDropdownControl") %&gt; </code></pre> <p>My question is, what's the best way to set the name and id on the control? I'd want to make sure I could have multiple instances of this control on one page, if needed. Also, I'd want to be able to send in the state that should be selected by default.</p> <p>Would I do it with ViewData somehow?</p>
[ { "answer_id": 265543, "author": "Corey Gaudin", "author_id": 31195, "author_profile": "https://Stackoverflow.com/users/31195", "pm_score": 2, "selected": false, "text": "" }, { "answer_id": 265598, "author": "CubanX", "author_id": 27555, "author_profile": "https://St...
2008/11/05
[ "https://Stackoverflow.com/questions/265508", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34720/" ]
265,515
<p>Just wondering what people think is the best practice when implementing an IValueConverter which does not have a meaningfull ConvertBack implementation (or one that is only to be used as OneWay)?</p> <p>Should it throw (and in that case what exception), return null or return some default value. </p> <p>Thoughts?</p>
[ { "answer_id": 265544, "author": "Todd White", "author_id": 30833, "author_profile": "https://Stackoverflow.com/users/30833", "pm_score": 7, "selected": true, "text": "IValueConverter.ConvertBack" }, { "answer_id": 265558, "author": "Tamir", "author_id": 30879, "autho...
2008/11/05
[ "https://Stackoverflow.com/questions/265515", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9222/" ]
265,516
<p>Are hints really necessary for every sql statement? We have a dba who is anal about it and asks us to put hints on every select and update statements in our stored procs. Is this really necessary?</p>
[ { "answer_id": 265550, "author": "Joel Coehoorn", "author_id": 3043, "author_profile": "https://Stackoverflow.com/users/3043", "pm_score": 1, "selected": false, "text": "with (nolock)" } ]
2008/11/05
[ "https://Stackoverflow.com/questions/265516", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2137/" ]
265,518
<p>Create a flat text file in c++ around 50 - 100 MB with the content 'Added first line' should be inserted in to the file for 4 million times</p>
[ { "answer_id": 265557, "author": "Ferruccio", "author_id": 4086, "author_profile": "https://Stackoverflow.com/users/4086", "pm_score": 4, "selected": false, "text": "creat()" }, { "answer_id": 265575, "author": "Kip", "author_id": 18511, "author_profile": "https://Sta...
2008/11/05
[ "https://Stackoverflow.com/questions/265518", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22076/" ]
265,524
<p>We have a few applications that use the same Linq 2 SQL DataContext. One of those Apps wil do massive inserts (it's a convertor from an old system). Is it possible to change the UpdateCheck of the TimeStamp column of each table at runtime ? Only for this one app we'd like to set it to Never, all the other apps should have Always.</p>
[ { "answer_id": 265582, "author": "Panos", "author_id": 8049, "author_profile": "https://Stackoverflow.com/users/8049", "pm_score": 1, "selected": false, "text": "[Column(Name=\"ITM_CREATE_DATE\", Storage=\"_ITM_CREATE_DATE\", DbType=\"DateTime NOT NULL\", UpdateCheck=UpdateCheck.Never)]\...
2008/11/05
[ "https://Stackoverflow.com/questions/265524", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34723/" ]
265,528
<p>Many web sites support folksonomy tags. You may have heard of <a href="http://microformats.org/wiki/reltag" rel="nofollow noreferrer">rel-tag</a>, where it says that "The last path component of the URL is the text of the tag".</p> <p>I am looking for a bookmarklet or greasemonkey script (javascript) to get the "last path component" for the URL currently being viewed in the browser, add that tag into another URL, and then open that page in a new tab or window.</p> <p>For example, if I am looking at a <a href="http://delicious.com/popular/foo" rel="nofollow noreferrer">delicious.com page with the tag "foo"</a>, I may want to create <a href="http://technorati.com/tag/foo" rel="nofollow noreferrer">a new URL with the tag "foo"</a>. This should also work for multiple tags in the last path component, such as, <a href="http://delicious.com/popular/foo+bar" rel="nofollow noreferrer">foo+bar</a>.</p> <p>Some <a href="http://microformats.org/discuss/mail/microformats-discuss/2008-June/012144.html" rel="nofollow noreferrer">regexp suggestions</a> have been offered.</p>
[ { "answer_id": 321492, "author": "Jan Goyvaerts", "author_id": 33358, "author_profile": "https://Stackoverflow.com/users/33358", "pm_score": 0, "selected": false, "text": "^[a-z]+://[^/#?]+/[^#?]*?([^#?/]+)(?:[#?]|$)\n" }, { "answer_id": 817324, "author": "Peter Boughton", ...
2008/11/05
[ "https://Stackoverflow.com/questions/265528", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31241/" ]
265,530
<p>IDE: Microsoft Visual Studio Professional 2008</p> <p>Language: C#</p> <p>Background: I have one form and two groupboxes that are going to be used as preference catagory groupboxes. My problem is that everytime I drag one groupbox on top of the other (hide/show groupboxes upon listview catagory select), the base groupbox auto-parents the second groupbox I just dragged on top.</p> <p>Question: How do I stop the two groupboxes from auto-parenting themselves when dragged on top of one another?</p> <p>// Edit;</p> <p>Q) I assume you are trying to acheive a layout where you swap out the visible box? --Mitchel Sellers</p> <p>A) Yes I am. I know I could do it at runtime but I'd like to make that my last option in case there is a more appropriate solution.</p>
[ { "answer_id": 423772, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 0, "selected": false, "text": " private void radioButton1_CheckedChanged(object sender, EventArgs e)\n {\n groupBox1.Location = new System.Drawi...
2008/11/05
[ "https://Stackoverflow.com/questions/265530", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
265,541
<p>Not wanting to re-invent the wheel or anything, I was wondering if there's a plugin out there a field or form validation plugin that works with Prototype that you can recommend from your own experience and why?</p>
[ { "answer_id": 267512, "author": "Chase Seibert", "author_id": 7679, "author_profile": "https://Stackoverflow.com/users/7679", "pm_score": 0, "selected": false, "text": "<input type=\"text\" name=\"myDate\" class=\"validate-date\"/>\n" } ]
2008/11/05
[ "https://Stackoverflow.com/questions/265541", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2977/" ]
265,559
<p>When @RadioServiceGroup is set to NULL, I want to return all the records from the sbi_l_radioservicecodes table which has about 120 records. However, when I execute the following procedure and set the @RadioServiceGroup to NULL, it returns no records. Here is the stored proc:</p> <pre><code>CREATE PROCEDURE [dbo].[GetRadioServiceCodes] @RadioServiceGroup nvarchar(1000) = NULL AS BEGIN IF(@RadioServiceGroup = NULL) BEGIN SELECT rsc.RadioService FROM sbi_l_radioservicecodes rsc END ELSE BEGIN SELECT rsc.RadioService FROM sbi_l_radioservicecodes rsc WHERE rsc.RadioServiceGroup = @RadioServiceGroup END END </code></pre>
[ { "answer_id": 265569, "author": "Joel Coehoorn", "author_id": 3043, "author_profile": "https://Stackoverflow.com/users/3043", "pm_score": 1, "selected": false, "text": "If" } ]
2008/11/05
[ "https://Stackoverflow.com/questions/265559", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33690/" ]
265,579
<p><strong>Update:</strong> Since development machine has moved to Vista, i now automatically test as a standard user. And with XP being phased out, this question isn't so relavent anymore.</p> <hr> <p>Since the Windows 2000 logo requirements, Microsoft has been requiring that applications run as standard user. Like everyone else i always ran my desktop as an administrative user. And like every developer: i log in, develop, run, and test as an administrative user.</p> <p>Now with a new push to finally support standard users, i've been testing my applications by running them as a normal user - either through RunAs, or having my application relaunch itself with normal rights using <code>[SaferCreateLevel][1]</code>/<code>[SaferComputeTokenFromLevel][2]</code> if it detects it is running as an administrator. i quickly see how specacularly some of my apps fail under Windows XP as a standard user (due to my own stupidity). i also see how the same applications work fine under Vista (thanks to it's numerous shims to fix my bugs for me). </p> <p><strong>Aside:</strong> It's ironic that applications are more likely to run on Vista as a standard user than on XP.</p> <p>The question is do you test your applications for standard user compatiblity? Do you develop as a standard user on XP? Do you ignore standard user access and hope for the best?</p> <hr> <p>i tried, as a bonus, to have my app relaunch itself as a limited user (rather than normal user). It doesn't even come up - Windows says it failed to initialize. So there an area of future research on my part: making the app even support limited user.</p> <hr> <p>i specifically referred to standard users on XP rather than Vista to enforce the truth that Vista is no different from XP as far as compatibility is concerned. And anyone who says their app fails on Vista must realize it also fails on XP.</p>
[ { "answer_id": 265590, "author": "Joel Coehoorn", "author_id": 3043, "author_profile": "https://Stackoverflow.com/users/3043", "pm_score": 2, "selected": false, "text": "Application Data" } ]
2008/11/05
[ "https://Stackoverflow.com/questions/265579", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12597/" ]
265,585
<p>For example:</p> <pre><code>public class A : A.B { public class B { } } </code></pre> <p>Which generates this error from the compiler:</p> <blockquote> <p>Circular base class dependency involving 'A' and 'A.B'</p> </blockquote> <p>I always figured a nested class behaved just like a regular class except with special rules concerning accessing the outer class's private members, but I guess there's some implicit inheritance occurring between the two classes?</p>
[ { "answer_id": 265599, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 6, "selected": true, "text": "A.B x = new A.B.B.B.B.B.B.B.B.B.B.B.B();\n" }, { "answer_id": 265838, "author": "Tinister", "author_id": ...
2008/11/05
[ "https://Stackoverflow.com/questions/265585", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34715/" ]
265,592
<p>Let me preface this by saying I don't care what language this solution gets written in as long as it runs on windows. </p> <p>My problem is this: there is a site that has data which is frequently updated that I would like to get at regular intervals for later reporting. The site requires JavaScript to work properly so just using wget doesn't work. What is a good way to either embed a browser in a program or use a stand-alone browser to routinely scrape the screen for this data? </p> <p>Ideally, I'd like to grab certain tables on the page but can resort to regular expressions if necessary.</p>
[ { "answer_id": 265618, "author": "Tomalak", "author_id": 18771, "author_profile": "https://Stackoverflow.com/users/18771", "pm_score": 2, "selected": false, "text": "CreateObject(\"InternetExplorer.Application\")" } ]
2008/11/05
[ "https://Stackoverflow.com/questions/265592", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14744/" ]
265,605
<p>I have a stored procedure that creates and opens some cursors. It closes them at the end, but if it hits an error those cursors are left open! Then subsequent runs fail when it tries to create cursors since a cursor with the name already exists.</p> <p>Is there a way I can query which cursors exists and if they are open or not so I can close and deallocate them? I feel like this is better than blindly trying to close and swallow errors.</p>
[ { "answer_id": 278120, "author": "Aaron Silverman", "author_id": 26197, "author_profile": "https://Stackoverflow.com/users/26197", "pm_score": 3, "selected": true, "text": "CREATE PROCEDURE dbo.p_cleanUpCursor @cursorName varchar(255) AS\nBEGIN\n\n DECLARE @cursorStatus int\n SET @...
2008/11/05
[ "https://Stackoverflow.com/questions/265605", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26197/" ]
265,613
<p>How can I add new application mapping in IIS using vbscript?</p> <p>Thanks,</p>
[ { "answer_id": 265701, "author": "Tomalak", "author_id": 18771, "author_profile": "https://Stackoverflow.com/users/18771", "pm_score": 2, "selected": false, "text": "adsutil.vbs" } ]
2008/11/05
[ "https://Stackoverflow.com/questions/265613", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
265,628
<p>I added the columns in the select list to the order by list, but it is still giving me the error:</p> <p>ORDER BY items must appear in the select list if SELECT DISTINCT is specified.</p> <p>Here is the stored proc:</p> <pre><code>CREATE PROCEDURE [dbo].[GetRadioServiceCodesINGroup] @RadioServiceGroup nvarchar(1000) = NULL AS BEGIN SET NOCOUNT ON; SELECT DISTINCT rsc.RadioServiceCodeId, rsc.RadioServiceCode + ' - ' + rsc.RadioService as RadioService FROM sbi_l_radioservicecodes rsc INNER JOIN sbi_l_radioservicecodegroups rscg ON rsc.radioservicecodeid = rscg.radioservicecodeid WHERE rscg.radioservicegroupid IN (select val from dbo.fnParseArray(@RadioServiceGroup,',')) OR @RadioServiceGroup IS NULL ORDER BY rsc.RadioServiceCode,rsc.RadioServiceCodeId,rsc.RadioService END </code></pre>
[ { "answer_id": 265637, "author": "Joel Coehoorn", "author_id": 3043, "author_profile": "https://Stackoverflow.com/users/3043", "pm_score": 6, "selected": false, "text": "DISTINCT" }, { "answer_id": 265641, "author": "Chris Van Opstal", "author_id": 7264, "author_profi...
2008/11/05
[ "https://Stackoverflow.com/questions/265628", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33690/" ]
265,639
<p>I've got a text file that contains several 'records' inside of it. Each record contains a name and a collection of numbers as data. </p> <p>I'm trying to build a class that will read through the file, present only the names of all the records, and then allow the user to select which record data he/she wants. </p> <p>The first time I go through the file, I only read header names, but I can keep track of the 'position' in the file where the header is. I need random access to the text file to seek to the beginning of each record after a user asks for it.</p> <p>I have to do it this way because the file is too large to be read in completely in memory (1GB+) with the other memory demands of the application.</p> <p>I've tried using the .NET StreamReader class to accomplish this (which provides very easy to use 'ReadLine' functionality, but there is no way to capture the true position of the file (the position in the BaseStream property is skewed due to the buffer the class uses).</p> <p>Is there no easy way to do this in .NET? </p>
[ { "answer_id": 267056, "author": "Corbin March", "author_id": 7625, "author_profile": "https://Stackoverflow.com/users/7625", "pm_score": 3, "selected": false, "text": "using (BinaryWriter writer = \n new BinaryWriter(File.Open(\"data.txt\", FileMode.Create)))\n{\n writer.Write(\"o...
2008/11/05
[ "https://Stackoverflow.com/questions/265639", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
265,644
<p>What is the best way to build a dynamic <em>Threaded</em> ASP.net radio button list? I am not that familiar with <code>RadioButtonLists</code> and it is my understanding that ASP.net doesn't like the application of individual styling of <code>ListItems</code>.</p>
[ { "answer_id": 265668, "author": "Tor Haugen", "author_id": 32050, "author_profile": "https://Stackoverflow.com/users/32050", "pm_score": 1, "selected": false, "text": "RadioButtonList" } ]
2008/11/05
[ "https://Stackoverflow.com/questions/265644", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3111/" ]