fs.writeFile() writes [object, object] instead of actual objects when closing script

My script needs to read and write from a JSON file. This works without problems. I copy the file locally, edit the object, and write them back out to the file. However, when I close the script with Ctrl+C and check my file it has [object, object] instead of the actual objects that should be … Read more

user.emailVerified doesn’t change after clicking email verification link firebase

After learning sending email verification is possible in latest firebase, although the docs are missing that, I wanted to test it for myself. Using the snippet below: Auth.$onAuthStateChanged(function(firebaseUser) { if (firebaseUser) { console.log(firebaseUser); if (firebaseUser.emailVerified) { // console.log(firebaseUser.emailVerified); toastr.success(‘Email verified’); } else { toastr.info(‘Do verify email’); } } }) The console.log(firebaseUser.emailVerified) returns false, always, although … Read more

Sequelize hasMany Join association

I’m expanding my application and I need to join two models I had previously created with Sequelize, they are as follows: Meal sequelize.define(‘meal’, { mealId: { type: DataTypes.INTEGER, primaryKey: true, autoIncrement: true }, quantity: { type: DataTypes.DECIMAL, allowNull: false }, period: { type: DataTypes.INTEGER, allowNull: false } }) Food sequelize.define(‘food’, { idFood: { type: DataTypes.INTEGER, … Read more

Error creating bean with name ‘requestMappingHandlerAdapter’

Am creating a simple REST service using Springframework with Tomcat. The response should have to be in json like {“id”:”101″,”name”:”Ram”} .When ever I run, am getting the following error org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘requestMappingHandlerAdapter’ defined in class org.springframework.web.servlet.config.annotation.DelegatingWebMvcConfiguration: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport.requestMappingHandlerAdapter()] threw exception; … Read more

ELF, PIE ASLR and everything in between, specifically within Linux

Before asking my question, I would like to cover some few technical details I want to make sure I’ve got correct: A Position Independent Executable (PIE) is a program that would be able to execute regardless of which memory address it is loaded into, right? ASLR (Address Space Layout Randomization) pretty much states that in … Read more

How to draw four boundary corner for qr code scanner

How to draw four Boundary for qrcode? Answer I created a vector drawable for this: <vector xmlns:android=”http://schemas.android.com/apk/res/android” android:width=”220dp” android:height=”220dp” android:viewportHeight=”230.0″ android:viewportWidth=”230.0″> <path android:fillColor=”#00000000″ android:fillType=”evenOdd” android:pathData=”M165,5C178.2,5 198.2,5 225,5L225,30.79L225,65″ android:strokeColor=”@color/qr_code_reader_square” android:strokeWidth=”10″/> <path android:fillColor=”#00000000″ android:fillType=”evenOdd” android:pathData=”M5,65C5,51.8 5,31.8 5,5L30.79,5L65,5″ android:strokeColor=”@color/qr_code_reader_square” android:strokeWidth=”10″/> <path android:fillColor=”#00000000″ android:fillType=”evenOdd” android:pathData=”M165,225C178.2,225 198.2,225 225,225L225,199.21L225,165″ android:strokeColor=”@color/qr_code_reader_square” android:strokeWidth=”10″/> <path android:fillColor=”#00000000″ android:fillType=”evenOdd” android:pathData=”M5,165C5,178.2 5,198.2 5,225L30.79,225L65,225″ android:strokeColor=”@color/qr_code_reader_square” android:strokeWidth=”10″/> </vector> You … Read more

Understanding Spring Boot @Autowired

I don’t understand how spring boot’s annotation @Autowired correctly works. Here is a simple example: @SpringBootApplication public class App { @Autowired public Starter starter; public static void main(String[] args) { SpringApplication.run(App.class, args); } public App() { System.out.println(“init App”); //starter.init(); } } — @Repository public class Starter { public Starter() {System.out.println(“init Starter”);} public void init() { … Read more