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
#!/bin/sh | |
# Uncomment for debugging | |
#set -x | |
pingf(){ | |
if ping -w 2 -q -c 1 192.168.1."$1" > /dev/null ; | |
then | |
printf "IP %s is up\n" 192.168.1."$1" | |
else | |
printf "IP %s is open\n" 192.168.1."$1" | |
fi |
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
from flask import Flask | |
from flask_jwt import JWT, jwt_required, current_identity | |
from werkzeug.security import safe_str_cmp | |
class User(object): | |
def __init__(self, id, username, password): | |
self.id = id | |
self.username = username | |
self.password = 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
const cluster = require('cluster'); | |
if (cluster.isMaster) { | |
cluster.fork(); | |
cluster.on('exit', function(worker, code, signal) { | |
cluster.fork(); | |
}); | |
} |
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
package com.demo.advjava; | |
public class StarsPattern { | |
public static void main(String[] args) { | |
printStars90(10); | |
printStarsRev(10); | |
// printStarsRev(10); | |
printStars(10); | |
} |
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
package com.demo.advjava; | |
public class GraphImplementationAdjMat { | |
int[][] graph; | |
public GraphImplementationAdjMat(int vertices) { | |
graph = new int[vertices][vertices]; | |
} |
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
package com.demo.advjava; | |
import java.awt.AWTException; | |
import java.awt.Robot; | |
import java.awt.event.KeyEvent; | |
import java.io.IOException; | |
public class NotepadFun { | |
public static void main(String[] args) throws IOException, InterruptedException, AWTException { | |
Runtime.getRuntime().exec("gedit"); |
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
package com.demo.advjava; | |
public class NQueensTesting { | |
int boardSize = 8; | |
int[][] board = new int[boardSize][boardSize]; | |
public void populateBoard() { | |
int i, j; | |
for (i = 0; i < boardSize; i++) |
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
package com.demo.advjava; | |
public class CircularLinkedList { | |
Node head; | |
class Node { | |
int data; | |
Node next; |
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
#include<stdio.h> | |
#include<stdlib.h> | |
struct nde { | |
int data; | |
struct nde *link; | |
}; | |
typedef struct nde* Node; |