title
stringlengths
13
150
body
stringlengths
749
64.2k
label
int64
0
3
token_count
int64
1.02k
28.5k
Improve performance of MongoDB $geoIntersects query
<p>I'm trying to improve a MongoDB query that queries documents by a point. The documents have a simple polygon geometry with between 10 and 100 points and between 50m and 5000m across. An example document:</p> <pre><code>{ "_id" : UUID("9175a387-4b0c-48ab-a74a-a8b200cc5285"), "seconds" : NumberLong(123), ...
2
4,544
MYSQL Stored Procedure - Update multiple columns if certain conditions are met
<p>My MySQL is fairly limited, and I've searched around a lot but I want to confirm what I've done so far.</p> <p>I'm trying to write a stored procedure in MySQL that takes in 5 parameters. 4 parameters will contain values for columns that will be used to update, and a 5th value that will be used to select the rows to...
2
1,173
Mongoid Model won't persist has_one via embeds_one relation
<p>I'm having trouble with embeds in a mongoid4-based rails 4 app. I've been looking for an answer everywhere for the past 2 days. So here is the code.</p> <p>This is a church management app, with a Service model, embedding a team and a band. Each team/band has several roles such as "presidence", "communion" that refe...
2
2,175
How to add global configuration options to Automapper v8 using instance api with .net core 2.2
<p>I'm using:</p> <ul> <li>.net core v2.2.0</li> <li>Microsoft.EntityFrameworkCore v2.2.4</li> <li>automapper v8.1.1</li> <li>AutoMapper.Extensions.Microsoft.DependencyInjection v6.1.1</li> <li>VS2017 Community Edition v15.9.12</li> </ul> <p>In my solution i have:</p> <ul> <li>TVC_DATA: handles all data access and c...
2
1,184
Using the serial port ttyUSB0 in Android with Digi Xbee Java Api
<p>I am making an Android app in Odroid Xu4, connected to it is the Xbee Pro s2 via usb serial converter with cp210x driver using ttyUBS0 port but inside the app it disconnects from ttyUBS0 and uses bus /dev/bus/usb/.. No I have to open the serial port to access Rx/Tx for xbee. I am right now using usb-serial-for-andr...
2
1,134
compile libffi as static library on raspberry pi
<p>I'm trying to compile static library of libffi-3.2.1 with no success.</p> <ol> <li>cd libffi-3.2.1</li> <li>./configure --prefix=/home/pi/libraries/libffi --enable-static --disable-shared</li> <li>make</li> </ol> <p>make output as follow:</p> <p>MAKE armv6l-unknown-linux-gnueabihf : 0 * all-all make[1]: Entering ...
2
1,934
What am I doing wrong here? Several "no match for operator" errors in my compile
<p>These seem to be my only errors. From my understanding, I only needed to overload an operator if I was setting "sortedListClass" equal to another declared "sortedListClass" or if I was asking if they were less than, equal to, not equal to, etc.. but these are user declared... not declared "sortedListClasses" so im c...
2
4,883
Why Should SwiftUI View Models be Annotated with @MainActor?
<p>I've been watching Apple's concurrency talks from WWDC21 as well as reading a ton of articles on Apple's concurrency updates; however, I cannot wrap my head around one thing: Why do people provide guidance that you should annotate view models with <code>@MainActor</code>? From what I have read, by making a view mode...
2
1,157
wxPython best way to pass back and forth a set of parameters from frame to dialog
<p>I'm new to wxPython programming and what I would ideally do is have parameters that can be set open in custom dialog (ParameterDialog) with text boxes that have the default values already filled in to the default parameter values set in ImageFrame. Then passing back the changed values or all values in the ParameterD...
2
1,543
Where does CloudFlare detect web and terminal requests?! On equal terms
<p>My problem is opening sites on <code>CloudFlare</code> in <code>CLI</code>. <br /> I do not mean when there is a challenge and I do not want to solve the challenge.</p> <p>Consider this site as an example: <a href="https://pegaxy.io" rel="noreferrer">https://pegaxy.io</a> <br /> When opened for the first time on a n...
2
5,292
Unable to install LDAP modules into Node.js using npm install
<p>I am using Node.js for my application, and I'm quite new to it.</p> <p>I have a case of acquiring credentials of users from an LDAP server, for which I have found enough modules in NPM registry. But none of them are getting installed when I tried by typing in " npm install "("npm install ldapauth", in my case )</p...
2
3,560
Jbehave test Runner Issue
<p>I am trying to implement BDD in my project and I'm using Jbehave for the same, I am referring the online materials available, I have created the story file, Steps class and the Runner class as below, but I'm getting some weird exception which I'm not able to resolve it.</p> <p>1) Story file, 'Sample.story' </p> <...
2
1,601
iOS AES Encryption - Fail to Encrypt
<p>In my project I got to implement AES 128 CBC Encryption. I am using Category and is based on NSData. This is my encryption code :</p> <pre><code>- (NSData*)AES128Decrypt { char ivPtr[kCCKeySizeAES128 + 1]; bzero(ivPtr, sizeof(ivPtr)); // fetch iv data [iv getCString:ivPtr maxLength:sizeof(ivPtr) en...
2
1,761
android rotate imageview onfling
<p>I am creating a rotating knob it works fine when I rotate it slowly in clockwise or anticlockwise direction.but if I want to select a precise value then it become hard.Because I am adding a margin of 3 on each call to onscroll(ACtion_Move). What should I do .</p> <p>I think I need a precise angle between previous a...
2
3,458
Disable / Enable GPIO Interrupt Raspberry Pi
<p>What I am trying to do is use a vibration sensor to trigger a motor to run. I want the pi to wait until a vibrate is sensed and then run the motor for a period of time, then stop and wait again. I can easily get the vibration trigger to work using "add_event_detect" interrupts but the motor running also triggers the...
2
1,497
Efficient way of parsing XML in Java
<p>I have to parse an XML file with following structure: </p> <pre><code>&lt;root&gt; &lt;object_1&gt; &lt;pro1&gt; abc &lt;/pro1&gt; &lt;pro2&gt; pqr &lt;/pro2&gt; &lt;pro3&gt; xyz &lt;/pro3&gt; &lt;children&gt; &lt;object_a&gt; &lt;pro1&gt; abc &lt;/pr...
2
1,182
How to analyze boot.oat crash log?( 'linkToDeath(): recipient must be non-NULL')
<p>APP crash comes during switch Android User from Owner to Guest.</p> <p>core crash logs refer below :</p> <pre><code>08-12 23:46:03.724 27197 27197 F libc : Fatal signal 6 (SIGABRT), code -6 in tid 27197 (com.dolby) 08-12 23:46:03.855 312 312 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** **...
2
1,808
JQuery capturing table row lost focus
<p>suppose i have table with 5 columns. in each column any kind of things could be there like only text or text inside span or input box, dropdown, checkbox or radio button etc. i want when user switch focus from any control to other row of same table or out side out that table then a function will be triggered or show...
2
2,337
Using RabbitMQ connector for MCollective
<p>Here's my client.cfg file:</p> <pre><code>main_collective = mcollective collectives = mcollective libdir = /usr/share/mcollective/plugins logger_type = console loglevel = warn # Plugins securityprovider = psk plugin.psk = unset connector = rabbitmq plugin.rabbitmq.pool.size = 1 plugin.rabbitmq.pool.1.host = myse...
2
3,230
how to set the specific row item option(visible, invisible) in listview in android
<p>frist my english skill weak. </p> <p>description> </p> <p>this is list view. </p> <p>ㅡㅡㅡㅡㅡㅡㅡㅡ<br> ㅣㅡㅡㅡㅡㅡㅣㅢ &lt;-- this is button , i init set invisible<br> ㅣㅡㅡㅡㅡㅡㅣㅢ<br> ㅣㅡㅡㅡㅡㅡㅣㅢ<br> ㅣㅡㅡㅡㅡㅡㅣㅢ<br> ㅣㅡㅡㅡㅡㅡ ////// &lt;-- i want make visible button<br> ㅣㅡㅡㅡㅡㅡ ////// &lt;-- specific position</p> <p>I make the cust...
2
4,619
Symfony2 dynamic forms mongodb
<p>Following the example as documented in the following <a href="http://symfony.com/doc/current/cookbook/form/dynamic_form_generation.html" rel="nofollow">http://symfony.com/doc/current/cookbook/form/dynamic_form_generation.html</a></p> <p>I need to populate subcategory field according to the category selection. I don...
2
1,477
Can't connect to mongo in Docker
<p>I'm practicing Docker with a dummy app but I can't connect with the database. If anyone can give a clue about what the problem could be, please. Thanks in advance for any help. If any more info is needed please let me know.</p> <p>Here is my Dockerfile for api:</p> <p><strong>Dockerfile in server</strong></p> <pre><...
2
1,408
Rendering Image Blob Correctly
<p>I'm trying to render an <code>&lt;img&gt;</code> from a blob. </p> <pre><code>import React from 'react'; import { getImageBlob } from '../api/images'; class ImageViewer extends React.Component { state = { src: undefined, loading: true, } componentDidMount() { getImageBlob() .then((ima...
2
1,157
Asp.net code not performing on actual server as localhost
<p>I have the following code that works fine on my localhost using IIS7 but when i upload it to my server it is behaving not the same as it did on my localhost For example the submit button when clicked should check validation which it does on my localhost and then redirects to a URL if the validation is correct</p> ...
2
1,815
How to send a parameter with an action URL from struts tag in a table
<p>I am populating some values in tag in struts 1 in a table.Now i want to send a value of that table with a URL which is a hyperlink of that table.i am able to call the action but i can not send the parameter with the URL.What I have done so far is,,</p> <pre><code>&lt;script type="text/javascript" charset="utf-8"&...
2
1,142
css image overlay on background image
<p>so i am trying to get an overlay to work on my website, i've been watching a tutorial, but now i have gotten to a point where i don't know what i'm doing wrong.</p> <pre><code>&lt;head&gt; &lt;link rel="stylesheet" href="css/venues.css"&gt; &lt;/head&gt; &lt;section class="alt-section"&gt; &lt;h2&gt; Places w...
2
1,143
IE9 throwing error on jQuery.ajax "done" method
<p>I've got code working in the latest Chrome and Firefox.<br> IE9 however hates me (and I feel the same). </p> <p>The specific error I'm getting is:<br> <code>Object doesn't support property or method 'done'</code> </p> <p>The code in question: </p> <pre><code>app.$.ajax({ url: app.baseUrl + "Geo...
2
1,451
R: Find all overlaps in data frame
<p>I have a dataframe (sample below) that has repeating data. The first column is the data from which the sample data was taken. I would like to create a table that calculates the number of overlaps in each possible intersection between the dates. In other words, using 2014.01.14 as an example, I want to see how many o...
2
3,987
javascript array - comparing elements with other elements within the same array
<p>Am comparing javascript array of elements with other elements within the same array. If elements are same means, i have to give same number for all the common elements. If the elements are different i have to give some different number for all the non identical elements in another element.</p> <p>for example :</p> ...
2
1,055
How to synchronize a Producer thread and a Consumer thread [C++/CLI]
<p><em>EDIT</em>: Forget to say the program has to be in .NET 3.5; Visual Studio 2008 and Windows 7.</p> <p>In my old MSDN library (for Visual Studio 2008) documentation, I come across an article about threading in C#. I try to convert to C++/CLI. I have encountered many problems in converting. Now there is only one l...
2
3,837
Adding search field to gson jtable
<p>I am attempting to add a search field on a specific column in a jtable that I have. I'm currently using gson in order to pass json data. Here is my controller:</p> <pre><code>public class gsonTestController extends HttpServlet { private static final long serialVersionUID = 1L; public void doPost(HttpServ...
2
2,893
MySQL-how to merge multiple rows into multiple columns and one row?
<p>If I have a MySQL table looking something like this: for example 2014000 is a product pen , there are four types abcd with different prices. and 2014001 is another prodct telephone , also there three types efg with different prices. now I want to get the one product one line with names and values.</p> <pre><code>id...
2
1,199
Animating the labels on input focus with CSS and JavaScript
<p>I have a few input fields and I want their labels to scale down and slide at the top on focus. I have managed to achieve this with CSS and JavaScript but it only animates the first label on the page.</p> <p>The code JS below uses &quot;querySelector&quot; to target the labels. I've also tried using &quot;getElements...
2
1,157
Karma not running in Jenkins CI, Cannot find module 'karma-jasmine'
<p>I'm setting up an Angular 4 SPA with automatic testing in Jenkins CI. The SPA is part of a larger, Maven-managed project, so the build is also Maven-managed. So far I've:</p> <ol> <li>Installed the NodeJS plugin on Jenkins, using install from nodejs.org with version 8.6.0</li> <li>Configured "Global npm packages to...
2
1,658
Node and Angular socket error in browser console
<p>I am using Node(server) + Angular(client) to implement socket in my application.</p> <blockquote> <p>Angular bower.json socket components : "angular-socket-io": "^0.7.0","socket.io-client": "^1.7.2",</p> <p>Node js socket component in package.json : "socket.io": "^1.7.3",</p> </blockquote> <p>I am seeing ...
2
1,323
TOO_MANY_REDIRECTS error when iFraming Kibana dashboard using cookies
<p>I'm attempting to embed password protected Kibana dashboards inside an iFrame to my Node powered Express application, based on information in <a href="https://discuss.elastic.co/t/authenticating-to-iframe-embedded-kibana-dashboard/71129/7" rel="noreferrer">this thread</a>. Kibana is protected using X-Pack and requir...
2
6,521
Firebase store provider photo URL (cannot convert value of type NSURL?)
<p>I am new to Firebase and I want to store the provider photo URL however it come out the error 'Can only store objects of type NSNumber, NSString, NSDictionary, and NSArray.' I have tried different type of the method but it seems not working for example <code>let profilePicUrl = profile.photoURL as String</code> or <...
2
1,029
MongoDB BSON (C# Driver), how do I deserialize BSON object serialized with BsonDocument.ToJson()?
<p>I'm having a hard time trying to deserialize JSON created with BsonDocument.ToJson() back to BsonDocument. I have an ASP.NET Core API server and a Unity C# frontend. I'm using the same version of BSON in both projects. The serverside retrieves an object from a MongoDB, serializes it to JSON by simply calling ToJson...
2
1,410
HTML fit page to screen problems
<p>I'm developing an application for measuring and storing running/cycling tracks using OSM/Google Maps integration.</p> <p>I want it to work without any page scrolling, so the page should fill the browser window. Basically it should look as follows:</p> <pre><code>+---------------------------------+ | Toolbar wi...
2
1,799
java.lang.NumberFormatException: with JSP App and mySQL
<p>Hi i'm getting an the above error when trying insert data into my database from a jsp application</p> <p>here is the JSP code </p> <pre><code> &lt;%@page contentType="text/html" pageEncoding="UTF-8"%&gt; &lt;html&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt; &lt;tit...
2
3,232
Sequelize nested include with required: true generates invalid join
<p>I apologise for the lengthy post in advance!</p> <p>I am trying to use sequelize in nodeJs to query a Wordpress mysql database with a <code>required: true</code> in a nested include.</p> <p>However, the generated query includes a bad join (I'd expect the join to be nested like the nested where clause). I don't see...
2
2,639
Cannot upload image to amazon s3 using http put
<p>I am developing an Android app, where users can create posts with images. Images are uploading to Amazon S3. So how every user can upload an image, I dont use Amazon AWS SDK, because its methods need secret key. I try to upload an image using HTTP put request. I send first request to backend, and it sends to me sig...
2
3,346
Compiling XFCE4 panel plugin
<p>I am converting a gnome panel applet to xfce panel plugin. I have so far removed the few gnome specific parts in the source and replaced them with xfce specific source as appropriate.</p> <p>I created makefile.am and configure.ac files using templates such as the weather plugin and the example plugin. However I am u...
2
5,349
Cakephp 3.7, Middleware, Authentication and Routing
<p>I'm using Cakephp 3.7 and authentication middleware.</p> <p>My app is hosted locally at <a href="http://192.168.33.10/scoring" rel="nofollow noreferrer">http://192.168.33.10/scoring</a>.</p> <p>I'm using the following middleware method in my Application.php. </p> <pre><code>&lt;?php /** * CakePHP(tm) : Rapid Dev...
2
3,248
OpenGL particles, help controlling direction
<p>I am trying to modify this Digiben sample in order to get the effect of particles that generate from a spot (impact point) and float upwards kind of like the sparks of a fire. The sample has the particles rotating in a circle... I have tried removing the cosine/sine functions and replace them with a normal glTransla...
2
1,332
problems with Hibernate's integration in Spring
<p>I have a simple Java application and I'm trying to integrate Hibernate in Spring but it seems that the Spring configuration file can't find the *.hbm.xml (the mapping resource): I have a file named persistence-context.xml that I use it as a Spring config file and I have the following bean declared:</p> <p> ...
2
1,762
jQuery Mixitup remove multiple filter select
<p>I am using jQuery <a href="https://mixitup.kunkalabs.com/" rel="nofollow">Mixitup</a> and I'm trying to remove the multiple select logic.</p> <p>Currently the 'All' filter is active and then when I select the filter for example 'Dogs' then only dogs will show but when I select 'Cats' then 'Dogs' and 'Cats' show.</p...
2
2,793
Sinon.stub() return different values every time it's called
<p>Here is the code I am writing tests for:</p> <pre><code>'use strict'; var internals = {}; var _ = require('lodash'); module.exports = { initialize: function (query) { internals.query = query; }, createField: function (fieldId, accountId, payload) { function callQuery (parList) { ...
2
2,399
@Stateless webservice with JPA+JTA: How to commit changes of managed entity?
<p>I have the following simple webservice declared as <code>@Stateless</code> EJB running on GlassFish 3.1.2.2 with EclipseLink 2.4.1 using a JTA <code>DataSource</code> to connect to a MySQL database:</p> <pre><code>@POST @Consumes(MediaType.APPLICATION_JSON) public Response update(TimeRow e) throws Exception { i...
2
1,576
Parallel For - Save In Database
<p>I'm having a lot of data to import into my database.</p> <p>These data need of treatment, filtration, joint, among other things. So everything is being done with objects, carrying all tables before starting, and saving all objects to the end.</p> <p>After all processing, I run the command to save. This is taking t...
2
1,342
Intent permissions and JobIntentService
<p>I've got an app A that sends an intent to app B. App A has a file provider and share a file to B. It add the grants to the intent and it starts a service on B. B has an IntentService and process the intent. Now I want to change B to use a JobIntentService according to the new Android O policy. However I can't call ...
2
1,293
supervisor curl command failing with exit 56 error
<p>I have this curl cmd I run locally on OSX that completes successfully:</p> <pre><code> curl -XPOST http://192.168.59.103:9200/inventoryindex {"acknowledged":true} </code></pre> <p>BUT when it's run from supervisor in docker it fails...ummmmm</p> <pre><code> 2014-08-16 14:24:38,838 INFO supervisord started with ...
2
2,282
'Procedure or function expects parameter, which was not supplied' error
<p>I have a method in a service that is calling a stored procedure in a SQL Server database and I'm getting an error:</p> <blockquote> <p>Procedure or function 'GenerateInviteKey' expects parameter '@inviterId', which was not supplied</p> </blockquote> <p>My stored procedure works when I execute it in SQL Server Mg...
2
1,042
Msbuild resolve project reference to custom project type
<p>I've created a custom project type (cljproj instead of csproj) for a programming language called clojure. When the project compiles it outputs multiple .dll files as well as some dependent .clj files.</p> <p>This is done by overriding the default CoreCompile target in the cljproj file. Which basically copies all fi...
2
1,045
React.useEffect hook and subscribing to a mousewheel event - the right approach
<p><strong>The goal:</strong></p> <ol> <li><p>Subscribe to the mousewheel <code>event</code> once, at component mount.</p></li> <li><p>Update the state.scrollTop of the component with <code>newValue</code>, where:</p></li> </ol> <p><code>newValue = Math.max(0, state.scrollTop + event.deltaY)</code></p> <ol start="3"...
2
1,043
Faster or more memory-efficient solution in Python for this Codejam problem
<p>I tried my hand at this <a href="http://code.google.com/codejam/contest/dashboard?c=438101#s=p0&amp;a=0" rel="nofollow noreferrer">Google Codejam Africa</a> problem (the contest is already finished, I just did it to improve my programming skills).</p> <blockquote> <p><strong>The Problem:</strong></p> <p>You are host...
2
1,200
Android log in page with MySQL
<p>Hey i'm new to android and i'm having trouble with a login page. I'm trying to connect to a MySQL database containing usernames and passwords. I've tried to get my code to work but it just won't let me log in.</p> <p><strong>Here's my code</strong></p> <pre><code>package login.CBA; import android.app.Activity; ...
2
1,462
How to Use MaterialAutoCompleteTextView with Completion Threshold
<p>I'd like to start using material components in my Android app, and I am having a bit of trouble with the <code>MaterialAutoCompleteTextView</code>. I want it to behave like a standard AutoCompleteTextView, and I prefer the <code>OutlinedBox</code> style. Furthermore, it should observe the <code>completionThreshold</...
2
2,044
How to add live stream source in Red5 IServerStream?
<h2>The problem</h2> <p>I have created and started Red5 server-side stream in my custom application based on oflaDemo in this way:</p> <pre><code>serverStream = StreamUtils.createServerStream( app , "mystream" ); // repeats /streams/prometheus.flv from oflaDemo several times (20sec): serverStream.addItem( SimplePlay...
2
1,601
RecyclerView item click checked state
<p>I have a horizontal <code>RecyclerView</code>, in which I have a circular <code>ImageView</code>, on item click, I want the selected circle image to get highlighted.</p> <p>I use <a href="https://github.com/hdodenhof/CircleImageView" rel="nofollow noreferrer">https://github.com/hdodenhof/CircleImageView</a> for circ...
2
1,593
Compiler error coming out of yaml-cpp
<p>I'm attempting to integrate yaml-cpp into a project, but I'm seeing some unexpected errors out of GCC. For example:</p> <pre><code>g++ -c -ggdb3 -ansi -Wall -Werror -pedantic-errors src/commands-tz.cpp -o obj/commands-tz.o In file included from /usr/local/include/yaml-cpp/conversion.h:9, from /usr...
2
3,634
Can't deserialize an array of objects from JSON into a C# object
<p>I'm having trouble getting the JavascriptSerializer to deserialize an array of objects. I'm not terribly sure what I'm missing. </p> <p>Here's my object...</p> <pre><code>public class HomefinderResult { public Data data; public List&lt;Listing&gt; listings; public Status status; public class List...
2
1,712
calculate grand total with javascript
<p>I don't know how to get Grand total value</p> <p>grand total is sum of all total</p> <p>here is the code</p> <pre><code>&lt;?php $con = mysqli_connect('localhost', 'root', '', 'a.karat'); if(isset($_POST['product_id'])) { $prno=$_POST['prno']; $i=1; $sql = mysqli_query($con,"select * from detail_pr where prNo='$p...
2
1,132
Failure sending mail using asp.net
<p>Below is my code for sending confirmation link to mail and I am getting errors like Failure sending mail. </p> <p>After sending confirmation link to email then user will reset the password.</p> <pre><code> string uniqueCode = string.Empty; SqlCommand cmd = new SqlCommand(); SqlDataReader dr; try { ...
2
1,737
"NSInternalInconsistencyException: threading violation: expected the main thread" outside of my code
<p>My iOS App is crashing with the following error:</p> <pre><code>*** Assertion failure in -[FBSSerialQueue assertOnQueue], /BuildRoot/Library/Caches/com.apple.xbs/Sources/FrontBoardServices/FrontBoard-626.4.1/FrontBoardServices/FBSSerialQueue.m:98 *** Terminating app due to uncaught exception 'NSInternalInconsistenc...
2
2,654
rails new creates Rails 7.1-alpha instead of Rails 7.0
<p>i am just wondering. I want to create a new rails app and have following setup on my linux system:</p> <ul> <li>ruby 3.0.3 via RVM</li> <li>yarn v1.22.17</li> </ul> <p>and</p> <pre><code>gem install bundler -v 2.2.33 gem install rails -v 7.0.0 </code></pre> <p>If I create a new app via</p> <pre><code> rails new my_...
2
6,796
org.hibernate.HibernateException: Missing column: auth_password in Spring Boot application
<p>I am working with a Spring Boot application . I have faced some issue related to <strong>org.hibernate.HibernateException: Missing column: auth_password in medxlabpro.appsettings</strong></p> <p>I have column in my PoJo class <code>authpassword</code> not auth_password. So why this type of issue coming in my appli...
2
3,044
Java - Can't write object as file to directory
<p>I have a weird problem with my program. I wrote a small program to write an object to a file in a specific directory.</p> <p>Player-Class:</p> <pre><code>package readwrite; import java.io.Serializable; public class Player implements Serializable { private String name; private int level; public Play...
2
1,653
How can i protect profile form update by other users laravel 5.3
<p>This time i have Url like this <strong><a href="http://Blog/user/profile/51" rel="nofollow noreferrer">http://Blog/user/profile/51</a></strong> and i am logged in with a user whose <strong>id = 51</strong> but if i change this id to 50 it shows the form with data of user whose id is 50 i want to stop this how i can...
2
1,085
Dynamic function calls at runtime (va_list)
<p>There is a way in C to obtain a dynamic length argument list with va_list, as described here: <a href="http://www.cprogramming.com/tutorial/c/lesson17.html" rel="nofollow">http://www.cprogramming.com/tutorial/c/lesson17.html</a></p> <p>That quite simple, but most times in C++ not needed. I am currently building a t...
2
1,705
Application not linking to CUDA
<p>I am trying to compile and run an application that depends on CUDA SDK. The CUDA shared objects are installed in the standard location on Ubuntu:</p> <pre><code>$ ls -l /usr/lib/x86_64-linux-gnu/libcuda* lrwxrwxrwx 1 root root 12 Feb 26 18:26 /usr/lib/x86_64-linux-gnu/libcuda.so -&gt; libcuda.so.1 lrwxrwxrwx ...
2
3,720
PHP to Powershell script
<p>I don't know much about PHP, but I've inherited a PHP script that I would like to convert to powershell. I'm not sure if this is possible. But it looks like the script is getting a list of products as XML from a service. It is then doing some cr/lf stripping, swapping a few quote characters, and then converting th...
2
1,025
Protractor always fails on first test
<p>first of all the versions I'm using:</p> <p>protractor v5.1.2 chromedriver v2.33 node v6.11.4 npm 3.10.10 selenium-webdriver v3.0.1</p> <p>I'm new to protractor and I'm only trying to run it on the test that is already given natively by protractor. It looks like this </p> <pre><code>describe('angularjs homepage'...
2
2,704
gson.toJson(jObj) stackoverflowerror .TypeAdapters$25.write(TypeAdapters.java:704)
<p>I am trying to convert a json object to String using gson. Below is the code</p> <pre><code>List&lt;Student&gt; studs = //from db int count = studs.size(); Integer tot_pages= count/limit; if(page&gt;tot_pages){ page=tot_pages; } Integer start=limit*page-limit; ...
2
1,155
PCDATA invalid Char in R
<p>First of all, I am sorry if this is a repeated question. I tried for several hours already and I see different solutions for PHP or other languages but not for R.</p> <p>I am retrieving data from the last.fm website using their API. You do need an API key to retrieve the data I am trying to get but I will make it s...
2
1,200
Update data from one element in RecyclerView using ViewModel and LiveData
<p>I am trying to write an app using a variety of architectural components/concepts and are now at a point where I am not sure what the best/preferred solution to one of my problems is.</p> <p>I have a fragment inside the app that has a RecyclerView and displays elements from the Database in a List. Each item has a del...
2
2,113
SharedPreferences EditText dialog squashed on HTC WildFire
<p>I'm using SharedPreferences in my Android app in the standard way. On the HTC WildFire device (resolution 240x320), the EditText is squashed up when the virtual keyboard is displayed.</p> <p>Has anyone else come across this is there a solution? I've been stumped for days.</p> <p><img src="https://i.stack.imgur.c...
2
1,131
How to solve a failure to insert something into SQLite db due to non-existing table?
<p>I'm trying to insert a note into my Android SQLite database, but I get the following error message:</p> <blockquote> <p>02-04 01:28:19.775 9521-9521/? E/SQLiteDatabase﹕ Error inserting text=Note 0 android.database.sqlite.SQLiteException: no such table: notes (code 1): , while compiling: INSERT INTO not...
2
1,325
Adding a google sign in button - sign in problems
<p>I am trying to put google sign in button in my android app. I have take reference from <a href="https://developers.google.com/+/mobile/android/sign-in" rel="nofollow noreferrer">https://developers.google.com/+/mobile/android/sign-in</a> and it showing me continuous progress bar and doesn't log into my account. I hav...
2
2,423
Array multiple points in google maps with sql & php?
<p>I a newbie in PHP. The code above works fine, but only with one marker. If I use top 1 to search one point it's ok.</p> <p>When I change the top nubmer like 10 still shows one or last marker. How can I show multiple markers? I don't want to use json. I think there's something like var array. Thank you </p> <p><d...
2
1,117
Different result using grep
<p>I have two files below:</p> <pre><code>$cat file1 "2020051576BPI";"TS.1.BPI.20121129120000.005.txt";"Error";"'OF_USM_DBTI0000029'/'CO_SERVICE_SVCID11066'/'CO_FA_SC_600224'/. appears less times in the Input File (0), but should appear at least 1 times";"" "2019707951BPI";"TS.1.BPI.20121129120000.014.txt";"Error";"'O...
2
1,058
Not able to use @Rule & @RunWith annotation, but the deprecated initmocks() works
<p>I am working on a basic test-driven development learning of a simple java program which provides portfolio value for the stocks.</p> <p>I am having 2 classes,<code>Portfolio.java</code> &amp; <code>Stock.java</code> which depicts the portfolio &amp; stock models. An interface <code>StockService.java</code> is used i...
2
2,876
could not get chConfig cache reference: QueryBlockConfig failed: queryChaincode failed:
<p>I'm developing a middleware in Go that integrates a hyperledger fabric network using fabric-sdk-go. The middleware is running on Docker container and it's set to use the same network of fabric containers (I've check that container is connecting each others), but when I tries connect to the channel the follow error i...
2
2,644
What is etcd looking for in 127.0.0.1:4001?
<p>I'm trying to set up a test cluster using etcd 2.3.7 installed from CentOS RPM on CentOS 7.1. On the <strong>Loader 1</strong> I executed:</p> <pre><code>etcdctl member add loader2 http://10.11.51.231:2380 </code></pre> <p>And received response which confirmed the operation completed successfully.</p> <p>Similar...
2
2,339
How to change listview's button background color when button clicked in android
<p>In my application, I keep yes and no button in listview as an item. <strong>setOnClickListener</strong> is defined in <strong>Adapter</strong> class. I have a problem with this. After I scroll the listview, I see the changed button in another row. How can I resolve my issue ?</p> <pre><code>public class QuizAdapter...
2
3,096
Mixer AudioUnit to RemoteIO AudioUnit
<p>I have an AudioUnit with correspondent Callback working properly, But now, I need to send it to a RemoteIO, cause i'm implementing some framework who needs an RemoteIO AudioUnit to work.</p> <p>THen... I need the same output i'm getting with this audiounit mixer but with another audiounit with type kAudioUnitSubTyp...
2
1,559
Flex 3 - How to read data dynamically from XML
<p>I'm new at Flex and I wanted to know how to read an xml file to pull its data into a chart, using Flex Builder 3.</p> <p>Even though I've read and done some tutorials, I haven't seen any of them loading the data dynamically. For example, I'd like to have an xml like the following:</p> <pre><code>&lt;data&gt; &...
2
1,416
Kendo Grid Row click change color
<p>I have a kendo grid with the following code : </p> <pre><code>var data = &lt;?php echo $model-&gt;over_view; ?&gt;; var grid = $("#grid").kendoGrid({ dataSource: { data: data, pageSize: 10, sort: { field: "metric", dir: "asc" } }, ...
2
1,659
abstractTableModel to display two sets of interdependent data in PySide
<p>I'm building a python/PySide tool for cinematography. I created an object which represents a shot. It has properties for start time, end time, and a list of references to actor objects. The actor object has simple properties (name, build, age, etc) and can be shared between shots.</p> <p>I want to display this in t...
2
5,233
Ruby on Rails website is slow; could it be the SQL queries?
<p>I have been working on a web application made with Ruby on Rails. I've "completed" the site, but it runs <em>very</em> slow and pages sometimes take on the order of ten seconds to load. I've broken this post up into three sections:</p> <ol> <li>Overview</li> <li>Diagnosis</li> <li>Possible Ideas</li> </ol> <p><s...
2
2,870
How to mock two axios call in same endpoint
<p><strong>Example:</strong></p> <p>In my test I need to mock the two calls to the external apis. I can't mock on the second call. With the library 'axios-mock-adapter' and ava I could only mock the first call.</p> <pre><code>const read = async (req, res) =&gt; { try { const responseOne = await axios({ me...
2
1,439
Laravel email not sended but no error, with own smtp server
<p>ISo i have a SMTP Server come with the hosting server, already use the host, port, username, password, etc correctly. The email is sending, but returns no error. Its working in mailtrap. I use beautymail for sending the email. The configuration is correct based on my cpanel site.</p> <p>My <code>.env</code></p> <p...
2
1,452
Randomizing text file read in Java
<p>I am trying to read a text file in Java, basically a set of questions. With four choices and one answer. The structure looks like this:</p> <blockquote> <p>question</p> <p>option a</p> <p>option b</p> <p>option c</p> <p>option d</p> <p>answer</p> </blockquote> <p>I have no trouble reading it that way:</p> <pre><code...
2
1,210
Attempting to use Kotlin Native with IntelliJ's base project but it won't compile
<p>Hi I'm learning about Kotlin Native and as such I wanted to start with getting a project compiled and running, using IntelliJ's provided Kotlin Native files I get the following error: (Using: "gradle build")</p> <pre><code> Execution failed for task ':compileKotlinMingw'. &gt; Process 'command 'C:\Program Files (x...
2
3,021
C++ Anti-aliased line for beginner to SDL
<p>Original question:</p> <blockquote> <p>I've been asked prior to a job interview to understand how an anti-aliased line is drawn in a framebuffer, using C or C++. I haven't used C, and it's been a few years for me since last using C++. I am a complete beginner when it comes to graphics. My C++ experience has...
2
1,506
error deploying a SpringData JPA2, hibernate cxf web service in jboss AS 7.2
<p>I am developing a SpringData/JPA2 web service that uses Hibernate as the persistence provider. It uses the following frameworks: <code>cxf=2.6.2</code> <code>hibernate= 4.1.1.Final</code> <code>springframework=3.1.2.RELEASE</code> <code>spring.data=1.2.0.RELEASE</code></p> <p>The database related code is in the "co...
2
7,043
Access mjpeg-streamer in OpenCV 3.0
<p>I have a raspberry pi b+ uploading a video stream with the mjpeg-streamer.</p> <p>On the Raspberry Pi</p> <pre><code>/usr/local/bin/mjpg_streamer -i "/usr/local/lib/input_uvc.so -y -r 340x240 -f 10 -d /dev/video0" -o "/usr/local/lib/output_http.so -w /usr/local/www" </code></pre> <p>This creates a video stream ac...
2
1,286
How to compile/run the java code via javac/java?
<p>I have a code below. I can compile and run it normally in NetBeans. But with javac/java, I cannot run it normally. What do I miss?</p> <p>The code:</p> <pre><code>/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /* the original code is from link: http://edu.qudon...
2
1,214
XQuery to group based on two variables
<p>I have xml like this </p> <pre><code>&lt;?xml version="1.0"?&gt; &lt;xmldb&gt; &lt;centers&gt; &lt;center id="0000100001" status="unsynced"&gt; &lt;meetingdate&gt;2011-01-13&lt;/meetingdate&gt; &lt;cname&gt;Center1&lt;/cname&gt; &lt;cfe empid="1001"&gt;FE1&lt;/cfe&gt; &lt;groups&gt; &l...
2
5,125
How to render a View to the right of parent node in ARCore sceneform
<p>Using ViewRenderable I am rendering layout file. I gave fixed width and height for the layout file</p> <pre><code>&lt;android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="500dp" an...
2
1,293