andrey andrey

1

votes
2

answer
1.1k

views

Clear input in stateless React component

I want to implement an X icon inside Input component that will clear the input field. I can easily do it if I control the state. But is it actually possible with stateless component? I use react-semantic-ui, their stateful components have auto controlled state. So I want to create an input that can...
Andrey
1

votes
2

answer
53

views

Python zip behavior with *

Why there is the following result with zip function (example number 3): l = list(zip(['1', '2'], ['a', 'b'])) print(l) # [('1', 'a'), ('2', 'b')] - ok, zip works as expected l = list(map(lambda t: t[0] + t[1], zip(['1', '2'], ['a', 'b']))) print(l) # ['1a', '2b'] - nice, I have expected result with...
Andrey
1

votes
2

answer
31

views

Copy rowtype variable to another

I have l_tab1 table1%rowtype; l_tab2 table2%rowtype; The structures of table1 and table2 are the same. How can move the data from l_tab1 to the l_tab2 ? now I can see two ways but I don't like it because I need hardcoded the fields. 1 l_tab2.field1 := l_tab1.field1; l_tab2.field2 := l_tab1.field2;...
Andrey Khmelev
0

votes
0

answer
13

views

Problems with data communication between components

I had a page on which there was a header with an input that was a search engine, a list of posts, and pagination. I decided to move the header from this file to a separate component in a separate vue file. After I did this, the search for posts by title stopped working, and I can’t add a post now...
Andrey Belichenko
1

votes
2

answer
32

views

Code optimization. One function instead of several duplicate lines of code

