Skip to content

Count the semiprime numbers in the given range [a..b]

I am solving Codility problem CountSemiprimes: Count the semiprime numbers in the given range [a..b]. Task description A prime is a positive integer X that has exactly two distinct divisors: 1 and X. The first few prime integers are 2, 3, 5, 7, 11 and 13. A semiprime is a natural number that is the product of…

How to execute shell command using SFTP channel in JSch?

I am trying to list all *.xml files in the directory. I do a cd first and then was trying to execute: But not sure how exactly to do it. There were some example around the Exec channel but is there a way to do the find with SFTP itself? Answer Your requirements are conflicting. You cannot execute shell comman…

SQLite: select from column by month

I am trying to sum a tablecolumn on basis of month but I got the following exception: the function the table In the debugger the cursor contains one item but when calling getInt(..) the app crashes Answer The column created for this result: is not called Total. Change the sql statement to this: This way you g…