This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val longitude = map.getAsOrElse[String]("$payload.longitude}", "0.0").toDouble | |
val latitude = map.getAsOrElse[String]("$payload.latitude}", "0.0").toDouble | |
if((longitude<68.17) || (longitude>97.41) || (latitude<7.96) || (latitude>35.50)) && (longitude!=0.0) && (latitude!=0.0)) | |
{"BLOCK"} | |
else | |
{"PASS"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.BufferedReader; | |
import java.io.FileReader; | |
import java.util.*; | |
import java.lang.reflect.Array; | |
import java.io.IOException; | |
public class ReadFileLineByUsingBufferedReader { | |
static String keywordsFile[] = {"java", "xml", "conf", "config", "yaml", "yml", "properties", "prop"}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Solving with the Symbolic link: | |
Irrespective of any version, it will help: | |
symbolic link and use the subl command, as $PATH and different versions within the installation folder may differ from one and other, so here is the simplest way to set up the symlink without having problem with quotation, versions, path etc. | |
1. Open Finder in your system, locate your Sublime Text app within the Applications folder. | |
2. Right click on the App, then `Show Package Contents`. | |
3. Navigate up to: Contents -> SharedSupport -> bin, look for subl file. | |
4. Copy this file subl. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Mysql installed but throwing error while using command `mysql -u root -p` | |
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) | |
But while checking in `/tmp/mysql.sock` there is no mysql in tmp | |
Perform the following steps: | |
1. sudo chown -R _mysql:mysql /usr/local/var/mysql | |
It will prompt for system password, enter the password. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
boolean hasCycle(Node head) { | |
boolean result = false; | |
if (head == null) { | |
result = false; | |
} | |
else { | |
Node slowp = head; | |
Node fastp = head; | |
while (fastp != null && fastp.next != null && slowp != null) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Delete a single open branch but merged branch from production environment | |
git push origin :remotes/origin/<branch_name> | |
#Delete all open but merged branches from production environment | |
for i in `git branch -r --merged production | grep -v "production" | awk -F / '{print $2}'`; do git push origin :$i; done | |
# check remaining branches count | |
git branch -a | wc -l |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
crontab: command used to schedule and run tasks in the background at defined regular intervals. | |
Format: | |
* * * * * * | |
( MIN HOUR DOM MON DOW CMD ) | |
where: | |
MIN- minute -0-59 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var list = { | |
name : 'I', | |
next : { | |
name : 'AM', | |
next : { | |
name : 'KANIKA', | |
next : { | |
name : 'SHARMA' | |
} | |
} |