Wednesday, October 14, 2020

Multiple Twitter accounts with the same Gmail address

 



Multiple Twitter accounts with the same Gmail address

There is a nice trick if you want to have multiple Twitter accounts and keep the same Gmail address, just add a dot in the address.

For example, considering your Gmail address is firstnamelastname@gmail.com, you can use many combinations:
  • firstname.lastname@gmail.com
  • first.namelastname@gmail.com
  • firstnamelast.name@gmail.com
Gmail just ignore the dots and it will forward the Twitter emails to your original email address firstnamelastname@gmail.com.

I hope this trick helps you!



Friday, October 9, 2020

Artificial Intelligence - Machine Learning - Spoken Digits Recognition

 


Spoken Digits Recognition

University of Toronto School of Continuing Studies

Term project for Machine Learning course

Group: Ankur Tyagi, Haitham Alamri, Rodolfo de Andrade Vasconcelos

Professor: Matthew MacDonald


Github:

https://github.com/ravasconcelos/spoken-digits-recognition 

Presentation

IMAGE ALT TEXT HERE

Business Problem

  • Inference of the digits as said by users on phone
  • Biometric authentication using speech dataset

Prerequisites

  1. if running locally, have Python 3.7 and Junyper installed

How to run

Local Jupyter Notebook

  1. clone this repository
  2. ensure you have the correct version of the Python libraries stated in the file src/lib_version Example:
python -m pip install -U <library>==<version>
  1. Run junyper nootebook
junyper notebook
  1. Open src/spoken-digits-recognition.ipynb or src/speaker-recognition.ipynb
  2. Run all Cells

Colab Jupyter Notebook

  1. Open
  2. Upload the CSV files
  3. Run all Cells

