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
423,504
<p>I am trying to run a .Net 2.0 application from a network share without using the FullTrust permission set. I want to create a new permission set that has just the permissions my assemblies require, and then assign that to the exe on the shared path. Is it possible to do this? From my limited experiments, I find that...
[ { "answer_id": 423577, "author": "Recep", "author_id": 51771, "author_profile": "https://Stackoverflow.com/users/51771", "pm_score": 0, "selected": false, "text": "<p>Prior to .NET 3.5, you need to fully trust the share to run a .NET application from there. Shawn explains this <a href=\"...
2009/01/08
[ "https://Stackoverflow.com/questions/423504", "https://Stackoverflow.com", "https://Stackoverflow.com/users/52795/" ]
I am trying to run a .Net 2.0 application from a network share without using the FullTrust permission set. I want to create a new permission set that has just the permissions my assemblies require, and then assign that to the exe on the shared path. Is it possible to do this? From my limited experiments, I find that I ...
You need to sign your assemblies with a strong name and then set the cas-policy for your strong-name to full trust. The easiest way for setting up FullTrust to all code signed with your strong-name is: ``` caspol.exe -q -m -ag MyZone -strong -hex [HexCodeOfYourStrongName] -noname -noversion FullTrust -name MyCode -de...
423,524
<p>What I want to do is when user finish editing of data in table cell to move focus onto another cell depending of what user entered, and to turn that cell into editing mode so user can start typing immediately with no additional action. This way user can focus on his work and software will do the 'thinking' about whi...
[ { "answer_id": 423582, "author": "Markus Lausberg", "author_id": 39062, "author_profile": "https://Stackoverflow.com/users/39062", "pm_score": 0, "selected": false, "text": "<p>You should add a KeyListener to the JTable to get all typed Characters.\nAfter the user presses <kbd>Enter</kbd...
2009/01/08
[ "https://Stackoverflow.com/questions/423524", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
What I want to do is when user finish editing of data in table cell to move focus onto another cell depending of what user entered, and to turn that cell into editing mode so user can start typing immediately with no additional action. This way user can focus on his work and software will do the 'thinking' about which ...
Please try this example. It should let you navigate through the table by entering the values u, d, l, r for Up, Down, Left, Right. Hope that this will give you an idea about how to do it. ``` import java.awt.event.ActionEvent; import javax.swing.AbstractAction; import javax.swing.Action; import javax.swing.JFrame; ...
423,547
<p>HI, I am doing ERP solution in C#(2.0) windows application and SQL2005 Database.The network application communicate through Database.I used normal technique for user login and logout, keeping a status bit.My problem is that when my application interrupted with any other reason user status might not change.That ...
[ { "answer_id": 423561, "author": "lc.", "author_id": 44853, "author_profile": "https://Stackoverflow.com/users/44853", "pm_score": 2, "selected": false, "text": "<p>How about keeping track of user logins by maintaining a session for each login? The quick-and-dirty solution is to then off...
2009/01/08
[ "https://Stackoverflow.com/questions/423547", "https://Stackoverflow.com", "https://Stackoverflow.com/users/49001/" ]
HI, I am doing ERP solution in C#(2.0) windows application and SQL2005 Database.The network application communicate through Database.I used normal technique for user login and logout, keeping a status bit.My problem is that when my application interrupted with any other reason user status might not change.That will ca...
If your intention is to disallow sharing of one username on different computers, after logging with valid password, log the unique token on that computer to **staff.last\_logged\_at** = **@unique\_token**. On logout, set staff.last\_logged\_at = ''. This way even if the computer was interrupted(program crash due to vir...
423,554
<p>I am currently trying to learn C and I have come to a problem that I've been unable to solve.</p> <p>Consider:</p> <pre><code>#include &lt;stdio.h&gt; #include &lt;stdlib.h&gt; #include &lt;string.h&gt; #define ELEMENTS 5 void make(char **array, int *array_size) { int i; char *t = "Hello, World!"; a...
[ { "answer_id": 423558, "author": "kauppi", "author_id": 964, "author_profile": "https://Stackoverflow.com/users/964", "pm_score": 2, "selected": false, "text": "<p>See PolyThinker's comment which is absolutely spot on. </p>\n\n<p>In addition to the way you pass the array, you should chec...
2009/01/08
[ "https://Stackoverflow.com/questions/423554", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I am currently trying to learn C and I have come to a problem that I've been unable to solve. Consider: ``` #include <stdio.h> #include <stdlib.h> #include <string.h> #define ELEMENTS 5 void make(char **array, int *array_size) { int i; char *t = "Hello, World!"; array = malloc(ELEMENTS * sizeof(char *)...
Here is the working code: ``` #include <stdio.h> #include <stdlib.h> #include <string.h> #define ELEMENTS 5 void make(char ***array) { char *t = "Hello, World!"; *array = malloc(ELEMENTS * sizeof(char *)); int i; for (i = 0; i < ELEMENTS; ++i) { (*array)[i] = strdup(t); } } int main(in...
423,591
<p>I wish to use a modelbinder I've made directly on an action method parameter. Such as:</p> <pre><code>public ActionResult MyAction([ModelBinder(typeof(MyBinder))] string param1) </code></pre> <p>However, I need to pass a string into the binder itself, so I was wondering if you could do something along the lines of...
[ { "answer_id": 424250, "author": "Craig Stuntz", "author_id": 7714, "author_profile": "https://Stackoverflow.com/users/7714", "pm_score": 3, "selected": true, "text": "<p>No, you cannot pass parameters via the attribute declaration. If you look at the source code for ModelBinderAttribute...
2009/01/08
[ "https://Stackoverflow.com/questions/423591", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13148/" ]
I wish to use a modelbinder I've made directly on an action method parameter. Such as: ``` public ActionResult MyAction([ModelBinder(typeof(MyBinder))] string param1) ``` However, I need to pass a string into the binder itself, so I was wondering if you could do something along the lines of: ``` public ActionResult...
No, you cannot pass parameters via the attribute declaration. If you look at the source code for ModelBinderAttribute, you will see that its constructor takes only a type argument, that it has no other properties, and that it is a sealed class. So this road is a dead end. The only way to get information into the Model...
423,598
<p>var result = from с in dal.context.Funds select new { Name = c.CODE Price = c.Price };</p>
[ { "answer_id": 423608, "author": "Marc Gravell", "author_id": 23354, "author_profile": "https://Stackoverflow.com/users/23354", "pm_score": 1, "selected": false, "text": "<p>I'm not a big VB user, but something like:</p>\n\n<pre><code>Dim result = From c In dal.context.Funds _\n ...
2009/01/08
[ "https://Stackoverflow.com/questions/423598", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
var result = from с in dal.context.Funds select new { Name = c.CODE Price = c.Price };
I'm not a big VB user, but something like: ``` Dim result = From c In dal.context.Funds _ Select c.CODE, c.Price ``` To rename it, you might need `With` (at a guess): ``` Select New With {.Name = c.CODE, .Price = c.Price} ```
423,600
<p>I am new to programming and am trying to follow an example which uses #! comment in ruby.</p> <p>I am consistently get the message: bash: matz.rb: command not found</p> <p>I am using this comment: #! /usr/bin/env ruby</p> <p>I have tried it with and without the space after ! as well as with and without the...
[ { "answer_id": 423603, "author": "Oliver Friedrich", "author_id": 44532, "author_profile": "https://Stackoverflow.com/users/44532", "pm_score": 0, "selected": false, "text": "<p>Have you tried the ShaBang as following to directly point to ruby?</p>\n\n<pre><code>#! /usr/bin/ruby\n</code>...
2009/01/08
[ "https://Stackoverflow.com/questions/423600", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I am new to programming and am trying to follow an example which uses #! comment in ruby. I am consistently get the message: bash: matz.rb: command not found I am using this comment: #! /usr/bin/env ruby I have tried it with and without the space after ! as well as with and without the env. when I use the $ whi...
If you're in the same directory as the matz.rb file, be sure to run it as ``` $ ./matz.rb ``` and not just ``` $ matz.rb ``` Here's a shell session demonstrating this working: ``` $ ls -la m* -rwxr-xr-x 1 gareth gareth 32 8 Jan 08:46 matz.rb $ cat matz.rb #!/usr/bin/env ruby puts "Matz" $ matz.rb -bash: matz...
423,605
<p>I'm sure I've done this before, but can't find any example of it! Grrr...</p> <p>For example, I want to convert an <code>IList&lt;T&gt;</code> into a <code>BindingList&lt;T&gt;</code>:</p> <pre><code>public class ListHelper { public static BindingList&lt;T&gt; ToBindingList(IList&lt;T&gt; data) { B...
[ { "answer_id": 423620, "author": "Sander", "author_id": 2928, "author_profile": "https://Stackoverflow.com/users/2928", "pm_score": 6, "selected": true, "text": "<pre><code>ToBindingList &lt;T&gt; (...)\n</code></pre>\n\n<hr>\n\n<pre><code>public class ListHelper\n{\n public static Bi...
2009/01/08
[ "https://Stackoverflow.com/questions/423605", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5461/" ]
I'm sure I've done this before, but can't find any example of it! Grrr... For example, I want to convert an `IList<T>` into a `BindingList<T>`: ``` public class ListHelper { public static BindingList<T> ToBindingList(IList<T> data) { BindingList<T> output = new BindingList<T>(); foreach (T it...
``` ToBindingList <T> (...) ``` --- ``` public class ListHelper { public static BindingList<T> ToBindingList<T>(IList<T> data) { BindingList<T> output = new BindingList<T>(); foreach (T item in data) { output.Add(item); } return output; } } ```
423,606
<p>I have this scenario where I need data integrity in the physical database. For example, I have a variable of <code>@email_address VARCHAR(200)</code> and I want to check if the value of <code>@email_address</code> is of email format. Anyone has any idea how to check format in T-SQL? </p> <p>Many thanks!</p>
[ { "answer_id": 423639, "author": "Rad", "author_id": 1349, "author_profile": "https://Stackoverflow.com/users/1349", "pm_score": 1, "selected": false, "text": "<p>If you use SQL 2005 or 2008 you might want to look at writing CLR stored proceudues and use the .NET regex engine <a href=\"h...
2009/01/08
[ "https://Stackoverflow.com/questions/423606", "https://Stackoverflow.com", "https://Stackoverflow.com/users/47610/" ]
I have this scenario where I need data integrity in the physical database. For example, I have a variable of `@email_address VARCHAR(200)` and I want to check if the value of `@email_address` is of email format. Anyone has any idea how to check format in T-SQL? Many thanks!
I tested the following query with many different wrong and valid email addresses. It should do the job. ``` IF ( CHARINDEX(' ',LTRIM(RTRIM(@email_address))) = 0 AND LEFT(LTRIM(@email_address),1) <> '@' AND RIGHT(RTRIM(@email_address),1) <> '.' AND CHARINDEX('.',@email_address ,CHARINDEX('@',@email_address)...
423,623
<p>I am developing a flvplayer with cocoa. I want to drag a flv file from the finder and drop it to the webview window (I use it to view the flv). But I didn't have the path of this file from finder. This is my code:</p> <pre><code> _ (void)showflv(nsstring*)aa { .......... //Register to acc...
[ { "answer_id": 423702, "author": "Chuck", "author_id": 50742, "author_profile": "https://Stackoverflow.com/users/50742", "pm_score": 4, "selected": true, "text": "<p>Like so:</p>\n\n<pre><code>NSArray *draggedFilePaths = [pboard propertyListForType:NSFilenamesPboardType];\n</code></pre>\...
2009/01/08
[ "https://Stackoverflow.com/questions/423623", "https://Stackoverflow.com", "https://Stackoverflow.com/users/51958/" ]
I am developing a flvplayer with cocoa. I want to drag a flv file from the finder and drop it to the webview window (I use it to view the flv). But I didn't have the path of this file from finder. This is my code: ``` _ (void)showflv(nsstring*)aa { .......... //Register to accept flv drag/d...
Like so: ``` NSArray *draggedFilePaths = [pboard propertyListForType:NSFilenamesPboardType]; ```
423,650
<p>Do you know how to access textboxes added to a radgrid that are not bound but are used to trap any row related input a user typed in to the textbox for that column. I need to access this data server side when a postback occurs. Your thoughts are greatly appreciated Thanking you</p> <p>Tony</p>
[ { "answer_id": 436080, "author": "Corey Downie", "author_id": 44861, "author_profile": "https://Stackoverflow.com/users/44861", "pm_score": 2, "selected": true, "text": "<p>That depends on how those textboxes are being added/created. If by 'not bound' you mean they are in Template colum...
2009/01/08
[ "https://Stackoverflow.com/questions/423650", "https://Stackoverflow.com", "https://Stackoverflow.com/users/51630/" ]
Do you know how to access textboxes added to a radgrid that are not bound but are used to trap any row related input a user typed in to the textbox for that column. I need to access this data server side when a postback occurs. Your thoughts are greatly appreciated Thanking you Tony
That depends on how those textboxes are being added/created. If by 'not bound' you mean they are in Template columns you should be able to use .FindControl in one of the grid's events to grab that textbox. And again which event will depend on what is causing the postback to happen. For the purpose of this code example...
423,663
<p>I'm rendering a certain scene into a texture and then I need to process that image in some simple way. How I'm doing this now is to read the texture using <code>glReadPixels()</code> and then process it on the CPU. This is however too slow so I was thinking about moving the processing to the GPU. </p> <p>The simpl...
[ { "answer_id": 436080, "author": "Corey Downie", "author_id": 44861, "author_profile": "https://Stackoverflow.com/users/44861", "pm_score": 2, "selected": true, "text": "<p>That depends on how those textboxes are being added/created. If by 'not bound' you mean they are in Template colum...
2009/01/08
[ "https://Stackoverflow.com/questions/423663", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9611/" ]
I'm rendering a certain scene into a texture and then I need to process that image in some simple way. How I'm doing this now is to read the texture using `glReadPixels()` and then process it on the CPU. This is however too slow so I was thinking about moving the processing to the GPU. The simplest setup to do this I...
That depends on how those textboxes are being added/created. If by 'not bound' you mean they are in Template columns you should be able to use .FindControl in one of the grid's events to grab that textbox. And again which event will depend on what is causing the postback to happen. For the purpose of this code example...
423,673
<p>I've got m2eclipse plugin installed and there's no problem syncing compile time dependencies that appear in pom.xml.</p> <p>Now, I add JPA + Hibernate(or whatever) dependency that maven catches up just fine when doing <code>mvn jetty:run</code>.</p> <p>The problem is, Eclipse doesn't. So I don't get those extra .j...
[ { "answer_id": 423683, "author": "Beau Simensen", "author_id": 50453, "author_profile": "https://Stackoverflow.com/users/50453", "pm_score": 4, "selected": true, "text": "<p>I have found that any time you update a project's POM it helps to rerun m2eclipse or it will not see the new exter...
2009/01/08
[ "https://Stackoverflow.com/questions/423673", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15187/" ]
I've got m2eclipse plugin installed and there's no problem syncing compile time dependencies that appear in pom.xml. Now, I add JPA + Hibernate(or whatever) dependency that maven catches up just fine when doing `mvn jetty:run`. The problem is, Eclipse doesn't. So I don't get those extra .jars deployed on the referenc...
I have found that any time you update a project's POM it helps to rerun m2eclipse or it will not see the new external dependencies. If you have not tried to run this since you added your new dependencies ( JPA + Hibernate or whatever ) to your POM then give it a shot and see if it works. ``` mvn clean install eclipse...
423,677
<p>I am using the following code </p> <p><strong>--- EDIT @annakata :</strong> Adding the complete code</p> <pre><code>&lt;HTML&gt; &lt;HEAD&gt; &lt;TITLE&gt; New Document &lt;/TITLE&gt; &lt;/HEAD&gt; &lt;BODY&gt; &lt;table id="additionalContactsTable" name="additionalContactsTable" ...
[ { "answer_id": 423700, "author": "annakata", "author_id": 13018, "author_profile": "https://Stackoverflow.com/users/13018", "pm_score": 2, "selected": true, "text": "<p>ok, I can clearly see this replicated in IE now.</p>\n\n<p>It appears to be a bug in IE (IE has notorious issues with p...
2009/01/08
[ "https://Stackoverflow.com/questions/423677", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11614/" ]
I am using the following code **--- EDIT @annakata :** Adding the complete code ``` <HTML> <HEAD> <TITLE> New Document </TITLE> </HEAD> <BODY> <table id="additionalContactsTable" name="additionalContactsTable" width="100%" > ...
ok, I can clearly see this replicated in IE now. It appears to be a bug in IE (IE has notorious issues with percentages) dependant on a scenario where: * the input is in a table * AND the input is sized in percentage * AND the input has a default value (i.e. in the markup) which exceeds the width Therefore a couple ...
423,678
<p>I'm just starting out using Ruby and I've written a bit of code to do basic parsing of a CSV file (Line is a basic class, omitted for brevity):</p> <pre><code>class File def each_csv each do |line| yield line.split(",") end end end lines = Array.new File.open("some.csv") do |file| file.each_...
[ { "answer_id": 423748, "author": "georg", "author_id": 3748, "author_profile": "https://Stackoverflow.com/users/3748", "pm_score": 2, "selected": false, "text": "<p>I don't know if you are aware of it, but ruby has <a href=\"http://ruby-doc.org/stdlib/libdoc/csv/rdoc/index.html\" rel=\"n...
2009/01/08
[ "https://Stackoverflow.com/questions/423678", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6369/" ]
I'm just starting out using Ruby and I've written a bit of code to do basic parsing of a CSV file (Line is a basic class, omitted for brevity): ``` class File def each_csv each do |line| yield line.split(",") end end end lines = Array.new File.open("some.csv") do |file| file.each_csv do |csv| ...
Here's a (possibly wild) idea, use the Struct class instead of rolling your own simple POD class. But what you want from this is to have a constructor that accepts all of the arguments that could be generated from the file data. ``` Line = Struct.new(:field1, :field2, :field3) ``` Then at the core of the algorithm y...
423,679
<p>I am using Kohana and just found this piece of code in their autoloading method</p> <pre><code> // Class extension to be evaluated $extension = 'class '.$class.' extends '.$class.'_Core { }'; // Start class analysis $core = new ReflectionClass($class.'_Core'); if ($core-&gt;...
[ { "answer_id": 423695, "author": "Greg", "author_id": 24181, "author_profile": "https://Stackoverflow.com/users/24181", "pm_score": 1, "selected": false, "text": "<p>I think you're stuck with <a href=\"http://www.php.net/eval\" rel=\"nofollow noreferrer\"><code>eval()</code></a> for that...
2009/01/08
[ "https://Stackoverflow.com/questions/423679", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5742/" ]
I am using Kohana and just found this piece of code in their autoloading method ``` // Class extension to be evaluated $extension = 'class '.$class.' extends '.$class.'_Core { }'; // Start class analysis $core = new ReflectionClass($class.'_Core'); if ($core->isAbstract()) ...
If you are looking to create a dynamic class then `eval()` is the goto function (*pun intended.*) However kind of related, I've found that you can put a class declaration within an `if-then` statement. So you can do the following: ``` if(true) { class foo { // methods } } ``` I use this to check t...
423,680
<p>I want to group by a report item, but that's not allowed. So I tried creating a parameter...not allowed as well. Tried referencing from footer...failed again.</p> <p>This is somewhat complicated. Let me explain:</p> <p>I have textbox22, it's value is:</p> <pre><code>=Code.Calc_Factor(Fields!xx.Value, fields!yy.Va...
[ { "answer_id": 423736, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 1, "selected": false, "text": "<p>I'm not 100% that someone won't have some magic solution for this but I have run across similar problems myself in the past...
2009/01/08
[ "https://Stackoverflow.com/questions/423680", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I want to group by a report item, but that's not allowed. So I tried creating a parameter...not allowed as well. Tried referencing from footer...failed again. This is somewhat complicated. Let me explain: I have textbox22, it's value is: ``` =Code.Calc_Factor(Fields!xx.Value, fields!yy.Value...) ``` This is embedd...
Have you tried adding a calculated field to your dataset? Here is how it works: * While you are in the layout view of the report, open "datasets" tool window(in my environment it is on the left). * Right click on the DataSet you are working with and add a field, you can use a calculated field, and build your formula ...
423,693
<p>My pages contain German characters and I have typed the text in between the HTML tag, but the browser views some characters differently. Do I need to include anything in HTML to properly display German characters?</p> <pre><code>&lt;label&gt; ausgefüllt &lt;/label&gt; </code></pre>
[ { "answer_id": 423703, "author": "Rowland Shaw", "author_id": 50447, "author_profile": "https://Stackoverflow.com/users/50447", "pm_score": 2, "selected": false, "text": "<p>Sounds like a character encoding issue, in that the file is saved as a different character encoding to what the we...
2009/01/08
[ "https://Stackoverflow.com/questions/423693", "https://Stackoverflow.com", "https://Stackoverflow.com/users/44984/" ]
My pages contain German characters and I have typed the text in between the HTML tag, but the browser views some characters differently. Do I need to include anything in HTML to properly display German characters? ``` <label> ausgefüllt </label> ```
It seems you need some basic explanations about something that unfortunately even most programmers don't understand properly. Files like your HTML page are saved and transmitted over the Internet as a sequence of bytes, but you want them displayed as characters. In order to translate bytes into characters, you need a ...
423,710
<p>How to return more than one variable from a function in Python?</p>
[ { "answer_id": 423712, "author": "ConcernedOfTunbridgeWells", "author_id": 15401, "author_profile": "https://Stackoverflow.com/users/15401", "pm_score": 3, "selected": false, "text": "<p>Return as a tuple, e.g.</p>\n\n<pre><code>def foo (a):\n x=a\n y=a*2\n return (x,y)\n</code>...
2009/01/08
[ "https://Stackoverflow.com/questions/423710", "https://Stackoverflow.com", "https://Stackoverflow.com/users/46646/" ]
How to return more than one variable from a function in Python?
You separate the values you want to return by commas: ``` def get_name(): # you code return first_name, last_name ``` The commas indicate it's a tuple, so you could wrap your values by parentheses: ``` return (first_name, last_name) ``` Then when you call the function you a) save all values to one variable ...
423,728
<p>I am struggling with something that I think should be easily (ish). I have a windows form and a flowgridlayout panel at the bottom of the form. Inside this form I dynamically populate it with X number of User Controls. The controls are all the same type.</p> <p>The goal is when the user hoovers the mouse over th...
[ { "answer_id": 423734, "author": "lc.", "author_id": 44853, "author_profile": "https://Stackoverflow.com/users/44853", "pm_score": 0, "selected": false, "text": "<p>Idea 1) When the <code>MouseLeave</code> event fires, you can check the mouse coordinates (relative to screen) and check if...
2009/01/08
[ "https://Stackoverflow.com/questions/423728", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6486/" ]
I am struggling with something that I think should be easily (ish). I have a windows form and a flowgridlayout panel at the bottom of the form. Inside this form I dynamically populate it with X number of User Controls. The controls are all the same type. The goal is when the user hoovers the mouse over the user contro...
Hooking all the controls MouseEnter and MouseLeave events, then figuring out if it is still inside the form is pretty painful. A simple timer can get the job done too: ``` public partial class Form1 : Form { private Timer mTimer; public Form1() { InitializeComponent(); mTimer = new Timer(); ...
423,730
<p>I would like to pass a COM method as a function argument but I get this error (Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01 for 80x86):</p> <p>error C3867: 'IDispatch::GetTypeInfoCount': function call missing argument list; use '&amp;IDispatch::GetTypeInfoCount' to create a pointer to membe...
[ { "answer_id": 423762, "author": "morechilli", "author_id": 5427, "author_profile": "https://Stackoverflow.com/users/5427", "pm_score": 2, "selected": false, "text": "<p>Looks like a straight c++ problem.</p>\n\n<p>Your method expects a pointer to a function.</p>\n\n<p>You have a member ...
2009/01/08
[ "https://Stackoverflow.com/questions/423730", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15485/" ]
I would like to pass a COM method as a function argument but I get this error (Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01 for 80x86): error C3867: 'IDispatch::GetTypeInfoCount': function call missing argument list; use '&IDispatch::GetTypeInfoCount' to create a pointer to member What am I m...
As [morechilli](https://stackoverflow.com/users/5427/morechilli) pointed out this is a C++ issue. Here it is the solution, thanks to my colleague Daniele: ``` #include <atlbase.h> template < typename interface_t > void update( interface_t* p, HRESULT (__stdcall interface_t::*com_uint_getter)(UINT*), UINT& u ) { U...
423,792
<p>I am developing a cocoa application which downloads firmware to the device. The progress of downloading is showed using NSProgressIndicator. I call the <code>-incrementBy:</code> method of NSProgressIndicator after DeviceRequestTO method in a while loop. But the progress indicator gets updated only after the entire ...
[ { "answer_id": 423964, "author": "Peter Hosey", "author_id": 30461, "author_profile": "https://Stackoverflow.com/users/30461", "pm_score": 3, "selected": false, "text": "<p>The method you need to call is <code>setNeedsDisplay:</code>, not <code>displayIfNeeded</code>. The latter means “s...
2009/01/08
[ "https://Stackoverflow.com/questions/423792", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39270/" ]
I am developing a cocoa application which downloads firmware to the device. The progress of downloading is showed using NSProgressIndicator. I call the `-incrementBy:` method of NSProgressIndicator after DeviceRequestTO method in a while loop. But the progress indicator gets updated only after the entire firmware is wr...
The method you need to call is `setNeedsDisplay:`, not `displayIfNeeded`. The latter means “send yourself `display` if somebody has sent you `setNeedsDisplay:YES`”. If you don't do that last part, the view doesn't know it should display, and `displayIfNeeded` will do nothing. And once you add the `setNeedsDisplay:` me...
423,794
<p>I'm working with some code (not mine I hasten to add, I don't trust this much at all) for a class which opens a socket, makes requests and listens for responses, which is throwing an exception in a way I can't comprehend when tested in xunit. I <em>assume</em> the same exception happens "live" but the class is refer...
[ { "answer_id": 423806, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 4, "selected": true, "text": "<p>If this object is eligible for garbage collection and there are no other references to the Socket, then the <em>socket...
2009/01/08
[ "https://Stackoverflow.com/questions/423794", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13018/" ]
I'm working with some code (not mine I hasten to add, I don't trust this much at all) for a class which opens a socket, makes requests and listens for responses, which is throwing an exception in a way I can't comprehend when tested in xunit. I *assume* the same exception happens "live" but the class is referenced by a...
If this object is eligible for garbage collection and there are no other references to the Socket, then the *socket's* finalizer may well run before your object's finalizer. I suspect that's what's happened here. It's generally a bad idea (IMO) to do this much work in a finalizer. I can't remember the last time I impl...
423,797
<p>I need to know how much physical memory a windows machine has, using Perl.</p> <p>I've tried using <a href="http://search.cpan.org/dist/Win32-SystemInfo" rel="nofollow noreferrer">Win32::SystemInfo</a>. However this module states the following caveat:</p> <blockquote> <p>On Intel x86 computers with more than 2 G...
[ { "answer_id": 427435, "author": "j_random_hacker", "author_id": 47984, "author_profile": "https://Stackoverflow.com/users/47984", "pm_score": 1, "selected": false, "text": "<p>I can only assume that the caveats attending <code>Win32::SystemInfo</code>'s results are also caveats attendin...
2009/01/08
[ "https://Stackoverflow.com/questions/423797", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13523/" ]
I need to know how much physical memory a windows machine has, using Perl. I've tried using [Win32::SystemInfo](http://search.cpan.org/dist/Win32-SystemInfo). However this module states the following caveat: > > On Intel x86 computers with more than 2 GB and less than 4 GB of memory, the MemoryStatus function will a...
As stated in the comments, this is an issue of [GlobalMemoryStatus](http://msdn.microsoft.com/en-us/library/aa366586.aspx), as it can return answers up to 2GB. And [GlobalMemoryStatusEX](http://msdn.microsoft.com/en-us/library/aa366589(VS.85).aspx) which solves this issue of the 2GB limit, but only works on 64 bit syst...
423,808
<p>I need to create a Firebird Database programmatically using DBExpress. I have done this for SQL server, by first connecting to Master, then passing in the script for Create to a query, but with Firebird I have a little chicken and egg problem.</p>
[ { "answer_id": 423877, "author": "Birger", "author_id": 11485, "author_profile": "https://Stackoverflow.com/users/11485", "pm_score": 3, "selected": true, "text": "<p>I got a good tip from a collegue that created some code for the Freepascal project. It doesn't use DB express, but accord...
2009/01/08
[ "https://Stackoverflow.com/questions/423808", "https://Stackoverflow.com", "https://Stackoverflow.com/users/22712/" ]
I need to create a Firebird Database programmatically using DBExpress. I have done this for SQL server, by first connecting to Master, then passing in the script for Create to a query, but with Firebird I have a little chicken and egg problem.
I got a good tip from a collegue that created some code for the Freepascal project. It doesn't use DB express, but according to him it is the only way to create a database with code. This code is based on the InterBase manual, and uses a call from the gdslib / fbclient dll: ``` procedure TIBConnection.CreateDB; var A...
423,840
<p>Is there an equivalent of a SQL IN statement in LINQ to objects?</p>
[ { "answer_id": 423875, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 5, "selected": true, "text": "<p>Yes - <a href=\"http://msdn.microsoft.com/en-us/library/system.linq.enumerable.contains.aspx\" rel=\"noreferrer\">Cont...
2009/01/08
[ "https://Stackoverflow.com/questions/423840", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5461/" ]
Is there an equivalent of a SQL IN statement in LINQ to objects?
Yes - [Contains](http://msdn.microsoft.com/en-us/library/system.linq.enumerable.contains.aspx). ``` var desiredNames = new[] { "Jon", "Marc" }; var people = new[] { new { FirstName="Jon", Surname="Skeet" }, new { FirstName="Marc", Surname="Gravell" }, new { FirstName="Jeff", Surname="Atwood" } }; var mat...
423,841
<p>I am generating some text to be shown on a web-site, and use <a href="http://msdn.microsoft.com/en-us/library/system.web.httputility.htmlencode.aspx" rel="nofollow noreferrer">HttpUtility.HtmlEncode</a> to ensure it will look correct. However, this method does not appear to encode the <a href="http://en.wikipedia.or...
[ { "answer_id": 423867, "author": "mouviciel", "author_id": 45249, "author_profile": "https://Stackoverflow.com/users/45249", "pm_score": 0, "selected": false, "text": "<p>Take a look at <a href=\"http://www.alistapart.com/articles/emen\" rel=\"nofollow noreferrer\">A List Apart</a>, as I...
2009/01/08
[ "https://Stackoverflow.com/questions/423841", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15393/" ]
I am generating some text to be shown on a web-site, and use [HttpUtility.HtmlEncode](http://msdn.microsoft.com/en-us/library/system.web.httputility.htmlencode.aspx) to ensure it will look correct. However, this method does not appear to encode the [Em Dash](http://en.wikipedia.org/wiki/Mdash#Em_dash) (it should conver...
Bobince's answer gives a solution to what seems to be your main concern : replacing your use of HtmlDecode by a more straightforward declaration of the char to replace. Rewrite ``` sWebsiteText.Replace(HttpUtility.HtmlDecode("&#8211;"), "&#8211;") ``` as ``` sWebsiteText.Replace("\u2013", "&#x2013;") ``` (...
423,860
<pre><code>include('header.php'); $name = $_POST['name']; $score = $_POST['score']; $dept = $_POST['dept']; $MyDB-&gt;prep("INSERT INTO demo (`id`,`name`,`score`,`dept`, `date`) VALUES ('','$name','$score','$dept','$date')"); // Bind a value to our :id hook // Produces: SELECT * FROM demo_table WHERE id = '23' $MyDB-...
[ { "answer_id": 423872, "author": "myplacedk", "author_id": 28683, "author_profile": "https://Stackoverflow.com/users/28683", "pm_score": 2, "selected": false, "text": "<p>Look at /Applications/MAMP/htdocs/testygubbins/OO/test/header.php line 15.</p>\n\n<p>At that position, it makes some ...
2009/01/08
[ "https://Stackoverflow.com/questions/423860", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31677/" ]
``` include('header.php'); $name = $_POST['name']; $score = $_POST['score']; $dept = $_POST['dept']; $MyDB->prep("INSERT INTO demo (`id`,`name`,`score`,`dept`, `date`) VALUES ('','$name','$score','$dept','$date')"); // Bind a value to our :id hook // Produces: SELECT * FROM demo_table WHERE id = '23' $MyDB->bind(':da...
Look carefully at your includes - perhaps you have a blank line after a closing ?> ? This will cause some literal whitespace to be sent as output, preventing you from making subsequent header calls. Note that it is legal to leave the close ?> off the include file, which is a useful idiom for avoiding this problem. ...
423,865
<p>The data that I am sending to convertStringToDataSet function is </p> <pre><code> &lt;NewDataSet&gt;\r\n &lt;Table ID="Table1"&gt; \r\n &lt;PATNAME&gt;Doe,JaneN&lt;/PATNAME&gt;\r\n &lt;LEVEL&gt;175&lt;/LEVEL&gt;\r\n &lt;WHEN&gt;2007-09-13T23:00:00.000...
[ { "answer_id": 423890, "author": "Lasse V. Karlsen", "author_id": 267, "author_profile": "https://Stackoverflow.com/users/267", "pm_score": 0, "selected": false, "text": "<p>Have you debugged it and put a breakpoint there to verify that the string you get is actually the string you expec...
2009/01/08
[ "https://Stackoverflow.com/questions/423865", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
The data that I am sending to convertStringToDataSet function is ``` <NewDataSet>\r\n <Table ID="Table1"> \r\n <PATNAME>Doe,JaneN</PATNAME>\r\n <LEVEL>175</LEVEL>\r\n <WHEN>2007-09-13T23:00:00.0000000-05:00</WHEN>\r\n <NOTE>New 180-day ...
DateTime.Parse will try all kinds of different patterns. Assuming you've got an explicit format in mind, I would use [DateTime.ParseExact](http://msdn.microsoft.com/en-us/library/system.datetime.parseexact.aspx) - that way you know what it's looking for. And as lassevk's said, look at the string before you try to pars...
423,898
<p>There are enough resources on how to convert an expression tree into postfix notation, and it's not that hard.</p> <p>But I have to parse a postfix expression into an expression tree.</p> <p>The expression is:</p> <blockquote> <p>A 2 ^ 2 A * B * - B 2 ^ + A B - /</p> </blockquote> <p>I don't really have a clue...
[ { "answer_id": 423905, "author": "Lasse V. Karlsen", "author_id": 267, "author_profile": "https://Stackoverflow.com/users/267", "pm_score": 7, "selected": true, "text": "<p>Create a stack containing nodes that could be part of a tree</p>\n\n<ol>\n<li>Push operands on a stack (A, 2, B, et...
2009/01/08
[ "https://Stackoverflow.com/questions/423898", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20261/" ]
There are enough resources on how to convert an expression tree into postfix notation, and it's not that hard. But I have to parse a postfix expression into an expression tree. The expression is: > > A 2 ^ 2 A \* B \* - B 2 ^ + A B - / > > > I don't really have a clue on how to interpret the expression. Does so...
Create a stack containing nodes that could be part of a tree 1. Push operands on a stack (A, 2, B, etc. are operands) as leaf-nodes, not bound to any tree in any direction 2. For operators, pop the necessary operands off the stack, create a node with the operator at the top, and the operands hanging below it, push the...
423,919
<p>Hi all i am writing a Rails application and i include some link_to_remote links The generated code is</p> <pre><code>&lt;a href="#" onclick="new Ajax.Request('/b10/categories/games?category=Action', {asynchronous:true, evalScripts:true}); return false;"&gt;Test&lt;/a&gt; </code></pre> <p>That works perfectly fine ...
[ { "answer_id": 423948, "author": "schnaader", "author_id": 34065, "author_profile": "https://Stackoverflow.com/users/34065", "pm_score": 0, "selected": false, "text": "<p>I think you should simply check the image dimensions. Having only a few formats, this isn't that hard and you can the...
2009/01/08
[ "https://Stackoverflow.com/questions/423919", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1438479/" ]
Hi all i am writing a Rails application and i include some link\_to\_remote links The generated code is ``` <a href="#" onclick="new Ajax.Request('/b10/categories/games?category=Action', {asynchronous:true, evalScripts:true}); return false;">Test</a> ``` That works perfectly fine on Safari and Firefox but when i try...
The dimensions should be able to get at without loading the entire image map into memory? Maybe you can find out more on the issue at [wotsit.org](http://www.wotsit.org/).
423,921
<p>I have an xml template document that I need to load into an XmlDocument. eg</p> <pre><code>myXMLDocument.Load(myXMLFile); </code></pre> <p>However this is very slow as it loads in the dtd. I have tried both <code>"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"</code> and a local copy of the dtd. Both take more or...
[ { "answer_id": 423940, "author": "schnaader", "author_id": 34065, "author_profile": "https://Stackoverflow.com/users/34065", "pm_score": 0, "selected": false, "text": "<p>Look at the DTD file, there are some more online references to .mod files, perhaps these slow the process down. You c...
2009/01/08
[ "https://Stackoverflow.com/questions/423921", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15233/" ]
I have an xml template document that I need to load into an XmlDocument. eg ``` myXMLDocument.Load(myXMLFile); ``` However this is very slow as it loads in the dtd. I have tried both `"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"` and a local copy of the dtd. Both take more or less the same time. If I turn of loadi...
You can avoid the DTD if you return an empty memory stream: ``` private class DummyResolver : XmlResolver { public override System.Net.ICredentials Credentials { set { // Do nothing. } } public override object GetEntity(Uri absoluteUri, string role, Type ofObjectToReturn) { return new...
423,924
<p>How to get Hibernate session inside a Hibernate Interceptor?</p> <p>I'm trying to use Hibernate to enforce data access by organization id transparently. I have set a global Filter to filter all queries by organization id. Now, I need to use an Entity interceptor to set Organizational Id on all Entities before Save...
[ { "answer_id": 425660, "author": "Nicholas", "author_id": 43786, "author_profile": "https://Stackoverflow.com/users/43786", "pm_score": 2, "selected": false, "text": "<p>If all you need is the Organizational Id, you could put it in a static ThreadLocal and then access it in the intercept...
2009/01/08
[ "https://Stackoverflow.com/questions/423924", "https://Stackoverflow.com", "https://Stackoverflow.com/users/51402/" ]
How to get Hibernate session inside a Hibernate Interceptor? I'm trying to use Hibernate to enforce data access by organization id transparently. I have set a global Filter to filter all queries by organization id. Now, I need to use an Entity interceptor to set Organizational Id on all Entities before Save/Update. ...
You can, but I would use a simple POJO just to keep things cleanly separated. Keep in mind that the value stored in the singleton will only be accessible by the same thread that handled the servlet request, so if you're doing any asynch, you will need to account for that. Here's a super basic impl: ``` public class Or...
423,925
<p>Does anyone know why, using SQLServer 2005</p> <pre><code>SELECT CONVERT(DECIMAL(30,15),146804871.212533)/CONVERT(DECIMAL (38,9),12499999.9999) </code></pre> <p>gives me 11.74438969709659,</p> <p>but when I increase the decimal places on the denominator to 15, I get a less accurate answer:</p> <pre><code>SELECT ...
[ { "answer_id": 424015, "author": "cmsjr", "author_id": 23114, "author_profile": "https://Stackoverflow.com/users/23114", "pm_score": 2, "selected": false, "text": "<p>Convert the expression not the arguments. </p>\n\n<pre><code>select CONVERT(DECIMAL(38,36),146804871.212533 / 12499999.9...
2009/01/08
[ "https://Stackoverflow.com/questions/423925", "https://Stackoverflow.com", "https://Stackoverflow.com/users/52881/" ]
Does anyone know why, using SQLServer 2005 ``` SELECT CONVERT(DECIMAL(30,15),146804871.212533)/CONVERT(DECIMAL (38,9),12499999.9999) ``` gives me 11.74438969709659, but when I increase the decimal places on the denominator to 15, I get a less accurate answer: ``` SELECT CONVERT(DECIMAL(30,15),146804871.212533)/CON...
For multiplication we simply add the number of decimal places in each argument together (using pen and paper) to work out output dec places. But division just blows your head apart. I'm off to lie down now. In SQL terms though, it's [exactly as expected.](http://msdn.microsoft.com/en-us/library/ms190476(SQL.90).aspx)...
423,950
<p>Well, I have an image that I would like to put as a background to a button (or something clicable). The problem is that this image is round, so I need to show this image, without any borders, etc.</p> <p>The JComponent that holds this button has a custom background, so the button really needs to only show the image...
[ { "answer_id": 423960, "author": "Bombe", "author_id": 43582, "author_profile": "https://Stackoverflow.com/users/43582", "pm_score": 0, "selected": false, "text": "<p>Opacity should be set to false, so</p>\n\n<pre><code>button.setOpaque(false);\n</code></pre>\n\n<p>could already be what ...
2009/01/08
[ "https://Stackoverflow.com/questions/423950", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37190/" ]
Well, I have an image that I would like to put as a background to a button (or something clicable). The problem is that this image is round, so I need to show this image, without any borders, etc. The JComponent that holds this button has a custom background, so the button really needs to only show the image. After s...
Create a new Jbutton: ``` JButton addBtn = new JButton("+"); addBtn.setBounds(x_pos, y_pos, 30, 25); addBtn.setBorder(new RoundedBorder(10)); //10 is the radius addBtn.setForeground(Color.BLUE); ``` while setting the border for a JButton, call the overridden `javax.swing.border.Border` class. ``` ad...
423,961
<p>I have some code that uses the Oracle function add_months to increment a Date by X number of months.</p> <p>I now need to re-implement the same logic in a C / C++ function. For reasons I don't want/need to go into I can't simply issue a query to oracle to get the new date.</p> <p>Does anyone know of a simple and ...
[ { "answer_id": 423977, "author": "MSalters", "author_id": 15416, "author_profile": "https://Stackoverflow.com/users/15416", "pm_score": 3, "selected": false, "text": "<p>Convert <code>time_t</code> to <code>struct tm</code>, add X to month, add months > 12 to years, convert back. tm.tm_m...
2009/01/08
[ "https://Stackoverflow.com/questions/423961", "https://Stackoverflow.com", "https://Stackoverflow.com/users/52888/" ]
I have some code that uses the Oracle function add\_months to increment a Date by X number of months. I now need to re-implement the same logic in a C / C++ function. For reasons I don't want/need to go into I can't simply issue a query to oracle to get the new date. Does anyone know of a simple and reliable way of a...
Method **AddMonths\_OracleStyle** does what you need. Perhaps you would want to replace IsLeapYear and GetDaysInMonth to some librarian methods. ``` #include <ctime> #include <assert.h> bool IsLeapYear(int year) { if (year % 4 != 0) return false; if (year % 400 == 0) return true; if (year % 100 == 0) re...
424,016
<p>I have a WPF App which is grinding to a halt after running out of memory...<br> It is basically a TreeView displaying nodes, which are instances of Linq To Sql OR Generated class ICTemplates.Segment. There around 20 tables indirectly linked via associations to this class in the OR designer. </p> <pre><code>&lt;Tr...
[ { "answer_id": 426092, "author": "Noah", "author_id": 47496, "author_profile": "https://Stackoverflow.com/users/47496", "pm_score": 0, "selected": false, "text": "<p>Have you tried using a global DataContext instead of one for each element?</p>\n\n<p>Creating all of the DataContext's eac...
2009/01/08
[ "https://Stackoverflow.com/questions/424016", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1695/" ]
I have a WPF App which is grinding to a halt after running out of memory... It is basically a TreeView displaying nodes, which are instances of Linq To Sql OR Generated class ICTemplates.Segment. There around 20 tables indirectly linked via associations to this class in the OR designer. ``` <TreeView Grid.Column="...
**The issue seems to be the creation of multiple S1DataContext objects** as **Sirocco** referred to. I tried the using statement to force a Dispose and make it eligible for collection. However it resulted in an ObjectDisposedException that I can't make sense of. 1. The control goes from the line that sets the data con...
424,018
<p>I'm trying to add a custom property which is a guid, but it gives me this error:</p> <blockquote> <p>System.InvalidCastException: Failed to convert parameter value from a String to a Guid. ---> System.InvalidCastException: Invalid cast from 'System.String' to 'System.Guid'.</p> </blockquote> <p>I speci...
[ { "answer_id": 424171, "author": "Claus Thomsen", "author_id": 15555, "author_profile": "https://Stackoverflow.com/users/15555", "pm_score": 6, "selected": true, "text": "<p>For your example the following should work:</p>\n\n<pre><code>&lt;parameter&gt;\n&lt;parameterName value=\"@Oid\" ...
2009/01/08
[ "https://Stackoverflow.com/questions/424018", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11619/" ]
I'm trying to add a custom property which is a guid, but it gives me this error: > > System.InvalidCastException: Failed to > convert parameter value from a String > to a Guid. ---> > System.InvalidCastException: Invalid > cast from 'System.String' to > 'System.Guid'. > > > I specify this in the config: ```...
For your example the following should work: ``` <parameter> <parameterName value="@Oid" /> <dbType value="Guid" /> <layout type="log4net.Layout.RawPropertyLayout"> <key value="Id" /> </layout> </parameter> ``` Important is you rename @id to something else otherwise you will get Null values in database even if you tr...
424,020
<p>I have the following RegEx</p> <pre><code>id=(.*?) | id="(.*?)" </code></pre> <p>The reason for this is I am trying to replace Ids from the browsers DOM using JavaScript. IE, however strips quotes from element atributes as it appears not to require them in the DOM</p> <p>The problem I have is that the backreferer...
[ { "answer_id": 424171, "author": "Claus Thomsen", "author_id": 15555, "author_profile": "https://Stackoverflow.com/users/15555", "pm_score": 6, "selected": true, "text": "<p>For your example the following should work:</p>\n\n<pre><code>&lt;parameter&gt;\n&lt;parameterName value=\"@Oid\" ...
2009/01/08
[ "https://Stackoverflow.com/questions/424020", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32021/" ]
I have the following RegEx ``` id=(.*?) | id="(.*?)" ``` The reason for this is I am trying to replace Ids from the browsers DOM using JavaScript. IE, however strips quotes from element atributes as it appears not to require them in the DOM The problem I have is that the backrefererences from each alternate stateme...
For your example the following should work: ``` <parameter> <parameterName value="@Oid" /> <dbType value="Guid" /> <layout type="log4net.Layout.RawPropertyLayout"> <key value="Id" /> </layout> </parameter> ``` Important is you rename @id to something else otherwise you will get Null values in database even if you tr...
424,025
<p>In my struts 2.0.12 application I'm trying to use s:datetimepicker but it does not render.</p> <p>Firebug error: dojo is not defined on dojo.require("dojo.widget.DatePicker");</p> <p>My jsp page </p> <pre><code> &lt;%@taglib prefix="s" uri="/struts-tags" %&gt; . . &lt;html xmlns="http://www.w3.org/1999/xhtml"&...
[ { "answer_id": 440622, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 1, "selected": false, "text": "<p>For use datetimepicker you need to use struts-dojo-tags, this came into de struts-dojo-plugin.jar of struts library, now u ...
2009/01/08
[ "https://Stackoverflow.com/questions/424025", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
In my struts 2.0.12 application I'm trying to use s:datetimepicker but it does not render. Firebug error: dojo is not defined on dojo.require("dojo.widget.DatePicker"); My jsp page ``` <%@taglib prefix="s" uri="/struts-tags" %> . . <html xmlns="http://www.w3.org/1999/xhtml"> <head> <s:head theme="ajax" debu...
For use datetimepicker you need to use struts-dojo-tags, this came into de struts-dojo-plugin.jar of struts library, now u have the tags, loaded whit and put inside head tag to visualize the date time picker.... ... maybe this can help you....
424,029
<p>html Tidy gives this as output for some reason:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-16"?&gt; &lt;?xml version="1.0" encoding="utf-16"?&gt; &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/x...
[ { "answer_id": 424047, "author": "Hank Gay", "author_id": 4203, "author_profile": "https://Stackoverflow.com/users/4203", "pm_score": 2, "selected": false, "text": "<p>Yes. Create a template that matches the first child element you want to accept and then have it just output the content ...
2009/01/08
[ "https://Stackoverflow.com/questions/424029", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30759/" ]
html Tidy gives this as output for some reason: ``` <?xml version="1.0" encoding="utf-16"?> <?xml version="1.0" encoding="utf-16"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta name="generator...
I think that it would be better to fix the original problem. Do you use the HTML Tidy library? Try setting [output-encoding](http://tidy.sourceforge.net/docs/quickref.html#output-encoding) to utf8 and [add-xml-decl](http://tidy.sourceforge.net/docs/quickref.html#add-xml-decl) to false. The DOCTYPE node can be suppres...
424,037
<p>I wanted to set <code>.htaccess</code> to rewrite:</p> <pre><code>example.com/bla/info/ </code></pre> <p>to</p> <pre><code>example.com/info/index.php?q=bla example.com/bla/info/txt/ </code></pre> <p>to</p> <pre><code>example.com/info/index.php?q=bla&amp;t=txt </code></pre> <p>I wanted the browser still to dis...
[ { "answer_id": 424049, "author": "SmacL", "author_id": 22564, "author_profile": "https://Stackoverflow.com/users/22564", "pm_score": 3, "selected": false, "text": "<p>Pick up a copy of <a href=\"http://www.binary-soft.com/dll2lib/dll2lib.htm\" rel=\"nofollow noreferrer\">DLL to Lib</a> (...
2009/01/08
[ "https://Stackoverflow.com/questions/424037", "https://Stackoverflow.com", "https://Stackoverflow.com/users/52730/" ]
I wanted to set `.htaccess` to rewrite: ``` example.com/bla/info/ ``` to ``` example.com/info/index.php?q=bla example.com/bla/info/txt/ ``` to ``` example.com/info/index.php?q=bla&t=txt ``` I wanted the browser still to display: ``` example.com/bla/info/txt/ ``` I didn't want rewrite in the level 2 rewrite...
Pick up a copy of [DLL to Lib](http://www.binary-soft.com/dll2lib/dll2lib.htm) (Edit: If you can't find a cheaper option)
424,071
<p>How can I print a plain list of all files that were part of a given commit?</p> <p>Although the following lists the files, it also includes unwanted diff information for each:</p> <pre><code>git show a303aa90779efdd2f6b9d90693e2cbbbe4613c1d </code></pre>
[ { "answer_id": 424084, "author": "Hank Gay", "author_id": 4203, "author_profile": "https://Stackoverflow.com/users/4203", "pm_score": 8, "selected": false, "text": "<p>I'll just assume that <a href=\"https://git-scm.com/docs/gitk\" rel=\"noreferrer\"><code>gitk</code></a> is not desired ...
2009/01/08
[ "https://Stackoverflow.com/questions/424071", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11123/" ]
How can I print a plain list of all files that were part of a given commit? Although the following lists the files, it also includes unwanted diff information for each: ``` git show a303aa90779efdd2f6b9d90693e2cbbbe4613c1d ```
**Preferred Way** (because it's a *plumbing* command; meant to be programmatic): ``` $ git diff-tree --no-commit-id --name-only -r bd61ad98 index.html javascript/application.js javascript/ie6.js ``` **Another Way** (less preferred for scripts, because it's a *porcelain* command; meant to be user-facing) ``` $ git s...
424,092
<p>I have a MySQL Left Join problem.</p> <p>I have three tables which I'm trying to join.</p> <p>A person table:</p> <pre>CREATE TABLE person ( id INT NOT NULL AUTO_INCREMENT, type ENUM('student', 'staff', 'guardian') NOT NULL, first_name CHAR(30) NOT NULL, last_name CHAR(30) NOT NULL, gender ENU...
[ { "answer_id": 424117, "author": "Jacob Schoen", "author_id": 3340, "author_profile": "https://Stackoverflow.com/users/3340", "pm_score": 0, "selected": false, "text": "<p>Would that not be a left outer join you are looking for? I may have my terminology mixed up? Would not be the first ...
2009/01/08
[ "https://Stackoverflow.com/questions/424092", "https://Stackoverflow.com", "https://Stackoverflow.com/users/52116/" ]
I have a MySQL Left Join problem. I have three tables which I'm trying to join. A person table: ``` CREATE TABLE person ( id INT NOT NULL AUTO_INCREMENT, type ENUM('student', 'staff', 'guardian') NOT NULL, first_name CHAR(30) NOT NULL, last_name CHAR(30) NOT NULL, gender ENUM('m', 'f') NOT NULL, ...
What you are doing is fine, you just missed off the group by clause ``` SELECT p.first_name, p.last_name, COUNT(i.student) FROM person p, student s LEFT JOIN incident i ON s.id = i.student WHERE p.id = s.person_id AND s.year_group LIKE "%Year 9%" GROUP BY p.first_name, p.last_name; ``` Here's some test data ``` i...
424,096
<p>We have three tables A, B, C.</p> <p><strong>Columns</strong></p> <p>A => id, x</p> <p>B => id, y </p> <p>C => A.id, B.id</p> <p>For every row in A there will be a row in B. To relate A and B we are using C (we cannot change the table design). We have to persist information in one transaction. Is there a way to...
[ { "answer_id": 424117, "author": "Jacob Schoen", "author_id": 3340, "author_profile": "https://Stackoverflow.com/users/3340", "pm_score": 0, "selected": false, "text": "<p>Would that not be a left outer join you are looking for? I may have my terminology mixed up? Would not be the first ...
2009/01/08
[ "https://Stackoverflow.com/questions/424096", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19970/" ]
We have three tables A, B, C. **Columns** A => id, x B => id, y C => A.id, B.id For every row in A there will be a row in B. To relate A and B we are using C (we cannot change the table design). We have to persist information in one transaction. Is there a way to do it using NHibernate?
What you are doing is fine, you just missed off the group by clause ``` SELECT p.first_name, p.last_name, COUNT(i.student) FROM person p, student s LEFT JOIN incident i ON s.id = i.student WHERE p.id = s.person_id AND s.year_group LIKE "%Year 9%" GROUP BY p.first_name, p.last_name; ``` Here's some test data ``` i...
424,104
<h3>Disclaimer</h3> <p>Yes, I am fully aware that what I am asking about is totally stupid and that anyone who would wish to try such a thing in production code should be fired and/or shot. I'm mainly looking to see if <em>can</em> be done.</p> <p>Now that that's out of the way, is there any way to access private clas...
[ { "answer_id": 424114, "author": "kdgregory", "author_id": 42126, "author_profile": "https://Stackoverflow.com/users/42126", "pm_score": 2, "selected": false, "text": "<p>If you know how your C++ compiler mangles names, yes.</p>\n\n<p>Unless, I suppose, it's a virtual function. But then,...
2009/01/08
[ "https://Stackoverflow.com/questions/424104", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2147/" ]
### Disclaimer Yes, I am fully aware that what I am asking about is totally stupid and that anyone who would wish to try such a thing in production code should be fired and/or shot. I'm mainly looking to see if *can* be done. Now that that's out of the way, is there any way to access private class members in C++ from...
If the class contains any template member functions you can specialize that member function to suit your needs. Even if the original developer didn't think of it. safe.h ``` class safe { int money; public: safe() : money(1000000) { } template <typename T> void backdoor() { /...
424,124
<p>I have an ASP.NET server control which relies on JQuery for certain functionality. I've tried to add as a webresource.</p> <p>My problem is my method of including the jquery file adds it to the body, or the form to be exact:</p> <pre><code>this.Page.ClientScript.RegisterClientScriptInclude(...) </code></pre> <p>T...
[ { "answer_id": 424448, "author": "Crescent Fresh", "author_id": 45433, "author_profile": "https://Stackoverflow.com/users/45433", "pm_score": 3, "selected": false, "text": "<p>If you want to package up jQuery and embed it inside your own server control you should serve it to the client u...
2009/01/08
[ "https://Stackoverflow.com/questions/424124", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21574/" ]
I have an ASP.NET server control which relies on JQuery for certain functionality. I've tried to add as a webresource. My problem is my method of including the jquery file adds it to the body, or the form to be exact: ``` this.Page.ClientScript.RegisterClientScriptInclude(...) ``` The alternative to this is to add ...
**Update:** A far easier way of doing it is to simply add the script tag dynamically, in your script and point to the google code hosting. e.g. ``` function include_dom(script_filename) { var html_doc = document.getElementsByTagName('head').item(0); var js = document.createElement('script'); js.setAttribu...
424,148
<p>I want to create the following element:</p> <pre><code>&lt;exercises xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xsi:noNamespaceSchemaLocation=&quot;mySchema.xsd&quot;&gt; </code></pre> <p>If I use something like this:</p> <pre><code>&lt;xsl:element name=&quot;excercises&quot;&gt; &lt;xsl:attribu...
[ { "answer_id": 424362, "author": "Kev", "author_id": 419, "author_profile": "https://Stackoverflow.com/users/419", "pm_score": 4, "selected": true, "text": "<p>Try the following instead:</p>\n\n<pre><code>&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\n&lt;xsl:stylesheet version=\"1.0\...
2009/01/08
[ "https://Stackoverflow.com/questions/424148", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30759/" ]
I want to create the following element: ``` <exercises xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="mySchema.xsd"> ``` If I use something like this: ``` <xsl:element name="excercises"> <xsl:attribute name="xmlns:xsi" namespace="http://www.w3.org/2001/XMLSchema-instance"/> ``...
Try the following instead: ``` <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <xsl:output method="xml" indent="yes"/> <xsl:template match="@* | node()"> <xsl:apply-t...
424,183
<p>double TotalMinute=300.0 double TotalMinutesAdded=1378.0</p> <pre><code> double TotalMinute=300.0 double TotalMinutesAdded=1378.0 foreach(DataRow dr in ds.Tables[0].Rows) { //Add The above Timings to each Row's 2nd Column DateTime correctDate=Convert.ToDateT...
[ { "answer_id": 424189, "author": "Janis Veinbergs", "author_id": 50173, "author_profile": "https://Stackoverflow.com/users/50173", "pm_score": 4, "selected": false, "text": "<p>DateTiem Add* functions are not supposed to change current DateTime value. They RETURN the new Value.</p>\n\n<p...
2009/01/08
[ "https://Stackoverflow.com/questions/424183", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
double TotalMinute=300.0 double TotalMinutesAdded=1378.0 ``` double TotalMinute=300.0 double TotalMinutesAdded=1378.0 foreach(DataRow dr in ds.Tables[0].Rows) { //Add The above Timings to each Row's 2nd Column DateTime correctDate=Convert.ToDateTime(dr[2]); ...
As mentioned, due to `DateTime` objects being immutable you have to reassign the variable. However, a point to note is that you can chain the manipulations as so: ``` correctDate = correctDate.AddMinutes(TotalMinute) .AddMinutes(TotalMinutesAdded); ```
424,192
<p>I would like to provide a horizontal scroll to a textarea in my HTML page. The scroll should appear without wrapping, if I type a long line without a line break. A few friends suggested using overflow-y CSS attribute, which did not work for me. The browsers that I use are IE 6+ and Mozilla 3+.</p>
[ { "answer_id": 424211, "author": "Filip Ekberg", "author_id": 39106, "author_profile": "https://Stackoverflow.com/users/39106", "pm_score": 3, "selected": false, "text": "<p>Try these:</p>\n\n<pre><code>overflow: scroll; \noverflow-y: scroll; \noverflow-x: scroll; \noverflow:-moz-scrollb...
2009/01/08
[ "https://Stackoverflow.com/questions/424192", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35392/" ]
I would like to provide a horizontal scroll to a textarea in my HTML page. The scroll should appear without wrapping, if I type a long line without a line break. A few friends suggested using overflow-y CSS attribute, which did not work for me. The browsers that I use are IE 6+ and Mozilla 3+.
To set no wrapping, you would use: ``` white-space: nowrap; ``` For other values: <https://developer.mozilla.org/en-US/docs/Web/CSS/white-space> NOTE: However the depreciated `wrap="off"` seems to be the only way for legacy browser support. Though it isn't HTML 5 compliant, it's still my preference if you're target...
424,212
<p>Is there any difference in the performance of the following three SQL statements?</p> <pre><code>SELECT * FROM tableA WHERE EXISTS (SELECT * FROM tableB WHERE tableA.x = tableB.y) SELECT * FROM tableA WHERE EXISTS (SELECT y FROM tableB WHERE tableA.x = tableB.y) SELECT * FROM tableA WHERE EXISTS (SELECT 1 FROM ta...
[ { "answer_id": 424246, "author": "DonOctavioDelFlores", "author_id": 22694, "author_profile": "https://Stackoverflow.com/users/22694", "pm_score": -1, "selected": false, "text": "<p>#3 Should be the best one, as you don´t need the returned data anyway. Bringing the fields will only add a...
2009/01/08
[ "https://Stackoverflow.com/questions/424212", "https://Stackoverflow.com", "https://Stackoverflow.com/users/52837/" ]
Is there any difference in the performance of the following three SQL statements? ``` SELECT * FROM tableA WHERE EXISTS (SELECT * FROM tableB WHERE tableA.x = tableB.y) SELECT * FROM tableA WHERE EXISTS (SELECT y FROM tableB WHERE tableA.x = tableB.y) SELECT * FROM tableA WHERE EXISTS (SELECT 1 FROM tableB WHERE tab...
The truth about the EXISTS clause is that the SELECT clause is not evaluated in an EXISTS clause - you could try: ``` SELECT * FROM tableA WHERE EXISTS (SELECT 1/0 FROM tableB WHERE tableA.x = tableB.y) ``` ...and should expect a divide by zero error, but you won't because it'...
424,220
<p>You may have noticed that we now show an edit summary on Community Wiki posts:</p> <blockquote> <p>community wiki<br> 220 revisions, 48 users</p> </blockquote> <p>I'd like to also show the user who "most owns" the final content displayed on the page, as a percentage of the remaining text:</p> <blockquote> <...
[ { "answer_id": 424247, "author": "Toon Krijthe", "author_id": 18061, "author_profile": "https://Stackoverflow.com/users/18061", "pm_score": 0, "selected": false, "text": "<p>Not sure if it is possible, but you could count the number of characters added.</p>\n\n<p>Example:</p>\n\n<ul>\n<l...
2009/01/08
[ "https://Stackoverflow.com/questions/424220", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1/" ]
You may have noticed that we now show an edit summary on Community Wiki posts: > > community wiki > > 220 revisions, 48 users > > > I'd like to also show the user who "most owns" the final content displayed on the page, as a percentage of the remaining text: > > community wiki > > 220 revisions, 48 user...
Saw your tweet earlier. From the display of the 327973 link, it appears you already have a single-step diff in place. Based on that, I'll focus on the multi-edit composition: 1. A, the original poster owns 100% of the post. 2. When B, a second poster, makes edits such that e.g. 90% of the text is unchanged, the owners...
424,264
<p>I am using Jfreechart. I have the following code:</p> <pre><code>TimeSeries t1 = new TimeSeries("EUR/GBP"); t1.add(new TimeSeriesDataItem....); </code></pre> <p>But my SQL query gives date in <code>String</code> format &amp; value in <code>Double</code>. I want to use <code>TimeSeriesDataItem</code>. Please let me...
[ { "answer_id": 591611, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 1, "selected": false, "text": "<p>1) convert your date from String to java.util.Date</p>\n\n<p>2) wrap this Date instance using one of the classes extending ...
2009/01/08
[ "https://Stackoverflow.com/questions/424264", "https://Stackoverflow.com", "https://Stackoverflow.com/users/48094/" ]
I am using Jfreechart. I have the following code: ``` TimeSeries t1 = new TimeSeries("EUR/GBP"); t1.add(new TimeSeriesDataItem....); ``` But my SQL query gives date in `String` format & value in `Double`. I want to use `TimeSeriesDataItem`. Please let me know how to convert my String into `TimeSeriesDataItem`. Pleas...
1) convert your date from String to java.util.Date 2) wrap this Date instance using one of the classes extending RegularTimePeriod. eg. RegularTimePeriod p = new Day (myDate) 3) TimeSeriesDataItem t = new TimeSeriesDataItem (p, a\_numeric\_value)
424,331
<p>The VB trick to get the path of the current temporary directory:</p> <pre><code>Private Declare Function GetTempPath Lib "kernel32" Alias "GetTempPathA" (ByVal nBufferLength As Long, ByVal lpBuffer As String) As Long </code></pre> <p>fails in VBScript. So?</p>
[ { "answer_id": 424332, "author": "Fabien", "author_id": 21132, "author_profile": "https://Stackoverflow.com/users/21132", "pm_score": 7, "selected": true, "text": "<pre><code>WScript.CreateObject(\"Scripting.FileSystemObject\").GetSpecialFolder(2)\n</code></pre>\n\n<p>It took me a while ...
2009/01/08
[ "https://Stackoverflow.com/questions/424331", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21132/" ]
The VB trick to get the path of the current temporary directory: ``` Private Declare Function GetTempPath Lib "kernel32" Alias "GetTempPathA" (ByVal nBufferLength As Long, ByVal lpBuffer As String) As Long ``` fails in VBScript. So?
``` WScript.CreateObject("Scripting.FileSystemObject").GetSpecialFolder(2) ``` It took me a while to find it on Google. So for the next one looking for the same as me...
424,348
<p>I have an xml file like this: </p> <pre><code>&lt;root&gt; &lt;item&gt; &lt;name&gt;one&lt;/name&gt; &lt;status&gt;good&lt;/status&gt; &lt;/item&gt; &lt;item&gt; &lt;name&gt;two&lt;/name&gt; &lt;status&gt;good&lt;/status&gt; &lt;/item&gt; &lt;item&gt; &lt;...
[ { "answer_id": 424387, "author": "gizmo", "author_id": 9396, "author_profile": "https://Stackoverflow.com/users/9396", "pm_score": 0, "selected": false, "text": "<p>It depends about your xslt engine. If you're using xslt 1.0 without any extension, then your approach is certainly the best...
2009/01/08
[ "https://Stackoverflow.com/questions/424348", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7211/" ]
I have an xml file like this: ``` <root> <item> <name>one</name> <status>good</status> </item> <item> <name>two</name> <status>good</status> </item> <item> <name>three</name> <status>bad</status> </item> <item> <name>four</name> ...
Muench to the rescue! ``` <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" indent="yes" encoding="UTF-8"/> <xsl:key name="muench" match="/root/item/status" use="."/> <xsl:template match="/"> <root> ...
424,354
<p>I'm trying to output a sentence containing 4 variables, with their values emboldened using the following code:</p> <pre><code>&lt;mx:Text width="100%" y="307"&gt; &lt;mx:htmlText&gt; &lt;![CDATA[Showing data from &lt;b&gt;{labelStartTime.text} {labelStartDate.text}&lt;/b&gt; to &lt;b&gt;{labelEndTime.te...
[ { "answer_id": 424387, "author": "gizmo", "author_id": 9396, "author_profile": "https://Stackoverflow.com/users/9396", "pm_score": 0, "selected": false, "text": "<p>It depends about your xslt engine. If you're using xslt 1.0 without any extension, then your approach is certainly the best...
2009/01/08
[ "https://Stackoverflow.com/questions/424354", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4742/" ]
I'm trying to output a sentence containing 4 variables, with their values emboldened using the following code: ``` <mx:Text width="100%" y="307"> <mx:htmlText> <![CDATA[Showing data from <b>{labelStartTime.text} {labelStartDate.text}</b> to <b>{labelEndTime.text} {labelEndDate.text}</b>]]> </mx:htmlTex...
Muench to the rescue! ``` <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" indent="yes" encoding="UTF-8"/> <xsl:key name="muench" match="/root/item/status" use="."/> <xsl:template match="/"> <root> ...
424,358
<p>How do I increase the default timeout to larger than 1 minute on a WCF service?</p>
[ { "answer_id": 424386, "author": "icelava", "author_id": 2663, "author_profile": "https://Stackoverflow.com/users/2663", "pm_score": 9, "selected": true, "text": "<p>Are you referring to the server side or the client side?</p>\n\n<p>For a client, you would want to adjust the <strong>send...
2009/01/08
[ "https://Stackoverflow.com/questions/424358", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39677/" ]
How do I increase the default timeout to larger than 1 minute on a WCF service?
Are you referring to the server side or the client side? For a client, you would want to adjust the **sendTimeout** attribute of a binding element. For a service, you would want to adjust the **receiveTimeout** attribute of a binding elemnent. ``` <system.serviceModel> <bindings> <netTcpBinding> <binding ...
424,361
<p>When a user request comes in, I can use Context.Request.UserHostAddress to get the user's IP address. How can I get the IP address of the website/server at runtime? I have some reporting code that can be used by multiple websites on the same server, and each website uses a different IP address. So I need to be able ...
[ { "answer_id": 424367, "author": "alex", "author_id": 50564, "author_profile": "https://Stackoverflow.com/users/50564", "pm_score": 4, "selected": false, "text": "<p>System.Net.Dns.GetHostAddresses</p>\n\n<p>by the way, you must pass in as an argument the name of the host, so perhaps try...
2009/01/08
[ "https://Stackoverflow.com/questions/424361", "https://Stackoverflow.com", "https://Stackoverflow.com/users/43722/" ]
When a user request comes in, I can use Context.Request.UserHostAddress to get the user's IP address. How can I get the IP address of the website/server at runtime? I have some reporting code that can be used by multiple websites on the same server, and each website uses a different IP address. So I need to be able to ...
Thanks Alex, your answer put me on the right path. Here is the code to do what I am looking for: VB.NET: ``` System.Net.Dns.GetHostAddresses(Request.Url.Host)(0).ToString() ``` or ``` System.Net.Dns.GetHostEntry(Request.Url.Host).AddressList(0).ToString() ```
424,366
<p>I have the following enumeration:</p> <pre><code>public enum AuthenticationMethod { FORMS = 1, WINDOWSAUTHENTICATION = 2, SINGLESIGNON = 3 } </code></pre> <p>The problem however is that I need the word "FORMS" when I ask for AuthenticationMethod.FORMS and not the id 1.</p> <p>I have found the followin...
[ { "answer_id": 424380, "author": "Charles Bretana", "author_id": 32632, "author_profile": "https://Stackoverflow.com/users/32632", "pm_score": 8, "selected": false, "text": "<p>Use method</p>\n\n<pre><code>Enum.GetName(Type MyEnumType, object enumvariable) \n</code></pre>\n\n<p>as in (...
2009/01/08
[ "https://Stackoverflow.com/questions/424366", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29964/" ]
I have the following enumeration: ``` public enum AuthenticationMethod { FORMS = 1, WINDOWSAUTHENTICATION = 2, SINGLESIGNON = 3 } ``` The problem however is that I need the word "FORMS" when I ask for AuthenticationMethod.FORMS and not the id 1. I have found the following solution for this problem ([lin...
Try [type-safe-enum](http://www.javacamp.org/designPattern/enum.html) pattern. ``` public sealed class AuthenticationMethod { private readonly String name; private readonly int value; public static readonly AuthenticationMethod FORMS = new AuthenticationMethod (1, "FORMS"); public static readonly Aut...
424,368
<p>How would you open a file (that has a known file/app association in the registry) into a "running instance" of the application it's supposed to open in? An example would be, I have Excel open and I click on an XLS file.....the file opens up in the current Excel instance. I want to do this for a custom application......
[ { "answer_id": 424390, "author": "Joel Martinez", "author_id": 5416, "author_profile": "https://Stackoverflow.com/users/5416", "pm_score": 2, "selected": false, "text": "<p>The way I'd do it is like this:</p>\n\n<ol>\n<li>First thing in the main method, check the process list for an exis...
2009/01/08
[ "https://Stackoverflow.com/questions/424368", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4398/" ]
How would you open a file (that has a known file/app association in the registry) into a "running instance" of the application it's supposed to open in? An example would be, I have Excel open and I click on an XLS file.....the file opens up in the current Excel instance. I want to do this for a custom application...how...
What you want to do is inherit a class from [WindowsFormsApplicationBase](http://msdn.microsoft.com/en-us/library/microsoft.visualbasic.applicationservices.windowsformsapplicationbase.aspx), setting the protected [IsSingleInstance](http://msdn.microsoft.com/en-us/library/microsoft.visualbasic.applicationservices.window...
424,375
<p>This is an example of RegisterClientScriptBlock </p> <pre><code> Page.ClientScript.RegisterClientScriptBlock(Me.GetType, "key","scriptblock", True) </code></pre> <p>Why do the method needs the type as the first parameter ? </p> <p>Thanks.</p>
[ { "answer_id": 424428, "author": "nshaw", "author_id": 29426, "author_profile": "https://Stackoverflow.com/users/29426", "pm_score": 4, "selected": true, "text": "<p>From the MSDN docs: \"A client script is uniquely identified by its key and its type. Scripts with the same key and type a...
2009/01/08
[ "https://Stackoverflow.com/questions/424375", "https://Stackoverflow.com", "https://Stackoverflow.com/users/41968/" ]
This is an example of RegisterClientScriptBlock ``` Page.ClientScript.RegisterClientScriptBlock(Me.GetType, "key","scriptblock", True) ``` Why do the method needs the type as the first parameter ? Thanks.
From the MSDN docs: "A client script is uniquely identified by its key and its type. Scripts with the same key and type are considered duplicates." Basically it gives you an additional way to uniquely identify your scripts. You could have the same key value across different types of controls.
424,396
<p>All of a sudden our VB ASP.Net 2.0 WebSite Project started complaining that Exception was not defined.</p> <p>I have discovered that if I add "Imports System" to the header, or explicitly use System.Exception that it works, but this error permeates a lot of other System descendants like the Data namespace, and the ...
[ { "answer_id": 424406, "author": "mmx", "author_id": 33708, "author_profile": "https://Stackoverflow.com/users/33708", "pm_score": 2, "selected": false, "text": "<p>Alter the Web.config file and add the namespaces you want under the <code>&lt;pages&gt;</code> tag in <code>&lt;system.web&...
2009/01/08
[ "https://Stackoverflow.com/questions/424396", "https://Stackoverflow.com", "https://Stackoverflow.com/users/52935/" ]
All of a sudden our VB ASP.Net 2.0 WebSite Project started complaining that Exception was not defined. I have discovered that if I add "Imports System" to the header, or explicitly use System.Exception that it works, but this error permeates a lot of other System descendants like the Data namespace, and the DateTime o...
Alter the Web.config file and add the namespaces you want under the `<pages>` tag in `<system.web>`: ``` <pages> <namespaces> <add namespace="System"/> <add namespace="System.Data"/> <add namespace="System.Web"/> <add namespace="System.Web.UI"/> <add namespace="System.Xml"/>...
424,412
<p>I am running into the same problem as in this question:</p> <p><a href="https://stackoverflow.com/questions/22879/how-do-you-prevent-leading-zeros-from-being-stripped-when-importing-an-excel-doc">How do you prevent leading zeros from being stripped when importing an excel doc using c#</a></p> <p>But I am not sure ...
[ { "answer_id": 424432, "author": "Dan Williams", "author_id": 4230, "author_profile": "https://Stackoverflow.com/users/4230", "pm_score": 1, "selected": false, "text": "<p>add a ' (single quote) to the front of the string.</p>\n" }, { "answer_id": 424435, "author": "Joe Casad...
2009/01/08
[ "https://Stackoverflow.com/questions/424412", "https://Stackoverflow.com", "https://Stackoverflow.com/users/33690/" ]
I am running into the same problem as in this question: [How do you prevent leading zeros from being stripped when importing an excel doc using c#](https://stackoverflow.com/questions/22879/how-do-you-prevent-leading-zeros-from-being-stripped-when-importing-an-excel-doc) But I am not sure if that is the best solution...
I don't know the output of your XSL transformation: I will assume it's the xml format for Excel. Trying to reverse the process I wrote three numbers (007) in an Excel sheet: once as number, once as text and once as number but formatted to show 3 digits padded with zeros. Then I saved it as xml and looked at it. Here is...
424,443
<p>When working an interactive bash session, one aspect from the Windows shell I miss is the <kbd>F8</kbd> key where you start typing a command, hit <kbd>F8</kbd> and the shell finds the most recent command entered in history that matches what you have typed so far. e.g.</p> <pre><code>me@Ubntu07:~&gt;cd /home/jb&lt;F...
[ { "answer_id": 424453, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 5, "selected": true, "text": "<p>Hit <kbd>Ctrl</kbd>-<kbd>R</kbd> before you start typing.</p>\n\n<p>(There may well be another version which finds com...
2009/01/08
[ "https://Stackoverflow.com/questions/424443", "https://Stackoverflow.com", "https://Stackoverflow.com/users/43786/" ]
When working an interactive bash session, one aspect from the Windows shell I miss is the `F8` key where you start typing a command, hit `F8` and the shell finds the most recent command entered in history that matches what you have typed so far. e.g. ``` me@Ubntu07:~>cd /home/jb<F8 Key Here> ``` brings up my prior c...
Hit `Ctrl`-`R` before you start typing. (There may well be another version which finds commands based on what's already been typed - I wouldn't know, as `Ctrl`-`R` has always been good enough for me :) Pressing `Ctrl`-`R` again shows the next match etc.
424,454
<p>I need to check a string to see if any word in it has multiple occurences. So basically I will accept:</p> <p>"google makes love"</p> <p>but I don't accept:</p> <p>"google makes google love" or "google makes love love google" etc.</p> <p>Any ideas? Really don't know any way to approach this, any help would be gr...
[ { "answer_id": 424473, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 1, "selected": false, "text": "<pre><code>function Accept($str)\n{\n $words = explode(\" \", trim($str));\n $len = count($words);\n for ($i = 0; $i ...
2009/01/08
[ "https://Stackoverflow.com/questions/424454", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26823/" ]
I need to check a string to see if any word in it has multiple occurences. So basically I will accept: "google makes love" but I don't accept: "google makes google love" or "google makes love love google" etc. Any ideas? Really don't know any way to approach this, any help would be greatly appreciated.
Based on Wicked Flea code: ``` function single_use_of_words($str) { $words = explode(' ', trim($str)); //Trim to prevent any extra blank if (count(array_unique($words)) == count($words)) { return true; //Same amount of words } return false; } ```
424,455
<p>This is my first post and I'm quite a novice on C++ and compiling in general.</p> <p>I'm compiling a program which requires some graphs to be drawn. The program create a <em>.dat file and then i should open gnuplot and write plot '</em>.dat'. That's fine.</p> <p>Is there a way to make gnuplot automatically open an...
[ { "answer_id": 424471, "author": "ConcernedOfTunbridgeWells", "author_id": 15401, "author_profile": "https://Stackoverflow.com/users/15401", "pm_score": 1, "selected": false, "text": "<p>Yes you can. You can make a file that has the commands you would otherwise type in to set up the plo...
2009/01/08
[ "https://Stackoverflow.com/questions/424455", "https://Stackoverflow.com", "https://Stackoverflow.com/users/52011/" ]
This is my first post and I'm quite a novice on C++ and compiling in general. I'm compiling a program which requires some graphs to be drawn. The program create a *.dat file and then i should open gnuplot and write plot '*.dat'. That's fine. Is there a way to make gnuplot automatically open and show me the plot I nee...
Depending on your OS, you might be able to use [popen().](http://www.opengroup.org/onlinepubs/007908799/xsh/popen.html) This would let you spawn a gnuplot process and just just write to it like any other FILE\*. If you have datapoints to plot, you can pass them inline with the *plot "-" ...* option. Similarly, you may...
424,468
<p>I have added the footer <strong><em>Page x of y</em></strong> to my report, but the PAGE_COUNT doesn't seem to work.</p> <p>Maybe the problem occurs because I have many subreports?</p> <p>I get:</p> <pre><code>Page 1 of 1 Page 2 of 0 Page 3 of 0 Page 4 of 0 </code></pre> <p>Any ideas?</p>
[ { "answer_id": 425018, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 2, "selected": false, "text": "<p>I found the solution.</p>\n\n<p><a href=\"http://jasperforge.org/tracker/index.php?func=detail&amp;aid=2873&amp;group_id=10...
2009/01/08
[ "https://Stackoverflow.com/questions/424468", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I have added the footer ***Page x of y*** to my report, but the PAGE\_COUNT doesn't seem to work. Maybe the problem occurs because I have many subreports? I get: ``` Page 1 of 1 Page 2 of 0 Page 3 of 0 Page 4 of 0 ``` Any ideas?
Well, don't know elder versions but in JasperReports 4.5.1; you can define two text fields both includes `$V{PAGE_NUMBER}` variables. The one which has `EvaluationTime: now` shows current page number; the other one with `EvaluationTime: report` shows the number of total pages. A simple trick but works :)
424,469
<p>I am trying to minify a few files with YUI compressor. However, I seem to be getting an error on 2 lines of code, which prevents compression. The .js file for <a href="http://www.gmarwaha.com/jquery/jcarousellite/" rel="noreferrer">jcarouselLite</a> contains 1 error, and my own code contains the other.</p> <p>I ha...
[ { "answer_id": 424489, "author": "Crescent Fresh", "author_id": 45433, "author_profile": "https://Stackoverflow.com/users/45433", "pm_score": 6, "selected": false, "text": "<p>It's not YUI per se, it's the jcarouselLite js. \"float\" is a reserved word. It needs to be put in quotes. EG:<...
2009/01/08
[ "https://Stackoverflow.com/questions/424469", "https://Stackoverflow.com", "https://Stackoverflow.com/users/47378/" ]
I am trying to minify a few files with YUI compressor. However, I seem to be getting an error on 2 lines of code, which prevents compression. The .js file for [jcarouselLite](http://www.gmarwaha.com/jquery/jcarousellite/) contains 1 error, and my own code contains the other. I have narrowed it down and in both occasio...
It's not YUI per se, it's the jcarouselLite js. "float" is a reserved word. It needs to be put in quotes. EG: ``` li.css({overflow: "hidden", "float": o.vertical ? "none" : "left"}); ``` Similar issue with your own code. YUI is trying its best to compile that js but will refuse/warn you of code like the one you foun...
424,517
<p>I am currently writing some unit tests for a business-logic class that includes validation routines. For example:</p> <pre><code>public User CreateUser(string username, string password, UserDetails details) { ValidateUserDetails(details); ValidateUsername(username); ValidatePassword(password); // c...
[ { "answer_id": 424533, "author": "Mendelt", "author_id": 3320, "author_profile": "https://Stackoverflow.com/users/3320", "pm_score": 5, "selected": true, "text": "<p>Every test should only fail for one reason and only one test should fail for that reason.</p>\n\n<p>This helps a lot with ...
2009/01/08
[ "https://Stackoverflow.com/questions/424517", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30056/" ]
I am currently writing some unit tests for a business-logic class that includes validation routines. For example: ``` public User CreateUser(string username, string password, UserDetails details) { ValidateUserDetails(details); ValidateUsername(username); ValidatePassword(password); // create and retu...
Every test should only fail for one reason and only one test should fail for that reason. This helps a lot with writing a maintainable set of unit tests. I'd write a couple of tests each for ValidateUserDetails, ValidateUsername and ValidateUserPassword. Then you only need to test that CreateUser calls those function...
424,522
<p>I have dates in the format <code>2008-12-23T00:00:00Z</code>. This look a lot like a <a href="http://en.wikipedia.org/wiki/ISO_8601" rel="noreferrer">ISO 8601 format</a> with a Zulu (UTC) timezone. I though the following code would parse it (using <a href="http://commons.apache.org/lang/api-release/org/apache/common...
[ { "answer_id": 424554, "author": "Michael Borgwardt", "author_id": 16883, "author_profile": "https://Stackoverflow.com/users/16883", "pm_score": 3, "selected": true, "text": "<p>Looks like a bug in commons-lang's <code>FastDateFormat</code>. Tell them about it, and you should get a fix e...
2009/01/08
[ "https://Stackoverflow.com/questions/424522", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23704/" ]
I have dates in the format `2008-12-23T00:00:00Z`. This look a lot like a [ISO 8601 format](http://en.wikipedia.org/wiki/ISO_8601) with a Zulu (UTC) timezone. I though the following code would parse it (using [commons-lang](http://commons.apache.org/lang/api-release/org/apache/commons/lang/time/DateFormatUtils.html#ISO...
Looks like a bug in commons-lang's `FastDateFormat`. Tell them about it, and you should get a fix eventually. Till then you could try to preprocess the dates and replace 'Z' with '+00'
424,524
<p>I was working with a online game website. There are some event which call a javascript function and the function have some action with callback. </p> <p>something like this,</p> <pre><code> &lt;input type="button" onclick="changeSomething"/&gt; function changeSomething() { /// some call back, which ch...
[ { "answer_id": 424543, "author": "Diodeus - James MacFarlane", "author_id": 12579, "author_profile": "https://Stackoverflow.com/users/12579", "pm_score": -1, "selected": false, "text": "<p>You can check the source of the click by passing an ID: </p>\n\n<pre><code>&lt;input id=\"good' typ...
2009/01/08
[ "https://Stackoverflow.com/questions/424524", "https://Stackoverflow.com", "https://Stackoverflow.com/users/41968/" ]
I was working with a online game website. There are some event which call a javascript function and the function have some action with callback. something like this, ``` <input type="button" onclick="changeSomething"/> function changeSomething() { /// some call back, which changes something } ``` now...
You will never be able to get 100% protected from any technique you try. It's a losing game. Having said that one way to get closer to your goal is to remove the onclick attribute altogether, and bind your click handler (ie "changeSomething") via javascript: html: ``` <input id="foo" type="button" /> ``` js: ``` ...
424,545
<p>Is it possible to force a column in a SQL Server 2005 table to a certain value regardless of the value used in an insert or update statement is? Basically, there is a bug in an application that I don't have access to that is trying to insert a date of 1/1/0001 into a datetime column. This is producing a SqlDateTim...
[ { "answer_id": 424553, "author": "Charles Bretana", "author_id": 32632, "author_profile": "https://Stackoverflow.com/users/32632", "pm_score": 2, "selected": false, "text": "<p>How is the value being inserted? If it's through a stored proc... you could just modify the Sproc to ignore th...
2009/01/08
[ "https://Stackoverflow.com/questions/424545", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Is it possible to force a column in a SQL Server 2005 table to a certain value regardless of the value used in an insert or update statement is? Basically, there is a bug in an application that I don't have access to that is trying to insert a date of 1/1/0001 into a datetime column. This is producing a SqlDateTime ove...
If it is a third party application then I will assume you don't have access to the Stored Procedure, or logic used to generate and insert that value (it is still worth checking the SPs for the application's database though, to see if you can modify them). As Charles suggested, if you *don't* have access to the source,...
424,560
<p>I have some JSON data from a web service which gives me data like the following</p> <pre><code>blah blah &lt;greek&gt;a&lt;/greek&gt; </code></pre> <p>I need to be able to convert what is inside the greek tags into their symbol equivalent, using javascript.</p> <p>Any ideas?</p>
[ { "answer_id": 424695, "author": "chills42", "author_id": 23855, "author_profile": "https://Stackoverflow.com/users/23855", "pm_score": 0, "selected": false, "text": "<p>This isn't a full solution, but I think this is the basic idea...</p>\n\n<pre><code>// The difference between standard...
2009/01/08
[ "https://Stackoverflow.com/questions/424560", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3193/" ]
I have some JSON data from a web service which gives me data like the following ``` blah blah <greek>a</greek> ``` I need to be able to convert what is inside the greek tags into their symbol equivalent, using javascript. Any ideas?
If this is for the occasional Greek letter and not for Greek Text than the W3C is fine with the following code (<http://www.w3.org/TR/html4/sgml/entities.html#h-24.3>) ``` function greekSymbol(str) { if(str.length == 0) { return ""; } return String.fromCharCode(str.charCodeAt(0) + (913 - 65)) + greekSymbol...
424,561
<p>I have a Java application running on a Websphere application server. When I analyse the system crash core dump file, I get some info like this:</p> <pre><code>ERROR: Symbol file could not be found. Defaulted to export symbols for J9THR23.dll </code></pre> <p>How can I get symbol files for Java?</p> <p>Thanks in...
[ { "answer_id": 425028, "author": "agnul", "author_id": 6069, "author_profile": "https://Stackoverflow.com/users/6069", "pm_score": 2, "selected": false, "text": "<p>It looks like the debugger is looking for PDB files, and as far as I can tell debug information for java application doesn'...
2009/01/08
[ "https://Stackoverflow.com/questions/424561", "https://Stackoverflow.com", "https://Stackoverflow.com/users/52950/" ]
I have a Java application running on a Websphere application server. When I analyse the system crash core dump file, I get some info like this: ``` ERROR: Symbol file could not be found. Defaulted to export symbols for J9THR23.dll ``` How can I get symbol files for Java? Thanks in advance. More details are here:...
You can get a DEBUG build of the JDK at this site. http://download.java.net/jdk6/ Look for jdk-6u12-ea-bin-b03-windows-i586-debug-22*dec*2008.jar, 91.47 MB It includes .pdb files
424,562
<p>I have a grid laid out like so;</p> <pre><code>+---------+---------+ | Image | Details | | is | pane | | here | for data| | | entry | +---------+---------+ | ListView here to | | select data item | | for top two panes | +---------+---------+ </code></pre> <p>This all works well, but I woul...
[ { "answer_id": 425220, "author": "Abe Heidebrecht", "author_id": 9268, "author_profile": "https://Stackoverflow.com/users/9268", "pm_score": 3, "selected": true, "text": "<p>In order to use a DataTemplate, you have to have a control that uses the template to render an object. If you use...
2009/01/08
[ "https://Stackoverflow.com/questions/424562", "https://Stackoverflow.com", "https://Stackoverflow.com/users/26221/" ]
I have a grid laid out like so; ``` +---------+---------+ | Image | Details | | is | pane | | here | for data| | | entry | +---------+---------+ | ListView here to | | select data item | | for top two panes | +---------+---------+ ``` This all works well, but I would now like to change the i...
In order to use a DataTemplate, you have to have a control that uses the template to render an object. If you use a ContentPresenter, you can set its ContentTemplate to be a DataTemplate to whatever you like. Here is how I would do this: ``` <Grid DataContext="..."> <ContentPresenter Content="{Binding SelectedIt...
424,564
<p>if i have data as follows</p> <p>A | 01/01/2008 00:00:00</p> <p>B | 01/01/2008 01:00:00</p> <p>A | 01/01/2008 11:59:00</p> <p>C | 02/01/2008 00:00:00</p> <p>D | 02/01/2008 01:00:00</p> <p>D | 02/01/2008 20:00:00</p> <p>I want to only select the records whose identifiers (A, B, C or D) have occured twice withi...
[ { "answer_id": 424577, "author": "Charles Bretana", "author_id": 32632, "author_profile": "https://Stackoverflow.com/users/32632", "pm_score": 3, "selected": false, "text": "<pre><code> Select Distinct A.Identifer \n From Table A\n Join Table B -- EDIT to eliminate self Joins (to s...
2009/01/08
[ "https://Stackoverflow.com/questions/424564", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
if i have data as follows A | 01/01/2008 00:00:00 B | 01/01/2008 01:00:00 A | 01/01/2008 11:59:00 C | 02/01/2008 00:00:00 D | 02/01/2008 01:00:00 D | 02/01/2008 20:00:00 I want to only select the records whose identifiers (A, B, C or D) have occured twice within a 12 hour period. In this example above this would...
``` Select Distinct A.Identifer From Table A Join Table B -- EDIT to eliminate self Joins (to same row) On A.PrimKey <> B.PrimaryKey And A.Identifer = B.Identifer -- EDIT to fix case where 2 at same time And A.OccurTime >= B.OccurTime And A....
424,586
<p>I would like to create a safe sum extension method that would have the same syntax as the normal Sum.</p> <p>This would be the syntax I'd like to use:</p> <pre><code>result = Allocations.SumIntSafe(all =&gt; all.Cost); </code></pre> <p>I use the <code>Int.Maxvalue</code> as a penalty value in my operations and tw...
[ { "answer_id": 424625, "author": "Joel Coehoorn", "author_id": 3043, "author_profile": "https://Stackoverflow.com/users/3043", "pm_score": 1, "selected": false, "text": "<ol>\n<li>This is by design. Software is supposed to require admin rights for installation (including update/upgrades...
2009/01/08
[ "https://Stackoverflow.com/questions/424586", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4694/" ]
I would like to create a safe sum extension method that would have the same syntax as the normal Sum. This would be the syntax I'd like to use: ``` result = Allocations.SumIntSafe(all => all.Cost); ``` I use the `Int.Maxvalue` as a penalty value in my operations and two `Int.MaxValue` summed together returns a `Int...
1. This is by design. Software is supposed to require admin rights for installation (including update/upgrades). You got away with it in XP because so many people ran as administrator. If you're registering a dll after installation, you're doing something wrong. 2. You should be able to do this without issue, but only ...
424,587
<p>consider the following http request:</p> <pre><code>GET /defects?group-by=priority </code></pre> <p>I would like the returned collection(feed) of defects to be grouped by their priority. i.e. the returned feed consists of defects(resources) and group infromation.</p> <p>I thought about something that will return ...
[ { "answer_id": 428467, "author": "DanSingerman", "author_id": 43965, "author_profile": "https://Stackoverflow.com/users/43965", "pm_score": 4, "selected": true, "text": "<p>I don't think what you are asking for is possible.</p>\n\n<p>If the client is expecting a collection of defects, th...
2009/01/08
[ "https://Stackoverflow.com/questions/424587", "https://Stackoverflow.com", "https://Stackoverflow.com/users/52954/" ]
consider the following http request: ``` GET /defects?group-by=priority ``` I would like the returned collection(feed) of defects to be grouped by their priority. i.e. the returned feed consists of defects(resources) and group infromation. I thought about something that will return the groups' titles and count befo...
I don't think what you are asking for is possible. If the client is expecting a collection of defects, then you can order by priority, but ``` a group of defects != a defect ``` So you can't return a collection of groups. You could add a nasty hack to add attributes to the defect resource for priority and priorit...
424,598
<p>I'm trying to get a handle on the amount of memory overhead associated with a .NET DataTable, and with individual DataRows within a table.<br> In other words, how much more memory does a data table occupy than what would be needed simply to store a properly typed array of each column of data?<br> I guess there will ...
[ { "answer_id": 424641, "author": "Marc Gravell", "author_id": 23354, "author_profile": "https://Stackoverflow.com/users/23354", "pm_score": 6, "selected": true, "text": "<p>Well, don't forget that a <code>DataTable</code> stores 2? 3? versions of the data - original and updated (possibly...
2009/01/08
[ "https://Stackoverflow.com/questions/424598", "https://Stackoverflow.com", "https://Stackoverflow.com/users/52955/" ]
I'm trying to get a handle on the amount of memory overhead associated with a .NET DataTable, and with individual DataRows within a table. In other words, how much more memory does a data table occupy than what would be needed simply to store a properly typed array of each column of data? I guess there will be so...
Well, don't forget that a `DataTable` stores 2? 3? versions of the data - original and updated (possibly one other?). It also has a lot of references since it is cell-based~~, and boxing for any value-types~~. It would be hard to quantify the exact memory... Personally, I very rarely use `DataTable` - typed POCO class...
424,606
<p>I typically use the below function to return the root URL if I ever need this, but thought to ask if jQuery had a "one liner" way to do this ...</p> <pre><code>function getRootURL() { var baseURL = location.href; var rootURL = baseURL.substring(0, baseURL.indexOf('/', 7)); ...
[ { "answer_id": 424643, "author": "meouw", "author_id": 12161, "author_profile": "https://Stackoverflow.com/users/12161", "pm_score": 5, "selected": true, "text": "<p>What about </p>\n\n<pre><code>document.location.hostname\n</code></pre>\n" }, { "answer_id": 424649, "author":...
2009/01/08
[ "https://Stackoverflow.com/questions/424606", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2701/" ]
I typically use the below function to return the root URL if I ever need this, but thought to ask if jQuery had a "one liner" way to do this ... ``` function getRootURL() { var baseURL = location.href; var rootURL = baseURL.substring(0, baseURL.indexOf('/', 7)); // if the r...
What about ``` document.location.hostname ```
424,626
<p>Ok. So I am pretty new a this. I have a datatable that I want to pass to a stored procedure for further manipulation. I have read some stuff on the web and it looks like I should be able to convert the datatable to XML and then pass that to the stored procedure. What am I doning wrong? I have SQL server 2005. The...
[ { "answer_id": 424643, "author": "meouw", "author_id": 12161, "author_profile": "https://Stackoverflow.com/users/12161", "pm_score": 5, "selected": true, "text": "<p>What about </p>\n\n<pre><code>document.location.hostname\n</code></pre>\n" }, { "answer_id": 424649, "author":...
2009/01/08
[ "https://Stackoverflow.com/questions/424626", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14780/" ]
Ok. So I am pretty new a this. I have a datatable that I want to pass to a stored procedure for further manipulation. I have read some stuff on the web and it looks like I should be able to convert the datatable to XML and then pass that to the stored procedure. What am I doning wrong? I have SQL server 2005. The data ...
What about ``` document.location.hostname ```
424,669
<p>I would like to add an operator to a class. I currently have a <code>GetValue()</code> method that I would like to replace with an <code>[]</code> operator.</p> <pre><code>class A { private List&lt;int&gt; values = new List&lt;int&gt;(); public int GetValue(int index) =&gt; values[index]; } </code></pre>
[ { "answer_id": 424677, "author": "Florian Greinacher", "author_id": 31985, "author_profile": "https://Stackoverflow.com/users/31985", "pm_score": 11, "selected": true, "text": "<pre><code>public int this[int key]\n{\n get =&gt; GetValue(key);\n set =&gt; SetValue(key, value);\n}\n<...
2009/01/08
[ "https://Stackoverflow.com/questions/424669", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4066/" ]
I would like to add an operator to a class. I currently have a `GetValue()` method that I would like to replace with an `[]` operator. ``` class A { private List<int> values = new List<int>(); public int GetValue(int index) => values[index]; } ```
``` public int this[int key] { get => GetValue(key); set => SetValue(key, value); } ```
424,673
<p>I am out of ideas as to why my app has suddenly stopped working - perhaps the collective mind of the SO community can help...<br> Background:<br> I have a large application that has been working up until recently. Now when ever I try and run it I get the error "The application failed to initialize properly (0xc00000...
[ { "answer_id": 424679, "author": "z -", "author_id": 38264, "author_profile": "https://Stackoverflow.com/users/38264", "pm_score": 1, "selected": false, "text": "<p>Check permissions?</p>\n" }, { "answer_id": 424690, "author": "Sergio", "author_id": 32037, "author_pr...
2009/01/08
[ "https://Stackoverflow.com/questions/424673", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3590/" ]
I am out of ideas as to why my app has suddenly stopped working - perhaps the collective mind of the SO community can help... Background: I have a large application that has been working up until recently. Now when ever I try and run it I get the error "The application failed to initialize properly (0xc0000005)" ...
There's probably some .dll file that is required for the application, but it's not found, or access to it is not allowed. Are you using some dll's, or maybe some runtime library of any kind?
424,699
<p>I have an entity Customer</p> <pre><code>public class Customer { public virtual int ID { get; set; } public virtual string Firstname { get; set; } public virtual string Lastname { get; set; } } </code></pre> <p>and my DAL method is :</p> <pre><code> public IList&lt;Customer&gt; GetCustomers(Custome...
[ { "answer_id": 550610, "author": "zihotki", "author_id": 66591, "author_profile": "https://Stackoverflow.com/users/66591", "pm_score": 5, "selected": true, "text": "<p>\"The ID is ignored when using query by example. This is done because an example object with the id set would return onl...
2009/01/08
[ "https://Stackoverflow.com/questions/424699", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42377/" ]
I have an entity Customer ``` public class Customer { public virtual int ID { get; set; } public virtual string Firstname { get; set; } public virtual string Lastname { get; set; } } ``` and my DAL method is : ``` public IList<Customer> GetCustomers(Customer example) { var customers = de...
"The ID is ignored when using query by example. This is done because an example object with the id set would return only one object anyways." - <http://forum.hibernate.org/viewtopic.php?t=927063> and <http://forum.hibernate.org/viewtopic.php?p=2351666&sid=c22d2c37f8d67e268b6ffe547f57ad9e> This is for Hibernate. NHib...
424,705
<p>I have a search page with parameters at the top and a search button with results at the bottom. The entire thing is wrapped in an update panel inside the master page. After clicking the search button it shows the first page. However if you click the next button on the DataPager it does not show the second page. ...
[ { "answer_id": 424736, "author": "Sachin Gaur", "author_id": 2572740, "author_profile": "https://Stackoverflow.com/users/2572740", "pm_score": 0, "selected": false, "text": "<p>Please make sure that your page change event is registered with the Script Manager as it is out of the update p...
2009/01/08
[ "https://Stackoverflow.com/questions/424705", "https://Stackoverflow.com", "https://Stackoverflow.com/users/52962/" ]
I have a search page with parameters at the top and a search button with results at the bottom. The entire thing is wrapped in an update panel inside the master page. After clicking the search button it shows the first page. However if you click the next button on the DataPager it does not show the second page. It show...
I think Nick has the right idea. It sounds like you are performing your search and populating your ListView in your OnClick method for your search button. You need to perform your search (or preferably cache the data the first time around) and bind that to the ListView for each new page that is requested using the Data...
424,709
<p>With my aspect, I track the changes on certain collections by advising certain method calls on instances of <code>java.util.Set</code>, notably <code>add(Object)</code> and <code>remove(Object)</code>. Since the changes are not reflected in the collection itself, invocations of <code>Set.contains(Object)</code> or <...
[ { "answer_id": 424735, "author": "mmx", "author_id": 33708, "author_profile": "https://Stackoverflow.com/users/33708", "pm_score": 3, "selected": true, "text": "<p>For security reasons, <code>MapPath</code> won't resolve paths outside the current application.</p>\n" }, { "answer_...
2009/01/08
[ "https://Stackoverflow.com/questions/424709", "https://Stackoverflow.com", "https://Stackoverflow.com/users/45018/" ]
With my aspect, I track the changes on certain collections by advising certain method calls on instances of `java.util.Set`, notably `add(Object)` and `remove(Object)`. Since the changes are not reflected in the collection itself, invocations of `Set.contains(Object)` or `Set.size()` return wrong results. Therefore I ...
For security reasons, `MapPath` won't resolve paths outside the current application.
424,739
<p>Firstly, I'm a newbie to C# and SharePoint, (less than a month's experience) so apologies if this is an obvious or easy question but I've been trawling the net for a couple of days now with absolutely no success.</p> <p>I have an xslt file that I have stored in a subdirectory of 'Style Library' from within the new ...
[ { "answer_id": 424769, "author": "Ray Booysen", "author_id": 42124, "author_profile": "https://Stackoverflow.com/users/42124", "pm_score": 2, "selected": true, "text": "<p>Here is a bit of code to retrieve the list items from a list:</p>\n\n<pre><code>SPList list = web.Lists[\"MyLibrary\...
2009/01/08
[ "https://Stackoverflow.com/questions/424739", "https://Stackoverflow.com", "https://Stackoverflow.com/users/52969/" ]
Firstly, I'm a newbie to C# and SharePoint, (less than a month's experience) so apologies if this is an obvious or easy question but I've been trawling the net for a couple of days now with absolutely no success. I have an xslt file that I have stored in a subdirectory of 'Style Library' from within the new website bu...
Here is a bit of code to retrieve the list items from a list: ``` SPList list = web.Lists["MyLibrary"]; if (list != null) { var results = from SPListItem listItem in list.Items select new { ...
424,743
<p>Just a general question about what the best practice is:</p> <pre><code>public void Foo() { int x = 5; myControl.Click += (o, e) =&gt; { x = 6; }; } </code></pre> <p>Notice, I'm using the <code>x</code> variable inside my lambda event handler. </p> <p>OR:</p> <pre><code>public class Bar {...
[ { "answer_id": 424773, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 1, "selected": false, "text": "<p>If you don't need x anywhere else in the code, your handler is a no-op - so surely that's a nonsense situation.</p>\n...
2009/01/08
[ "https://Stackoverflow.com/questions/424743", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15861/" ]
Just a general question about what the best practice is: ``` public void Foo() { int x = 5; myControl.Click += (o, e) => { x = 6; }; } ``` Notice, I'm using the `x` variable inside my lambda event handler. OR: ``` public class Bar { private int x = 5; public void Foo() { ...
It depends on your need. In the first example, the side-effects of your event handler are limited to method scope, and in the second, the side-effects are instance scoped. I think that using a closure in terms of your first example serves no purpose since X isn't used anywhere, so it's hard to determine based on your e...
424,770
<p>I built a Winform app several months ago that schedules appointments for repair techs. I'd like to update the app by adding a map for the customer's address on the customer form, and then print that map on the report the techs take when they leave the office.</p> <p>I've been looking around but I haven't found a go...
[ { "answer_id": 424814, "author": "Stever B", "author_id": 47939, "author_profile": "https://Stackoverflow.com/users/47939", "pm_score": 1, "selected": true, "text": "<p>Both Google Maps and Live Maps have a public api.</p>\n\n<p>Since you are doing winforms I'd probably use live maps.</p...
2009/01/08
[ "https://Stackoverflow.com/questions/424770", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42620/" ]
I built a Winform app several months ago that schedules appointments for repair techs. I'd like to update the app by adding a map for the customer's address on the customer form, and then print that map on the report the techs take when they leave the office. I've been looking around but I haven't found a good solutio...
Both Google Maps and Live Maps have a public api. Since you are doing winforms I'd probably use live maps. <http://dev.live.com/VirtualEarth/> There are a few examples on CodePlex. <http://codeplex.com/Project/ProjectDirectory.aspx?TagName=Virtual%20Earth>
424,775
<p>The <code>()</code> seems silly. is there a better way?</p> <p>For example:</p> <p><code>ExternalId.IfNotNullDo(() =&gt; ExternalId = ExternalId.Trim());</code></p>
[ { "answer_id": 424792, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 4, "selected": false, "text": "<p>No, there isn't. Lambda expressions are optimised (in terms of syntax) for the single parameter case.</p>\n\n<p>I kno...
2009/01/08
[ "https://Stackoverflow.com/questions/424775", "https://Stackoverflow.com", "https://Stackoverflow.com/users/52972/" ]
The `()` seems silly. is there a better way? For example: `ExternalId.IfNotNullDo(() => ExternalId = ExternalId.Trim());`
Sort of! There is a new idiom in town, that is nice and may help you in some cases. It is not fully what you want, but sometimes I think you will like it. Since underscore ("\_") is a valid C# identifier, it is becoming a common idiom to use it as a parameter name to a lambda in cases where you plan to ignore the para...
424,800
<p>Let's say I have an Array of numbers: <code>[2,3,3,4,2,2,5,6,7,2]</code></p> <p>What is the best way to find the minimum or maximum value in that Array?</p> <p>Right now, to get the maximum, I am looping through the Array, and resetting a variable to the value if it is greater than the existing value:</p> <pre><c...
[ { "answer_id": 424819, "author": "Adam Bellaire", "author_id": 21632, "author_profile": "https://Stackoverflow.com/users/21632", "pm_score": 5, "selected": false, "text": "<p>There isn't any reliable way to get the minimum/maximum without testing every value. You don't want to try a sor...
2009/01/08
[ "https://Stackoverflow.com/questions/424800", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31298/" ]
Let's say I have an Array of numbers: `[2,3,3,4,2,2,5,6,7,2]` What is the best way to find the minimum or maximum value in that Array? Right now, to get the maximum, I am looping through the Array, and resetting a variable to the value if it is greater than the existing value: ``` var myArray:Array /* of Number */ =...
The theoretical answers from everyone else are all neat, but let's be pragmatic. ActionScript provides the tools you need so that you don't even have to write a loop in this case! First, note that `Math.min()` and `Math.max()` can take any number of arguments. Also, it's important to understand the `apply()` method av...
424,826
<p>I have this piece of code:</p> <pre><code>var myObj = function () { this.complex = function (text) { /* long piece of code */ } this.parse(text) { return text.replace(/valid_pattern/gi, function ($1) { return this.complex($1); } ); } } </code></pre> <p>Of course calling <strong>this.complex($1)</stro...
[ { "answer_id": 424836, "author": "Jimmy", "author_id": 4435, "author_profile": "https://Stackoverflow.com/users/4435", "pm_score": 0, "selected": false, "text": "<p>declare a variable for that.</p>\n\n<pre><code>var myObj = function () {\n var foo = this.complex = function (text) { /* l...
2009/01/08
[ "https://Stackoverflow.com/questions/424826", "https://Stackoverflow.com", "https://Stackoverflow.com/users/52982/" ]
I have this piece of code: ``` var myObj = function () { this.complex = function (text) { /* long piece of code */ } this.parse(text) { return text.replace(/valid_pattern/gi, function ($1) { return this.complex($1); } ); } } ``` Of course calling **this.complex($1)** won't do the trick, because I'm in ...
Maybe try: ``` var myObj = function () { this.complex = function (text) { /* long piece of code */ } this.parse(text) { var that = this; return text.replace(/valid_pattern/gi, function ($1) { return that.complex($1); } ); } } ``` It is one of the most useful tricks :-) **UPDATE:** The trick is no...
424,830
<p>This is how I do it at the moment. I try to open the file with the FileShare set to none. So I want exclusive accesss to the file. If I can't get that then its a good bet somebody else has the file locked.</p> <p>There's got to be a better and faster way. Any ideas?</p> <pre><code> try { ...
[ { "answer_id": 424838, "author": "Sunny Milenov", "author_id": 8220, "author_profile": "https://Stackoverflow.com/users/8220", "pm_score": 6, "selected": true, "text": "<p>There is no need first to check if the file is locked and then access it, as between the check and the access some o...
2009/01/08
[ "https://Stackoverflow.com/questions/424830", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42109/" ]
This is how I do it at the moment. I try to open the file with the FileShare set to none. So I want exclusive accesss to the file. If I can't get that then its a good bet somebody else has the file locked. There's got to be a better and faster way. Any ideas? ``` try { using (F...
There is no need first to check if the file is locked and then access it, as between the check and the access some other process may still get a lock on the file. So, what you do is correct, if you succeed, do your work with the file.
424,842
<p><strong>Dupe: <a href="https://stackoverflow.com/questions/302701/null-difference">Null Difference</a></strong></p> <p>A lifetime ago I came across an article that explained that the following were not equal (in c#):</p> <pre><code>if (o == null) {} if (null == o) {} </code></pre> <p>The article explained that th...
[ { "answer_id": 424852, "author": "Jimmy", "author_id": 4435, "author_profile": "https://Stackoverflow.com/users/4435", "pm_score": 4, "selected": true, "text": "<p>it's an old habit to prevent you from typing <code>if (o = null)</code>. if (null = o) is a syntax error. kind of pointless ...
2009/01/08
[ "https://Stackoverflow.com/questions/424842", "https://Stackoverflow.com", "https://Stackoverflow.com/users/52165/" ]
**Dupe: [Null Difference](https://stackoverflow.com/questions/302701/null-difference)** A lifetime ago I came across an article that explained that the following were not equal (in c#): ``` if (o == null) {} if (null == o) {} ``` The article explained that the latter was preferred because it resulted in a more accu...
it's an old habit to prevent you from typing `if (o = null)`. if (null = o) is a syntax error. kind of pointless in C#, because null values aren't ever coerced into booleans.
424,849
<p>I currently have a small Java program which I would like to run both on the desktop (ie in a JFrame) and in an applet. Currently all of the drawing and logic are handled by a class extending Canvas. This gives me a very nice main method for the Desktop application:</p> <pre><code>public static void main(String[] ar...
[ { "answer_id": 424874, "author": "Bombe", "author_id": 43582, "author_profile": "https://Stackoverflow.com/users/43582", "pm_score": 3, "selected": true, "text": "<p><a href=\"http://java.sun.com/j2se/1.5.0/docs/api/java/applet/Applet.html\" rel=\"nofollow noreferrer\">Applet</a> is a <a...
2009/01/08
[ "https://Stackoverflow.com/questions/424849", "https://Stackoverflow.com", "https://Stackoverflow.com/users/50264/" ]
I currently have a small Java program which I would like to run both on the desktop (ie in a JFrame) and in an applet. Currently all of the drawing and logic are handled by a class extending Canvas. This gives me a very nice main method for the Desktop application: ``` public static void main(String[] args) { MyCa...
[Applet](http://java.sun.com/j2se/1.5.0/docs/api/java/applet/Applet.html) is a [Container](http://java.sun.com/j2se/1.5.0/docs/api/java/awt/Container.html), just [add](http://java.sun.com/j2se/1.5.0/docs/api/java/awt/Container.html#add(java.awt.Component)) your Canvas there.
424,866
<p>In C# how do you write a DataSet to file without it being written with pretty print?</p> <p>Using C# and .NET 2.0, I've been using dataSet.WriteXml(fileName, XmlWriteMode.IgnoreSchema), which by default is writing the Xml file with pretty print. The company consuming the Xml files I write suggested that writing wit...
[ { "answer_id": 424901, "author": "Kev", "author_id": 419, "author_profile": "https://Stackoverflow.com/users/419", "pm_score": 1, "selected": false, "text": "<p>If it's not possible to influence the formatting of the dataset xml, I'd just load the xml into a new XMLDocument and send the ...
2009/01/08
[ "https://Stackoverflow.com/questions/424866", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4660/" ]
In C# how do you write a DataSet to file without it being written with pretty print? Using C# and .NET 2.0, I've been using dataSet.WriteXml(fileName, XmlWriteMode.IgnoreSchema), which by default is writing the Xml file with pretty print. The company consuming the Xml files I write suggested that writing without the p...
It's pretty simple, you just have to create an `XmlWriter` using an `XmlWriterSettings` which has the `Indent` property set to false: ``` // The memory stream for the backing. using (MemoryStream ms = new MemoryStream()) { // The settings for the XmlWriter. XmlWriterSettings settings = new XmlWriterSettings(); ...
424,880
<p>Any idea how to initialize .NET delegate that points to method from 'mixed' class instance?</p> <p>I have 'mixed' C++ class like this:</p> <pre><code>class CppMixClass { public: CppMixClass(void){ dotNETclass-&gt;StateChanged += gcnew DotNetClass::ServiceStateEventHandler(&amp;UpdateHealthState); }...
[ { "answer_id": 425895, "author": "Rob", "author_id": 18505, "author_profile": "https://Stackoverflow.com/users/18505", "pm_score": 2, "selected": false, "text": "<p>Only .NET types can use events. I suggest creating a new managed class that handles the event, and compose that class withi...
2009/01/08
[ "https://Stackoverflow.com/questions/424880", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35425/" ]
Any idea how to initialize .NET delegate that points to method from 'mixed' class instance? I have 'mixed' C++ class like this: ``` class CppMixClass { public: CppMixClass(void){ dotNETclass->StateChanged += gcnew DotNetClass::ServiceStateEventHandler(&UpdateHealthState); } ~CppMixClass(void); v...
I just found answer to this(of course by Nishant Sivakumar, man seems to have answers to all my C++/CLI interop related problems): <http://www.codeproject.com/KB/mcpp/CppCliSupportLib.aspx?display=Print> Answer is located in "msclr/event.h" header, where macros for delegates in native classes are defined. Nish's cod...
424,895
<p>My company is trying to migrate away from a <strong>.NET</strong> application to something that is purely <strong>web-based</strong>, and very "ajaxy". The original .NET app is fairly interactive, roughly equivalent to Google Maps as far as user interaction is concerned (zoom, pan, annotate features on a vector map...
[ { "answer_id": 425100, "author": "Troy Gilbert", "author_id": 53003, "author_profile": "https://Stackoverflow.com/users/53003", "pm_score": 4, "selected": false, "text": "<p>I'm not familiar with GWT, but I'm very familiar with Flex. Even though GWT is Java-based (and it sounds like you'...
2009/01/08
[ "https://Stackoverflow.com/questions/424895", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1274957/" ]
My company is trying to migrate away from a **.NET** application to something that is purely **web-based**, and very "ajaxy". The original .NET app is fairly interactive, roughly equivalent to Google Maps as far as user interaction is concerned (zoom, pan, annotate features on a vector map). Our .NET developer is real...
I'm only mildly familiar with Flex, but have worked with GWT for many years. We had to make a very similar decision some years ago (Flash vs GWT), but for different reasons. In the end we saw the many advantages of GWT over Flash (Many of which apply to Flex): * Not all our customers have flash, penetration numbers fr...
424,899
<p>I'm currently writing an iPhone application that uses a UITabBarController with more than 5 Tab Bar Items. Thus, a 'more' tab is automatically generated (like in the YouTube Application). I found out that the corresponding view controller class is <a href="http://ericasadun.com/iPhoneDocs220/interface_u_i_more_list_...
[ { "answer_id": 424999, "author": "Marc Charbonneau", "author_id": 35136, "author_profile": "https://Stackoverflow.com/users/35136", "pm_score": 0, "selected": false, "text": "<p>You should not have to declare or #import any of the standard Cocoa Touch classes. UIMoreListController does n...
2009/01/08
[ "https://Stackoverflow.com/questions/424899", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27862/" ]
I'm currently writing an iPhone application that uses a UITabBarController with more than 5 Tab Bar Items. Thus, a 'more' tab is automatically generated (like in the YouTube Application). I found out that the corresponding view controller class is [UIMoreListController](http://ericasadun.com/iPhoneDocs220/interface_u_i...
If you're just trying to check for the `UIMoreListController` class you can access the class variable using the objc-api. ``` if ([viewController isKindOfClass:NSClassFromString(@"UIMoreListController")]) ``` Then you don't need the `#import` or the `@class` declaration.
424,919
<p>Let's say you have a table for branches in your organization. Some of them are "main" branches, and others are satellite offices that roll up to a main branch. Other than this distinction, which only impacts a few things in the system, the branches are all peers and have the same attributes (address, etc.). One way ...
[ { "answer_id": 424950, "author": "Otávio Décio", "author_id": 48684, "author_profile": "https://Stackoverflow.com/users/48684", "pm_score": 1, "selected": false, "text": "<p>Seems to me like a business constraint, difficult to enforce at the data definition level. I don't believe the rel...
2009/01/08
[ "https://Stackoverflow.com/questions/424919", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37539/" ]
Let's say you have a table for branches in your organization. Some of them are "main" branches, and others are satellite offices that roll up to a main branch. Other than this distinction, which only impacts a few things in the system, the branches are all peers and have the same attributes (address, etc.). One way to ...
You can bind a check constraint to the return value of a UDF. Create a UDF that takes the columns involved as input parameters, and then check your desired state using a select in the UDF.