Thursday, March 5, 2020
ReactJS - Hey, don't forget to read the documentation
Good documentation helps to understand the concepts faster. If you are new to ReactJS, this is one of the best pages to begin learning: https://reactjs.org/docs/getting-started.html
Sunday, February 16, 2020
It's all about Spring Boot
Building a Spring Boot application with Rest API
- This link has the simplest Rest API building example: https://spring.io/guides/gs/rest-service/
- Also check out the links at the end of the page of https://spring.io/guides/gs/rest-service/ and you will learn almost everything using Spring Boot.
- Also check this page too: https://spring.io/guides#getting-started-guides
Building a Spring Boot and ReactJS mono-repo application
- Look no further! This link has all listed out all the details: https://github.com/kantega/react-and-spring
Spring Boot application with Postgresql on Heroku
- On Mac, brew install Postgresql
- Some useful commands to work with Postgresql on local:
- By default, Postgresql is already started. If not, use this command to manually start the Postgresqlpg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
- To turn-off Postgresql manually, use this command pg_ctl -D /usr/local/var/postgres stop -s -m fast
- To access Postgres from command prompt: psql postgres -U kad221
- To stop the access to Postgres from command prompt: quit psql CMD+D
- Follow the instructions to set up and push the spring boot application to Heroku: https://devcenter.heroku.com/articles/deploying-spring-boot-apps-to-heroku
- In Heroku dashboard, select the spring boot application that is deployed.
- Go to Resources, click on the Heroku Postgres, click on settings > View Credentials > Copy URI.
- From command prompt: psql <paste the URI here> and hit enter.
- In application.properties, add spring.datasource.url: <paste URI here>
- From command prompt, run ./mvnw spring-boot:run, and you are good to go with the development.
Monday, February 10, 2020
Search is over to find spring-and-react application build guidelines
It took some time to find this, but found it eventually :)
Building a spring boot application with ReactJS front end: https://github.com/kantega/react-and-spring
Building a spring boot application with ReactJS front end: https://github.com/kantega/react-and-spring
Sunday, February 9, 2020
A nice online guid generator
I like this online guid generator: https://www.guidgenerator.com/online-guid-generator.aspx
Saturday, January 25, 2020
SDTM in a nutshell
Beautifully explained the practical methods for creating CDISC SDTM tables:
https://support.sas.com/resources/papers/proceedings/pdfs/sgf2008/207-2008.pdf
Golden words: Analyses are "one proc away" from ADaM data.
Other important SAS related references:
SAS clinical questions and answers: https://tekslate.com/sas-clini cal-interview-questions-and- answers
There is a listing of sample graphs and example code: https://support.sas.com/en/kno wledge-base/graph-samples-gall ery.html
Details of Oncology studies and a relation between SDTM, ADaM and Controlled Terminology: https://www.pharmasug.org/proc eedings/2018/DS/PharmaSUG-2018 -DS06.pdf
Powerpoint slides details on ADaM tables and RECIST 1.1: https://www.cytel.com/hubfs/0- library-0/pdfs/CDISCJourneyonS olidTumorusingRECIST1.1.pdf
Again, it is a listing of sample graphs: http://support.sas.com/sassamp les/graphgallery/PROC_SGPLOT. html
https://www.cdisc.org/system/f iles/all/event/restricted/2018 _US/6B-CDISC-ADaM_Overview_-_ Minjoe.pdf
https://www.cdisc.org/system/f iles/all/event/restricted/2017 _International/INTX17%20Sessio n%203%20Track%20A_Soloff.pdf
https://www.lexjansen.com/phar masug/2018/DS/PharmaSUG-2018- DS24.pdf
https://www.lexjansen.com/phar masug/2010/HW/HW06.pdf
https://www.quantics.co.uk/ blog/an-introduction-to- integrated-summary-of-safety- and-integrated-summary-of- effectiveness-iss-and-ise/
https://blogs.sas.com/content/ iml/2011/09/19/count-the- number-of-missing-values-for- each-variable.html
https://blogs.sas.com/content/ iml/2012/04/02/count-missing- values-in-observations.html
https://journals.lww.com/anest hesia-analgesia/Fulltext/2018/ 09000/Survival_Analysis_and_ Interpretation_of.32.aspx
https://www.lexjansen.com/phar masug-cn/2014/CD/PharmaSUG- China-2014-CD03.pdf
https://www.lexjansen.com/phus e/2018/ds/DS03_ppt.pdf
Graphs from Robert Allison: https://robslink.com/SAS/Home.htm
About ADaM flags: https://www.pharmasug.org/proceedings/2013/PO/PharmaSUG-2013-PO11.pdf
http://www.stattutorials.com/SAS/
Oncology Survival Plot: https://support.sas.com/rnd/datavisualization/papers/Annotate_Your_SGPLOT_Graphs.pdfhttps://support.sas.com/rnd/datavisualization/papers/Annotate_Your_SGPLOT_Graphs.pdf
Survival analysis (Time-to-event analysis) is the process of measuring the length of time to the event. The event could be progress-free survival or overall survival or objective response rate. It may not be possible to measure the length of time for some patients because the patient disappeared or a bus hit him, or the study called off, etc. The missing data related to that patient is called the censored data.
Proc lifetest is useful to get the survival plot in a clinical trial. Also it provides multiple survival plots between two treatments. In the TIME statement, the survival time variable, Days, is crossed with the censoring variable, Status, with the value 0 indicating censoring.
https://support.sas.com/resources/papers/proceedings/pdfs/sgf2008/207-2008.pdf
Golden words: Analyses are "one proc away" from ADaM data.
Other important SAS related references:
SAS clinical questions and answers: https://tekslate.com/sas-clini
There is a listing of sample graphs and example code: https://support.sas.com/en/kno
Details of Oncology studies and a relation between SDTM, ADaM and Controlled Terminology: https://www.pharmasug.org/proc
Powerpoint slides details on ADaM tables and RECIST 1.1: https://www.cytel.com/hubfs/0-
Again, it is a listing of sample graphs: http://support.sas.com/sassamp
https://www.cdisc.org/system/f
https://www.cdisc.org/system/f
https://www.lexjansen.com/phar
https://www.lexjansen.com/phar
https://www.quantics.co.uk/
https://blogs.sas.com/content/
https://blogs.sas.com/content/
https://journals.lww.com/anest
https://www.lexjansen.com/phar
https://www.lexjansen.com/phus
Graphs from Robert Allison: https://robslink.com/SAS/Home.htm
About ADaM flags: https://www.pharmasug.org/proceedings/2013/PO/PharmaSUG-2013-PO11.pdf
http://www.stattutorials.com/SAS/
Oncology Survival Plot: https://support.sas.com/rnd/datavisualization/papers/Annotate_Your_SGPLOT_Graphs.pdfhttps://support.sas.com/rnd/datavisualization/papers/Annotate_Your_SGPLOT_Graphs.pdf
Survival analysis (Time-to-event analysis) is the process of measuring the length of time to the event. The event could be progress-free survival or overall survival or objective response rate. It may not be possible to measure the length of time for some patients because the patient disappeared or a bus hit him, or the study called off, etc. The missing data related to that patient is called the censored data.
Proc lifetest is useful to get the survival plot in a clinical trial. Also it provides multiple survival plots between two treatments. In the TIME statement, the survival time variable, Days, is crossed with the censoring variable, Status, with the value 0 indicating censoring.
The ADSL data structure has one record for one subject and contains subject-level population flags indicating whether subjects are in efficacy, safety, pharmacokinetic, pharmacodynamic, food effect, or dose proportionality analyses. In the Basic Data Structure (BDS) data sets, common record-level analysis flags include: recheck flags, flags for exclusion, baseline flags, early termination identifiers, and treatment-emergent flags.
Thursday, January 16, 2020
Free, free, free ReactJS templates
Isn't it beautiful if you can find some free templates that makes your job simpler to build a ReactJs app?
Here you go: https://colorlib.com/wp/free-react-templates/
Another life saver with the templates: https://bootstrapious.com/p/bootstrap-sidebar (all you got to do is go to demo pages, view source, and customize it to your requirement) %3CmxGraphModel%3E%3Croot%3E%3CmxCell%20id%3D%220%22%2F%3E%3CmxCell%20id%3D%221%22%20parent%3D%220%22%2F%3E%3CmxCell%20id%3D%222%22%20value%3D%22WS%22%20style%3D%22rounded%3D0%3BwhiteSpace%3Dwrap%3Bhtml%3D1%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20x%3D%22849%22%20y%3D%22295%22%20width%3D%2235%22%20height%3D%2230%22%20as%3D%22geometry%22%2F%3E%3C%2FmxCell%3E%3C%2Froot%3E%3C%2FmxGraphModel%3E
Here you go: https://colorlib.com/wp/free-react-templates/
Another life saver with the templates: https://bootstrapious.com/p/bootstrap-sidebar (all you got to do is go to demo pages, view source, and customize it to your requirement) %3CmxGraphModel%3E%3Croot%3E%3CmxCell%20id%3D%220%22%2F%3E%3CmxCell%20id%3D%221%22%20parent%3D%220%22%2F%3E%3CmxCell%20id%3D%222%22%20value%3D%22WS%22%20style%3D%22rounded%3D0%3BwhiteSpace%3Dwrap%3Bhtml%3D1%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20x%3D%22849%22%20y%3D%22295%22%20width%3D%2235%22%20height%3D%2230%22%20as%3D%22geometry%22%2F%3E%3C%2FmxCell%3E%3C%2Froot%3E%3C%2FmxGraphModel%3E
Saturday, January 11, 2020
What to prepare when applying for a JavaScript position?
What to prepare:
- Core JavaScript concepts: 10 things to learn during a weekend
- Building NPM packages, publishing, and importing
- Building an application with an express server
- Two ways of creating a react app: from scratch and from create-react-app
- Build react app with a fake server for API testing
- Git repos and commands
- Responsive web design, (can this make the process simpler: react-responsive-navbar)
- CSS approaches: SCSS files, bootstrap, css modules, media-queries
- ReactJs routing, hooks, using context & HIC, child as a function
- Some examples of Jest unit testing
- Some examples of Ajax call testing
- Feature testing: Selenium, Cypress
- Responsive web design
- A11y
- ESLinting
- Build and deploy process
- CodeSandBox and CodePen
- Workshop
Core JavaScript concepts:
Function objects:
- Functions are function objects. In JavaScript, anything that is not a primitive type ( undefined, null, boolean, number, or string) is an object. Objects in JavaScript are extremely versatile. Because of this, we can even pass a function as a parameter into another function.
Callback functions:
- A callback is a function that is to be executed after another function has finished executing — hence the name 'call back'.
- Example: setTimeout(function() {console.log('I am the response from callback function')}, 300)
Promises:
Use Promise API to use asynchronous code. Create promise object using Promise API, access the asynchronous code response using promise.then.
Use Promise API to use asynchronous code. Create promise object using Promise API, access the asynchronous code response using promise.then.
Example:
let promise = new Promise(a callback function);
// By the way, this callback takes two parameters resolve and reject that are functions too, so…
let resolve = function(){}
let reject = function(){}
let promise = new Promise(function(resolve, reject) {
// do your async code here…
// If successful, call resolve function
// If failure, call reject function
});
promise.then to handle the data returned by either resolve or reject
Nobody can explain promises better than this guy: https://www.sitepoint.com/overview-javascript-promises/
Closures:
A Closure is nothing but a function that has access to the variables defined in outer (and enclosing) function.
As far as scope is concerned, the closure has access to global variables, its own variables, and variables of outer (and enclosing) function.
Example:
const myFunctionTwo = () => {
const message = 'My New Message';
const printMessage = () => {
console.log(message);
}
return printMessage;
}
const myPrintMessage = myFunctionTwo();
myPrintMessage();
// prints My New Message
Currying:
The curried effect is achieved by binding some of the arguments to the first function invoke, so that those values are fixed for the next invocation. It’s something like keeping masala ready and cook either chicken, goat, beef with ease.
Example:
var all_you_have_to_do_is_specify_masala = function(masala) {
return cook_with_masala = function(b){
console.log('i cooked ' + b + ' with ' + masala)
}
}
let use_ramesh_recipe = all_you_have_to_do_is_specify_masala ('masala made with garlic, ginger, spices')
use_ramesh_recipe('chicken')
use_ramesh_recipe('goat')
JavaScript making HTTP requests
The XMLHttpRequest object can be used to request data from a web server.
Example:
const puzzleAPIhit = () => {
const request = new XMLHttpRequest()
request.addEventListener('readystatechange', (e) => {
if (e.target.readyState === 4 && e.target.status === 200) {
const data = JSON.parse(e.target.responseText);
console.log(data.puzzle)
} else if (e.target.readyState === 4) {
console.log('An error has taken place')
}
})
request.open('GET', 'https://puzzle.mead.io/puzzle?wordCount=3')
request.send()
}
puzzleAPIhit();
Fetch API:
The Fetch API introduced in relatively newer versions of JavaScript and has built-in support for Promises. Technically, it is just another method of hitting HTTP Requests while harnessing the powers and perks of Promises and Promise Chaining.
fetch('http://puzzle.mead.io/puzzle', {}).then((response) => {
if (response.ok) {
return response.json();
/*
Actually, the .json() method takes the response and returns a Promise Object and hence
We need to add another then() as we have done in Promise Chaining
*/
} else {
throw new Error('Unable to fetch the puzzle');
}
}).then((data) => {
console.log(data.puzzle);
}).catch((error) => {
console.log(error);
});
Object Oriented Programming (OOP) in JavaScript:
OOP describes a way to write programs. This way focuses on data: stored as object properties, and actions: stored as object methods.
- Constructor functions versus ES6 classes, encapsulation, inheritance, prototypal vs static methods in JavaScript: https://medium.com/@luke_smaki/javascript-es6-classes-8a34b0a6720a
- Prototypal methods Vs Static methods: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes
- Building NPM packages, publishing and importing (https://npmjs.com)
Building an application with an express server:
- Create the app from express, tell your app how to handle get, post, put requests, and run the app at a port
- Reference: https://alligator.io/nodejs/express-basics/
Creating a React app from scratch:
- You need Webpack, React, Babel to create a react app from scratch.
- Example: https://www.valentinog.com/blog/babel/
- Create a React using create-react-app:
- Example: https://github.com/facebook/create-react-app
Build react app with a fake server for API testing
Subscribe to:
Posts (Atom)