Skip to content

Instantly share code, notes, and snippets.

View the-cybersapien's full-sized avatar

Aditya Aggarwal the-cybersapien

View GitHub Profile
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
@the-cybersapien
the-cybersapien / Logcat952505
Created January 6, 2018 18:20
logcat from review #952505
01-06 23:49:09.606 5196-5196/? I/zygote: Not late-enabling -Xcheck:jni (already on)
01-06 23:49:09.613 5196-5196/? W/zygote: Unexpected CPU variant for X86 using defaults: x86
01-06 23:49:09.709 5196-5196/com.example.android.inventoryapp I/InstantRun: starting instant run server: is main process
01-06 23:49:09.812 5196-5196/com.example.android.inventoryapp E/SQLiteLog: (1) near "TABLES": syntax error
01-06 23:49:09.812 5196-5196/com.example.android.inventoryapp D/AndroidRuntime: Shutting down VM
01-06 23:49:09.814 5196-5196/com.example.android.inventoryapp E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.android.inventoryapp, PID: 5196
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.android.inventoryapp/com.example.android.inventoryapp.MainActivity}: android.database.sqlite.SQLiteException: near "TABLES": synt
@the-cybersapien
the-cybersapien / Vagrantfile
Created September 12, 2017 14:44
Vagrantfile for Udacity Fullstack VM
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/xenial32"
config.vm.network "forwarded_port", guest: 8000, host: 8000, host_ip: "127.0.0.1"
config.vm.network "forwarded_port", guest: 8080, host: 8080, host_ip: "127.0.0.1"
config.vm.network "forwarded_port", guest: 5000, host: 5000, host_ip: "127.0.0.1"
# Work around disconnected virtual network cable.
@the-cybersapien
the-cybersapien / .hyper.js
Last active August 27, 2017 06:42
Hyper Configuration file
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// default font size in pixels for all tabs
fontSize: 15,
// font family with optional fallbacks
@the-cybersapien
the-cybersapien / RecyclerMainActivity.java
Created August 12, 2017 12:20
RecyclerELE Code Sample Gist
public class MainActivity extends AppCompatActivity implements LoaderManager.LoaderCallbacks < List < GuardianStory >> {
/*Adapter for the stories*/
private RecyclerELEAdapter RAdapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
loaderManager = getLoaderManager();
//Create RecyclerView
RecyclerView storyListView = (RecyclerView) findViewById(R.id.stories_list);
@the-cybersapien
the-cybersapien / MainActivity.java
Last active August 12, 2017 12:19
RecyclerELE Code Samples
public class MainActivity extends AppCompatActivity implements LoaderManager.LoaderCallbacks < List < GuardianStory >> {
/*Adapter for the stories*/
private GuardianStoryAdapter guardianStoryAdapter;
/*Create the Recycler View*/
private RecyclerView storyListView;
/*Reference to the progress Bar*/
private ProgressBar progressBar;
/*Get a reference to the LoaderManager to intereact with the Loaders*/
private LoaderManager loaderManager;
/*Reference to the error(hint) TextView*/
abstract class Calculate {
abstract fun add(a: Int, b: Int): Int
}
fun main(args: Array) {
val result = object : Calculate() {
override fun add(a: Int, b: Int): Int {
return a + b
}
}.add(11010, 22011)
@the-cybersapien
the-cybersapien / javaDemo.java
Created August 12, 2017 11:50
Java Class Demo
abstract class Calculate {
abstract int add(int a, int b);
}
public class Main{
public static void main(String[] args){
int result = new Calculate(){
@Override
int add(int a, int b){
return a+b;
@the-cybersapien
the-cybersapien / insertArray.cpp
Created July 15, 2017 15:26
Gist containing the code to add an element to an array. Basic code, only for a display.
#include <iostream>
using namespace std;
class array1 {
public:
void a1() {
int n, i;
int no, pos;
Complete Source Code available here:
https://github.com/skyerofficial/solarc