Categories
Development Linux Ubuntu

wget downloading speed gradually slows down

Today I attempted downloading a file using $ wget -P some_directory URL. The first few minutes of downloading went smoothly, downloading 500KBPS but later, its speed gradually decreased, reaching 50KBPS, and remained at it for the next 30 minutes. I couldn’t endure it anymore, so I tried restarting the process. $ ctrl+c $ wget -c […]

Categories
Development Linux Ubuntu

Rclone Failed to sync: googleapi: Error 403: We’re sorry, but this service is not available in your location, forbidden

I want to backup my files into google drive using rclone by this command: sudo rclone sync “/media/so/ACAC8B5FAC8B2346/Company Informations/مدارک شرکت GSH/اداری (copy)” gsh:Company_Informations/office_files –checkers 3 –log-file /home/so/Desktop/trash/rclone_sync.log -v –transfers 3 So i get this error: Failed to sync: googleapi: Error 403: We’re sorry, but this service is not available in your location, forbidden so entire […]

Categories
Development

Scipy.detrend: Function changes range of values

I am trying to detrend this one dimensional array: array([13.64352283, 13.48914862, 13.00767009, 13.35416524, 13.60143818, 13.40895156, 13.48349417, 13.65703125, 13.4959721 , 13.28891263, 12.97999066, 13.01112397, 12.79519705, 13.32030445, 13.19949068, 12.88691975, 13.32079707]) The function runs without errors but changes the range of values from ~[12,14] to ~[-0.4,0.4]. I believe it is due to the small std dev of the values […]

Categories
Development

Given n integer a1, a2, …, an and k. How many ways to choose k consecutive elements that those elements can construct a triangle? [closed]

Consecutive elements can construct a triangle if they can be divided into 3 sets as 3 edges (sum of elements in a set is the weight of 1 edge). (n <= 10^5, 0 <= a[i] <= 10^9, each element is distinct). For example: n = 6, k = 3 a = [1, 3, 4, 2, […]

Categories
Development

Using AWS AppSync (with amplify), how does one allow authenticated users read-only access, but only allow mutations for object owners?

I’m using Cognito User Pools as the default authentication method. I’m also using iam for my lambda backend. I’m using an aws appsync client in the lambda function for some custom resolvers. let’s assume I have a User object type that fundamentally looks like this: type User { id: ID! displayName: String! } What I […]

Categories
Development

Add sequence lengths to headers in a fasta file

I have a multifasta file and would like to add the sequence lengths to the headers by keeping the sequences. >Seq1 MADKLTRIAIVNHDKCKPKKCRQECKKSCPVVRMGKLCIEVTPQSKIAWISETLCIGCGI KILAGKQKPNLGKYDDPPDWQEILTYFRGSELQNYFTKILEDDLKAIIKPQYVDQIPKAA KGTVGSILDRKDETKTQAIVCQQLDLTHLKERNVEDLSGGELQRFACAVVCIQK >Seq2 MADKLTRIAIVNHDKCKPKKCRQECKKSCPVVRMGKLCIEVTSQSKIAWISETLCIGCGI CIKKCPFGALSIVNLPSNLEKETTHRYCANAFKLHRLPIPRPGEVLGLVGTNGIGKSTAL KGTVGSILDRKDETKTQTVVCQQLDLTHLKERNVEDLSGGELQRFACAVVCIQKADIFMF DEPSSYLDVKQRLKAAITIRSLINPDRYIIV My desired output >Seq1_174 MADKLTRIAIVNHDKCKPKKCRQECKKSCPVVRMGKLCIEVTPQSKIAWISETLCIGCGI KILAGKQKPNLGKYDDPPDWQEILTYFRGSELQNYFTKILEDDLKAIIKPQYVDQIPKAA KGTVGSILDRKDETKTQAIVCQQLDLTHLKERNVEDLSGGELQRFACAVVCIQK >Seq2_211 MADKLTRIAIVNHDKCKPKKCRQECKKSCPVVRMGKLCIEVTSQSKIAWISETLCIGCGI CIKKCPFGALSIVNLPSNLEKETTHRYCANAFKLHRLPIPRPGEVLGLVGTNGIGKSTAL KGTVGSILDRKDETKTQTVVCQQLDLTHLKERNVEDLSGGELQRFACAVVCIQKADIFMF DEPSSYLDVKQRLKAAITIRSLINPDRYIIV I tried to use this command awk ‘/^>/{if (l!=””) print l; print; l=0; next}{l+=length($0)}END{print […]

Categories
Development

How to expand only leaf nodes with property red_color = true of jtree

I have a jtree with green leaf nodes and reds leaf nodes by implementing a custom CellRenderer. i am doing this to expand the entire jtree: expAll.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { for (int i = 0; i < jTree1.getRowCount(); i++) { jTree1.expandRow(i); } } }); but How to create a action […]

Categories
Development

error with returning a value from a method in java

hello in the code below I am sorting (sort method) a small array to find the largest number. I then print the answer in the (display method). But to extend my knowledge I want to mass the max value back to them main in a return statement and then print from there….simply to learn how […]