on-internet

Android: Add new buildType - Unable to find a matching configuration of project

Android Studio 3.1, Gradle 4.4 My project hierarchy -app -common build.gradle common is a android lib for my project. As result in settings.gradle: include ':app', ':common' Here my app/build.gradle buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' configBuildType(delegate, RELEASE_APP_NAME, null, RELEASE_API_BASE_URL) signingConfig signingConfigs.release } debug { configBuildType(delegate, DEBUG_APP_NAME, DEBUG_APP_ID_SUFFIX, DEBUG_API_BASE_URL) } } dependencies { implementation fileTree(dir: 'libs', include: ['*.jar'

Join the discussion →

How to resolve a JsonSchema and move a sub-schema up to the root?

I wrote a schema in JavaScript because its easier, which I can simply run to turn it into JSON. That part is all fine, but now I want to extract a sub-schema/definition because the application I want to use it with won't let me specify a JSON path for the sub-schema I'm interested. So I tried writing a little script to pull it out: #!/usr/bin/env node import Ajv from 'ajv'; import Path from 'path'; const ajv = new Ajv({ $data: true, }); ajv.addSchema(require(Path.resolve(process.argv[2])).default,'x'); const schema = ajv.getSchema(`x#/${process.argv[3]}`).schema; console.log(JSON.stringify(sch

Join the discussion →

Can't bind to 'gridOptions' since it isn't a known property of 'ag-grid-angular' (Angular4)

I have this code in HTML: <ag-grid-angular [gridOptions]="gridOptions"></ag-grid-angular> code in Component: import {GridOptions} from 'ag-grid'; ... export class SampleComponent{ gridOptions: GridOptions; } ... app.module.ts: import {NgModule} from "@angular/core"; import {AgGridModule} from "ag-grid-angular/main"; import {AppComponent} from "./app.component"; ... @NgModule({ declarations: [...], imports: [ ... AgGridModule.withComponents([]) ], providers: [], bootstrap: [AppComponent] }) export class AppModule { } What can be the source for the error that I get? Here is the full error: Error

Join the discussion →

Azure Data lake VS Azure HDInsight

I was going through the Microsoft documents: https://learn.microsoft.com/en-us/azure/data-lake-store/data-lake-store-overview I'm new to Azure Data lake and HDInsight. There is a statement in the URL which tells that "Azure Data Lake Store can be accessed from Hadoop (available with HDInsight cluster) using the WebHDFS-compatible REST APIs." As per my initial understanding, Data lake store is a store in which any kind of data can be stored. I think, HDInsight also kind of does the same thing. My question is what is the difference between Azure Data lake and Azure HDInsight? If HDInsight can be

Join the discussion →

Why does my code throw a "Cannot read property 'classList' of undefined" Error?

I was working on a personal project of making a slider using pure JavaScript, but when I click the Next or Previous buttons, the console shows an error that the property 'classList' of undefined: Uncaught TypeError: Cannot read property 'classList' of null at prev (main.js:36) at HTMLElement.<anonymous> var next1 = document.getElementById("next"); var prev1 = document.getElementById("prev"); var ulist = document.getElementsByTagName("ul").lastChild; var ulist1 = document.getElementsByTagName("ul").firstChild; var slides = document.querySelectorAll("li"); var active = document.getElementsByClas

Join the discussion →

Prevent sleep while SSH session active

I'm trying to prevent computer from going to sleep while there is an active SSH connection but just can't set it up. Found a short description on how to do it but it doesn't work: https://askubuntu.com/questions/521620/prevent-machine-from-sleeping-when-ssh-connections-are-on?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa Since I'm using ubuntu 16.04 I have tried to move the script to /lib/systemd/system-sleep/ and it shows up in logs that script was executed and returned 1 before computer was suspended but it's not preventing it from going to sleep. I have also tried

Join the discussion →

How to specify an __init__ argument that is not a class attribute

