compare_oracle / oraclechunk11.json
xPXXX's picture
Upload 10 files
0d91987
Raw
History Blame Contribute Delete
18.1 kB
Invalid JSON:Unexpected non-whitespace character after JSONat line 2, column 1
{"QuestionId": 7271661, "AnswerCount": 3, "Tags": "<algorithm><crc>", "CreationDate": "2011-09-01T14:17:05.883", "AcceptedAnswerId": "7273055", "Title": "CRC divisor calculation", "Body": "<p>Im trying to understand CRC and I'm getting confused as how to calculate the 'divisor'.</p>\n\n<p>In the <a href=\"http://en.wikipedia.org/wiki/Cyclic_redundancy_check#Computation_of_CRC\" rel=\"noreferrer\">example on wikipedia</a> the divisor is 11 (1011) for input of 11010011101100</p>\n\n<pre><code>11010011101100 000 &lt;--- input left shifted by 3 bits\n1011 &lt;--- divisor (4 bits) = x\u00b3+x+1\n------------------\n01100011101100 000 &lt;--- result\n</code></pre>\n\n<p>How is the divisor calculated? In this example (x\u00b3+x+1) x is 2? Where did the 2 come from?</p>\n", "Lable": "No"}
{"QuestionId": 7442099, "AnswerCount": 1, "Tags": "<ruby-on-rails><ruby-on-rails-3><paypal><activemerchant>", "CreationDate": "2011-09-16T08:37:02.857", "AcceptedAnswerId": null, "Title": "active_merchant: A field was longer or shorter than the server allows", "Body": "<p>I'm implementing paypal direct payment using activemerchant\nFollowing is the code</p>\n\n<pre><code>def credit_card_details\n credit_card = ActiveMerchant::Billing::CreditCard.new(\n :first_name =&gt; 'Bob',\n :last_name =&gt; 'Bobsen',\n :number =&gt; '4242424242424242',\n :month =&gt; '8',\n :year =&gt; '2012',\n :verification_value =&gt; '123')\n\n errors.add(:expire_year, \"Credit card expired\") if credit_card.expired?\n errors.add(:cc_number, \"invalid credit card details\") unless credit_card.valid?\n\n if credit_card.valid?\n # Capture $10 from the credit card\n amount = 1000\n response = PAYPAL_GATEWAY.purchase(amount, credit_card)\n\n if response.success?\n puts \"Successfully charged $#{sprintf(\"%.2f\", amount / 100)} to the credit card #{credit_card.display_number}\"\n else\n\n raise StandardError, response.inspect\n end\n end\n end\n</code></pre>\n\n<p>I was trying with other credit card details but it was causing \"A field was longer or shorter than the server allows\" this error. So I replaced cc details with one specified in active_merchants github page still no luck. \nI dont understand what is wrong?</p>\n", "Lable": "No"}
{"QuestionId": 7468149, "AnswerCount": 1, "Tags": "<eclipse><eclipse-rcp><xtext>", "CreationDate": "2011-09-19T08:23:36.633", "AcceptedAnswerId": "13491190", "Title": "XText in a RCP product", "Body": "<p>we want to provide the users of our RCP product with a textual editor for our model. Accordingly, we created an EMF model and a XText grammar. The problem is that our RCP app does not the Eclipse IDE's project structure (i.e., we do not have any workspaces or builders), hence we have some troubles in making the XText editor work... </p>\n\n<p>does anybody have some suggestions? </p>\n\n<p><strong>[EDIT to clarify my question]</strong></p>\n\n<p>I have some plugins with the EMF model &amp; XText stuff. If I run those plugins in a \"standard\" eclipse product, I am able to create and edit textual instances of my model (like in the default XText demo).</p>\n\n<p>However, I need to go a step further: those plugins are required in a RCP product I'm working on. This product does <strong>NOT</strong> leverage the project management of eclipse. Accordingly, my RCP cannot add the XText nature to its projects, hence the default XText editor are not properly working.</p>\n\n<p>When I searched for solutions, I only found links dated 2009 (which is before XText 2.0). Additionally, there is a bug opened on this issue ( <a href=\"https://bugs.eclipse.org/bugs/show_bug.cgi?id=289212\" rel=\"noreferrer\">https://bugs.eclipse.org/bugs/show_bug.cgi?id=289212</a> ) but the last comment was made roughly one year ago...</p>\n", "Lable": "No"}
{"QuestionId": 7471751, "AnswerCount": 2, "Tags": "<asp.net><asp.net-mvc-3><url-routing><asp.net-mvc-areas>", "CreationDate": "2011-09-19T13:31:49.047", "AcceptedAnswerId": "7471892", "Title": "asp.net mvc 3 areas and url routing configuration", "Body": "<p>I have problem with create ulr routing for asp.net mvc3 application.</p>\n\n<p>My project has this structure : </p>\n\n<ul>\n<li>Areas\n<ul>\n<li>EmployeeReport\n<ul>\n<li>Controllers\n<ul>\n<li>Report </li>\n</ul></li>\n<li>Views\n<ul>\n<li>Report\n<ul>\n<li>List </li>\n<li>....</li>\n</ul></li>\n</ul></li>\n</ul></li>\n</ul></li>\n<li>Controllers\n<ul>\n<li>Login </li>\n</ul></li>\n<li>Viwes\n<ul>\n<li>Login\n<ul>\n<li>... </li>\n</ul></li>\n</ul></li>\n</ul>\n\n<p>EmployeeReportAreaRegistration.cs : \n<code></p>\n\n<pre><code>public class EmployeeReportAreaRegistration : AreaRegistration\n{\n public override string AreaName\n {\n get\n {\n return \"EmployeeReport\";\n }\n }\n\n public override void RegisterArea(AreaRegistrationContext context)\n {\n var routes = context.Routes;\n\n routes.MapRoute(null, \"vykazy/vykazy-zamestnance\", new { Area = \"EmployeeReport\", controller = \"Report\", action = \"List\" });\n\n }\n}\n</code></pre>\n\n<p></code></p>\n\n<p>Global.asax : </p>\n\n<p><code></p>\n\n<pre><code> routes.MapRoute(null, \"prihlasit\", new { controller = \"Login\", action = \"Login\" });\n\n routes.MapRoute(\"Default\", \"{controller}/{action}/{id}\", new { controller = \"Default\", action = \"Welcome\", id = UrlParameter.Optional });\n</code></pre>\n\n<p></code></p>\n\n<pre><code>When i try load \"http://localhost/app_name/vykazy/vykazy-zamestnance\ni get this exception :\n\nThe view 'List' or its master was not found or no view engine supports the searched locations. The following locations were searched:\n~/Views/Report/List.aspx\n~/Views/Report/List.ascx\n~/Views/Shared/List.aspx\n~/Views/Shared/List.ascx\n~/Views/Report/List.cshtml\n~/Views/Report/List.vbhtml\n~/Views/Shared/List.cshtml\n~/Views/Shared/List.vbhtml\n</code></pre>\n\n<p>Well, where I do mistake ?</p>\n\n<p>Thanks</p>\n", "Lable": "No"}
{"QuestionId": 7544140, "AnswerCount": 2, "Tags": "<python><c><image-processing><opencv>", "CreationDate": "2011-09-25T07:09:43.993", "AcceptedAnswerId": "7545444", "Title": "Why does cvSet2D take in a tuple of doubles, and why is this tuple all 0 save for the first element?", "Body": "<p><code>cvSet2D(matrix, i, j, tuple)</code></p>\n\n<p>Hi. I'm dissecting the Gabor Filter code given in <a href=\"http://www.eml.ele.cst.nihon-u.ac.jp/~momma/wiki/wiki.cgi/OpenCV/Gabor%20Filter.html\" rel=\"nofollow\">http://www.eml.ele.cst.nihon-u.ac.jp/~momma/wiki/wiki.cgi/OpenCV/Gabor%20Filter.html</a> . I have a few questions on cvSet2D especially as used in the following code snippets (as given in the link):</p>\n\n<p>C code:</p>\n\n<pre><code>for (x = -kernel_size/2;x&lt;=kernel_size/2; x++) {\n for (y = -kernel_size/2;y&lt;=kernel_size/2; y++) {\n kernel_val = exp( -((x*x)+(y*y))/(2*var))*cos( w*x*cos(phase)+w*y*sin(phase)+psi);\n cvSet2D(kernel,y+kernel_size/2,x+kernel_size/2,cvScalar(kernel_val));\n cvSet2D(kernelimg,y+kernel_size/2,x+kernel_size/2,cvScalar(kernel_val/2+0.5));\n }\n}\n</code></pre>\n\n<p>Python code:</p>\n\n<pre><code>for x in range(-kernel_size/2+1,kernel_size/2+1):\n for y in range(-kernel_size/2+1,kernel_size/2+1):\n kernel_val = math.exp( -((x*x)+(y*y))/(2*var))*math.cos( w*x*math.cos(phase)+w*y*math.sin(phase)+psi)\n cvSet2D(kernel,y+kernel_size/2,x+kernel_size/2,cvScalar(kernel_val))\n cvSet2D(kernelimg,y+kernel_size/2,x+kernel_size/2,cvScalar(kernel_val/2+0.5))\n</code></pre>\n\n<p>As I'm aware cvSet2D sets the (j, i)th pixel of a matrix to the equivalent color value of the tuple defined in the last parameter. But why does it take in a tuple of doubles? Isn't it more natural to take in a tuple of ints, seeing that a pixel color is defines as a tuple of ints?</p>\n\n<p>Lastly, if I read the docs correctly, the cvScalar method used returns the 4-tuple <code>&lt;given_value_in_double, 0.000000, 0.000000, 0.000000)&gt;</code>. I surmised that cvSet2D takes the first three values and uses it to as the RGB 3-tuple. But, seeing that the output of Gabor Filters are more or less in grayscale, that won't hold being that, the colors produced in my scheme will lean towards red. So, what does cvSet2D do with this tuple?</p>\n\n<p>Thank you for anyone who'll take the bother to explain!</p>\n", "Lable": "No"}
{"QuestionId": 7564803, "AnswerCount": 2, "Tags": "<asp.net><session><c#-4.0><login>", "CreationDate": "2011-09-27T05:59:01.553", "AcceptedAnswerId": "7566018", "Title": "Using Sessions in an ASP.NET 4.0 Log-In Control", "Body": "<p>I'm currently developing a website using Visual Studio 2010. As you all might know, creating a new website here automatically adds an Account folder which contains webpages like Login.aspx, etc. I am implementing this Login.aspx which contains the ASP.NET Login control. It's now functioning the way it should but I have a few concerns.</p>\n\n<p>Before, I used to create my own UI for the log-in so managing sessions is not a problem to me. But since i'm currently using the Login.aspx which has a CS file almost empty, i don't have an idea where I can start implementing my session. Meaning to say, I don't know how to check programatically if the user has been successfully logged in so I can start implementing my session.</p>\n\n<p>I would very much appreciate any pointer regarding this matter.</p>\n\n<p>Thanks in advance. :)</p>\n", "Lable": "No"}
{"QuestionId": 7614345, "AnswerCount": 3, "Tags": "<wordpress>", "CreationDate": "2011-09-30T18:09:42.130", "AcceptedAnswerId": "7620012", "Title": "Wordpress query_posts posts_per_page not working", "Body": "<p>Can't figure out why this is not limiting the posts_per_page. It is displaying a very long list of posts, but I only want to show 4</p>\n\n<pre><code>query_posts('posts_per_page=4&amp;post_type=page&amp;pagename=media');\n\nif(have_posts() ) :\nwhile(have_posts()) : the_post();\n</code></pre>\n", "Lable": "No"}
{"QuestionId": 7672393, "AnswerCount": 2, "Tags": "<c#><asp.net>", "CreationDate": "2011-10-06T09:23:41.143", "AcceptedAnswerId": "7672508", "Title": "ASP.net page_load doesn't detect session", "Body": "<p>I have a problem with using <code>session</code> variable in the <code>page_load</code>. I have a page (<code>members.aspx</code>) which is a members area. </p>\n\n<p>If the user isn't <code>logged</code> in, it will display a form asking them to login. The form submits their details, checks if ok then sets <code>session</code> variables if <code>OK</code>. It then reloads the page.</p>\n\n<p>So if the user has authenticated correctly, it sets <code>Session[\"memberLoggedIn\"] = true</code>. \nMy <code>page_load</code> function then looks like this</p>\n\n<pre><code>protected void Page_Load(object sender, EventArgs e)\n{\n if (Convert.ToBoolean(Session[\"memberLoggedIn\"]) == true) {\n Response.Write(\"OK\");\n }\n}\n</code></pre>\n\n<p>There is more code, but essentially, the \"OK\" should be written. However, it doesn't appear. Even though the <code>session</code> IS set. If I go to the page directly it will then show. It's just for the reloading of the members page from the initial login which stops it. </p>\n\n<p>any ideas?!</p>\n\n<p>======================\nthe code to set the session is</p>\n\n<pre><code>if (logindetails.Count &gt; 0) {\n System.Data.DataRow details = logindetails[0];\n Session[\"memberLoggedIn\"] = true;\n}\n</code></pre>\n\n<p>I then just check if <code>(Convert.ToBoolean(Session[\"memberLoggedIn\"]) == true)</code> on all my pages. To be honest it doesn't seem that reliable and I Think sometimes I need to understand the order in which pages are loaded as when I destroy the session on the log out page, some parts still show the logged in features! (but that's another story....)</p>\n", "Lable": "No"}
{"QuestionId": 7690627, "AnswerCount": 2, "Tags": "<javascript><dom>", "CreationDate": "2011-10-07T17:17:36.197", "AcceptedAnswerId": "7690653", "Title": "How to retrieve the text of a DOM Text node?", "Body": "<p>For a given Text node in the DOM, one can use one of these properties to retrieve its text: </p>\n\n<ul>\n<li><code>textContent</code></li>\n<li><code>data</code></li>\n<li><code>nodeValue</code></li>\n<li><code>wholeText</code></li>\n</ul>\n\n<p>But which one to use? Which one is the most reliable and cross-browser supported?</p>\n\n<p>(If multiple properties are 100% reliable and cross-browser, then which one would be most appropriate?)</p>\n", "Lable": "No"}
{"QuestionId": 7707020, "AnswerCount": 2, "Tags": "<javascript><jquery><checkbox>", "CreationDate": "2011-10-09T22:30:50.303", "AcceptedAnswerId": "7707103", "Title": "JS / JQuery - Trouble with getting checkbox values", "Body": "<p>I have many checkboxes in a dynamically produced (ASP) photo gallery. Each checkbox has the name 'photos' and contains a photo ID in the value, like this:</p>\n\n<pre><code>&lt;form name=\"selectForm\" id=\"selectForm\"&gt;\n&lt;input type=\"checkbox\" onclick=\"selectPhoto(&lt;%=rs1.Fields(\"photoID\")%&gt;)\" id=\"checkbox_&lt;%=rs1.Fields(\"photoID\")%&gt;\" class=\"photos\" name=\"photos\" value=\"&lt;%=rs1.Fields(\"photoID\")%&gt;\"&gt;\n&lt;/form&gt;\n</code></pre>\n\n<p>Without submitting a form, when the user clicks the checkbox, I need to create a comma (,) separated list of all the checked values for the checkbox named 'photos'. So this is what I tested but it alerts 'undefined'! The ASP is correct, for those not familiar with it.</p>\n\n<pre><code>function selectPhoto(id) {\n... other stuff that uses id ...\nvar allValues = document.selectForm.photos.value;\nalert(allValues);\n}\n</code></pre>\n\n<p>But as I said above, this returns 'undefined' and I can work out why. When a user selects a photo, I simply need to display a list of all the photo ID's that have been clicked e.g. 1283,1284,1285,1286...</p>\n\n<p>Any ideas what I am doing wrong here? Or is there another way to achieve this?</p>\n", "Lable": "No"}
{"QuestionId": 7890076, "AnswerCount": 2, "Tags": "<wpf><datagrid><cell>", "CreationDate": "2011-10-25T13:33:36.420", "AcceptedAnswerId": "7890969", "Title": "Access to cell values of a DataGrid in WPF?", "Body": "<p>We have such a scenario that we have a page including a DataGrid, and now we want to get all data from this DataGrid, but without accessing to the underlying item source of it, i.e., we want to access to the data directly from the DataGrid. It seems to be tricky but not impossible. I found many articles, like this: <a href=\"http://code.google.com/p/artur02/source/browse/trunk/DataGridExtensions/DataGridHelper.cs\" rel=\"nofollow\">DataGridHelper</a>, and this: <a href=\"http://techiethings.blogspot.com/2010/05/get-wpf-datagrid-row-and-cell.html\" rel=\"nofollow\">Get WPF DataGrid row and cell</a>, and many other ones. They are basically the same thing: to define the extension methods on DataGrid with help of another GetVisualChild function to find the target DataGridCell object. However, when I am using it, I can't find the target cell. Specifically, Each row in the DataGrid corresponds to one item from a collection of the DataContext, let's say, it is a collection of type \"Employee\", and each column of the DataGrid corresponds one property of class Employee, e.g, the Name, Gender, Age. Now my problem is, the above-mentioned GetCell() function always finds a DataGridCell with one Employee object as its content (the property of Content in DataGridCell), and can't go further into each property, no matter what column index I give it. \nFor example, in the GetCell function, there is one line:\n <code>Dim cell As DataGridCell = DirectCast(presenter.ItemContainerGenerator.ContainerFromIndex(column), DataGridCell)</code>, \nwhere the presenter is a DataGridCellsPresenter I got which representing the row I choose, and as soon as I give the column index, naturally I am expecting it to return the control for selected property at position I specified. But it just doesn't work as expected. Any help would be appreciated!</p>\n", "Lable": "No"}
{"QuestionId": 7955749, "AnswerCount": 3, "Tags": "<php><datetime>", "CreationDate": "2011-10-31T15:22:39.657", "AcceptedAnswerId": "7955793", "Title": "Changing date formats in PHP < 5.3.0", "Body": "<p>Given a date string in the format m-d-Y (e.g, \"12-09-2011\") how can I display it in the format \"m/d/Y\" <strong>WITHOUT</strong> resorting to regular expressions.</p>\n\n<p>Just in case you missed it: <strong><em>without using regular expressions.</em></strong></p>\n\n<p>I would prefer to use <code>DateTime::createFromFormat()</code> for this problem, but the server I am using currently doesn't have 5.3.0 on it.</p>\n\n<p>I'd also prefer using <code>date('m/d/Y', strtotime(\"12-09-2011\"))</code> but <code>strtotime()</code> doesn't recognize that format properly. It confuses the day and month.</p>\n", "Lable": "No"}
{"QuestionId": 7979375, "AnswerCount": 5, "Tags": "<c#><textbox><substring>", "CreationDate": "2011-11-02T11:12:25.287", "AcceptedAnswerId": "7979400", "Title": "Using substring in C# textboxes", "Body": "<p>I wanted to display the remaining characters using a label beside my textbox just in case the user input exceeded the maximum length of characters.</p>\n\n<p>This is my code for remaining characters:</p>\n\n<pre><code>private void txtID_TextChanged(object sender, EventArgs e)\n {\n int MaxChars = 10 - txtID.Text.Length;\n labelChars.Text = MaxChars.ToString() + \" characters remaining.\";\n }\n</code></pre>\n\n<p>What I wanted to do now is to prevent the user from entering characters in my textbox when he/she already exceeded the character limit. I'm planning to use the <strong>Substring</strong> property of the textbox but I don't know how. Help me out? Thanks.</p>\n", "Lable": "No"}