qid
int64
4
8.14M
question
stringlengths
20
48.3k
answers
list
date
stringlengths
10
10
metadata
list
input
stringlengths
12
45k
output
stringlengths
2
31.8k
300,755
<p>Ok... I'm new to WPF, but I kind of know how to do things using DataTriggers and Converters.</p> <p>But, what I want to seems a little more complex than that. Let me give you the details:</p> <p>The DataContext for the ListView control is an IList of objects (object=Room). These are the available rooms. I've go...
[ { "answer_id": 300797, "author": "Jobi Joy", "author_id": 8091, "author_profile": "https://Stackoverflow.com/users/8091", "pm_score": 2, "selected": true, "text": "<p>You can write a MultiValueConverter which returns Visibility back and takes DataContext as the first Converter Value and ...
2008/11/19
[ "https://Stackoverflow.com/questions/300755", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21807/" ]
Ok... I'm new to WPF, but I kind of know how to do things using DataTriggers and Converters. But, what I want to seems a little more complex than that. Let me give you the details: The DataContext for the ListView control is an IList of objects (object=Room). These are the available rooms. I've got another control (l...
You can write a MultiValueConverter which returns Visibility back and takes DataContext as the first Converter Value and the specific 'Room' object as the second Value(Use ElementName binding with Element as 'Room') If the Values matches then show the Image control ie, imgControl.Visibility bind to the Converter
300,757
<p>I have a Flex application with multiple modules.</p> <p>When I redeploy the application I was finding that modules (which are deployed as separate swf files) were being cached in the browser and the new versions weren't being loaded. </p> <p>So i tried the age old trick of adding <code>?version=xxx</code> to all t...
[ { "answer_id": 301632, "author": "Theo", "author_id": 1109, "author_profile": "https://Stackoverflow.com/users/1109", "pm_score": 0, "selected": false, "text": "<p>The caching is not done by Flash Player but by the browser, so it's out of Adobe's control. I think you have found a workabl...
2008/11/19
[ "https://Stackoverflow.com/questions/300757", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16940/" ]
I have a Flex application with multiple modules. When I redeploy the application I was finding that modules (which are deployed as separate swf files) were being cached in the browser and the new versions weren't being loaded. So i tried the age old trick of adding `?version=xxx` to all the modules when they are loa...
I had a similar problem, and ended up putting the SWF files in a sub-directory named as the build number. This meant that the URL to the SWF files pointed to a different location each time. Ideally this should be catered for by the platform, but no joy there. But this works perfectly for us, and integrates very easily...
300,761
<p>I have a collection of custom entity objects one property of which is an <code>ArrayList</code> of byte arrays.</p> <p>The custom entity is serializable and the collection property is marked with the following attributes: <code>[XmlArray("Images"), XmlArrayItem("Image",typeof(byte[]))]</code></p> <p>So I serialize...
[ { "answer_id": 300778, "author": "Charles Bretana", "author_id": 32632, "author_profile": "https://Stackoverflow.com/users/32632", "pm_score": 2, "selected": false, "text": "<p>Depending on exactly what you are doing, there are a variety of options... Investigate the Xml Attributes in Sy...
2008/11/19
[ "https://Stackoverflow.com/questions/300761", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5019/" ]
I have a collection of custom entity objects one property of which is an `ArrayList` of byte arrays. The custom entity is serializable and the collection property is marked with the following attributes: `[XmlArray("Images"), XmlArrayItem("Image",typeof(byte[]))]` So I serialize a collection of these custom entities ...
Properties of serializable classes, that are to be serialized, must be Read/Write. In my case above, the ArrayList property to read only, It was returning byte arrays based on a separate function where file names were added to it. Once a setter was written for ArrayList property and the logic tweaked a bit throughout...
300,786
<p>We have an application that generates simulated data for one of our services for testing purposes. Each data item has a unique Guid. However, when we ran a test after some minor code changes to the simulator all of the objects generated by it had the same Guid.</p> <p>There was a single data object created, then ...
[ { "answer_id": 300790, "author": "Mitch Wheat", "author_id": 16076, "author_profile": "https://Stackoverflow.com/users/16076", "pm_score": 2, "selected": false, "text": "<p>It's a bug in your code. If you've managed to generate multiple guid's it is the most likely explanation. The clue ...
2008/11/19
[ "https://Stackoverflow.com/questions/300786", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29021/" ]
We have an application that generates simulated data for one of our services for testing purposes. Each data item has a unique Guid. However, when we ran a test after some minor code changes to the simulator all of the objects generated by it had the same Guid. There was a single data object created, then a for loop w...
Does Submit do an async call, or does the ticket object go into another thread at any stage. In the code example you are reusing the same object. What if Submit sends the ticket in a background thread after a short delay (and does not take a copy). When you change the CacheId you are actually updating all the pending ...
300,791
<p>Maybe it's the really late night I had but I can't figure this one out. First the html:</p> <pre><code>&lt;div&gt; &lt;a href="#internal"&gt;Internal Link&lt;/a&gt; &lt;a href="http://external.com"&gt;External Link&lt;/a&gt; &lt;a href="#internal2"&gt;Internal Link2&lt;/a&gt; &lt;/div&gt; </code></pre> <p>in order...
[ { "answer_id": 300807, "author": "jakber", "author_id": 29812, "author_profile": "https://Stackoverflow.com/users/29812", "pm_score": 3, "selected": true, "text": "<p><strong>Selenium</strong> can automate most browser based tasks. <a href=\"http://selenium.seleniumhq.org/\" rel=\"nofoll...
2008/11/19
[ "https://Stackoverflow.com/questions/300791", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Maybe it's the really late night I had but I can't figure this one out. First the html: ``` <div> <a href="#internal">Internal Link</a> <a href="http://external.com">External Link</a> <a href="#internal2">Internal Link2</a> </div> ``` in order to do something on the page instead of going to the link I need to filter...
**Selenium** can automate most browser based tasks. <http://selenium.seleniumhq.org/> **The Grinder** comes with a local proxy that can record traffic and is scriptable with Python. <http://grinder.sourceforge.net/>
300,808
<p>I have been working on a legacy C++ application and am definitely outside of my comfort-zone (a good thing). I was wondering if anyone out there would be so kind as to give me a few pointers (pun intended).</p> <p>I need to cast 2 bytes in an unsigned char array to an unsigned short. The bytes are consecutive. </p>...
[ { "answer_id": 300812, "author": "arul", "author_id": 15409, "author_profile": "https://Stackoverflow.com/users/15409", "pm_score": 1, "selected": false, "text": "<p>static cast has a different syntax, plus you need to work with pointers, what you want to do is:</p>\n\n<pre><code>unsigne...
2008/11/19
[ "https://Stackoverflow.com/questions/300808", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38784/" ]
I have been working on a legacy C++ application and am definitely outside of my comfort-zone (a good thing). I was wondering if anyone out there would be so kind as to give me a few pointers (pun intended). I need to cast 2 bytes in an unsigned char array to an unsigned short. The bytes are consecutive. For an examp...
Well, you are widening the char into a short value. What you want is to interpret two bytes as an short. `static_cast` cannot cast from `unsigned char*` to `unsigned short*`. You have to cast to `void*`, then to `unsigned short*`: ``` unsigned short *p = static_cast<unsigned short*>(static_cast<void*>(&packetBuffer[1]...
300,840
<p>We have some integer arithmetic which for historical reasons has to work the same on PHP as it does in a few statically typed languages. Since we last upgraded PHP the behavior for overflowing integers has changed. Basically we are using following formula:</p> <pre><code>function f($x1, $x2, $x3, $x4) { return...
[ { "answer_id": 300851, "author": "Vincent", "author_id": 1508, "author_profile": "https://Stackoverflow.com/users/1508", "pm_score": 2, "selected": false, "text": "<p>I think it may have to do with the integer in PHP being unsigned 32 bits as in C# they are signed 32 bits by default.</p>...
2008/11/19
[ "https://Stackoverflow.com/questions/300840", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3798/" ]
We have some integer arithmetic which for historical reasons has to work the same on PHP as it does in a few statically typed languages. Since we last upgraded PHP the behavior for overflowing integers has changed. Basically we are using following formula: ``` function f($x1, $x2, $x3, $x4) { return (($x1 + $x2) ^ ...
So I solved the problem, and discovered a lot about PHP (at least in the way it handles Integer overflow). 1) It completely depended on a cross between which platform the machine was running on, which version of PHP, whether or not it had Suhosin Hardened PHP running, and how many bits it was compiled for (32 or 64)....
300,841
<p>How do you globally set the date format in ASP.NET?</p> <p>My local machine and servers have Regional Settings set to "English (New Zealand)".</p> <p>When I format a date with <code>dd/MM/yyyy</code> I expect to see <code>19/11/2008</code> for today for example.</p> <p>Until recently, that is what I did in fact g...
[ { "answer_id": 300853, "author": "Christian C. Salvadó", "author_id": 5445, "author_profile": "https://Stackoverflow.com/users/5445", "pm_score": 8, "selected": true, "text": "<p>You can change the current thread culture in your Global.asax file, and override the date format for example:...
2008/11/19
[ "https://Stackoverflow.com/questions/300841", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19377/" ]
How do you globally set the date format in ASP.NET? My local machine and servers have Regional Settings set to "English (New Zealand)". When I format a date with `dd/MM/yyyy` I expect to see `19/11/2008` for today for example. Until recently, that is what I did in fact get from both my local machine and the servers....
You can change the current thread culture in your Global.asax file, and override the date format for example: ``` using System.Globalization; using System.Threading; //... protected void Application_BeginRequest(Object sender, EventArgs e) { CultureInfo newCulture = (CultureInfo) System.Threading.Thread.Current...
300,871
<p>Given a point (pX, pY) and a circle with a known center (cX,cY) and radius (r), what is the shortest amount of code you can come up with to find the point on the circle closest to (pX, pY) ?</p> <p>I've got some code kind of working but it involves converting the circle to an equation of the form (x - cX)^2 + (y - ...
[ { "answer_id": 300875, "author": "Windows programmer", "author_id": 23705, "author_profile": "https://Stackoverflow.com/users/23705", "pm_score": 1, "selected": false, "text": "<p>Trig functions, multiply by r, and add pX or pY as appropriate.</p>\n" }, { "answer_id": 300880, ...
2008/11/19
[ "https://Stackoverflow.com/questions/300871", "https://Stackoverflow.com", "https://Stackoverflow.com/users/364/" ]
Given a point (pX, pY) and a circle with a known center (cX,cY) and radius (r), what is the shortest amount of code you can come up with to find the point on the circle closest to (pX, pY) ? I've got some code kind of working but it involves converting the circle to an equation of the form (x - cX)^2 + (y - cY)^2 = r^...
where P is the point, C is the center, and R is the radius, in a suitable "mathy" language: ``` V = (P - C); Answer = C + V / |V| * R; ``` where |V| is length of V. OK, OK ``` double vX = pX - cX; double vY = pY - cY; double magV = sqrt(vX*vX + vY*vY); double aX = cX + vX / magV * R; double aY = cY + vY / magV * R...
300,907
<p>I have a language-agnostic question about an algorithm.</p> <p>This comes from a (probably simple) programming challenge I read. The problem is, I'm too stupid to figure it out, and curious enough that it is bugging me.</p> <p>The goal is to sort a list of integers to ascending order by swapping the positions of n...
[ { "answer_id": 300910, "author": "Zach Snow", "author_id": 25381, "author_profile": "https://Stackoverflow.com/users/25381", "pm_score": 0, "selected": false, "text": "<p>As a hint, this reeks of dynamic programming; that might not be precise enough a hint to help, but I'd rather start w...
2008/11/19
[ "https://Stackoverflow.com/questions/300907", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38803/" ]
I have a language-agnostic question about an algorithm. This comes from a (probably simple) programming challenge I read. The problem is, I'm too stupid to figure it out, and curious enough that it is bugging me. The goal is to sort a list of integers to ascending order by swapping the positions of numbers in the lis...
Only read the first two paragraph is you just want a hint. There is a an efficient solution to this (unless I made a mistake of course). First sort the list. Now we can write the original list as a list of products of disjoint cycles. For example 5,3,4,2,1 has two cycles, (5,1) and (3,4,2). The cycle can be thought of...
300,911
<p>For a deleted file what's the command to use to view the content of a old revision</p> <pre><code>E:\Downloads\eeli\eel\eel&gt;svn cat eel-scalable-font.h -r 2 svn: warning: 'eel-scalable-font.h' is not under version control </code></pre>
[ { "answer_id": 300928, "author": "Brian Gianforcaro", "author_id": 3415, "author_profile": "https://Stackoverflow.com/users/3415", "pm_score": 2, "selected": false, "text": "<p>I think what your looking for is: </p>\n\n<pre><code>svn cat eel-scalable-font.h@2\n</code></pre>\n" }, { ...
2008/11/19
[ "https://Stackoverflow.com/questions/300911", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30546/" ]
For a deleted file what's the command to use to view the content of a old revision ``` E:\Downloads\eeli\eel\eel>svn cat eel-scalable-font.h -r 2 svn: warning: 'eel-scalable-font.h' is not under version control ```
You need to use a repository URL (not working copy), and use the @rev syntax. Something like: ``` svn cat https://myhost/svn/eeli/eel/eel/eel-scalable-font.h@2 ```
300,929
<p>EDIT: For the inner queries, there could be more than one match per inner query. It grabs a bunch of tags with the same game_ID. Thats why .First or .Max won't work.</p> <p>Need some help, I have a query in LINQ that looks like this:</p> <pre><code>from yy in Tags_Lookups where yy.Tag_ID == (from xx in Tags_Loo...
[ { "answer_id": 300932, "author": "tvanfosson", "author_id": 12950, "author_profile": "https://Stackoverflow.com/users/12950", "pm_score": 3, "selected": true, "text": "<p>Since your inner query can return multiple matches, you just need to convert the inner query to a list and reverse th...
2008/11/19
[ "https://Stackoverflow.com/questions/300929", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7644/" ]
EDIT: For the inner queries, there could be more than one match per inner query. It grabs a bunch of tags with the same game\_ID. Thats why .First or .Max won't work. Need some help, I have a query in LINQ that looks like this: ``` from yy in Tags_Lookups where yy.Tag_ID == (from xx in Tags_Lookups where xx.Game_ID =...
Since your inner query can return multiple matches, you just need to convert the inner query to a list and reverse the sense of the contains clause, I think. ``` from yy in Tags_Lookups where (from xx in Tags_Lookups where xx.Game_ID == new Guid("4962d645-711c-4db8-a7ce-ae9b36dd730c") select xx.Tag_ID).T...
300,950
<p>I have a label function like :</p> <pre><code>private function formatDate (item:Object, column:DataGridColumn):String { var df:DateFormatter = new DateFormatter(); df.formatString = "MM/DD/YY"; if (column.dataField == "startDate") { return df.format(item.startDate); } return "ERR"; } <...
[ { "answer_id": 301295, "author": "Theo", "author_id": 1109, "author_profile": "https://Stackoverflow.com/users/1109", "pm_score": 5, "selected": true, "text": "<p>You can define another function, let's call it <code>partial</code> that binds some extra arguments to your function:</p>\n\n...
2008/11/19
[ "https://Stackoverflow.com/questions/300950", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16940/" ]
I have a label function like : ``` private function formatDate (item:Object, column:DataGridColumn):String { var df:DateFormatter = new DateFormatter(); df.formatString = "MM/DD/YY"; if (column.dataField == "startDate") { return df.format(item.startDate); } return "ERR"; } ``` Which I u...
You can define another function, let's call it `partial` that binds some extra arguments to your function: ``` function partial( func : Function, ...boundArgs ) : Function { return function( ...dynamicArgs ) : * { return func.apply(null, boundArgs.concat(dynamicArgs)) } } ``` Then you change your function li...
300,957
<p>My question is similar to Engram's <a href="https://stackoverflow.com/questions/223149/how-do-you-handle-the-output-of-a-dynamically-generated-form-in-aspnet-mvc">here</a>, but my question goes a bit further. The way i intend it to work is I have a textbox asking how many entries a user is going to make. After the...
[ { "answer_id": 301005, "author": "Scott", "author_id": 29640, "author_profile": "https://Stackoverflow.com/users/29640", "pm_score": 3, "selected": true, "text": "<p>I'd break this up in stages, you'll need to add a \"Save\" view someplace depending on what you want.</p>\n\n<p>Scott</p>\...
2008/11/19
[ "https://Stackoverflow.com/questions/300957", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30816/" ]
My question is similar to Engram's [here](https://stackoverflow.com/questions/223149/how-do-you-handle-the-output-of-a-dynamically-generated-form-in-aspnet-mvc), but my question goes a bit further. The way i intend it to work is I have a textbox asking how many entries a user is going to make. After they input the numb...
I'd break this up in stages, you'll need to add a "Save" view someplace depending on what you want. Scott ``` <form action="/Demo01/Create" method="post"> Number of Exercises: <%= Html.TextBox("tbxNumberOfExercises") %> <br /> <br /> <input type="submit" value="Set Exercise Number" /> </form> <% if (ViewData["number"...
301,008
<p>We were using stringstream to prepare select queries in C++. But we were strongly advised to use QUERY PARAMETERS to submit db2 sql queries to avoid using of stringstream. Can anyone share what exactly meant by query parameter in C++? Also, share some practical sample code snippets.</p> <p>Appreciate the help in ad...
[ { "answer_id": 301015, "author": "vfilby", "author_id": 24279, "author_profile": "https://Stackoverflow.com/users/24279", "pm_score": 3, "selected": true, "text": "<p>I suspect this refers to parameterized queries in general, rather than constructing the query in a string, they supply sq...
2008/11/19
[ "https://Stackoverflow.com/questions/301008", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18657/" ]
We were using stringstream to prepare select queries in C++. But we were strongly advised to use QUERY PARAMETERS to submit db2 sql queries to avoid using of stringstream. Can anyone share what exactly meant by query parameter in C++? Also, share some practical sample code snippets. Appreciate the help in advance. Ed...
I suspect this refers to parameterized queries in general, rather than constructing the query in a string, they supply sql variables (or parameters) and then pass those variables separately. These are much better for handling SQL Injection Attacks. To illustrate with an example: ``` "SELECT * FROM Customers WHERE Cust...
301,039
<p>I have a bash shell script that loops through all child directories (but not files) of a certain directory. The problem is that some of the directory names contain spaces. </p> <p>Here are the contents of my test directory:</p> <pre><code>$ls -F test Baltimore/ Cherry Hill/ Edison/ New York City/ Philadelphi...
[ { "answer_id": 301059, "author": "Charles Duffy", "author_id": 14122, "author_profile": "https://Stackoverflow.com/users/14122", "pm_score": 8, "selected": true, "text": "<p>First, don't do it that way. The best approach is to use <code>find -exec</code> properly:</p>\n\n<pre><code># thi...
2008/11/19
[ "https://Stackoverflow.com/questions/301039", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1094969/" ]
I have a bash shell script that loops through all child directories (but not files) of a certain directory. The problem is that some of the directory names contain spaces. Here are the contents of my test directory: ``` $ls -F test Baltimore/ Cherry Hill/ Edison/ New York City/ Philadelphia/ cities.txt ``` An...
First, don't do it that way. The best approach is to use `find -exec` properly: ``` # this is safe find test -type d -exec echo '{}' + ``` The other safe approach is to use NUL-terminated list, though this requires that your find support `-print0`: ``` # this is safe while IFS= read -r -d '' n; do printf '%q\n' "...
301,045
<p>For background see my question <a href="https://stackoverflow.com/questions/291761/converting-a-fairly-simple-c-class-library-into-a-com-object">here</a>.</p> <p>So the problem now isn't that I can't send a <code>DataSet</code> to classic ASP but that it can't do anything with it. So I found some code to create a ...
[ { "answer_id": 378770, "author": "Gregg", "author_id": 18266, "author_profile": "https://Stackoverflow.com/users/18266", "pm_score": 0, "selected": false, "text": "<p>First, the line:</p>\n\n<pre><code>theStream = (MemoryStream)theWriter.BaseStream;\n</code></pre>\n\n<p>is redundant as t...
2008/11/19
[ "https://Stackoverflow.com/questions/301045", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29650/" ]
For background see my question [here](https://stackoverflow.com/questions/291761/converting-a-fairly-simple-c-class-library-into-a-com-object). So the problem now isn't that I can't send a `DataSet` to classic ASP but that it can't do anything with it. So I found some code to create a recordset xml structure from a `D...
I think you want to work with Data-based objects and XML based data. If it's true, I suggest using `ADODB` Classes (It is in COM References: Microsoft ActiveX Data Objects 6.0 Library -Or in other versions like 2.8-). You can convert your `DataTable` to a `ADODB.Recordset` by this code: [Simplest code to convert an AD...
301,053
<p>Is it possible to re-assign the <kbd>Win</kbd>+<kbd>L</kbd> hotkey to another executable/shortcut?</p> <p>Use-case - I would like to switch off the monitor of my laptop as soon as it is locked. I know of a executable which can lock and turn off the monitor but I do not want to change the way the system is locked (b...
[ { "answer_id": 301058, "author": "ine", "author_id": 4965, "author_profile": "https://Stackoverflow.com/users/4965", "pm_score": 2, "selected": false, "text": "<p>Looks like you can't.</p>\n\n<blockquote>\n <p>You can disable all built-in Windows\n hotkeys <strong>except Win+L</strong>...
2008/11/19
[ "https://Stackoverflow.com/questions/301053", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26090/" ]
Is it possible to re-assign the `Win`+`L` hotkey to another executable/shortcut? Use-case - I would like to switch off the monitor of my laptop as soon as it is locked. I know of a executable which can lock and turn off the monitor but I do not want to change the way the system is locked (by running the program explic...
You need to set the following registry key to completely disable the Windows locking feature: ``` [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System] "DisableLockWorkstation"=dword:00000001 ``` And restart the computer. This works on Win7, Win8 and Win10
301,054
<p>How can I determine if a Win32 thread has terminated?</p> <p>The documentation for <strong><a href="http://msdn.microsoft.com/en-us/library/ms683190(VS.85).aspx" rel="noreferrer">GetExitCodeThread</a></strong> warns to not to use it for this reason since the error code STILL_ACTIVE can be returned for other reasons...
[ { "answer_id": 301067, "author": "Shog9", "author_id": 811, "author_profile": "https://Stackoverflow.com/users/811", "pm_score": 3, "selected": false, "text": "<p>The documentation you link to warns against using <code>STILL_ACTIVE</code> as a return code, since it can't be distinguished...
2008/11/19
[ "https://Stackoverflow.com/questions/301054", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19129/" ]
How can I determine if a Win32 thread has terminated? The documentation for **[GetExitCodeThread](http://msdn.microsoft.com/en-us/library/ms683190(VS.85).aspx)** warns to not to use it for this reason since the error code STILL\_ACTIVE can be returned for other reasons. Thanks for the help! :)
MSDN mentions that "When a thread terminates, the thread object attains a signaled state, satisfying any threads that were waiting on the object". So, you can check for whether a thread has terminated by checking the state of the thread handle - whether it's signaled or not: ``` DWORD result = WaitForSingleObject( hT...
301,060
<p>say I want to find the latest added rows (UPDATE by any user, not necessarily the one which is executing UPDATE) in XX table.</p>
[ { "answer_id": 301084, "author": "shahkalpesh", "author_id": 23574, "author_profile": "https://Stackoverflow.com/users/23574", "pm_score": 0, "selected": false, "text": "<p>Please refer to SQL Docs &amp; look for OUTPUT clause (that you can use with UPDATE/INSERT to get the affected reco...
2008/11/19
[ "https://Stackoverflow.com/questions/301060", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38819/" ]
say I want to find the latest added rows (UPDATE by any user, not necessarily the one which is executing UPDATE) in XX table.
You would need to use a Transaction Log reader tool. There are several free ones available as well as commercial offerings. * [ApexSQL Log](http://www.apexsql.com/sql_tools_log.asp) You could also try [this](http://www.mssqlcity.com/Articles/KnowHow/ViewLog.htm) undocumented command: ``` DBCC LOG(<database name>[,{...
301,066
<p>I'm trying to measure height of some text for table printing purpose.</p> <p>Here's the code. In my case it prints different numbers in preview and on actual page. I can't try on any printers other than Microsoft Office Document Image Writer right now, but I'm pretty sure it isn't a printer issue.</p> <p>Perhaps s...
[ { "answer_id": 301126, "author": "MusiGenesis", "author_id": 14606, "author_profile": "https://Stackoverflow.com/users/14606", "pm_score": 0, "selected": false, "text": "<p>Try a PageUnit other than Graphics.Pixel in your PrintPage event. Inch, Millimeter or Point (among others) should ...
2008/11/19
[ "https://Stackoverflow.com/questions/301066", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I'm trying to measure height of some text for table printing purpose. Here's the code. In my case it prints different numbers in preview and on actual page. I can't try on any printers other than Microsoft Office Document Image Writer right now, but I'm pretty sure it isn't a printer issue. Perhaps somebody have foun...
I guess that the problem is that System.Drawing.Graphics is based on GDI+ where as the actual printing is based on GDI. You could replace the call to MeasureString to use a GDI based method: ``` SizeF hT = TextRenderer.MeasureText(s, new Font("Arial", 24)); ``` > > The System.Windows.Forms.TextRenderer > class wa...
301,068
<p>I have a string that contains both double-quotes and backslashes that I want to set to a variable in Python. However, whenever I try to set it, the quotes or slashes are either removed or escaped. Here's an example:</p> <pre><code>&gt;&gt;&gt; foo = 'baz "\"' &gt;&gt;&gt; foo 'baz ""' </code></pre> <p>So instead o...
[ { "answer_id": 301075, "author": "Charles Duffy", "author_id": 14122, "author_profile": "https://Stackoverflow.com/users/14122", "pm_score": 8, "selected": true, "text": "<p>You're being mislead by output -- the second approach you're taking actually does what you want, you just aren't b...
2008/11/19
[ "https://Stackoverflow.com/questions/301068", "https://Stackoverflow.com", "https://Stackoverflow.com/users/422/" ]
I have a string that contains both double-quotes and backslashes that I want to set to a variable in Python. However, whenever I try to set it, the quotes or slashes are either removed or escaped. Here's an example: ``` >>> foo = 'baz "\"' >>> foo 'baz ""' ``` So instead of `baz "\"` like I want I'm getting `baz ""`...
You're being mislead by output -- the second approach you're taking actually does what you want, you just aren't believing it. :) ``` >>> foo = 'baz "\\"' >>> foo 'baz "\\"' >>> print(foo) baz "\" ``` Incidentally, there's another string form which might be a bit clearer: ``` >>> print(r'baz "\"') baz "\" ```
301,108
<p>I realize that this could probably be done easier in any number of other scripting languages but started to do it quick in cmd and now Im curious.</p> <p>Looking to start a process at an offset to the time that another process started. Lets say 5 minutes to keep it simple. Is there a way to add to the %TIME% vari...
[ { "answer_id": 301141, "author": "PhiLho", "author_id": 15459, "author_profile": "https://Stackoverflow.com/users/15459", "pm_score": 4, "selected": false, "text": "<p>I just typed <code>set/?</code> and discovered cmd is much better than old bat... :-)</p>\n\n<pre><code>set h=%TIME:~0,2...
2008/11/19
[ "https://Stackoverflow.com/questions/301108", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I realize that this could probably be done easier in any number of other scripting languages but started to do it quick in cmd and now Im curious. Looking to start a process at an offset to the time that another process started. Lets say 5 minutes to keep it simple. Is there a way to add to the %TIME% variable? For i...
I just typed `set/?` and discovered cmd is much better than old bat... :-) ``` set h=%TIME:~0,2% set m=%TIME:~3,2% set/a m2="m+5" set t2=%h%:%m2% set t2 ``` Obviously, you can get 62 minutes, etc., I let you do the extra math... :-D
301,109
<p>How would I implement "close all other tabs" function for a tab control using Context menu strip?</p>
[ { "answer_id": 301257, "author": "Guge", "author_id": 37771, "author_profile": "https://Stackoverflow.com/users/37771", "pm_score": 2, "selected": false, "text": "<p>I made a small app with just one tabcontrol in the main window and a context menu connected to that tabcontrol.</p>\n\n<p>...
2008/11/19
[ "https://Stackoverflow.com/questions/301109", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
How would I implement "close all other tabs" function for a tab control using Context menu strip?
I made a small app with just one tabcontrol in the main window and a context menu connected to that tabcontrol. The following is the handler for the context menu item: ``` private void closeAllOtherToolStripMenuItem_Click(object sender, EventArgs e) { for (int i = 0; i < this.tabControl1.TabCount;...
301,115
<p>I am having issues using the :collection command for a partial within a form I am creating in rails. I would ideally like to use the :collection command, so I can easily manipulate this section in my .rjs templates (the form will submit and reload the form when the check box is changed, it's a to-do list).</p> <p>T...
[ { "answer_id": 303075, "author": "Tim Harding", "author_id": 38021, "author_profile": "https://Stackoverflow.com/users/38021", "pm_score": 2, "selected": false, "text": "<p>I think that the problem is you've not got @list defined anywhere when you're using the render :partial with a :col...
2008/11/19
[ "https://Stackoverflow.com/questions/301115", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I am having issues using the :collection command for a partial within a form I am creating in rails. I would ideally like to use the :collection command, so I can easily manipulate this section in my .rjs templates (the form will submit and reload the form when the check box is changed, it's a to-do list). This code w...
I think that the problem is you've not got @list defined anywhere when you're using the render :partial with a :collection. The system is looking for @list to match the list[] when you call f.check\_box you could set @list = list in your partial to get around that. I suppose.
301,134
<p>I'm writing a Python application that takes a command as an argument, for example:</p> <pre><code>$ python myapp.py command1 </code></pre> <p>I want the application to be extensible, that is, to be able to add new modules that implement new commands without having to change the main application source. The tree look...
[ { "answer_id": 301139, "author": "Greg Hewgill", "author_id": 893, "author_profile": "https://Stackoverflow.com/users/893", "pm_score": 4, "selected": false, "text": "<p>You can use <a href=\"https://docs.python.org/3/library/functions.html#exec\" rel=\"noreferrer\"><code>exec</code></a>...
2008/11/19
[ "https://Stackoverflow.com/questions/301134", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15061/" ]
I'm writing a Python application that takes a command as an argument, for example: ``` $ python myapp.py command1 ``` I want the application to be extensible, that is, to be able to add new modules that implement new commands without having to change the main application source. The tree looks something like: ``` m...
With Python older than 2.7/3.1, that's pretty much how you do it. For newer versions, see `importlib.import_module` for [Python 2](https://docs.python.org/2/library/importlib.html#importlib.import_module) and [Python 3](https://docs.python.org/3/library/importlib.html#importlib.import_module). You can use `exec` if y...
301,143
<p>My program works already, I have Perl (GUI Window) where I can input data, data passed to the webpage (using to Tomcat server, JSP) and then <strong>saved</strong> it to oracle database. What I want is to make search parameter (webapp) that <strong>retrieve/extract</strong> data from the Oracle database using Perl C...
[ { "answer_id": 301180, "author": "toolkit", "author_id": 3295, "author_profile": "https://Stackoverflow.com/users/3295", "pm_score": 2, "selected": false, "text": "<p>Any specific reason for the mix in technologies? Why not use a servlet/JSP?</p>\n\n<p>If you must use Perl, then you need...
2008/11/19
[ "https://Stackoverflow.com/questions/301143", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28607/" ]
My program works already, I have Perl (GUI Window) where I can input data, data passed to the webpage (using to Tomcat server, JSP) and then **saved** it to oracle database. What I want is to make search parameter (webapp) that **retrieve/extract** data from the Oracle database using Perl CGI. Is it possible? Or any su...
Yes you can by using [DBI](http://search.cpan.org/dist/DBI/) and [DBD::Oracle](http://search.cpan.org/dist/DBD-Oracle/) modules. However there are some gotchas with Oracle. I remember a few fun and games with Oracle 8 so these may no longer be applicable but it did require setting ENV variables like ORACLE\_HOME, ORAC...
301,147
<p>I want to show a table of fixed width at the center of browser window. Now I use</p> <pre><code>&lt;table width="200" align="center"&gt; </code></pre> <p>But Visual Studio 2008 gives warning on this line:</p> <p><em>Attribute 'align' is considered outdated. A newer construct is recommended.</em></p> <p>What CSS...
[ { "answer_id": 301152, "author": "Steven A. Lowe", "author_id": 9345, "author_profile": "https://Stackoverflow.com/users/9345", "pm_score": 0, "selected": false, "text": "<pre><code>style=\"text-align:center;\" \n</code></pre>\n\n<p>(i think)</p>\n\n<p>or you could just ignore it, it sti...
2008/11/19
[ "https://Stackoverflow.com/questions/301147", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11256/" ]
I want to show a table of fixed width at the center of browser window. Now I use ``` <table width="200" align="center"> ``` But Visual Studio 2008 gives warning on this line: *Attribute 'align' is considered outdated. A newer construct is recommended.* What CSS style should I apply to the table to obtain the same...
Steven is right, in [theory](http://theodorakis.net/tablecentertest.html): > > the “correct” way to center a table using CSS. Conforming browsers ought to center tables if the left and right margins are equal. The simplest way to accomplish this is to set the left and right margins to “auto.” Thus, one might write in...
301,149
<p>I am working on my website, and I am trying to get the url parameter "page" which is an integer that tells which entry to read in the MySQL database that hols the HTML for all the pages. Here is my code, with the MySQL username and password removed for security reasons:</p> <pre><code> if ($_GET["page"]) { $con ...
[ { "answer_id": 301163, "author": "andy.gurin", "author_id": 22388, "author_profile": "https://Stackoverflow.com/users/22388", "pm_score": 0, "selected": false, "text": "<p>You should read the manual <a href=\"http://de.php.net/mysql_query\" rel=\"nofollow noreferrer\">http://de.php.net/m...
2008/11/19
[ "https://Stackoverflow.com/questions/301149", "https://Stackoverflow.com", "https://Stackoverflow.com/users/60881/" ]
I am working on my website, and I am trying to get the url parameter "page" which is an integer that tells which entry to read in the MySQL database that hols the HTML for all the pages. Here is my code, with the MySQL username and password removed for security reasons: ``` if ($_GET["page"]) { $con = mysql_connec...
Apart from the injection vulnerability (see John's answer) you should get the title from the mysql\_query using ``` $res = mysql_query("SELECT title FROM pageContent WHERE pageID=" . $escapedpage); $title = mysql_fetch_assoc($res); $title = $title['title'] $res2 = mysql_query("SELECT content FROM pageContent WHERE...
301,162
<p>Aside from using the region to infer which carrier the user is under.</p>
[ { "answer_id": 304231, "author": "August", "author_id": 30966, "author_profile": "https://Stackoverflow.com/users/30966", "pm_score": 0, "selected": false, "text": "<p>No, there is no API in the SDK to do this.</p>\n" }, { "answer_id": 509622, "author": "Taptronic", "auth...
2008/11/19
[ "https://Stackoverflow.com/questions/301162", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38836/" ]
Aside from using the region to infer which carrier the user is under.
1st Import `#import <CoreTelephony/CTTelephonyNetworkInfo.h>` make sure you have the Framework installed too. ``` CTTelephonyNetworkInfo *phoneInfo = [[CTTelephonyNetworkInfo alloc] init]; CTCarrier *phoneCarrier = [phoneInfo subscriberCellularProvider]; NSLog(@"Carrier = %@", [phoneCarrier carrierName]); [phoneInfo r...
301,176
<p>I need to use a byte array as a profile property in a website. Normally I would declare the type as system.string or system.int32 but I have no idea what the type if for a byte array.</p> <p>EDIT: I need to use this as profile property that is declared in the web.config like below:</p> <pre><code>&lt;profile defau...
[ { "answer_id": 301188, "author": "Adam Rosenfield", "author_id": 9530, "author_profile": "https://Stackoverflow.com/users/9530", "pm_score": 2, "selected": false, "text": "<p>If the file is opened by another process in exclusive mode, you can't -- Windows won't let you. In that case, th...
2008/11/19
[ "https://Stackoverflow.com/questions/301176", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23230/" ]
I need to use a byte array as a profile property in a website. Normally I would declare the type as system.string or system.int32 but I have no idea what the type if for a byte array. EDIT: I need to use this as profile property that is declared in the web.config like below: ``` <profile defaultProvider="ProfileProvi...
If the file is opened by another process in exclusive mode, you can't -- Windows won't let you. In that case, the best you can do is to either wait for the other process to close the file and then delete it, or have it be deleted at the next reboot by using [`MoveFileEx()`](http://msdn.microsoft.com/en-us/library/aa365...
301,203
<p>Although I'm doubtful, I'm curious as to whether it's possible to extract primitive-type template parameters from an existing type, perhaps using RTTI.</p> <p>For example:</p> <pre><code>typedef std::bitset&lt;16&gt; WordSet; </code></pre> <p>Would it be possible to extract the number 16 in the above code without...
[ { "answer_id": 301228, "author": "Adam Rosenfield", "author_id": 9530, "author_profile": "https://Stackoverflow.com/users/9530", "pm_score": 1, "selected": false, "text": "<p>In the case of <code>std::bitset</code>, you can just use the <code>size()</code> member function:</p>\n\n<pre><c...
2008/11/19
[ "https://Stackoverflow.com/questions/301203", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3594/" ]
Although I'm doubtful, I'm curious as to whether it's possible to extract primitive-type template parameters from an existing type, perhaps using RTTI. For example: ``` typedef std::bitset<16> WordSet; ``` Would it be possible to extract the number 16 in the above code without hard-coding it elsewhere? Compiler spe...
It's not possible in general to pick arbitrary template parameters. However, the usual way you do it is this: ``` template<int N> struct foo { static const int value = N; }; ``` and for types ``` template<typename T> struct foo { typedef T type; }; ``` You can access it then as `foo<39>::value` or `foo<i...
301,215
<p>How do I get the current wallpaper on a Mac? Just point me to an API function so I can Google more.</p> <p>Edit: I think I found it. [NSUserDefaults standardUserDefaults] mentioned at <a href="http://lists.apple.com/archives/student-dev/2004/Aug/msg00140.html" rel="noreferrer">http://lists.apple.com/archives/studen...
[ { "answer_id": 301573, "author": "Mecki", "author_id": 15809, "author_profile": "https://Stackoverflow.com/users/15809", "pm_score": 4, "selected": true, "text": "<h2>Updated Answer (Mavericks and newer)</h2>\n\n<p>Starting with Mavericks, Apple writes the Desktop images to</p>\n\n<pre><...
2008/11/19
[ "https://Stackoverflow.com/questions/301215", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8005/" ]
How do I get the current wallpaper on a Mac? Just point me to an API function so I can Google more. Edit: I think I found it. [NSUserDefaults standardUserDefaults] mentioned at <http://lists.apple.com/archives/student-dev/2004/Aug/msg00140.html> Also possible from shell: defaults read com.apple.desktop Background An...
Updated Answer (Mavericks and newer) ------------------------------------ Starting with Mavericks, Apple writes the Desktop images to ``` /Users/<current-user>/Application Support/Dock/desktoppicture.db ``` which is an SQLite database. You can open this file in Terminal like this ``` sqlite3 "/Application Support...
301,221
<p>I am executing a <code>diff</code> command in <code>perl</code>.</p> <pre><code>my @lines = `/usr/local/bin/diff -udr \"$expected_file\" \"$gen_file\"`; if ($? != 0) { print ERRFILE "Diff between $expected_file and $gen_file failed\n"; return $diff_err; } </code></pre> <p>Here the <code>diff</code> might ...
[ { "answer_id": 301428, "author": "brian d foy", "author_id": 2766176, "author_profile": "https://Stackoverflow.com/users/2766176", "pm_score": 5, "selected": true, "text": "<p>This is answered in <a href=\"http://learn.perl.org/faq/perlfaq8.html#How-can-I-capture-STDERR-from-an-external-...
2008/11/19
[ "https://Stackoverflow.com/questions/301221", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18657/" ]
I am executing a `diff` command in `perl`. ``` my @lines = `/usr/local/bin/diff -udr \"$expected_file\" \"$gen_file\"`; if ($? != 0) { print ERRFILE "Diff between $expected_file and $gen_file failed\n"; return $diff_err; } ``` Here the `diff` might have failed because of some reason. For example: the stderr...
This is answered in [perlfaq8: How can I capture STDERR from an external command?](http://learn.perl.org/faq/perlfaq8.html#How-can-I-capture-STDERR-from-an-external-command) If I want to read STDOUT and STDERR of a process, I use IPC::Open3, which comes with Perl. That way, I don't have to merge those streams and late...
301,233
<p>I am using Xcode to develop a GUI application. I have a model class and a controller class. I have a NSTextView data member in my controller class. How do I access this variable from the model class?</p>
[ { "answer_id": 301565, "author": "Mecki", "author_id": 15809, "author_profile": "https://Stackoverflow.com/users/15809", "pm_score": 4, "selected": false, "text": "<p>First of all, a model class shall not talk to a view class. A TextView is part of the view.</p>\n\n<p><a href=\"http://de...
2008/11/19
[ "https://Stackoverflow.com/questions/301233", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I am using Xcode to develop a GUI application. I have a model class and a controller class. I have a NSTextView data member in my controller class. How do I access this variable from the model class?
First of all, a model class shall not talk to a view class. A TextView is part of the view. [alt text http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaFundamentals/Art/cocoa\_mvc.gif](http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaFundamentals/Art/cocoa_mvc.gif) The controller talks to v...
301,234
<p>I have a question regarding an update function I created...</p> <pre><code>CREATE OR REPLACE FUNCTION rm_category_update(icompany bpchar, iraw_mat_cat_code bpchar, iraw_mat_cat_desc bpchar) RETURNS character AS $BODY$ DECLARE loc_result CHAR(50); BEGIN UPDATE rm_category SET raw_mat_cat_code = ...
[ { "answer_id": 301565, "author": "Mecki", "author_id": 15809, "author_profile": "https://Stackoverflow.com/users/15809", "pm_score": 4, "selected": false, "text": "<p>First of all, a model class shall not talk to a view class. A TextView is part of the view.</p>\n\n<p><a href=\"http://de...
2008/11/19
[ "https://Stackoverflow.com/questions/301234", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I have a question regarding an update function I created... ``` CREATE OR REPLACE FUNCTION rm_category_update(icompany bpchar, iraw_mat_cat_code bpchar, iraw_mat_cat_desc bpchar) RETURNS character AS $BODY$ DECLARE loc_result CHAR(50); BEGIN UPDATE rm_category SET raw_mat_cat_code = iraw_mat_cat_c...
First of all, a model class shall not talk to a view class. A TextView is part of the view. [alt text http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaFundamentals/Art/cocoa\_mvc.gif](http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaFundamentals/Art/cocoa_mvc.gif) The controller talks to v...
301,239
<p>Well I testing my jython program, that does some neat [".xls", ".doc", ".rtf", ".tif", ".tiff", ".pdf" files] -> pdf (intermediary file) -> tif (final output) conversion using Open Office. We moved away from MS Office due to the problems we had with automation. Now it seems we have knocked down many bottles relate...
[ { "answer_id": 301565, "author": "Mecki", "author_id": 15809, "author_profile": "https://Stackoverflow.com/users/15809", "pm_score": 4, "selected": false, "text": "<p>First of all, a model class shall not talk to a view class. A TextView is part of the view.</p>\n\n<p><a href=\"http://de...
2008/11/19
[ "https://Stackoverflow.com/questions/301239", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21537/" ]
Well I testing my jython program, that does some neat [".xls", ".doc", ".rtf", ".tif", ".tiff", ".pdf" files] -> pdf (intermediary file) -> tif (final output) conversion using Open Office. We moved away from MS Office due to the problems we had with automation. Now it seems we have knocked down many bottles related to ...
First of all, a model class shall not talk to a view class. A TextView is part of the view. [alt text http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaFundamentals/Art/cocoa\_mvc.gif](http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaFundamentals/Art/cocoa_mvc.gif) The controller talks to v...
301,247
<p>The <strong><code>fuser</code></strong> command lets me know which processes are using a file or directory.</p> <p>I'm looking for command that does the opposite: lets me know which files are being used by a process.</p> <hr> <h2>Update</h2> <p>Forgot to mention that it's for a Solaris system.</p>
[ { "answer_id": 301255, "author": "Johannes Schaub - litb", "author_id": 34509, "author_profile": "https://Stackoverflow.com/users/34509", "pm_score": 5, "selected": false, "text": "<pre><code>lsof -p &lt;pid&gt;\n</code></pre>\n<p>From <a href=\"http://ph7spot.com/articles/leveraging_lso...
2008/11/19
[ "https://Stackoverflow.com/questions/301247", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15884/" ]
The **`fuser`** command lets me know which processes are using a file or directory. I'm looking for command that does the opposite: lets me know which files are being used by a process. --- Update ------ Forgot to mention that it's for a Solaris system.
While I wouldn't begrudge anyone learning Dtrace or gaining experience installing software, in Solaris there **is** a command to see the files a process has open: /usr/bin/pfiles ``` % tail -f /etc/motd & [1] 6033 % pfiles 6033 6033: tail -f /etc/motd Current rlimit: 256 file descriptors 0: S_IFREG m...
301,283
<p>I am developing a Java desktop application and would like to have an external configuration.xml.<br> I am developing the application using Netbeans and tried to add the configuration.xml file in the dist directory so that it resides in the application work folder. But when Netbeans executes its clean operation it de...
[ { "answer_id": 301405, "author": "Michel", "author_id": 7198, "author_profile": "https://Stackoverflow.com/users/7198", "pm_score": 5, "selected": true, "text": "<p>You can add this to your build.xml : </p>\n\n<pre><code>&lt;target name=\"-post-jar\"&gt;\n &lt;copy todir=\"${dist.jar.d...
2008/11/19
[ "https://Stackoverflow.com/questions/301283", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34145/" ]
I am developing a Java desktop application and would like to have an external configuration.xml. I am developing the application using Netbeans and tried to add the configuration.xml file in the dist directory so that it resides in the application work folder. But when Netbeans executes its clean operation it delete...
You can add this to your build.xml : ``` <target name="-post-jar"> <copy todir="${dist.jar.dir}"> <fileset dir="resources" includes="**"/> </copy> </target> ``` You can now put your configuration.xml file in the folder 'resources' (that you need to create) in your project and all files in it wi...
301,284
<p>I have example of code below. </p> <pre><code>&lt;script type="text/javascript" src="assets/scripts/somescript.php"&gt;. &lt;/script&gt; </code></pre> <p>So, will my browser still cache this just by not setting this scripts headers meta tag cache to must-revalidate?</p>
[ { "answer_id": 301299, "author": "Stefan Gehrig", "author_id": 11354, "author_profile": "https://Stackoverflow.com/users/11354", "pm_score": 0, "selected": false, "text": "<p>If you send a <code>Content-type: text/javascript; charset=\"your_charset\"</code> the browser will recognize you...
2008/11/19
[ "https://Stackoverflow.com/questions/301284", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24744/" ]
I have example of code below. ``` <script type="text/javascript" src="assets/scripts/somescript.php">. </script> ``` So, will my browser still cache this just by not setting this scripts headers meta tag cache to must-revalidate?
Some browsers are more agressive with default caching than others. However, there are cache control headers you can send to indicate when to reload the code. ``` header("Expires: " . date("r", time() + ( 60 * 60 * 24 * 7 * 1 ) ) ); // Expires in 1 week header("Content-Type: application/x-javascript"); ``` Is a code...
301,290
<p>I want to increase the I/O priority of a process. Answers for both .NET and Windows Vista would be nice. processexplorer is ok as well.</p>
[ { "answer_id": 301333, "author": "1800 INFORMATION", "author_id": 3146, "author_profile": "https://Stackoverflow.com/users/3146", "pm_score": 6, "selected": true, "text": "<p>The relevant information seems to be a bit scattered compared to the usual MS documentation. There is this white ...
2008/11/19
[ "https://Stackoverflow.com/questions/301290", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35012/" ]
I want to increase the I/O priority of a process. Answers for both .NET and Windows Vista would be nice. processexplorer is ok as well.
The relevant information seems to be a bit scattered compared to the usual MS documentation. There is this white paper that discusses [I/O Prioritization in windows](http://www.google.co.nz/url?sa=t&source=web&ct=res&cd=2&url=http%3A%2F%2Fdownload.microsoft.com%2Fdownload%2Fa%2Ff%2F7%2Faf7777e5-7dcd-4800-8a0a-b18336565...
301,302
<p>I'm using RSACryptoServiceProvider in .NET 2 and it seems that the Private part of a Public/Private key pair always contains the Public part as well.</p> <p>I need to encrypt some info using my Public key, and allow the other party to ONLY DECRYPT what I encrypted. I don't want them to be able to know how I encrypt...
[ { "answer_id": 301313, "author": "Stefan Schultze", "author_id": 6358, "author_profile": "https://Stackoverflow.com/users/6358", "pm_score": 4, "selected": false, "text": "<p>The private key always includes the public key.</p>\n\n<p>What you might really want is Signing. Using the same ....
2008/11/19
[ "https://Stackoverflow.com/questions/301302", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I'm using RSACryptoServiceProvider in .NET 2 and it seems that the Private part of a Public/Private key pair always contains the Public part as well. I need to encrypt some info using my Public key, and allow the other party to ONLY DECRYPT what I encrypted. I don't want them to be able to know how I encrypted my mess...
The private key always includes the public key. What you might really want is Signing. Using the same .NET classes, you can sign data with your private key and verify the signature on the other party's side with the public key (which obviously doesn't contain the private key). ``` public static string Sign(string...
301,312
<p>Is there a way to execute a query(containing built in DB function) using PreparedStatement?</p> <p>Example: insert into foo (location) values (pointfromtext('12.56666 13.67777',4130)) Here pointfromtext is a built in function.</p>
[ { "answer_id": 301315, "author": "Thilo", "author_id": 14955, "author_profile": "https://Stackoverflow.com/users/14955", "pm_score": 2, "selected": false, "text": "<p>Sure, that should work. </p>\n\n<p>If not, what is your database system, and can you run the exact same command from the ...
2008/11/19
[ "https://Stackoverflow.com/questions/301312", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38857/" ]
Is there a way to execute a query(containing built in DB function) using PreparedStatement? Example: insert into foo (location) values (pointfromtext('12.56666 13.67777',4130)) Here pointfromtext is a built in function.
By what I've seen, the first parameter on pointfromtext function is a string, and the second a number. So, try the following: ``` PreparedStatement preparedStatement = getConnection().prepareStatement("insert into map_address (location) values(pointfromtext('POINT(' || ? || ' ' || ? || ')',4130))"); preparedStatement....
301,314
<p>As a huge XSL fan, I am very happy to use xsl as the view in our proprietary MVC framework on ASP.NET. Objects in the model are serialized under the hood using .NET's xml serializer, and we use quite atomic xsl templates to declare how each object or property should transform.</p> <p>For example:</p> <pre><code> ...
[ { "answer_id": 307802, "author": "Dimitre Novatchev", "author_id": 36305, "author_profile": "https://Stackoverflow.com/users/36305", "pm_score": 2, "selected": true, "text": "<p><strong>You can used the serialized (xml) form of your objects and edit it with the XML Editor of VS</strong> ...
2008/11/19
[ "https://Stackoverflow.com/questions/301314", "https://Stackoverflow.com", "https://Stackoverflow.com/users/216896/" ]
As a huge XSL fan, I am very happy to use xsl as the view in our proprietary MVC framework on ASP.NET. Objects in the model are serialized under the hood using .NET's xml serializer, and we use quite atomic xsl templates to declare how each object or property should transform. For example: ``` <xsl:template match="...
**You can used the serialized (xml) form of your objects and edit it with the XML Editor of VS** (I use VS2008). Then associate an xsd schema to this xml document. Use the schema that xsd,exe generated itself and that it uses in the serialization/deserialization. **You will see that you get intellisense for free**! ...
301,330
<p>If I have a template function, for example like this:</p> <pre><code>template&lt;typename T&gt; void func(const std::vector&lt;T&gt;&amp; v) </code></pre> <p>Is there any way I can determine within the function whether T is a pointer, or would I have to use another template function for this, ie:</p> <pre><code>t...
[ { "answer_id": 301338, "author": "Johannes Schaub - litb", "author_id": 34509, "author_profile": "https://Stackoverflow.com/users/34509", "pm_score": 7, "selected": false, "text": "<p>Indeed, templates can do that, with partial template specialization:</p>\n\n<pre><code>template&lt;typen...
2008/11/19
[ "https://Stackoverflow.com/questions/301330", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
If I have a template function, for example like this: ``` template<typename T> void func(const std::vector<T>& v) ``` Is there any way I can determine within the function whether T is a pointer, or would I have to use another template function for this, ie: ``` template<typename T> void func(const std::vector<T*>& ...
Indeed, templates can do that, with partial template specialization: ``` template<typename T> struct is_pointer { static const bool value = false; }; template<typename T> struct is_pointer<T*> { static const bool value = true; }; template<typename T> void func(const std::vector<T>& v) { std::cout << "is it a poi...
301,339
<p>I wonder if <a href="http://msdn.microsoft.com/en-us/library/system.net.mail.mailmessage.aspx" rel="nofollow noreferrer">MailMessage</a> class is protected from <a href="http://en.wikipedia.org/wiki/E-mail_injection" rel="nofollow noreferrer">e-mail injection</a>. For example, should I check values before passing th...
[ { "answer_id": 301347, "author": "Stefan Schultze", "author_id": 6358, "author_profile": "https://Stackoverflow.com/users/6358", "pm_score": 0, "selected": false, "text": "<p>There seems to be only a simple check in the MailAddress class which checks if the address contains an @.</p>\n" ...
2008/11/19
[ "https://Stackoverflow.com/questions/301339", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11256/" ]
I wonder if [MailMessage](http://msdn.microsoft.com/en-us/library/system.net.mail.mailmessage.aspx) class is protected from [e-mail injection](http://en.wikipedia.org/wiki/E-mail_injection). For example, should I check values before passing them to its constructor: ``` MailMessage message = new MailMessage(fromTextBox...
The `MailAddress` class checks its addresses against the full BNF grammar from RFC822. (See `MailBnfHelper`). There is no risk of injection when using `MailMessage`s. (Except HTML injection in your own content)
301,345
<p>I use the Autocomplete extender feature to get the list of suggestions from my database. There is no scroll bar for this control, so I have added a scroll bar in a panel (MS .net 2.0) which i attach to my autocomplete extender.Now the issue is with the srcoll bar. like this </p> <pre><code>&lt;asp:Panel ID="autocom...
[ { "answer_id": 314150, "author": "Richard Ev", "author_id": 39709, "author_profile": "https://Stackoverflow.com/users/39709", "pm_score": 1, "selected": false, "text": "<p>This does not directly answer your question - but I would ask if you're sure that the autocomplete extender is the b...
2008/11/19
[ "https://Stackoverflow.com/questions/301345", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I use the Autocomplete extender feature to get the list of suggestions from my database. There is no scroll bar for this control, so I have added a scroll bar in a panel (MS .net 2.0) which i attach to my autocomplete extender.Now the issue is with the srcoll bar. like this ``` <asp:Panel ID="autocompleteDropDownPane...
This does not directly answer your question - but I would ask if you're sure that the autocomplete extender is the best control to be using in this scenario. From a usability perspective the great thing about autocomplete is that I can type a 3-4 characters, see a few available inputs and easily select them using the ...
301,354
<p>I am probably doing something wrong -- but cant figure why. I have a DateTime field in my DB keeping a UTC time </p> <p>My server is in the US, and the browser is in Europe. </p> <p>The PageLoad Code is as follow:</p> <pre><code>DateTime t = DateTime.SpecifyKind((DateTime)rdr["startTime"], DateTimeKind.Utc); labe...
[ { "answer_id": 301380, "author": "J c", "author_id": 25837, "author_profile": "https://Stackoverflow.com/users/25837", "pm_score": 3, "selected": false, "text": "<p>One technique is to detect the client timezone offset (in minutes) using JavaScript on the client browser:</p>\n\n<pre><cod...
2008/11/19
[ "https://Stackoverflow.com/questions/301354", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37955/" ]
I am probably doing something wrong -- but cant figure why. I have a DateTime field in my DB keeping a UTC time My server is in the US, and the browser is in Europe. The PageLoad Code is as follow: ``` DateTime t = DateTime.SpecifyKind((DateTime)rdr["startTime"], DateTimeKind.Utc); label1.Text = t.ToLocalTime().To...
One technique is to detect the client timezone offset (in minutes) using JavaScript on the client browser: ``` alert((new Date()).getTimezoneOffset()); ``` This can then be sent back to the server and stored in the session, or a cookie, and used to offset the UTC dates displayed to them. Alternatively, another techn...
301,357
<p>I know that I am supposed to use <code>delete []</code> after I use <code>new []</code>, so using <code>auto_ptr</code> with <code>new []</code> is not such a bright idea.</p> <p>However, while debugging <code>delete []</code> (using Visual Studio 2005), I noticed that the call went into a function that looked like...
[ { "answer_id": 301367, "author": "1800 INFORMATION", "author_id": 3146, "author_profile": "https://Stackoverflow.com/users/3146", "pm_score": 2, "selected": false, "text": "<p>Just because they might work the same now, doesn't mean you can necessarily treat them the same - the behaviour ...
2008/11/19
[ "https://Stackoverflow.com/questions/301357", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1398/" ]
I know that I am supposed to use `delete []` after I use `new []`, so using `auto_ptr` with `new []` is not such a bright idea. However, while debugging `delete []` (using Visual Studio 2005), I noticed that the call went into a function that looked like this: ``` void operator delete[]( void * p ) { RTCCALLBACK(...
Consider this code: ``` class DeleteMe { public: ~DeleteMe() { std::cout << "Thanks mate, I'm gone!\n"; } }; int main() { DeleteMe *arr = new DeleteMe[5]; delete arr; return 0; } ``` If you run that in VS2005 it will print: ``` Thanks mate, I'm gone! ``` If you change `main()` to correctly adhere ...
301,365
<p>My team is responsible for the development of an API for a large system that we also write. We need to provide example code so that other developers using our API can learn how to use it. We have been documenting the code using the xml document comments. eg.</p> <pre><code>/// &lt;summary&gt;Summary here&lt;/summar...
[ { "answer_id": 301415, "author": "Robert Gould", "author_id": 15124, "author_profile": "https://Stackoverflow.com/users/15124", "pm_score": 0, "selected": false, "text": "<p><strong>Simple solution:</strong>\nMake a small application in which you include all the sample code headers and t...
2008/11/19
[ "https://Stackoverflow.com/questions/301365", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33125/" ]
My team is responsible for the development of an API for a large system that we also write. We need to provide example code so that other developers using our API can learn how to use it. We have been documenting the code using the xml document comments. eg. ``` /// <summary>Summary here</summary> /// <example>Here is...
Yes, sandcastle supports this and it's great to maintain the correctness of examples. You can point to a code region like this: ``` /// <summary> /// Gizmo which can act as client or server. /// </summary> /// <example> /// The following example shows how to use the gizmo as a client: /// <code lang=...
301,366
<p>I am using Oracle form 10 I want to know how can I access the parameters of URL in oracle form </p> <p>Ex: whenever I run the form it opens in a browser and the URL for the same is</p> <p><a href="http://112.10.0.10:7778/forms/frmservlet?config=pkamble" rel="nofollow noreferrer">http://112.10.0.10:7778/forms/frmse...
[ { "answer_id": 340000, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 3, "selected": false, "text": "<p>I don't know if you can read config parameter, but to read another parameter from URL your URL have to be like:</p>\n\n<pre...
2008/11/19
[ "https://Stackoverflow.com/questions/301366", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I am using Oracle form 10 I want to know how can I access the parameters of URL in oracle form Ex: whenever I run the form it opens in a browser and the URL for the same is <http://112.10.0.10:7778/forms/frmservlet?config=pkamble> I just want to know how can I access the value of 'config' parameter inside oracle fo...
I don't know if you can read config parameter, but to read another parameter from URL your URL have to be like: ``` http://112.10.0.10:7778/forms/frmservlet?config=pkamble&otherparams=name=value ``` In your .fmb you will have to add 'name' parameter in the parameters block and then you could do something like: ``` ...
301,369
<p>How do I declare a session variable in PL/SQL - one that will persist for the duration of the session only, without me having to store it in the database itself?</p>
[ { "answer_id": 301418, "author": "WW.", "author_id": 14663, "author_profile": "https://Stackoverflow.com/users/14663", "pm_score": 4, "selected": false, "text": "<p>You create a package level variable. This is a minimal example:</p>\n\n<pre><code>CREATE OR REPLACE PACKAGE my_package\nAS...
2008/11/19
[ "https://Stackoverflow.com/questions/301369", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38871/" ]
How do I declare a session variable in PL/SQL - one that will persist for the duration of the session only, without me having to store it in the database itself?
You create a package level variable. This is a minimal example: ``` CREATE OR REPLACE PACKAGE my_package AS FUNCTION get_a RETURN NUMBER; END my_package; / CREATE OR REPLACE PACKAGE BODY my_package AS a NUMBER(20); FUNCTION get_a RETURN NUMBER IS BEGIN RETURN a; END get_a; END my_p...
301,372
<p>Suppose I have a .NET assembly, A, which uses reflection to load assemblies B and C (also .NET). These two assemblies both implement a number of large interfaces (the same for both). When a method is called in A it tries to make B do the work. However, B is unreliable and might throw exceptions. Now A has two modes,...
[ { "answer_id": 301389, "author": "1800 INFORMATION", "author_id": 3146, "author_profile": "https://Stackoverflow.com/users/3146", "pm_score": 2, "selected": false, "text": "<p>You might do this, it saves some repetition:</p>\n\n<pre><code>public class BErrorWrapper : I1, I2, I3{\n ...\...
2008/11/19
[ "https://Stackoverflow.com/questions/301372", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4055/" ]
Suppose I have a .NET assembly, A, which uses reflection to load assemblies B and C (also .NET). These two assemblies both implement a number of large interfaces (the same for both). When a method is called in A it tries to make B do the work. However, B is unreliable and might throw exceptions. Now A has two modes, on...
You might do this, it saves some repetition: ``` public class BErrorWrapper : I1, I2, I3{ ... public int DoSomeWork(int num){ try { return B.DoSomeWork(num); } catch(MyLibException e) { if (FailWithExceptions) throw; return C.DoSomeWOrk(num); } } ...
301,374
<p>In a PHP application I am writing, I would like to have users enter in text a mix of HTML and text with pointed-brackets, but when I display this text, I want to let the HTML tags be rendered by the non-HTML tags be shown literary, e.g. a user should be able to enter:</p> <pre><code>&lt;b&gt; 5 &gt; 3 = true&lt;/b&...
[ { "answer_id": 301387, "author": "philistyne", "author_id": 16597, "author_profile": "https://Stackoverflow.com/users/16597", "pm_score": 3, "selected": true, "text": "<p>I'd recommend having the users enter BBcode style markup which you then replace with the html tags:</p>\n\n<pre><code...
2008/11/19
[ "https://Stackoverflow.com/questions/301374", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4639/" ]
In a PHP application I am writing, I would like to have users enter in text a mix of HTML and text with pointed-brackets, but when I display this text, I want to let the HTML tags be rendered by the non-HTML tags be shown literary, e.g. a user should be able to enter: ``` <b> 5 > 3 = true</b> ``` when displayed, the...
I'd recommend having the users enter BBcode style markup which you then replace with the html tags: ``` [b]This is bold[/b] [i]this is italic with a > 'greater than' sign there[/i] ``` This gives you more control over how you parse user's input into html, though I admit it looks like an unnecessary burden.
301,376
<p>I have the following markup for buttons (can be changed, but I really don't want to):</p> <pre><code>&lt;a href="#" class="button"&gt; Button text &lt;img src="someimage.png" /&gt; &lt;/a&gt; </code></pre> <p>This is styled using CSS to become a rather neat button with an icon on it. I am using jQuery to round...
[ { "answer_id": 301397, "author": "redsquare", "author_id": 6440, "author_profile": "https://Stackoverflow.com/users/6440", "pm_score": 5, "selected": true, "text": "<p>You can use the following to select anchors with / without a child image</p>\n\n<pre><code>$('a.button:has(img)')\n\n$('...
2008/11/19
[ "https://Stackoverflow.com/questions/301376", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1606/" ]
I have the following markup for buttons (can be changed, but I really don't want to): ``` <a href="#" class="button"> Button text <img src="someimage.png" /> </a> ``` This is styled using CSS to become a rather neat button with an icon on it. I am using jQuery to round the leftmost side of the buttons: ``` $('a...
You can use the following to select anchors with / without a child image ``` $('a.button:has(img)') $('a.button:not(:has(img))') ```
301,392
<p>How do you traverse a folder structure using C# without falling into the trap of <a href="http://en.wikipedia.org/wiki/NTFS_junction_point" rel="nofollow noreferrer">junction points</a>? </p>
[ { "answer_id": 301398, "author": "Pieter Breed", "author_id": 24172, "author_profile": "https://Stackoverflow.com/users/24172", "pm_score": 4, "selected": true, "text": "<p>For those that don't know: A junction point behaves similarly to a symbolic link for a folder on linux. The trap th...
2008/11/19
[ "https://Stackoverflow.com/questions/301392", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24172/" ]
How do you traverse a folder structure using C# without falling into the trap of [junction points](http://en.wikipedia.org/wiki/NTFS_junction_point)?
For those that don't know: A junction point behaves similarly to a symbolic link for a folder on linux. The trap that is mentioned happens when you set up a recursive folder structure, like this: ``` given folder /a/b let /a/b/c point to /a then /a/b/c/b/c/b becomes valid folder locations. ``` I suggest a strategy l...
301,400
<p>I am working with Rails fixtures for testing my rails application. It is all good except one of my database columns is supposed to hold YAML content. But, I am sure how to put the YAML markup I want to load into my database inside the YAML file. Here is an example:</p> <pre><code>mvnforum: name: mvnforum ...
[ { "answer_id": 301476, "author": "JesperE", "author_id": 13051, "author_profile": "https://Stackoverflow.com/users/13051", "pm_score": 4, "selected": true, "text": "<p>If you want to put YAML code inside a YAML document, you need to treat it like a string:</p>\n\n<pre><code>url: \"src: t...
2008/11/19
[ "https://Stackoverflow.com/questions/301400", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5004/" ]
I am working with Rails fixtures for testing my rails application. It is all good except one of my database columns is supposed to hold YAML content. But, I am sure how to put the YAML markup I want to load into my database inside the YAML file. Here is an example: ``` mvnforum: name: mvnforum abstraction_type...
If you want to put YAML code inside a YAML document, you need to treat it like a string: ``` url: "src: test username: admin" ``` If you need a multiline string, you can do ``` mvnforum: name: mvnforum abstraction_type: SVN url: " src: test\n username: admin\n " sourcepath: mvnforum/src/ webroot: ...
301,425
<p>I have a method to return a group of objects as a generic list which I then bind to a Repeater. I want to implement paging on the repeater using the PagedDataSource class but I'm not sure that this is possible as it doesn't seem to work.</p> <p>Will I have to change the return type of my method or is it possible to...
[ { "answer_id": 301440, "author": "Kieron", "author_id": 5791, "author_profile": "https://Stackoverflow.com/users/5791", "pm_score": 3, "selected": true, "text": "<p>I've just modified some of my code to use a generic list and seems to have worked fine, hope this helps:</p>\n\n<p>Note tha...
2008/11/19
[ "https://Stackoverflow.com/questions/301425", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2913/" ]
I have a method to return a group of objects as a generic list which I then bind to a Repeater. I want to implement paging on the repeater using the PagedDataSource class but I'm not sure that this is possible as it doesn't seem to work. Will I have to change the return type of my method or is it possible to bind the ...
I've just modified some of my code to use a generic list and seems to have worked fine, hope this helps: Note that this entire method can be called with or without a page number to automatically set the page, it also builds a paging control inside of a panel calling PagingPanel. The line that sets the DataSource on t...
301,429
<p>I have a table in Access 2003 VBA with 164 columns but the data I get has 181 column and it is possible that it will get bigger in the future. I need to know how to resize my table an to add extra colums during the runtime I know how to check how many colums I need so I just need to know how to resize my own table....
[ { "answer_id": 301830, "author": "bugmagnet", "author_id": 426, "author_profile": "https://Stackoverflow.com/users/426", "pm_score": 1, "selected": false, "text": "<p>Might be something <a href=\"http://www.functionx.com/vbaccess/Lesson09b.htm\" rel=\"nofollow noreferrer\">here</a>. I'd ...
2008/11/19
[ "https://Stackoverflow.com/questions/301429", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I have a table in Access 2003 VBA with 164 columns but the data I get has 181 column and it is possible that it will get bigger in the future. I need to know how to resize my table an to add extra colums during the runtime I know how to check how many colums I need so I just need to know how to resize my own table. t...
Another option; rather than have a "*short-fat*" table with lots of columns, have a "*tall-skinny*" table with lots of rows: **Short-fat:** ``` ID FirstName LastName ... Amount 1 Joe Smith ... $123 2 Bob Roberts ... $214 3 Jim Black ... $500 ``` **Tall-skinny:** ``` RecordID Fiel...
301,430
<p>I'm trying to use some extension methods that I use to apply consistent formatting to DateTime and Int32 - which works absolutely fine in code behind, but I'm having issues with databinding.</p> <p>I get:</p> <pre><code>'System.DateTime' does not contain a definition for 'ToCustomShortDate' </code></pre> <p>for</...
[ { "answer_id": 301477, "author": "Rohan West", "author_id": 38686, "author_profile": "https://Stackoverflow.com/users/38686", "pm_score": 0, "selected": false, "text": "<p>You should remove the assembly name from the import namespace...</p>\n\n<p>I guess your extension method is located ...
2008/11/19
[ "https://Stackoverflow.com/questions/301430", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5777/" ]
I'm trying to use some extension methods that I use to apply consistent formatting to DateTime and Int32 - which works absolutely fine in code behind, but I'm having issues with databinding. I get: ``` 'System.DateTime' does not contain a definition for 'ToCustomShortDate' ``` for ``` <%# ((ProductionDetails)Conta...
Found the issue! I was including the namespace correcly as I thought - but the real issue was that the app was only INCLUDING the .NET 3.5 assemblies and not being compiled using the 3.5 compiler, was missing some entries from web.config which I realised when I created an empty project and tried it (successfully) in th...
301,435
<p>I have a form I am submitting via AJAX (using prototype and the built-in rails 'form_remote_tag' helper).<br> What I would like is to update one div (a status area) if there are form validation errors but a different div (the div where the form lives) if the submit goes through sucessfully.</p> <p>My code looks som...
[ { "answer_id": 301477, "author": "Rohan West", "author_id": 38686, "author_profile": "https://Stackoverflow.com/users/38686", "pm_score": 0, "selected": false, "text": "<p>You should remove the assembly name from the import namespace...</p>\n\n<p>I guess your extension method is located ...
2008/11/19
[ "https://Stackoverflow.com/questions/301435", "https://Stackoverflow.com", "https://Stackoverflow.com/users/151/" ]
I have a form I am submitting via AJAX (using prototype and the built-in rails 'form\_remote\_tag' helper). What I would like is to update one div (a status area) if there are form validation errors but a different div (the div where the form lives) if the submit goes through sucessfully. My code looks something li...
Found the issue! I was including the namespace correcly as I thought - but the real issue was that the app was only INCLUDING the .NET 3.5 assemblies and not being compiled using the 3.5 compiler, was missing some entries from web.config which I realised when I created an empty project and tried it (successfully) in th...
301,438
<p>...or am I stuck rolling my own "XML chopping" functions. I'd like to create a small tasktray app so I can quickly re-point a Virual Directory to one of several of folders on my harddisk.</p> <p><strong>Bit of background:</strong> </p> <p>I have 3 different svn branches of our code base on my dev machine.</p> <pr...
[ { "answer_id": 301451, "author": "Magnus Westin", "author_id": 2957, "author_profile": "https://Stackoverflow.com/users/2957", "pm_score": 1, "selected": false, "text": "<p>I haven't used this my self, so I'm not 100% sure it will solve your problem. But take a look at System.DirectorySe...
2008/11/19
[ "https://Stackoverflow.com/questions/301438", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30155/" ]
...or am I stuck rolling my own "XML chopping" functions. I'd like to create a small tasktray app so I can quickly re-point a Virual Directory to one of several of folders on my harddisk. **Bit of background:** I have 3 different svn branches of our code base on my dev machine. ``` Current Production Branch ( C:...
Ok...this isn't a tray app but you can run it from the command line. Just change the physical paths as necessary: ``` using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.DirectoryServices; namespace Swapper { class Program { static void Main(string[] args) { ...
301,442
<p>I want to create a compiled JavaScript file for my website. For development I would prefer to keep the JavaScript in separate files and just as part of my automated scripts concatenate the files into one and run the compressor over it.</p> <p>My problem is that if I use the old DOS copy command it also puts in th...
[ { "answer_id": 301488, "author": "eugensk", "author_id": 17495, "author_profile": "https://Stackoverflow.com/users/17495", "pm_score": 4, "selected": false, "text": "<p>To copy without EOF use binary mode:</p>\n\n<pre><code>copy /B *.js compiled.js /Y\n</code></pre>\n\n<p>If the resultin...
2008/11/19
[ "https://Stackoverflow.com/questions/301442", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24459/" ]
I want to create a compiled JavaScript file for my website. For development I would prefer to keep the JavaScript in separate files and just as part of my automated scripts concatenate the files into one and run the compressor over it. My problem is that if I use the old DOS copy command it also puts in the EOF marker...
I recommend using Apache Ant and YUI Compressor. <http://ant.apache.org/> <http://yui.github.com/yuicompressor/> Put something like this in the Ant build xml. It will create two files, application.js and application-min.js. ``` <target name="concatenate" description="Concatenate all js files"> <concat destfile=...
301,466
<p>This has always bugged me. When I ssh or telnet to a Unix server (whatever flavour) it always manages to guess correctly the terminal type I am logging in from and so the keyboard always acts 'normally' ... i.e. the backspace key works. </p> <p>But then when I have successfully logged in, it often guesses incorrect...
[ { "answer_id": 301505, "author": "rwired", "author_id": 17492, "author_profile": "https://Stackoverflow.com/users/17492", "pm_score": 2, "selected": false, "text": "<p>I think you mean backspace properly works when you are inputting your username and password, then it stops working after...
2008/11/19
[ "https://Stackoverflow.com/questions/301466", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21544/" ]
This has always bugged me. When I ssh or telnet to a Unix server (whatever flavour) it always manages to guess correctly the terminal type I am logging in from and so the keyboard always acts 'normally' ... i.e. the backspace key works. But then when I have successfully logged in, it often guesses incorrectly the ter...
I think you mean backspace properly works when you are inputting your username and password, then it stops working after you've logged in. Most likely stty is being set to something else in ~/.profile or /etc/profile (or another script that executes on login). Find that file and comment the line.
301,471
<p>I'm trying to load javascript code with a user web control into a page via a the Page.LoadControl method during an asyncron post back of an update panel.</p> <p>I've tried the specially for that scenario designed methods of the scriptmanager, but the javascript just doens't get returned to the user.</p> <p>To expl...
[ { "answer_id": 301972, "author": "rams", "author_id": 3635, "author_profile": "https://Stackoverflow.com/users/3635", "pm_score": 2, "selected": false, "text": "<p>Have your tried </p>\n\n<pre><code>Page.ClientScript.RegisterStartUpScript(GetType(Page), \"key\", &lt;your script here&gt;,...
2008/11/19
[ "https://Stackoverflow.com/questions/301471", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36475/" ]
I'm trying to load javascript code with a user web control into a page via a the Page.LoadControl method during an asyncron post back of an update panel. I've tried the specially for that scenario designed methods of the scriptmanager, but the javascript just doens't get returned to the user. To explain my scenario a...
For that you can do ``` string scr; scr = "<script src='/scripts/myscript.js'></script>" Page.ClientScript.RegisterStartupScript(GetType(Page), "key", scr, false) ``` HTH
301,473
<p>I have several input and option elements on my page, each (well almost) have an event attached to update some text on the page once they change. I use jQuery which is really really cool :) </p> <p>I also use Microsofts <a href="http://en.wikipedia.org/wiki/Ajax_%28programming%29" rel="noreferrer">Ajax</a> framework...
[ { "answer_id": 301489, "author": "Phil Jenkins", "author_id": 35496, "author_profile": "https://Stackoverflow.com/users/35496", "pm_score": 7, "selected": true, "text": "<p>Since you're using ASP.NET AJAX, you'll have access to a <code>pageLoad</code> event handler, that gets called each...
2008/11/19
[ "https://Stackoverflow.com/questions/301473", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11619/" ]
I have several input and option elements on my page, each (well almost) have an event attached to update some text on the page once they change. I use jQuery which is really really cool :) I also use Microsofts [Ajax](http://en.wikipedia.org/wiki/Ajax_%28programming%29) framework, utilizing the UpdatePanel. The reaso...
Since you're using ASP.NET AJAX, you'll have access to a `pageLoad` event handler, that gets called each time the page posts back, be it full or partial from an UpdatePanel. You just need to put the function in to your page, no hooking up is required. ``` function pageLoad(sender, args) { if (args.get_isPartialLoad...
301,479
<p>Here is new C# future in version 4.0 known as dynamic. Show me the way i can use it in my code and how this future can help me?</p> <hr> <p>Related questions:</p> <ul> <li><a href="https://stackoverflow.com/questions/298277/does-the-new-dynamic-c-40-keyword-deprecate-the-var-keyword">Does the new ‘dynamic’ C# 4.0...
[ { "answer_id": 301498, "author": "Cristian Libardo", "author_id": 16526, "author_profile": "https://Stackoverflow.com/users/16526", "pm_score": 2, "selected": false, "text": "<p>One of the usages is interop between static and dynamic languages.</p>\n\n<p>Say you want to invoke a JavaScri...
2008/11/19
[ "https://Stackoverflow.com/questions/301479", "https://Stackoverflow.com", "https://Stackoverflow.com/users/208062/" ]
Here is new C# future in version 4.0 known as dynamic. Show me the way i can use it in my code and how this future can help me? --- Related questions: * [Does the new ‘dynamic’ C# 4.0 keyword deprecate the ‘var’ keyword ?](https://stackoverflow.com/questions/298277/does-the-new-dynamic-c-40-keyword-deprecate-the-var...
One of the usages is interop between static and dynamic languages. Say you want to invoke a JavaScript function fron silverlight: ``` HtmlPage.Window.Invoke("HelloWorldFunction"); ``` If the window was dynamic (and properly implemented) you would be able to use it like this: ``` HtmlPage.Window.HelloWorldFunction(...
301,484
<p>I am trying to create a dialog box that will appear only if the browser selected is IE (any version) however I get this error:</p> <blockquote> <p>Message: HTML Parsing Error: Unable to modify the parent container element before the child element is closed (KB927917)</p> </blockquote> <p>That's all in "Line/Char...
[ { "answer_id": 301511, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 2, "selected": false, "text": "<p>The best way to address IE only are <em>conditional comments</em>. You don't even need to use JavaScript. See for example <...
2008/11/19
[ "https://Stackoverflow.com/questions/301484", "https://Stackoverflow.com", "https://Stackoverflow.com/users/28586/" ]
I am trying to create a dialog box that will appear only if the browser selected is IE (any version) however I get this error: > > Message: HTML Parsing Error: Unable to modify the parent container element before the child element is closed (KB927917) > > > That's all in "Line/Char/Code" 0 so I do not know where ...
You're modifying document while it's being loaded (when browser hasn't "seen" closing tag for this element) . This causes very tricky situation in the parser and in IE it's not allowed. [IE blog](http://blogs.msdn.com/ie/archive/2008/04/23/what-happened-to-operation-aborted.aspx) has explanation of this. The solution...
301,490
<p>I have a class like so:</p> <pre><code>public class ClassA { public bool MethodA() { //do something complicated to test requiring a lot of setup } public bool MethodB() { if (MethodA()) //do something else //do something else endif }...
[ { "answer_id": 301511, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 2, "selected": false, "text": "<p>The best way to address IE only are <em>conditional comments</em>. You don't even need to use JavaScript. See for example <...
2008/11/19
[ "https://Stackoverflow.com/questions/301490", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I have a class like so: ``` public class ClassA { public bool MethodA() { //do something complicated to test requiring a lot of setup } public bool MethodB() { if (MethodA()) //do something else //do something else endif } } ``` I hav...
You're modifying document while it's being loaded (when browser hasn't "seen" closing tag for this element) . This causes very tricky situation in the parser and in IE it's not allowed. [IE blog](http://blogs.msdn.com/ie/archive/2008/04/23/what-happened-to-operation-aborted.aspx) has explanation of this. The solution...
301,493
<p>We have developers with knowledge of these languages - Ruby , Python, .Net or Java. We are developing an application which will mainly handle XML documents. Most of the work is to convert predefined XML files into database tables, providing mapping between XML documents through database, creating reports from databa...
[ { "answer_id": 301533, "author": "Chris Fulstow", "author_id": 38126, "author_profile": "https://Stackoverflow.com/users/38126", "pm_score": 3, "selected": false, "text": "<p>In .NET, C# 3.0 and VB9 provide excellent support for working with XML using LINQ to XML:</p>\n\n<p><a href=\"htt...
2008/11/19
[ "https://Stackoverflow.com/questions/301493", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6613/" ]
We have developers with knowledge of these languages - Ruby , Python, .Net or Java. We are developing an application which will mainly handle XML documents. Most of the work is to convert predefined XML files into database tables, providing mapping between XML documents through database, creating reports from database ...
A dynamic language rules for this. Why? The mappings are easy to code and change. You don't have to recompile and rebuild. Indeed, with a little cleverness, you can have your "XML XPATH to a Tag -> DB table-field" mappings as disjoint blocks of Python code that your main application imports. The block of Python code ...
301,502
<p>I just installed an application on a win2003 server and I'm getting this error:</p> <pre><code>Line 149: &lt;roleManager&gt; Line 150: &lt;providers&gt; Line 151: &lt;add name="AspNetSqlRoleProvider" connectionStringName="LocalSqlServer" applicationName="/" type="System.Web.Security.SqlRoleProvider, ...
[ { "answer_id": 301533, "author": "Chris Fulstow", "author_id": 38126, "author_profile": "https://Stackoverflow.com/users/38126", "pm_score": 3, "selected": false, "text": "<p>In .NET, C# 3.0 and VB9 provide excellent support for working with XML using LINQ to XML:</p>\n\n<p><a href=\"htt...
2008/11/19
[ "https://Stackoverflow.com/questions/301502", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7277/" ]
I just installed an application on a win2003 server and I'm getting this error: ``` Line 149: <roleManager> Line 150: <providers> Line 151: <add name="AspNetSqlRoleProvider" connectionStringName="LocalSqlServer" applicationName="/" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, ...
A dynamic language rules for this. Why? The mappings are easy to code and change. You don't have to recompile and rebuild. Indeed, with a little cleverness, you can have your "XML XPATH to a Tag -> DB table-field" mappings as disjoint blocks of Python code that your main application imports. The block of Python code ...
301,504
<p>A follow up to an earlier question, showing the part that fails when I try to get the error message from my target library:</p> <pre><code>require 'gt4r' @@test_environment = "INCLUDE=C:\\graphtalk\\env\\aiadev\\config\\aiadev.ini" @@normal_user = "BMCHARGUE" describe Gt4r do it 'initializes' do rv = Gt4r...
[ { "answer_id": 301774, "author": "a2800276", "author_id": 27408, "author_profile": "https://Stackoverflow.com/users/27408", "pm_score": 2, "selected": false, "text": "<p>Which bit fails? I'm guessing it's this:</p>\n\n<pre><code>Gt4r.gTD_get_error_message rv, @msg\n</code></pre>\n\n<p>Ho...
2008/11/19
[ "https://Stackoverflow.com/questions/301504", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32322/" ]
A follow up to an earlier question, showing the part that fails when I try to get the error message from my target library: ``` require 'gt4r' @@test_environment = "INCLUDE=C:\\graphtalk\\env\\aiadev\\config\\aiadev.ini" @@normal_user = "BMCHARGUE" describe Gt4r do it 'initializes' do rv = Gt4r.gTD_initializ...
Which bit fails? I'm guessing it's this: ``` Gt4r.gTD_get_error_message rv, @msg ``` How is the method implemented? What's the C signature of the method? (\*char)? Btw: at the risk of sounding like broken record, it's MUCH easier to write a C extension than trying to shoehorn things into DL. AFAIK, no one uses DL, ...
301,528
<p>I've got this date time string:</p> <pre><code>post["date"] = "2007-07-18 10:03:19" </code></pre> <p>I'd like to extract just "2007-07-18" as a date. I've seen some reference to <code>strptime</code> but I'm not sure how to use it. How can I extract the date from this string?</p>
[ { "answer_id": 301537, "author": "gimel", "author_id": 6491, "author_profile": "https://Stackoverflow.com/users/6491", "pm_score": 3, "selected": false, "text": "<p>In your case, just use split:</p>\n\n<pre><code>&gt;&gt;&gt; d1=\"2007-07-18 10:03:19\"\n&gt;&gt;&gt; d1.split()[0]\n'2007-...
2008/11/19
[ "https://Stackoverflow.com/questions/301528", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16974/" ]
I've got this date time string: ``` post["date"] = "2007-07-18 10:03:19" ``` I'd like to extract just "2007-07-18" as a date. I've seen some reference to `strptime` but I'm not sure how to use it. How can I extract the date from this string?
The other two answers are fine, but if you actually want the date for something else, you can use the `datetime` module: ``` from datetime import datetime d = datetime.strptime('2007-07-18 10:03:19', '%Y-%m-%d %H:%M:%S') day_string = d.strftime('%Y-%m-%d') ``` It might be overkill for now, but it'll come in useful. ...
301,536
<p><strong>PHP has a <a href="http://php.net/var_dump" rel="noreferrer">var_dump()</a> function which outputs the internal contents of an object, showing an object's type and content.</strong></p> <p>For example:</p> <pre><code>class Person { private $firstName; private $lastName; public function __construct($...
[ { "answer_id": 301575, "author": "serg10", "author_id": 1853, "author_profile": "https://Stackoverflow.com/users/1853", "pm_score": 7, "selected": true, "text": "<p><strong>It is not quite as baked-in in Java, so you don't get this for free.</strong> It is done with convention rather th...
2008/11/19
[ "https://Stackoverflow.com/questions/301536", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5343/" ]
**PHP has a [var\_dump()](http://php.net/var_dump) function which outputs the internal contents of an object, showing an object's type and content.** For example: ``` class Person { private $firstName; private $lastName; public function __construct($firstName, $lastName) { $this->firstName = $firstName; ...
**It is not quite as baked-in in Java, so you don't get this for free.** It is done with convention rather than language constructs. In all data transfer classes (and maybe even *in all classes you write...*), you should implement a sensible [`toString`](http://java.sun.com/javase/6/docs/api/java/lang/Object.html#toStr...
301,544
<p>I have this SQL query:</p> <pre><code>SELECT * FROM IMAGES WHERE IMAGENAME in ('IMG1', 'IMG2', 'IMG3', 'IMG4', 'IMG5', 'IMG6') ORDER BY CASE IMAGENAME WHEN 'IMG1' THEN 1 WHEN 'IMG2' THEN 2 WHEN 'IMG3' THEN 3 WHEN 'IMG4' THEN 4 WHEN 'IMG5' THEN 5 WHEN 'IMG6' THEN 6 ELSE 7 END </code></pre> <p>I cannot...
[ { "answer_id": 301596, "author": "Andrew", "author_id": 5662, "author_profile": "https://Stackoverflow.com/users/5662", "pm_score": 0, "selected": false, "text": "<p>Could you strip the <code>IMG</code> (or non-numeric) part of the <code>IMAGENAME</code> to a new column when writing to t...
2008/11/19
[ "https://Stackoverflow.com/questions/301544", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38883/" ]
I have this SQL query: ``` SELECT * FROM IMAGES WHERE IMAGENAME in ('IMG1', 'IMG2', 'IMG3', 'IMG4', 'IMG5', 'IMG6') ORDER BY CASE IMAGENAME WHEN 'IMG1' THEN 1 WHEN 'IMG2' THEN 2 WHEN 'IMG3' THEN 3 WHEN 'IMG4' THEN 4 WHEN 'IMG5' THEN 5 WHEN 'IMG6' THEN 6 ELSE 7 END ``` I cannot guarantee that the list o...
I'm not sure if this is available in your target databases, but it might hopefully work at least as inspiration for a better approach. In MySQL, you would do what you want with the FIELD() function like this: ``` SELECT * FROM IMAGES WHERE IMAGENAME IN ('IMG1', 'IMG2', 'IMG3', 'IMG4', 'IMG5', 'IMG6') ORDER BY FIEL...
301,546
<p>There's a web services I want to call in my application, I can use it with importing the WSDL or by just use "HTTP GET" with the URL and parameters, so I prefer the later because it's simple thing.</p> <p>I know I can use indy idhttp.get, to do the job, but this is very simple thing and I don't want to add complex ...
[ { "answer_id": 301598, "author": "Bruce McGee", "author_id": 19183, "author_profile": "https://Stackoverflow.com/users/19183", "pm_score": 5, "selected": false, "text": "<p>Calling a RESTful web service using Indy is pretty straight forward.</p>\n\n<p>Add IdHTTP to your uses clause. Rem...
2008/11/19
[ "https://Stackoverflow.com/questions/301546", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24462/" ]
There's a web services I want to call in my application, I can use it with importing the WSDL or by just use "HTTP GET" with the URL and parameters, so I prefer the later because it's simple thing. I know I can use indy idhttp.get, to do the job, but this is very simple thing and I don't want to add complex indy code ...
You could use the [WinINet API](http://msdn.microsoft.com/en-us/library/aa383630(VS.85).aspx) like this: ``` uses WinInet; function GetUrlContent(const Url: string): string; var NetHandle: HINTERNET; UrlHandle: HINTERNET; Buffer: array[0..1024] of Char; BytesRead: dWord; begin Result := ''; NetHandle := I...
301,551
<p>If I'm using ConcurrentHashMap (where the put is thread safe) , and I supply a public function myPut that uses the ConcurrentHashMap put - do I need to synchronize my function? </p> <p>meaning : should this be synchronized?</p> <pre><code>ConcurrentHashMap map; public void myPut(int something) { this.map.pu...
[ { "answer_id": 301558, "author": "Burkhard", "author_id": 12860, "author_profile": "https://Stackoverflow.com/users/12860", "pm_score": 0, "selected": false, "text": "<p>No.<br>\nYou can cal myPut multiple times at once.<br>\nThe put will be called one at a time, because the HashTable's ...
2008/11/19
[ "https://Stackoverflow.com/questions/301551", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4038/" ]
If I'm using ConcurrentHashMap (where the put is thread safe) , and I supply a public function myPut that uses the ConcurrentHashMap put - do I need to synchronize my function? meaning : should this be synchronized? ``` ConcurrentHashMap map; public void myPut(int something) { this.map.put(something); } ``...
Concurrency utilities such as ConcurrentHashMap are designed so that you don't need to synchronize: they'll handle thread-safe access internally. What Tom says is true, that you need to think about the potential of the map reference to change. If the reference actually *doesn't* change, then in practice you'll get awa...
301,563
<p>Whats this syntax useful for : </p> <pre><code> function(String... args) </code></pre> <p>Is this same as writing </p> <pre><code> function(String[] args) </code></pre> <p>with difference only while invoking this method or is there any other feature involved with it ?</p>
[ { "answer_id": 301583, "author": "JesperE", "author_id": 13051, "author_profile": "https://Stackoverflow.com/users/13051", "pm_score": 3, "selected": false, "text": "<p>On the receiver size you will get an array of String. The difference is only on the calling side.</p>\n" }, { "...
2008/11/19
[ "https://Stackoverflow.com/questions/301563", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11614/" ]
Whats this syntax useful for : ``` function(String... args) ``` Is this same as writing ``` function(String[] args) ``` with difference only while invoking this method or is there any other feature involved with it ?
The only difference between the two is the way you call the function. With String var args you can omit the array creation. ``` public static void main(String[] args) { callMe1(new String[] {"a", "b", "c"}); callMe2("a", "b", "c"); // You can also do this // callMe2(new String[] {"a", "b", "c"}); } pub...
301,577
<p>I wrote a simple add-in for Visual Studio 2008 that opens a dockable window pane. </p> <p><a href="http://www.codeplex.com/ora" rel="noreferrer">You can download the source and a binary installer by clicking here.</a></p> <p>The nature of the add-in means that it is ideally going to stay docked next to where you e...
[ { "answer_id": 313046, "author": "JB Brown", "author_id": 21360, "author_profile": "https://Stackoverflow.com/users/21360", "pm_score": 4, "selected": true, "text": "<p>I faced the some of the same docking issues with TeamReview (<a href=\"http://www.codeplex.com/TeamReview\" rel=\"noref...
2008/11/19
[ "https://Stackoverflow.com/questions/301577", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27423/" ]
I wrote a simple add-in for Visual Studio 2008 that opens a dockable window pane. [You can download the source and a binary installer by clicking here.](http://www.codeplex.com/ora) The nature of the add-in means that it is ideally going to stay docked next to where you edit your source. But sometimes, on some insta...
I faced the some of the same docking issues with TeamReview (<http://www.codeplex.com/TeamReview>). I can't say why it happens but I can help point you to code that always docs your window in OnStartupComplete. If you have a particular location you want it to be in you can Link it to be inside a frame after creating yo...
301,590
<p>I have a few longtables that stretch several pages and I want to use pageref and hyperref to link to these rows.</p> <p>But whatever I try, the links always refer to the start of the table. When I look into the aux file, the labels all seem to be re-defined into table.[number of table].</p> <p>I tried putting invi...
[ { "answer_id": 302290, "author": "ConcernedOfTunbridgeWells", "author_id": 15401, "author_profile": "https://Stackoverflow.com/users/15401", "pm_score": 1, "selected": false, "text": "<p>According to <a href=\"http://newsgroups.derkeiler.com/Archive/Comp/comp.text.tex/2008-05/msg01417.ht...
2008/11/19
[ "https://Stackoverflow.com/questions/301590", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38893/" ]
I have a few longtables that stretch several pages and I want to use pageref and hyperref to link to these rows. But whatever I try, the links always refer to the start of the table. When I look into the aux file, the labels all seem to be re-defined into table.[number of table]. I tried putting invisible dummy figur...
I solved this problem by introducing a custom counter and label command: ``` \newcounter{mycounter} \newcommand{\mylabel}[1]{\refstepcounter{mycounter} \label{#1}} ```
301,622
<p>I found this in the code I'm working on at the moment and thought it was the cause of some problems I'm having.</p> <p>In a header somewhere:</p> <pre><code>enum SpecificIndexes{ //snip INVALID_INDEX = -1 }; </code></pre> <p>Then later - initialization:</p> <pre><code>nextIndex = INVALID_INDEX; </code></...
[ { "answer_id": 301638, "author": "Gorpik", "author_id": 25824, "author_profile": "https://Stackoverflow.com/users/25824", "pm_score": 1, "selected": false, "text": "<p>In fact, -1 is implicitly cast to its equivalente unsigned value when it is assigned to nextValue. The equivalente unsi...
2008/11/19
[ "https://Stackoverflow.com/questions/301622", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15667/" ]
I found this in the code I'm working on at the moment and thought it was the cause of some problems I'm having. In a header somewhere: ``` enum SpecificIndexes{ //snip INVALID_INDEX = -1 }; ``` Then later - initialization: ``` nextIndex = INVALID_INDEX; ``` and use ``` if(nextIndex != INVALID_INDEX) { ...
Yes to everything. It is valid code, it is also commonly used library-side C++ code, more so in modern C++ (it is strange when you see it the first time but its a very common pattern in reality). Then enums are signed ints, but they get implicitly cast into unsigned ints, now this depending on your compiler might give...
301,624
<p>I'm trying to load spring beans using XmlWebApplicationContext setConfigLocations method. However, I keep getting a </p> <pre><code>BeanIsAbstractException </code></pre> <p>I know that the bean is abstract, I have it configured this way, so Spring should know not to try to instantiate it.</p> <p>I'm using Spring...
[ { "answer_id": 301645, "author": "toolkit", "author_id": 3295, "author_profile": "https://Stackoverflow.com/users/3295", "pm_score": 2, "selected": false, "text": "<p>The following code will try, and fail to create an instance of your abstract class:</p>\n\n<pre><code>map.put(beansName[m...
2008/11/19
[ "https://Stackoverflow.com/questions/301624", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24481/" ]
I'm trying to load spring beans using XmlWebApplicationContext setConfigLocations method. However, I keep getting a ``` BeanIsAbstractException ``` I know that the bean is abstract, I have it configured this way, so Spring should know not to try to instantiate it. I'm using Spring2.0.8.jar with jetspeed2.1. Sprin...
``` map.put(beansName[mnCnt], factory.getBean(beansName[mnCnt])); ``` There's your problem, isn't it? By calling getBean with the name of the abstract bean, you try to instantiate it, which will generate an exception.
301,637
<p>I need to perform a HTTP GET from PHP. </p> <p>More specifically, from within /index.php I need to get the content of /trac/ and /svn/, find the "ul" element and then render then inline on the index.php.</p> <p>/trac and /svn are relative URLs and not filesystem folders. <a href="http://myserver/trac" rel="nofollo...
[ { "answer_id": 301660, "author": "Ken", "author_id": 20074, "author_profile": "https://Stackoverflow.com/users/20074", "pm_score": 1, "selected": false, "text": "<p>Have a look at <a href=\"http://it.php.net/function.file-get-contents\" rel=\"nofollow noreferrer\">file_get_contents</a> -...
2008/11/19
[ "https://Stackoverflow.com/questions/301637", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29075/" ]
I need to perform a HTTP GET from PHP. More specifically, from within /index.php I need to get the content of /trac/ and /svn/, find the "ul" element and then render then inline on the index.php. /trac and /svn are relative URLs and not filesystem folders. <http://myserver/trac> and <http://myserver/svn>
The simplest way is [`file_get_contents()`](http://www.php.net/file_get_contents). ``` $str = file_get_contents('http://myserver/svn/'); // Or, if you don't want to hardcode the server $str = file_get_contents('http://' . $_SERVER['HTTP_HOST'] . '/svn/'); if ($str) { // Find the ul } ```
301,658
<p>How do you set a break points in server tags in .aspx pages. e.g.</p> <pre><code>&lt;% dim breakhere =new object() %&gt; </code></pre> <p>The web application is running in debug mode with the <code>&lt;compilation debug="true" ...</code> in the web.config. But the page says:</p> <blockquote> <p>The break poin...
[ { "answer_id": 301950, "author": "rams", "author_id": 3635, "author_profile": "https://Stackoverflow.com/users/3635", "pm_score": -1, "selected": false, "text": "<p>I havent tried this myself but in ASP (VBScript) you can inject a STOP statement and that will trigger the IDE to break on ...
2008/11/19
[ "https://Stackoverflow.com/questions/301658", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29547/" ]
How do you set a break points in server tags in .aspx pages. e.g. ``` <% dim breakhere =new object() %> ``` The web application is running in debug mode with the `<compilation debug="true" ...` in the web.config. But the page says: > > The break point will not currently be > hit. No symbols have been loaded for...
instead of setting the breakpoint directly, you could use ``` <% System.Diagnostics.Debugger.Break(); // more code here... %> ``` Maybe a better suggestion though is to not put inline code in your markup - instead put it in a method in the code-behind file, and then call that method from your markup. In ...
301,667
<p>I would like to replace "&amp;gt" with ">" and "&amp;lt" with "&lt;" but only when they occur outside "&lt;pre>" and "&lt;/pre>". Is this possible?</p> <pre><code>$newText = preg_replace('&amp;gt', '&gt;', $text); </code></pre> <p>I would be using the preg_replace in PHP as above.</p>
[ { "answer_id": 301753, "author": "annakata", "author_id": 13018, "author_profile": "https://Stackoverflow.com/users/13018", "pm_score": 0, "selected": false, "text": "<p>I'm not sure offhand if PHP's regex engine does negative lookarounds, but that's what you're interested in. The regex ...
2008/11/19
[ "https://Stackoverflow.com/questions/301667", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4639/" ]
I would like to replace "&gt" with ">" and "&lt" with "<" but only when they occur outside "<pre>" and "</pre>". Is this possible? ``` $newText = preg_replace('&gt', '>', $text); ``` I would be using the preg\_replace in PHP as above.
If you want to do this with a regex, the trick is to make your regex match the things you don't want to replace as well as the things you want to replace, and dynamically calculate the replacement depending on what was matched. ``` $new_text = preg_replace_callback('%&lt;|&gt;|<pre>.*?</pre>%si', compute_replacement, ...
301,679
<p>I'm trying to print a RDLC file directly without showing Microsoft Report Viewer, I have followed the <a href="http://msdn.microsoft.com/en-us/library/ms252172.aspx" rel="noreferrer">MSDN's example</a> but now, every time I call the "Render" method of my instance of LocalReport class it throws the "One or more param...
[ { "answer_id": 4163270, "author": "Gerrie Pretorius", "author_id": 505558, "author_profile": "https://Stackoverflow.com/users/505558", "pm_score": 4, "selected": false, "text": "<p>i just discovered if you pass parameter value as empty string like parameter = \"\"\nit will give you that...
2008/11/19
[ "https://Stackoverflow.com/questions/301679", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34623/" ]
I'm trying to print a RDLC file directly without showing Microsoft Report Viewer, I have followed the [MSDN's example](http://msdn.microsoft.com/en-us/library/ms252172.aspx) but now, every time I call the "Render" method of my instance of LocalReport class it throws the "One or more parameters required to run the repor...
i just discovered if you pass parameter value as empty string like parameter = "" it will give you that error took me a while
301,681
<p>Edit: This behaviour is reproducible with <a href="https://stackoverflow.com/questions/301766/mutability-and-reference-of-php5-get-variables">query globals</a> on.</p> <p>I have the following:</p> <pre><code> $_SESSION['query_key'] = $_GET['query_key']; print($query_key); </code></pre> <p>Vs.</p> <pre><code> ...
[ { "answer_id": 301718, "author": "Greg", "author_id": 24181, "author_profile": "https://Stackoverflow.com/users/24181", "pm_score": 2, "selected": false, "text": "<p>You must be doing something very weird with your code.\n<a href=\"http://www.php.net/clone\" rel=\"nofollow noreferrer\">c...
2008/11/19
[ "https://Stackoverflow.com/questions/301681", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6691/" ]
Edit: This behaviour is reproducible with [query globals](https://stackoverflow.com/questions/301766/mutability-and-reference-of-php5-get-variables) on. I have the following: ``` $_SESSION['query_key'] = $_GET['query_key']; print($query_key); ``` Vs. ``` $_SESSION['query_key'] = clone $_GET['query_key']; p...
You must be doing something very weird with your code. [clone](http://www.php.net/clone) is for use on objects. Unless you're stuffing objects into $\_GET then that code will result in a fatal error (or a warning in older PHP versions). @Michael Haren - clone actually does a shallow copy of an object, that is, it copi...
301,683
<p>In the grails-framework some objects are using log. This is normally injected by grails. It works on execution of <code>grails test-app</code>. But the same test (an integration-test) fails on execution of <code>grails test-app -integration</code>.</p> <p>What goes wrong here and can I force the injection of the lo...
[ { "answer_id": 303441, "author": "Ted Naleid", "author_id": 8912, "author_profile": "https://Stackoverflow.com/users/8912", "pm_score": 2, "selected": false, "text": "<p>What version of grails are you using? It's working fine for both situations for me on 1.0.4 (the latest).</p>\n\n<p>I...
2008/11/19
[ "https://Stackoverflow.com/questions/301683", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21005/" ]
In the grails-framework some objects are using log. This is normally injected by grails. It works on execution of `grails test-app`. But the same test (an integration-test) fails on execution of `grails test-app -integration`. What goes wrong here and can I force the injection of the log-object somehow?
What version of grails are you using? It's working fine for both situations for me on 1.0.4 (the latest). I create a new blank app and created a service class with an integration test: FooService.groovy: ``` class FooService { def logSomething(message) { log.error(message) return true } } `...
301,695
<p>This is an SQL problem I can't wrap my head around in a simple query Is it possible?</p> <p>The data set is (letters added for ease of understanding):</p> <pre><code>Start End 10:01 10:12 (A) 10:03 10:06 (B) 10:05 10:25 (C) 10:14 10:42 (D) 10:32 10:36 (E) </code></...
[ { "answer_id": 301740, "author": "Unsliced", "author_id": 2902, "author_profile": "https://Stackoverflow.com/users/2902", "pm_score": 0, "selected": false, "text": "<p>The New and ActiveAtEnd are fairly straightforward (assuming the the period's start and end being stored in temporary va...
2008/11/19
[ "https://Stackoverflow.com/questions/301695", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38896/" ]
This is an SQL problem I can't wrap my head around in a simple query Is it possible? The data set is (letters added for ease of understanding): ``` Start End 10:01 10:12 (A) 10:03 10:06 (B) 10:05 10:25 (C) 10:14 10:42 (D) 10:32 10:36 (E) ``` The desired output is: ...
Assuming you also have (or Create) a table named @Times with one record for each ten minute start time, How about... ``` Select T.Start, (Select Count(*) From testTab Where Start Between T.Start And DateAdd(minute, 10, T.Start)) New, (Select Count(*) From testTab Where Start ...
301,696
<p>I have a web app that is heavily loaded in javascript and css. First time users log in it takes some time to load once it is downloading js etc. Then the caching will make everything faster.</p> <p>I want my users to be aware of this loading time. How can I add some code to "show" some loading information while js ...
[ { "answer_id": 301726, "author": "Dave Markle", "author_id": 24995, "author_profile": "https://Stackoverflow.com/users/24995", "pm_score": 0, "selected": false, "text": "<p>Sweet mother of mercy, Ricardo, how much Javascript and CSS are involved with this application?</p>\n\n<p>You could...
2008/11/19
[ "https://Stackoverflow.com/questions/301696", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19224/" ]
I have a web app that is heavily loaded in javascript and css. First time users log in it takes some time to load once it is downloading js etc. Then the caching will make everything faster. I want my users to be aware of this loading time. How can I add some code to "show" some loading information while js and css ar...
You could show an overlay saying "loading..." and hide this the moment the downloads are complete. ``` <html> <head> ... a bunch of CSS and JS files ... <script type="text/javascript" src="clear-load.js"></script> </head> <body> <div style="position: absolute; left: 50...
301,711
<p>I would like to do the equivalent of the following:</p> <pre><code>#define print_max(TYPE) \ # ifdef TYPE##_MAX \ printf("%lld\n", TYPE##_MAX); \ # endif print_max(INT); </code></pre> <p>Now the <code>#ifdef</code> or any nested preprocessor directive is not allowed as far as I can see in a function macro....
[ { "answer_id": 301819, "author": "Ferruccio", "author_id": 4086, "author_profile": "https://Stackoverflow.com/users/4086", "pm_score": 0, "selected": false, "text": "<p>I don't think it's a case of the ## operator not being allowed in an #ifdef. I tried this:</p>\n\n<pre><code>#define _p...
2008/11/19
[ "https://Stackoverflow.com/questions/301711", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4421/" ]
I would like to do the equivalent of the following: ``` #define print_max(TYPE) \ # ifdef TYPE##_MAX \ printf("%lld\n", TYPE##_MAX); \ # endif print_max(INT); ``` Now the `#ifdef` or any nested preprocessor directive is not allowed as far as I can see in a function macro. Any ideas? Update: So it seems like...
The [Boost Preprocessor](http://www.boost.org/doc/libs/1_37_0/libs/preprocessor/doc/index.html) (which works for C as well as C++, even though Boost as a whole is a C++ library) library can help with this kind of task. Instead of using an #ifdef within a macro (which isn't permitted), it helps you include a file multip...
301,714
<p>I am using the following html page:</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;title&gt;AJAX Example&lt;/title&gt; &lt;meta http-equiv="Content-Type" content="text/html"; charset="iso-8859-1"&gt; &lt;/head&gt; &lt;script language="JavaScript" src="ajaxlib.js"&gt;&lt;/script&gt; &lt;!--define the ajax javasc...
[ { "answer_id": 301743, "author": "DreamWerx", "author_id": 15487, "author_profile": "https://Stackoverflow.com/users/15487", "pm_score": 0, "selected": false, "text": "<p>I suggest getting Firefox + tamper data add-on.. You'll be able to see if your browser is downloading the javascript,...
2008/11/19
[ "https://Stackoverflow.com/questions/301714", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1246613/" ]
I am using the following html page: ``` <html> <head> <title>AJAX Example</title> <meta http-equiv="Content-Type" content="text/html"; charset="iso-8859-1"> </head> <script language="JavaScript" src="ajaxlib.js"></script> <!--define the ajax javascript library--> <body> Click this <a href="#" OnClick="GetEmplo...
For starters, your `getEmployee()` function should `return false;` to prevent the default action on the `<a>`. The little boxes thing seems to imply that the character sets aren't matching up. Make sure that the HTML page and the PHP page both use the same character set. I'd suggest trying to make everything UTF-8. Ed...
301,716
<p>My scenario is:</p> <p>I have a WPF Window with 3 data-bound text boxes</p> <pre class="lang-xml prettyprint-override"><code>SettingsUI : Window &lt;Grid Name="SettingsUIGrid1"&gt; &lt;TextBox Text="{Binding val1}" .... &lt;TextBox Text="{Binding val2}" .... &lt;TextBox Text="{Binding val3}" .... &lt;...
[ { "answer_id": 301818, "author": "Bijington", "author_id": 32348, "author_profile": "https://Stackoverflow.com/users/32348", "pm_score": 0, "selected": false, "text": "<p>I would suggest putting some code into your cancel button click event to check whether any of the data has been chang...
2008/11/19
[ "https://Stackoverflow.com/questions/301716", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
My scenario is: I have a WPF Window with 3 data-bound text boxes ```xml SettingsUI : Window <Grid Name="SettingsUIGrid1"> <TextBox Text="{Binding val1}" .... <TextBox Text="{Binding val2}" .... <TextBox Text="{Binding val3}" .... </Grid> ``` In the constructor I do this: ``` SettingsUIGrid1.DataContex...
The Binding works two way: it takes the value and sets it editable in the textbox, and if the value changes, it updates the original object's value... If you only wish to show the data, you can use the Mode=OneTime option in the Binding ``` {Binding Path =val1, Mode=OneTime} ``` This will only evaluate the data onc...
301,722
<p>I have a form with a DIV, 3 INPUTS, each INPUT sits within a LABEL element. I would like to change the background image of the DIV element when focusing on each INPUT.</p> <p>I can't move back up the DOM to fix this with CSS, so could someone suggest a few lines of jQuery please?</p> <p>Thanks</p>
[ { "answer_id": 301748, "author": "Pat", "author_id": 238, "author_profile": "https://Stackoverflow.com/users/238", "pm_score": 1, "selected": false, "text": "<pre><code>$('input').focus(function(){\n $(this).parent().parent().addClass('highlight');\n}).blur(function(){\n $(this).p...
2008/11/19
[ "https://Stackoverflow.com/questions/301722", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I have a form with a DIV, 3 INPUTS, each INPUT sits within a LABEL element. I would like to change the background image of the DIV element when focusing on each INPUT. I can't move back up the DOM to fix this with CSS, so could someone suggest a few lines of jQuery please? Thanks
``` $('div input').focus(function(){ $(this).parents('div:eq(0)').addClass('specialCSSclass'); }).blur(function(){ $(this).parents('div:eq(0)').removeClass('specialCSSclass'); }); ``` You would need to create a class in your CSS and then replace "specialCSSclass" with it.
301,725
<p>I need to find out the position of the TR.</p> <p>Actually, I got the index of the TD which is 291, But I need to get the index of the TR contains the TD.</p> <p>We can get the <code>innerHTML</code> by</p> <pre><code>document.getElementsByTagName(&quot;td&quot;)[291].parentNode.innerHTML.. </code></pre> <p>How to g...
[ { "answer_id": 301741, "author": "krosenvold", "author_id": 23691, "author_profile": "https://Stackoverflow.com/users/23691", "pm_score": 0, "selected": false, "text": "<p>I am wondering why you need the index of that node ? </p>\n\n<p>You can assign </p>\n\n<p>var trNode = document.getE...
2008/11/19
[ "https://Stackoverflow.com/questions/301725", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38172/" ]
I need to find out the position of the TR. Actually, I got the index of the TD which is 291, But I need to get the index of the TR contains the TD. We can get the `innerHTML` by ``` document.getElementsByTagName("td")[291].parentNode.innerHTML.. ``` How to get the index of that `parentNode` I mean the TR. Please ...
``` var parent = document.getElementsByTagName("td")[291].parentNode; var index = -1; for (var i = 0; i < parent.childNodes.length; i++) { if (parent.childNodes.item(i) == tr) { index = i; break; } } ```
301,759
<p>How can I return to the start of a line and overwrite what has already been output on the console? The following does not appear to work:</p> <pre><code>System.out.print(mystuff+'\r'); </code></pre>
[ { "answer_id": 301779, "author": "Avi", "author_id": 1605, "author_profile": "https://Stackoverflow.com/users/1605", "pm_score": 2, "selected": false, "text": "<p>If you just want to write a new line to the console, you should use the println() method:</p>\n\n<pre><code>System.out.printl...
2008/11/19
[ "https://Stackoverflow.com/questions/301759", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
How can I return to the start of a line and overwrite what has already been output on the console? The following does not appear to work: ``` System.out.print(mystuff+'\r'); ```
I suspect that your cursor IS moving to the front of the line. The text you already have isn't disappearing because you haven't overwritten it with anything. You could output spaces to blank the line and then add another \r. I just tested the following on Windows XP and AIX and it works as expected: ``` public class ...
301,766
<p>I have the following in a page e.g. <code>/mypage?myvar=oldvalue</code></p> <pre><code>$_SESSION['myvar'] = $_GET['myvar']; $myvar = 'a_new_string' </code></pre> <p>Now <code>$_SESSION['myvar']</code> has the value <code>'a_new_string'</code></p> <p>Is this by design?</p> <p>How can I copy the <em>value</em> of ...
[ { "answer_id": 301783, "author": "Pat", "author_id": 238, "author_profile": "https://Stackoverflow.com/users/238", "pm_score": 2, "selected": false, "text": "<p>It's a feature not a bug :-)</p>\n\n<p>luckily you can turn it off, set <a href=\"http://www.php.net/register_globals\" rel=\"n...
2008/11/19
[ "https://Stackoverflow.com/questions/301766", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6691/" ]
I have the following in a page e.g. `/mypage?myvar=oldvalue` ``` $_SESSION['myvar'] = $_GET['myvar']; $myvar = 'a_new_string' ``` Now `$_SESSION['myvar']` has the value `'a_new_string'` Is this by design? How can I copy the *value* of `'myvar'` rather than a reference to it?
register\_globals is the invention of the devil. Fortunately in PHP 6.0 it will be entirely disabled. It wasn't just a huge security problem, it makes people confuse. Please turn it off in your php.ini using register\_globals = Off More information: <http://us2.php.net/register_globals> Also you can check the current ...
301,770
<p>All the examples that I can search online use the App.Config mode of specifying the context definition retrieved by </p> <pre><code>contextToGetSprungObjects = ContextRegistry.GetContext(contextname) </code></pre> <p>I want to use </p> <pre><code>contextToGetSprungObjects = new XmlApplicationContext(sXmlFileName)...
[ { "answer_id": 301783, "author": "Pat", "author_id": 238, "author_profile": "https://Stackoverflow.com/users/238", "pm_score": 2, "selected": false, "text": "<p>It's a feature not a bug :-)</p>\n\n<p>luckily you can turn it off, set <a href=\"http://www.php.net/register_globals\" rel=\"n...
2008/11/19
[ "https://Stackoverflow.com/questions/301770", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1695/" ]
All the examples that I can search online use the App.Config mode of specifying the context definition retrieved by ``` contextToGetSprungObjects = ContextRegistry.GetContext(contextname) ``` I want to use ``` contextToGetSprungObjects = new XmlApplicationContext(sXmlFileName) ``` (I'm calling into a DLL (that ...
register\_globals is the invention of the devil. Fortunately in PHP 6.0 it will be entirely disabled. It wasn't just a huge security problem, it makes people confuse. Please turn it off in your php.ini using register\_globals = Off More information: <http://us2.php.net/register_globals> Also you can check the current ...
301,772
<p>I am using Rob Connery's excellent MVC Storefront as a loose basis for my new MVC Web App but I'm having trouble porting the LazyList code to VB.NET (don't ask).</p> <p>It seems that VB doesn't allow the GetEnumerator function to be specified twice with only differing return types. Does anyone know how I might get ...
[ { "answer_id": 302633, "author": "Simon Steele", "author_id": 4591, "author_profile": "https://Stackoverflow.com/users/4591", "pm_score": 0, "selected": false, "text": "<p>Sorry, I don't know how to get around this using VB, but one of the advantages of .NET is that at runtime you can us...
2008/11/19
[ "https://Stackoverflow.com/questions/301772", "https://Stackoverflow.com", "https://Stackoverflow.com/users/38911/" ]
I am using Rob Connery's excellent MVC Storefront as a loose basis for my new MVC Web App but I'm having trouble porting the LazyList code to VB.NET (don't ask). It seems that VB doesn't allow the GetEnumerator function to be specified twice with only differing return types. Does anyone know how I might get around thi...
VB.NET allows you to specify a name for the function which differs from the function you are implementing. ``` Public Function GetEnumerator() As IEnumerator(Of T) _ Implements IEnumerable(Of T).GetEnumerator Return Inner.GetEnumerator() End Function Public Function GetListEnumerator() As IEnumerator _ Impleme...
301,776
<p>I would like to know if there is any easy way to print multiple emails(about 200) so that they continue on as opposed to printing one per page. I have tried with thunderbird and evolution and this does not seem possible. Would concatenating the individual mail files work or are there other unix utilities that could ...
[ { "answer_id": 301796, "author": "boutta", "author_id": 15108, "author_profile": "https://Stackoverflow.com/users/15108", "pm_score": 3, "selected": true, "text": "<p>Why don't you put all the data from the mails in one text file and print that one.</p>\n\n<p>This could be done by someth...
2008/11/19
[ "https://Stackoverflow.com/questions/301776", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1246613/" ]
I would like to know if there is any easy way to print multiple emails(about 200) so that they continue on as opposed to printing one per page. I have tried with thunderbird and evolution and this does not seem possible. Would concatenating the individual mail files work or are there other unix utilities that could do ...
Why don't you put all the data from the mails in one text file and print that one. This could be done by something like: ``` cat *.eml > file.txt ``` Or print it directly with ``` cat *.eml | lpr ```