With attrs, how can I specify an __init__ argument that is not a class attribute. e.g. a CRC8 object might be passed some bytes or bytearray in the constructor, but I don't want to store that input, just calculate the CRC and store the result. Is this pattern an example where using a class method is appropriate (as described in this link)? http://www.attrs.org/en/stable/init.html#initialization

Join the discussion →

Regular expression-like pattern matching on IEnumerable instead of string chars in C#

I am trying to modify a list of CIL code instructions in C#. Common tasks include finding groups or patterns of instructions and replacing them with other instructions while reusing some of the information from the original match. That sounds a lot like regular expressions except that my use case is on lists of instances a specific type instead of characters in a string. I can write some basic code to search and match stuff and replace it but I wonder if there is a more general approach with regexp syntax like “x?” or “(a|b)+” or “(a+)b*(c+)” but with a, b, c not being characters but instances

Join the discussion →

Handling decimal values in spark scala

I have data in a file as shown below: 7373743343333444. 7373743343333432. This data should be converted to decimal values and should be in a position of 8.7 where 8 are the digits before decimal and 7 are the digits after decimal. I am trying to read the data file as below: val readDataFile = Initialize.spark.read.format("com.databricks.spark.csv").option("header", "true").option("delimiter", "|").schema(***SCHEMA*****).load(****DATA FILE PATH******) I have tried this: val changed = dataFileWithSchema.withColumn("COLUMN NAME", dataFileWithSchema.col("COLUMN NAME").cast(new DecimalType(38,3)))

Join the discussion →

Crear una matriz y encontrar el valor mayor de cada fila y columna

