Categories
Mastering Development

NodeJs encrypt using pbkdf2Sync and decrypt in java

I encrypt some data in NodeJs using below method. It works fine on Nodejs server to encrypt and decrypt. Input for encryption = “SIYdcYSyiWY5XUqYMrfv31sPF8DSojs1ikghMs4R” Encrypted Output in NodeJS = “IRhqmwhlFUxS1Zg+Qyr2ykSkAA1cQ5gVts7RIZoULCbYMS/DVsdfTyanGAAu4HkuAZv4ynk+VBPZ6vaTH5xTONfuVRlUavF9X//12v5et5em1ItPYdlOWkYo5IkodpAQvm5Yrm4F5xaRxRU3+TAZzOQm/3YQIlz74X+3V3/aV/K4qFebSLUMZJM9glPWo4O+ISDf76ztiN2ynLyvsivSU/qUuQEtPVEK” encryptAES = ((text) => { // random initialization vector const iv = crypto.randomBytes(16); const salt = crypto.randomBytes(64); var masterKey = crypto.randomBytes(32); const key = crypto.pbkdf2Sync(masterKey, […]

Categories
Mastering Development

how to fix list indices must be integers or slices, not str

after 2 previous questions still did not fix the problem. question 1 question 2 I have a python script that clean text before it goes to analysis text part. so i have some functions that clean the text and make POS tags in order to split text and tokenize it. I need to return the […]

Categories
Development Linux Ubuntu

mpif.h not found error [install openmpi]

I was trying to install openpi on ubuntu. I have an Ubuntu 18.04.4 LTS (64 bit) desktop. I installed openmpi using sudo apt-get install openmpi-bin openmpi-common openmpi-doc libopenmpi2 libopenmpi-dev openssh-client openssh-server Then, in the .bashrc, I have added the following two lines: echo export PATH=”$PATH:/home/$USER/.openmpi/bin” >> /home/$USER/.bashrc echo export LD_LIBRARY_PATH=”$LD_LIBRARY_PATH:/home/$USER/.openmpi/lib/” >> /home/$USER/.bashrc After that, I […]

Categories
Development

convert right side of join of one to many tables into an array in knex

Please help I have table ideas that look like this ideas = { id, title, abstract, background, classification, technicalfeild, tag, user_id, } and a table idea-images that look like this idea-images = { id, idea_id, banner, image_details } they have a one to many relations. I need to select all the ideas that have public […]

Categories
Development

Trying to detect Bluetooth devices connection change in Android

I’m trying to detect BT device connection changes in my app to automatically start / pause playback This works fine, except that the connection event is received with about a 20 to 30s delay. The disconnection has a small delay of 2 to 3s, but as I’m also listening to ACTION_AUDIO_BECOMING_NOISY, then I can pause […]

Categories
Development

Django Rest – ManyToManyField with SlugRelatedField Data Is Not Being Created

I have the following structure in my database: { “name”: “sum”, “formula”: “a+b”, “date”: “2020-01-17T19:02:24.143000Z”, “tags”: [ “sum”, “test” ], “latex”: “a+b” } “tags” is a field in the Table Calculator with ManyToManyField relationship. I used an intermediate model (TagLink) that specifies the foreign keys to the calculator and tag model that are involved in […]

Categories
Development

Can semantic-release be configured to back merge to develop after release

I use a slightly modified version of the git flow branching model in a project of mine. I have GitLab CI configured with semantic-release to update the project changelog and versionbump/tag the master branch every time changes are merged into it. I follow standard git flow practise on my develop branch and when I’m ready […]

Categories
Development

Product is listed on database is not listed in Admin > Products List

As an Opencart newbie, I’m adding the product with a static array just for testing the addProduct function but I could not get it to work. Static array: $data[‘pid’] = $this->model_catalog_product->addProduct([ ‘product_description’ => [[‘name’ => ‘bakbuişte’, ‘description’ => ”, ‘meta_title’ => ‘metaraba’, ‘meta_description’ => ”, ‘meta_keyword’ => ”, ‘tag’ => ”]], ‘model’ => ‘amabigun’, ‘sku’ […]

Categories
Development

Problems with multiple variable socket.io emits

So I followed a couple questions about a similar question, however, the questions and their appropriate solutions were from multiple years ago, and since then socket.io has seen several updates which make their code unusable. I’ve tried adapting it to fit v2.3.0 but it does not work. I’m trying to make a chat application which […]

Categories
Development

Extract Universal Dependencies using Stanford Parser in Python

Edit: Solution : In order to extract relative clauses, I use another parser, namely CoreNLPParser() which gives me a nltk tree. From there, I just need to extract the correct label, join the leaves and voilà, I have the relative clause. I want to extract relative clauses from sentences and want to use Stanford Parser […]