HOME BLOG

Yinkos Price Comparison 2.0 is launched

Posted on: November 26th, 2020 by Olu No Comments

Hi folks,

It’s a pleasure for us to announce an update to Yinkos Price Comparison App.

Yinkos Price Comparison 2.0 brings a few new features as follows:

  • We have added support for over 1,500 more devices.
  • Also, the design of the app was improved for display on tablets.
  • Other minor bug fixes and improvements were made as well.

This application allows you compare grocery prices easily between major stores in the UK.

Get it from Google Play today!

Let us know if you have any feedback or comments by visiting our website.

Yinkos Price Comparison is Launched!

Posted on: November 22nd, 2020 by Olu No Comments

Hi folks,

It’s a pleasure for us to announce the release of Yinkos Price Comparison App.

This application allows you compare grocery prices easily between major stores in the UK.

Initially we support Tesco and Sainsburys but we plan to quickly add support for other popular stores.

Get it from Google Play today!

Let us know if you have any feedback or comments by visiting our website.

How to inspect an Android app SQLite databases

Posted on: October 30th, 2020 by Olu No Comments

Hi folks,

In this post I talk about how to view an Android app’s SQLite database. You may need to do this for debugging purpose if develoing and Android app that stores data.

You can do this using Android Studio.

Go to View -> Tool Windows -> Device File Explorer.

In the Device File Explorer pane, navigate to dat/data/<your.app.package.name>/databases.

In here you should see three files for your database: one for the database, one for the -shm file and another for the -wal file. So if your database is called somedb in code, you would see files somedb-db, somedb-db-shm, somedb-db-wal. Cmd+click on all three files.

Then right-click and click Save As.

Select where to save them on your computer.

Once saved, you can open the main database on your computer using your favourite SQLite browser e.g. DB Browser for SQLite.

That’s all for now.

Happy software development.

 

 

How to import SQLite tables quickly

Posted on: October 24th, 2020 by Olu No Comments

Hi folks,

In this post I’ll sharemy recent experience with importing a large SQLite table. By large, I mean a table with very many rows.

Usually I use DB Browser for SQLite to manage the database.

So at first I thought, maybe I should use the export and import functionality from DB Browser for SQLite.

I exported to an SQL file, made my changes to the dump, and then tried importing that dump to a new database using DB Browser for SQLite.

Lo and behold, it was super duper slow. On realizing it would take forever, I decided there must be a faster way.

More research showed that there’s an SQLite command-line tool that can carry out imports. I learnt that it may be a good idea to export to CSV format, then import it using the SQLite command-line tool. To export to csv, use the following command:

 

sqlite3 -header -csv your_db.db "select * from your_table;" > your_csv_file.csv

 

To import a csv file use the following commands:

 

sqlite3 your_db_file.db
.mode csv
.import /path/to/your/csv_file.csv your_table_name

 

So I tried it. Boy, was it much faster.

So, the takeaway is that if you must export and later import large SQLite table, first export the database to a CSV file, and use the SQLite command-line utility to import the file(s) into a new database.

That’s all for now. Happy software development.

How to resolve error ‘The item you were attempting to purchase could not be found’ when testing subscriptions using Google Play Billing library

Posted on: October 14th, 2020 by Olu No Comments

Hi foliks,

Here I share a simple solution to a issue found when testing subscriptions with Google Play Billing library:

The error message was as follows:

The item you were attempting to purchase could not be found.

The root cause is that that the test user had not been authorized to test the app.

Solution:

Make sure you send the opt-in url to test users and that the users opt in to it.

How to create table literals in Oracle

Posted on: October 9th, 2020 by Olu No Comments

Hi folks,

In this post I talk about how to create literal tables in Oracle.

You may have a list of values and want to run an Oracle query against those values.

A convenient way to do this is to create a literal table in an Oracle SQL using those values.

 

Single-column

If you want to create a single-column literal table,

you can use either dbms_debug_vc2coll or sys.ODCIVarchar2List

e.g.

select * from table (sys.ODCIVarchar2List('AAA', 'BBB', 'CCC'));

This will return an inline table with a single column named COLUMN_VALUE and rows with values AAA, BBB and CCC.

i.e.

COLUMN_VALUE
==
AAA
BBB
CCC

Second example

select column_value from table(sys.dbms_debug_vc2coll(‘AAA’, ‘BBB’, ‘CCC’))

 

Multiple colums

If you want to generate a literal table with two columns, you can use a query like:

select objectschema m, objectname n
from
table(sys.ODCIObjectList(
sys.odciobject('APPLE', 'FRUIT'),
sys.odciobject('CARROT', 'VEGGIE')
));

For more tahan 2 columns, you can use a query like:

create type t as object (a varchar2(10), b varchar2(10), c number);
create type tt as table of t;

