Skip to content

Instantly share code, notes, and snippets.

<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.4/latest.js?config=AM_CHTML"></script>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>
<div id="app">
<div v-for="(q, i) in questions" :key="i">
function debounce(func, wait, immediate) {
var timeout;
return function () {
var context = this, args = arguments;
var later = function () {
timeout = null;
if (!immediate) func.apply(context, args);
};
var callNow = immediate && !timeout;
clearTimeout(timeout);
import java.sql.*;
public class Main {
public static void main(String... args) throws ClassNotFoundException, SQLException {
Connection connection = null;
//Loading of driver
Class.forName("com.mysql.cj.jdbc.Driver");
// Getting connection from driver
connection = DriverManager.getConnection("jdbc:mysql://localhost/srgp?user=root&password=");
import java.sql.*;
public class Main {
public static void main(String... args) throws ClassNotFoundException, SQLException {
Connection connection = null;
//Loading of driver
Class.forName("com.mysql.cj.jdbc.Driver");
// Getting connection from driver
connection = DriverManager.getConnection("jdbc:mysql://localhost/srgp?user=root&password=");
import java.sql.*;
public class Main {
public static void main(String... args) throws ClassNotFoundException, SQLException {
Connection connection = null;
//Loading of driver
Class.forName("com.mysql.cj.jdbc.Driver");
// Getting connection from driver
connection = DriverManager.getConnection("jdbc:mysql://localhost/srgp?user=root&password=");
import jdk.jshell.spi.SPIResolutionException;
import java.sql.*;
public class Main {
public static void main(String... args) throws ClassNotFoundException, SQLException {
Connection connection = null;
//Loading of driver
Class.forName("com.mysql.cj.jdbc.Driver");
@extsalt
extsalt / gist:0d072c2aa4204b4ae15f3ba06429b371
Created June 19, 2021 04:18
How to get input in Java?
import jdk.jshell.spi.SPIResolutionException;
import java.sql.*;
import java.util.Scanner;
public class Main {
public static void main(String... args) throws ClassNotFoundException, SQLException {
Scanner scanner = new Scanner(System.in);
package com.example.mycalculator;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
public class MainActivity extends AppCompatActivity {
@extsalt
extsalt / gist:f5ec6dc8bc87423c2e36671b9c81009c
Created June 22, 2021 11:25
Android Linear Layout Example
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".MainActivity">
<EditText
@extsalt
extsalt / gist:901d784b929b79664747433d46088d6b
Created June 25, 2021 10:51
Android Button On Click Listener and TextView
package com.example.mycalculator;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;