Skip to content

Instantly share code, notes, and snippets.

View navin-mohan's full-sized avatar

Navin Mohan navin-mohan

View GitHub Profile

This is an example of using Play framework to implement the GET method for submitting search queries.

The URL http://localhost:9000/search will give you the search box. Upon on clicking the search button, the browser will append ?q=<whatever search query that was entered> to the URL and refreshes the page.

The new URL after submission will be http://localhost:9000/search?q=<whatever search query that was entered> and play framwork renders the result page as defined in the controller.

Code Snippets:

@navin-mohan
navin-mohan / newton.cpp
Last active June 14, 2019 17:05
Newton-Raphson Method
/*
* ------------------------
* | Newton-Raphson Method |
* ------------------------
*
* Author: Navin Mohan
* Website: https://nvnmo.github.io
*
* MIT License
*
@navin-mohan
navin-mohan / hack.js
Last active May 19, 2019 09:25
resnet50 visualization
/*
** HOW TO USE
** --------------
** Go to http://alexlenail.me/NN-SVG/AlexNet.html
** Open console (Ctrl + Shift + J on Chrome)
** Paste this script and hit enter
*/
document.getElementsByClassName('btn btn-primary btn-add input-group-prepend')[0].classList.add('add-layer-btn')
ORG 0000
CLR C
MOV DPTR,#0100
MOVX A,@DPTR
MOV R0,A
INC DPTR
MOVX A,@DPTR
ADD A,R0
INC DPTR
MOVX @DPTR,A
@navin-mohan
navin-mohan / concat.c
Created April 11, 2018 15:39
concat and remove
#include <stdio.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <pthread.h>
#include <string.h>
#include <stdlib.h>
// gcc -pthread concat.c -o concat
@navin-mohan
navin-mohan / A.c
Created April 11, 2018 03:34
FIFO NET LAB
#include <stdio.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <stdlib.h>
int main(){
int n,i,a,fd1;
@navin-mohan
navin-mohan / tlp.sh
Created April 9, 2018 06:50
Setup TLP
#!/bin/bash
sudo pacman -S tlp --noconfirm
sudo systemctl enable tlp.service
sudo systemctl enable tlp-sleep.service
sudo systemctl mask systemd-rfkill.service
sudo systemctl mask systemd-rfkill.socket
sudo systemctl start tlp.service
sudo systemctl start tlp-sleep.service
from html.parser import HTMLParser
class TextExtractionParser(HTMLParser):
'''
Custom HTML Parser that extracts
textual data from HTML
'''
def __init__(self,*args,**kwargs):
super().__init__(*args,**kwargs)
self.word_list = []
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#define TAB_SIZE 100
#define SYMBOL_SIZE 30
#define OPCODE_SIZE 10