Contents

  • README.md: This file, explaining the project

  • UofT_Final_project.pdf: Project presentation in PDF format

  • UofT_Final_project.pptx: Project presentation in Power Point format

  • spoken_digits_comparison.pdf: Recordings comparisson for each digit for the six speakers

  • data/*: wav files with English spoken digits from 0 to 9

  • src/lib_version: Python libraries version used in this project

  • src/more_test.csv: Features of the files in data/recordings/moreSpeakersTest

  • src/more_train.csv: Features of the files in data/recordings/moreSpeakersTrain

  • src/speaker-recognition.ipynb: Junyper Notebook with Keras Neural Network model able to recognize the speaker of English digits (Jackson, Nicolas, Theo, Ankur, Caroline and Rodolfo)

  • src/speaker-recognition.pdf: PDF version of an execution of speaker-recognition.ipynb

  • src/spoken-digits-recognition.ipynb: Junyper Notebook with Neural Network model able to recognize English spoken digits

  • src/spoken-digits-recognition.pdf: PDF version of an execution of spoken-digits-recognition

  • src/test.csv: Features of the files in data/recordings/test

  • src/train.csv: Features of the files in data/recordings/train

Recording Data

The files stored in data/recordings/test and data/recordings/train were downloaded from FSDD [Ref 1 and 2]:

Ankur, Caroline and Rodolfo provided the recordings stored in data/recordings/moreSpeakersTest and data/recordings/moreSpeakersTrain

References

  1. https://github.com/Jakobovski/free-spoken-digit-dataset
  2. https://github.com/moebg/spoken-digit-recognition

Wednesday, October 7, 2020

Error installing Azure PowerShell - Nuget not installed

 If you get the error below when installing Azure PowerShell, see below how to fix it.


PS C:\windows\system32> Install-Module -Name Az -AllowClobber -SkipPublisherCheck


NuGet provider is required to continue

PowerShellGet requires NuGet provider version '2.8.5.201' or newer to interact with NuGet-based repositories. The NuGet

 provider must be available in 'C:\Program Files\PackageManagement\ProviderAssemblies' or

'C:\Users\XXXXXXXXX\AppData\Local\PackageManagement\ProviderAssemblies'. You can also install the NuGet provider by

 running 'Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force'. Do you want PowerShellGet to install

and import the NuGet provider now?

[Y] Yes  [N] No  [S] Suspend  [?] Help (default is "Y"): Y

WARNING: Unable to download from URI 'https://go.microsoft.com/fwlink/?LinkID=627338&clcid=0x409' to ''.

WARNING: Unable to download the list of available providers. Check your internet connection.

PackageManagement\Install-PackageProvider : No match was found for the specified search criteria for the provider

'NuGet'. The package provider requires 'PackageManagement' and 'Provider' tags. Please check if the specified package

has the tags.

At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:7468 char:21

+ ...     $null = PackageManagement\Install-PackageProvider -Name $script:N ...

+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : InvalidArgument: (Microsoft.Power...PackageProvider:InstallPackageProvider) [Install-Pac

   kageProvider], Exception

    + FullyQualifiedErrorId : NoMatchFoundForProvider,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackagePro

   vider


PackageManagement\Import-PackageProvider : No match was found for the specified search criteria and provider name

'NuGet'. Try 'Get-PackageProvider -ListAvailable' to see if the provider exists on the system.

At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:7474 char:21

+ ...     $null = PackageManagement\Import-PackageProvider -Name $script:Nu ...

+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : InvalidData: (NuGet:String) [Import-PackageProvider], Exception

    + FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.ImportPackageProv

   ider


WARNING: Unable to download from URI 'https://go.microsoft.com/fwlink/?LinkID=627338&clcid=0x409' to ''.

WARNING: Unable to download the list of available providers. Check your internet connection.

PackageManagement\Get-PackageProvider : Unable to find package provider 'NuGet'. It may not be imported yet. Try

'Get-PackageProvider -ListAvailable'.

At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:7478 char:30

+ ... tProvider = PackageManagement\Get-PackageProvider -Name $script:NuGet ...

+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : ObjectNotFound: (Microsoft.Power...PackageProvider:GetPackageProvider) [Get-PackageProvi

   der], Exception

    + FullyQualifiedErrorId : UnknownProviderFromActivatedList,Microsoft.PowerShell.PackageManagement.Cmdlets.GetPacka

   geProvider


Install-Module : NuGet provider is required to interact with NuGet-based repositories. Please ensure that '2.8.5.201'

or newer version of NuGet provider is installed.

At line:1 char:1

+ Install-Module -Name Az -AllowClobber -SkipPublisherCheck

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : InvalidOperation: (:) [Install-Module], InvalidOperationException

    + FullyQualifiedErrorId : CouldNotInstallNuGetProvider,Install-Module


Ensure you are running Windows PowerShell as Administrator and try the command below:
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Let me know if it fixed the Azure PowerShell for you as well.

Source: https://stackoverflow.com/questions/16657778/install-nuget-via-powershell-script


Sunday, October 4, 2020

Step-by-Step Tutorial: Springboot Hello Word application with Java 8 and Lombok

Step-by-Step Tutorial: Springboot Hello Word application with Java 8 and Lombok

Objective

In this tutorial, we will build a Springboot application with Java 8 and Lombok. 

Pre-requisites:

  • Java JDK 8
  • Maven
  • IntelliJ IDEA

Github:

The source code can be found at https://github.com/ravasconcelos/springboot-tutorials/tree/main/1-springboot-hello-world .


Hands-on:

Create the project:

Start IntelliJ IDEA and click in Create New Project.



Project settings:

Preferably, select a JDK 8 as "Project SDK". In my case, I am using a JDK 11.
Choose the default starter service URL.



Enter the following information:
  • Group: com.ravasconcelos
  • Artifact: hello-world
  • Type: Maven Project
  • Language: Java
  • Packaging: Jar
  • Java Version: 8
  • Name: hello-world
  • Description: A Hello World REST Service using Java 8 and Lombok.





Select the libraries you want to be included in the project.

From "Developer Tools", we will choose: 
  • Spring Boot DevTools
  • Lombok
  • Spring Configuration Processor



From "Web", we will choose: 
  • Spring Web Services



Set the Project name and the location. Click in the Finish button.


Project Created:

You will have the Spring Application class created for you.

After the project is created it will look like this.



Creating the Controller and the Model:

Let's first create a package for the controller class.

Right-click the com.ravasconcelos.helloworld package. Select "New", then "Package".

Enter the name "controllers".


Create the controller class right-clicking the "controllers" package.

Select "New" then "Java Class".

Enter HelloWorldController as the class name.



The created class will look like this.




Follow the same steps and create a model class.

Name the package as "model" and the class name as "HelloWorldModel".




Add the Lombok annotations Data and Builder.

Create the fields:
  • greeting
  • firstName
  • lastName
It should look like this.



Let's go back to our controller class and add the RestController annotation.

Create the "getGreeting" method and annotate it with "GetMapping".

Return the model class populated with the input parameter and "Hello" as the "greeting".



Running:

Believe it or not we are done.

We can now run the server clicking in the play icon at the top right.



If you see the message log below, everything worked well and you can test it, as the next sub-chapter.


Testing:

Using Postman, curl or your HTTP Client of choice you can send a GET request passing the firstName and the lastName as query parameters.

The response is the JSON payload we have created in the model class. 



Conclusion:

Using Springboot you can develop prototypes and real REST-based applications pretty quickly leveraging the Spring framework libraries.

If you found this tutorial useful, please write a comment.

If some of the steps have not worked for you, let me know and I'll do my best to help you.

Wednesday, March 11, 2020

How to delete/drop an user schema in Oracle

alter session set "_oracle_script"=true;

drop user <USER_SCHEMA> cascade;

Example:
drop user myUserSchema cascade;

Tuesday, February 25, 2020

POSTMAN - How to save a response field as a variable

In the "Tests" tab, use the code below:

var jsonData = JSON.parse(responseBody);
postman.setEnvironmentVariable("myId", jsonData.id);

It will save the id field in the JSON response payload to the variable myId. The variable can be used in another request this way: {{myId}}

Friday, February 21, 2020

POSTMAN - How to use random number in the request

Just use the variable randomInt, for example:
In the request:
{
    "id": "{{$randomInt}}"
}

In the pre-request Script:
postman.setEnvironmentVariable("myId", "MY_ID_"+ _.random(1,99999));
console.log(postman.getEnvironmentVariable("myId"));
Read this link for more information: https://learning.postman.com/docs/postman/variables-and-environments/variables/