qid
int64
4
22.2M
question
stringlengths
18
48.3k
answers
list
date
stringlengths
10
10
metadata
list
295,287
<p>Is there any way to 'hide' the name of a class, whose sole purpose is to provide extension methods, from Intellisense? </p> <p>I would like to remove the class name from the Intellisense list but need the extension methods of the class to be available to external assemblies via Intellisense in the usual way.</p>
[ { "answer_id": 295311, "author": "Hallgrim", "author_id": 15454, "author_profile": "https://Stackoverflow.com/users/15454", "pm_score": 2, "selected": false, "text": "[EditorBrowsable(EditorBrowsableState.Never)]\nstatic class MyExtensions { }\n" }, { "answer_id": 295427, "au...
2008/11/17
[ "https://Stackoverflow.com/questions/295287", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27805/" ]
295,291
<p>I'm currently doing the following to use typed datasets in vs2008: </p> <p>Right click on "app_code" add new dataset, name it tableDS.</p> <p>Open tableDS, right click, add "table adapter"</p> <p>In the wizard, choose a pre defined connection string, "use SQL statements"</p> <p>select * from tablename and next + next to finish. (I generate one table adapter for each table in my DB)</p> <p>In my code I do the following to get a row of data when I only need one: </p> <p>cpcDS.tbl_cpcRow tr = (cpcDS.tbl_cpcRow)(new cpcDSTableAdapters.tbl_cpcTableAdapter()).GetData().Select("cpcID = " + cpcID)[0];</p> <p>I believe this will get the entire table from the database and to the filtering in dotnet (ie not optimal), is there any way I can get the tableadapter to filer the result set on the database instead (IE what I want to is send select * from tbl_cpc where cpcID = 1 to the database)</p> <p>And as a side note, I think this is a fairly ok design pattern for getting data from a database in vs2008. It's fairly easy to code with, read and mantain. But I would like to know it there are any other design patterns that is better out there? I use the datasets for read/update/insert and delete. </p>
[ { "answer_id": 295324, "author": "Marc Gravell", "author_id": 23354, "author_profile": "https://Stackoverflow.com/users/23354", "pm_score": 2, "selected": true, "text": "int id = ... // the primary key we want to look for\nusing(var ctx = new MydataContext()) {\n SomeType record = ctx....
2008/11/17
[ "https://Stackoverflow.com/questions/295291", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37083/" ]
295,314
<p>When I launch an ant script from Eclipse 3.4.x it prints the output to console until certain stage. After that it often hangs (wait forever). Last lines that I see at the screen (console) - partial output from my obfuscator.</p> <p>Under Eclipse 3.3.2 everything works fine (the same project, workspace, settings, JVM etc.).</p> <p>Does anybody have the same issue? Any thoughts how to fix it?</p>
[ { "answer_id": 295352, "author": "VonC", "author_id": 6309, "author_profile": "https://Stackoverflow.com/users/6309", "pm_score": 0, "selected": false, "text": "-diagnostics" } ]
2008/11/17
[ "https://Stackoverflow.com/questions/295314", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19347/" ]
295,315
<p>I have this java code:</p> <pre><code>&lt;script src="http://www.google.com/jsapi"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; google.load("jquery", "1.2.6"); $("a#more").click(function() { $("#info_box").show("blind", { direction: "vertical" }, 800); }); &lt;/script&gt; </code></pre> <p>And this link:</p> <pre><code>&lt;a href="#" id="more"&gt;More Info...&lt;/a&gt; </code></pre> <p>info_box is just a div with the properties:</p> <pre><code>width: 30%; position: absolute; left: 35%; top: 250px; background-color: #FFFFFF; border: 2px solid #000000; visibility: hidden; </code></pre> <p>How can this not be working, been trying to figure it out for 20 minutes.</p>
[ { "answer_id": 295331, "author": "DisgruntledGoat", "author_id": 37947, "author_profile": "https://Stackoverflow.com/users/37947", "pm_score": 1, "selected": false, "text": "\"blind\"" }, { "answer_id": 295351, "author": "Eduardo Molteni", "author_id": 2385, "author_p...
2008/11/17
[ "https://Stackoverflow.com/questions/295315", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26823/" ]
295,321
<p>When using gdb and Vim, often I want to stop on a particular line. Normally in Vim I copy-paste the line number showing on the rule area to the gdb session. It'd save me a lot of hassle if I could use something like <code>"+&lt;magic-incantation&gt;</code> to copy the line number of the current cursor position into the xclipboard buffer. Is this possible?</p>
[ { "answer_id": 295356, "author": "Gowri", "author_id": 3253, "author_profile": "https://Stackoverflow.com/users/3253", "pm_score": 5, "selected": true, "text": "map ,n <Esc>:let @*=line(\".\")<CR>\n" }, { "answer_id": 295366, "author": "PierreBdR", "author_id": 7136, ...
2008/11/17
[ "https://Stackoverflow.com/questions/295321", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4596/" ]
295,333
<p>If you put up an <code>NSAlert</code> while your app is in the background your dock icon starts bouncing and keeps on bouncing until you switch back. </p> <p>I find this annoying. </p> <p>Does anyone know how disable that for a single app? </p>
[ { "answer_id": 295372, "author": "Matthew Schinckel", "author_id": 188, "author_profile": "https://Stackoverflow.com/users/188", "pm_score": 0, "selected": false, "text": "- (void)cancelUserAttentionRequest:(int)request\n" }, { "answer_id": 295453, "author": "Dirk Stoop", ...
2008/11/17
[ "https://Stackoverflow.com/questions/295333", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22147/" ]
295,336
<p>I'm still working on groking the F# thing - trying to work out how to 'think' in F# rather than just translating from other languages I know.</p> <p>I've recently been thinking about the cases where you don't have a 1:1 map between before and after. Cases where List.map falls down.</p> <p>One example of this is moving averages, where typically you will have len-n+1 results for a list of length len when averaging over n items.</p> <p>For the gurus out there, is this a good way to do it (using queue pinched from <a href="http://blogs.msdn.com/jomo_fisher/archive/2007/12/12/strange-confluence-an-immutable-queue-in-f.aspx" rel="noreferrer">Jomo Fisher</a>)?</p> <pre><code>//Immutable queue, with added Length member type Fifo&lt;'a&gt; = new()={xs=[];rxs=[]} new(xs,rxs)={xs=xs;rxs=rxs} val xs: 'a list; val rxs: 'a list; static member Empty() = new Fifo&lt;'a&gt;() member q.IsEmpty = (q.xs = []) &amp;&amp; (q.rxs = []) member q.Enqueue(x) = Fifo(q.xs,x::q.rxs) member q.Length() = (List.length q.xs) + (List.length q.rxs) member q.Take() = if q.IsEmpty then failwith "fifo.Take: empty queue" else match q.xs with | [] -&gt; (Fifo(List.rev q.rxs,[])).Take() | y::ys -&gt; (Fifo(ys, q.rxs)),y //List module, add function to split one list into two parts (not safe if n &gt; lst length) module List = let splitat n lst = let rec loop acc n lst = if List.length acc = n then (List.rev acc, lst) else loop (List.hd lst :: acc) n (List.tl lst) loop [] n lst //Return list with moving average accross len elements of lst let MovingAverage (len:int) (lst:float list) = //ugly mean - including this in Fifo kills genericity let qMean (q:Fifo&lt;float&gt;) = ((List.sum q.xs) + (List.sum q.rxs))/(float (q.Length())) //get first part of list to initialise queue let (init, rest) = List.splitat len lst //initialise queue with first n items let q = new Fifo&lt;float&gt;([], init) //loop through input list, use fifo to push/pull values as they come let rec loop (acc:float list) ls (q:Fifo&lt;float&gt;) = match ls with | [] -&gt; List.rev acc | h::t -&gt; let nq = q.Enqueue(h) //enqueue new value let (nq, _) = nq.Take() //drop old value loop ((qMean nq)::acc) t nq //tail recursion loop [qMean q] rest q //Example usage MovingAverage 3 [1.;1.;1.;1.;1.;2.;2.;2.;2.;2.] </code></pre> <p>(Maybe a better way would be to implement a MovingAverageQueue by inheriting from Fifo?)</p>
[ { "answer_id": 295537, "author": "xtofl", "author_id": 6610, "author_profile": "https://Stackoverflow.com/users/6610", "pm_score": -1, "selected": false, "text": "let" }, { "answer_id": 295604, "author": "Benjol", "author_id": 11410, "author_profile": "https://Stackov...
2008/11/17
[ "https://Stackoverflow.com/questions/295336", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11410/" ]
295,337
<p>i'm currently experimenting using PixelShaders introduced with .net 3.5 sp1 to improve image processing performance. everything is much faster , but til yet i just had effects applied to some elements in my wpf forms, that i actually want to avoid.</p> <p>we have a bunch of image processing functionality and i'd like to replace some othe the stuff piece by piece with pixel shaders to gain some performance. is there a way to apply such a pixel shader to an ImageSource without having to display it?</p>
[ { "answer_id": 18466797, "author": "H B", "author_id": 521443, "author_profile": "https://Stackoverflow.com/users/521443", "pm_score": 3, "selected": true, "text": "//prepare images\nimg = new Image();\nimg.Stretch = Stretch.None;\nviewbox = new Viewbox();\nviewbox.Stretch = Stretch.None...
2008/11/17
[ "https://Stackoverflow.com/questions/295337", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20227/" ]
295,345
<p>I need to encrypt a small block of data (16 bytes) using 512 bit RSA public key -- quite an easy task for most cryptography libraries known to me, except for MS CSP API, as it seems. Documentation for <a href="http://msdn.microsoft.com/en-us/library/aa379924(VS.85).aspx" rel="nofollow noreferrer">CryptEncrypt</a> function states that</p> <blockquote> <p>The Microsoft Enhanced Cryptographic Provider supports direct encryption with RSA public keys and decryption with RSA private keys. The encryption uses PKCS #1 padding.</p> </blockquote> <p>It didn't work to me though. Well, my code works and produces encrypted block of data with correct size, but openssl fails to decypher it. It looks much like CryptEncrypt still uses symmetric cypher.</p> <p>Unfortunately all the examples I've found refer to combined cryptography with symmetric cypher, so I don't have a working example on hands which definitely would make things easier.</p> <p>Could please anyone point me to such an example or let me know if there are some not that obvious pitfalls I've missed?</p> <p>Thank you.</p>
[ { "answer_id": 18466797, "author": "H B", "author_id": 521443, "author_profile": "https://Stackoverflow.com/users/521443", "pm_score": 3, "selected": true, "text": "//prepare images\nimg = new Image();\nimg.Stretch = Stretch.None;\nviewbox = new Viewbox();\nviewbox.Stretch = Stretch.None...
2008/11/17
[ "https://Stackoverflow.com/questions/295345", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2231145/" ]
295,348
<p>I'm looking for a way to <strong>monitor certain Windows services</strong> (on Windows Server 2003) and <strong>restart if necessar</strong>y. The services are on different servers and include mainly SQL Server services (e.g. SQL Server Agent), but also some proprietary services.</p> <p>Email alerts sent out if a service has stopped would be very useful as well.</p>
[ { "answer_id": 295362, "author": "VonC", "author_id": 6309, "author_profile": "https://Stackoverflow.com/users/6309", "pm_score": 3, "selected": false, "text": "wmic /node:[hostname] service list\n" }, { "answer_id": 295363, "author": "Tomalak", "author_id": 18771, "a...
2008/11/17
[ "https://Stackoverflow.com/questions/295348", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16279/" ]
295,358
<p>I want to save a set of email addresses collected from a text field (separated by commas) into a single field in a table. I am trying to use serialize but I'm getting SerializationTypeMismatch error. How can I do this?</p> <p>This is my model:</p> <p>class Crew &lt; ActiveRecord::Base</p> <p>class Recipients &lt; HashWithIndifferentAccess ; end</p> <p>serialize :recipients, Recipients</p> <p>end</p>
[ { "answer_id": 295393, "author": "Stein G. Strindhaug", "author_id": 26115, "author_profile": "https://Stackoverflow.com/users/26115", "pm_score": 2, "selected": false, "text": "has_many :emails" } ]
2008/11/17
[ "https://Stackoverflow.com/questions/295358", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
295,383
<p>When I delete a visual component in a base form, and forget any references in inherited forms, my application only breaks in runtime.</p> <p>What I normally do is to use a search tool to find references in .DFM, but I'm not completely satisfied with this method.</p> <p>Do you have any better recommendations?</p>
[ { "answer_id": 295431, "author": "Toon Krijthe", "author_id": 18061, "author_profile": "https://Stackoverflow.com/users/18061", "pm_score": 1, "selected": false, "text": "inherited Form1: TForm1\n Caption = 'Form1'\n PixelsPerInch = 96\n TextHeight = 13\nend\n" } ]
2008/11/17
[ "https://Stackoverflow.com/questions/295383", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2089/" ]
295,384
<p>How can I see which file extensions are related to which kind of syntax highlighting? Unfortunately, <code>Tools -&gt; Options -&gt; Text Editor -&gt; File Extensions</code> lists only those entered manually, no default ones. And I didn't manage to find it on my own via Google or other means. </p> <p>My particular problem is, I want to have .inc highlighted exactly as .asp but I'm not sure which editor is used for .asp. I did try the following (none worked):</p> <ul> <li>Web Form Editor </li> <li>VBscript Editor </li> <li>HTML Editor</li> <li>Script Editor</li> </ul> <p>(They did work in a sense that they colored my code in one way or another, but it wasn't the same highlight as I get for <code>.asp</code> files).</p>
[ { "answer_id": 295431, "author": "Toon Krijthe", "author_id": 18061, "author_profile": "https://Stackoverflow.com/users/18061", "pm_score": 1, "selected": false, "text": "inherited Form1: TForm1\n Caption = 'Form1'\n PixelsPerInch = 96\n TextHeight = 13\nend\n" } ]
2008/11/17
[ "https://Stackoverflow.com/questions/295384", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25413/" ]
295,386
<p>How can I create a scheduled task to run a PHP file?<br /> Yes, I filled out everything in the scheduled task, but it still doesn't work.</p> <blockquote> <p>Run: &quot;C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\WEB\4w_website\save.php&quot;</p> <p>Start in: &quot;C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\WEB\4w_website&quot;</p> </blockquote> <p>It just opens the PHP file in Notepad.</p> <p>I gave the correct user name and pwd.</p> <p>Please help me..</p>
[ { "answer_id": 9122112, "author": "matobago", "author_id": 1186446, "author_profile": "https://Stackoverflow.com/users/1186446", "pm_score": 4, "selected": false, "text": ".bat" }, { "answer_id": 11304858, "author": "charles", "author_id": 1312690, "author_profile": "...
2008/11/17
[ "https://Stackoverflow.com/questions/295386", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38172/" ]
295,387
<p>I am writing a windows service. This service runs another process I've developed through Process class methods, but I want to run this process on debug mode also, using breakpoints, for instance.</p> <p>How can I do this?</p>
[ { "answer_id": 295424, "author": "Ulf Lindback", "author_id": 30354, "author_profile": "https://Stackoverflow.com/users/30354", "pm_score": 3, "selected": true, "text": "#if DEBUG\n System.Diagnostics.Debugger.Break();\n#endif\n" } ]
2008/11/17
[ "https://Stackoverflow.com/questions/295387", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21668/" ]
295,402
<p>In our organization, we have the following problem. We want to have our web tree revision-controlled, but many of us want to be able to alter (and check in) any file of that tree. We would also like there to be only a single check-out for all this because the tree is rather huge. For parts of that tree, we are currently using RCS, which allows for the behavior described above, but has several other drawbacks, of course.</p> <p>Does anyone know how to do such a thing (maybe with some kind of workaround) with Subversion on a Unix server?</p>
[ { "answer_id": 295807, "author": "Ken Gentle", "author_id": 8709, "author_profile": "https://Stackoverflow.com/users/8709", "pm_score": 1, "selected": false, "text": "svn" }, { "answer_id": 296382, "author": "Greg Hewgill", "author_id": 893, "author_profile": "https:/...
2008/11/17
[ "https://Stackoverflow.com/questions/295402", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
295,403
<p>Many times I use 'mqsc' for create MQ queue manager from script files but I don't know how to generate script files.</p> <p>Thanks</p>
[ { "answer_id": 2718735, "author": "T.Rob", "author_id": 214668, "author_profile": "https://Stackoverflow.com/users/214668", "pm_score": 1, "selected": false, "text": "DIS CHL(*) ALL\n" } ]
2008/11/17
[ "https://Stackoverflow.com/questions/295403", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24550/" ]
295,415
<p>I have a .net winforms app which has a few animation effects, fade ins and scroll animations etc. These work fine however if I'm in a Remote Desktop Protocol session the animations start to grate.</p> <p>Can someone suggest a way of determining whether or not an app is running across an RDP session so I can turn the effects off in this case?</p>
[ { "answer_id": 295437, "author": "George Stocker", "author_id": 16587, "author_profile": "https://Stackoverflow.com/users/16587", "pm_score": 2, "selected": false, "text": " BOOL IsRemoteSession(void){\n return GetSystemMetrics( SM_REMOTESESSION );\n }\n" }, { "answer_id":...
2008/11/17
[ "https://Stackoverflow.com/questions/295415", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29411/" ]
295,417
<p>I need to have a string, based on an integer, which should always have 5 digits.</p> <p>Example:</p> <pre><code>myInteger = 999 formatedInteger = "00999" </code></pre> <p>What is the best way of doing this in classic ASP?</p>
[ { "answer_id": 295440, "author": "Jonathan Lonowski", "author_id": 15031, "author_profile": "https://Stackoverflow.com/users/15031", "pm_score": 2, "selected": false, "text": "function PadNumber(number, width)\n dim padded : padded = cStr(number)\n\n while (len(padded) < width)\n ...
2008/11/17
[ "https://Stackoverflow.com/questions/295417", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2019426/" ]
295,419
<p>What is the best free way to get your maintenance plan-generated backups compressed?</p> <p>I know there are non-free tools that will compress the backups, but I'm not interested in them.</p> <p>Options:</p> <ol> <li>Have a T-SQL task after the backups that will run a script through xp_cmdshell that compresses every non compressed backup.</li> <li>???</li> </ol> <p>Any other ideas welcome, I'd like to avoid writing a script/program.</p>
[ { "answer_id": 1784533, "author": "Clay Lenhart", "author_id": 113088, "author_profile": "https://Stackoverflow.com/users/113088", "pm_score": 3, "selected": true, "text": "msbp.exe backup \"db(database=model)\" \"zip64\" \"local(path=c:\\model.full.bak.zip)\"\n" } ]
2008/11/17
[ "https://Stackoverflow.com/questions/295419", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5190/" ]
295,421
<p>I'm trying to find an editor (or some simple JavaScript - preferably jQuery) that will allow me to edit the contents of a textarea.</p> <p>I don't want it to be rich text or WYSIWYG; I just want to be able to select a bit of text, click a button/link and have some simple HTML tags that I define put either side of the highlighted text. I also want to be able to insert empty tags at the cursor if no text is selected in the textarea. Essentially, what I'm looking for is similar to the Stack Overflow text editor, but for custom HTML, not Markdown.</p> <p>What options are there that I could use?</p> <p>Thanks in advance.</p>
[ { "answer_id": 295429, "author": "Phil Jenkins", "author_id": 35496, "author_profile": "https://Stackoverflow.com/users/35496", "pm_score": 2, "selected": true, "text": "document.selection" } ]
2008/11/17
[ "https://Stackoverflow.com/questions/295421", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21709/" ]
295,438
<p>I need to test a function that needs to query a page on an external server using urllib.urlopen (it also uses urllib.urlencode). The server could be down, the page could change; I can't rely on it for a test.</p> <p>What is the best way to control what urllib.urlopen returns?</p>
[ { "answer_id": 295465, "author": "Douglas Leeder", "author_id": 3978, "author_profile": "https://Stackoverflow.com/users/3978", "pm_score": 3, "selected": false, "text": "class Processor(oject):\n def __init__(self, fetcher):\n self.m_fetcher = fetcher\n\n def doProcessing(s...
2008/11/17
[ "https://Stackoverflow.com/questions/295438", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1771/" ]
295,448
<p>A number of business areas I work with use a folder structure to organise their Sharepoint housed documents (not ideal I know, but we're stuck with it). </p> <p>I would like to use a web part page to present a number of views of their document libraries based on the subfolders that the documents appear in, but this is proving more difficult than I had thought. Has anyone overcome this problem in the past?</p>
[ { "answer_id": 6751423, "author": "schletti2000", "author_id": 852531, "author_profile": "https://Stackoverflow.com/users/852531", "pm_score": 4, "selected": false, "text": "<Where>\n <Contains>\n <FieldRef Name='FileDirRef' />\n <Value Type='Lookup'>MyFolder</Value>\n </Co...
2008/11/17
[ "https://Stackoverflow.com/questions/295448", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
295,455
<p>In Oracle we can print output by <code>dbms_output.put_line()</code> but I don't know to do the same thing in DB2.</p> <p>I currently use <code>signal</code> for printing some messages when I debug.</p>
[ { "answer_id": 6751423, "author": "schletti2000", "author_id": 852531, "author_profile": "https://Stackoverflow.com/users/852531", "pm_score": 4, "selected": false, "text": "<Where>\n <Contains>\n <FieldRef Name='FileDirRef' />\n <Value Type='Lookup'>MyFolder</Value>\n </Co...
2008/11/17
[ "https://Stackoverflow.com/questions/295455", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24550/" ]
295,459
<p>How do I execute the following shell command using the Python <a href="https://docs.python.org/library/subprocess.html" rel="noreferrer"><code>subprocess</code></a> module?</p> <pre><code>echo "input data" | awk -f script.awk | sort &gt; outfile.txt </code></pre> <p>The input data will come from a string, so I don't actually need <code>echo</code>. I've got this far, can anyone explain how I get it to pipe through <code>sort</code> too?</p> <pre><code>p_awk = subprocess.Popen(["awk","-f","script.awk"], stdin=subprocess.PIPE, stdout=file("outfile.txt", "w")) p_awk.communicate( "input data" ) </code></pre> <p><strong>UPDATE</strong>: Note that while the accepted answer below doesn't actually answer the question as asked, I believe S.Lott is right and it's better to avoid having to solve that problem in the first place!</p>
[ { "answer_id": 295471, "author": "geocar", "author_id": 37507, "author_profile": "https://Stackoverflow.com/users/37507", "pm_score": 2, "selected": false, "text": "Popen" }, { "answer_id": 295564, "author": "S.Lott", "author_id": 10661, "author_profile": "https://Sta...
2008/11/17
[ "https://Stackoverflow.com/questions/295459", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3715/" ]
295,472
<p>I am using xsl to control the output of my xml file, but the BOM character is being added.</p>
[ { "answer_id": 300474, "author": "Benedikt Waldvogel", "author_id": 4308, "author_profile": "https://Stackoverflow.com/users/4308", "pm_score": 7, "selected": false, "text": "# vim file.xml\n:set nobomb\n:wq\n" }, { "answer_id": 7664724, "author": "ken", "author_id": 9077...
2008/11/17
[ "https://Stackoverflow.com/questions/295472", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
295,511
<p>MS Access allows the numeric type GUID (in German it's called 'Replikations-ID', so I guess in English that would be 'replication id') which is stored as a 16 byte binary field in the database.</p> <p>I found how to access these fields in Delphi with <a href="http://docwiki.embarcadero.com/Libraries/Tokyo/en/Data.Win.ADODB.TADOQuery" rel="nofollow noreferrer"><strong>TADOQuery</strong></a>/<a href="http://docwiki.embarcadero.com/Libraries/Tokyo/en/Data.Win.ADODB.TADOTable" rel="nofollow noreferrer"><strong>TADOTable</strong></a> using </p> <pre><code>(TheQuery.FieldByName('SomeGuidField') as TGUIDField).AsGuid; </code></pre> <p>But now I want to execute an SQL-Query like this:</p> <pre><code>SELECT * FROM SomeTable WHERE SomeGuidField=:AGuid </code></pre> <p>I tried setting a <a href="http://docwiki.embarcadero.com/Libraries/Tokyo/en/Data.Win.ADODB.TADOQuery.SQL" rel="nofollow noreferrer"><strong>TADOQuery.SQL</strong></a> property to the above statement, but found no way to actually set the <code>AGuid</code> parameter such that the query can be opened. Whatever I tried resulted in the (ADO/COM) error </p> <blockquote> <p>No value given for one or more required parameters</p> </blockquote> <p>For example:</p> <pre><code>TheQuery.ParamByName('AGuid').Value := QuotedString(GuidToStr(AGuid)); TheQuery.Open; // &lt;&lt;== crashes here </code></pre> <p>This doesn't work either:</p> <pre><code>TheQuery.ParamByName('AGuid').Value := GuidToStr(AGuid); TheQuery.Open; // &lt;&lt;== crashes here </code></pre> <p>I had a look at how <code>TGuidField(...).AsGuid</code> works and found that it first converts the GUID to a string and then the string to a variant (and vice versa).</p> <p>It works fine, if I always generate the SQL-Statement like this:</p> <pre><code>SELECT * FROM SomeTable WHERE SomeGuidField='&lt;a guid goes here&gt;' </code></pre> <p>As I am passing that <strong>TADOQuery</strong> object around in the program I would like to only change the <code>AGuid</code>-Parameter to keep most methods agnostic on the actual SQL-Statement.</p> <p>Is there any other way to set a GUID-Parameter than always change the complete SQL-Statement?</p> <p>(It must be a GUID because I need a globally unique identifier to synchronize with other databases which are MS SQL or MS Access based.)</p> <p><strong>Edit</strong> vradmilovic is right, this works:</p> <pre><code>TheQuery.ParamByName('AGuid').Value := GuidToStr(AGuid); TheQuery.Open; </code></pre> <p>I don't understand why it didn't work the first time I tried it.</p>
[ { "answer_id": 295571, "author": "Steve", "author_id": 22712, "author_profile": "https://Stackoverflow.com/users/22712", "pm_score": -1, "selected": false, "text": "TGuidField(TheQuery.ParamByName('AGuid')).AsGuid\n" }, { "answer_id": 1192730, "author": "Community", "auth...
2008/11/17
[ "https://Stackoverflow.com/questions/295511", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21506/" ]
295,515
<p>Inside my code I'm generating hashes of URLs, (which are practically of unbounded length). I'm currently using sha1(), which I know has a tiny chance of a collision, but I have up to 255 bytes to store the hash in so feel that I might as well use that available space to lower the chance of collision even further.</p> <p>Is there either:</p> <ol> <li>Another PHP hash function with a longer or customisable hash length?</li> <li>A way of using a fixed-length hash function like sha1 with a variable length input to generate a longer hash?</li> </ol> <p>Or, is sha1's 20-byte hash good enough for anything and I should stop worrying about it?</p>
[ { "answer_id": 295667, "author": "tvanfosson", "author_id": 12950, "author_profile": "https://Stackoverflow.com/users/12950", "pm_score": 0, "selected": false, "text": "found = false\nhv = hash(urlValue)\nif table[hash,url] contains pair (hv,urlValue)\n found = true\nendif\n\nif (not f...
2008/11/17
[ "https://Stackoverflow.com/questions/295515", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34024/" ]
295,523
<p>I need to increase the max_allowed_packet param, to fit some theoretically very large items. If I set this param to say 10M, what price if any am I paying compared to setting it to 1M or 4M. Thanks for any input! Tomas</p>
[ { "answer_id": 296241, "author": "Bill Karwin", "author_id": 20860, "author_profile": "https://Stackoverflow.com/users/20860", "pm_score": 3, "selected": true, "text": "http://www.astahost.com/info.php/max_allowed_packet-mysql_t2725.html" } ]
2008/11/17
[ "https://Stackoverflow.com/questions/295523", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38231/" ]
295,524
<p>I'm looking for a web based upload manager, with good support for images. It should be as easy as possible for novice users to "add images to a website". I could use such a thing for two use cases:</p> <ul> <li>A CMS for external use, needs proper image support (1-file upload doesn't quite cut it).</li> <li>A Wiki for internal use, to get popular it will need the ability to put in screenshots easily without bothering with "save screenshot to file - upload file - put complicated markup on page to display image".</li> </ul> <p>Ideally, the thing I'm looking for shows galleries of uploaded images and allows the user to add/remove/replace images. </p> <p>I know there are probably a lot of server-side PHP scripts that can do things like this, in a pop-up window, or with AJAX, but where they're all lacking is in copy/paste support. Especially for the internal support site, a printscreen + paste would be an ideal solution, but I'm unable to find a package that supports this.</p> <p>I'm guessing this should be possible using Flash; unless there's no way to paste image data into a Flash file. I don't know much about that though. I could probably develop something myself, but I really don't want to have to learn Flash, and I don't have the $$ to pay for the Flash development tools.</p> <p>So tell me, is it even possible to copy/paste bitmap data into a Flash movie? And has someone perhaps already written an elegant image/upload manager that makes use of it?</p>
[ { "answer_id": 296241, "author": "Bill Karwin", "author_id": 20860, "author_profile": "https://Stackoverflow.com/users/20860", "pm_score": 3, "selected": true, "text": "http://www.astahost.com/info.php/max_allowed_packet-mysql_t2725.html" } ]
2008/11/17
[ "https://Stackoverflow.com/questions/295524", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2474/" ]
295,533
<p>say I have an asynchronous library, written in native C++, with an interface similar to this:</p> <pre><code>class connection { public: boost::signal&lt; void() &gt; sig_connection_made; boost::signal&lt; void(const std::string&amp;) &gt; sig_error; void connect(const std::string&amp; host, const std::string&amp; port); }; </code></pre> <p>that I want to wrap in C#. Does anyone know of a way, using SWIG or something similar, that will allow me to bind the signals to C# delegates?</p>
[ { "answer_id": 296241, "author": "Bill Karwin", "author_id": 20860, "author_profile": "https://Stackoverflow.com/users/20860", "pm_score": 3, "selected": true, "text": "http://www.astahost.com/info.php/max_allowed_packet-mysql_t2725.html" } ]
2008/11/17
[ "https://Stackoverflow.com/questions/295533", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35656/" ]
295,538
<p>When connecting to a network share for which the current user (in my case, a network enabled service user) has no rights, name and password have to be provided.</p> <p>I know how to do this with Win32 functions (the <code>WNet*</code> family from <code>mpr.dll</code>), but would like to do it with .Net (2.0) functionality.</p> <p>What options are available?</p> <p><strong>Maybe some more information helps:</strong></p> <ul> <li>The use case is a windows service, not an Asp.Net application.</li> <li>The service is running under an account which has no rights on the share.</li> <li>The user account needed for the share is not known on the client side.</li> <li>Client and server are not members of the same domain.</li> </ul>
[ { "answer_id": 295545, "author": "GEOCHET", "author_id": 5640, "author_profile": "https://Stackoverflow.com/users/5640", "pm_score": 1, "selected": false, "text": "<identity impersonate=\"true\" userName=\"domain\\user\" password=\"****\" />\n" }, { "answer_id": 295553, "auth...
2008/11/17
[ "https://Stackoverflow.com/questions/295538", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23772/" ]
295,557
<p>What's the best way to do it in .NET? I always forget what I need to <code>Dispose()</code> (or wrap with <code>using</code>).</p> <p>EDIT: after a long time using <code>WebRequest</code>, I found out about customizing <code>WebClient</code>. Much better.</p>
[ { "answer_id": 295558, "author": "orip", "author_id": 37020, "author_profile": "https://Stackoverflow.com/users/37020", "pm_score": 3, "selected": false, "text": "public string GetRequest(Uri uri, int timeoutMilliseconds)\n{\n var request = System.Net.WebRequest.Create(uri);\n requ...
2008/11/17
[ "https://Stackoverflow.com/questions/295557", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37020/" ]
295,563
<p>I need to disable windows-update service from my installation. I already use vbscript to do some stuff so I would like to do it in vbscript.</p> <p>My knowledge of vbscript (or any other script language) is very limited so...can anybody help me out with that? I'll really appreciate it!</p> <p>Thanks.</p>
[ { "answer_id": 295586, "author": "Tomalak", "author_id": 18771, "author_profile": "https://Stackoverflow.com/users/18771", "pm_score": 1, "selected": false, "text": "strComputer = \".\" 'could be any computer, not just the local one '\nSet objWMIService = GetObject(\"winmgmts:\\\\\" & s...
2008/11/17
[ "https://Stackoverflow.com/questions/295563", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14053/" ]
295,566
<p>I need to display external resources loaded via cross domain requests and make sure to only display "<em>safe</em>" content. </p> <p>Could use Prototype's <a href="http://www.prototypejs.org/api/string/stripScripts" rel="noreferrer">String#stripScripts</a> to remove script blocks. But handlers such as <code>onclick</code> or <code>onerror</code> are still there.</p> <p>Is there any library which can at least</p> <ul> <li>strip script blocks,</li> <li>kill DOM handlers,</li> <li>remove black listed tags (eg: <code>embed</code> or <code>object</code>).</li> </ul> <p>So are any JavaScript related links and examples out there?</p>
[ { "answer_id": 430240, "author": "Mike Samuel", "author_id": 20394, "author_profile": "https://Stackoverflow.com/users/20394", "pm_score": 7, "selected": false, "text": "var tagBody = '(?:[^\"\\'>]|\"[^\"]*\"|\\'[^\\']*\\')*';\n\nvar tagOrComment = new RegExp(\n '<(?:'\n // Comment...
2008/11/17
[ "https://Stackoverflow.com/questions/295566", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28150/" ]
295,569
<p>What I am looking for is a way to programmatically verify a target object has been deallocated. Currently I have an NSLog statement in the dealloc methods of the objects I wish to observe. The unit testing framework is from the Google Toolbox for the mac, and it working nicely. I am just not certain how to frame this particular test.</p>
[ { "answer_id": 297815, "author": "Peter Hosey", "author_id": 30461, "author_profile": "https://Stackoverflow.com/users/30461", "pm_score": 2, "selected": false, "text": "dealloc" }, { "answer_id": 4156216, "author": "zoul", "author_id": 17279, "author_profile": "https...
2008/11/17
[ "https://Stackoverflow.com/questions/295569", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24707/" ]
295,576
<p>I have a LinqDataSource that I use to calculate the number of rows in a table. I would like to update the value of literal with the number, with the following code, taken from MSDN (<a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.linqdatasourcestatuseventargs.totalrowcount.aspx" rel="nofollow noreferrer">linqdatasourcestatuseventargs.totalrowcount.aspx</a>):</p> <pre><code>protected void linqDataSource1_Selected(object sender, LinqDataSourceStatusEventArgs e) { Literal1.Text = e.TotalRowCount.ToString(); } </code></pre> <p>By how do I trigger the select event on the data source? The SqlDataSource class has a Select() method so that it can be triggered programmatically in e.g. Page_Load, but the LinqDataSource does not have this method. I currently solved the problem by binding my data source to an empty FormView element, but this is just too ugly.</p> <p>I feel pretty confident that there is a much nicer way to get the total number of rows into my literal when using LinqToSql, I just don't know how to do so.</p> <p>The suggestion by tvanfosson, of attaching an method to the data source's selected event, does unfortunately not solve my problem, because the select event is still not triggered when the page loads. (I have, by the way, already attached the _Selected method with the OnSelected attribute, like this)</p> <pre><code>&lt;asp:LinqDataSource ID="linqDataSource1" runat="server" OnSelected="linqDataSource1_Selected"&gt; </code></pre>
[ { "answer_id": 297621, "author": "tvanfosson", "author_id": 12950, "author_profile": "https://Stackoverflow.com/users/12950", "pm_score": 2, "selected": false, "text": "public void Page_Load( object sender, EventArgs e )\n{\n linqDataSource1.Selected += LinqDataSource1_Selected;\n}\n...
2008/11/17
[ "https://Stackoverflow.com/questions/295576", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37147/" ]
295,579
<p>I'm looking for the fastest way to determine if a <code>long</code> value is a perfect square (i.e. its square root is another integer): </p> <ol> <li>I've done it the easy way, by using the built-in <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Math.html#sqrt(double)" rel="noreferrer"><code>Math.sqrt()</code></a> function, but I'm wondering if there is a way to do it faster by restricting yourself to integer-only domain.</li> <li>Maintaining a lookup table is impractical (since there are about 2<sup>31.5</sup> integers whose square is less than 2<sup>63</sup>).</li> </ol> <p>Here is the very simple and straightforward way I'm doing it now:</p> <pre><code>public final static boolean isPerfectSquare(long n) { if (n &lt; 0) return false; long tst = (long)(Math.sqrt(n) + 0.5); return tst*tst == n; } </code></pre> <p><sub>Note: I'm using this function in many <a href="http://projecteuler.net/" rel="noreferrer">Project Euler</a> problems. So no one else will ever have to maintain this code. And this kind of micro-optimization could actually make a difference, since part of the challenge is to do every algorithm in less than a minute, and this function will need to be called millions of times in some problems.</sub></p> <hr> <p>I've tried the different solutions to the problem:</p> <ul> <li>After exhaustive testing, I found that adding <code>0.5</code> to the result of Math.sqrt() is not necessary, at least not on my machine.</li> <li>The <a href="https://en.wikipedia.org/wiki/Fast_inverse_square_root" rel="noreferrer">fast inverse square root</a> was faster, but it gave incorrect results for n >= 410881. However, as suggested by <a href="https://stackoverflow.com/users/38426/bobbyshaftoe">BobbyShaftoe</a>, we can use the FISR hack for n &lt; 410881.</li> <li>Newton's method was a good bit slower than <code>Math.sqrt()</code>. This is probably because <code>Math.sqrt()</code> uses something similar to Newton's Method, but implemented in the hardware so it's much faster than in Java. Also, Newton's Method still required use of doubles.</li> <li>A modified Newton's method, which used a few tricks so that only integer math was involved, required some hacks to avoid overflow (I want this function to work with all positive 64-bit signed integers), and it was still slower than <code>Math.sqrt()</code>.</li> <li>Binary chop was even slower. This makes sense because the binary chop will on average require 16 passes to find the square root of a 64-bit number.</li> <li>According to John's tests, using <code>or</code> statements is faster in C++ than using a <code>switch</code>, but in Java and C# there appears to be no difference between <code>or</code> and <code>switch</code>.</li> <li>I also tried making a lookup table (as a private static array of 64 boolean values). Then instead of either switch or <code>or</code> statement, I would just say <code>if(lookup[(int)(n&amp;0x3F)]) { test } else return false;</code>. To my surprise, this was (just slightly) slower. This is because <a href="https://stackoverflow.com/questions/299079/why-is-this-code-with-several-or-statements-slightly-faster-than-using-a-lookup-t#299205">array bounds are checked in Java</a>. </li> </ul>
[ { "answer_id": 295590, "author": "chakrit", "author_id": 3055, "author_profile": "https://Stackoverflow.com/users/3055", "pm_score": 6, "selected": false, "text": "float Q_rsqrt( float number )\n{\n long i;\n float x2, y;\n const float threehalfs = 1.5F;\n\n x2 = number * 0.5F;\n y ...
2008/11/17
[ "https://Stackoverflow.com/questions/295579", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18511/" ]
295,584
<p>I've found a few pages (some that even link to a number of other pages) on the Microsoft website that I bookmarked last night for reading today, but I'm curious as to other good non-Microsoft resources for discussing ASP.NET web applications, both Forms and MVC (including comparisons/contrasts between the two).</p>
[ { "answer_id": 295792, "author": "Ben Scheirman", "author_id": 3381, "author_profile": "https://Stackoverflow.com/users/3381", "pm_score": 3, "selected": true, "text": "</shamelessPlug>\n" } ]
2008/11/17
[ "https://Stackoverflow.com/questions/295584", "https://Stackoverflow.com", "https://Stackoverflow.com/users/572/" ]
295,593
<p>I have a List containing several keywords. I foreach through them building my linq query with them like so (boiled down to remove the code noise):</p> <pre><code>List&lt;string&gt; keys = FillKeys() foreach (string key in keys){ q = q.Where(c =&gt; c.Company.Name.Contains(key)); } </code></pre> <p>When I now make my keys contain 2 keys that return results seperatly, but can never occure together (every item in q is either "xyz" or "123", never "123" AND "xyz"), I still get results. The resultset is then the same as the last string it got to.</p> <p>I had a look at the linq query and it appears it creates the correct sql, but it replaces @p1 AND @p2 both by the same (last itterated) value.</p> <p>What am I doing wrong?</p>
[ { "answer_id": 295597, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 6, "selected": true, "text": "key" }, { "answer_id": 295605, "author": "Marc Gravell", "author_id": 23354, "author_profile": "https...
2008/11/17
[ "https://Stackoverflow.com/questions/295593", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11333/" ]
295,600
<p>Assume that you have a running SQL Server Express instance named (local)\SQLEXPRESS. Its database folder is c:\program files\Microsoft SQL Server\MSSQL.1\MSSQL\Data. </p> <p>How can VBScript be used to retrieve that folder? </p> <p>Maybe by using SMO? And if so, how? &lt;- Forget that. SMO uses .NET. Only possible in PowerShell.</p> <hr> <p><strong>Update:</strong> The reason for this is, that I am developing an MSI setup that uses a custom action (call to a .NET based assembly) for attaching mdf Files to an existing SQL server instance. for this, the .mdf files get transferred from the installation medium to the hard drive. So the setup needs to know where to place the files.</p> <p>Since I would like to support the standards, I need to place the files into the common data folder.</p> <hr> <p><strong>Update:</strong> When selecting a SQL server instance in InstallShield, the Property IS _ SQLSERVER _ SERVER is set with the instance name.</p> <p>I found out, that I can query the registry under HKLM\Software\Microsoft\Microsoft SQL Server\Instance Names\SQL to get the SQL name for the instance name (e.g. SQLEXPRESS -> MSSQL.1).</p> <p>With this information, I can query HKLM\Software\Microsoft\Microsoft SQL Server\MSSQL.1\Setup to retrieve the SQLDataRoot key. When I append a \Data to the value found here, I have the folder, I was looking for. </p> <p>However, is there a better way?</p>
[ { "answer_id": 295738, "author": "Tomalak", "author_id": 18771, "author_profile": "https://Stackoverflow.com/users/18771", "pm_score": 3, "selected": true, "text": "root\\Microsoft\\SqlServer" }, { "answer_id": 45663755, "author": "Codename K", "author_id": 2267382, "...
2008/11/17
[ "https://Stackoverflow.com/questions/295600", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23369/" ]
295,611
<p>I have some questions about basic CSS that I was unable to understand or find an answer for.</p> <p>First, I tried placing 3 div tags within another div tag. The first main div tag containing the 3 other tags had nothing set for it except a size, which was <code>400px</code> by <code>400px</code>. Of the other 3 divs inside, all were <code>20px</code> by <code>20px</code>, and 1 was assigned <code>float:left</code>, and the other two were assigned a style that was float right. All attributes were defined within a style, and the two divs that were <code>float:right</code> were assigned the same style. My problem is that out of the 2 divs, the one that came last in the code, would appear first in a browser, and I did not understand the reasoning for this.</p> <p>Here is the code:</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;style&gt; #main{ border: red 4px dashed; width: 25% height: 25%, } #left{ float: left; width: 20px; height: 20px, } #right{ float: right; width: 20px; height: 20px, } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="main"&gt; &lt;div id="left"&gt;1&lt;/div&gt; &lt;div id="right"&gt;2&lt;/div&gt; &lt;div id="right"&gt;3&lt;/div&gt; &lt;/div&gt; &lt;/body&gt; &lt;/head&gt; &lt;/html&gt; </code></pre>
[ { "answer_id": 295633, "author": "Graeme Perrow", "author_id": 1821, "author_profile": "https://Stackoverflow.com/users/1821", "pm_score": 0, "selected": false, "text": "...\n<div class=\"right\">2</div>\n<div class=\"right\">3</div>\n...\n" }, { "answer_id": 295634, "author"...
2008/11/17
[ "https://Stackoverflow.com/questions/295611", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1246613/" ]
295,615
<p>I Have a problem where I occasionally (i.e. not always) see the below error popup from the Debug Flash Player after launching my app:</p> <pre><code>Error #2044: Unhandled securityError:. text=Error #2048: Security sandbox violation: http://example.com/myApp.swf cannot load data from localhost:4499. at org.mydomain.mypackage::MyClassUsingSocket() at MyMainApplicationClass$cinit() at global$init() at global$init() at flash.system::ApplicationDomain/hasDefinition() at mx.managers::SystemManager/getDefinitionByName() at _MyMainApplicationClass_mx_managers_SystemManager/create() at mx.managers::SystemManager/initializeTopLevelWindow() at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::docFrameHandler() </code></pre> <p>I have some code in this app that tries to connect to <code>localhost:4499</code> via a <code>Socket</code>, and this error occurs when the socket server is not running and listening for the connections, <em>which is to be expected</em>. What I <em>don't</em> understand, however, is <strong>why Flash Player is complaining about unhandled securityErrors when I have try/catch blocks to catch the <code>SecurityError</code>s</strong> when trying to connect the socket (as well as listeners for the <code>SecurityErrorEvents</code>, which this error message doesn't seem to point to, though).</p> <p>The constructor of the relevant class is below:</p> <pre><code>/** * Constructor. */ public function MyClassUsingSocket(aHost:String = null, aPort:int = -1):void { super(); var hostToConnectTo:String = (aHost != null) ? aHost : DEFAULT_HOST; var portToConnectTo:int = (aPort != -1) ? aPort : DEFAULT_PORT; try { _out_socket = new Socket(); // note: the event handlers used below are private functions within the same class _out_socket.addEventListener(Event.CONNECT, _socketConnectEventHandler, false,0,true); _out_socket.addEventListener(IOErrorEvent.IO_ERROR, _socketIOErrorEventHandler, false,0,true); _out_socket.addEventListener(SecurityErrorEvent.SECURITY_ERROR, _socketSecurityErrorEventHandler, false,0,true); _out_socket.connect(hostToConnectTo, portToConnectTo); } catch(e:IOError) { enabled = false; } catch(e:SecurityError) { enabled = false; } } </code></pre> <p>Any ideas on why this might be occurring? What am I missing?</p>
[ { "answer_id": 298805, "author": "geraldalewis", "author_id": 7501, "author_profile": "https://Stackoverflow.com/users/7501", "pm_score": -1, "selected": false, "text": "\n\n try\n {\n _out_socket = new Socket();\n\n // note: the event handlers...
2008/11/17
[ "https://Stackoverflow.com/questions/295615", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4111/" ]
295,620
<p>Given the following Delphil DLL declaration</p> <pre><code>function csd_HandleData(aBuf: PChar; aLen: integer): integer; stdcall; </code></pre> <p>what would be the VB6 declaration to use it?</p> <p>I've tried a variety of declarations, e.g.</p> <pre><code>Declare Function csd_HandleData Lib "chsdet.dll" (ByVal aBuf As String, ByVal aLen As Integer) Declare Function csd_HandleData Lib "chsdet.dll" (aBuf As Long, ByVal aLen As Integer) Declare Function csd_HandleData Lib "chsdet.dll" (aBuf As Byte, ByVal aLen As Integer) </code></pre> <p>with the relevant code to suit the parameters, but nothing seems to work, i.e. the Delphi debugger says I have a too-largish value in aLen and a null string in aBuf.</p> <p>I am working toward using a TypeLib to drive the connection, but was prototyping with Declares.</p>
[ { "answer_id": 295638, "author": "Steve", "author_id": 22712, "author_profile": "https://Stackoverflow.com/users/22712", "pm_score": 3, "selected": true, "text": "Declare Function csd_HandleData Lib \"chsdet.dll\" (ByVal aBuf As String, \nByVal aLen As Integer) As Integer\n" }, { ...
2008/11/17
[ "https://Stackoverflow.com/questions/295620", "https://Stackoverflow.com", "https://Stackoverflow.com/users/426/" ]
295,621
<p>I have an iframe inside my main page. There is a modalpopup inside the iframe page. So when the modalpopup is shown, the parent of the modalpopup is the iframe body and the main page parent body. Thus the overlay only covers the iframe and not the entire page.</p> <p>I tried moving the modalpopup from the iframe to the parent windows body element (or any other element inside the parents body) using jQuery. I am getting an invalid argument error.</p> <p>How do I show a modalpopup from an page inside iframe and it should cover the entire document, parent document as well?</p> <p><strong>Update:</strong> </p> <p>Since few users are interested in achieving the same behavior .. here is the workaround</p> <p>The best workaround that I would suggest would be to have the modalpopup in the main page .. and then invoke it from the iframe .. say something like this ..</p> <pre><code>/* function in the main(parent) page */ var _onMyModalPopupHide = null; function pageLoad(){ // would be called by ScriptManager when page loads // add the callback that will be called when the modalpopup is closed $find('MyModalPopupBehaviorID').add_hidden(onMyModalPopupHide); } // will be invoked from the iframe to show the popup function ShowMyModalPopup(callback) { _onMyModalPopupHide = callback; $find('MyModalPopupBehaviorID').show(); } /* this function would be called when the modal popup is closed */ function onMyModalPopupHide(){ if (typeof(_onMyModalPopupHide) === "function") { // fire the callback function _onMyModalPopupHide.call(this); } } /* functions in the page loaded in the iframe */ function ShowPopup(){ if(typeof(window.parent.ShowMyModalPopup) === "function") { window.parent.ShowMyModalPopup.apply(this, [OnPopupClosed]); } } // will be invoked from the parent page .. after the popup is closed function OnPopupClosed(){ // do something after the modal popup is closed } </code></pre> <p>Hope it helps</p>
[ { "answer_id": 23271920, "author": "Adeel Rizvi", "author_id": 3569277, "author_profile": "https://Stackoverflow.com/users/3569277", "pm_score": 0, "selected": false, "text": "<button type=\"button\" id=\"popup\">Show Popup</button>\n<br />\n<br />\n<iframe src=\"your url\" style=\"width...
2008/11/17
[ "https://Stackoverflow.com/questions/295621", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25138/" ]
295,626
<p>I have a .net 3.5 WinForms application that runs fine on my machine, but on another machine it immediately crashes with a system.io.fileloadexception. Unfortunately, there are absolutely no details on which file failed to load, so I do not know where the problem actually is.</p> <p>I believe I know which one it could be (SQL Server Compact edition), but before I aimlessly hunt, I wonder if there is a proper way to find out what caused the fileloadexception, other than using FileMon from SysInternals.</p> <p>The only error message is:</p> <blockquote> <p>EventType clr20r3, P1 myapplication.exe, P2 2.1.0.0, P3 490eca78, P4 myapplication, P5 2.1.0.0, P6 490eca78, P7 2e, P8 21, P9 system.io.fileloadexception, P10 NIL.</p> </blockquote>
[ { "answer_id": 295654, "author": "Marc Gravell", "author_id": 23354, "author_profile": "https://Stackoverflow.com/users/23354", "pm_score": 3, "selected": false, "text": "Main()" } ]
2008/11/17
[ "https://Stackoverflow.com/questions/295626", "https://Stackoverflow.com", "https://Stackoverflow.com/users/91/" ]
295,628
<p>Our team is using a SecureRandom to generate a list of key pairs (the SecureRandom is passed to a KeyPairGenerator). We cannot agree on which of the following two options to use:</p> <ol> <li><p>Create a new instance every time we need to generate a key pair</p></li> <li><p>Initialize a static instance and use it for all key pairs</p></li> </ol> <p>Which approach is generally better and <em>why</em>?</p> <p>ADDED: My gut feeling is that the second option is more secure. But my only argument is a theoretical attack based on the assumption that the pseudorandomness is derived from the current timestamp: someone may see the creation time of the key pair, guess timestamps in the surrounding time interval, compute the possible pseudorandom sequences, and obtain the key material.</p> <p>ADDED: My assumption about determinism based on a timestamp was wrong. That's the difference between Random and SecureRandom. So, it looks like the answer is: in terms of security it doesn't really matter.</p>
[ { "answer_id": 295652, "author": "Gowri", "author_id": 3253, "author_profile": "https://Stackoverflow.com/users/3253", "pm_score": 5, "selected": true, "text": "java.util.Random" }, { "answer_id": 1304948, "author": "Community", "author_id": -1, "author_profile": "htt...
2008/11/17
[ "https://Stackoverflow.com/questions/295628", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23109/" ]
295,629
<p>I'm writing an application which has to be configurable to connect to Oracle, SQL Server and MySQL depending on client whim.</p> <p>Up till now I'd been planning on using the JDBC-ODBC bridge and just connecting to the databases using different connection strings.</p> <p><strong>I'm told this is not very efficient.</strong></p> <ol> <li><p>Is there a pattern or best practice for connecting to multiple database systems? Or for selecting which driver to use?</p></li> <li><p>Should I have it configurable? but include all three drivers or build three separate clients?</p></li> </ol> <p>I'm not doing anything complex just pumping (inserting) data into the database from an event stream.</p>
[ { "answer_id": 295656, "author": "Vincent Ramdhanie", "author_id": 27439, "author_profile": "https://Stackoverflow.com/users/27439", "pm_score": 4, "selected": true, "text": " if(DB.equals(\"MySQL\")){\n DAO = new MySQLDAO();\n}\nreturn DAO;\n" }, { "answer_id": 295712, "a...
2008/11/17
[ "https://Stackoverflow.com/questions/295629", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20400/" ]
295,645
<p>I'm developing an invisible Java Applet, that will be controlled entirely from JavaScript.</p> <p>I can call the applet's Java methods easily, and I can call JavaScript methods from within the applet by using <code>netscape.javascript.JSObject.getWindow(this).call()</code>.</p> <p>But in order to register a JavaScript callback in the applet, I guess I would need an JavaScript function object of some sort.</p> <p>I would like to do:</p> <pre><code>public void registerCallback( SomeJavascriptFunction func ) { ... } </code></pre> <p>Which I could call from Javascript:</p> <pre><code>myapplet.registerCallback(function(){ alert("called back"); }); </code></pre> <p>So I could call this function in later code:</p> <pre><code>func.call( ... ); </code></pre> <p>Does something like this exist? How can I do this?</p> <p>Rigth now I'm thinking of creating some Javascript to handle this callback mechanism instead of doing so from the applet.</p>
[ { "answer_id": 296452, "author": "PhiLho", "author_id": 15459, "author_profile": "https://Stackoverflow.com/users/15459", "pm_score": 3, "selected": true, "text": "function CallJava()\n{\n document.Applet.Call(\"Does it work?\");\n document.Applet.Call(function () { alert(\"It works!\"...
2008/11/17
[ "https://Stackoverflow.com/questions/295645", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30700/" ]
295,647
<p>I'm attempting to register an anonymous function when a user clicks a cell in an HTML table. Here's some of the raw, unadulterated code:</p> <pre><code>document.getElementById( "course"+displayed_year_index+occurrences_indices[displayed_year_index]).onclick = eval("function() {PrintReceipt("+result.years[result_year_index].rul_code+");};"); </code></pre> <p>Note the use of <code>eval</code>, since this sits in a loop and the anonymous function is different each time round.</p> <p>Suffice to say, this works absolutely fine in Firefox 2. But, Firefox 3 throws a 'Syntax Error', pointing inside the brackets after the word 'function'.</p> <p>Does anybody have any smart ideas on how I can fix this?</p> <hr> <p>Just to make it crystal clear what I'm attempting to do, here's a much simplified example:</p> <pre><code>for (index=0; index&lt;4; index++) { document.getElementById("div"+index).onclick = eval("function () {Foo(index);};"); } </code></pre> <p>In other words, I wish to trigger the same function with a different parameter value for each <code>div</code>.</p>
[ { "answer_id": 295666, "author": "Tom", "author_id": 26155, "author_profile": "https://Stackoverflow.com/users/26155", "pm_score": 3, "selected": false, "text": "document.getElementById('course' + displayed_year_index + occurences_indices[displayed_year_index]) =\n function (nr)\n ...
2008/11/17
[ "https://Stackoverflow.com/questions/295647", "https://Stackoverflow.com", "https://Stackoverflow.com/users/441661/" ]
295,649
<p>We have a simple project where we read data from a socket and we want to populate a table with the coming data, but we can't find a way to add rows to a yet created <code>JTable</code> object, we can only find how to add rows at creation time of the table.</p> <p>Is it possible to add rows dynamically to a <code>JTable</code>, or there is a better alternative object to deal with this way of showing data?</p> <p><strong>EDIT</strong>: Thanks a lot for your answers.</p> <p>All three of them look very promising, but I have to choose only one and I think the best is Guillaume's.</p>
[ { "answer_id": 295674, "author": "Guillaume", "author_id": 23704, "author_profile": "https://Stackoverflow.com/users/23704", "pm_score": 5, "selected": true, "text": "TableModel" }, { "answer_id": 295695, "author": "Peter", "author_id": 26483, "author_profile": "https...
2008/11/17
[ "https://Stackoverflow.com/questions/295649", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38238/" ]
295,660
<p>I am trying to have one one layer, and center images within. I.E., if I have 3 images and want 3 links beneath them, is there a way to do this without using a separate div tag for each link and image? To automatically make the links be centered under the images, and the images to be spaced evenly within a layer? </p> <p>I was also wondering how I would make the div show behind standard html if that is possible. I.E. if I have some text and a div over the text, the div will default show over the text, when I would like it to be behind. Is this only possible by using another layer?</p>
[ { "answer_id": 295669, "author": "nickf", "author_id": 9021, "author_profile": "https://Stackoverflow.com/users/9021", "pm_score": 3, "selected": true, "text": "<div class=\"pictureBox\">\n <div>\n <img />\n caption caption\n </div>\n <div>\n <img />\n ...
2008/11/17
[ "https://Stackoverflow.com/questions/295660", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1246613/" ]
295,662
<p>This is one is for any of you Doctrine users out there. I have a PHP CLI daemon process that checks a table every n seconds to find entries that haven't been processed. It's basically a FIFO. Anyways, I always exceed the memory allocated to PHP becuase Doctrine does not free it's resources. To combat this problem it provides free for the query object. I can't seem to make it work though. Here's the code:</p> <pre><code> 22 print "You are using " . (memory_get_usage() / 1024). "\n"; 23 $query = Doctrine_Query::create() 24 -&gt;from('SubmissionQueue s') 25 -&gt;where('s.time_acted_on IS NULL') 26 -&gt;orderby('s.time_queued') 27 -&gt;limit(1) 28 -&gt;execute(); 29 print $query[0]-&gt;time_queued . "\n"; 30 $query-&gt;free(); </code></pre> <p>Any ideas what I am doing wrong?</p> <p>EDIT: I am using 1.0.3</p> <p>EDIT: I have tried all of the below suggestions. I was very hopeful for <code>unset()</code> as I had it in there before I found <code>free()</code>.</p> <p>Here is more of the code to possibly aid in any help. Before you question the opening and closing of the connection it will be daemon process that spawns children and from I have experienced the connection has to be unique.</p> <pre><code> 1 &lt;?php 2 3 require_once('/usr/local/lib/php/Doctrine/lib/Doctrine.php'); 4 5 spl_autoload_register(array('Doctrine', 'autoload')); 6 7 $manager = Doctrine_Manager::getInstance(); 8 $manager-&gt;setAttribute('model_loading','conservative'); 9 Doctrine::loadModels('lib/model/master'); 10 11 while(1){ 12 print "You are using " . intval(memory_get_usage() / 1024) . "\n"; 13 $manager-&gt;connection('********************************************','master'); 14 $query = Doctrine_Query::create() 15 -&gt;from('SubmissionQueue s') 16 -&gt;where('s.time_acted_on IS NULL') 17 -&gt;orderby('s.time_queued') 18 -&gt;limit(1) 19 -&gt;execute(); 20 print "[" . $query[0]-&gt;time_queued . "]\n"; 21 $query-&gt;free(); 22 unset($query); 23 $query = null; 24 $manager-&gt;closeConnection(Doctrine_Manager::getInstance()-&gt;getConnection('master')); 25 sleep(5); 26 } 27 </code></pre> <p>Some sample output:</p> <pre><code>You are using 14949KB [2008-11-17 13:59:00] You are using 14978KB [2008-11-17 13:59:00] You are using 15007KB [2008-11-17 13:59:00] You are using 15035KB [2008-11-17 13:59:00] You are using 15064KB [2008-11-17 13:59:00] You are using 15093KB [2008-11-17 13:59:00] You are using 15121KB [2008-11-17 13:59:00] You are using 15150KB [2008-11-17 13:59:00] You are using 15179KB [2008-11-17 13:59:00] You are using 15207KB [2008-11-17 13:59:00] You are using 15236KB [2008-11-17 13:59:00] You are using 15265KB [2008-11-17 13:59:00] You are using 15293KB [2008-11-17 13:59:00] You are using 15322KB </code></pre>
[ { "answer_id": 295954, "author": "PhiLho", "author_id": 15459, "author_profile": "https://Stackoverflow.com/users/15459", "pm_score": 0, "selected": false, "text": "$query = Doctrine_Query::create()\n ->from('SubmissionQueue s')\n ->where('s.time_acted_on IS NULL')\...
2008/11/17
[ "https://Stackoverflow.com/questions/295662", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28714/" ]
295,670
<p>What is and how can it be used in C#.<br/> Can you use the same concept in Python/Perl?</p>
[ { "answer_id": 295713, "author": "gnud", "author_id": 27204, "author_profile": "https://Stackoverflow.com/users/27204", "pm_score": 2, "selected": false, "text": "class A(object):\n pass\n\nobj = A()\n\ndef _some_method(self):\n print self.__class__\nA.identify = _some_method\n\nob...
2008/11/17
[ "https://Stackoverflow.com/questions/295670", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31179/" ]
295,686
<p>The following error is being thrown:</p> <pre><code>com.sun.jdi.InternalException: Got error code in reply:35 occurred while retrieving value. for all expressions </code></pre> <p>I am getting this error for all expressions and cant find anything on it. My guess is that the debugger isn't correctly connecting to the remote version, but I am not sure.</p>
[ { "answer_id": 678516, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 1, "selected": false, "text": "com.sun.jdi.internalexception" }, { "answer_id": 8151260, "author": "Shri", "author_id": 1049589, "author_...
2008/11/17
[ "https://Stackoverflow.com/questions/295686", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
295,687
<p>I would like to get the path to the execution directory of a Windows Forms application. (That is, the directory in which the executable is located.)</p> <p>Does anyone know of a built-in method in .NET to do this?</p>
[ { "answer_id": 295694, "author": "Tomas Pajonk", "author_id": 4694, "author_profile": "https://Stackoverflow.com/users/4694", "pm_score": 6, "selected": false, "text": "Dim directory as String = My.Application.Info.DirectoryPath\n" }, { "answer_id": 295696, "author": "Ali Ers...
2008/11/17
[ "https://Stackoverflow.com/questions/295687", "https://Stackoverflow.com", "https://Stackoverflow.com/users/51/" ]
295,688
<p>I have 2 tables event + event_artist</p> <h2>event</h2> <pre><code>eventId | eventName ------------------- 1 , gig1 2, gig2 </code></pre> <h2>event_artist</h2> <pre><code>eventId, artistName ------------------- 1, Led Zip 1, The Beatles </code></pre> <p>ie Led Zep and the Beatles are both playing @ Gig1</p> <p>I need to create the SQl to bind to a gridview ( you necessarily need to know about gridviews to answers this )</p> <p>The results that i want would look like this<br> eventId = 1, EventName = Gig1. ArtistLineup = Led Zep, The beatles</p> <p>So i need to create an alias ArtistLineup that would list all the artist. Via an inner select i think.</p> <p>Any thoughts on what this would look like. </p>
[ { "answer_id": 295819, "author": "ScottK", "author_id": 37757, "author_profile": "https://Stackoverflow.com/users/37757", "pm_score": 3, "selected": true, "text": "drop table event\ngo\n\ndrop table event_artist\ngo\n\ncreate table event (eventid int, eventname varchar(255))\ngo\n\ncreat...
2008/11/17
[ "https://Stackoverflow.com/questions/295688", "https://Stackoverflow.com", "https://Stackoverflow.com/users/461880/" ]
295,690
<p>I've got a section of code on a b2evo PHP site that does the following: </p> <pre><code>$content = preg_replace_callback( '/[\x80-\xff]/', create_function( '$j', 'return "&amp;#".ord($j[0]).";";' ), $content); </code></pre> <p>What does this section of code do? My guess is that it strips out ascii characters between 128 and 256, but I can't be sure. </p> <p>Also, as it stands, every time this bit of code is called from within a page, PHP allocates and then does not free upto 2K of memory. If the function is called 1000+ times on a page (this can happen), then the page uses an extra 2MB of memory. </p> <p>This is causing problems with my web application. Why am I losing memory, and how do I rewrite this so I don't get a memory leak?</p>
[ { "answer_id": 295697, "author": "Greg", "author_id": 24181, "author_profile": "https://Stackoverflow.com/users/24181", "pm_score": 2, "selected": false, "text": "create_function" }, { "answer_id": 295698, "author": "PhiLho", "author_id": 15459, "author_profile": "htt...
2008/11/17
[ "https://Stackoverflow.com/questions/295690", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1726/" ]
295,708
<p>Before I ask my question, here's the offending code:</p> <pre><code>var coords = dojo.coords(g); g.style.left = coords.x + "px"; g.style.top = coords.y + "px"; g.style.position = "absolute"; </code></pre> <p>Now imagine that <code>g</code> is a relatively positioned element with an <code>x</code> position of 70 and a <code>y</code> position of 30. If I comment out the last line of the above code, that's what <code>dojo.coords(g)</code> gives me. But as soon as I add the last line, <code>dojo.coords(g)</code> returns an <code>x</code> position of 18, which is where the element would be if it were absolutely positioned. It seems to me that the call to <code>dojo.coords()</code> shouldn't be affected by code below it, but it is.</p> <p>I'm also seeing the same problem with <code>dojo.require()</code> where if I call it directly before the function call that it's loading, I get an undefined error for that given function.</p> <p>I'm testing in Firefox 3, but I also am noticing similar problems in Safari 3. Any ideas?</p>
[ { "answer_id": 295720, "author": "José Leal", "author_id": 37190, "author_profile": "https://Stackoverflow.com/users/37190", "pm_score": -1, "selected": false, "text": "g.style.left = parseInt(coords.x) + \"px\";\ng.style.top = parseInt(coords.y) + \"px\";\n" }, { "answer_id": 29...
2008/11/17
[ "https://Stackoverflow.com/questions/295708", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12549/" ]
295,710
<p>There is a need from a customer to log every data change to a logging table with the actual user who made the modification. The application is using one SQL user to access the database, but we need to log the "real" user id.</p> <p>We can do this in t-sql by writing triggers for every table insert and update, and using context_info to store the user id. We passed the user id to a stored procedure, stored the user id in the contextinfo, and the trigger could use this info to write log rows to the log table.</p> <p>I can not find the place or way where or how can I do something similar using EF. So the main goal is: if I make a change in the data via EF, I would like to log the exact data change to a table in a semi-automatic way (so I don't want to check for every field for change before saving the object). We are using EntitySQL.</p> <p>Unfortunately we have to stick on SQL 2000 so the data change capture introduced in SQL2008 is not an option (but maybe that's also not the right way for us).</p> <p>Any ideas, links or starting points?</p> <p><strong>[Edit]</strong> Some notes: by using ObjectContext.SavingChanges eventhandler, I can get the point where I can inject the SQL statement to initialize the contextinfo. However I cannot mix the EF and the standard SQL. So I can get the EntityConnection but I cannot execute a T-SQL statement using it. Or I can get the connection string of the EntityConnection and create an SqlConnection based on it, but it will be a different connection, so the contextinfo will not affect the save made by the EF.</p> <p>I tried the following in the SavingChanges handler:</p> <pre><code>testEntities te = (testEntities)sender; DbConnection dc = te.Connection; DbCommand dcc = dc.CreateCommand(); dcc.CommandType = CommandType.StoredProcedure; DbParameter dp = new EntityParameter(); dp.ParameterName = "userid"; dp.Value = textBox1.Text; dcc.CommandText = "userinit"; dcc.Parameters.Add(dp); dcc.ExecuteNonQuery(); </code></pre> <p>Error: The value of EntityCommand.CommandText is not valid for a StoredProcedure command. The same with SqlParameter instead of EntityParameter: SqlParameter cannot be used.</p> <pre><code>StringBuilder cStr = new StringBuilder("declare @tx char(50); set @tx='"); cStr.Append(textBox1.Text); cStr.Append("'; declare @m binary(128); set @m = cast(@tx as binary(128)); set context_info @m;"); testEntities te = (testEntities)sender; DbConnection dc = te.Connection; DbCommand dcc = dc.CreateCommand(); dcc.CommandType = CommandType.Text; dcc.CommandText = cStr.ToString(); dcc.ExecuteNonQuery(); </code></pre> <p>Error: The query syntax is not valid.</p> <p>So here I am, stuck to create a bridge between Entity Framework and ADO.NET. If I can get it working, I will post a proof of concept.</p>
[ { "answer_id": 304709, "author": "Biri", "author_id": 968, "author_profile": "https://Stackoverflow.com/users/968", "pm_score": 3, "selected": false, "text": "-- This is for the data\ncreate table datastuff (\n id int not null identity(1, 1),\n userid nvarchar(64) not null default(...
2008/11/17
[ "https://Stackoverflow.com/questions/295710", "https://Stackoverflow.com", "https://Stackoverflow.com/users/968/" ]
295,719
<p>We have a custom REST handler on ASP.NET that is configured like this to handle all incoming requests:</p> <pre><code>&lt;add path="*" verb="*" type="REST.RESTProtocolHandler"/&gt; </code></pre> <p>However, passing it a pipe character, properly encoded or not at all, triggers a validation error that seems to come from inside ASP.NET.</p> <p>Accessing <code><a href="http://localhost:8080/%7c" rel="nofollow noreferrer">http://localhost:8080/%7c</a></code> or <code><a href="http://localhost:8080/|" rel="nofollow noreferrer">http://localhost:8080/|</a></code> yields this error:</p> <blockquote> <p>[ArgumentException: Illegal characters in path.] System.IO.Path.CheckInvalidPathChars(String path) +7489125 System.IO.Path.Combine(String path1, String path2) +40 System.Web.Configuration.UserMapPath.GetPhysicalPathForPath(String path, VirtualDirectoryMapping mapping) +114 System.Web.Configuration.UserMapPath.GetPathConfigFilename(String siteID, VirtualPath path, String&amp; directory, String&amp; baseName) +72 System.Web.Configuration.UserMapPath.MapPath(String siteID, VirtualPath path) +30 System.Web.Configuration.UserMapPath.MapPath(String siteID, String path) +31 System.Web.Hosting.HostingEnvironment.MapPathActual(VirtualPath virtualPath, Boolean permitNull) +297 System.Web.Hosting.HostingEnvironment.MapPathInternal(VirtualPath virtualPath, Boolean permitNull) +51 System.Web.CachedPathData.GetConfigPathData(String configPath) +341 System.Web.CachedPathData.GetVirtualPathData(VirtualPath virtualPath, Boolean permitPathsOutsideApp) +110 System.Web.HttpContext.GetFilePathData() +36 System.Web.HttpContext.GetConfigurationPathData() +26 System.Web.Configuration.RuntimeConfig.GetConfig(HttpContext context) +43 System.Web.Configuration.CustomErrorsSection.GetSettings(HttpContext context, Boolean canThrow) +41 System.Web.HttpResponse.ReportRuntimeError(Exception e, Boolean canThrow, Boolean localExecute) +101 System.Web.HttpRuntime.FinishRequest(HttpWorkerRequest wr, HttpContext context, Exception e) +383</p> </blockquote> <p>No userland code gets executed. Is this a configuration option somewhere? Reproduced on IIS 7 &amp; VS Studio's 2008 devel server.</p> <p>Stack Overflow seems to handle this error OK, it looks like a dynamically generated 404 MVC page gets rendered for <a href="https://stackoverflow.com/%7c"><a href="https://stackoverflow.com/%7c">https://stackoverflow.com/%7c</a></a>.</p> <p>Any ideas?</p>
[ { "answer_id": 302093, "author": "Sunny Milenov", "author_id": 8220, "author_profile": "https://Stackoverflow.com/users/8220", "pm_score": 1, "selected": false, "text": "protected void Application_Error(Object sender, EventArgs e)\n{\n Exception ex = Server.GetLastError();\n //do w...
2008/11/17
[ "https://Stackoverflow.com/questions/295719", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28917/" ]
295,731
<p>I have a website built in C#.NET that tends to produce a fairly steady stream of SQL timeouts from various user controls and I want to easily pop some code in to catch all unhandled exceptions and send them to something that can log them and display a friendly message to the user.</p> <p>How do I, through minimal effort, catch all unhandled exceptions?</p> <p><a href="https://stackoverflow.com/questions/944/unhandled-exception-handler-in-net-11">this question</a> seems to say it's impossible, but that doesn't make sense to me (and it's about .NET 1.1 in windows apps): </p>
[ { "answer_id": 295739, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 2, "selected": false, "text": "Exception" }, { "answer_id": 295803, "author": "P Daddy", "author_id": 36388, "author_profile": "htt...
2008/11/17
[ "https://Stackoverflow.com/questions/295731", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2462/" ]
295,736
<p>I need to spawn a process in Java (under Linux exclusively) that will continue to run after the JVM has exited. How can I do this? </p> <p>Basically the Java app should spawn an updater which stops the Java app, updates files and then starts it again.</p> <p>I'm interested in a hack &amp; slash method to just get it working as well as a better design proposal if you have one :)</p>
[ { "answer_id": 295748, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 5, "selected": true, "text": "java.lang.Process" }, { "answer_id": 39486055, "author": "cowls", "author_id": 992151, "author_profil...
2008/11/17
[ "https://Stackoverflow.com/questions/295736", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
295,752
<p>I am trying to write an installer (by creating a .vdproj) that will work on both Windows Vista and XP. The only thing I am finding is that when I try to run it on Vista, the files that I include in the installer are installed with Read-only permissions for the Users groups. This is a problem because the application needs to read/write from these files. The only way I have been able to get it to work is to either "Run as Administrator" or actually change the permissions. Does anyone know how to make these files be open to anyone to write? Thanks.</p>
[ { "answer_id": 295787, "author": "Joel Coehoorn", "author_id": 3043, "author_profile": "https://Stackoverflow.com/users/3043", "pm_score": 4, "selected": true, "text": "Environment.GetFolderPath()" } ]
2008/11/17
[ "https://Stackoverflow.com/questions/295752", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14101/" ]
295,766
<p>The XML file I want to parse starts with :</p> <pre><code>&lt;!DOCTYPE plist PUBLIC "-//...//DTD PLIST 1.0//EN" "http://www.....dtd"&gt; </code></pre> <p>So when I start the SAX praser, it tries to access this DTD online, and I get a java.net.UnknownHostException.</p> <ol> <li>I cannot modify the XML file before feeding it to the SAX parser</li> <li>I have to run even with no internet connection</li> </ol> <p>How can I change the SAX Parser behaviour so that it does not try to load the DTD ? Thanks.</p> <pre><code>javax.xml.parsers.SAXParserFactory factory = javax.xml.parsers.SAXParserFactory.newInstance(); factory.setValidating(false); javax.xml.parsers.SAXParser parser = factory.newSAXParser(); parser.parse(xmlFile, handler); </code></pre>
[ { "answer_id": 295840, "author": "Gowri", "author_id": 3253, "author_profile": "https://Stackoverflow.com/users/3253", "pm_score": 0, "selected": false, "text": "EntityResolver" }, { "answer_id": 295998, "author": "Gowri", "author_id": 3253, "author_profile": "https:/...
2008/11/17
[ "https://Stackoverflow.com/questions/295766", "https://Stackoverflow.com", "https://Stackoverflow.com/users/155796/" ]
295,771
<p>I have a SQL SELECT query which has a LIKE clause containing an underscore, which should specifically look for an underscore, not treat it as a wildcard: </p> <pre><code>SELECT * FROM my_table WHERE name LIKE '_H9%'; </code></pre> <p>I understand that I can change the actual clause to '[_]H9%' for this to work as I expect, but the problem is that this clause is being generated by Hibernate.</p> <p>Is there a way to configure Hibernate to escape all underscores in all queries in this way? Failing that, is there a way to configure SQL Server (2008 in my case) to <em>not</em> treat underscores as wildcards?</p>
[ { "answer_id": 423054, "author": "Cowan", "author_id": 17041, "author_profile": "https://Stackoverflow.com/users/17041", "pm_score": 4, "selected": true, "text": "public class EscapingLikeExpression extends LikeExpression {\n public EscapingLikeExpression(String propertyName, String val...
2008/11/17
[ "https://Stackoverflow.com/questions/295771", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1174/" ]
295,772
<p>I have a *.MDB database file, and I am wondering if it is possible or recommended to work against it using LINQ in C#. I am also wondering what some simple examples would look like.</p> <p>I don't know a lot about LINQ, but my requirements for this task are pretty simple (I believe). The user will be passing me a file path to Microsoft Access MDB database and I would like to use LINQ to add rows to one of the tables within the database.</p>
[ { "answer_id": 2332263, "author": "Quinten Miller", "author_id": 264147, "author_profile": "https://Stackoverflow.com/users/264147", "pm_score": 1, "selected": false, "text": "eICATDataSet.ICSWSbuDataTable tbl = new eICATDataSet.ICSWSbuDataTable();\n\nICSWSbuTableAdapter ta = new ICSWSbu...
2008/11/17
[ "https://Stackoverflow.com/questions/295772", "https://Stackoverflow.com", "https://Stackoverflow.com/users/506/" ]
295,773
<p>I have a basic ajax application, which will not work, instead the php code is displayed in the browser. The javascript and html seem fine. I have copied the code verbatim from here:</p> <p><a href="http://arief.aeroven.com/2008/07/30/first-ajax-script-tutorial-connecting-ajax-contain-pure-htmlphpand-javascript-to-mysql-database/" rel="nofollow noreferrer">http://arief.aeroven.com/2008/07/30/first-ajax-script-tutorial-connecting-ajax-contain-pure-htmlphpand-javascript-to-mysql-database/</a></p> <p>and this is the php:</p> <pre><code>&lt;? session_start(); //start the session $cmd = $_GET["cmd"]; $con = mysql_connect('localhost', 'root', 'indosat'); if (!con) { die('Connection to MySQL server failed: ' . mysql_error()); //show error message (mysql_error) if connection failed } mysql_select_db('ajax', $con); //select the database, in this case our database name is "ajax" if ($cmd === 'GetEmployee') //set command value (executed from javascript ajaxlib.js) { sleep(10); //give delay about 10 seconds before execute the command //we use this sleep function so we can see the loading animation //you can edit/remove echo "&lt;table border='1' width='100%'&gt; &lt;tr&gt; &lt;th&gt;EmpNo&lt;/th&gt; &lt;th&gt;fName&lt;/th&gt; &lt;th&gt;lName&lt;/th&gt; &lt;th&gt;Age&lt;/th&gt; &lt;/tr&gt;"; //print a table to browser to show the values $sql = "select * from employee"; //this is query to show all records $result = mysql_query($sql); //execute the query &amp; fill it to $result variable while ($row = mysql_fetch_array($result)) { echo "&lt;tr&gt; &lt;td&gt;" . $row['IdEmp'] . "&lt;/td&gt; &lt;td&gt;" . $row['fName'] . "&lt;/td&gt; &lt;td&gt; " . $row['lName'] . "&lt;/td&gt; &lt;td&gt;" . $row['Age'] . "&lt;/td&gt; &lt;/tr&gt;"; //print the record to the table } echo '&lt;/table&gt;'; //close the table } mysql_close($con); //close the mysql connection ?&gt; </code></pre> <p>I don't see what the problem could be</p> <p>edit: it is NOT the shorttags. they are enabled, andusing "long" tags makes no difference.</p>
[ { "answer_id": 295784, "author": "DreamWerx", "author_id": 15487, "author_profile": "https://Stackoverflow.com/users/15487", "pm_score": 2, "selected": false, "text": "\"<?php\"" }, { "answer_id": 295909, "author": "Tom", "author_id": 26155, "author_profile": "https:/...
2008/11/17
[ "https://Stackoverflow.com/questions/295773", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1246613/" ]
295,781
<p>I'm sure there is a quick and easy way to calculate the sum of a column of values on Unix systems (using something like <code>awk</code> or <code>xargs</code> perhaps), but writing a shell script to parse the rows line by line is the only thing that comes to mind at the moment.</p> <p>For example, what's the simplest way to modify the command below to compute and display the total for the SEGSZ column (70300)?</p> <pre><code>ipcs -mb | head -6 IPC status from /dev/kmem as of Mon Nov 17 08:58:17 2008 T ID KEY MODE OWNER GROUP SEGSZ Shared Memory: m 0 0x411c322e --rw-rw-rw- root root 348 m 1 0x4e0c0002 --rw-rw-rw- root root 61760 m 2 0x412013f5 --rw-rw-rw- root root 8192 </code></pre>
[ { "answer_id": 295812, "author": "warren", "author_id": 4418, "author_profile": "https://Stackoverflow.com/users/4418", "pm_score": 1, "selected": false, "text": "cut" }, { "answer_id": 295817, "author": "Johannes Schaub - litb", "author_id": 34509, "author_profile": ...
2008/11/17
[ "https://Stackoverflow.com/questions/295781", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17035/" ]
295,798
<p>I'm looking for a module or some way to obtain the information about the content of a file. </p> <p>The same sort of thing that the Linux "file" command does, but in Perl language.</p>
[ { "answer_id": 296070, "author": "David Ameller", "author_id": 19689, "author_profile": "https://Stackoverflow.com/users/19689", "pm_score": -1, "selected": false, "text": "$res = `file a.txt`;\n" } ]
2008/11/17
[ "https://Stackoverflow.com/questions/295798", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19689/" ]
295,811
<p>I have a .jar file that i've placed in my D:\Coldfusion8\wwwroot\web-inf\lib\ directory. The file is abcdef.jar</p> <p>This is my first time doing this, not sure what the path should be in my createObject().</p> <pre><code>&lt;cfset abcObj = createObject("java","com.abcdef") /&gt; &lt;cfset result = acbObj.doStuff("123456") /&gt; </code></pre> <p>But when I run it, I get </p> <pre><code>Object Instantiation Exception. Class not found: com.vp4jo_b </code></pre> <p>What am I missing in the path?</p>
[ { "answer_id": 295918, "author": "Tomalak", "author_id": 18771, "author_profile": "https://Stackoverflow.com/users/18771", "pm_score": 3, "selected": true, "text": "CreateObject()" } ]
2008/11/17
[ "https://Stackoverflow.com/questions/295811", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26121/" ]
295,827
<p><strong>Background</strong></p> <p>We have a web application in which several developers have written several .js files that manipulate the DOM and the problem of duplicate function names has crept into our application.</p> <p><strong>Question</strong></p> <p>Can anyone recommend a tool that will warn us when we accidentally write a web page with two javascript functions with the same name? </p> <p><strong>Example</strong></p> <p><em>HTML page</em></p> <pre><code>&lt;script language="JavaScript" src="test.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script&gt;function foo() {alert('bar');}&lt;/script&gt; </code></pre> <p><em>test.js</em></p> <pre><code>function foo() {alert('foo');} </code></pre> <p>Since foo() is declared twice in the page, apparently only the one that takes precedence is loaded. </p> <p>The tools I've used seem to ignore this. Firebug only shows the loaded function. Netbeans will show both functions in navigator (without a warning), but only looks at one file at a time (ie, I can't point it at the HTML file and see it and the .js at the same time.) and web developer extensions allows me to look at everything at once, but no errors or warnings. Firefox's error console also throws no warning or error. Neither does IE.</p> <p>Thanks!</p>
[ { "answer_id": 296393, "author": "picardo", "author_id": 32816, "author_profile": "https://Stackoverflow.com/users/32816", "pm_score": 4, "selected": true, "text": "var myNamespace = function (){\n var myPrivateProperty;\n var myPrivateFunction = function(){};\n return{\n\n my...
2008/11/17
[ "https://Stackoverflow.com/questions/295827", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1181/" ]
295,832
<p>Consider the following code in VB9:</p> <pre><code>Dim text = "Line1&lt;br/&gt;Line2" Dim markup = &lt;span&gt;&lt;%= text %&gt;&lt;/span&gt;.ToString </code></pre> <p>While I was hoping markup would end up being <code>&lt;span&gt;Line1&lt;br/&gt;Line2&lt;/span&gt;</code>, it actually evaluates to <code>&lt;span&gt;Line1&amp;lt;br/&amp;gt;Line2&lt;/span&gt;</code>.</p> <p>Is there any way to get the value of the variable not to be HTML encoded?</p> <p>P.S.: This is an oversimplified example of what I'm trying to do. I know this could be rewritten a number of ways to make it work, but the way my code is constructed, un-encoding the variable would be optimal. If that's not possible, then I'll go down a different road.</p> <p>More detail: The "text" is coming from a database, where a user can enter free-form text, with carriage returns. The output is HTML, so somehow I need to get the value from the database and convert the carriage returns to line breaks.</p>
[ { "answer_id": 295891, "author": "JaredPar", "author_id": 23283, "author_profile": "https://Stackoverflow.com/users/23283", "pm_score": 3, "selected": true, "text": "<br/>" }, { "answer_id": 355140, "author": "Robin Rodricks", "author_id": 41021, "author_profile": "ht...
2008/11/17
[ "https://Stackoverflow.com/questions/295832", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23935/" ]
295,833
<p>Could someone explain why this works in C#.NET 2.0:</p> <pre><code> Nullable&lt;DateTime&gt; foo; if (true) foo = null; else foo = new DateTime(0); </code></pre> <p>...but this doesn't:</p> <pre><code> Nullable&lt;DateTime&gt; foo; foo = true ? null : new DateTime(0); </code></pre> <p>The latter form gives me an compile error "Type of conditional expression cannot be determined because there is no implicit conversion between '&lt;null&gt;' and 'System.DateTime'."</p> <p>Not that I can't use the former, but the second style is more consistent with the rest of my code.</p>
[ { "answer_id": 295842, "author": "Stewart Johnson", "author_id": 6408, "author_profile": "https://Stackoverflow.com/users/6408", "pm_score": 9, "selected": true, "text": "null" }, { "answer_id": 295859, "author": "FlySwat", "author_id": 1965, "author_profile": "https:...
2008/11/17
[ "https://Stackoverflow.com/questions/295833", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38258/" ]
295,836
<p>When using CDT I would like to have std::string show up in the 'variable' debug window with the string it contains. For instance if it is currently holding the word <em>"history"</em> I would like to see <strong>history</strong> in the debugger window labeled "variables". </p> <p>I think that there is a general way to have it drill down into objects but I can't put my finger on it. Does anyone out there know how to do this?</p> <p>This would also be useful for me to use when outputting just a single field from a complex object.</p> <p>Thanks, Bill</p>
[ { "answer_id": 444448, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 0, "selected": false, "text": "up" }, { "answer_id": 7463960, "author": "Chris Seddon", "author_id": 951592, "author_profile": "https://S...
2008/11/17
[ "https://Stackoverflow.com/questions/295836", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1265473/" ]
295,839
<p>I am using following code to embed files, video with <code>.wmv</code> extension, that is not working in Firefox. It's working fine in IE.</p> <pre><code>document.getElementById("QuestionMedia").innerHTML += '&lt;OBJECT ID="MediaPlayer" WIDTH="350" HEIGHT="280" CLASSID="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"STANDBY="Loading Windows Media Player components..." TYPE="application/x-oleobject"&gt;' + '&lt;PARAM NAME="FileName" VALUE="video/' + Question.Media + '"&gt;' + '&lt;PARAM name="autostart" VALUE="false"&gt;' + '&lt;PARAM name="ShowControls" VALUE="true"&gt;' + '&lt;param name="ShowStatusBar" value="false"&gt;' + '&lt;PARAM name="ShowDisplay" VALUE="false"&gt;' + '&lt;EMBED TYPE="video/x-ms-wmv " SRC="video/' + Question.Media + '" NAME="MediaPlayer" WIDTH="350" HEIGHT="280" ShowControls="1" ShowStatusBar="0" ShowDisplay="0" autostart="1"&gt; &lt;/EMBED&gt;' + '&lt;/OBJECT&gt;'; </code></pre> <p>Please let me know what would I do to make it work..?</p>
[ { "answer_id": 405517, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 0, "selected": false, "text": "<!-- begin embedded WindowsMedia file... -->\n<table border='0' cellpadding='0' align=\"center\">\n <tr><td>\n <OBJECT id=...
2008/11/17
[ "https://Stackoverflow.com/questions/295839", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38260/" ]
295,849
<p>In Perl</p> <pre><code>print "a" x 3; # aaa </code></pre> <p>In C# </p> <pre><code>Console.WriteLine( ??? ) </code></pre>
[ { "answer_id": 295856, "author": "Marc Gravell", "author_id": 23354, "author_profile": "https://Stackoverflow.com/users/23354", "pm_score": 5, "selected": true, "text": "new string('a',3)" }, { "answer_id": 295857, "author": "GeekyMonkey", "author_id": 29900, "author_...
2008/11/17
[ "https://Stackoverflow.com/questions/295849", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4200/" ]
295,860
<p>As a primarily Windows developer, perhaps I'm missing something cultural in the Linux community, but it has always confused me.</p> <p>When downloading something that the files are first put into a <code>.tar</code> archive then <em>zipped</em>. Why the two-step process? Doesn't <em>zipping</em> achieve the file grouping? Is there some other benefit that I'm not aware of?</p>
[ { "answer_id": 295865, "author": "Stewart Johnson", "author_id": 6408, "author_profile": "https://Stackoverflow.com/users/6408", "pm_score": 8, "selected": true, "text": "bzip" }, { "answer_id": 295913, "author": "Jonathan Leffler", "author_id": 15168, "author_profile...
2008/11/17
[ "https://Stackoverflow.com/questions/295860", "https://Stackoverflow.com", "https://Stackoverflow.com/users/767/" ]
295,861
<p>Being a Windows developer I'm currently working on my own project using LAMP. I understand what I need to know of PHP and MySQL, but Linux looks huge and it's not clear where to start and what is enough given my goals. And my goals are to grasp general concepts, being able to deploy the project to a hosting provider and to be able to monitor the site's performance in order to spot problems, load issues, etc.</p> <p>I know, the best solution is to get a Linux administrator to do that, but before I can do that I need to do it myself.</p>
[ { "answer_id": 296057, "author": "Astra", "author_id": 5862, "author_profile": "https://Stackoverflow.com/users/5862", "pm_score": 1, "selected": false, "text": "sudo /etc/init.d/apache stop" }, { "answer_id": 296069, "author": "S.Lott", "author_id": 10661, "author_pr...
2008/11/17
[ "https://Stackoverflow.com/questions/295861", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28098/" ]
295,877
<p>I'd like to group the digits in a double by thousands, but also output however number of decimals are actually in the number. I cannot figure out the format string. </p> <pre class="lang-cs prettyprint-override"><code> 1000 =&gt; 1,000 100000 =&gt; 100,000 123.456 =&gt; 123.456 100000.21 =&gt; 100,000.21 100200.123456 =&gt; 100,200.123456 </code></pre> <p>Disclaimers (it's not as straight forward as you think): </p> <ul> <li>Please do not point me to <a href="https://stackoverflow.com/questions/105770/net-stringformat-to-add-commas-in-thousands-place-for-a-number">this question</a> it does not answer my question</li> <li>Please do not point me to <a href="http://msdn.microsoft.com/en-us/library/dwhawy9k.aspx" rel="nofollow noreferrer">MS</a><a href="http://msdn.microsoft.com/en-us/library/0c899ak8.aspx#" rel="nofollow noreferrer">DN</a>, the articles have not helped me. (If you believe I'm reading them incorrectly, read them yourself and post the correct answer)</li> <li><code>.ToString("n")</code> does not work, it rounds the digits</li> </ul>
[ { "answer_id": 295902, "author": "Joel Coehoorn", "author_id": 3043, "author_profile": "https://Stackoverflow.com/users/3043", "pm_score": 0, "selected": false, "text": "Dim vals() As Double = {1000, 100000, 123.456, 100000.21, 100200.123456}\nFor Each val As Double in vals\n Console.W...
2008/11/17
[ "https://Stackoverflow.com/questions/295877", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8435/" ]
295,897
<p>We have 50+ Java batch processes that run at different times of the day. They run on a Solaris box, and are started via cron. Currently, the only way we only know if they succeed or fail is by an email generated at the end of each batch process. We have a support team that monitors these emails. Recently, we've had issues with emails not being received, even though the batches are running. There must be a better way.</p> <p>Without having to reinvent the wheel, are there any open source batch monitoring applications?</p> <p>And a more general question, what is the best way to monitor batch processes?</p>
[ { "answer_id": 295941, "author": "Ken Gentle", "author_id": 8709, "author_profile": "https://Stackoverflow.com/users/8709", "pm_score": 3, "selected": true, "text": "Schedule Tasks" } ]
2008/11/17
[ "https://Stackoverflow.com/questions/295897", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29962/" ]
295,900
<p>I am using a System.Random object which is instantiated with a fixed seed all thoughout the application. I am calling the NextDouble method and after some time passed I am getting 0.0 as result.</p> <p>Is there any remedy to this, has anyone else encountered this ?</p> <p>EDIT: I have one seed for the whole run which is set to 1000 for convience sake. The random.NextDouble is called several hundred thousand times. It is an optimizer application and could run for couple hours, but this actually happens after 10-0 mins of execution. I have recently added little bit more random calls to the app.</p>
[ { "answer_id": 295955, "author": "e.James", "author_id": 33686, "author_profile": "https://Stackoverflow.com/users/33686", "pm_score": 5, "selected": true, "text": "class ThreadSafeRandom\n{\n private static Random random = new Random();\n\n public static int Next()\n {\n ...
2008/11/17
[ "https://Stackoverflow.com/questions/295900", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4694/" ]
295,919
<p>I can't seem to figure out what I am doing wrong here. I publish my website to my server and when I try to run it I get the following exception:</p> <blockquote> <p>Could not load the assembly 'App_Web_kh7-x3ka'. Make sure that it is compiled before accessing the page.</p> </blockquote> <p>Has anyone else ever encountered this?</p>
[ { "answer_id": 296289, "author": "ChrisAnnODell", "author_id": 1758, "author_profile": "https://Stackoverflow.com/users/1758", "pm_score": 6, "selected": true, "text": "<%@Page />" } ]
2008/11/17
[ "https://Stackoverflow.com/questions/295919", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20748/" ]
295,920
<p>Is there a way to prematurely abort a transaction? Say, I have sent a command to the database which runs five minutes and after four, I want to abort it.</p> <p>Does JDBC define a way to send a "stop whatever you are doing on this connection" signal to the DB?</p>
[ { "answer_id": 295950, "author": "Gowri", "author_id": 3253, "author_profile": "https://Stackoverflow.com/users/3253", "pm_score": 4, "selected": false, "text": "java.sql.Statement.setQueryTimeout(seconds)\n" } ]
2008/11/17
[ "https://Stackoverflow.com/questions/295920", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34088/" ]
295,925
<pre><code>/* I start with this: */ &lt;Report&gt; &lt;prop1&gt;4&lt;/prop1&gt; &lt;prop2&gt;2255&lt;/prop2&gt; &lt;prop3&gt;true&lt;/prop3&gt; &lt;prop4&gt;false&lt;/prop4&gt; &lt;prop5&gt;true&lt;/prop5&gt; &lt;/Report&gt; /* I want this result (change the value of node "prop5"): */ &lt;Report&gt; &lt;prop1&gt;4&lt;/prop1&gt; &lt;prop2&gt;2255&lt;/prop2&gt; &lt;prop3&gt;true&lt;/prop3&gt; &lt;prop4&gt;false&lt;/prop4&gt; &lt;prop5&gt;false&lt;/prop5&gt; &lt;/Report&gt; /* I tried this: */ var reportXML:XML = &lt;Report&gt; &lt;prop1&gt;4&lt;/prop1&gt; &lt;prop2&gt;2255&lt;/prop2&gt; &lt;prop3&gt;true&lt;/prop3&gt; &lt;prop4&gt;false&lt;/prop4&gt; &lt;prop5&gt;true&lt;/prop5&gt; &lt;/Report&gt;; var myArray:Array = [{xmlNodeName: "prop5", value: false}]; for each (var item:Object in myArray) { report.xml[item.xmlNodeName] = item.value.toString(); } /* But this just adds a new node, resulting in this: */ &lt;Report&gt; &lt;prop1&gt;4&lt;/prop1&gt; &lt;prop2&gt;2255&lt;/prop2&gt; &lt;prop3&gt;true&lt;/prop3&gt; &lt;prop4&gt;false&lt;/prop4&gt; &lt;prop5&gt;true&lt;/prop5&gt; &lt;prop5&gt;false&lt;/prop5&gt; &lt;/Report&gt;; </code></pre>
[ { "answer_id": 295932, "author": "Christophe Herreman", "author_id": 17255, "author_profile": "https://Stackoverflow.com/users/17255", "pm_score": -1, "selected": false, "text": "report.prop5[0] = false;\n" }, { "answer_id": 296859, "author": "defmeta", "author_id": 10875...
2008/11/17
[ "https://Stackoverflow.com/questions/295925", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31298/" ]
295,936
<p>How could I setup a nice indice on <code>cap:deploy</code>?</p> <p>I want the remote server to nice the <code>cp</code> commands like so: </p> <pre><code>nice -n 19 cp ... </code></pre>
[ { "answer_id": 295932, "author": "Christophe Herreman", "author_id": 17255, "author_profile": "https://Stackoverflow.com/users/17255", "pm_score": -1, "selected": false, "text": "report.prop5[0] = false;\n" }, { "answer_id": 296859, "author": "defmeta", "author_id": 10875...
2008/11/17
[ "https://Stackoverflow.com/questions/295936", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
295,938
<p>I have an issue with EMMA where it is correctly covering all my various Java projects except one. I am puzzled as to why this occurs as the ANT script appears to be correct. The following expected output is given:</p> <pre><code> [echo] c:\cc_local_home\emmadata\ProjectName [instr] processing instrumentation path ... [instr] instrumentation path processed in 1876 ms [instr] [84 class(es) instrumented, 0 resource(s) copied] [instr] metadata merged into [c:\cc_local_home\data\2008-11-17_14.35.19\coverage.emma] {in 62 ms} </code></pre> <p>The above is generated by the following piece of ANT script:</p> <pre><code>&lt;target name="emma" depends="init" if="use.emma"&gt; &lt;echo message="${emma.bin}" /&gt; &lt;emma enabled="true"&gt; &lt;instr instrpath="${test.bin}" destdir="${emma.bin}" metadatafile="${test.data.dir}/coverage.emma" merge="true"&gt; &lt;filter excludes="*Test*,*test*" /&gt; &lt;filter excludes="*Exception" /&gt; &lt;filter excludes="*AppConstants" /&gt; &lt;/instr&gt; &lt;/emma&gt; &lt;/target&gt; </code></pre> <p>After the JUnit tests are run, the following is logged.</p> <p>emma.report: [report] processing input files ...<br> [report] 1 file(s) read and merged in 16 ms<br> [report] nothing to do: no runtime coverage data found in any of the data files </p> <p>And no coverage report is generated.</p> <p>I am certain that the coverage.emma files are being linked correctly so why is EMMA not covering the code?</p> <p>The <code>emma.report</code> task looks like the following:</p> <pre><code>&lt;target name="emma.report" if="use.emma"&gt; &lt;emma enabled="true"&gt; &lt;report sourcepath="${test.reports.dir}"&gt; &lt;infileset dir="${test.data.dir}" includes="*.emma" /&gt; &lt;html outfile="${test.reports.dir}/coverage.html" /&gt; &lt;/report&gt; &lt;/emma&gt; &lt;/target&gt; </code></pre>
[ { "answer_id": 295966, "author": "Ken Gentle", "author_id": 8709, "author_profile": "https://Stackoverflow.com/users/8709", "pm_score": 1, "selected": false, "text": "<emma.report>" }, { "answer_id": 296355, "author": "Community", "author_id": -1, "author_profile": "h...
2008/11/17
[ "https://Stackoverflow.com/questions/295938", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
295,939
<p>Is there a way to print out the diffs like they show when you open them with "gvim -d", with all the common code folded away and only the diffs showing in context? I tried the print menu option, but it printed the entire file that I was currently "in", rather than printing the folded diffs.</p>
[ { "answer_id": 298775, "author": "Gowri", "author_id": 3253, "author_profile": "https://Stackoverflow.com/users/3253", "pm_score": 3, "selected": true, "text": ":he convert-to-HTML\n" }, { "answer_id": 9908506, "author": "codeape", "author_id": 3571, "author_profile":...
2008/11/17
[ "https://Stackoverflow.com/questions/295939", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3333/" ]
295,948
<p>Sometimes when running selenium, it displays a message similar to:</p> <blockquote> <p>WARN - Invalid length: Content-Length=798242 written=8192</p> </blockquote> <p>And then Selenium stops responding. The website under automation runs on ASP.NET, and served up via IIS.</p> <p>How do I prevent Selenium from stopping due to whatever error this is?</p>
[ { "answer_id": 5122222, "author": "Wesley Wiser", "author_id": 124538, "author_profile": "https://Stackoverflow.com/users/124538", "pm_score": 0, "selected": false, "text": "Response.ClearContent();\nstring data = GetSomeData();\nResponse.Write(data);\nResponse.Flush();\nResponse.Close()...
2008/11/17
[ "https://Stackoverflow.com/questions/295948", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13172/" ]
295,952
<p>Suppose I want to create a set of observers based on type. That is to say, when they are notified of an event, they are told the type of one of the arguments and then decides whether or not to act based on if it can operate on that type.</p> <p>Are there any simple ways to do this? I figured this would be fairly simple to do with generics, but that seems to be turning out to be harder than I imagined. And I would prefer not to have to deal with casting a bunch of references to object if I can avoid it.</p> <p>Where I'm getting stuck is in doing this:</p> <pre><code>public delegate void NotifyDelegate&lt;T&gt;(IEnumerator&lt;T&gt; loadable, NotifyArgs na); interface IObserver { void Notify&lt;T&gt;(IEnumerator&lt;T&gt; loadable, NotifyArgs na); } class Subject { NotifyDelegate notifier; //won't compile: needs type args void Register(IObserver o) { notifier += o.Notify; } } </code></pre> <p>Of course, I could make the Subject generic as well, but then I have to have a separate Subject for each type. Does anyone have any advice here? Is there some piece of functionality that I'm missing somewhere or am I overcomplicating this?</p> <p><strong>UPDATE</strong>: I did oversimplify the arguments that Notify and NotifyDelegate take. Instead of this:</p> <pre><code>public delegate void NotifyDelegate&lt;T&gt;(NotifyArgs na); </code></pre> <p>I'm actually wanting to do something like this:</p> <pre><code>public delegate void NotifyDelegate&lt;T&gt;(IEnumerator&lt;T&gt; loadable, NotifyArgs na); </code></pre> <p>What I'm basically trying to pass back and forth is data from a database. Sorry if the previous code sample confused anyone.</p>
[ { "answer_id": 296004, "author": "Skizz", "author_id": 1898, "author_profile": "https://Stackoverflow.com/users/1898", "pm_score": 3, "selected": true, "text": "interface IObserver\n{\n}\n\nclass Subject\n{\n public Subject ()\n {\n m_observers = new List<IObserver> ();\n }\n\n pu...
2008/11/17
[ "https://Stackoverflow.com/questions/295952", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2147/" ]
295,956
<p>I have a JEdit (BeanShell) macro which opens a specific file then immediately saves the file to my c:\temp folder (so that I don't accidentally update the real file).</p> <p>Here is the bean shell code:</p> <pre><code>logFilePath = &quot;c:\\temp\\aj.txt&quot;; jEdit.openFile( view , logFilePath ); _buffer = jEdit.getBuffer(logFilePath); _buffer.save(view,&quot;c:\\temp\\backup.txt&quot;,true); </code></pre> <p>This gives me the following error:</p> <pre><code>I/O Error Each buffer can only execute one input/output operation at a time. Please wait until the current operation finishes (or abort it in the I/O progress monitor) before starting another one. </code></pre> <p>I have tried adding a while loop to wait until <code> buffer.isLoaded() </code> is true, but that just goes into an infinite loop.<br /> What does seem to work is popping up a message box (<code> Macros.message </code>). However, I really don't want to have this unnecessary dialogue.</p> <p>I don't know much java, so please tell me if I'm making a rookie mistake.</p> <h2>Update:</h2> <p>Added my own answer to show the code pointed to from <a href="https://stackoverflow.com/users/34009/serhii">Serhii's answer</a>.</p>
[ { "answer_id": 296361, "author": "Serxipc", "author_id": 34009, "author_profile": "https://Stackoverflow.com/users/34009", "pm_score": 3, "selected": true, "text": "VFSManager.waitForRequests();" }, { "answer_id": 298291, "author": "AJ.", "author_id": 7211, "author_pr...
2008/11/17
[ "https://Stackoverflow.com/questions/295956", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7211/" ]
295,990
<p>I'm trying to implement a stateful web service in PHP using the SOAP extension. (Yes I know that web services are supposed to be stateless; all I really care to persist is some form of a session ID so I don't need to authenticate with every call to the service). PHP.net's API documentation is somewhat lacking on this, and there isn't much else written on it.</p> <p>I found one page that discusses it (<a href="http://bytes.com/forum/thread160816.html" rel="nofollow noreferrer">http://bytes.com/forum/thread160816.html</a>) and implemented the code as a test. I built a small .NET application that consumes the web service and calls each function and displays the result. From what I've read, the PHP SOAP extension will persist class variables between calls as long as the functionality is encapsulated in a class using the setClass() function and the setPersistence() function is passed SOAP_PERSISTENCE_SESSION.</p> <p>Here is my code:</p> <pre><code>&lt;?php class User { var $name = "Initial value"; function setName($name) { $this-&gt;name = $name; // Tried this too. // $this-&gt;name = "Set to string constant" ; } function getName() { // This always returns "Initial value" return $this-&gt;name; } } // Tried placing session_start() in several places // before $server-&gt;handle()... // One guy says this doesn't need to be called. // I assume it depends on if session autostart is on. session_start(); $server = new SoapServer(null, array('uri' =&gt; 'http://localhost/')); $server-&gt;setClass('User'); $server-&gt;setPersistence(SOAP_PERSISTENCE_SESSION); $server-&gt;handle(); ?&gt; </code></pre> <p>The problem I run into is that $name is not persisted between calls -- I always get the initialized value and not the value I assign to setName(). As I stated, I'm trying to persist a session ID after authenticating against a database -- if anyone has a better way to do this I'm open to suggestions; however, I would still like to solve the general case. Anyone have any ideas?</p>
[ { "answer_id": 297525, "author": "Steve Kalemkiewicz", "author_id": 38151, "author_profile": "https://Stackoverflow.com/users/38151", "pm_score": 2, "selected": true, "text": "using System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Data;\nusing System...
2008/11/17
[ "https://Stackoverflow.com/questions/295990", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38151/" ]
295,992
<pre><code>var i : integer; i := 1234567; </code></pre> <p>Given the above, I want the string "1,234,567" as output (assuming UK locale). IntToStr just gives me "1234567". I'm sure there's a one-liner for this, but I can't find it...</p>
[ { "answer_id": 296047, "author": "Bruce McGee", "author_id": 19183, "author_profile": "https://Stackoverflow.com/users/19183", "pm_score": 5, "selected": true, "text": "Label1.Caption := Format('%.0n', [i + 0.0]);\n" }, { "answer_id": 296093, "author": "Mark", "author_id"...
2008/11/17
[ "https://Stackoverflow.com/questions/295992", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1737/" ]
295,993
<p>I'm actual looking for a way to get notified about any changes on a SharePoint group. First I though I would be able to this by attaching a event handler to some kind of group list. But unfortunately there are no such list representing SharePoint groups. </p> <p>My second attempt was to bind a event handler to the content type SharePointGroup but this didn't work either. </p> <p>So are there any other options to get notified about events on a SharePoint group?</p> <p><strong>EDIT:</strong></p> <p>Thanks for the reply so far.</p> <p>I forgot to mention that I've already googled and read about the user information list. Sorry.</p> <p>First I found a forum entry where they post the relative URL to the user information list (_catalogs/users/simple.aspx). When I'm using this link to see the list,it only contains users and no groups. I don't know but perhaps this link does some filtering on the list.</p> <p>The other information I found about in several blog and forum posts was that a event handler attached to the user information list are not fired up on an events. I have to admit after reading that it doesn't work so many times and even on MSDN (<a href="http://msdn.microsoft.com/en-us/library/aa979520.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/aa979520.aspx</a>), I didn't try it on my own.</p> <p>The problem attaching the event handler to the content type wasn't the attaching thing, the handler simply didn't get fired when I for example changed a group name or deleted a user from the group. I don't have an idea why the handler doesn't get called I pretty sure I implemented the right methods and attached them to the right events.</p> <p><strong>Any other suggestions how to get informed about changes on SharePoint groups?</strong></p>
[ { "answer_id": 2804746, "author": "Dave Cornall", "author_id": 337495, "author_profile": "https://Stackoverflow.com/users/337495", "pm_score": 2, "selected": false, "text": " wssQuery = new SPAuditQuery(site);\n wssQuery.AddEventRestriction(SPAuditEventType.SecGroup...
2008/11/17
[ "https://Stackoverflow.com/questions/295993", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19601/" ]
295,994
<p>We had a discussion here at work regarding why <em>fread()</em> and <em>fwrite()</em> take a size per member and count and return the number of members read/written rather than just taking a buffer and size. The only use for it we could come up with is if you want to read/write an array of structures which aren't evenly divisible by the platform alignment and hence have been padded but that can't be so common as to warrant this choice in design.</p> <p>From <a href="https://man7.org/linux/man-pages/man3/fread.3.html" rel="noreferrer">fread(3)</a>:</p> <blockquote> <p>The function fread() reads nmemb elements of data, each size bytes long, from the stream pointed to by stream, storing them at the location given by ptr.</p> </blockquote> <blockquote> <p>The function fwrite() writes nmemb elements of data, each size bytes long, to the stream pointed to by stream, obtaining them from the location given by ptr.</p> </blockquote> <blockquote> <p>fread() and fwrite() return the number of items successfully read or written (i.e., not the number of characters). If an error occurs, or the end-of-file is reached, the return value is a short item count (or zero).</p> </blockquote>
[ { "answer_id": 296018, "author": "Peter Miehle", "author_id": 27800, "author_profile": "https://Stackoverflow.com/users/27800", "pm_score": 6, "selected": false, "text": "fread(buf, 1000, 1, stream)" }, { "answer_id": 296305, "author": "Michael Burr", "author_id": 12711, ...
2008/11/17
[ "https://Stackoverflow.com/questions/295994", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22247/" ]
295,996
<p>From a couple of preliminary tests it seems that <a href="http://msdn.microsoft.com/en-us/library/ms633497.aspx" rel="noreferrer"><code>EnumWindows</code></a> always returns windows in reverse instantiation order, i.e. most recently instantiated window first. Is that a valid observation? If so, is it true across all versions of Windows? And is this a reliable assumption, i.e. is that behaviour documented somewhere?</p> <hr> <p>Context: <em>I'm dealing with a situation where I am triggering a third-party application to open several non-modal windows and I need to send some window messages to those windows once they're open, yet I have no sure-fire way of identifying them as neither their window classes nor their captions will differ and I also do not know their expected coordinates. However, if I could rely on the above behaviour of <code>EnumWindows</code> I could simply use the first handle returned by <code>EnumWindows</code> whose class and caption match my expectation. That still leaves some hypothetical loop holes but I think it will be good enough. Alternative suggestions welcome nevertheless.</em></p>
[ { "answer_id": 296014, "author": "P Daddy", "author_id": 36388, "author_profile": "https://Stackoverflow.com/users/36388", "pm_score": 6, "selected": true, "text": "WS_EX_TOPMOST" }, { "answer_id": 296048, "author": "Skizz", "author_id": 1898, "author_profile": "https...
2008/11/17
[ "https://Stackoverflow.com/questions/295996", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9784/" ]
296,001
<p>Since I'm sure many people have different standard, I've made this post a community wiki.</p> <p>My question is, what's a good naming scheme for table aliases? I've been using the first letter of every word from the table name, but it's been getting quite unreadable. Here's a quick example.</p> <pre><code>FROM incidents i FROM cause_attack ca FROM obscure_table ot </code></pre> <p>Thank you.</p>
[ { "answer_id": 296022, "author": "Tomalak", "author_id": 18771, "author_profile": "https://Stackoverflow.com/users/18771", "pm_score": 2, "selected": false, "text": "'RelObjectProperty'" }, { "answer_id": 296028, "author": "Charles Bretana", "author_id": 32632, "autho...
2008/11/17
[ "https://Stackoverflow.com/questions/296001", "https://Stackoverflow.com", "https://Stackoverflow.com/users/25371/" ]
296,003
<p>Does any one know the best way to deploy a resource file to the App_GlobalResource folder of the web application when a feature is activated?</p>
[ { "answer_id": 296488, "author": "Lars Fastrup", "author_id": 27393, "author_profile": "https://Stackoverflow.com/users/27393", "pm_score": 2, "selected": false, "text": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Solution SolutionId=\"{185E973C-3A10-4e2a-9E0F-DC14414551F9}\" \n ...
2008/11/17
[ "https://Stackoverflow.com/questions/296003", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13135/" ]
296,015
<p>Please consider the following example. Note that in the real-word, the binding source will likely be a data object. I'm using a <code>TextBlock</code> for simplicity.</p> <pre><code>&lt;Window x:Class="Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="300" Width="300"&gt; &lt;StackPanel Margin="20"&gt; &lt;Label&gt;Enter a Name:&lt;/Label&gt; &lt;TextBox x:Name="txt_Name" Text="{Binding ElementName=display_name, Path=Text, UpdateSourceTrigger=LostFocus}" /&gt; &lt;Label&gt;The name you entered:&lt;/Label&gt; &lt;TextBlock x:Name="display_name" /&gt; &lt;Button x:Name="btn_Save" Click="SaveClick"&gt;_Save&lt;/Button&gt; &lt;/StackPanel&gt; &lt;/Window&gt; </code></pre> <pre class="lang-vb prettyprint-override"><code>Class Window1 Private Sub SaveClick(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) MessageBox.Show("Saving your name as: " &amp; display_name.Text) End Sub End Class </code></pre> <p>In the example above, if I enter the name <code>"Joe"</code> into the <code>TextBox</code> and click the "Save" button, the <code>TextBlock</code> is updated upon <code>LostFocus</code> and the data is "saved" properly. All is good.</p> <p>However, if I then enter <code>"Bob"</code> in the <code>TextBox</code> and use my access key (Alt-S) to save, the <code>TextBlock</code> is not updated because the <code>LostFocus</code> event on the <code>TextBox</code> is not fired. As a result, my binding source is not updated and the wrong value (i.e., <code>"Joe"</code>) is saved.</p> <p>In most WPF <code>TextBox</code> data entry fields, you'll want to do your validation upon <code>LostFocus</code> (not <code>PropertyChanged</code>); however, if the <code>LostFocus</code> event does not fire (and thus the binding is not updated) when an access key is used, how do we validate the entry? In WinForms we have the <code>Validating</code> and <code>Validated</code> events, but they are absent in WPF.</p>
[ { "answer_id": 296092, "author": "Sam Meldrum", "author_id": 16005, "author_profile": "https://Stackoverflow.com/users/16005", "pm_score": 2, "selected": false, "text": "txt_Name.GetBindingExpression(TextBox.TextProperty).UpdateTarget();\n" } ]
2008/11/17
[ "https://Stackoverflow.com/questions/296015", "https://Stackoverflow.com", "https://Stackoverflow.com/users/132931/" ]
296,020
<p>How can I create a table that has its first row and first column both locked, as in Excel, when you activate 'freeze panes'? I need the table to both scroll horizontally and vertically (a lot of solutions for this exist, but only allow vertical scrolling).</p> <p>So, when you scroll down in the table, the first row will stay put, since it will have the column headings. This may end up being in a <code>thead</code>, or it may not, whatever makes the solution easier.</p> <p>When you scroll right, the first column stays put, since it holds the labels for the rows.</p> <p>I'm pretty certain this is impossible with CSS alone, but can anyone point me toward a JavaScript solution? It needs to work in all major browsers.</p>
[ { "answer_id": 296030, "author": "matt b", "author_id": 4249, "author_profile": "https://Stackoverflow.com/users/4249", "pm_score": 0, "selected": false, "text": "overflow: scroll;" }, { "answer_id": 296063, "author": "VonC", "author_id": 6309, "author_profile": "http...
2008/11/17
[ "https://Stackoverflow.com/questions/296020", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4257/" ]