Multiple conditions with scanf in C

TLDR: I need to check if the input I am scanning with scanf into an array is really an integer while using EOF. I need to scan numbers into an array until EOF. I am doing everything with statically allocated memory, since I am quite a beginner and for now dynamically allocated memory is hard… Read More Multiple conditions with scanf in C

How to use multiline <<EOF in bash with assigning output to variable?

Let’s say that I have a code like: python <<EOF print("abc") EOF and I want to assign output to bash variable. Something like: VAR=$(python -c ‘print("abc")’) Of course real python code is more complicated than print(abc) and one-liner can’t be used here So the qestion is how to assign output of first example to variable?… Read More How to use multiline <<EOF in bash with assigning output to variable?

Comparing 2 HashMap with Key as String and Value as UserDefined Object

I want to output a boolean as true indicating both maps have same Key and values. If i use equals() it returns false. How can i output as true , Object references are different. But the entries are same I have 2 maps below Map<String,Information> map1=new HashMap<>(); map1.put("key1", new Information("10","20","30","40")); map1.put("key2", new Information("11","22","33","44")); Map<String,Information> map2=new… Read More Comparing 2 HashMap with Key as String and Value as UserDefined Object