title stringlengths 13 150 | body stringlengths 749 64.2k | label int64 0 3 | token_count int64 1.02k 28.5k |
|---|---|---|---|
NPM behind proxy returning HTML | <p>I'm new to NPM and I think I've managed to finally get past the corporate proxy in place using these settings:</p>
<pre><code>proxy = http://MyUsername:MyPassword@MyProxy:MyPort
https-proxy = http://MyUsername:MyPassword@MyProxy:MyPort
strict-ssl = false
registry = http://registry.npmjs.org/
</code></pre>
<p>Howev... | 2 | 5,640 |
Put a va_list variable inside... a variable argument list (!) | <p>I would like to design a function which takes a variable number of arguments, one of these arguments being itself a <code>va_list</code>; but something gets wrong in my code and I do not understand what...</p>
<p><strong>WARNING — My question is not about designing a code doing what I wish to do (I have found a way... | 2 | 1,698 |
can't get value from input fields in bootstrap modal on a jquery post call | <p>I was trying to get the value of a couple of fields in a bootstrap modal and then have them sent via $.post call to a php script that sends an email and responds true if the email has been correctly sent or false otherwise.</p>
<p>I can't get those values...fields are always sent empty (or with the default value in... | 2 | 5,573 |
Why vue-socket.io doesn't send the message on the server, | <p>please help for my problem. I try to create real-time chat on Vue, Vuex and NodeJS (initially, messages should be received through the POST method, then through the socket). Why vue-socket.io doesn't send the message on the server? How can i add event on vuex and do I need a socket.io-client for this?</p>
<p>Vue... | 2 | 1,346 |
eslint – how to know where a rule is "defined" | <p>Given a project with its node's <code>package.json</code> installing eslint and a few plugins, how can I know where a particular rule is set?</p>
<p>I see a rule being applied (<code>space-before-function-paren</code>) but I cannot find it either in any of the <code>.eslintrc</code> files in the project, or in the d... | 2 | 2,352 |
Couldnt call A Model Class in Another Module From Default Module? | <p>My application has the structure :</p>
<pre><code>myapp
- applcation
- modules
- default
- controllers
- models
- Acl.php
- views
- Bootstrap.php
- admin
- controllers
- models
- ResourceMapper.php
... | 2 | 1,451 |
Struggling to figure out how to use a FIFO with this init.d startup script | <p>Summary: Looking for some help using a named pipe in my init.d startup script. The pipe doesn't work when it starts, and I can't figure out how to kill it.</p>
<p>I have this startup script that I'm using in Ubuntu 10.04 x64 to launch a minecraft server. The one thing that I need is to setup a read FIFO so that ... | 2 | 2,034 |
Keras custom loss function print tensor values | <p>I try to implement object detector like yolo. It uses complex custom loss function. So I need to print/debug its tensors. I understand, that python code only builds computing graph so standard print won't work in not eager mode.
tensorflow 1.12.0
keras 2.2.4</p>
<p>I tried all methods from these posts <a href="htt... | 2 | 1,806 |
JPA with generics and multilevel inheritance. Set Single Table strategy. org.hibernate.MappingException: Could not get constructor | <p>I have problem with my entity. </p>
<p>Everything works fine until I've changed classes inheritance from:</p>
<pre><code>GenericModel -> Insurance -> Doctor
GenericModel -> Insurance -> Nurse
</code></pre>
<p>to:</p>
<pre><code>GenericModel -> Insurance -> Liability > Doctor
GenericModel -&g... | 2 | 6,792 |
Getting the xml soap response instead of raw data | <p>I am trying to get the soap response and read few tags and then put the key and values inside a dictionary.</p>
<p>Better would be if I could use the response generated directly and preform regd operations to it.
But since I was not able to do that, I tried storing the response in an xml file and then using that fo... | 2 | 1,315 |
Reverse the order a SliverFixedExtentList is built in Flutter | <p>I have a FutureBuilder on the homepage of my app that returns a SliverFixedExtentList after the future is complete. It looks something like this:</p>
<pre><code>import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:flutter/material.dart';
import 'package:project_spruce/DataBase/DataBaseConnection.d... | 2 | 2,665 |
OpenCV - imshow hangs if called two times from a thread | <p>everybody.</p>
<p>I'm trying to have a separate thread to display and process images coming from a webcam.
Those operations cannot be in the main thread, since it's dedicated to other tasks.
What I need to do is to stop and eventually restart the thread.</p>
<p>What happens is that the thread works the very first ... | 2 | 1,467 |
Subset data frame based on column values | <p>I have a data frame consisting of the fluorescence read out of multiple cells tracked over time, for example:</p>
<pre><code>Number=c(1,2,3,4,1,2,3,4,1,2,3,4,1,2,3,4)
Fluorescence=c(9,10,20,30,8,11,21,31,6,12,22,32,7,13,23,33)
df = data.frame(Number, Fluorescence)
</code></pre>
<p>Which gets:</p>
<pre><code> Nu... | 2 | 1,114 |
ImportError: No module named pkg_resources when running pip on Amazon EC2 | <p>I'm trying to set up an EC2 instance with django but I'm having issues installing anything. I ran <code>sudo apt-get update</code> and <code>upgrade -y</code>. But when I try to run pip which it claims is installed I get this: </p>
<pre><code>ubuntu@ip-172-31-62-51:/home$ pip
Traceback (most recent call last):
... | 2 | 1,147 |
Calling protected variable from parent class with getters in php | <p>I'm a newbie in OOP in PHP. I have the following problem:
I have 1 parent class called 'User' and 2 subclasses 'Business' and 'Standaard'.</p>
<p>My parent class looks something like this:</p>
<pre><code>class User {
protected $m_iId;
protected $m_iFoto;
protected $m_sEmail;
/*Constructor*/
public function __... | 2 | 1,655 |
Reverse CRC-32 NSData in Swift | <p>I think the components of the answer are out there, but I don't understand this stuff well enough, and I'm getting very stuck on conversions.</p>
<p>Here's an implementation I found for NSData to crc32:</p>
<p><a href="https://github.com/krzyzanowskim/CryptoSwift/blob/643bbabd6781b6e226f18815dba616cf6a08629b/Crypt... | 2 | 1,518 |
base64_decode truncates array causes unserialize to return false | <p>I am logging user actions on an online application. So, I have a rather large (but not that large) multidimentional array that I am storing into database.
To do so, I am using base64 encode / decode and serialize / unserialize.</p>
<p>Here is the method I use to serialize my array: </p>
<pre><code>$this->detail... | 2 | 6,230 |
Background Managed Object Context Staggers UI Animation | <p>I've got a doozey of a problem that I've been working on for a few weeks. It involves stuttering UI performance whenever I save my Core Data managed object context. I've gotten as far as I can on my own and am looking for some help.</p>
<h1>The Situation</h1>
<p>My application uses two <code>NSManagedObjectContext... | 2 | 1,576 |
set input to empty string or null if it is not filled and save other datas in vue with laravel | <p>I have about seven input field in my newinsight i want some of the input field to be optional either it is field or not the post should be saved to database, i get error 500 if i leave some inputs empty. I have tried an it seems not working can anyone help out. below is my code.</p>
<p><strong>my controller</strong>... | 2 | 1,491 |
Installed PostgreSQL and cannot get the pgAdmin to open | <p>This is the error I get when I try to open pgAdmin 4. I installed the PostgresSQL 13 which is latest. I did the HKEY fix, cleared temp folders under AppData and ran as admin and nothing. I need to create a database and table. How do I do that if I can't even open pgAdmin.<br />
New to this.</p>
<p>pgAdmin Runtime En... | 2 | 1,660 |
Angular 4 reactive forms custom validator form error c: undefined | <p>I have a custom validator to evaluate 2 controller values; totalDisch should be more than damaNumb</p>
<p><strong>Component file:</strong></p>
<pre><code> form = new FormGroup({
hospital: new FormControl({ value: '', disabled: true }, Validators.required),
department: new FormControl('', Validators.requi... | 2 | 1,336 |
select name from php query and refresh seprate query on same page. | <p>I have just used my first bit of AJAX to search a MySQL database. This is for a persons name I would normally add a href to the result (which i have) and post to a seprate page to show all the the relevant details, eg address, grade and location. However i was wondering if this is possible staying on the same page. ... | 2 | 1,145 |
Mime type not working | <p>I have searched mime types for zip,apk files but they are not working for me (gives error -invalid format as per my code written.) . I have following code with me , other mime types of allowed extensions are working perfectly.Whats going wrong for me in below code ?</p>
<pre><code>$USER = $_COOKIE['phne'];
include ... | 2 | 1,451 |
Long polling with Ajax with sleep()/time_sleep_until() in while() loop | <p>I'm willing to set up a long polling Ajax call to check for orders in my e-commerce web app. There is a specificity in this application in the way that customers are able to place order in the future. As such, in the admin panel, we have past orders and futures orders (that can be 2 months or 20 minutes in the futur... | 2 | 1,690 |
Spring boot, Security, OAuth2: Is possible to use custom AuthorizationCodeResourceDetails? Auth server requires specific params in redirect url | <p>I'm developing an OAuth2 Client with SpringBoot. A third-party auth server requires specific params in redirect urls.</p>
<p>My app.yml</p>
<pre><code> acme:
client:
clientId: acme
clientSecret: acmepassword
accessTokenUri: http://localhost:8080/sso/oauth/token
userAuthorizati... | 2 | 1,210 |
Custom Elements v1 in transpiling from Typescript to ECMAScript 5 failing under IE11 | <p>I'm running into trouble getting a simple web component to work when transpiled to ES5. It appears to function perfectly fine under chrome, Edge, and Firefox, but IE11 is failing in the component's constructor with "The custom element constructor did not produce the element being upgraded."</p>
<h1>UPDATE</h1>
<p... | 2 | 1,731 |
Google combo chart transition animation | <p>today i found it these chart service by google and i played around with a little ans seem to go stuck and chart transition animation where i try 2 view two sets of different data on the same table which changes on button click, following is the code,</p>
<pre><code> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 ... | 2 | 1,444 |
Calling next at IEnumWbemClassObject hangs the app | <p>I have a simple function that gets the harddisk serial number using WMI, but the following call will hang the app like if it entered an infinite loop:</p>
<pre><code>HRESULT hr = pEnumerator->Next(WBEM_INFINITE, 1, &pclsObj, &uReturn);
</code></pre>
<p>The full code is:</p>
<pre><code>std::string GetHa... | 2 | 3,887 |
JSF backing bean sets the property to null | <p>I am trying access the form backing bean data from by controller bean. The value from form
gets set in the bean but when i am trying to access it from the controller bean the value comes null.The null value is in createTicket method :---> ticketData.getSummary());</p>
<pre><code>/*from data bean everything se... | 2 | 1,024 |
Recursion Program | <p>I am stuck up in this code: </p>
<blockquote>
<p>Problem: A child can hop a staircase of steps n in 1,2 or 3 steps at one time. Given a value of n, print all the permutations of the order in which he can climb the staircase.</p>
</blockquote>
<p>This is my code: </p>
<pre><code> public class HoppingLad
{... | 2 | 1,175 |
Log every request to web api method to file | <p>My requirements are to add logging to every request and response and errors to a file. I have tried this,</p>
<pre><code>public class LogRequestAndResponseHandler : DelegatingHandler
{
private static readonly ILog Log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
pr... | 2 | 1,032 |
Composer error on update [UnexpectedValueException] | <p>I get this error when try to update composer.</p>
<p>Im using the comand:</p>
<pre><code>composer update -v --no-dev
</code></pre>
<p>And i get this error (stack trace) below:</p>
<pre><code>Adding VCS repository npm-asset/lodash.uniq
Adding VCS repository npm-asset/lodash.without
Adding VCS repository npm-asse... | 2 | 3,363 |
Spring error: nested exception is java.lang.IllegalArgumentException: Class name must not be null | <p>I am currently working on a Spring Security project: Web-application with registration & log-in functions.</p>
<p>The code that will be given later below is from a Udemy course and I am just learning it.</p>
<p>The code seems correct to me, but it throws an exception like this. </p>
<pre><code>(root cause)
or... | 2 | 2,586 |
Unable to guess the MIME type as no guessers are available (have you enable the php_fileinfo extension?) | in Symfony 5.08 | <p>I got some error when i tried to upload image on easyadmin with vich_uploader. </p>
<blockquote>
<p>Unable to guess the MIME type as no guessers are available (have you enable the php_fileinfo extension?) </p>
</blockquote>
<p>I have enabled php_fileinfo extension but that didn't solve this case. Also i checke... | 2 | 4,452 |
Saving data via AJAX, once done only then redirect the user | <p>I am working on a form which is saved via ajax, this part is working perfectly fine. The problem I am having is user looses the data when before saving the form he clicks on another link which redirects the user to another page.</p>
<p>As a solution, I thought of using JavaScript function so <code>onclick</code> of... | 2 | 1,078 |
Exchange edifact message with smooks - error during response | <p>I need to write osgi bundle to simple unmarshal edifact message (invoice), and persist invoice in database. I receive an exception during response</p>
<p>My environment:
- ServiceMix 5.0.0</p>
<p>I have following camel route</p>
<pre><code> <route>
<from uri="mina2:tcp://localhost:9999?textlin... | 2 | 2,779 |
Android: Files: Unable to get file path from content URI when file is selected from RECENT section in file browser | <p>I was trying to fetch file path from Uri given by data.data!! onActivityResult() method in android. When I selected the DCIM folder in File browser I was able to get the file path but when I selected the same file from RECENT section in file browser I was not getting the file path.</p>
<p>Code on Button click:</p>
... | 2 | 2,715 |
log messages processIncoming, handlePacket, sendBufferedRequest is repeated a LOT - android | <p>my app was in the background and i was checking the log i saw that the app sending log messages intensively with messages that i could not understand. </p>
<p>I use GCM push notification and i have doubt that it can be the reason.</p>
<p>If it is the reason! Battery will not like sending this much requests in less... | 2 | 9,240 |
Formatting a sharepoint workflow email table using HTML Tags | <p>I'm setting up a workflow email that takes values from a sharepoint form and then formats that email for users. </p>
<p>I've gotten everything working correctly, except for one part. When the email is sent out, the field that is being looked up doesn't get word-wrapped which then causes my emails(including the tabl... | 2 | 1,645 |
How do I determine the context in which a ColdFusion object resides? | <p>So, given that I have an instance of this component:</p>
<p>foo.cfc</p>
<pre><code><cfcomponent>
<cffunction name="locateMe">
<cfreturn "I don't know where I live!">
</cffunction>
</cfcomponent>
</code></pre>
<p>And, this other component, fooParent.cfc:</p>
<pre><code><cf... | 2 | 1,063 |
Android JSON parsing - Read data from a MySQL db , parsing & display result in a ListView | <p>I'm following a tutorial about <code>Android JSON parsing</code> on youtube. I want to read data from <code>MySQL db</code> parse into <code>JSON format</code> and display them in a list view in my Android app.</p>
<p>I have a created a <code>PHP</code> to <code>decode JSON data</code> and it shows in my Android ap... | 2 | 2,102 |
Django: Loop over 2 objects in same loop in template | <p>I have two models that are related, and I need to create a table that takes from both objects.</p>
<p>In my models:</p>
<pre><code>class Chamber(models.Model):
chamber_name = models.CharField(max_length=100)
chamber_type = models.CharField(max_length=50)
customer = models.ForeignKey(Customer, on_delete... | 2 | 1,331 |
ASP.NET MVC CORE web application integration tests with EF Core in-memory database - fresh database for each test | <p>I am learning about ASP.NET Core 3 and have built a basic application. I am looking run integration tests to assert calls to the controllers read/write from the database correctly. To avoid having to rely on the actual database I am looking at using EF Core's in-memory database. I have been following <a href="https:... | 2 | 2,732 |
APP.YAML: Combine different URLs-same file, static file serving & source code access in app.yaml | <p>I now there are a lot of questions about app.yaml, and I searched and searched, but this one I couldn't find.</p>
<p><strong>TLDR</strong>: PLEASE read full answer first, this isn't your standard application_readable:true.
<strong>I basically want to access the same file via different routes e.g. /static/img/pic.j... | 2 | 1,137 |
Notification not Opening my app | <p>I have (strange!) another question for all of you!</p>
<p>I have this code :</p>
<pre><code>package com.radio.radiostar;
import android.app.Activity;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.media.MediaP... | 2 | 1,764 |
Android App Not Available For Download on Some Devices | <p>I'm facing an issue where the app is not available for download on certain devices that should be well supported, the listing just doesn't up in Google Play.</p>
<p>I see about 1800 devices on the Not Supported list for the APK via the dev console. Among them some Galaxy S3, S4, S5 models (the list has multiple var... | 2 | 2,504 |
Laravel 6.x new password.confirm middleware doesn't work with custom guard | <p>a new password.confirm feature has been added to the laravel 6.2 framework.
I have a fresh laravel 6.18.8 installation, I have done multi-authentication based on guard.
I want to run password.confirm for this custom guard.
Login / logout for guard:admin works correctly, after login redirects to admin/home url correc... | 2 | 1,157 |
Python TypeError: derivatives_circ() takes 2 positional arguments but 6 were given | <p>i am trying to calculate some derivatives in order to complete some equations. but when i define my function which i would like to hold 6 different variables. it gives me this error bellow.</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code"... | 2 | 1,367 |
linq2db insert with inheritance mapping | <p>I'm trying to test a complex example of linq2db mapping, that includes inheritance mapping and embedded object. I follow the example from the tests project, but get an exception on insert operation. I didn't find any examples of insert or update operations in the test project, so maybe I do something wrong. </p>
<p... | 2 | 1,503 |
How to fix makefile to properly include -lcrypto to avoid linker error: undefined reference to `EVP_CIPHER_CTX_new' | <p>First of all I am trying to use </p>
<pre><code>#include <openssl/evp.h>
</code></pre>
<p>I am getting the common linker error: </p>
<pre><code>undefined reference to `EVP_CIPHER_CTX_new'
</code></pre>
<p>which I know can be solved by using <code>-lcrypto</code> when compiling. I am able to do this when co... | 2 | 1,146 |
How to verify a GMAC? | <p>According to section 5.2 (Two GCM Functions) of the <a href="https://csrc.nist.gov/publications/detail/sp/800-38d/final" rel="nofollow noreferrer">Recommendation for Block Cipher Modes of Operation: Galois/Counter Mode (GCM) and GMAC</a>, it mentions that for the case of GMAC, <em>the authenticated encryption and d... | 2 | 1,294 |
Writing to multiple CSV files from a for-loop | <p>I have a <code>for loop</code> which get the ticker symbol and another for loop inside which gets stock data. Now i am trying to create csv files which will take the data of stock name from the first for loop and add the stock data inside the CSV file. </p>
<pre><code>stock_data = []
with open('Nifty 50 Scrapped da... | 2 | 1,396 |
MS Edge: form submitted even if return false | <p>I got a strange problem when creating a login form for a website I create for work. I know it has been posed a million times but my case only breaks in Edge.</p>
<p>Principle is: I have a form with username and password. When submitting the form user and pass is validated and logged in in ajax (and returns error if... | 2 | 1,264 |
Leaflet map is not showing the line from gpx file | <p>I am having a weird issue with the leaflet.js map. For some reason, the trail line does not appear on the map even though it shows all the markers. It works fine in a standalone simple html page but whenever I embed this in the bootstrap template it breaks. My MVC .chtml page has the following code and jquery is ref... | 2 | 2,395 |
UnsupportedOperationException: WebView is not allowed in privileged processes | <p>I am using <code>android:sharedUserId="android.uid.system"</code> in my manifest to obtain some unavoidable rights. (to read HDMI input from an <a href="http://eweat.manufacturer.globalsources.com/si/6008848465509/pdtl/HD-set-top/1143517456/TV-Box-R9-Mini.htm" rel="nofollow noreferrer">Android box</a>) </p>
<p>My ... | 2 | 3,083 |
Error linking boost libraries | <p>I want to run code which needs boost libraries. I built it using CMake. Someone else has written this code and cmakelist. It needs to be linked with boost regex, filesystem and system libraries.</p>
<p>I downloaded boost 1.48 and built the above mentioned 3 libraries. Now I have dll and static libraries(.a). I ran ... | 2 | 1,970 |
Confusion about current transformation matrix in a PDF | <p>I am having some confusions about the current transformation matrix (CTM) in PDFs. For page 5 in <a href="https://drive.google.com/file/d/0B65bQnJhC1mvbEVQQ0o0QU9STlU/view" rel="nofollow noreferrer">this PDF</a>, I have examined the Token Stream (<a href="http://pastebin.com/k6g4BGih" rel="nofollow noreferrer">http:... | 2 | 1,162 |
Change push notification icon (FCM) in Xamarin | <p>I am trying to do Push Notifications with Xamarin.Forms (Android) and FCM from this <a href="https://www.youtube.com/watch?v=7w2q2D6mR7g&list=PLfbOp004UaYX5B2pKKp5j7QPniyLMPkSO" rel="nofollow noreferrer">tutorial</a> , <a href="https://github.com/jfversluis/XFFCMPushNotificationsSample" rel="nofollow noreferrer"... | 2 | 1,215 |
How to Get birthday info when using google+ login | <p>I m using google+ login on my website .
m getting the user info using this syntax -$google_oauthV2->userinfo->get();
but m not getting the user's birthday. What should i do to get the users birthday and location if possible.
here's my code:</p>
<p>`
<pre><code>require_once '../../src/Google_Client.php';
requir... | 2 | 1,163 |
the specified colorspace format is not supported. falling back on libyuv | <p>I'm currently working on a camera app. Everything worked fine, but when I tried to change the constraints of the Vision View the log suddenly printed this error.</p>
<p>[warning]the specified colorspace format is not supported. falling back on libyuv.</p>
<p>I have no Idea where it comes from and what I should chang... | 2 | 1,367 |
Odoo 9 where can I find action button dropdown in stock.move xml? | <p>I want to change <code>action</code> button dropdown menu with <code>adding</code> or <code>deleting</code> the submenus in <code>stock.move class</code> (or change export function) but I can't find the place in <code>xml</code> where is described button <code>"action"</code> with <code>"export"</code> and <code>"de... | 2 | 1,493 |
Redshift: copy command Json data from s3 | <p>I have the following JSON data.</p>
<pre><code>{
"recordid":"69",
"recordTimestamp":1558087302591,
"spaceId":"space-cd88557d",
"spaceName":"Kirtipur",
"partnerId":"Kirtipur",
"eventType":"event-location-update",
"eventlocationupdate":{
"event":{
"eventid":"event-qcTUrDAThkb... | 2 | 1,114 |
EF 5 derived classes can't access partial class's property | <p>I have an EF 5/MVC 4, database first project I am working on and have created separate edmx files for certain logical functional areas of my application (UserManagement, CompanyManagement, InventoryManagement, OrderManagement). The UserProfile table is in all of the edmx files as it is there to join to the CreatedBy... | 2 | 2,499 |
JAVA: How do I properly store Objects in a Binary File? Without overwriting | <p>I'm working on a Java File I/O Interface, I need my files to be in binary format, not in strings. I've found ObjectOutputStream and ObjectInputStream useful for my needs, but I need the interface to be able to write at the end of my file, as of I need it to record future data in the same file over and over.</p>
<p>... | 2 | 1,083 |
Generic solution to get simple values from lua file into c++ | <p>I'm trying to use a Lua file as a config or an ini. I have succeeded but my solution irritates me. Specifically, <code>get_double</code>, <code>get_int</code> and <code>get_string</code> functions needs to be done in a reusable way.</p>
<p>I ran into problems creating function templates that don't have arguments.
A... | 2 | 1,053 |
dlopen, factory pattern and the virtual method table | <p>I'm trying to wrap my head around how the factory pattern works internally when using dlopen in c++. Sorry for long post. </p>
<p>tl;dr; Question is in <strong>Bold</strong> below.</p>
<p>Snippets from <a href="http://www.tldp.org/HOWTO/C++-dlopen/thesolution.html" rel="nofollow noreferrer">http://www.tldp.org/HOW... | 2 | 1,373 |
Duplicate Records showing SQL Server 2008 R2 | <p>I have a query that I am working with and I want to change the criteria of how a person is selected, instead of being selected by the type of doctor a person gets an order written by, I want to see results come back if a person has had activity performed by a physician of a certain type. </p>
<p>In some cases the s... | 2 | 2,033 |
Using OneToOneField in Django | <p>I'm realized some models in application:</p>
<pre><code>from django.db import models
class Commentary(models.Model):
user_id = models.ForeignKey(User)
created_date = models.DateField()
comment = models.TextField()
class Role(models.Model):
role_name = models.CharField(max_length=25)
class User(mo... | 2 | 1,348 |
promise from fetch not resolving properly | <p>So I have this method that I use to call the all purpose fetch method I defined in a separate js file:</p>
<pre><code>export function detailedView(request,token)
{
let endpoint = 'api/v1/cbn/inventory/GetDetailRequest?RequestNo='+request['RequestNo'];
let header = {
"Content-Type": "application/x-w... | 2 | 1,597 |
Reflection on the Right Side of Image in Android ImageView | <p>I have an image and I want to give reflection to that image in Android application, below is the source code. I've found an example code </p>
<pre><code> ImageView imageView = (ImageView) findViewById(R.id.image1);
imageView.setImageResource(imageIDs[position]);
//The gap we want b... | 2 | 1,429 |
Relative Strength Index | <p>I'm trying to calculate the relative strength index, <strong>RSI</strong>, for a financial instrument. When I compare my calculation with one done by a commercial software, they don't look the same. I can't figure out what I'm doing wrong. Can anyone help?
<br />
The <a href="http://stockcharts.com/school/doku.php?i... | 2 | 2,128 |
Symfony Form with Doctrine Entity - Relation not loading for editing | <p>I'm having an issue with something I think is probably fairly basic but the cause is escaping me.</p>
<p>I have a two entities, an Organisation and a Subscription. An organisation is linked with one subscription. </p>
<p>I want to be able to edit this via a form (creating via form already works). When I do the fol... | 2 | 2,786 |
How to enable Long Range for BLE Mesh in Zephyr OS | <p>I’m working on Bluetooth mesh network solution and I have requirement to increase range.</p>
<p>I’m using nrf52840 DK and nrf52840 dongles, nrf5SDKforMeshv310.
In Nordic <a href="https://devzone.nordicsemi.com/f/nordic-q-a/29813/change-phy-in-mesh" rel="nofollow noreferrer">Devzone</a>
I found solution which, enabl... | 2 | 1,099 |
mouseleave 2 elements show/hide 1 element? | <p>I have 2 elements a <code><ul></code> and a <code><div></code>.</p>
<p>If I hover over the div I want the ul to appear and when I mouseleave the div I want to check if the mouse is over the ul, if not I want to hide the ul again.</p>
<p>This is my code it works in Chrome and safari but not in Firefox d... | 2 | 1,408 |
Makefile/GCC struggles with special characters in path using Windows | <p>I've got the following makefile:</p>
<pre><code>SRC = File1.cpp File2.cpp
OBJECTS = $(patsubst %.cpp,$(GEN)/%.o,$(SRC))
all: $(OBJECTS)
@echo Packing objects: $(OBJECTS)
$(AR) rcs $(GEN)/../libOutput.a $(OBJECTS)
$(GEN)/%.o : $(GEN)/%.cpp
@echo Compiling $<
$(CXX) -c $(CXXFLAGS) -O2 $< -o $@... | 2 | 1,104 |
Convert data from QSqlTableModel to human form in QTableView (enum -> String) | <p>I'm using a QSqlTableModel to get the data from the required table, and I'm rendering it in the GUI using QTableView.
The problem that I have now is that I want to change different fields (convert them) from the existing value to another one (enum -> String).
For example an existing value of 1 should be displaied a... | 2 | 1,256 |
Python asyncio - heartbeat() method not writing to stream | <p>I trying to create a proof of concept with Python 3 <em>asyncio</em>, implementing a client that sends <em>heartbeats</em> periodically to a server in order to keep the connection alive.</p>
<p>Note that the server is simply an echo server and doesn't close the connection. But it is important that the client is able... | 2 | 1,856 |
Auto-fill Form Select Fields from External API using HTTP GET | <p>I'm trying to link up a HTML/PHP form from a WordPress site to communicate with an external database (which is built using Ruby on Rails I believe). I have been told this DB has a fully working API.</p>
<p>The full form has a few other standard text fields etc, but to give a basic overview, the user would select a ... | 2 | 1,201 |
Dynamically selecting a radio button in Ionic 3 | <p>I have some code that dynamically selects a radio button depending on the expression but the issue is that it sometimes selects two radio buttons of a radio-group list, the code for html</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<... | 2 | 1,108 |
How to undo a line stroke ios | <p>Im developing a colouring app, however I cant manage to implement an UNDO button. I am unsure of the approach, I have tried implementing NSUndoManager, but I could not get it to work effectively. My approach is possibly incorrect. Im would greatly appreciate an answer that uses code, based on my example.</p>
<pre><... | 2 | 3,034 |
authentication Google Content Api service account - error 'user cannot access account' | <p>I am bashing my head against the wall trying to get my code to work.
I already have succesfully connected to the google Api by using the authentication route with the redirect url.</p>
<p>However, I need to get this working as a standalone service which will be running in a crontab.</p>
<p>So now I am trying to au... | 2 | 1,167 |
How to extract separate portions of HTML with Jsoup? | <p>I have already used some of the <code>Jsoup</code> methods to get this string that contains a portion of the webpage's HTML code: </p>
<pre><code>protected String doInBackground(String... arguments) {
// extract arguments
String newsurl = arguments[0];
//
Document doc = null;
... | 2 | 15,614 |
java.lang.NoSuchMethodError: org.apache.spark.streaming.api.java.JavaDStream.foreachRDD(Lorg/apache/spark/api/java/function/Function;)V | <p>I'm working with kafka-sparkstreaming, java.
zookeer: v3.3.6, kafka: v2.11-0.10.1.0, spark: v2.0.1-bin-hadoop2.7, scala: v2.11.8.</p>
<p>There were no configuration's done apart from renaming few files in conf directory.</p>
<p>Code to read from kafka:</p>
<pre><code>JavaPairInputDStream<String, String> kaf... | 2 | 4,693 |
Kotlin-gRPC: error: incompatible types: NonExistentClass cannot be converted to Annotation @error.NonExistentClass() | <p>I downloaded from micronaut.lanch a simple grpc project and I can build it until I add Kotlin gRPC plugin.</p>
<p>Beyond the changes in build.gradle.kts, there is nothing else than the original scafolded project.</p>
<p>I edited in build.gradle.kts.</p>
<p>Firstly, in order to match IntelliJ Kotlin version</p>
<pre>... | 2 | 2,621 |
no bean named > 'mystoreBrandCategoryCodeValueProvider' available (hybris) | <blockquote>
<p>Caused by: java.util.concurrent.ExecutionException:
de.hybris.platform.solrfacetsearch.indexer.exceptions.IndexerRuntimeException:
de.hybris.platform.solrfacetsearch.indexer.exceptions.IndexerException:
Failed to index item with PK 8796431187969: No bean named
'mystoreBrandCategoryCodeValuePro... | 2 | 2,148 |
Bulk Update users G-suite | <p>I'm about to bulk update multiple users email domaine in g-suite using the code below - found it here <a href="https://support.google.com/a/answer/7068037" rel="nofollow noreferrer">https://support.google.com/a/answer/7068037</a></p>
<pre><code> // Cell Colors
COLOR_GRAY = '#434343';
COLOR_GREEN = '#B5D5A7';
COL... | 2 | 4,429 |
Binding WPF Combobox to DataTable via XAML | <p>I have a DataGrid that I am attempting to populate using a dynamic DataTemplate (depending on context, it will show a TextBlock, CheckBox, ComboBox, etc); I have the DataGrid bound to an object containing the data I need, but I'm running into trouble when it comes time to set the ItemsSource of the ComboBox cells to... | 2 | 1,201 |
Segfault at end of c++ program related to file i/o | <p>I'm working on a cryptography project and our cipher will need to be able to read and write to a file. One of my partner's implemented the reading capability, and now we're running into an odd problem. Our program runs correctly and without error if no output file is supplied by the user, but segfaults after complet... | 2 | 2,751 |
How does Servlet/JSP MVC patterns translate to JSF/Facelets (in particular the service and controller parts)? | <p>Let us take a basic example. In a servlet app I would have those classes:</p>
<ul>
<li><strong>app.domain.User</strong>: domain or model POJO, would contain fields and getters/setters</li>
<li><strong>app.service.UserService</strong>: would contain methods that operate on User instances, such as <code>Register(User... | 2 | 1,039 |
Facebook FB.ui send method not working on mobile web and need alternative | <p>I am trying to allow users of my app to notify multiple Facebook friends that they need them to vote for their favorite item on a web page. I have been using the FB send method (<a href="https://developers.facebook.com/docs/reference/dialogs/send/" rel="nofollow">https://developers.facebook.com/docs/reference/dialog... | 2 | 1,098 |
Reading XML tags getting value from inner tag | <p>I don't know how to explain my situation, I can provide example below.
I have an XML file to be read in Java, something like this:</p>
<pre><code><Author AffiliationIDS="Aff1">
<AuthorName DisplayOrder="Western">
<GivenName>Wei</GivenName>
<GivenName>Long</GivenNa... | 2 | 1,111 |
Google Analytics API: Uncaught TypeError: Cannot read property 'request' of undefined | <p>I have been looking for a solution to this, but since I'm a newbie I might be missing something obvious? I'm playing with the Quick Start example, trying to set a batch request, because I'm trying to learn how they work :).</p>
<p>This is the code:</p>
<pre><code><!DOCTYPE html>
<html lang="en">
<he... | 2 | 1,304 |
Express.js: res.render() does not send data when wrapped in promise chain | <p><strong>I recently started refactoring older callback-hell routes to use promises.</strong> <em>(Note: the refactor is not complete so some of the following code is ugly)</em></p>
<p>Doing so broke my <code>res.render()</code> function. </p>
<ul>
<li>I am using EJS for my render engine.</li>
<li>Most of my promise... | 2 | 1,559 |
Crop multiple images on same canvas using FabricJs | <p>I want to add images to the canvas and select one at a time and apply crop to please have a look:
<a href="http://jsfiddle.net/kNEaX/586/" rel="nofollow noreferrer">http://jsfiddle.net/kNEaX/586/</a></p>
<p>original post: <a href="https://stackoverflow.com/questions/18732876/crop-functionality-using-fabricjs">Cro... | 2 | 1,483 |
ExpressionVisitor soft delete | <p>We're having some issues implementing soft delete functionality with entity framework. The idea is to use a repository which is aware of the EF context. On the level of the repository we implemented a plugin system, these plugins get executed whenever an action is done on the repository. For example when we call <co... | 2 | 5,770 |
How to repeat a CSS grid layout pattern? | <p>I'm trying to make a grid layout with repeating 2 vertical, 2 horizontal sections. Then 2 horizontal, 2 verticals, and we repeat again.</p>
<p>Like this: </p>
<p><div class="snippet" data-lang="js" data-hide="true" data-console="true" data-babel="false">
<div class="snippet-code snippet-currently-hidden">
<pre cla... | 2 | 1,033 |
XSL-FO: Adjust border-width based on text width | <p>I am having trouble with XSL-FO using Apache FOP as a processor. I have a simple stylesheet and already have set a round border to an fo:block-container. The problem is: the text size is non-predictable given that the .fo file will be generated using a XSLT and a XML, so i need to tell FOP to adjust the border width... | 2 | 1,130 |
How do I pop android navigation backstack up to a certain fragment? | <p>I am once again asking for your intellectual support.</p>
<p>I have a fragment that puts a number of copies of itself on the navigation backstack like this:</p>
<pre><code>Navigation.findNavController(button).navigate(
TaskCollectFragmentDirections.actionTaskCollectFragmentSelf(args.taskIndex, args.screenIndex +... | 2 | 1,594 |
Spelling libraries (like hunspell) in UWP Applications? | <p>I am porting an application for writers to the UWP platorm. The only piece of the puzzle i have left is the NHunspell library. I use it extensively for spell checking and thesaurus features. I've customized the heck out of it, and created custom dictionaries for various things (i.e. a different dictionary for each w... | 2 | 1,082 |
Primefaces AJAX update="@form" calls listener twice | <p>I have a page that has some options at the top that when changed updates some chart on the same page. Here is the relevant filters part:</p>
<pre><code><p:fieldset id="filtrosDashboard" legend="Filtros" toggleable="true" toggleSpeed="500" collapsed="#{beanJanela.filtroCollapsed}">
<!--Site filter-->
&l... | 2 | 9,162 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.