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
405,072
<p>I am relatively new to The Zend framework having only been working with it probably two months at the most. I am now trying to get a list of results from a query I run, send it through the zend paginator class and display 4 results per page, however it does not seem to be recognising when it has got 4 results, I bel...
[ { "answer_id": 405259, "author": "Brian Fisher", "author_id": 43816, "author_profile": "https://Stackoverflow.com/users/43816", "pm_score": 1, "selected": false, "text": "<p>So I think the root of your problem is in your model class with the getAllNews function. The Zend_Db fetchAll func...
2009/01/01
[ "https://Stackoverflow.com/questions/405072", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I am relatively new to The Zend framework having only been working with it probably two months at the most. I am now trying to get a list of results from a query I run, send it through the zend paginator class and display 4 results per page, however it does not seem to be recognising when it has got 4 results, I believ...
$paginator should be set to 4 as you want to show only 4 records at a time : ``` $paginator->setItemCountPerPage(4); ```
405,073
<p>I have a parts application that is built on Flex 3 and I having a problem with the parts list. The parts list uses two objects:</p> <ul> <li>Part</li> <li>ArrayOfPart</li> </ul> <p>I cache the parts list locally in a SharedObject. <strong>This has been working fine for a couple months</strong>. I added a new Boole...
[ { "answer_id": 405351, "author": "Andy Webb", "author_id": 10931, "author_profile": "https://Stackoverflow.com/users/10931", "pm_score": 0, "selected": false, "text": "<p>This looks like a tough one.</p>\n\n<p>I don't think it is a formation or serialization issue. Maybe something else ...
2009/01/01
[ "https://Stackoverflow.com/questions/405073", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5592/" ]
I have a parts application that is built on Flex 3 and I having a problem with the parts list. The parts list uses two objects: * Part * ArrayOfPart I cache the parts list locally in a SharedObject. **This has been working fine for a couple months**. I added a new Boolean property to the Part class and re-imported we...
I solved my own problem. The ArrayOfPart had a constructor with a parameter. When I removed the constructor, the error went away. By the way, this was Flash 9.
405,076
<p>I made a drag and drop utility that make it possible for users to drag and drop elements directly on a workplace and create their page, I wound how can I save the user's work as HTML page!</p>
[ { "answer_id": 405080, "author": "Salamander2007", "author_id": 10629, "author_profile": "https://Stackoverflow.com/users/10629", "pm_score": 0, "selected": false, "text": "<p>Uhhm,.. press the save button? Seriously though, I think you might want to put more information on your question...
2009/01/01
[ "https://Stackoverflow.com/questions/405076", "https://Stackoverflow.com", "https://Stackoverflow.com/users/49809/" ]
I made a drag and drop utility that make it possible for users to drag and drop elements directly on a workplace and create their page, I wound how can I save the user's work as HTML page!
You mean the position of all elements? How about iterating through them and saving their position? If you use jQuery you could do something like this: ``` var positions = new Array(); function savePositionOfAllDivs() { $('div').each( function(){ $this = $(this); id = $this.attr('id'); position = $this.position(...
405,082
<p>I've got a custom site page in Windows SharePoint Services 3.0 that contains an SPGridView. When I use the search box on this page, I get the following error:</p> <pre><code>Unable to validate data. at System.Web.Configuration.MachineKeySection.EncryptOrDecryptData(Boolean fEncrypt, Byte[] buf, Byte[] modifier, I...
[ { "answer_id": 405098, "author": "Kb.", "author_id": 49544, "author_profile": "https://Stackoverflow.com/users/49544", "pm_score": 0, "selected": false, "text": "<p>Is the application running in a webfarm environment?<br/>\nIf so the machineKey must be set in web.config:<br/>\nWe use the...
2009/01/01
[ "https://Stackoverflow.com/questions/405082", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13463/" ]
I've got a custom site page in Windows SharePoint Services 3.0 that contains an SPGridView. When I use the search box on this page, I get the following error: ``` Unable to validate data. at System.Web.Configuration.MachineKeySection.EncryptOrDecryptData(Boolean fEncrypt, Byte[] buf, Byte[] modifier, Int32 start, In...
OK, I finally figured out what the problem was (in my particular case, anyway): I was specifying the DataKeyNames attribute of the SPGridView. After removing that attribute, search worked just fine.
405,106
<p>All of the questions that I've asked recently about Python have been for this project. I have realised that the reason I'm asking so many questions may not be because I'm so new to Python (but I know a good bit of PHP) and is probably not because Python has some inherent flaw.</p> <p>Thus I will now say what the pr...
[ { "answer_id": 405129, "author": "Ali Afshar", "author_id": 28380, "author_profile": "https://Stackoverflow.com/users/28380", "pm_score": 2, "selected": false, "text": "<p>I have narrowed your issue down to:</p>\n\n<blockquote>\n <p>With Python I have to remake that\n array each time I...
2009/01/01
[ "https://Stackoverflow.com/questions/405106", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1384652/" ]
All of the questions that I've asked recently about Python have been for this project. I have realised that the reason I'm asking so many questions may not be because I'm so new to Python (but I know a good bit of PHP) and is probably not because Python has some inherent flaw. Thus I will now say what the project is a...
"data.py creates an array (well, list), to use this list from another file I need to import data.py and remake said list." I can't figure out what you're talking about. Seriously. Here's a main program, which imports the data, and another module. SomeMainProgram.py ``` import data import someOtherModule print data...
405,112
<p>How are objects stored in memory in C++?</p> <p>For a regular class such as </p> <pre><code>class Object { public: int i1; int i2; char i3; int i4; private: }; </code></pre> <p>Using a pointer of Object as an array can be used to access i1 as follows?</p> <pre><code>((Object*)&amp;myObjec...
[ { "answer_id": 405121, "author": "SoapBox", "author_id": 36384, "author_profile": "https://Stackoverflow.com/users/36384", "pm_score": 3, "selected": false, "text": "<p>Classes without virtual members and without inheritance are laid out in memory just like structs. But, when you start ...
2009/01/01
[ "https://Stackoverflow.com/questions/405112", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16177/" ]
How are objects stored in memory in C++? For a regular class such as ``` class Object { public: int i1; int i2; char i3; int i4; private: }; ``` Using a pointer of Object as an array can be used to access i1 as follows? ``` ((Object*)&myObject)[0] === i1? ``` Other questions on SO seem t...
Almost. You cast to an Object\*, and neglected to take an address. Let's re-ask as the following: ``` ((int*)&myObject)[0] == i1 ``` You have to be really careful with assumptions like this. As you've defined the structure, this should be true in any compiler you're likely to come across. But all sorts of other prop...
405,113
<p>I have a structure in C which resembles that of a database table record. Now when I query the table using select, I do not know how many records I will get. I want to store all the returned records from the select query in a array of my structure data type.</p> <p>Which method is best?</p> <h3>Method 1: find array s...
[ { "answer_id": 405124, "author": "Bjarke Ebert", "author_id": 31890, "author_profile": "https://Stackoverflow.com/users/31890", "pm_score": 1, "selected": false, "text": "<p>A problem with 'select count(*)' is that the value might change between calls, so your \"real\" select will have a...
2009/01/01
[ "https://Stackoverflow.com/questions/405113", "https://Stackoverflow.com", "https://Stackoverflow.com/users/50706/" ]
I have a structure in C which resembles that of a database table record. Now when I query the table using select, I do not know how many records I will get. I want to store all the returned records from the select query in a array of my structure data type. Which method is best? ### Method 1: find array size and allo...
And I forgot option #4. Allocate an array of fixed size. When that array is full, allocate another. You can keep track of the arrays by linking them in a linked list, or having a higher level array that keeps the pointers to the data arrays. This two-level scheme is great when you need random access, you just need to b...
405,116
<p>Inspired by this <a href="https://stackoverflow.com/questions/404899/scope-of-variables-in-a-delegate">question</a> I began wondering why the following examples are all illegal in c#:</p> <pre><code>VoidFunction t = delegate { int i = 0; }; int i = 1; </code></pre> <p>and </p> <pre><code>{ int i = 0; } int i...
[ { "answer_id": 405195, "author": "JaredPar", "author_id": 23283, "author_profile": "https://Stackoverflow.com/users/23283", "pm_score": 4, "selected": true, "text": "<p>This behavior is covered in section 3 of the C# language specification. Here is the quote from the spec</p>\n\n<blockq...
2009/01/01
[ "https://Stackoverflow.com/questions/405116", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13995/" ]
Inspired by this [question](https://stackoverflow.com/questions/404899/scope-of-variables-in-a-delegate) I began wondering why the following examples are all illegal in c#: ``` VoidFunction t = delegate { int i = 0; }; int i = 1; ``` and ``` { int i = 0; } int i = 1; ``` I'm just wondering if anyone knew th...
This behavior is covered in section 3 of the C# language specification. Here is the quote from the spec > > Similarly, any expression that > occurs as the body of an anonymous > function in the form of a > lambda-expression creates a > declaration space which contains the > parameters of the anonymous function. ...
405,134
<p>I <code>UIButton</code> using + <code>buttonWithType:</code> </p> <p>What I need to figure out is how to manually change the button state. There are times when I need it to be set to "disabled."</p> <p>I read through the <code>UIButton</code> documentation but I cannot seem to find anything about manually setting ...
[ { "answer_id": 405163, "author": "Ben Gottlieb", "author_id": 6694, "author_profile": "https://Stackoverflow.com/users/6694", "pm_score": 7, "selected": true, "text": "<p>Did you try <code>button.enabled = NO;</code>?</p>\n\n<p><strong>Swift 5.0</strong></p>\n\n<pre><code>button.isEnable...
2009/01/01
[ "https://Stackoverflow.com/questions/405134", "https://Stackoverflow.com", "https://Stackoverflow.com/users/46022/" ]
I `UIButton` using + `buttonWithType:` What I need to figure out is how to manually change the button state. There are times when I need it to be set to "disabled." I read through the `UIButton` documentation but I cannot seem to find anything about manually setting a button state. Any thoughts would be greatly app...
Did you try `button.enabled = NO;`? **Swift 5.0** ``` button.isEnabled = false ```
405,140
<p>How can I achieve the following with a format string: Do 01.01.2009 ? It has to work in all languages (the example would be for Germany). So there should only be the short weekday and then the short date.</p> <p>I tried 'ddd d' (without the '). However, this leads to 'Do 01'. Is there maybe a character I can put be...
[ { "answer_id": 405154, "author": "Darin Dimitrov", "author_id": 29407, "author_profile": "https://Stackoverflow.com/users/29407", "pm_score": 3, "selected": true, "text": "<pre><code>DateTime.Now.ToString(\"ddd dd/MM/yyyy\")\n</code></pre>\n" }, { "answer_id": 405167, "author...
2009/01/01
[ "https://Stackoverflow.com/questions/405140", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
How can I achieve the following with a format string: Do 01.01.2009 ? It has to work in all languages (the example would be for Germany). So there should only be the short weekday and then the short date. I tried 'ddd d' (without the '). However, this leads to 'Do 01'. Is there maybe a character I can put before the '...
``` DateTime.Now.ToString("ddd dd/MM/yyyy") ```
405,151
<p>On iPhone, I perform a HTTP request using NSURLRequest for a chunk of data. Object allocation spikes and I assign the data accordingly. When I finish with the data, I free it up accordingly - however instruments doesn't show any data to have been freed!</p> <p>My theory is that by default HTTP requests are cached, ...
[ { "answer_id": 405711, "author": "catlan", "author_id": 23028, "author_profile": "https://Stackoverflow.com/users/23028", "pm_score": 3, "selected": false, "text": "<p>If you use NSURLConnection take a look at the delegate:</p>\n\n<pre><code>- (NSCachedURLResponse *)connection:(NSURLConn...
2009/01/01
[ "https://Stackoverflow.com/questions/405151", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1221378/" ]
On iPhone, I perform a HTTP request using NSURLRequest for a chunk of data. Object allocation spikes and I assign the data accordingly. When I finish with the data, I free it up accordingly - however instruments doesn't show any data to have been freed! My theory is that by default HTTP requests are cached, however - ...
Usually it's easier to create the request like this ``` NSURLRequest *request = [NSURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:60.0]; ``` Then create the connection ``` NSURLConnection *conn = [NSURLConnection connectionWithRequest:request delegat...
405,164
<p>I've done quite a bit of research into this but it seems that the methods used are inconsistent and varied.</p> <p>Here are some methods I have used in the past:</p> <pre><code>/* 1: */ typeof myFunc === 'function' /* 2: */ myFunc.constructor === Function /* 3: */ myFunc instanceof Function </code></pre> <p>As...
[ { "answer_id": 405202, "author": "AnthonyWJones", "author_id": 17516, "author_profile": "https://Stackoverflow.com/users/17516", "pm_score": 2, "selected": false, "text": "<p>John Resig the developer of jQuery does seem to have made some bizarre choices in the internals of jQuery.</p>\n\...
2009/01/01
[ "https://Stackoverflow.com/questions/405164", "https://Stackoverflow.com", "https://Stackoverflow.com/users/21677/" ]
I've done quite a bit of research into this but it seems that the methods used are inconsistent and varied. Here are some methods I have used in the past: ``` /* 1: */ typeof myFunc === 'function' /* 2: */ myFunc.constructor === Function /* 3: */ myFunc instanceof Function ``` As part of my research I had a look...
The best way to test if an object is a function is `typeof myFunc === 'function'`. If you are using a library, use that library's function test: `jQuery.isFunction(myFunc)`. Things *can* be misreported as functions when using `typeof`. This is very rare but a library is there to remove these inconsistencies. jQuery wo...
405,176
<p>The Table - Query has 2 columns (functionId, depFunctionId)</p> <p>I want all values that are either in functionid or in depfunctionid</p> <p>I am using this:</p> <pre><code>select distinct depfunctionid from Query union select distinct functionid from Query </code></pre> <p>How to do it better?</p>
[ { "answer_id": 405180, "author": "Bob Probst", "author_id": 12424, "author_profile": "https://Stackoverflow.com/users/12424", "pm_score": 4, "selected": true, "text": "<p>I think that's the best you'll get.</p>\n" }, { "answer_id": 405187, "author": "Charles Bretana", "au...
2009/01/01
[ "https://Stackoverflow.com/questions/405176", "https://Stackoverflow.com", "https://Stackoverflow.com/users/30546/" ]
The Table - Query has 2 columns (functionId, depFunctionId) I want all values that are either in functionid or in depfunctionid I am using this: ``` select distinct depfunctionid from Query union select distinct functionid from Query ``` How to do it better?
I think that's the best you'll get.
405,229
<p>I have a script of MySQL queries that I use and that work.</p> <p>I'm trying to execute the same queries in Microsoft SQL server and there's one thing I don't understand.</p> <p>MySql uses "key" to define a key made up of different fields.</p> <p>What is the way to do the same thing in SQL Server?</p> <p>Thanks!...
[ { "answer_id": 405234, "author": "recursive", "author_id": 44743, "author_profile": "https://Stackoverflow.com/users/44743", "pm_score": 2, "selected": false, "text": "<p>You can declare a primary key that consists of multiple columns in TSQL (SQL server's query language)</p>\n\n<pre><co...
2009/01/01
[ "https://Stackoverflow.com/questions/405229", "https://Stackoverflow.com", "https://Stackoverflow.com/users/44004/" ]
I have a script of MySQL queries that I use and that work. I'm trying to execute the same queries in Microsoft SQL server and there's one thing I don't understand. MySql uses "key" to define a key made up of different fields. What is the way to do the same thing in SQL Server? Thanks! -Adeena
You can declare a primary key that consists of multiple columns in TSQL (SQL server's query language) ``` ALTER TABLE product ADD CONSTRAINT prim_prod PRIMARY KEY(product_foo, product_bar) ``` If you use SQL Server Management studio, you can also achieve this via "Modify Table".
405,233
<p>In the below code sample, what does <code>{0:X2}</code> mean? This is from the reflection section of the MCTS Application Development Foundation book (covering dynamic code, etc.).</p> <pre><code>foreach(Byte b in body.GetILAsBodyArray()) { Console.Write("{0:X2}", b); } </code></pre>
[ { "answer_id": 405239, "author": "BenAlabaster", "author_id": 40650, "author_profile": "https://Stackoverflow.com/users/40650", "pm_score": 6, "selected": true, "text": "<p>This uses the same format as String.Format(). Check out the following reference:</p>\n\n<p><a href=\"http://msdn.m...
2009/01/01
[ "https://Stackoverflow.com/questions/405233", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32484/" ]
In the below code sample, what does `{0:X2}` mean? This is from the reflection section of the MCTS Application Development Foundation book (covering dynamic code, etc.). ``` foreach(Byte b in body.GetILAsBodyArray()) { Console.Write("{0:X2}", b); } ```
This uses the same format as String.Format(). Check out the following reference: <http://msdn.microsoft.com/en-us/library/fht0f5be.aspx> * X = Hexadecimal format * 2 = 2 characters
405,288
<p>Consider this trigger:</p> <pre><code>ALTER TRIGGER myTrigger ON someTable AFTER INSERT AS BEGIN DELETE FROM someTable WHERE ISNUMERIC(someField) = 1 END </code></pre> <p>I've got a table, someTable, and I'm trying to prevent people from inserting bad records. For the purpose of this question, a...
[ { "answer_id": 405295, "author": "ConcernedOfTunbridgeWells", "author_id": 15401, "author_profile": "https://Stackoverflow.com/users/15401", "pm_score": 7, "selected": true, "text": "<p>Triggers cannot modify the changed data (<code>Inserted</code> or <code>Deleted</code>) otherwise you ...
2009/01/01
[ "https://Stackoverflow.com/questions/405288", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4/" ]
Consider this trigger: ``` ALTER TRIGGER myTrigger ON someTable AFTER INSERT AS BEGIN DELETE FROM someTable WHERE ISNUMERIC(someField) = 1 END ``` I've got a table, someTable, and I'm trying to prevent people from inserting bad records. For the purpose of this question, a bad record has a field "s...
Triggers cannot modify the changed data (`Inserted` or `Deleted`) otherwise you could get infinite recursion as the changes invoked the trigger again. One option would be for the trigger to roll back the transaction. **Edit:** The reason for this is that the standard for SQL is that inserted and deleted rows cannot be...
405,320
<p>Each page of my site has 10 (almost) identical divs, varying only in the text within. When a certain part of a div is clicked, I want a different part of that div to be modified.</p> <p>I'm using this code:</p> <pre><code>$(document).ready(function(){ $(".notLogged img").mouseover(function(){ $(this).parent()&g...
[ { "answer_id": 405330, "author": "Andreas Grech", "author_id": 44084, "author_profile": "https://Stackoverflow.com/users/44084", "pm_score": 4, "selected": true, "text": "<p>Try it like this:</p>\n\n<pre><code>$(document).ready(function(){\n $(\".notLogged img\").mouseover(function(){\n ...
2009/01/01
[ "https://Stackoverflow.com/questions/405320", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1615/" ]
Each page of my site has 10 (almost) identical divs, varying only in the text within. When a certain part of a div is clicked, I want a different part of that div to be modified. I'm using this code: ``` $(document).ready(function(){ $(".notLogged img").mouseover(function(){ $(this).parent()>$("span").html("You mu...
Try it like this: ``` $(document).ready(function(){ $(".notLogged img").mouseover(function(){ $(this).parent().find("span").html("You must be logged in to vote."); }); }); ```
405,336
<p>Netbeans tells me it's bad to access a static method from a non static method. Why is this bad? "Accessing static method getInstance" is the warning:</p> <pre><code>import java.util.Calendar; public class Clock { // Instance fields private Calendar time; /** * Constructor. Starts the clock at the...
[ { "answer_id": 405348, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 4, "selected": false, "text": "<p>What do you mean by \"return a static method\"? It's fine to call a static method from an instance method in my view ...
2009/01/01
[ "https://Stackoverflow.com/questions/405336", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Netbeans tells me it's bad to access a static method from a non static method. Why is this bad? "Accessing static method getInstance" is the warning: ``` import java.util.Calendar; public class Clock { // Instance fields private Calendar time; /** * Constructor. Starts the clock at the current opera...
You're probably accessing the static method from an instance instead of directly. Try using `Calendar.getInstance()` instead: ``` private String getSystemTime() { return Calendar.getInstance().get(Calendar.HOUR)+":"+ Calendar.getInstance().get(Calendar.MINUTE); } ```
405,338
<p>Using the standard MVC set up in Zend Framework, I want to be able to display pages that have anchors throughout. Right now I'm just adding a meaningless parameter with the '#anchor' that I want inside the .phtml file.</p> <pre><code>&lt;?= $this-&gt;url(array( 'controller'=&gt;'my.controller', 'action'=&gt...
[ { "answer_id": 406720, "author": "Martin Rázus", "author_id": 39014, "author_profile": "https://Stackoverflow.com/users/39014", "pm_score": 5, "selected": true, "text": "<p>one of possibilities is to override url helper, or to create a new one.</p>\n\n<pre><code>class My_View_Helper_Url ...
2009/01/01
[ "https://Stackoverflow.com/questions/405338", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42523/" ]
Using the standard MVC set up in Zend Framework, I want to be able to display pages that have anchors throughout. Right now I'm just adding a meaningless parameter with the '#anchor' that I want inside the .phtml file. ``` <?= $this->url(array( 'controller'=>'my.controller', 'action'=>'my.action', 'anchor'...
one of possibilities is to override url helper, or to create a new one. ``` class My_View_Helper_Url extends Zend_View_Helper_Url { public function url(array $urlOptions = array(), $name = null, $reset = false, $encode = true) { if (isset($urlOptions['anchor']) && !empty($urlOptions['anchor'])) ...
405,364
<p>This question is for the java language in particular. I understand that there is a static protion of memory set aside for all static code.</p> <p>My question is how is this static memory filled? Is a static object put into static memory at import, or at first reference? Also, do the same garbage collection rules ap...
[ { "answer_id": 405372, "author": "krosenvold", "author_id": 23691, "author_profile": "https://Stackoverflow.com/users/23691", "pm_score": 3, "selected": false, "text": "<p>There is normally no such thing as \"static\" memory. Most vm's have the permanent generation of the heap (where cla...
2009/01/01
[ "https://Stackoverflow.com/questions/405364", "https://Stackoverflow.com", "https://Stackoverflow.com/users/48728/" ]
This question is for the java language in particular. I understand that there is a static protion of memory set aside for all static code. My question is how is this static memory filled? Is a static object put into static memory at import, or at first reference? Also, do the same garbage collection rules apply to sta...
Imports don't correlate with any instructions in compiled code. They establish aliases for use at compile time only. There are some reflective methods that allow the class to be loaded but not yet initialized, but in most cases, you can assume that whenever a class is referenced, it has been initialized. Static membe...
405,379
<p>I am designing a helper method that does lazy loading of certain objects for me, calling it looks like this:</p> <pre><code>public override EDC2_ORM.Customer Customer { get { return LazyLoader.Get&lt;EDC2_ORM.Customer&gt;( CustomerId, _customerDao, ()=&gt;base.Customer, (x)=&gt;Customer = x); } ...
[ { "answer_id": 405391, "author": "Michael Stum", "author_id": 91, "author_profile": "https://Stackoverflow.com/users/91", "pm_score": 2, "selected": false, "text": "<p>copy/pasting from <a href=\"http://www.chinaitpower.com/A/2002-01-23/11684.html\" rel=\"nofollow noreferrer\">here</a>:<...
2009/01/01
[ "https://Stackoverflow.com/questions/405379", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5056/" ]
I am designing a helper method that does lazy loading of certain objects for me, calling it looks like this: ``` public override EDC2_ORM.Customer Customer { get { return LazyLoader.Get<EDC2_ORM.Customer>( CustomerId, _customerDao, ()=>base.Customer, (x)=>Customer = x); } set { base.Customer = valu...
"base.Foo" for a virtual method will make a non-virtual call on the parent definition of the method "Foo". Starting with CLR 2.0, the CLR decided that a non-virtual call on a virtual method can be a potential security hole and restricted the scenarios in which in can be used. They limited it to making non-virtual calls...
405,394
<p>Now I'm trying to work with System.Web.Routing. All is just fine, but I can't understand how to make form authentication work with url routing (return url, redirection, etc). Google says nothing. Help! :)</p> <p><strong>UPD:</strong> I forgot - I <strong>don't use MVC</strong>. That's the problem. How to use rouni...
[ { "answer_id": 405407, "author": "indyfromoz", "author_id": 32649, "author_profile": "https://Stackoverflow.com/users/32649", "pm_score": 0, "selected": false, "text": "<p>The first result I got from a Google search is Frederiks excellent post on <a href=\"http://weblogs.asp.net/fredrikn...
2009/01/01
[ "https://Stackoverflow.com/questions/405394", "https://Stackoverflow.com", "https://Stackoverflow.com/users/50737/" ]
Now I'm trying to work with System.Web.Routing. All is just fine, but I can't understand how to make form authentication work with url routing (return url, redirection, etc). Google says nothing. Help! :) **UPD:** I forgot - I **don't use MVC**. That's the problem. How to use rounig and form authentication without MVC...
These steps should allow you to implement the required behaviour. To summarize: 1. You are using routing but not MVC. My example will map a url like <http://host/Mysite/userid/12345> onto a real page at <http://host/Mysite/Pages/users.aspx?userid=12345>. 2. You want to control access to these addresses, requiring ...
405,409
<p>I have</p> <pre><code>$.ajax({ url: identity, success: function(data) { ProcessIdentityServer(data) } }); </code></pre> <p>When 'data' is returned, is there a way to run selectors against it without adding it into the DOM. So for example, how can I get all the href values of any LINK tags contained in the HTML...
[ { "answer_id": 405417, "author": "nakajima", "author_id": 39589, "author_profile": "https://Stackoverflow.com/users/39589", "pm_score": 4, "selected": false, "text": "<p>Presuming that <code>data</code> is a string of HTML, you can do this:</p>\n\n<pre><code>$(data).find('a');\n</code></...
2009/01/01
[ "https://Stackoverflow.com/questions/405409", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39655/" ]
I have ``` $.ajax({ url: identity, success: function(data) { ProcessIdentityServer(data) } }); ``` When 'data' is returned, is there a way to run selectors against it without adding it into the DOM. So for example, how can I get all the href values of any LINK tags contained in the HTML held in 'data' without ad...
``` // Finds all div elements within an XML document from an AJAX response. $("div", xml.responseXML); ```
405,415
<p>Given this line of code in C:</p> <blockquote> <p><code>printf("%3.0f\t%6.1f\n", fahr, <strong>(</strong>(5.0/9.0) * (fahr-32)<strong>)</strong>);</code></p> </blockquote> <p>Is there a way to delete or yank from the first bold parenthesis to its matching parenthesis? I thought about <strong>df)</strong>, but th...
[ { "answer_id": 405420, "author": "David Norman", "author_id": 34502, "author_profile": "https://Stackoverflow.com/users/34502", "pm_score": 4, "selected": false, "text": "<p>Place your cursor on the first parenthesis, then press <code>v%y</code> or <code>v%d</code>.</p>\n" }, { "...
2009/01/01
[ "https://Stackoverflow.com/questions/405415", "https://Stackoverflow.com", "https://Stackoverflow.com/users/50111/" ]
Given this line of code in C: > > `printf("%3.0f\t%6.1f\n", fahr, **(**(5.0/9.0) * (fahr-32)**)**);` > > > Is there a way to delete or yank from the first bold parenthesis to its matching parenthesis? I thought about **df)**, but that only will get you to just after the 9.0. Is there a similar way to get vim to ...
Various Motions: % ------------------ The [`%` command](http://vimdoc.sourceforge.net/htmldoc/motion.html#%) jumps to the match of the item under the cursor. Position the cursor on the opening (or closing) paren and use `y%` for yanking or `d%` for deleting everything from the cursor to the matching paren. This works...
405,426
<p>In Java, it would look like this:</p> <pre><code>class Foo { float[] array; } Foo instance = new Foo(); instance.array = new float[10]; </code></pre>
[ { "answer_id": 405431, "author": "Adam Rosenfield", "author_id": 9530, "author_profile": "https://Stackoverflow.com/users/9530", "pm_score": 5, "selected": true, "text": "<p>You can just use a pointer:</p>\n\n<pre><code>float *array;\n// Allocate 10 floats -- always remember to multiple ...
2009/01/01
[ "https://Stackoverflow.com/questions/405426", "https://Stackoverflow.com", "https://Stackoverflow.com/users/50335/" ]
In Java, it would look like this: ``` class Foo { float[] array; } Foo instance = new Foo(); instance.array = new float[10]; ```
You can just use a pointer: ``` float *array; // Allocate 10 floats -- always remember to multiple by the object size // when calling malloc array = (float *)malloc(10 * sizeof(float)); ... // Deallocate array -- don't forget to do this when you're done with your object free(array); ``` If you're using Objective-C++...
405,429
<p>Coming from a C++ background, I've run into a snag with overloading based on a specific instance of a generic type. The following doesn't work since only once instance of the code for the <code>Foo&lt;T&gt;</code> class is ever generated, so inside the <code>Method</code>, the type of <code>this</code> is simply <c...
[ { "answer_id": 405451, "author": "BenAlabaster", "author_id": 40650, "author_profile": "https://Stackoverflow.com/users/40650", "pm_score": 0, "selected": false, "text": "<p>Edit: I'm not sure that you can complete this as you're attempting. I've tried all sorts of tricks to attempt to ...
2009/01/01
[ "https://Stackoverflow.com/questions/405429", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8701/" ]
Coming from a C++ background, I've run into a snag with overloading based on a specific instance of a generic type. The following doesn't work since only once instance of the code for the `Foo<T>` class is ever generated, so inside the `Method`, the type of `this` is simply `Foo<T>`, not `Foo<A>` or `Foo<B>` as I'd hop...
This works for the static case. Dealing with instance functions would be a bit more complicated. This [post from Jon Skeet](http://msmvps.com/blogs/jon_skeet/archive/2008/08/09/making-reflection-fly-and-exploring-delegates.aspx) might provide a reasonable way to deal with instance methods. ``` class Program { stat...
405,432
<p>I want to fill a map with class name and method, a unique identifier and a pointer to the method.</p> <pre><code>typedef std::map&lt;std::string, std::string, std::string, int&gt; actions_type; typedef actions_type::iterator actions_iterator; actions_type actions; actions.insert(make_pair(class_name, attribute_nam...
[ { "answer_id": 405452, "author": "strager", "author_id": 39992, "author_profile": "https://Stackoverflow.com/users/39992", "pm_score": 3, "selected": false, "text": "<p>Perhaps you're looking for <a href=\"http://www.parashift.com/c++-faq-lite/pointers-to-members.html\" rel=\"nofollow no...
2009/01/01
[ "https://Stackoverflow.com/questions/405432", "https://Stackoverflow.com", "https://Stackoverflow.com/users/47537/" ]
I want to fill a map with class name and method, a unique identifier and a pointer to the method. ``` typedef std::map<std::string, std::string, std::string, int> actions_type; typedef actions_type::iterator actions_iterator; actions_type actions; actions.insert(make_pair(class_name, attribute_name, identifier, metho...
I wrote that stuff last hours, and added it to my collection of useful stuff. The most difficult thing is to cope with the factory function, if the types you want to create are not related in any way. I used a `boost::variant` for this. You have to give it a set of types you ever want to use. Then it will keep track wh...
405,478
<p>Currently I am binding a dataset with a datagrid.</p> <pre><code>ds = query.ExecuteReadQuery("select PollQuestionText as 'Survey Question', PollAnswer1Text as 'Selection 1', PollAnswer2Text as 'Selection 2', PollAnswer3Text as 'Selection 3', PollEnabled 'Status' from tbl_pollquestions") For Each row As Data...
[ { "answer_id": 405563, "author": "mson", "author_id": 36902, "author_profile": "https://Stackoverflow.com/users/36902", "pm_score": 1, "selected": false, "text": "<p>If you are using a gridview, you might want to use as it was intended.</p>\n\n<p>You should have a content template.</p>\n...
2009/01/01
[ "https://Stackoverflow.com/questions/405478", "https://Stackoverflow.com", "https://Stackoverflow.com/users/44973/" ]
Currently I am binding a dataset with a datagrid. ``` ds = query.ExecuteReadQuery("select PollQuestionText as 'Survey Question', PollAnswer1Text as 'Selection 1', PollAnswer2Text as 'Selection 2', PollAnswer3Text as 'Selection 3', PollEnabled 'Status' from tbl_pollquestions") For Each row As Data.DataRow In ds...
Here's one quick way to solves your problem without using content template. First, add `RowDataBound` event to your GridView. ``` <asp:GridView ID="GridView1" runat="server" onrowdatabound="GridView1_RowDataBound"> </asp:GridView> ``` Second, add the code for the event handler using your logic. RowDataBound event w...
405,480
<p>I have a Repeater contol bound to a custom object (an EntitySpaces query) and have noticed there are a couple of ways to conditionally format the values being displayed. </p> <p>1) From my aspx I can call a method in my code-behind and pass through the bound value and use that to drive any conditional logic:</p> <...
[ { "answer_id": 405563, "author": "mson", "author_id": 36902, "author_profile": "https://Stackoverflow.com/users/36902", "pm_score": 1, "selected": false, "text": "<p>If you are using a gridview, you might want to use as it was intended.</p>\n\n<p>You should have a content template.</p>\n...
2009/01/01
[ "https://Stackoverflow.com/questions/405480", "https://Stackoverflow.com", "https://Stackoverflow.com/users/50623/" ]
I have a Repeater contol bound to a custom object (an EntitySpaces query) and have noticed there are a couple of ways to conditionally format the values being displayed. 1) From my aspx I can call a method in my code-behind and pass through the bound value and use that to drive any conditional logic: ``` <a ...
Here's one quick way to solves your problem without using content template. First, add `RowDataBound` event to your GridView. ``` <asp:GridView ID="GridView1" runat="server" onrowdatabound="GridView1_RowDataBound"> </asp:GridView> ``` Second, add the code for the event handler using your logic. RowDataBound event w...
405,489
<p>Is there a built-in function/operator I could use to unpack values from a dictionary and assign it into instance variables?</p> <p>This is what I intend to do:</p> <pre><code>c = MyClass() c.foo = 123 c.bar = 123 # c.foo == 123 and c.bar == 123 d = {'bar': 456} c.update(d) # c.foo == 123 and c.bar == 456 </cod...
[ { "answer_id": 405492, "author": "S.Lott", "author_id": 10661, "author_profile": "https://Stackoverflow.com/users/10661", "pm_score": 5, "selected": false, "text": "<p>Have you tried</p>\n\n<pre><code>f.__dict__.update( b )\n</code></pre>\n\n<p>?</p>\n" }, { "answer_id": 405498, ...
2009/01/01
[ "https://Stackoverflow.com/questions/405489", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3055/" ]
Is there a built-in function/operator I could use to unpack values from a dictionary and assign it into instance variables? This is what I intend to do: ``` c = MyClass() c.foo = 123 c.bar = 123 # c.foo == 123 and c.bar == 123 d = {'bar': 456} c.update(d) # c.foo == 123 and c.bar == 456 ``` Something akin to dic...
there is also another way of doing it by looping through the items in d. this doesn't have the same assuption that they will get stored in `c.__dict__` which isn't always true. ``` d = {'bar': 456} for key,value in d.items(): setattr(c,key,value) ``` or you could write a `update` method as part of `MyClass` so ...
405,508
<p>Kind of related to my <a href="https://stackoverflow.com/questions/405480/best-practices-when-applying-conditional-formatting-in-data-bound-controls">other question</a> - I've only ever used HTMLControls with runat="server" and WebControls grudgingly, preferring to have control over the markup that gets generated (i...
[ { "answer_id": 405538, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 2, "selected": true, "text": "<p>When you say \"databinding,\" are you speaking of binding a database result set to a Gridview or Repeater, etc. via a .Bind(...
2009/01/01
[ "https://Stackoverflow.com/questions/405508", "https://Stackoverflow.com", "https://Stackoverflow.com/users/50623/" ]
Kind of related to my [other question](https://stackoverflow.com/questions/405480/best-practices-when-applying-conditional-formatting-in-data-bound-controls) - I've only ever used HTMLControls with runat="server" and WebControls grudgingly, preferring to have control over the markup that gets generated (including the i...
When you say "databinding," are you speaking of binding a database result set to a Gridview or Repeater, etc. via a .Bind() call, or just using any ASP.NET server control (or HTML server control) in general? Because, if you just want to avoid using server controls in general, but don't want to use Response.Write eithe...
405,516
<p>Using Python 2.6, is there a way to check if all the items of a sequence equals a given value, in one statement?</p> <pre><code>[pseudocode] my_sequence = (2,5,7,82,35) if all the values in (type(i) for i in my_sequence) == int: do() </code></pre> <p>Instead of, say:</p> <pre><code>my_sequence = (2,5,7,82,3...
[ { "answer_id": 405519, "author": "S.Lott", "author_id": 10661, "author_profile": "https://Stackoverflow.com/users/10661", "pm_score": 4, "selected": false, "text": "<p>Do you mean</p>\n\n<pre><code>all( type(i) is int for i in my_list )\n</code></pre>\n\n<p>?</p>\n\n<p>Edit: Changed to ...
2009/01/01
[ "https://Stackoverflow.com/questions/405516", "https://Stackoverflow.com", "https://Stackoverflow.com/users/44563/" ]
Using Python 2.6, is there a way to check if all the items of a sequence equals a given value, in one statement? ``` [pseudocode] my_sequence = (2,5,7,82,35) if all the values in (type(i) for i in my_sequence) == int: do() ``` Instead of, say: ``` my_sequence = (2,5,7,82,35) all_int = True for i in my_sequenc...
Use: ``` all( type(i) is int for i in lst ) ``` Example: ``` In [1]: lst = range(10) In [2]: all( type(i) is int for i in lst ) Out[2]: True In [3]: lst.append('steve') In [4]: all( type(i) is int for i in lst ) Out[4]: False ``` [Edit]. Made cleaner as per comments.
405,518
<p>I am writing unit tests for my presentation class in MVP pattern.But I am having trouble to write mock setup code. </p> <p>I have a presenter and when presenter's Load method called I want to test view should load class properties, table fields, data types,set presenter.... So When I have a different thing to do wh...
[ { "answer_id": 406737, "author": "caltuntas", "author_id": 36474, "author_profile": "https://Stackoverflow.com/users/36474", "pm_score": 2, "selected": true, "text": "<p>After a long sleepless night and research I have found this solution.When I thougt carefully I have came up with this....
2009/01/01
[ "https://Stackoverflow.com/questions/405518", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36474/" ]
I am writing unit tests for my presentation class in MVP pattern.But I am having trouble to write mock setup code. I have a presenter and when presenter's Load method called I want to test view should load class properties, table fields, data types,set presenter.... So When I have a different thing to do when present...
After a long sleepless night and research I have found this solution.When I thougt carefully I have came up with this. I am testing too many behaviour in one test. And I have changed the tests like this ``` [TestFixture] public class When_Presenter_Loads { private MockRepository mockRepository; private ITableR...
405,526
<p>Does anybody know of a tool that allow me to inspect what files an installer just added to a system after it ran? </p> <p>Its sounds like this should be something that should exist.</p>
[ { "answer_id": 406737, "author": "caltuntas", "author_id": 36474, "author_profile": "https://Stackoverflow.com/users/36474", "pm_score": 2, "selected": true, "text": "<p>After a long sleepless night and research I have found this solution.When I thougt carefully I have came up with this....
2009/01/01
[ "https://Stackoverflow.com/questions/405526", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9611/" ]
Does anybody know of a tool that allow me to inspect what files an installer just added to a system after it ran? Its sounds like this should be something that should exist.
After a long sleepless night and research I have found this solution.When I thougt carefully I have came up with this. I am testing too many behaviour in one test. And I have changed the tests like this ``` [TestFixture] public class When_Presenter_Loads { private MockRepository mockRepository; private ITableR...
405,537
<p>I'm new to C, and am confused by results I'm getting when referencing a member of a struct via a pointer. See the following code for an example. What's happening when I reference tst->number the first time? What fundamental thing am I missing here?</p> <pre><code>#include &lt;stdio.h&gt; #include &lt;stdlib.h&gt...
[ { "answer_id": 405561, "author": "jason", "author_id": 45914, "author_profile": "https://Stackoverflow.com/users/45914", "pm_score": 1, "selected": false, "text": "<p>You are returning the address of <code>t</code> as declared in the method <code>Test_New</code>, not the address of <code...
2009/01/01
[ "https://Stackoverflow.com/questions/405537", "https://Stackoverflow.com", "https://Stackoverflow.com/users/50758/" ]
I'm new to C, and am confused by results I'm getting when referencing a member of a struct via a pointer. See the following code for an example. What's happening when I reference tst->number the first time? What fundamental thing am I missing here? ``` #include <stdio.h> #include <stdlib.h> typedef struct { int nu...
When you pass test into your Test\_New function, you are passing it by value and so a local copy is made on the stack for the function scope of your Test\_New function. Since you return the address of the variable, once the function returns the stack is useless but you've returned a pointer to a struct on the old stack...
405,540
<p>I was just reading through <a href="http://books.google.com/books?id=1HxWGezDZcgC&amp;lpg=PP1&amp;dq=learning%20python&amp;pg=PA254#v=onepage&amp;q=cyclic&amp;f=false" rel="nofollow noreferrer">"Learning Python" by Mark Lutz and came across this code sample</a>:</p> <pre><code> >>> L = ['grail'] >>> L.append(L) >>>...
[ { "answer_id": 405562, "author": "Beau Simensen", "author_id": 50453, "author_profile": "https://Stackoverflow.com/users/50453", "pm_score": 0, "selected": false, "text": "<p>One example would be a linked list where the last item points the first. This would allow you to create a fixed n...
2009/01/01
[ "https://Stackoverflow.com/questions/405540", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2908/" ]
I was just reading through ["Learning Python" by Mark Lutz and came across this code sample](http://books.google.com/books?id=1HxWGezDZcgC&lpg=PP1&dq=learning%20python&pg=PA254#v=onepage&q=cyclic&f=false): ``` >>> L = ['grail'] >>> L.append(L) >>> L ['grail', [...]] ``` It was identified as a cyclic data structure....
Lots of things. Circular buffer, for example: you have some collection of data with a front and a back, but an arbitrary number of nodes, and the "next" item from the last should take you back to the first. Graph structures are often cyclic; acyclicity is a special case. Consider, for example, a graph containing all t...
405,583
<p>I'm trying to write a query that updates rows in a table if a certain column has a value in a list I'm providing:</p> <pre><code>UPDATE MY_TABLE SET COL1 = 'xyz' WHERE COL2 IN ('x', 'y', 'z'); </code></pre> <p>I'm getting a syntax error, but I know that this should be possible. It's essentially a single command to...
[ { "answer_id": 405595, "author": "Beau Simensen", "author_id": 50453, "author_profile": "https://Stackoverflow.com/users/50453", "pm_score": 0, "selected": false, "text": "<p>Is that your full update query? It looks like it is missing the end part. Short of the missing bits, it looks fin...
2009/01/01
[ "https://Stackoverflow.com/questions/405583", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23249/" ]
I'm trying to write a query that updates rows in a table if a certain column has a value in a list I'm providing: ``` UPDATE MY_TABLE SET COL1 = 'xyz' WHERE COL2 IN ('x', 'y', 'z'); ``` I'm getting a syntax error, but I know that this should be possible. It's essentially a single command to execute the following 3 c...
You should post the *precise* error message. The error message will give a clue about what part of the query confused the parser. Do some of the values x, y, z contain quotes as part of the value? You could have imbalanced quotes. For example the following is clearly a syntax error: ``` UPDATE MY_TABLE SET COL1 = 'xy...
405,588
<p>How would you model a turn-based game server as a RESTful API? For example, a chess server, where you could play a game of chess against another client of the same API. You would need some way of requesting and negotiating a game with the other client, and some way of playing the individual moves of the game.</p> <...
[ { "answer_id": 405601, "author": "nakajima", "author_id": 39589, "author_profile": "https://Stackoverflow.com/users/39589", "pm_score": 1, "selected": false, "text": "<p>I think you could <em>model</em> it RESTfully. <em>Implementing</em> it will be more difficult, because you'd either n...
2009/01/01
[ "https://Stackoverflow.com/questions/405588", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29173/" ]
How would you model a turn-based game server as a RESTful API? For example, a chess server, where you could play a game of chess against another client of the same API. You would need some way of requesting and negotiating a game with the other client, and some way of playing the individual moves of the game. Is this ...
What are the resources you're trying to model? I would seem to have four: You, your opponent, the particular game (session, instance) and the game board state. So it would start with something like ``` /game /game/gameID/gamer/gamerID /game/gameID/board ``` we've got a good intro/overview on [InfoQ](http://www.infoq...
405,600
<p>For whatever reason, <code>ThreadPool</code>'s <code>QueueWorkItem</code> doesn't return an <code>IAsyncResult</code> or some other handle to the work item, which would allow to wait until it's completed. There are <code>RegisterWait...</code> methods, but you have to pass a <code>WaitHandle</code> and creating them...
[ { "answer_id": 405733, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 4, "selected": true, "text": "<p>Well, you've got a race condition between fetching the WaitHandle and setting it. Do you really want the caller to be ...
2009/01/01
[ "https://Stackoverflow.com/questions/405600", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9204/" ]
For whatever reason, `ThreadPool`'s `QueueWorkItem` doesn't return an `IAsyncResult` or some other handle to the work item, which would allow to wait until it's completed. There are `RegisterWait...` methods, but you have to pass a `WaitHandle` and creating them is expensive (see `IAsyncResult` documentation, which adv...
Well, you've got a race condition between fetching the WaitHandle and setting it. Do you really want the caller to be waiting forever if they happen to be a tiny bit late? You should probably do some appropriate locking and keep an "I've finished" flag so that if you *do* create the WaitHandle after it's finished, you...
405,617
<p>I'm having a small problem with a Python program (below) that I'm writing. </p> <p>I want to insert two values from a MySQL table into another table from a Python program.</p> <p>The two fields are priority and product and I have selected them from the shop table and I want to insert them into the products table. ...
[ { "answer_id": 405625, "author": "Loïc Wolff", "author_id": 12008, "author_profile": "https://Stackoverflow.com/users/12008", "pm_score": 2, "selected": false, "text": "<pre><code>import sys\n\nfor arg in sys.argv:\n print arg\n</code></pre>\n" }, { "answer_id": 405629, "aut...
2009/01/01
[ "https://Stackoverflow.com/questions/405617", "https://Stackoverflow.com", "https://Stackoverflow.com/users/47204/" ]
I'm having a small problem with a Python program (below) that I'm writing. I want to insert two values from a MySQL table into another table from a Python program. The two fields are priority and product and I have selected them from the shop table and I want to insert them into the products table. Can anyone help...
1. Find out what the dragged file was: <http://docs.python.org/library/sys.html#sys.argv> 2. Open it: <http://docs.python.org/library/functions.html#open> 3. Read it in: <http://docs.python.org/library/stdtypes.html#file.read> 4. Post it: <http://docs.python.org/library/urllib2.html#urllib2.urlopen>
405,619
<p>How can you check whether a <strong>string</strong> is <strong>convertible</strong> to an <strong>int?</strong></p> <p>Let's say we have data like "House", "50", "Dog", "45.99", I want to know whether I should just use the <strong>string</strong> or use the parsed <strong>int</strong> value instead.</p> <p><em>In ...
[ { "answer_id": 405633, "author": "Johnno Nolan", "author_id": 1116, "author_profile": "https://Stackoverflow.com/users/1116", "pm_score": 7, "selected": true, "text": "<p><code>Int32.TryParse(String, Int32)</code> - <a href=\"http://msdn.microsoft.com/en-us/library/f02979c7.aspx\" rel=\"...
2009/01/01
[ "https://Stackoverflow.com/questions/405619", "https://Stackoverflow.com", "https://Stackoverflow.com/users/41021/" ]
How can you check whether a **string** is **convertible** to an **int?** Let's say we have data like "House", "50", "Dog", "45.99", I want to know whether I should just use the **string** or use the parsed **int** value instead. *In JavaScript we had this [parseInt()](http://www.w3schools.com/jsref/jsref_parseInt.asp...
`Int32.TryParse(String, Int32)` - <http://msdn.microsoft.com/en-us/library/f02979c7.aspx> ``` bool result = Int32.TryParse(value, out number); if (result) { Console.WriteLine("Converted '{0}' to {1}.", value, number); } ```
405,640
<p>I'm in the process of developing a web interface to a service business management application that uses a Pervasive SQL database to store information (not my choice, by the way). At the moment, I'm using the official Pervasive SqlClient implementation with a custom set of query generation classes so I can write code...
[ { "answer_id": 405650, "author": "dkretz", "author_id": 31641, "author_profile": "https://Stackoverflow.com/users/31641", "pm_score": 0, "selected": false, "text": "<p>You should be able to find the ODBC drivers from Pervasive - they must be solid or Pervasive would be out of business by...
2009/01/01
[ "https://Stackoverflow.com/questions/405640", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31516/" ]
I'm in the process of developing a web interface to a service business management application that uses a Pervasive SQL database to store information (not my choice, by the way). At the moment, I'm using the official Pervasive SqlClient implementation with a custom set of query generation classes so I can write code li...
Pervasive.SQL has a pretty solid ADO Adapter, and rocks over ODBC in most cases; I have used if successufully for years, but not without the headaches of Pervasive's syntax. In Pervasive's defense their relational engine does comply with SQL-92 and most of SQL-99. What I am curious about is what parts of the syntax a...
405,647
<p>I am generally wary of implementing interfaces partially. However, <code>IAsyncResult</code> is a bit of a special case, given that it supports several quite different usage patterns. How often do you use/see used the <code>AsyncState</code>/<code>AsyncCallback</code> pattern, as opposed to just calling <code>EndInv...
[ { "answer_id": 405721, "author": "Community", "author_id": -1, "author_profile": "https://Stackoverflow.com/users/-1", "pm_score": 3, "selected": true, "text": "<ul>\n<li>In my experience, just calling EndInvoke without either waiting or being called back first is rarely useful</li>\n<li...
2009/01/01
[ "https://Stackoverflow.com/questions/405647", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9204/" ]
I am generally wary of implementing interfaces partially. However, `IAsyncResult` is a bit of a special case, given that it supports several quite different usage patterns. How often do you use/see used the `AsyncState`/`AsyncCallback` pattern, as opposed to just calling `EndInvoke`, using `AsyncWaitHandle`, or polling...
* In my experience, just calling EndInvoke without either waiting or being called back first is rarely useful * Just providing callbacks is sometimes not enough, as your clients might want to wait for multiple operations at once (WaitAny, WaitAll) * I've never polled IsCompleted, yuck indeed! So, you could save the imp...
405,652
<p>I want to do something like this:</p> <pre><code>c:\data\&gt; python myscript.py *.csv </code></pre> <p>and pass all of the .csv files in the directory to my python script (such that <code>sys.argv</code> contains <code>["file1.csv", "file2.csv"]</code>, etc.) </p> <p>But <code>sys.argv</code> just receives <code...
[ { "answer_id": 405662, "author": "Vinko Vrsalovic", "author_id": 5190, "author_profile": "https://Stackoverflow.com/users/5190", "pm_score": 6, "selected": true, "text": "<p>You can use the glob module, that way you won't depend on the behavior of a particular shell (well, you still depe...
2009/01/01
[ "https://Stackoverflow.com/questions/405652", "https://Stackoverflow.com", "https://Stackoverflow.com/users/49559/" ]
I want to do something like this: ``` c:\data\> python myscript.py *.csv ``` and pass all of the .csv files in the directory to my python script (such that `sys.argv` contains `["file1.csv", "file2.csv"]`, etc.) But `sys.argv` just receives `["*.csv"]` indicating that the wildcard was not expanded, so this doesn't...
You can use the glob module, that way you won't depend on the behavior of a particular shell (well, you still depend on the shell not expanding the arguments, but at least you can get this to happen in Unix by escaping the wildcards :-) ). ``` from glob import glob filelist = glob('*.csv') #You can pass the sys.argv a...
405,679
<p>I can write:</p> <pre><code>update my_table set xml = updateXML(xml, '/a/b', '1') where document_id = 123 </code></pre> <p>Now what if in the same update query I also want to set /a/c to 2 (in addition /a/b to 1)? I am tempted to write:</p> <pre><code>update my_table set xml = updateXML(xml, '/a/b', '1'), ...
[ { "answer_id": 405744, "author": "Gary Myers", "author_id": 25714, "author_profile": "https://Stackoverflow.com/users/25714", "pm_score": 4, "selected": true, "text": "<p>The documentation indicates that the XPath string and expression can be repeated\n<a href=\"http://download.oracle.co...
2009/01/01
[ "https://Stackoverflow.com/questions/405679", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5295/" ]
I can write: ``` update my_table set xml = updateXML(xml, '/a/b', '1') where document_id = 123 ``` Now what if in the same update query I also want to set /a/c to 2 (in addition /a/b to 1)? I am tempted to write: ``` update my_table set xml = updateXML(xml, '/a/b', '1'), xml = updateXML(xml, '/a/c', '2') w...
The documentation indicates that the XPath string and expression can be repeated <http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/functions205.htm#i1134878> so try update my\_table set xml = updateXML(xml, '/a/b', '1', '/a/c', '2') where document\_id = 123
405,684
<p>I am having trouble with PHP regarding encoding.</p> <p>I have a JavaScript/jQuery HTML5 page interact with my PHP script using $.post. However, PHP is facing a weird problem, probably related to encoding.</p> <p>When I write</p> <pre><code>htmlentities("í") </code></pre> <p>I expect PHP to output <code>&amp;ia...
[ { "answer_id": 405691, "author": "Eran Galperin", "author_id": 10585, "author_profile": "https://Stackoverflow.com/users/10585", "pm_score": 4, "selected": false, "text": "<p>It's very important to specify the encoding of <a href=\"http://www.php.net/htmlentities\" rel=\"noreferrer\">htm...
2009/01/01
[ "https://Stackoverflow.com/questions/405684", "https://Stackoverflow.com", "https://Stackoverflow.com/users/32775/" ]
I am having trouble with PHP regarding encoding. I have a JavaScript/jQuery HTML5 page interact with my PHP script using $.post. However, PHP is facing a weird problem, probably related to encoding. When I write ``` htmlentities("í") ``` I expect PHP to output `&iacute;`. However, instead it outputs `&Atilde;&shy;...
It's very important to specify the encoding of [htmlentities](http://www.php.net/htmlentities) to match that of the input, as you did in your final example but omitted in the first three. ``` htmlentities($text,ENT_COMPAT,'utf-8'); ``` Regarding communications with MySQL, you need to make sure the connection collati...
405,761
<p>In statically typed functional programming languages, like Standard ML, F#, OCaml and Haskell, a function will usually be written with the parameters separated from each other and from the function name simply by whitespace:</p> <pre><code>let add a b = a + b </code></pre> <p>The type here being "<code>int -&g...
[ { "answer_id": 405765, "author": "ShreevatsaR", "author_id": 4958, "author_profile": "https://Stackoverflow.com/users/4958", "pm_score": 2, "selected": false, "text": "<p>Possibly because it is useful to have a tuple as a separate type, and it is good to keep different types separate?</p...
2009/01/02
[ "https://Stackoverflow.com/questions/405761", "https://Stackoverflow.com", "https://Stackoverflow.com/users/41489/" ]
In statically typed functional programming languages, like Standard ML, F#, OCaml and Haskell, a function will usually be written with the parameters separated from each other and from the function name simply by whitespace: ``` let add a b = a + b ``` The type here being "`int -> (int -> int)`", i.e. a function...
I think the consensus today is to handle *multiple arguments* by currying (the `a -> b -> c` form) and to reserve tuples for when you genuinely want values of tuple type (in lists and so on). This consensus is respected by every statically typed functional language since Standard ML, which (purely as a matter of conven...
405,770
<p>I always wonder why compilers can't figure out simple things that are obvious to the human eye. They do lots of simple optimizations, but never something even a little bit complex. For example, this code takes about 6 seconds on my computer to print the value zero (using java 1.6):</p> <pre class="lang-java prettypr...
[ { "answer_id": 405775, "author": "Daniel Schaffer", "author_id": 2596, "author_profile": "https://Stackoverflow.com/users/2596", "pm_score": 4, "selected": false, "text": "<p>Seriously? Why would anyone ever write real-world code like that? IMHO, the code, not the compiler is the \"stupi...
2009/01/02
[ "https://Stackoverflow.com/questions/405770", "https://Stackoverflow.com", "https://Stackoverflow.com/users/48181/" ]
I always wonder why compilers can't figure out simple things that are obvious to the human eye. They do lots of simple optimizations, but never something even a little bit complex. For example, this code takes about 6 seconds on my computer to print the value zero (using java 1.6): ```java int x = 0; for (int i = 0; i...
Oh, I don't know. Sometimes compilers are pretty smart. Consider the following C program: ``` #include <stdio.h> /* printf() */ int factorial(int n) { return n == 0 ? 1 : n * factorial(n - 1); } int main() { int n = 10; printf("factorial(%d) = %d\n", n, factorial(n)); return 0; } ``` On my version o...
405,782
<p>I am updating some code from the old mysql_* functions to PDO. It connects without a problem, runs the query without a problem, but the resultset is empty. PDO::query() is supposed to return a PDOStatement object, yet I am getting true in return. No errors are reported.</p> <p>Here is my code:</p> <pre><code> t...
[ { "answer_id": 405801, "author": "Bill Karwin", "author_id": 20860, "author_profile": "https://Stackoverflow.com/users/20860", "pm_score": 4, "selected": true, "text": "<pre><code>object \ntrue \nERROR: getClientInfo query failed.\n</code></pre>\n\n<p>It looks to me like your <code>PDO...
2009/01/02
[ "https://Stackoverflow.com/questions/405782", "https://Stackoverflow.com", "https://Stackoverflow.com/users/47858/" ]
I am updating some code from the old mysql\_\* functions to PDO. It connects without a problem, runs the query without a problem, but the resultset is empty. PDO::query() is supposed to return a PDOStatement object, yet I am getting true in return. No errors are reported. Here is my code: ``` try { $DB = new PDO...
``` object true ERROR: getClientInfo query failed. ``` It looks to me like your `PDOStatement $stmt` variable is in fact reported to be an object, not "`true`". The code then prints "`true`" when it sees that `$stmt` is non-null, which it is, because it's an object. I recommend that you check the return value fr...
405,786
<p>I have a Joomla site which uses <code>mod_rewrite</code> to create pretty urls.</p> <pre><code>http://www.example.com/resources/newsletter </code></pre> <p>However this created a problem. Including images like this: <code>src="images/pic.jpg"</code>, it would then look for a file at:</p> <pre><code>http://www.exa...
[ { "answer_id": 405818, "author": "Sophie Alpert", "author_id": 49485, "author_profile": "https://Stackoverflow.com/users/49485", "pm_score": 2, "selected": false, "text": "<p>Is it possible to change your <code>src</code> attribute to be something like <code>/images/pic.jpg</code>? That'...
2009/01/02
[ "https://Stackoverflow.com/questions/405786", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9021/" ]
I have a Joomla site which uses `mod_rewrite` to create pretty urls. ``` http://www.example.com/resources/newsletter ``` However this created a problem. Including images like this: `src="images/pic.jpg"`, it would then look for a file at: ``` http://www.example.com/resources/newsletter/images/pic.jpg ``` ...which...
Is it possible to change your `src` attribute to be something like `/images/pic.jpg`? That'll achieve the effect you're looking for. If that's not possible, this (untested) jQuery code should work for you: ``` $('a[@href^="#"]').click(function() { var hash = this.hash, el = $(hash), offset; if(!el.size()) { ...
405,795
<p>I have a somewhat complex query with roughly 100K rows.</p> <p>The query runs in 13 seconds in SQL Server Express (run on my dev box)</p> <p>The same query with the same indexing and tables takes over 15+ minutes to run on MySQL 5.1 (run on my production box - much more powerful and tested with 100% resources) An...
[ { "answer_id": 405803, "author": "dkretz", "author_id": 31641, "author_profile": "https://Stackoverflow.com/users/31641", "pm_score": 1, "selected": false, "text": "<p>100,000 rows shouldn't take 13 seconds if efficient indexes were available. I suspect the difference is due to the fact ...
2009/01/02
[ "https://Stackoverflow.com/questions/405795", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36902/" ]
I have a somewhat complex query with roughly 100K rows. The query runs in 13 seconds in SQL Server Express (run on my dev box) The same query with the same indexing and tables takes over 15+ minutes to run on MySQL 5.1 (run on my production box - much more powerful and tested with 100% resources) And sometimes the qu...
This answer I originally attempted to post to your deleted question which did not indicate that it was a problem with MySQL. I would still go ahead and use SQL Server to refactor the query using the CTEs and then convert back to nested queries (if any remain). Sorry about the formatting, Jeff Atwood sent me the origina...
405,810
<p>Basically you have two ways for doing this:</p> <pre><code>for (int x = 0; x &lt; UPPER_X; x++) for (int y = 0; y &lt; UPPER_Y; y++) { arr1[x, y] = get_value(); arr2[y, x] = get_value(); } </code></pre> <p>The only difference is what variable to change in the inner loop: first o...
[ { "answer_id": 405825, "author": "Mitch Wheat", "author_id": 16076, "author_profile": "https://Stackoverflow.com/users/16076", "pm_score": 2, "selected": false, "text": "<p>You should benchmark your particular circumstances to be sure.</p>\n\n<p>You would think that there would be no dif...
2009/01/02
[ "https://Stackoverflow.com/questions/405810", "https://Stackoverflow.com", "https://Stackoverflow.com/users/50727/" ]
Basically you have two ways for doing this: ``` for (int x = 0; x < UPPER_X; x++) for (int y = 0; y < UPPER_Y; y++) { arr1[x, y] = get_value(); arr2[y, x] = get_value(); } ``` The only difference is what variable to change in the inner loop: first or second. I heard that the resul...
The reason one is faster than the other has to do with the processor's cache, and the way the data is laid out in memory. There are two normal ways to store the two-dimensional data is in one-dimensional address space, Either you can store all of the data for the first row, then the second row, and so on (aka [*row ma...
405,812
<p>I am trying to use a hyperlinkbutton in silverlight to enable the user to download a word document. I don't care if a file save as box appears or if the word doc opens in a new browser. I get the error "cannot navigate to locations relative to a page." I've seen it posted that you can do this with the absolute pa...
[ { "answer_id": 407626, "author": "Michael S. Scherotter", "author_id": 27306, "author_profile": "https://Stackoverflow.com/users/27306", "pm_score": 3, "selected": true, "text": "<p>The HyperlinkButton only works with absolute URLS, so you should fixup your URLs at runtime:</p>\n\n<pre><...
2009/01/02
[ "https://Stackoverflow.com/questions/405812", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5115/" ]
I am trying to use a hyperlinkbutton in silverlight to enable the user to download a word document. I don't care if a file save as box appears or if the word doc opens in a new browser. I get the error "cannot navigate to locations relative to a page." I've seen it posted that you can do this with the absolute path (ww...
The HyperlinkButton only works with absolute URLS, so you should fixup your URLs at runtime: ``` uriCurrent = System.Windows.Browser.HtmlPage.Document.DocumentUri; string current = uriCurrent.OriginalString; int iLastSlash = current.LastIndexOf('/') + 1; current = current.Remove(iLastSlash, current.Length - iLastSlash...
405,826
<p>My problem is thus: I need a way to ensure only one given class can instantiate another. I don't want to have to make the other a nested inner class or something dumb like that. How do I do this? I forget offhand.</p>
[ { "answer_id": 405835, "author": "frankodwyer", "author_id": 42404, "author_profile": "https://Stackoverflow.com/users/42404", "pm_score": 1, "selected": false, "text": "<p>You could make the class that is to be protected from instantiation package private.</p>\n" }, { "answer_id...
2009/01/02
[ "https://Stackoverflow.com/questions/405826", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19825/" ]
My problem is thus: I need a way to ensure only one given class can instantiate another. I don't want to have to make the other a nested inner class or something dumb like that. How do I do this? I forget offhand.
Make the constructor private. Create a static factory method that takes an instance of the class that is allowed access. Have the factory method create a suitable object and use a settor on the object that is allowed access to the created object to give that class the created copy. ``` public class AllowedAccess { ...
405,897
<p>Using Zend_Form, how would I create form elements like this:</p> <pre><code>&lt;input type="text" name="element[1]" value="" /&gt; &lt;input type="text" name="element[2]" value="" /&gt; // etc... </code></pre>
[ { "answer_id": 406268, "author": "Stefan Gehrig", "author_id": 11354, "author_profile": "https://Stackoverflow.com/users/11354", "pm_score": 6, "selected": true, "text": "<p>You can either use subforms:</p>\n\n<pre><code>$form = new Zend_Form();\n\n$subForm = new Zend_Form_SubForm();\n$s...
2009/01/02
[ "https://Stackoverflow.com/questions/405897", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3765/" ]
Using Zend\_Form, how would I create form elements like this: ``` <input type="text" name="element[1]" value="" /> <input type="text" name="element[2]" value="" /> // etc... ```
You can either use subforms: ``` $form = new Zend_Form(); $subForm = new Zend_Form_SubForm(); $subForm->addElement('Text', '1') ->addElement('Text', '2'); $form->addSubForm($subForm, 'element'); ``` Or you should also be able to use `setBelongsTo()` on the form elements (untested): ``` $form = new Zend_Fo...
405,901
<p>I've created an ASP.Net user control that will get placed more than once inside of web page. In this control I've defined a javascript object such as:</p> <pre><code>function MyObject( options ) { this.x = options.x; } MyObject.prototype.someFunction=function someFunctionF() { return this.x + 1; } </code></pre...
[ { "answer_id": 405911, "author": "tvanfosson", "author_id": 12950, "author_profile": "https://Stackoverflow.com/users/12950", "pm_score": 0, "selected": false, "text": "<p>If it is just one value, why not have the function take it as a parameter and build your onclick handler so that it ...
2009/01/02
[ "https://Stackoverflow.com/questions/405901", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20651/" ]
I've created an ASP.Net user control that will get placed more than once inside of web page. In this control I've defined a javascript object such as: ``` function MyObject( options ) { this.x = options.x; } MyObject.prototype.someFunction=function someFunctionF() { return this.x + 1; } ``` In the code behind I...
Your Javascript like this:- ``` function MyObject(options) { this.x = options.x; } MyObject.prototype.someFunction = function() { return this.x + 1; } MyObject.create(id, options) { if (!this._instances) this._instances = {}; return this._instances[id] = new MyObject(options); } MyObject.getInstance(id) { retu...
405,910
<p>I have a query to insert a row into a table, which has a field called ID, which is populated using an AUTO_INCREMENT on the column. I need to get this value for the next bit of functionality, but when I run the following, it always returns 0 even though the actual value is not 0:</p> <pre><code>MySqlCommand comm = ...
[ { "answer_id": 405922, "author": "Michael Haren", "author_id": 29, "author_profile": "https://Stackoverflow.com/users/29", "pm_score": 6, "selected": true, "text": "<p>[Edit: added \"select\" before references to last_insert_id()]</p>\n\n<p>What about running \"<code>select last_insert_i...
2009/01/02
[ "https://Stackoverflow.com/questions/405910", "https://Stackoverflow.com", "https://Stackoverflow.com/users/23249/" ]
I have a query to insert a row into a table, which has a field called ID, which is populated using an AUTO\_INCREMENT on the column. I need to get this value for the next bit of functionality, but when I run the following, it always returns 0 even though the actual value is not 0: ``` MySqlCommand comm = connect.Creat...
[Edit: added "select" before references to last\_insert\_id()] What about running "`select last_insert_id();`" after your insert? ``` MySqlCommand comm = connect.CreateCommand(); comm.CommandText = insertInvoice; comm.CommandText += "\'" + invoiceDate.ToString("yyyy:MM:dd hh:mm:ss") + "\', " + bookFee + ", " + ...
405,950
<p>If there is a REST resource that I want to monitor for changes or modifications from other clients, what is the best (and most RESTful) way of doing so?</p> <p>One idea I've had for doing so is by providing specific resources that will keep the connection open rather than returning immediately if the resource does ...
[ { "answer_id": 405973, "author": "Ross", "author_id": 29173, "author_profile": "https://Stackoverflow.com/users/29173", "pm_score": 2, "selected": false, "text": "<p>I found <a href=\"http://cometdaily.com/2007/12/27/a-standards-based-approach-to-comet-communication-with-rest/\" rel=\"no...
2009/01/02
[ "https://Stackoverflow.com/questions/405950", "https://Stackoverflow.com", "https://Stackoverflow.com/users/29173/" ]
If there is a REST resource that I want to monitor for changes or modifications from other clients, what is the best (and most RESTful) way of doing so? One idea I've had for doing so is by providing specific resources that will keep the connection open rather than returning immediately if the resource does not (yet) ...
Your proposed solution sounds like [long polling](https://stackoverflow.com/questions/333664/simple-long-polling-example-code), which could work really well. You would request `/game/17/move/5` and the server will not send any data, until move 5 has been completed. If the connection drops, or you get a time-out, you s...
405,967
<p>The WPF <code>TextBox</code> natively makes use of the System Highlight color for painting the background of selected text. I would like to override this and make it consistent since it varies by OS/user theme.</p> <p>For <code>ListBoxItem</code>s, there is a <a href="http://blogs.msdn.com/wpfsdk/archive/2007/08/31...
[ { "answer_id": 406328, "author": "Jobi Joy", "author_id": 8091, "author_profile": "https://Stackoverflow.com/users/8091", "pm_score": -1, "selected": false, "text": "<p>You can create a Style for the TextBox and write a Setter for the background. The TextBox style should be a default one...
2009/01/02
[ "https://Stackoverflow.com/questions/405967", "https://Stackoverflow.com", "https://Stackoverflow.com/users/41693/" ]
The WPF `TextBox` natively makes use of the System Highlight color for painting the background of selected text. I would like to override this and make it consistent since it varies by OS/user theme. For `ListBoxItem`s, there is a [neat trick](http://blogs.msdn.com/wpfsdk/archive/2007/08/31/specifying-the-selection-co...
As Steve mentioned : [NOTE: This behavior appears to be added to WPF 4.](https://learn.microsoft.com/en-us/archive/blogs/llobo/new-wpf-features-caretbrushselectionbrush) I bumped into the same problem. As Dr.WPF says > > "It is entirely impossible in the > current .NET releases (3.0 & 3.5 > beta). The control is ha...
405,995
<p>Could you, please, give a code snippet showing how to use Lua embedded in OCaml?</p> <p>A simple example could be a &quot;Hello, World&quot; variant. Have OCaml prompt the user for a name. Then pass that name to a Lua function. Have Lua print a greeting and return the length of the name. Then have OCaml print a ...
[ { "answer_id": 406036, "author": "Norman Ramsey", "author_id": 41661, "author_profile": "https://Stackoverflow.com/users/41661", "pm_score": 4, "selected": true, "text": "<p>I'm not aware of a mature set of bindings for embedding the C implementation of Lua into OCaml. An immature set o...
2009/01/02
[ "https://Stackoverflow.com/questions/405995", "https://Stackoverflow.com", "https://Stackoverflow.com/users/50797/" ]
Could you, please, give a code snippet showing how to use Lua embedded in OCaml? A simple example could be a "Hello, World" variant. Have OCaml prompt the user for a name. Then pass that name to a Lua function. Have Lua print a greeting and return the length of the name. Then have OCaml print a message about the lengt...
I'm not aware of a mature set of bindings for embedding the C implementation of Lua into OCaml. An immature set of bindings was [posted on the Caml mailing list in 2004](http://tinyurl.com/9cx5xm). If you want to use the ML implementation you can find some examples in a paper called [ML Module Mania](http://www.cs.tu...
406,010
<p>There is a pointer-to-an-Array of Arrays i.e. NameList in the code. I want the contents of each of the Arrays in the Pointer(NameList) to get printed one by one. The below code is not able do the task. Pls. help.</p> <pre><code>int Data1[] = {10,10}; int Data2[] = {20,20}; int Data3[] = {30,30}; int *NameList[...
[ { "answer_id": 406032, "author": "strager", "author_id": 39992, "author_profile": "https://Stackoverflow.com/users/39992", "pm_score": 0, "selected": false, "text": "<pre><code>int Data1[]\n</code></pre>\n\n<p>has the type of</p>\n\n<pre><code>int *\n</code></pre>\n\n<p>and</p>\n\n<pre><...
2009/01/02
[ "https://Stackoverflow.com/questions/406010", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
There is a pointer-to-an-Array of Arrays i.e. NameList in the code. I want the contents of each of the Arrays in the Pointer(NameList) to get printed one by one. The below code is not able do the task. Pls. help. ``` int Data1[] = {10,10}; int Data2[] = {20,20}; int Data3[] = {30,30}; int *NameList[] = {Data1, Data2,...
Darn it *litb*, once again you beat me to the punch by mere minutes. (If only I didn't have kids who keep waking up...) Ahh, what the hell. Perhaps this will still be useful to somebody. --- Oh, and just to nail this thing down: * Arrays, such as *int a[4]* allocate memory space for their data. * Pointers, such as ...
406,016
<p>I am crafting an application and cannot decide whether to use the terms <strong>Login/out</strong> or <strong>Logon/off</strong>. Is there a <em>more correct</em> option between these two? Should I use something else entirely (like "Sign on/off").</p> <p>In terms of usability, as long as I am consistent it probably...
[ { "answer_id": 406026, "author": "Michael Bray", "author_id": 50356, "author_profile": "https://Stackoverflow.com/users/50356", "pm_score": 3, "selected": false, "text": "<p>I've always distinguished the two in this manner:</p>\n\n<p>Logon - you log on to a terminal or other multi-user a...
2009/01/02
[ "https://Stackoverflow.com/questions/406016", "https://Stackoverflow.com", "https://Stackoverflow.com/users/708/" ]
I am crafting an application and cannot decide whether to use the terms **Login/out** or **Logon/off**. Is there a *more correct* option between these two? Should I use something else entirely (like "Sign on/off"). In terms of usability, as long as I am consistent it probably doesn't matter which terms I choose, but I...
Since you're looking for correctness, *login*, *logout*, *logon*, and *logoff* are all **nouns**: ``` "Please enter your login credentials." "I see three logons but only two logoffs from this user." ``` The corresponding **verbs** are each two words: ``` "Please log in to see your reputation." "You must log off a...
406,020
<p>I use the following code to create countdowns in Javascript. n is the number of times to repeat, freq is the number of milliseconds to wait before executing, funN is a function to call on each iteration (typically a function that updates part of the DOM) and funDone is the function to call when the countdown is comp...
[ { "answer_id": 406056, "author": "BenAlabaster", "author_id": 40650, "author_profile": "https://Stackoverflow.com/users/40650", "pm_score": 3, "selected": true, "text": "<p>I'd create an object that receives a counter and receives a function pointer to execute, something akin to the foll...
2009/01/02
[ "https://Stackoverflow.com/questions/406020", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19234/" ]
I use the following code to create countdowns in Javascript. n is the number of times to repeat, freq is the number of milliseconds to wait before executing, funN is a function to call on each iteration (typically a function that updates part of the DOM) and funDone is the function to call when the countdown is complet...
I'd create an object that receives a counter and receives a function pointer to execute, something akin to the following pseudo code: ``` TimedIteration = function(interval, iterations, methodToRun, completedMethod){ var counter = iterations; var timerElapsed = methodToRun; //Link to timedMethod() method var c...
406,045
<p>If you are doing something like the following:</p> <pre><code>var i = $('input[@name=some_field]'); if (i.val() != '' &amp;&amp; !(i.val() &gt;=1 &amp;&amp; i.val() &lt;= 36) || i.val() == 'OT')) { i.focus(); } </code></pre> <p>is <code>i.val()</code> fast enough to use it multiple times or should you do:</p>...
[ { "answer_id": 406051, "author": "jb.", "author_id": 37522, "author_profile": "https://Stackoverflow.com/users/37522", "pm_score": 1, "selected": false, "text": "<p>You aren't going to take a performance hit from calling jQuery's <a href=\"http://docs.jquery.com/Attributes/val\" rel=\"no...
2009/01/02
[ "https://Stackoverflow.com/questions/406045", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5441/" ]
If you are doing something like the following: ``` var i = $('input[@name=some_field]'); if (i.val() != '' && !(i.val() >=1 && i.val() <= 36) || i.val() == 'OT')) { i.focus(); } ``` is `i.val()` fast enough to use it multiple times or should you do: ``` var value = i.val(); ``` first and then use value in th...
This isn't necessarily a jQuery question but it applies pretty well to most programming languages. And in fact, there's a lot more to this question than just performance issues. One thing to keep in mind is that if you store the value, then there is no possibility that it will change during the execution of your subse...
406,053
<p>When referencing class variables, why do people prepend it with <code>this</code>? I'm not talking about the case when <code>this</code> is used to disambiguate from method parameters, but rather when it seems unnecessary.</p> <p>Example:</p> <pre><code>public class Person { private String name; p...
[ { "answer_id": 406058, "author": "Cogsy", "author_id": 48234, "author_profile": "https://Stackoverflow.com/users/48234", "pm_score": 2, "selected": false, "text": "<p>Apart from the disambiguation with method parameters, it buys you nothing. Maybe clarity/readability but that really dep...
2009/01/02
[ "https://Stackoverflow.com/questions/406053", "https://Stackoverflow.com", "https://Stackoverflow.com/users/24396/" ]
When referencing class variables, why do people prepend it with `this`? I'm not talking about the case when `this` is used to disambiguate from method parameters, but rather when it seems unnecessary. Example: ``` public class Person { private String name; public String toString() { return th...
Same reason why some people like to prepend private data members with "m\_" or name interfaces "IFoo". They believe it increases readability and clarity. Whether or not you agree with conventions like these is a matter of taste.
406,076
<p>Is there any way to have a 'Resizable' panel in GWT.</p> <p>By resizable I mean that if you you drag on the edge of Panel it can be resized accordingly.</p>
[ { "answer_id": 406116, "author": "Jarrod Dixon", "author_id": 3, "author_profile": "https://Stackoverflow.com/users/3", "pm_score": 0, "selected": false, "text": "<p>It looks like the <a href=\"http://code.google.com/p/gwt-ext/\" rel=\"nofollow noreferrer\">GWT-Ext</a> widget extensions ...
2009/01/02
[ "https://Stackoverflow.com/questions/406076", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15476/" ]
Is there any way to have a 'Resizable' panel in GWT. By resizable I mean that if you you drag on the edge of Panel it can be resized accordingly.
Figured it out myself, here is an example: ```java public class DraggablePanel extends VerticalPanel { private boolean isBeingDragged = false; private boolean isBeingMoved = false; private Element movingPanelElement; public void setMovingPanelElement(Element movingPanelElement) { this.movingPa...
406,097
<p>There's a lot of capital C, capital S computer science going into Javascript via the Tracemonkey, Squirrelfish, and V8 projects. Do any of these projects (or others) address the performance of DOM operations, or are they purely Javascript computation related?</p>
[ { "answer_id": 406174, "author": "Shog9", "author_id": 811, "author_profile": "https://Stackoverflow.com/users/811", "pm_score": 2, "selected": false, "text": "<p>They're pure JavaScript. Unless a particular DOM method call is implemented <em>in</em> JS, they'll have little effect (not t...
2009/01/02
[ "https://Stackoverflow.com/questions/406097", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4668/" ]
There's a lot of capital C, capital S computer science going into Javascript via the Tracemonkey, Squirrelfish, and V8 projects. Do any of these projects (or others) address the performance of DOM operations, or are they purely Javascript computation related?
The performance of pure DOM operations (getElementById/Tagname/Selector, nextChild, etc) are unaffected as they're already in pure C++. How the JS engine improvements will effect performance does depend to an extent on the particular techniques used for the performance improvements, as well as the performance of the D...
406,121
<p>Is there a simple way to flatten a list of iterables with a list comprehension, or failing that, what would you all consider to be the best way to flatten a shallow list like this, balancing performance and readability?</p> <p>I tried to flatten such a list with a nested list comprehension, like this:</p> <pre><co...
[ { "answer_id": 406141, "author": "recursive", "author_id": 44743, "author_profile": "https://Stackoverflow.com/users/44743", "pm_score": 3, "selected": false, "text": "<p>Off the top of my head, you can eliminate the lambda:</p>\n\n<pre><code>reduce(list.__add__, map(list, [mi.image_set....
2009/01/02
[ "https://Stackoverflow.com/questions/406121", "https://Stackoverflow.com", "https://Stackoverflow.com/users/27462/" ]
Is there a simple way to flatten a list of iterables with a list comprehension, or failing that, what would you all consider to be the best way to flatten a shallow list like this, balancing performance and readability? I tried to flatten such a list with a nested list comprehension, like this: ``` [image for image i...
If you're just looking to iterate over a flattened version of the data structure and don't need an indexable sequence, consider [itertools.chain and company](http://docs.python.org/library/itertools.html#itertools.chain). ``` >>> list_of_menuitems = [['image00', 'image01'], ['image10'], []] >>> import itertools >>> ch...
406,133
<p>I'm trying to configure an installer for some software we use within the company.</p> <p>The installer is pushed out to target machines via SMS, and it performs the following steps:</p> <ol> <li>Terminate any currently running instances of the app (the app is a utility, so this isn't an impact on the user).</li> <...
[ { "answer_id": 406141, "author": "recursive", "author_id": 44743, "author_profile": "https://Stackoverflow.com/users/44743", "pm_score": 3, "selected": false, "text": "<p>Off the top of my head, you can eliminate the lambda:</p>\n\n<pre><code>reduce(list.__add__, map(list, [mi.image_set....
2009/01/02
[ "https://Stackoverflow.com/questions/406133", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18434/" ]
I'm trying to configure an installer for some software we use within the company. The installer is pushed out to target machines via SMS, and it performs the following steps: 1. Terminate any currently running instances of the app (the app is a utility, so this isn't an impact on the user). 2. Remove the previous ver...
If you're just looking to iterate over a flattened version of the data structure and don't need an indexable sequence, consider [itertools.chain and company](http://docs.python.org/library/itertools.html#itertools.chain). ``` >>> list_of_menuitems = [['image00', 'image01'], ['image10'], []] >>> import itertools >>> ch...
406,161
<p>Am working on web based Job search application using Lucene.User on my site can search for jobs which are within a radius of 100 miles from say "Boston,MA" or any other location. Also, I need to show the search results sorted by "relevance"(ie. Score returned by lucene) in descending order.</p> <p>I'm using a 3rd...
[ { "answer_id": 406846, "author": "James Brady", "author_id": 29903, "author_profile": "https://Stackoverflow.com/users/29903", "pm_score": 0, "selected": false, "text": "<p>Apart from <code>tempFinalQuery</code> being unused and an unnecessary map lookup to get the state, there doesn't s...
2009/01/02
[ "https://Stackoverflow.com/questions/406161", "https://Stackoverflow.com", "https://Stackoverflow.com/users/40907/" ]
Am working on web based Job search application using Lucene.User on my site can search for jobs which are within a radius of 100 miles from say "Boston,MA" or any other location. Also, I need to show the search results sorted by "relevance"(ie. Score returned by lucene) in descending order. I'm using a 3rd party API t...
Not quite sure if I completely understand your code, but when it comes to geospatial search a filter approach might be more appropriate. Maybe this link can give you some ideas - <http://sujitpal.blogspot.com/2008/02/spatial-search-with-lucene.html> Maybe you can use *Filter*s for other parts of your query as well. To...
406,192
<p>I am using jQuery. How do I get the path of the current URL and assign it to a variable?</p> <p>Example URL:</p> <pre><code>http://localhost/menuname.de?foo=bar&amp;amp;number=0 </code></pre>
[ { "answer_id": 406200, "author": "clawr", "author_id": 46201, "author_profile": "https://Stackoverflow.com/users/46201", "pm_score": 6, "selected": false, "text": "<p>You'll want to use JavaScript's built-in <a href=\"http://www.devguru.com/Technologies/ecmascript/quickref/location.html\...
2009/01/02
[ "https://Stackoverflow.com/questions/406192", "https://Stackoverflow.com", "https://Stackoverflow.com/users/44984/" ]
I am using jQuery. How do I get the path of the current URL and assign it to a variable? Example URL: ``` http://localhost/menuname.de?foo=bar&amp;number=0 ```
To get the path, you can use: ``` var pathname = window.location.pathname; // Returns path only (/path/example.html) var url = window.location.href; // Returns full URL (https://example.com/path/example.html) var origin = window.location.origin; // Returns base URL (https://example.com) ```
406,210
<p>A long time ago I had the following directory structure in my SVN repository</p> <pre><code>trunk/ data/ levels/ 1.level 2.level ... ... ... </code></pre> <p>But I deleted the 'levels' directory long ago. Now I want to add a single text file called 'level...
[ { "answer_id": 406214, "author": "Lily Ballard", "author_id": 582, "author_profile": "https://Stackoverflow.com/users/582", "pm_score": 4, "selected": true, "text": "<p>Try running <code>svn update</code>. That will update the current folder's revision number and all associated metadata....
2009/01/02
[ "https://Stackoverflow.com/questions/406210", "https://Stackoverflow.com", "https://Stackoverflow.com/users/813/" ]
A long time ago I had the following directory structure in my SVN repository ``` trunk/ data/ levels/ 1.level 2.level ... ... ... ``` But I deleted the 'levels' directory long ago. Now I want to add a single text file called 'levels' to the 'data' directory...
Try running `svn update`. That will update the current folder's revision number and all associated metadata. You should also make sure `svn status` doesn't display anything related to this.
406,212
<p>How would one modify the following snippet (in a tableView:cellForRowAtIndexPath: UITableViewController method) from the "09a - PrefsTable" recipe from Chapter 6 of The iPhone Developer's Cookbook:</p> <pre><code>if (row == 1) { // Create a big word-wrapped UILabel cell = [tableView dequeueReusableCellWit...
[ { "answer_id": 406216, "author": "Lily Ballard", "author_id": 582, "author_profile": "https://Stackoverflow.com/users/582", "pm_score": 4, "selected": false, "text": "<p>You should use NSString's <code>-sizeWithFont:forWidth:lineBreakMode:</code> method to retrieve the associated sizing ...
2009/01/02
[ "https://Stackoverflow.com/questions/406212", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4766/" ]
How would one modify the following snippet (in a tableView:cellForRowAtIndexPath: UITableViewController method) from the "09a - PrefsTable" recipe from Chapter 6 of The iPhone Developer's Cookbook: ``` if (row == 1) { // Create a big word-wrapped UILabel cell = [tableView dequeueReusableCellWithIdentifier:@"...
I had to do this enough that I extended UILabel to do it for me: ``` @interface UILabel (BPExtensions) - (void)sizeToFitFixedWidth:(CGFloat)fixedWidth; @end @implementation UILabel (BPExtensions) - (void)sizeToFitFixedWidth:(CGFloat)fixedWidth { self.frame = CGRectMake(self.frame.origin.x, self.frame.origin.y, f...
406,230
<p>I know it's possible to match a word and then reverse the matches using other tools (e.g. <code>grep -v</code>). However, is it possible to match lines that do not contain a specific word, e.g. <code>hede</code>, using a regular expression?</p> <h5>Input:</h5> <pre><code>hoho hihi haha hede </code></pre> <h5>Code:</...
[ { "answer_id": 406243, "author": "Athena", "author_id": 17846, "author_profile": "https://Stackoverflow.com/users/17846", "pm_score": 8, "selected": false, "text": "<p><em>If</em> you're just using it for grep, you can use <code>grep -v hede</code> to get all lines which do not contain h...
2009/01/02
[ "https://Stackoverflow.com/questions/406230", "https://Stackoverflow.com", "https://Stackoverflow.com/users/36830/" ]
I know it's possible to match a word and then reverse the matches using other tools (e.g. `grep -v`). However, is it possible to match lines that do not contain a specific word, e.g. `hede`, using a regular expression? ##### Input: ``` hoho hihi haha hede ``` ##### Code: ``` grep "<Regex for 'doesn't contain hede'...
The notion that regex doesn't support inverse matching is not entirely true. You can mimic this behavior by using negative look-arounds: ``` ^((?!hede).)*$ ``` Non-capturing variant: ```regex ^(?:(?!:hede).)*$ ``` The regex above will match any string, or line without a line break, **not** containing the (sub)str...
406,249
<p>I'm working on an IPhone application that works with a Google App Engine application. I manage to get logged by using a google account and I get the authentication token. I'm also able to GET data from the GAE service (I did it after reading another question written here) but now I need to POST data so I need to sen...
[ { "answer_id": 406308, "author": "Marc Novakowski", "author_id": 27020, "author_profile": "https://Stackoverflow.com/users/27020", "pm_score": 2, "selected": false, "text": "<p>Whenever I'm troubleshooting a problem related to HTTP, the first tool I'll grab is <a href=\"http://www.charle...
2009/01/02
[ "https://Stackoverflow.com/questions/406249", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I'm working on an IPhone application that works with a Google App Engine application. I manage to get logged by using a google account and I get the authentication token. I'm also able to GET data from the GAE service (I did it after reading another question written here) but now I need to POST data so I need to send t...
Whenever I'm troubleshooting a problem related to HTTP, the first tool I'll grab is [Charles HTTP Proxy](http://www.charlesproxy.com/). It will show you the entire request and response for closer examination.
406,253
<p>I have tried one where clause in Linq to get details about <code>User</code>s those who are <code>Active</code> and <code>AllowLogin</code> is also true.</p> <p>So how can I compare the table values (both are boolean values) with true or false?</p>
[ { "answer_id": 406261, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 4, "selected": false, "text": "<p>Just use something like:</p>\n\n<pre><code>var query = from user in context.Users\n where user.Active &amp...
2009/01/02
[ "https://Stackoverflow.com/questions/406253", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I have tried one where clause in Linq to get details about `User`s those who are `Active` and `AllowLogin` is also true. So how can I compare the table values (both are boolean values) with true or false?
Just use something like: ``` var query = from user in context.Users where user.Active && user.AllowLogin select user; ``` Alternatively, you can write the same query without a query expression: ``` var query = context.Users.Where(user => user.Active && user.AllowLogin); ```
406,258
<p>According to the Perl source code page on CPAN, 5.8.9 is now 14 days old, and will be the last 5.8 release. 5.10.0 is over a year old and presumably ready for use in Production.</p> <p>Leaving aside discussion of Perl 6 for now, can I ask what versions of Perl folks are testing, rolling out and using in production?...
[ { "answer_id": 406337, "author": "melaos", "author_id": 38124, "author_profile": "https://Stackoverflow.com/users/38124", "pm_score": 1, "selected": false, "text": "<p>We're using v5.6.1 in our production server. I guess we're old school. :P</p>\n\n<p>Unless there's a specific features t...
2009/01/02
[ "https://Stackoverflow.com/questions/406258", "https://Stackoverflow.com", "https://Stackoverflow.com/users/45284/" ]
According to the Perl source code page on CPAN, 5.8.9 is now 14 days old, and will be the last 5.8 release. 5.10.0 is over a year old and presumably ready for use in Production. Leaving aside discussion of Perl 6 for now, can I ask what versions of Perl folks are testing, rolling out and using in production? We have c...
According to the Perl Survey, performed over a year ago now predating 5.10, as their **minimum** version of Perl people are using... ``` 4.x 3% 5.0.x 3% 5.4.x 2% 5.5.x 6% 5.6.x 17% 5.8.x 66% ``` and the **maximum** is... ``` 5.6.x 3% 5.8.x 88% 5.9.x 5% ``` 5.6.1 and 5.8.8 are most popular with...
406,288
<p>I recently started working in Java and was introduced to the wild and crazy world of getters and setters for everything. I hated it at first, but quickly got used to it. Too used to it.</p> <p>I have been spending a lot of time lately thinking more about class design. One of the things I am trying to do is avoid th...
[ { "answer_id": 406300, "author": "Toon Krijthe", "author_id": 18061, "author_profile": "https://Stackoverflow.com/users/18061", "pm_score": 3, "selected": true, "text": "<p>To put it simple:</p>\n\n<ul>\n<li>You need getters for all fields that must be read from the outside.</li>\n<li>Yo...
2009/01/02
[ "https://Stackoverflow.com/questions/406288", "https://Stackoverflow.com", "https://Stackoverflow.com/users/50453/" ]
I recently started working in Java and was introduced to the wild and crazy world of getters and setters for everything. I hated it at first, but quickly got used to it. Too used to it. I have been spending a lot of time lately thinking more about class design. One of the things I am trying to do is avoid the trap of ...
To put it simple: * You need getters for all fields that must be read from the outside. * You need setters for all fields that must be written from the outside. This can be 100%, but most of the time it is less.
406,293
<p>C# 2.0 gives me access to nullable types. This seems very convenient when I want the DateTime variable in the database to be null. Is there anything I should worry about when using nullable types or can I go overboard and make every type I have nullable?</p>
[ { "answer_id": 406304, "author": "Mitch Wheat", "author_id": 16076, "author_profile": "https://Stackoverflow.com/users/16076", "pm_score": 2, "selected": false, "text": "<p>Watch out for <code>DBNull</code> which is different to <code>null</code></p>\n" }, { "answer_id": 406319, ...
2009/01/02
[ "https://Stackoverflow.com/questions/406293", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10352/" ]
C# 2.0 gives me access to nullable types. This seems very convenient when I want the DateTime variable in the database to be null. Is there anything I should worry about when using nullable types or can I go overboard and make every type I have nullable?
Mitch's DBNull not being null is a good point. Also beware of this, which is legal C# but will (fortunately) produce a warning: ``` int x = 0; // Much later if (x == null) ``` It looks like it should be illegal, but it's valid because x can be implicitly converted to a nullable int. Never ignore this warning. You ...
406,294
<p>What is the difference between <code>LEFT JOIN</code> and <code>LEFT OUTER JOIN</code>?</p>
[ { "answer_id": 406299, "author": "Mitch Wheat", "author_id": 16076, "author_profile": "https://Stackoverflow.com/users/16076", "pm_score": 9, "selected": false, "text": "<blockquote>\n <p>What is the difference between left join and left outer join?</p>\n</blockquote>\n\n<p><strong>Noth...
2009/01/02
[ "https://Stackoverflow.com/questions/406294", "https://Stackoverflow.com", "https://Stackoverflow.com/users/48581/" ]
What is the difference between `LEFT JOIN` and `LEFT OUTER JOIN`?
As per the documentation: [FROM (Transact-SQL)](http://msdn.microsoft.com/en-us/library/ms177634%28SQL.90%29.aspx): ``` <join_type> ::= [ { INNER | { { LEFT | RIGHT | FULL } [ OUTER ] } } [ <join_hint> ] ] JOIN ``` The keyword `OUTER` is marked as optional (enclosed in square brackets). In this specific cas...
406,298
<p>I am trying to join tableA with some data to an empty set of another tableB. The main purpose is to get all the columns of tableB. I do not need any data of tableB.</p> <p>I have constucted the following SQL:</p> <pre><code>SELECT uar.*, s.screen_id, s.screen_name FROM crs_screens LEFT JOIN crs\_user\_access\_ri...
[ { "answer_id": 406299, "author": "Mitch Wheat", "author_id": 16076, "author_profile": "https://Stackoverflow.com/users/16076", "pm_score": 9, "selected": false, "text": "<blockquote>\n <p>What is the difference between left join and left outer join?</p>\n</blockquote>\n\n<p><strong>Noth...
2009/01/02
[ "https://Stackoverflow.com/questions/406298", "https://Stackoverflow.com", "https://Stackoverflow.com/users/46971/" ]
I am trying to join tableA with some data to an empty set of another tableB. The main purpose is to get all the columns of tableB. I do not need any data of tableB. I have constucted the following SQL: ``` SELECT uar.*, s.screen_id, s.screen_name FROM crs_screens LEFT JOIN crs\_user\_access\_right uar ON s.rid IS ...
As per the documentation: [FROM (Transact-SQL)](http://msdn.microsoft.com/en-us/library/ms177634%28SQL.90%29.aspx): ``` <join_type> ::= [ { INNER | { { LEFT | RIGHT | FULL } [ OUTER ] } } [ <join_hint> ] ] JOIN ``` The keyword `OUTER` is marked as optional (enclosed in square brackets). In this specific cas...
406,312
<p>Here is my class:</p> <pre><code>public class User { public int Id { get; set; } public string Name { get; set; } public ISet&lt;User&gt; Friends { get; set; } } </code></pre> <p>Here is my mapping:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt; &lt;hibernate-mapping xmlns="urn:nhibernate-map...
[ { "answer_id": 406347, "author": "Adeel Ansari", "author_id": 42769, "author_profile": "https://Stackoverflow.com/users/42769", "pm_score": 2, "selected": false, "text": "<p>From Hibernate.org</p>\n\n<blockquote>\n <p><strong>Why does Hibernate always initialize a collection when I only...
2009/01/02
[ "https://Stackoverflow.com/questions/406312", "https://Stackoverflow.com", "https://Stackoverflow.com/users/50275/" ]
Here is my class: ``` public class User { public int Id { get; set; } public string Name { get; set; } public ISet<User> Friends { get; set; } } ``` Here is my mapping: ``` <?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="Test" assembly="test"> <cl...
From Hibernate.org > > **Why does Hibernate always initialize a collection when I only want to add > or remove an element?** > > > Unfortunately the collections API > defines method return values that may > only be computed by hitting the > database. There are three exceptions > to this: Hibernate can add to a...
406,315
<p>This problem involved me not knowing enough of C++. I am trying to access a specific value that I had placed in the Heap, but I'm unsure of how to access it. In my problem, I had placed a value in a heap from a data member function in an object, and I am trying to access it in another data member function. Problem i...
[ { "answer_id": 406326, "author": "abelenky", "author_id": 34824, "author_profile": "https://Stackoverflow.com/users/34824", "pm_score": 5, "selected": true, "text": "<p>pValue needs to be a member-variable of the class Grid.</p>\n\n<pre><code>class Grid\n{\n private: int* pValue;\n pub...
2009/01/02
[ "https://Stackoverflow.com/questions/406315", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
This problem involved me not knowing enough of C++. I am trying to access a specific value that I had placed in the Heap, but I'm unsure of how to access it. In my problem, I had placed a value in a heap from a data member function in an object, and I am trying to access it in another data member function. Problem is I...
pValue needs to be a member-variable of the class Grid. ``` class Grid { private: int* pValue; public: void HeapValues(); void AccessHeap(); }; ``` Now the member-variable pValue is accessible from any member-function of Grid.
406,316
<p>How do I pass have a Javascript script request a PHP page and pass data to it? How do I then have the PHP script pass data back to the Javascript script?</p> <p>client.js:</p> <pre><code>data = {tohex: 4919, sum: [1, 3, 5]}; // how would this script pass data to server.php and access the response? </code></pre> <...
[ { "answer_id": 406322, "author": "Ólafur Waage", "author_id": 22459, "author_profile": "https://Stackoverflow.com/users/22459", "pm_score": 1, "selected": false, "text": "<p>You can pass data from PHP to javascript but the only way to get data from javascript to PHP is via AJAX.</p>\n\n<...
2009/01/02
[ "https://Stackoverflow.com/questions/406316", "https://Stackoverflow.com", "https://Stackoverflow.com/users/49318/" ]
How do I pass have a Javascript script request a PHP page and pass data to it? How do I then have the PHP script pass data back to the Javascript script? client.js: ``` data = {tohex: 4919, sum: [1, 3, 5]}; // how would this script pass data to server.php and access the response? ``` server.php: ``` $tohex = ... ;...
Passing data from PHP is easy, you can generate JavaScript with it. The other way is a bit harder - you have to invoke the PHP script by a Javascript request. An example (using traditional event registration model for simplicity): ``` <!-- headers etc. omitted --> <script> function callPHP(params) { var httpc = n...
406,351
<p>Is there any good way convert a binary (base 2) strings to integers in T-SQL (if not I guess I can write a function...)</p> <p>'0110' => 6 etc.</p>
[ { "answer_id": 406359, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 2, "selected": true, "text": "<p>Do you know that the strings will always be a particular length? If so you <em>could</em> hard-code a bunch of Substri...
2009/01/02
[ "https://Stackoverflow.com/questions/406351", "https://Stackoverflow.com", "https://Stackoverflow.com/users/40939/" ]
Is there any good way convert a binary (base 2) strings to integers in T-SQL (if not I guess I can write a function...) '0110' => 6 etc.
Do you know that the strings will always be a particular length? If so you *could* hard-code a bunch of Substring/convert-to-int/multiply steps. It wouldn't exactly be nice though... EDIT: To give a bit more detail, suppose you know it's going to be length 4, you could do: ``` SELECT (8 * CONVERT(int, SUBSTRING(@x, 1...
406,352
<p>I'm experiencing some issues regarding my javabuilder-compiled matlab-code. My application is basically split up like this:</p> <ul> <li>GUI: Java</li> <li>Calculations: Matlab</li> </ul> <p>The main problem is that when compiling my matlab-code with the javabuilder in Matlab (R17, 2007a), I have less memory avail...
[ { "answer_id": 406432, "author": "axelclk", "author_id": 24819, "author_profile": "https://Stackoverflow.com/users/24819", "pm_score": 0, "selected": false, "text": "<p>I think the solution to your problem is to increase the Java VM heap space as described here:</p>\n\n<p><a href=\"http:...
2009/01/02
[ "https://Stackoverflow.com/questions/406352", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37257/" ]
I'm experiencing some issues regarding my javabuilder-compiled matlab-code. My application is basically split up like this: * GUI: Java * Calculations: Matlab The main problem is that when compiling my matlab-code with the javabuilder in Matlab (R17, 2007a), I have less memory available than I have when I compile the...
Actually, you might want to *decrease* the Java heap space. The memory in your process, at least in regular Matlab, is split between Matlab and Java. If you increase the Java heap size, you will correspondingly decrease the memory available for Matlab arrays. Matlab arrays live in regular C-style memory, not Java's GCe...
406,358
<p>How to protect a SQL Server database from viewing others?</p>
[ { "answer_id": 406432, "author": "axelclk", "author_id": 24819, "author_profile": "https://Stackoverflow.com/users/24819", "pm_score": 0, "selected": false, "text": "<p>I think the solution to your problem is to increase the Java VM heap space as described here:</p>\n\n<p><a href=\"http:...
2009/01/02
[ "https://Stackoverflow.com/questions/406358", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
How to protect a SQL Server database from viewing others?
Actually, you might want to *decrease* the Java heap space. The memory in your process, at least in regular Matlab, is split between Matlab and Java. If you increase the Java heap size, you will correspondingly decrease the memory available for Matlab arrays. Matlab arrays live in regular C-style memory, not Java's GCe...
406,361
<p>My code:</p> <pre><code>a = '2.3' </code></pre> <p>I wanted to display <code>a</code> as a floating point value.</p> <p>Since <code>a</code> is a string, I tried:</p> <pre><code>float(a) </code></pre> <p>The result I got was :</p> <pre><code>2.2999999999999998 </code></pre> <p>I want a solution for this probl...
[ { "answer_id": 406367, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 4, "selected": false, "text": "<p>I think it reflects more on your understanding of floating point types than on Python. See <a href=\"http://csharpind...
2009/01/02
[ "https://Stackoverflow.com/questions/406361", "https://Stackoverflow.com", "https://Stackoverflow.com/users/46646/" ]
My code: ``` a = '2.3' ``` I wanted to display `a` as a floating point value. Since `a` is a string, I tried: ``` float(a) ``` The result I got was : ``` 2.2999999999999998 ``` I want a solution for this problem. Please, kindly help me. I was following [this tutorial](http://docs.python.org/tutorial/floating...
I think it reflects more on your understanding of floating point types than on Python. See [my article about floating point numbers](http://csharpindepth.com/Articles/General/FloatingPoint.aspx) (.NET-based, but still relevant) for the reasons behind this "inaccuracy". If you need to keep the exact decimal representati...
406,385
<p>I wanted to set some handler for all the unexpected exceptions that I might not have caught inside my code. In <code>Program.Main()</code> I used the following code:</p> <pre><code>AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(ErrorHandler.HandleException); </code></pre> <p>B...
[ { "answer_id": 406389, "author": "Peter Lindholm", "author_id": 45467, "author_profile": "https://Stackoverflow.com/users/45467", "pm_score": 6, "selected": true, "text": "<p>It's because you're running it through Visual Studio in Debug mode. If you release and install your app somewhere...
2009/01/02
[ "https://Stackoverflow.com/questions/406385", "https://Stackoverflow.com", "https://Stackoverflow.com/users/40872/" ]
I wanted to set some handler for all the unexpected exceptions that I might not have caught inside my code. In `Program.Main()` I used the following code: ``` AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(ErrorHandler.HandleException); ``` But it didn't work as I expected. When...
It's because you're running it through Visual Studio in Debug mode. If you release and install your app somewhere else, nothing but your global exception handler will be processed.
406,386
<p>Where can I find a Visual Studio plug-in that automatically generates documentation header for methods and properties?</p> <p>Example the comment to a property could look like this:</p> <pre><code>/// &lt;summary&gt; /// Gets or sets the value of message /// &lt;/summary&gt; public static string Message { ...
[ { "answer_id": 406391, "author": "Joe", "author_id": 13087, "author_profile": "https://Stackoverflow.com/users/13087", "pm_score": 4, "selected": true, "text": "<p>Ghostdoc from <a href=\"http://www.roland-weigelt.de/ghostdoc/\" rel=\"nofollow noreferrer\">http://www.roland-weigelt.de/gh...
2009/01/02
[ "https://Stackoverflow.com/questions/406386", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18631/" ]
Where can I find a Visual Studio plug-in that automatically generates documentation header for methods and properties? Example the comment to a property could look like this: ``` /// <summary> /// Gets or sets the value of message /// </summary> public static string Message { get { return message...
Ghostdoc from <http://www.roland-weigelt.de/ghostdoc/>
406,396
<p>I am trying to prefix a string (<code>reference_</code>) to the names of all the *.bmp files in all the directories as well sub-directories. The first time we run the silk script, it will create directories as well subdirectories, and under each subdirectory it will store each mobile application's sceenshot with <co...
[ { "answer_id": 406441, "author": "Jonathan Leffler", "author_id": 15168, "author_profile": "https://Stackoverflow.com/users/15168", "pm_score": 2, "selected": false, "text": "<p>You should probably check out the <a href=\"http://perldoc.perl.org/File/Find.html\" rel=\"nofollow noreferrer...
2009/01/02
[ "https://Stackoverflow.com/questions/406396", "https://Stackoverflow.com", "https://Stackoverflow.com/users/45284/" ]
I am trying to prefix a string (`reference_`) to the names of all the \*.bmp files in all the directories as well sub-directories. The first time we run the silk script, it will create directories as well subdirectories, and under each subdirectory it will store each mobile application's sceenshot with `.bmp` extension...
You don't open a directory for writing. Just use [opendir](http://perldoc.perl.org/functions/opendir.html) without the mode parts of the string: ``` opendir my($dir), $dirname or die "Could not open $dirname: $!"; ``` However, you don't need that. You can use File::Find to make the list of files you need. ``` #!/u...
406,400
<p>I have a div that contains other floating divs:</p> <p>&lt;div id="parent"&gt;<br /> &nbsp;&nbsp;&lt;div style="float:left;"&gt;text&lt;/div&gt;<br /> &nbsp;&nbsp;&lt;div style="float:left;"&gt;text&lt;/div&gt;<br /> &nbsp;&nbsp;&lt;div style="float:right;"&gt;text&lt;/div&gt;<br /> &lt;/div&gt;</p> <p>How can I a...
[ { "answer_id": 406429, "author": "Sophie Alpert", "author_id": 49485, "author_profile": "https://Stackoverflow.com/users/49485", "pm_score": 2, "selected": false, "text": "<p>Try floating the parent div.</p>\n" }, { "answer_id": 406451, "author": "bochgoch", "author_id": ...
2009/01/02
[ "https://Stackoverflow.com/questions/406400", "https://Stackoverflow.com", "https://Stackoverflow.com/users/676066/" ]
I have a div that contains other floating divs: <div id="parent">   <div style="float:left;">text</div>   <div style="float:left;">text</div>   <div style="float:right;">text</div> </div> How can I add bottom padding to the parent div and make it work in IE6 (or in other words avoid the bugs in IE6)? Tha...
In my CSS reset file i have a "clearfix" code: ``` .clearfix:after { content:"."; display:block; height:0; clear:both; visibility:hidden; } .clearfix {display:inline-block;} /* Hide from IE Mac \*/ .clearfix {display:block;} /* End hide from IE Mac */ * html .clearfix {height:1px;} ``` Looks weir...
406,402
<p>I wrote this code </p> <h2>I have these errors</h2> <p>Cannot implicitly convert type x.Program.TreeNode' to 'int' // on findmin</p> <p>Cannot implicitly convert type x.Program.TreeNode' to 'int' // on findmax</p> <p>and is my main correct or missing somethin?</p> <p>and how i can count the nodes,leaves and get...
[ { "answer_id": 406409, "author": "Marc Gravell", "author_id": 23354, "author_profile": "https://Stackoverflow.com/users/23354", "pm_score": 3, "selected": true, "text": "<p>Since you need (<code>FindMin</code>/<code>FindMax</code>) to return an <code>int</code>, do you mean <code>current...
2009/01/02
[ "https://Stackoverflow.com/questions/406402", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I wrote this code I have these errors ------------------- Cannot implicitly convert type x.Program.TreeNode' to 'int' // on findmin Cannot implicitly convert type x.Program.TreeNode' to 'int' // on findmax and is my main correct or missing somethin? and how i can count the nodes,leaves and get the hight (need onl...
Since you need (`FindMin`/`FindMax`) to return an `int`, do you mean `current.n`? --- Updated: for counting leaves and nodes, how about (as instance methods of `TreeNode`): ``` public int CountNodes() { int count = 1; // me! if (_left != null) count += _left.CountNodes(); if (_right !...
406,431
<p>Does any one know of a way to control how Visual Studio handles curly braces in Html view?</p> <p>Type...</p> <pre><code>&lt;% if (true) { %&gt; </code></pre> <p>Then</p> <pre><code>&lt;% { %&gt; </code></pre> <p>And visual studio will auto format it as such.</p> <pre><code>&lt;% if (true) { %&gt; &lt;%...
[ { "answer_id": 406443, "author": "Henk", "author_id": 47354, "author_profile": "https://Stackoverflow.com/users/47354", "pm_score": 0, "selected": false, "text": "<p>Take a look at tools -> options -> texteditor -> JScript -> Formatting!</p>\n" }, { "answer_id": 406475, "aut...
2009/01/02
[ "https://Stackoverflow.com/questions/406431", "https://Stackoverflow.com", "https://Stackoverflow.com/users/45909/" ]
Does any one know of a way to control how Visual Studio handles curly braces in Html view? Type... ``` <% if (true) { %> ``` Then ``` <% { %> ``` And visual studio will auto format it as such. ``` <% if (true) { %> <% } %> ``` Not a major issue but nest a few of these using foreach and it gets messy.
Well its not really a sollution, but what i do is that i hit Ctrl+x to undo, and it will undo the formatting - there is not another way that i know off, other that changed it in all C# documents.
406,446
<p>I haven't used a statically typed language in many years and have set myself the task of getting up to speed with C#. I'm using my usual trick of following the fifteen exercises here <a href="http://www.jobsnake.com/seek/articles/index.cgi?openarticle&amp;8533" rel="noreferrer">http://www.jobsnake.com/seek/articles/...
[ { "answer_id": 406448, "author": "Marc Gravell", "author_id": 23354, "author_profile": "https://Stackoverflow.com/users/23354", "pm_score": 7, "selected": true, "text": "<p>As an iterator block:</p>\n\n<pre><code>using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\nsta...
2009/01/02
[ "https://Stackoverflow.com/questions/406446", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37196/" ]
I haven't used a statically typed language in many years and have set myself the task of getting up to speed with C#. I'm using my usual trick of following the fifteen exercises here <http://www.jobsnake.com/seek/articles/index.cgi?openarticle&8533> as my first task. I've just finished the second Fibonacci task which ...
As an iterator block: ``` using System; using System.Collections.Generic; using System.Linq; static class Program { static IEnumerable<long> Fibonacci() { long n = 0, m = 1; yield return 0; yield return 1; while (true) { long tmp = n + m; n = m; ...
406,463
<p>I want all the Method-ClassName from namespace</p> <p>like i have system.windows.Forms</p> <p>wehen in visual studio we rigt system.windows.Forms. it will suggest box of all the related method,class,enum extra</p> <p>i need to fetch the same ,how can i do that in C#</p>
[ { "answer_id": 406467, "author": "Jon Skeet", "author_id": 22656, "author_profile": "https://Stackoverflow.com/users/22656", "pm_score": 3, "selected": false, "text": "<p>For a start, there are no methods in a namespace - only types.</p>\n\n<p>To get all the types from one namespace with...
2009/01/02
[ "https://Stackoverflow.com/questions/406463", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I want all the Method-ClassName from namespace like i have system.windows.Forms wehen in visual studio we rigt system.windows.Forms. it will suggest box of all the related method,class,enum extra i need to fetch the same ,how can i do that in C#
For a start, there are no methods in a namespace - only types. To get all the types from one namespace within a particular assembly, you can use (assuming .NET 3.5 for the LINQ bit) [Assembly.GetTypes](http://msdn.microsoft.com/en-us/library/system.reflection.assembly.gettypes.aspx): ``` var types = assembly.GetTypes...
406,485
<p>How do you do it? Given a byte array:</p> <pre><code>byte[] foo = new byte[4096]; </code></pre> <p>How would I get the first x bytes of the array as a separate array? (Specifically, I need it as an <code>IEnumerable&lt;byte&gt;</code>)</p> <p>This is for working with <code>Socket</code>s. I figure the easiest way...
[ { "answer_id": 406489, "author": "Arjan Einbu", "author_id": 19594, "author_profile": "https://Stackoverflow.com/users/19594", "pm_score": 7, "selected": false, "text": "<p>You could use the arrays <code>CopyTo()</code> method.</p>\n\n<p>Or with LINQ you can use <code>Skip()</code> and <...
2009/01/02
[ "https://Stackoverflow.com/questions/406485", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15537/" ]
How do you do it? Given a byte array: ``` byte[] foo = new byte[4096]; ``` How would I get the first x bytes of the array as a separate array? (Specifically, I need it as an `IEnumerable<byte>`) This is for working with `Socket`s. I figure the easiest way would be array slicing, similar to Perls syntax: ``` @bar =...
Arrays are enumerable, so your `foo` already is an `IEnumerable<byte>` itself. Simply use LINQ sequence methods like [`Take()`](https://msdn.microsoft.com/en-us/library/bb503062(v=vs.110).aspx) to get what you want out of it (don't forget to include the `Linq` namespace with `using System.Linq;`): ``` byte[] foo = new...
406,514
<p>I got this ajax form in a ASP.NET MVC beta application :</p> <pre><code> &lt;%using (this.Ajax.BeginForm("Edit", "Subscriber", new AjaxOptions { OnSuccess = "onEditResult", HttpMethod = "GET" })) {%&gt; &lt;%=Html.Hidden("idSub", p.Id.ToString())%&gt; &lt;inp...
[ { "answer_id": 406515, "author": "annakata", "author_id": 13018, "author_profile": "https://Stackoverflow.com/users/13018", "pm_score": 0, "selected": false, "text": "<p>You're getting yourself a bit over stressed I think :)</p>\n\n<p>Check out <a href=\"http://www.w3.org/TR/CSS21/visure...
2009/01/02
[ "https://Stackoverflow.com/questions/406514", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3109/" ]
I got this ajax form in a ASP.NET MVC beta application : ``` <%using (this.Ajax.BeginForm("Edit", "Subscriber", new AjaxOptions { OnSuccess = "onEditResult", HttpMethod = "GET" })) {%> <%=Html.Hidden("idSub", p.Id.ToString())%> <input type="submit" value="Edit"...
> > Say I have textboxes, dropdownlists > and submit buttons. They are all > inline-elements. Which means that > "officially" margin, padding, width > and height properties should be > ignored (in practice not really). If I > were to go the right way to set the > height to a button I would write > something li...
406,520
<p>Hi i executed the following stored procedure in .net web application. Then run the application. I got this error</p> <p>" Divide By zero error "</p> <p>Stored procedure:</p> <pre><code>CREATE procedure Details(@Stringtext varchar(8000),@SearchStringtext varchar(100)) as begin SELECT ({fn LENGTH(@Stringtext)}- {fn...
[ { "answer_id": 406521, "author": "slim", "author_id": 7512, "author_profile": "https://Stackoverflow.com/users/7512", "pm_score": 2, "selected": false, "text": "<p>Evidently:</p>\n\n<pre><code>{ fn LENGTH(@SearchStringtext)}\n</code></pre>\n\n<p>... is evaluating to zero.</p>\n" }, {...
2009/01/02
[ "https://Stackoverflow.com/questions/406520", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Hi i executed the following stored procedure in .net web application. Then run the application. I got this error " Divide By zero error " Stored procedure: ``` CREATE procedure Details(@Stringtext varchar(8000),@SearchStringtext varchar(100)) as begin SELECT ({fn LENGTH(@Stringtext)}- {fn LENGTH({fn REPLACE(@Stringt...
Evidently: ``` { fn LENGTH(@SearchStringtext)} ``` ... is evaluating to zero.
406,526
<p>I need to define new UI Elements as well as data binding in code because they will be implemented after run-time. Here is a simplified version of what I am trying to do.</p> <p>Data Model:</p> <pre><code>public class AddressBook : INotifyPropertyChanged { private int _houseNumber; public int HouseNumber ...
[ { "answer_id": 406538, "author": "Steven Robbins", "author_id": 26507, "author_profile": "https://Stackoverflow.com/users/26507", "pm_score": 2, "selected": false, "text": "<p>Do you need to set the binding mode programatically? It may be defaulting to OneTime.</p>\n" }, { "answ...
2009/01/02
[ "https://Stackoverflow.com/questions/406526", "https://Stackoverflow.com", "https://Stackoverflow.com/users/50859/" ]
I need to define new UI Elements as well as data binding in code because they will be implemented after run-time. Here is a simplified version of what I am trying to do. Data Model: ``` public class AddressBook : INotifyPropertyChanged { private int _houseNumber; public int HouseNumber { get { ret...
The root of it was that the string I passed to PropertyChangedEventArgs did not EXACTLY match the name of the property. I had something like this: ``` public int HouseNumber { get { return _houseNumber; } set { _houseNumber = value; NotifyPropertyChanged("HouseNum"); } } ``` Where it should be this: ``` pub...