title
stringlengths
13
150
body
stringlengths
749
64.2k
label
int64
0
3
token_count
int64
1.02k
28.5k
How to do a select query using flask and sqlalchemy?
<p>I'm new using flask and SQLAlchemy, I have a database in postgress, this database have table "data" 200 records, I want to do a Select statment but when I do it always give me the same error, this my code:</p> <p>This is my model.py</p> <pre><code>from sqlalchemy import Column, ForeignKey, Integer, String from sql...
0
1,144
Unable to authenticate to SSL site in java: "pathLenConstraint violated - this cert must be the last cert in the certification path"
<p>I'm trying to read from a secure (i.e. SSL) web page, in Java code. I'm trying to use both URLConnection (java.net) and Apache's HTTPClient. In both cases, when I make the request, I get this exception:</p> <blockquote> <p>javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX pa...
0
1,470
.NET 4.0 Concurrent collection performance
<p>I am trying to write a program where i schedule items for removal by putting them in a collection from different threads and cleaning them up in a single thread that iterates of the collection and disposes the items.</p> <p>Before doing so, I wondered what would yield the optimal performance so I've tried Concurren...
0
1,135
KO data-binding "text:" to a function with a parameter
<p>Is it possible in any way to do the following without have to pass through temporary observables / computed observables? I have common data which is used for lookups to display data:</p> <pre><code>&lt;span data-bind="text: lookupContactName(31)"&gt;&lt;/span&gt; </code></pre> <p>result: function is exectuded, pa...
0
1,325
C# using SendMessage, problem with WM_COPYDATA
<p>I've been spending a few days (or more) trying to get this to work.</p> <p>The application at hand is <code>FTPRush</code>, and I know there is a cmd line application called <code>rush_cmdline.exe</code> which uses <code>SendMessage</code> to send requests to <code>FTPRush</code>.</p> <p>From debugging the <code>r...
0
1,073
Argument 1 passed to Illuminate\\Database\\Eloquent\\Model::__construct() must be of the type array, object given
<p>I want to add product to wishlist and following repository pattern to store product id and user id of the user who wants to add product to his wishlist but when i run my code i get </p> <blockquote> <p>Argument 1 passed to Illuminate\Database\Eloquent\Model::__construct() must be of the type array, object giv...
0
1,916
PyTorch: Expected input batch_size (12) to match target batch_size (64)
<p>I tried out PyTorch and wanted to write a program for MNIST. But, I got the error message:</p> <blockquote> <p>Expected input batch_size (12) to match target batch_size (64)</p> </blockquote> <p>I searched for a solution but I don't understand what's wrong with my code.</p> <pre><code>#kwargs is empty because I...
0
1,692
Installation of javaCV
<p>I am trying to follow the instructions for installing javaCV from here: <a href="https://code.google.com/p/javacv/" rel="nofollow noreferrer">https://code.google.com/p/javacv/</a>. I ve already built opencv. Actually I locate the java folder with .jar file and .dll in opencv folder and I add them in the path of my p...
0
1,070
NG0200: Circular dependency in DI detected for InjectionToken HTTP_INTERCEPTORS
<pre><code>Angular CLI: 11.0.1 Node: 14.8.0 OS: darwin x64 Angular: 11.0.0 ... animations, cdk, common, compiler, compiler-cli, core, forms ... language-service, material, platform-browser ... platform-browser-dynamic, router Ivy Workspace: Yes Package Version ---------------------------------...
0
2,539
AlertDialog styling - how to change style (color) of title, message, etc
<p>I've breaking my head over this quite a bit. What I need to do is, change the style of all <code>AlertDialog</code>s in my android application - dialog background needs to be white-ish, and text needs to be black-ish. I tried creating a lot of styles, themes, and applying from the code, manifest, etc, but no success...
0
1,485
Row not taking 100% height in css-grid
<p>I want to create a page which has <code>Bootstrap</code>'s <code>navbar</code> and <code>css-grid</code>'s layout. </p> <p>At the top level, I have created a <code>css grid</code> with 1 column and two rows. I want the grid to contain 2 rows. The height of the first row should be the same as the height of bootstrap...
0
1,803
Woocommerce - search in product category by keyword
<p>This is my search form. Im use woocommerce. And need to search products by keywords and categories.</p> <pre><code> &lt;form role="search" method="get" action="&lt;?php echo get_permalink( woocommerce_get_page_id( 'shop' ) ); ?&gt;"&gt; &lt;div class="search-bar-select hidden-sm hidden-xs"&gt; ...
0
1,061
How to insert data into a wordpress table using a custom function
<p>I have a wordpress app hosted on Azure, and I need to insert data into the wp_posts table, using a custom function since I'm running this script as a background job and I cannot use wordpress functions since the script is not on the wordpress folder.</p> <p>I've tried:</p> <pre><code>mysql_query("INSERT INTO wp_po...
0
1,551
Unresolved symbols QMetaObject when building OpenCV with QT support
<p>I have problems on building OpenCV_HighGui220d.lib with QT support. The problems are the unresolved symbols about <strong>QMetaObject</strong>, such as:</p> <pre><code> public: virtual struct QMetaObject const * __thiscall GuiReceiver::metaObject(void)const (?metaObject@GuiReceiver@@UBEPBUQMetaObject@@XZ) </cod...
0
3,218
System.Data.SqlClient.SqlException: Invalid column name 'phone_types_phone_type_id'
<p>I'm trying to get information from some of my models that have a foreign key relationships to my main employee model. If I map out each model individually, I can access them like normal with no problems, but I have to visit multiple different web pages to do so.</p> <p>I'm trying to merge several of my models into ...
0
2,008
Create Bar Chart in Excel with Apache POI
<p>I'm trying to create a Bar Chart in an XLSX Spreadsheet using Apache POI, but Excel keeps saying that there's a problem with the content and deleting the chart when I try to open the file. Here's the full code of what I'm trying to do:</p> <pre><code>public static void createBarChart() { Workbook wb = new ...
0
2,209
Socket.io installation fails on windows 7 32 bit
<blockquote> <p>I installed node.js <strong>v0.8.22</strong> and tried to install socket.io in Windows 7 32bit Socket.io installation fails consecutively. Console log is:</p> </blockquote> <pre><code>C:\Program Files\nodejs&gt;npm install socket.io npm http GET https://registry.npmjs.org/socket.io npm http GET...
0
1,353
PersistenceContext not injecting EntityManager
<p>I am getting a NullPointerException when trying to access the <code>EntityManager</code> via annotation <code>PersistenceContext</code></p> <pre><code>import javax.ejb.Stateless; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; import javax.persistence.criteria.CriteriaBuilder; i...
0
1,322
How to get checked checkboxes in JSP
<p>How can I get/set checkbox value using jstl and delete only those record from the database where the checkbox is checked? can you also advise how to use ternary operators in jstl for this scenario?</p> <p>SearchStudent.jsp</p> <pre><code> &lt;%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%&gt; ...
0
1,382
How to export an HTML table as a .xlsx file
<p>I have a question about exporting an <strong>HTML table</strong> as an <strong>xlsx</strong> file. I did some work and now I can export it as an <strong>xls</strong>, but I need to export it as an <strong>xlsx</strong>.</p> <p><strong>Here is my jsFiddle:</strong> <a href="https://jsfiddle.net/272406sv/1/" rel="nor...
0
1,274
Maven skip site/reporting for module
<p>I have a multi-module project and in the parent pom, I have several reporting plug-ins defined. Some of the modules contain code that does not need to have the reporting plugins run against them and I do not need them included in the generated site. Is there a way I can tell Maven to ignore them at the parent pom le...
0
1,193
ContextCompat.getcolor() going to null object reference
<p>I'm getting error when I set color to SlidingTabLayout object. Here is my mainActivity, first I found that getResource.getColor is deprecated. So I used contextCompat.getColor. But now its going to null.</p> <pre><code>public class MainActivity extends AppCompatActivity { private Toolbar toolbar; private V...
0
1,836
How can I make my AES encryption identical between Java and Objective-C (iPhone)?
<p>I am encrypting a string in objective-c and also encrypting the same string in Java using AES and am seeing some strange issues. The first part of the result matches up to a certain point but then it is different, hence when i go to decode the result from Java onto the iPhone it cant decrypt it.</p> <p>I am using a...
0
1,248
Type conversion in VHDL: real to integer - Is the rounding mode specified?
<p>While debugging the handling of user defined physical types in Vivado (<a href="https://stackoverflow.com/questions/27792449/can-vivado-handle-user-defined-physical-types">read more</a>), I found a different behavior for type conversions from real to integer.</p> <p>Here is my example code:</p> <pre><code>library ...
0
1,044
Error rendering data with Javascript / KendoUI autocomplete - Object #<Object> has no method 'slice' - how to resolve?
<p>I am following the <a href="http://www.kendoui.com/blogs/teamblog/posts/12-10-25/using_kendo_ui_with_mvc4_webapi_odata_and_ef.aspx" rel="noreferrer">Using Kendo UI with MVC4 WebAPI OData and EF</a> article. After installing KendoUI and making sure all references are set, I type in three characters, and get the foll...
0
3,257
Excel automation: How do I set the range?
<p>The standard method to get the range of an Excel spreadsheet in use is the UsedRange-method. I can copy all the used cells like this:</p> <pre><code>xlWorkSheet.UsedRange.Copy(misValue); </code></pre> <p>Unfortunately it is not a good method because cells are "activated" if the user write something in one and then...
0
1,855
Python OpenCV streaming from camera - multithreading, timestamps
<p>I ran simple python script on Raspberry Pi 3. This script is responsible to open video device and stream data (800x600) to HTTP endpoint using MJPEG. When I receive this stream one of my Raspberry Pi cores works on 100%. It possible to run OpenCV with multi threading?</p> <p>This is my code</p> <pre><code>import cv2...
0
1,265
C# - XML - Compression
<p>I have a situation where I am generating a XML file to be submitted to a webservice, sometimes due to the amount of data it exceeds 30mb or 50mb. </p> <p>I need to compress the file, using c#, .net framework 4.0, rather one of the nodes which has most of the data.. I have no idea how i am going to do it .. is it po...
0
2,330
Autolayout violates translation rotation animation
<p>I have UIView, I want to animate it with rotation. I want to use autolayout too. I already saw a lot of stackoverflow common questions, but I didn't find any applicable solution. So, let's start with my interface and animation code; I have a UIView with image, which must be rotated. And right now I have button, that...
0
1,163
Android Studio CMake Error: Build Command failed
<p>I'm running into an Error when I open a new project in Android Studio from the Code Samples (Hello JIN). When the Project is opened the following:</p> <pre><code>Build command failed. Error while executing process /opt/android-sdk/cmake/3.6.4111459/bin/cmake with arguments {-H/home/max/Documents/AndroidStudioProjec...
0
1,395
Angular 6 Material: mat-tab-link be selected by underlining bar
<p>I have a <code>mat-tab-nav-bar</code> navigation bar for my website, but the <code>mat-tab-link</code> blue underlining bar won't chase the active button. It just stays at the first button, and doesn't move. The buttons do turn into active state though in the sense that the background color changes, and they route w...
0
1,540
Python 3.9 Microsoft Visual C++ 14.0 or greater is required
<p>so I recently upgraded to Python 3.9 and when trying to install some libraries - specifically <code>pip install discord</code> - I encountered the following error:</p> <pre><code> ERROR: Command errored out with exit status 1: command: 'c:\users\user\appdata\local\programs\python\python39\python.exe' 'c:\users\u...
0
2,098
How to relocate the dz-remove link Dropzone.js
<p>On my image below as you can see I would like to be able change the position of the remove file link to out side of the content div area.</p> <p>I have tried with custom template bit no luck.</p> <blockquote> <p>Question How can I have a remove file button out side of my content div area? Instead of below imag...
0
1,372
SUM by two different GROUP BY
<p>I'm getting the wrong result from my report. Maybe i'm missing something simple.</p> <p>The report is an inline table-valued-function that should count goods movement in our shop and how often these spareparts are claimed(replaced in a repair). </p> <p>The problem: different spareparts in the shop-table(lets call ...
0
2,398
Python causing: IOError: [Errno 28] No space left on device: '../results/32766.html' on disk with lots of space
<p>I am running a Python script that is causing the above error. The unusual thing is this script is running on a different machine and is having no problems.</p> <p>The difference is that on the machine that is causing the problems I am writing to an external hard drive. To make things even weirder this script has r...
0
1,076
set content type for xml response in spring
<p>I have this method that returns an object which is then serialized.</p> <p>I'd like to set the content type of the response (e.g. as <code>application/xml</code>).</p> <p>How can I do this?</p> <p>I have found other posts but they are not very clear about how to do this for xml type</p> <pre><code>@RequestMappin...
0
1,808
SQLSTATE[42000]: Syntax error or access violation: 1064 PHP/MySQL
<p>I am creating a script to automatically export the results of a query i have created in MySQL, in a table format in an email. I have it working up to the point where i receive 2 emails, one email gives me the error: <strong>SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax...
0
1,518
Remove item from array in Vue
<p>I have the following task list app. I am trying to implement a <code>delete</code> function. I get I need to use <code>splice</code> to remove the item from the <code>array</code> but how do I target only the item whose button I clicked on?</p> <p><a href="https://jsfiddle.net/clintongreen/txtrage5/1/" rel="nofollo...
0
1,267
how to get ID of the items in recyclerview
<p>i'm using slide to delete from recyclerview but the problem comes when getAdapterPosition() doesn't match with the row_id of sql table. how can i get id from the adapter and how to update recyclerview when the data is added(it doesn't display new data until i reopen the app or change orientation) ?</p> <p>public cl...
0
2,090
AngularJS $http REST call returns null data
<p>I have a REST service that returns a JSON object. I am trying to make the authentication but it responses with empty data.</p> <p>I did notice that the call is asychronous and when the user is pressing the login button it makes the call before getting the username and password. So I decided to use the $q constructo...
0
1,395
Getting the closest date to a given date
<p>Given this base date:</p> <pre><code>base_date = "10/29 06:58 AM" </code></pre> <p>I want to find a tuple within the list that contains the closest date to the <code>base_date</code>, but it must not be an earlier date. </p> <pre><code>list_date = [('10/30 02:18 PM', '-103', '-107'), ('10/30 02:17 PM', '+100', '-...
0
2,388
Sending Data in socket programming using "C"
<p>I had earlier posted a question, regarding same, but over here i want guidance for my code. Using the tips from people I have tried to create for sending a packet. My max packet structure alongwith header and payload is of 16 bytes.Kindly if possible glance through the sending and receiving code and suggest where i...
0
2,263
Splitting a dataframe into separate CSV files
<p>I have a fairly large csv, looking like this:</p> <pre><code>+---------+---------+ | Column1 | Column2 | +---------+---------+ | 1 | 93644 | | 2 | 63246 | | 3 | 47790 | | 3 | 39644 | | 3 | 32585 | | 1 | 19593 | | 1 | 12707 | | 2 | 53480 | +---------+--...
0
1,095
how to create dynamic dropdown list in angularjs
<p>I have a problem in creating a dynamic dropdown list. I have this select options.</p> <p><strong>UPDATED</strong></p> <pre><code> &lt;div class="form-group has-feedback"&gt; &lt;label class="control-label"&gt;Type&lt;/label&gt;&lt;br/&gt; &lt;select class="form-control" ng-model="selectedItem" ng-options="it...
0
1,232
Invalid type in JSON write (_SwiftValue) using Alamofire
<p>I have tried a lot of things now and are still getting: <em>Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Invalid type in JSON write (_SwiftValue)'</em></p> <p>UPDATE: I scan a barcode and save the info:</p> <pre><code>let calendar = Calendar.current let expiryDate = (calendar as...
0
1,088
Firebase - Cannot assign value of type 'AppDelegate' to type 'UNUserNotificationCenterDelegate?'
<p>I always get compiling erros when deploying firebase using this tutorial: <a href="https://firebase.google.com/docs/cloud-messaging/ios/client" rel="noreferrer">https://firebase.google.com/docs/cloud-messaging/ios/client</a> My deployment SDK is 9.0.</p> <h1><strong>Errors I get:</strong></h1> <p>How can I fix this?...
0
1,159
Is it possible to inject a bean defined with @Component as an argument to a BeanFactoryPostProcessor?
<p>And if so which configuration is needed? Is this not recommended?</p> <p>The annotated class:</p> <pre><code>package com.springbug.beanfactorydependencyissue; import javax.annotation.Resource; import org.springframework.stereotype.Component; @Component public class DependantBean { @Resource DependencyBe...
0
1,367
tomcat server fails to start the server and application in STS
<p>When I run a Spring MVC application I get this exception and the sever fails to start.</p> <p>Please help me to fix this issue.</p> <p>Exception StackTrace:</p> <pre><code>Jan 24, 2013 11:33:59 AM org.apache.catalina.startup.ContextConfig processAnnotationsJar SEVERE: Unable to process Jar entry [org/springframew...
0
1,032
ANCM InProcess startup failed because of invalid runtimeconfig.json
<p>The application is deployed as an (32-bit, .NET Core 2.2) App Service on Azure. It works fine when using the standard <code>AspNetCoreModule</code> instead of the newer <code>AspNetCoreModuleV2</code> that supports the <code>InProcess</code> hostingmodel. </p> <p>When using the new <code>InProcess</code> hostingmod...
0
4,027
How do I prevent crashing due to invalid input in C#?
<p>The program I've written is set to only accept positive integers as input. If the user inputs a letter instead, then it crashes. Negative integers don't cause any problems, though it's not 'valid' in regards to how my program functions.</p> <p>What I want to do is:</p> <ol> <li><p>Prevent the program from crashing...
0
1,120
SoapUI not finding my web-service
<p>So I've been struggling with web-services for a couple of days now, and It seemed that I finally had a breakthrough.</p> <p>I followed <a href="http://blog.jdevelop.eu/2008/02/27/creating-soap-web-services-with-netbeans-6/" rel="nofollow">this</a> tutorial to the letter, and I have my web-service up and running. Th...
0
1,658
Managing jQuery plugin dependency in webpack
<p>I'm using Webpack in my application, in which I create two entry points - bundle.js for all my JavaScript files/codes, and vendors.js for all libraries like jQuery and React. What do I do in order to use plugins which have jQuery as their dependencies and I want to have them also in vendors.js? What if those plugins...
0
1,216
Dynamically Add Form Elements in MVC3 Razor Create View
<p>I'd like to create a form with a group of text boxes and every time a user clicks the add button those text boxes will be recreated as many time as the user clicks the add button. Here is a picture of what I am looking to do.<img src="https://i.stack.imgur.com/wuHLG.jpg" alt="enter image description here"></p> <h2>...
0
1,540
Howto resolve "Illegal mix of collations" SQLException?
<p>I looked in the mysql reference, and here, in stackoverflow, and looks like a lot of people are having difficulties with character encoding, but I couldn't find a clear answer to this problem:</p> <p>A java program is using a mysql database, and when there are special characters in the query like ű,ő (but á,é,í,ó,ú...
0
1,115
nullpointer exception on statement = conn.createStatement();
<p>I am using jdbc in android (Aware not recomended)</p> <p>I have following piece of code:</p> <pre><code> public int CheckUser(String uName,String password) { try { String sql="select uid from UserMaster where username='"+uName+"' and password='"+password+"'"; ...
0
4,124
GroupBy in EF Core 3.1 / EF Core 5.0 not working, even for the simplest example
<p>I'm updating an EF6.x project to EF Core 3.1. Decided to go back to basics and follow the example of how to set up relationships from scratch again.</p> <p>According to the official Microsoft documentation, <a href="https://docs.microsoft.com/en-us/ef/core/modeling/relationships?tabs=fluent-api%2Cfluent-api-simple-k...
0
2,484
SQL query for Calculating Total No. of Orders per Day?
<p>Can anyone post a SQL query for Calculating Total No. of Orders per Day?</p> <p>Here are the Columns along with their data in my Database.</p> <hr> <pre><code>order_id order_placed_date order_total - 1 12/30/2008 12:06:24 AM 2499.99 - 2 2/3/2009 1:57:17 AM 199.99 - 3 2/3/2009 1:58:27 AM 44...
0
1,037
How to create a reusable widget in Yii2
<p>I have made a simple widget in my current project of <a href="/questions/tagged/yii2" class="post-tag" title="show questions tagged 'yii2'" rel="tag">yii2</a>. Simply, it creates a select options list for all jui themes and allow the user to change the theme and save it by the mean of cookies.</p> <p>This widget ne...
0
1,078
HTTP Post request with content type application/x-www-form-urlencoded not working in Spring boot service
<p>I am new to spring boot recently i am trying to do HTTP POST request from one android application through retrofit2 rest API library with application/x-www-form-url encoded but when i hit my spring boot POST service it shows me below error</p> <blockquote> <p>"status":415,"error":"Unsupported Media Type","excep...
0
2,481
Google login uses same account everytime users login
<p>I use OAuth to let users sign in to the android app via Google account. When the user taps the Google login button for the first time, it produces a dialog to choose the account. Again, when the user logs out and decides to login with different Google account, it doesn't prompt to choose the account, it logs in the ...
0
5,527
Pass data to CGI script and back with jQuery.ajax
<p>I'm working with <strong>jQuery.ajax()</strong> to send some HTML form data to my Perl script on the server and then return some data back to the frontend.</p> <p>Preferably, the data should be in text/string format. I also need to save it as a variable for further use in jQuery functions.</p> <p>I already set up ...
0
1,538
How to use CMake with Catch2?
<p>From <a href="https://github.com/catchorg/Catch2/blob/master/docs/tutorial.md#writing-tests" rel="noreferrer">Catch2's example</a>, I tried to run this example with <code>cmake</code> where structure of my project is like this:</p> <pre><code>/factorial +-- CMakeLists.txt +-- /bin +-- /include | ...
0
1,039
Getting cannot read property 'users' of undefined while creating mongoose model
<p>I am trying to create a mongoose model and using it to get the data from the mongodb, but I am getting the exception </p> <p>My mongoose version from package.json is :<strong>"mongoose": "4.5.5"</strong></p> <pre><code>TypeError: Cannot read property 'users' of undefined </code></pre> <p>Now here is my demo code:...
0
1,485
How to find a matching row in Excel?
<p><strong>Given</strong></p> <p>A search key</p> <pre><code>--------------------------- | | A | B | C | D | --------------------------- | 1 | 01 | 2 | 4 | TextA | --------------------------- </code></pre> <p>An Excel sheet</p> <pre><code>------------------------------ | | A | B | C | D | E | ------...
0
1,192
AngularJS: Uncaught ReferenceError: angular is not defined app.js:1(anonymous function):
<p>I have moved my AngularJS test project into app.js, controllers.js and Services.js. After it my project is not running and not even a single page is being working properly. </p> <p>i have attached my main source files here along with exception screenshot</p> <p>index.html</p> <pre><code> &lt;!DOCTYPE html&gt; ...
0
4,012
Test if Hardware Acceleration has been enabled for a CSS animation?
<p>How can I tell <em>(for testing purposes)</em> if Hardware Acceleration has been enabled for a CSS animation?</p> <p>I have the following code which essentially enlarges an element and makes it fullscreen (without using the HTML5 fullscreen API). It runs like a stuttering asthmatic tortoise on most mobiles when usi...
0
1,354
How to avoid 'instanceof' when implementing factory design pattern?
<p>I am attempting to implement my first Factory Design Pattern, and I'm not sure how to avoid using instanceof when adding the factory-made objects to lists. This is what I'm trying to do:</p> <pre><code>for (Blueprint bp : blueprints) { Vehicle v = VehicleFactory.buildVehicle(bp); allVehicles.add(v); ...
0
2,137
SQL - INSERT with Scope_Identity() - getting the record id
<p>I have an ASP.NET page written in VB.NET that gets the items into a <code>GridView</code> by using a <code>SELECT</code> statement with <code>INNER JOIN</code> and also allows you to add an item to the invoice.</p> <p><code>INNER JOIN</code> that gets data from <code>items</code> and <code>project_items</code>.</p>...
0
1,159
Using a4j:support to update the model and view, ready for the next button/submit action
<h1>The Problem</h1> <p>We have a swing based front end for an enterprise application and now are implementing a (for now simpler) JSF/Seam/Richfaces front end for it.</p> <p>Some of the pages include fields that, when edited, should cause other fields to change as a result. We need this change to be shown to the use...
0
2,565
In Verilog, how can I define the width of a port at instantiation?
<p>In a Verilog 2001 module, how can I define the width of a port at instantiation?</p> <p>For example, a multiplier and the module that instantiates it might look like this:</p> <pre><code>module Multiplier #(parameter WIDTH = 8, parameter WIDTH1 = 8, WIDTH2 = 8) ( output [WIDTH-1:0] product, input [WIDTH1-1...
0
1,278
parser error : String not started expecting ' or " in php
<p>Hi I'm trying to convert the XML file into associative array by using the following code</p> <pre><code>$xmlUrl = '../products.xml'; $xmlStr = file_get_contents($xmlUrl); $xmlObj = simplexml_load_string($xmlStr); print_r ($xmlObj);exit; $arrXml = objectsIntoArray($xmlObj); </code></pre> <p>and product.xml contai...
0
2,270
code for onclick navbar item changes to active state
<p>I need to change the hover state of the navbar item to active state onclick.I do not know how to write the code for this bootsrap navbar as I cannot really access the links/ .Anything in jquery /javascript /php will be helpful.</p> <p>MY HTML CODE:</p> <p></p> <pre><code>&lt;div class="navbar-inner"&gt; &lt;ul...
0
1,086
PySpark SparkContext Name Error 'sc' in jupyter
<p>I am new for pyspark and want to use pyspark using Ipython notebook in my Ubuntu 12.04 machine. Below are the configuration for pyspark and Ipython notebook.</p> <pre><code>sparkuser@Ideapad:~$ echo $JAVA_HOME /usr/lib/jvm/java-8-oracle # Path for Spark sparkuser@Ideapad:~$ ls /home/sparkuser/spark/ bin CHANGES...
0
1,740
haml by default
<p>Is there a way to configure rails to use haml by default, i.e. when a scaffold is generated the according <code>scaffold_name/index.html.haml</code> is generated instead of <code>scaffold_name/index.html.erb</code>. </p> <p>Similar to how you are able to add <code>config.sass.preferred_syntax = :sass</code> to <co...
0
1,078
Error setting up MySQL: Table 'mysql.plugin' doesn't exist
<p>I have a MySQL 5.7 instance running without problems on Ubuntu 16, but when i try to install any other package or try to update existing ones through apt-get, i get the following error:</p> <pre><code># apt-get upgrade Setting up mysql-server-5.7 (5.7.20-0ubuntu0.16.04.1) ... Checking if update is needed. Checking...
0
2,376
Vuetify v-select not showing :items
<p>I can't figure this out. I am using Vuetify to style my pages, and for some reason I can't get the data to show in my <code>v-select</code> select box. The data SHOULD be coming from the array <code>marketplaces</code>. I thought it might be a version issue, but I've upgraded everything and its still not working.. I...
0
5,651
Docker: Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5432?
<p>I am getting issues while setup and run the docker instance on my local system with Ruby on Rail. Please see my docker configuration files:-</p> <p>Dockerfile</p> <pre><code>FROM ruby:2.3.1 RUN useradd -ms /bin/bash web RUN apt-get update -qq &amp;&amp; apt-get install -y build-essential RUN apt-get -y install ng...
0
1,054
How to mock angularjs $window.sessionStorage with Jasmine and Karma
<p>I'm brand new to Jasmine and trying to figure out how to mock the $window.sessionStorage object when testing an angularjs SPA using Jasmine.</p> <pre><code>(function() { 'use strict'; var serviceId = 'session'; ...
0
1,441
Setting namespaces and prefixes in a Java DOM document
<p>I'm trying to convert a ResultSet to an XML file. I've first used this example for the serialization.</p> <pre><code>import org.w3c.dom.bootstrap.DOMImplementationRegistry; import org.w3c.dom.Document; import org.w3c.dom.ls.DOMImplementationLS; import org.w3c.dom.ls.LSSerializer; ... DOMImplementationRegistry...
0
1,143
Inconsistent scope of "use strict" on different web browsers (concerning arguments.callee and caller)
<h3>Situation:</h3> <p>I found something strange concerning <strong>strict mode</strong> in Javascript.</p> <ul> <li>I am using an external, third-party Javascript library which <ul> <li>was minified,</li> <li>has over 4000 lines of code,</li> <li>is <strong>not</strong> using <code>use strict</code> at all, and</li...
0
1,575
Stream webcam with GStreamer (RTSP)
<p>I have <a href="https://kodakpixpro.com/cameras/360-vr/sp360-4k" rel="nofollow noreferrer">Kodak PIXPRO SP360 4k camera</a> connected to the Jetson Nano or TX2 via USB cable. </p> <p>I want to be able to see that video over browser, either with RTSP stream, Webrtc or something else. It doesn't matter how it works i...
0
1,911
ADO EF - Errors Mapping Associations between Derived Types in TPH
<h2>Background</h2> <p>I am writing a data access library using the ADO Entity Framework in Visual Studio 2008 SP1 using the .NET Framework 3.5 SP1. I am trying to create associations between two entities that are both derived from an abstract type. I am representing both entity inheritance hierarchies using <a href="...
0
11,004
bootstrap-datetimepicker convert selected local date to UTC
<p>im using bootstrap-datetimepicker from <a href="http://tarruda.github.io/bootstrap-datetimepicker/" rel="nofollow">http://tarruda.github.io/bootstrap-datetimepicker/</a> this gives the option to select the datetime in local time, what i cannot understand is how do i convert it to UTC before sending it to the cgi. I ...
0
1,053
MongoDB: Count of matching array elements
<p>I have a collection called "Lines" with the following structure (basically, I have a lot of documents that contain several arrays and I need to count their elements with conditions).</p> <pre><code> { "_id" : "201503110040020021", "Line" : "1", // several documents may have this Line value ...
0
1,375
Illegal Instruction 4 on Mac using C++
<p>I am running this code on my mac (10.8.2) through terminal and for certain n it terminates with "Illegal Instruction 4" does anyone know why, or how to stop it?</p> <p>I am confused as the code runs fine except for n=43, 45, 47 and 57.</p> <p>Also after n=60 it seems to happen for all n. Might it be a memory issue...
0
5,259
python concurrent.futures.ProcessPoolExecutor: Performance of .submit() vs .map()
<p>I am using <code>concurrent.futures.ProcessPoolExecutor</code> to find the occurrence of a number from a number range. The intent is to investigate the amount of speed-up performance gained from concurrency. To benchmark performance, I have a control - a serial code to perform said task (shown below). I have written...
0
3,116
Spring Security Auto Login not Persisted in HttpSession
<p>The below code creates a Spring Authentication object that has the role_user associated as when I looked at the SecurityContext context = SecurityContextHolder.getContext(); at the very end it does have the ROLE_USER and a principal of UserDetails so somehow its not getting associated to my HttpSession. Any ideas? ...
0
6,197
How to install extension for php via docker-php-ext-install?
<p>In order to <a href="https://stackoverflow.com/questions/37526509/how-to-install-pdo-driver-in-php-docker-image">resolve an issue</a>, I am now trying install the mysql pdo via</p> <pre><code>docker-php-ext-install </code></pre> <p>as pointed out in the <a href="https://github.com/docker-library/docs/tree/master/p...
0
1,394
How does MVC populate the model when data is posted back
<p>MVC is very clear on how data is sent to the browser. You go to a URL, it runs code to create a model, passes that typed model into a view, which then renders HTML based on the state of the model.</p> <p>What I'm not finding so clear however is when a user submits a form on the page, how does MVC map that form pos...
0
3,177
C3P0 apparent deadlock when the threads are all empty?
<p>I'm using C3P0 as a connection pool in Tomcat, and I'm seeing very worrying errors:</p> <pre><code>2010-09-16 13:25:00,160 [Timer-0] WARN com.mchange.v2.async.ThreadPoolAsynchronousRunner - com.mchange.v2.async.ThreadPoolAsynchronousRunner$DeadlockDetector@43502400 -- APPARENT DEADLOCK!!! Creating emergency threa...
0
1,029
Multiple file upload with ASP.NET MVC & jQuery Multiple File Upload Plugin
<p>I'm using jQuery Multiple File Upload Plugin to upload several pictures. But form posts only 1, top, item. Fiddler (POST):</p> <pre><code>POST /Images/UploadImages HTTP/1.1 Host: localhost:4793 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.6) Gecko/20091201 Firefox/3.5.6 Accept: text/html,app...
0
1,175
Web Api Custom Authorize Attribute Properties
<p>I'm trying to extend he default Web Api authorize attribute to allow authenticated users to have access to a set of actions even though they are not registered in the application (e.g., they don't have a role).</p> <pre><code> public class AuthorizeVerifiedUsersAttribute : AuthorizeAttribute { /// &lt;s...
0
1,161
Create tree table from JSON object using jQuery
<p>I have following data structure coming as a JSON object from server side</p> <pre><code>var data = { "name": "preprodwizard", "cSVServers": [{ "name": "preprodwizard_80_csvs", "status": "UP", "ipAddress": "162.115.34.53", "port": "80", "protocol": "HTTP", "lBV...
0
2,305
How to iterate through a spark dataset and update a column value in Java?
<p>I'm working on POC where I have to update the account number in DB with tokens. I read the data into a dataset dsRecords(about 2M records). I have another routine that had captured distinct account numbers and got the tokens, the mapping is stored in HashMap. </p> <pre><code>Dataset&lt;Row&gt; applySwappedTokens(Da...
0
2,100
html2canvas wait for images to load
<p>I'm having this problem for some time ow and I can't seem to find a solution.</p> <p>I'm using the latest html2canvas js plugin to take a screenshot of chart made with flotcharts and then submit the base64 screenshot via a hidden input. The problem is the div with the chart also has some images and html2canvas retu...
0
1,579
CUDA: how to sum all elements of an array into one number within the GPU?
<p>First of all, let me state that I am fully aware that my question has been already asked: <a href="https://stackoverflow.com/questions/22939034/block-reduction-in-cuda">Block reduction in CUDA</a> However, as I hope to make clear, my question is a follow-up to that and I have particular needs that make the solution ...
0
1,254
D3 bubble chart / pack layout - How to make bubbles radiate out from the largest bubbles to the smallest?
<p><br> So I am using the same code as this D3 gallery example (with my own data):</p> <blockquote> <p><a href="http://bl.ocks.org/mbostock/4063269" rel="noreferrer">http://bl.ocks.org/mbostock/4063269</a></p> </blockquote> <p><br> I'd like to get a bubble chart where the circles are arranged with the biggest in th...
0
5,849
Reading csv file to python ValueError: could not convert string to float
<p>Any help with this would be appreciated. Please keep in mind that I am a beginner in Python. This is the portion of the code that I am having trouble with:</p> <pre><code>__author__ = 'peter' from datetime import datetime, timedelta import csv TICKER='CHTR' STDEV_FILE = TICKER + '_stdev.csv' TRADES_FILE = TICK...
0
1,184
How can I search multiple columns in DataTables?
<p>I am trying to combine a column search and a normal search on specific columns.</p> <p>If you look for example at the snippet below, I want to be able to search the columns <code>Name</code> and <code>Position</code>, with the "normal" search, and ignore the rest of it, but I still want to be able to select an valu...
0
13,656
java spring unit test failure , failed to load ApplicationContext
<p>I'm trying to do a unit test in my application to test a a method on service layer.</p> <p>I have the following classes.</p> <p><strong>AbstractTest.java</strong></p> <pre><code>import org.junit.runner.RunWith; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.boot.test.context.S...
0
1,547