Skip to content

Instantly share code, notes, and snippets.

View AbsolutelySaurabh's full-sized avatar
🤗
Give me a problem, and I can write a partially running code in Java, Go, C/C++

Saurabh Singh AbsolutelySaurabh

🤗
Give me a problem, and I can write a partially running code in Java, Go, C/C++
View GitHub Profile
@AbsolutelySaurabh
AbsolutelySaurabh / AddingFractions.java
Created January 6, 2020 17:03
Adding Fractions in java
import java.io.*;
import java.util.*;
/*
* To execute Java, please define "static void main" on a class
* named Solution.
*
* If you need more classes, simply define them inline.
*/
@AbsolutelySaurabh
AbsolutelySaurabh / FirstNonRepeating
Created December 10, 2019 05:50
First non-repeating character in a string
package practice;
import java.util.Scanner;
public class Solution1 {
//first non-repeating character in a string
private static int[] buildFreq(String str){
@AbsolutelySaurabh
AbsolutelySaurabh / MaxAvgStudents
Created December 10, 2019 05:45
Max average marks of students
package practice;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Scanner;
public class Solution2 {
private static Map<String, Double> studentsMap;
@AbsolutelySaurabh
AbsolutelySaurabh / .gitignore
Created August 23, 2019 17:02 — forked from octocat/.gitignore
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
Handler: func(db *gorm.DB, argument *admin.FilterArgument) *gorm.DB {
startDate := argument.Value.Get("Start").Value
endDate := argument.Value.Get("End").Value
startDateTime, _ := time.Parse(C.DATE_YYYY_MM_DD_HH_MM, utils.ToString(startDate))
endDateTime, _ := time.Parse(C.DATE_YYYY_MM_DD_HH_MM, utils.ToString(endDate))
diffStartEnd := startDateTime.Sub(Date(endDateTime.Year(), endDateTime.Month(), endDateTime.Day(), endDateTime.Hour(), endDateTime.Minute())).Hours() / 24
log.Printf("diffStartEnd: %f", diffStartEnd)
if diffStartEnd < 0 {
//admin
booking.Filter(&admin.Filter{
Label: "Created At",
Name: "CreatedAt",
Type: "datetime",
Handler: func(db *gorm.DB, argument *admin.FilterArgument) *gorm.DB {
startDate := argument.Value.Get("Start").Value
endDate := argument.Value.Get("End").Value
//db.go
SELECT_DISTINCT_MASTER_TYPES = "select distinct master_type from master_types"
//admin.go
master_type := Admin.AddResource(&models.MasterType{}, &admin.Config{
Permission: configuration.GetPermission(C.MODEL_MASTER_TYPE),
PageCount: C.PAGE_COUNT})
master_type.Meta(&admin.Meta{
Name: "Master_Type",
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@AbsolutelySaurabh
AbsolutelySaurabh / README.md
Created June 14, 2018 17:07 — forked from hofmannsven/README.md
My simply MySQL Command Line Cheatsheet