Tengo una duda en un programa Basicamente el programa dice lo siguiente: Encontrar el valor mas grande de cada fila,de cada columna y el mayor de toda la matriz,es una matriz de 4x7. En realidad el programa es un menu con mas opciones pero yo ya tengo todas, solamente que no se como encontrar el valor mas grande de la fila y columna,el valor mayor de toda la matriz tambien me sale el unico problema es con las columnas y filas. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ULTIMOEXAMEN { class Examen { public float[

Join the discussion →

undefined symbol: __asan_option_detect_stack_use_after_return

I'm trying to compile C++ using clang's address sanitizer to output the sanitize results within a core dump, so I added: CXXFLAGS += -fsanitize=address to have the compiler options: /opt/llvm-3.8.0/bin/clang++ \ --gcc-toolchain=/opt/gcc-5.2.0 -fsanitize=address -DLINUX \ -DLINUX64 -DTB_USE_RCU -DURCU_INLINE_SMALL_FUNCTIONS \ -DU_USING_ICU_NAMESPACE=0 -DNDEBUG -D_POSIX_PTHREAD_SEMANTICS \ -fPIC -D_GNU_SOURCE -DTB_USE_RCU -DTB_USE_RCU \ -D_GLIBCXX_USE_CXX11_ABI=0 -m64 --gcc-toolchain=/opt/gcc-5.2.0 \ -flto=full -std=gnu++14 -D_GLIBCXX_DEPRECATED= -pipe \ -fno-omit-frame-pointer -ffast-math -fno-

Join the discussion →

Difference between npx and npm

I have just started learning React, and Facebook helps in simplifying the initial setup by providing the following ready-made project. If I have to install the skeleton project, I have to type npx create-react-app my-app on the command line. Why does Facebook have npx create-react-app my-app on GitHub rather than npm create-react-app my-app?

Join the discussion →

Creating simple calculator

I am trying to solve a problem given to me and it involves using basic loops, functions and conditions. I have been given the below: // TODO: complete program console.log(calculate(4, "+", 6)); // Must show 10 console.log(calculate(4, "-", 6)); // Must show -2 console.log(calculate(2, "*", 0)); // Must show 0 console.log(calculate(12, "/", 0)); // Must show Infinity and this is my attempt (not working of course). Can anyone give me a nudge of a pointer as to what I am doing wrong? function calculate(n1, n2, n3) { let calc if n2 = "+" { (calc = +) }; else if n2 = "-" { (calc = -) }; else if n2

Join the discussion →

Boxcox() transformation in R error

cellphone = read.csv("/Users/crystalchau/Desktop/UICT-CELL_IND.csv", nrows = 25, colClasses = c(NA,NA,"NULL")) cellphone = cellphone[nrow(cellphone):1,] cellphone.ts = ts(cellphone, frequency = 1) ts.plot(cellphone.ts, ylab = "Mobile Cellular Telephone Subscriptions") title(expression(Mobile~Celluar~Telephone~Subscriptions)) par(mfrow=c(1,2)) cellphone = read.csv("/Users/crystalchau/Desktop/UICT-CELL_IND.csv", nrows = 25, colClasses = c("NULL",NA,"NULL")) cellphone = cellphone[nrow(cellphone):1,] cellphone.ts = ts(cellphone, frequency = 1) acf(cellphone.ts, lag.max = 10) pacf(cellphone.ts, lag

Join the discussion →

TypeScript generation for SQL files

I'm interested to know if anyone has come across a tool that can generate TypeScript type definitions based on the expected result of a SQL query? That is to say, is there a CLI that accepts a SQL schema and .sql file and outputs a .ts file based on the expected result of the query? Such a tool already exists for GraphQL queries and my team has found it extremely useful because it completely removes errors associated with hand-rolled type definitions.

Join the discussion →

What change in history would cause the Dutch to speak German?

What single change(s) in history would cause the Dutch people to be speaking German instead of Dutch? I understand that German and Dutch are both Germanic languages and share a common ancestry, as German has dialect continuum from the border with Poland all the way to the Netherlands. I'm looking for a change that would prevent the drastic, but gradual diversion that happened between the two, so that someone from Berlin could understand a Dutchman just as well as he would someone from Munster or Austria. I do know that people from different parts of Germany and Austria can have difficulties un

Join the discussion →

Event ID 36887, A fatal alert was received from the remote endpoint. The TLS protocol defined fatal alert code is 40

This is resulting from an outbound connection to Equifax's new TLS 1.2-enabled URL. Background: Servers: Windows 2012 R2, .NET 4.6.2, all TLS 1.x Enabled in Test, Stage and Production tiers per this. IIS configurations match between servers (app pools/code except tier-specific configurations/IIS settings.) Servers are load balanced via Citrix Netscaler, but this site uses Port 80/HTTP, no HTTPS configuration. Both tiers use the same Equifax URL, but with tier-specific credentials. The Situation: Prod will not communicate with their site, we get the opening error. Our stage environment has no p

Join the discussion →

how do I send (put) multiple files using nodejs ssh2-sftp-client?

If I try more then 10 files I got the warning, but the other files are not uploaded, I cannot upload more than 10 files. What am I doing wrong? { node:17472) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 ready listeners added. Use emitter.setMaxListeners() to increase limit (node:17472) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 error listeners added. Use emitter.setMaxListeners() to increase limit (node:17472) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 close listeners added. Use emitter.setMaxListe

Join the discussion →

Netbeans Project wont run

im not very good at English so i'll do my best to try to explain the situation Im making a Netbeans Java Project, like 10 mins ago everything was running fine now when i run the project, a Java Application runs but i cant open it, here's my Java project [ [Image 2][2] As you can see there's no error on my code when i run it shows that everything is fine but its not working. When I click on "Run Project" I get the Running Project loading bar in the bottom. Then a Java Application runs but it’s like empty, its not my Interface and when i close it I get and error on "Notifications" I have an "Une

Join the discussion →

On the cortex-m3 platform, why does UCOS-III not use SVC to perform pendsv?

Recently, I am reading the source code of UCOS-III, and I have an question about UCOS-III's task switching when it running on the Cortex-M3 platform. It use PendSV for task switching by directly writing register SCB_ICSR(Interrupt control and state register), but accessing register SCB_ICSR Requires privilege operation level. This means that the processor is runing in the process mode at privilege operation level without exceptions and interrupts, which I don't think it's safe. Why does UCOS-III not use SVC to perform pendsv? Is it a matter of efficiency? Could somebody please explain this for

Join the discussion →

Multiple File Upload Using Angular 4

I am facing issue with multiple files upload using Angular 4. Here I am trying to append the multiple files in getFileDetails() but only file is selecting and if I choose another file it is getting replaced with the new file but actual expectation is they need to append each other and using post method I need to pass the json. app.component.html: <div> <h1>{{title}}!</h1> <ng-container> <input type="file" id="file" multiple (change)="getFileDetails($event)"> <button (click)="uploadFiles()">Upload</button> </ng-container> </div app.component.ts import { Component, OnInit } from '@angular/core';

Join the discussion →

PHP: Null coalescing operator

I am trying to understand how the null coalescing operator really does work. So, I tested many examples after reading the documentation in php.net and some posts on Stack Overflow. However, I can't understand this code: <?php $x = false ?? 'stackoverflow'; var_dump($x); // bool(false) since it's equivalent to (from Null coalescing operator) isset(false) ? false : 'stackoverflow'; and since isset(false) generates a fatal error. What is the explanation?

Join the discussion →

How to automatically check if there is any possible exceptions in Python?

I'm refactoring a non-trivial python project, there could be many exceptions to be thrown. sometimes it's hard to catch all of them if you don't just try...except the whole program. In order to achieve a fine-grained exception handling, I want to systematically get a list(preferably a graph) of all possible exceptions( and their types) that could be thrown in different location of execution flow. Is such a thing even[sic] possible?

Join the discussion →

Flight search engine for weekend flights

I'm looking for a flight search engine that lets me search for a flight from a specific origin to a specific destination. I don't care on which weekend the flights take place, but I want to find the cheapest flight in the next 2 months that leaves one a Friday afternoon evening and returns at Sunday night or Monday morning. I couldn't find such a flight search engine. Is there anything like that?

Join the discussion →

date format issuse in vue2-datepicker

I am using "vue2-datepicker" plugin in my vuejs2 project. "yyyy MM dd" is the default format in that datpicker but I want the change format like "dd MMM yyyy"(16-May-2016). I have changed the format in my script but it's not reflecting in the UI. It shows "16-05-2018" as the output. <template> <b-card> <div> <date-picker v-model="dob" :lang="lang" :format="format"></date-picker> </div> </b-card> </template> <script> import DatePicker from 'vue2-datepicker' eexport default { name: 'addEmpl', components: { DatePicker }, data () { return { dob: '', lang:{ default : 'en' }, format: 'dd-MMM-yyyy' }

Join the discussion →

Controlling Stepper Motor + Raspberry Pi Zero + L293D IC

My friend is trying to program a Raspberry Pi Zero to control a stepper motor using Python 3. She followed these tutorials. Looks like she used the parts and wiring from #1 and the code from #2: https://raspi-tutorials.com/how-to-control-a-stepper-motor-with-raspberry-pi-and-l293d-uln2003a/ https://www.raspberrypi.org/forums/viewtopic.php?f=49&t=55580 This is her actual setup: https://photos.app.goo.gl/WJbCo4UU3wAdo8913 She mentioned she is not using a resistor between the power source and the L293D Driver IC. Parts Used: Raspberry Pi Zero (Pi 2 or 3 was recommended, but the Zero has the same

Join the discussion →

Programming in Python: Controlling Stepper Motor + Raspberry Pi Zero + L293D IC

(Warning! I am not educated on this topic) Hey folks. I'm posting here because I have a friend who desperately needs help with her project. I'm familiar with scripting, but not too much with programming. I do work in IT, so I'll do my best to provide the necessary information. She's trying to program a Raspberry Pi Zero to control a stepper motor using Python 3. Simple as that. She followed these tutorials. Looks like she used the parts and wiring from #1 and the code from #2: https://raspi-tutorials.com/how-to-control-a-stepper-motor-with-raspberry-pi-and-l293d-uln2003a/ https://www.raspberry

Join the discussion →
Older stories