I want to create one function instead of several duplicate lines of code. I have this module. It`s works, but I want to optimize this code. import React from 'react'; const form = (props) => { //start let arr = props.data.nodes.map((element) => element.vendor); let unique = arr.filter(function(...
Andrey Green
1

votes
1

answer
424

views

Read response from command on serial port

I am programming a PHP application that uses a serial device to do stuff with GSM modem. So you can communicate with the serial port via screen and you would get a response when you write a command. I use PHP to communicate with my serial port and use sleep to wait between the commands, I se fopen w...
Andrey Tsarev
1

votes
0

answer
280

views

Alternative for TreeView widget in Universal Windows

I have to develop UWP program, and I have found that to use a regular TreeView Widget, what is supported in Windows Forms, is too much overhead. So I have to substitute this part of my GUI with something else. This is an example of my desired data hierarchy House #1 Person #1 Person #2 Person #3 Pe...
Andrey Mazur
1

votes
1

answer
872

views

Reading depth buffer with PyOpenGL

Basically, I'm trying to extract a depth map (by this I mean a matrix with z corresponding to z-coordinates for vertices in GL.glVertex3dv(vertex) call - obviously, interpolated for plane pixels) after rendering a model (script is loading the model from file with path specified as the first command...
Andrey K.
1

votes
0

answer
87

views

Is it possible to include/exclude `cs`-file into the `csproj`-file by the `dotnet` command?

.Net Core 2 Is it possible to include/exclude cs-file into the csproj-file by the dotnet command? In the documentation I found only how to add a package to csproj-file by the dotnet command.
Andrey Bushman
1

votes
1

answer
219

views

Avro schema record field name start from number

Avro documentation says: The name portion of a fullname, record field names, and enum symbols must: start with [A-Za-z_] subsequently contain only [A-Za-z0-9_] Is it possible somehow to escape the first rule and have record field name starting with digit, i.e. 123ColumnName? Maybe via 'escaping' or...
Andrey Dmitriev
1

votes
0

answer
214

views

Scrollable table in flex layout

I'm trying to create an HTML layout with header, footer and 3 content sections. It does work for simple sections; however for the code below, I get table2 spanning past footer: Header Col1Col2Col2 Val1Val2Val3 Col1Col2Col2 Val1Val2Val3 Val1Val2Val3 Val1Val2Val3 Val1Val2Val3 Val1Val2Val3 Val1Val2Val3...
Andrey Paramonov
1

votes
0

answer
33

views

Is it acceptable if two services interact with each other in Angular 2 application?

I have two services, for example: RoomService import { Injectable } from '@angular/core'; import { Room } from './room.model'; @Injectable() export class RoomService { ... getRoom(): Room { return room; } ... } EventService import { Injectable } from '@angular/core'; import { Event } from './event.m...
Andrey Pilyushkin
1

votes
0

answer
54

views

RecyclerView and EditText.setOnFocusChangeListener

There is a RecyclerViewCursorAdapter in which EditText is located. It records the quantity of goods for the order. Need to save the data from the input field after the change (in this case, after losing the focus. About TextChangedListener also thought, but for the time being stopped on this option)...
Andrey Mihalev
1

votes
0

answer
43

views

Video in JavaFX8 doesn't replay after building a jar with Zenjava plugin

I'm trying to make video play indefinite number of times and use this code: Media media = new Media(getClass().getResource('/media/video.mp4').toExternalForm()); MediaPlayer video = new MediaPlayer(media); video.setCycleCount(MediaPlayer.INDEFINITE); root.getChildren().add(video); ... video.play();...
Andrey Serebryanskiy
1

votes
0

answer
82

views

Postgres ltree module, update id of a node with all the children related paths

I have the following simple table: create table nodes( id text primary key, path ltree ); lets say I put some data to the table: insert into nodes (id, path) values ('A', 'A'); insert into nodes (id, path) values ('B', 'A.B'); insert into nodes (id, path) values ('C', 'A.C'); so that the tree looks...
Andrey Yaskulsky
1

votes
1

answer
105

views

I try to get 2 frames from picamera. Why it works very slowly?

From picamera.PiCamera() Thread I try to get cls.frameCV2 = snap.array for handling in opencv, and another cls.frame = stream.read() for web streaming. Both work, but very slowly. What is the problem? If Use only frameCV2 it works quite fast, or if I only Use stream.read, it also ok. Here is my co...
Andrey Taranov
1

votes
1

answer
261

views

In Spark Java session is null after redirect

I'm in the very beggining of creating my first web app on Spark. The application is very simple: it is custom random number generator. On the first screen form takes two numbers (range of random number generation). I want to redirect users to the first screen if their input values are wrong and mak...
Andrey Serebryanskiy
1

votes
0

answer
537

views

What can cause connection refused on unix socket file

I have nginx server installed and I use spawn-fcgi to create a socket but for some reason the socket refuses the connection from nginx. This is my config: location /sympa { gzip off; include /etc/nginx/fastcgi_params; fastcgi_pass unix:/var/run/sympa/wwsympa.socket; # If you changed wwsympa_u...
Andrey Tsarev
1

votes
1

answer
211

views

PouchDB allows unauthorized users to create admins

I have a pouchdb (using their own server) installation running. If I do curl -X PUT 127.0.0.1:5984/_config/admins/anna -d ''secret'' I get {'error':'unauthorized','reason':'You are not a server admin.'} as expected. BUT, If I use the pouchdb-authentication plugin and run the following in the browse...
Andrey
1

votes
1

answer
94

views

Encountering a CryptographicException when console app is run from Windows Task Scheduler

I'm deploying a console app which gathers data on a user base and sends emails to our support team. There is a spreadsheet to read for which Google Spreadsheet Service is employed, therefore the corresponding class opens with the following lines: const string serviceAccountEmail = 'someemailaddresss...
Andrey Belenkiy
1

votes
0

answer
48

views

Doesn't reach subscribe operator

The following snippet of code is using for sending request to server and saving data to database. sessionRepository.getUserId()// from database .flatMap(userId -> { return profileRepository.editProfile(userId, profile);// send request to server }) .flatMapCompletable(profile1 -> { return profileRepo...
Andrey Mazniev
1

votes
0

answer
33

views

Prevent Linux from switching to another task during execution of a certain function

I made an implementation of 1-wire protocol for the Raspberry Pi adapted from this book. It uses bit banging to implement the communication protocol. The function bcm2835_delayMicroseconds() from the BCM2835 library is used to produced required delays. It works quite well, but not completely reliabl...
Andrey Pro
1

votes
1

answer
315

views

Inject mocks into class before constructor's logic comes on

Imagine, we have a class, in which a lot of logic is being executed inside a constructor. A question: how to inject mocks in such class before constructor's logic gets executed? Additional info: This class is not written by me and I do not want to violate the existing interface in this class by cha...
Andrey Ilyunin
1

votes
0

answer
150

views

Use custom deserializer in jackson fasterxml

I have an xml file like: User 15 ... ... I want to map this xml to List, where User class defined as: class User { public String userName; public int userAge; } I don't want to define mapping using annotations and so on. Just want to create an custom deserializer. I know that It is possible in Jacks...
Andrey Sukhovitsky
1

votes
0

answer
106

views

Robolectric: interaction with dialog, created anonymously on view click

I am new to robolectric as well as to testing android.* classes, and here is a problem: when user wants to specify his birthday, he clicks on a textview, which invokes a DatePickerDialog, and specified date is meant to be shown in the textview. Here is no any external links to the dialog. My code: i...
Andrey Ilyunin
1

votes
1

answer
557

views

Kubernetes NGINX Ingress TLS issue

I deployed k8s cluster in cloud (VMVare vSphere) - 3 masters and 1 worker node. Then with helm installed nginx-ingress: helm install stable/nginx-ingress Deployed few pods of simple http-svc Changed nginx-controller service type from LoadBalancer to NodePort and added externalIPs (IP adressess of my...
Andrey Okhotnikov
1

votes
0

answer
479

views

Python dynamic type hinting

I would like to be able to provide a function with a tuple of types which would then be used to deserialize the returned data from a transaction. The function would then return the instances of those types, if the transaction had succeeded. For example: T = TypeVar('T') class Base: @classmethod def...
Andrey Cizov
1

votes
1

answer
268

views

How can I encrypt string with DES algorithm in Javascript?

I have the following shell script which uses openssl to encrypt string: encrypt() { STRING_TO_BE_ENCRYPTED=$1 DATE_STRING=$2 MD5=$(/bin/echo -n ${DATE_STRING} | openssl md5) MD5=${MD5#*=\ } key=${MD5:0:8} iv=${MD5:24:8} key=$(/bin/echo -n '${key}' |od -A n -t x1|sed s/\ //g) iv=$(/bin/echo -n '${iv}...
Andrey Nazarov
1

votes
0

answer
236

views

Sync PouchDb with CouchBase through Sync Gateway by channel - error 404 for local document

I am trying to sync pouchDB with CouchBase through Sync Gateway by channel. In pouch I have : var da = new PouchDB('example_DE'); da.sync(remoteDB, { create_target: true, live: true, retry: true, filter: 'sync_gateway/bychannel', query_params: { channels: ['DE'] } }) Sync config file: { 'log': ['*'...
Andrey Shat
1

votes
0

answer
430

views

Java, Error: A JNI error has occurred, please check your installation and try again Exception in thread “main” java.lang.SecurityException:

I have the following problem while I'm trying to run in command line jar file assembled in Maven in ItelliJ IDEA. Error: A JNI error has occurred, please check your installation and try again Exception in thread 'main' java.lang.SecurityException: Invalid signature file digest for Manifest main attr...
Andrey
1

votes
0

answer
935

views

Using hibernate @Formula to fetch a collection

I have a similar db structure. The only difference that I have more tables on the path from A to C entity: db structure example image And I have following mapping for this structure: @Entity @Table(name = 'a') class A { @Id private int id; private String title; @ElementCollection(targetClass=String....
1

votes
0

answer
295

views

Sphinx in Docker: Lost connection to MySQL server at 'reading initial communication packet', system error: 0

I have trouble with connection to Sphinx in Docker from outside. In docker container connection works fine: [email protected]:/app# mysql -h127.0.0.1 -P 9306 Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 Server version: 2.3.2-id64-beta (4409612) Copyright (c...
1

votes
0

answer
51

views

TTS Utteranceprogresslistener does not work correctly

My app use the accessibility (TalkBack) and android TTS. I use TTS to read the TextView and use the callback methods to go to a new ViewPager page. public class Player extends UtteranceProgressListener implements TextToSpeech.OnInitListener{ public void onInit(int i) {} @Override public void onStart...
Andrey Cherkasov
1

votes
1

answer
10.2k

views

Measure in Power BI using if statements

I want to create a the following measure using if statement: PRE_MTD_M_visit_cost_v2 = if('table_1'[Source_Type]='Online'; CALCULATE((DIVIDE(21*[MTD_M_visit_cost];7))); 'table_1'[M_visit_cost]) I want to create a measure with a conditional statement if column Source_Type has “Online” then I want...
andrey_t
1

votes
0

answer
247

views

iframe overflow parent div issue (grid-layout)

I have a grid layout with embedded youtube iframes inside. HTML: I wrote styles for iframe to hide black youtube frames at the top and bottom CSS: .container { display: grid; grid-template-columns: 1fr; grid-gap: 100px; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);...
Andrey Tvorch
1

votes
0

answer
124

views

React, Redux. Text translation

I am currently working on React application and I need to implement translation inside of it. https://www.npmjs.com/package/react-redux-i18n I am using this library to achieve the translation. I am also using functional components with compose library, so I need to use Translate component instead o...
Andrey
1

votes
1

answer
65

views

SymPy replace method with Wild does not correctly identify the exponent

I use SymPy for recognition and replacement of pattern, and it worked great. For example: import sympy as sym mu = sym.symbols('mu') a=sym.Wild('a') b=sym.Wild('b') c=sym.Wild('c') and now I1=36*sym.exp(12)*mu**2 I1.replace(c*sym.exp(b)*mu**a,a,exact=True) returns 2. But when I tried to recognize si...
Andrey Barilov
1

votes
0

answer
52

views

Problems with pagination Rails

When I try to go to the next page, it redirects to board first page. This problem has appeared after adding sort and search. Maybe this is something wrong with routes. BoardController class BoardController < ApplicationController def index if params[:set_locale] redirect_to board_url(locale: params...
Andrey Anischik
1

votes
0

answer
98

views

How to get the ProcessThread ID from the currently executing Thread object?

I read the CLR via C# book by Jeffrey Richter. Right now I read the chapter about threads. Author writes that a threat in CLR exactly matches to thread in Windows OS. Therefore it is interesting for me how to get the real id of Thread instance ProcessThread class instance contains Id property. It is...
Andrey Bushman
1

votes
0

answer
309

views

How to export and import a database for SQL Server 2017 on Linux?

Linux Mint 18.3 x64 Microsoft SQL Server 2017 Developer Edition (64-bit) on Linux Microsoft documentation contains the related info for SQL Server installed on Windows, but my SQL Server 2017 instance is installed on Linux. How to export and import a database for SQL Server 2017 on Linux? Is it poss...
Andrey Bushman

View additional