select * from table( tt (
    t('APPLE', 'FRUIT', 1),
    t('APPLE', 'FRUIT', 1122), 
    t('CARROT', 'VEGGIE', 3),
    t('PEACH', 'FRUIT', 104),
    t('CUCUMBER', 'VEGGIE', 5),
    t('ORANGE', 'FRUIT', 6) ) )

That’s all for now. Happy database querying.

 

Sources

Oracle SQL Tip: Using dbms_debug_vc2coll and sys.ODCIVarchar2List. https://training.fusionapplied.com/2017/08/23/oracle-sql-tip-using-dbms_debug_vc2coll-and-sys-odcivarchar2list/

Is there a non-ugly way to use a multi-column, multi-row table literal in an Oracle 11g query? https://stackoverflow.com/questions/29903397/is-there-a-non-ugly-way-to-use-a-multi-column-multi-row-table-literal-in-an-ora/29904128

How to request sensitive details in Python without displaying the input on the screen

Posted on: September 26th, 2020 by Olu No Comments

Hi folks,

Here’s a short code snippet that demonstrates how to request sensitive information from a Python application without displaying the details on screen as the user enters it. The tool to use is a library called getpass as well as the subprocess library. Here it is.

 

import subprocess

info_process = subprocess.run([
'python', '-c', 
"print(import('getpass').getpass('Enter the details here'))"
], stdout=subprocess.PIPE)

details = info_process.stdout.decode('utf-8').strip()

That’s all for now. Happy coding

How to fix issue of “’” showing on page instead of “ ‘ ” in gVim in Windows

Posted on: September 26th, 2020 by Olu No Comments

Hi folks,

Recently I experienced an issue where when I opened a file using my favourite editor gVim in Windows and found to my utter bewilderment that the “’” character was showing instead of “ ‘ ”. I’ll quickly talk about how to fix such problem.

First, what’s the cause? The cause is that the editor isn’t using UTF-8 encoding. It might be using ISO-8859-1/Windows-1252. So, to fix it, update gVim to use UTF-8. Here’s how to do that.

Open your _vimrc file and add the following lines

 

set encoding=utf-8
set fileencoding=utf-8

Save and close the file. That’s it. Your apostrophe characters should now display correctly. Happy editing.

Sources:

“’” showing on page instead of “ ‘ ”. stackoverflow. https://stackoverflow.com/questions/2477452/%C3%A2%E2%82%AC-showing-on-page-instead-of

Set encoding and fileencoding to utf-8 in Vim. stackoverflow. https://stackoverflow.com/questions/16507777/set-encoding-and-fileencoding-to-utf-8-in-vim

SSH Login without password from Windows to Linux

Posted on: September 20th, 2020 by Olu No Comments

Your aim

You want to use Linux and OpenSSH to automate your tasks. Therefore you need an automatic login from Windows host A / user a to Linux Host B / user b. You don’t want to enter any passwords, because you want to call ssh from a within a shell script.

How to do it

First log in on A as user a and generate a pair of authentication keys. Do this using Git Bash. Do not enter a passphrase:

a@A:~> ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/a/.ssh/id_rsa): 
Created directory '/home/a/.ssh'.
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /home/a/.ssh/id_rsa.
Your public key has been saved in /home/a/.ssh/id_rsa.pub.
The key fingerprint is:
3e:4f:05:79:3a:9f:96:7c:3b:ad:e9:58:37:bc:37:e4 a@A

Now use ssh to create a directory ~/.ssh as user b on B. (The directory may already exist, which is fine):

a@A:~> ssh b@B mkdir -p .ssh
b@B's password: 

Finally append a’s new public key to b@B:.ssh/authorized_keys and enter b’s password one last time:

a@A:~> cat .ssh/id_rsa.pub | ssh b@B 'cat >> .ssh/authorized_keys'
b@B's password: 

From now on you can log into B as b from A as a without password:

a@A:~> ssh b@B

A note from one of our readers: Depending on your version of SSH you might also have to do the following changes:

  • Put the public key in .ssh/authorized_keys2
  • Change the permissions of .ssh to 700
  • Change the permissions of .ssh/authorized_keys2 to 640

 

Source:

 

SSH login without password. http://linuxproblem.org/art_9.html

How to add rsync to Git Bash in Windows 10

Posted on: September 20th, 2020 by Olu No Comments

Download the package: http://www2.futureware.at/~nickoe/msys2-mirror/msys/x86_64/rsync-3.1.2-2-x86_64.pkg.tar.xz

 

Launch Git Bash and change to the download location.

 

Extract the archive using coommand:

 

tar -xf rsync-3.1.2-2-x86_64.pkg.tar.xz

 

You will get a folder usr.

 

Move usr/bin/rsync.exe to C:\Program Files\Git\usr\bin

 

Source:

How to Add rsync to Git Bash for Windows 10. https://gist.github.com/hisplan/ee54e48f17b92c6609ac16f83073dde6