Categories
Mastering Development

Multiple Async Execution NodeJS

I have updated the code snippet per suggestion: const fs = require(‘fs’); const replaceExt = require(‘replace-ext’); function newFile() { const directoryFile = fs.readdirSync(‘./zipped’).toString(); const direArray = directoryFile.split(‘,’); console.log(direArray); return Promise.resolve(direArray); //console.log(typeof direArray); //console.log(directoryFile); } function dirArr(direArray) { direArray.forEach((directoryFile) => { fs.rename(‘./zipped/’ + directoryFile, replaceExt(‘./zipped/’ + directoryFile, ‘.zip’), function (err) { if (err) throw err; console.log(directoryFile) […]

Categories
Mastering Development

MySQL insert into apparently not executing using an HTML form, PHP, and MySQL

I am a beginner “programmer” so please excuse my ignorance. I am using a prepared statement in the interest of security. The else clause is echoed instead of the INSERT INTO statement executing. I am passing a hidden value from the hmtl form: <input type=”hidden” value=”EVS1″ name=”CustomerCode” /> <?php include (‘../etc/mysql_connect.php’); if(isset($_POST[‘submit’])) { $FirstName= trim( […]

Categories
Mastering Development

Missing and inaccurate payload in Rails with ActiveModel and Forms

I have a model for Organisation like class Organisation include ActiveModel::Model attr_accessor :orguid, :title, :firstname, :lastname, :role, :telephone, :extension, :email, :name, :branch, :address1, :address2, :address3, :city, :state, :country, :zip end In my controller I have the following actions: # frozen_string_literal: true require ‘cgi’ require ‘json’ class OrganisationsController < ApplicationController include Secured before_action :set_api, only: %i[dashboard […]

Categories
Development

Nested decode in where clause

I have a cursor that fetches address for the id passed, based on the latest activity date. CURSOR get_address_upd_c ( id t1.id%TYPE ) IS SELECT street_line1, street_line2, city, stat_code, zip, activity_date, atyp_code FROM addr WHERE addr_im = ‘1’ AND status_ind IS NULL AND from_date < SYSDATE AND DECODE (TO_DATE, NULL, SYSDATE, TO_DATE) >= SYSDATE ORDER […]

Categories
Development User Help

GPG on Mac freezes when asking for my passphrase

When I try to decrypt a file using gpg, gpg just freezes after asking for my passphrase. $ gpg foo.asc You need a passphrase to unlock the secret key for user: “Edward A. Falk <falk@efalk.org>” 1024-bit ELG key, ID 07D99B37, created 2005-11-28 (main key ID 6F064DF1) hunter2 wtf? ^C gpg: signal Interrupt caught … exiting […]

Categories
Development

if i upload more than 60mb file should move folder but not insert why?

$errors = array(); $file_name=$_FILES[“file”][“name”]; $file_size=$_FILES[“file”][“size”]; $temp_name=$_FILES[“file”][“tmp_name”]; $file_type=$_FILES[“file”][“type”]; $target_path=”uploads/”; $file_ext=@end((explode(‘.’,isset($file_name)))); $expensions=array(“jpeg”,”jpg”,”png”,”pdf”,”zip”,”docx”,”txt”,”doc”,”csv”); if(in_array($file_ext,$expensions)=== false) { $errors[]=”Choose Files”; } if($file_size > 2147483648 ) { $errors[]=’File Size should be less than 1GB’; } move_uploaded_file($temp_name,$target_path.$file_name); if($file_name!=”) { $add_query=”INSERT INTO files(file_name,file_status)VALUES(‘$file_name’,’0′)”; $res=mysqli_query($connection,$add_query); } This is my code for file upload. i use 40 mb file to be uploaded but more than […]

Categories
Development

Python – make_archive zip in multiprocess pool not working properly

I want to create a zip archive from multiple processes at the same time. When I’ve used pool from multiprocessing. Some of zip archive have not been created. It seems that the close method do not wait for processes to end Below the process launcher: import os import sys import json from multiprocessing import Pool […]

Categories
Development

How to connect to yugabyte db using LibPQ in julia?

I am trying to generate insert load for yugastore.users table of yugabyte db using the following scrpt. I am able to successfully connect and execute on built in postgresql server but couldn’t connect to yugabyte db from client using LibPQ in julia. Code: using LibPQ, DataStreams, DataFrames, Dates, Random; global fnames = [“Oliver”, “Jake”, “Noah”, […]

Categories
Development

Snakemake: HISAT2index buind and alignment using touch

Following my previous question:Snakemake: HISAT2 alignment of many RNAseq reads against many genomes UPDATED. I wanted to run the hisat2 alignment using touch in snakemake. I have several genome files with suffix .1.ht2l to .8.ht2l bob.1.ht2l … bob.8.ht2l steve.1.ht2l … steve.8.ht2l and sereval RNAseq samples flower_kevin_1.fastq.gz flower_kevin_2.fastq.gz flower_daniel_1.fastq.gz flower_daniel_2.fastq.gz I need to align all rnaseq […]

Categories
Development User Help

“Smart” fast compression for archiving mixed content?

I would like to backup a computer folder quickly to an archive format (e.g. tar, zip, 7z, gz, etc.). The folder contains many files: Some are text files that can achieve a good compression ratio. For example, I know there’s one folder consisting of large plain CSV/XML files that can be compressed from more than […]