Instantly share code, notes, and snippets.

View activity_main.xml
<?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"
android:background="@drawable/bg"
android:weightSum="10"
tools:context=".MainActivity">
View insert-student.php
<?php
include('header.php');
include('connection.php');
if(isset($_POST['submit'])){
$name=$_POST['name'];
$roll=$_POST['roll'];
$phone=$_POST['phone'];
$sql="INSERT INTO info (sname, roll, phone) VALUES('$name', '$roll', '$phone')";
View barcode_scanner.py
#!/usr/bin/python
import sys
import requests
import json
api_key = "" #https://upcdatabase.org/
def barcode_reader():
"""Barcode code obtained from 'brechmos'
https://www.raspberrypi.org/forums/viewtopic.php?f=45&t=55100"""
View fiddle.css
#mydiv {
background-color: lightblue;
width: 200px;
height: 200px
}
View ForLoop.c
#include<stdio.h>
#include<conio.h>
int main(){
int i;
for(i=1; i<=10; i++)
{
printf("%d\n", i);
}