Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

meshileya

🏠
Working from home
  • Lagos, Nigeria
View GitHub Profile
View JSONStringify.swift
// Author - Santosh Rajan
import Foundation
let jsonObject: [AnyObject] = [
["name": "John", "age": 21],
["name": "Bob", "age": 35],
]
func JSONStringify(value: AnyObject, prettyPrinted: Bool = false) -> String {
View Error.java
2019-04-11 08:10:22.026 10105-10143/datainfosec.developer.couchbasesample E/WS: CBLWebSocket.socket_open()
2019-04-11 08:11:56.274 10105-10105/datainfosec.developer.couchbasesample A/zygote: java_vm_ext.cc:534] JNI DETECTED ERROR IN APPLICATION: thread Thread[1,tid=10105,Runnable,Thread*=0xa784e000,peer=0x734e7978,"main"] using JNI after critical get
2019-04-11 08:11:56.274 10105-10105/datainfosec.developer.couchbasesample A/zygote: java_vm_ext.cc:534] in call to ExceptionOccurred
2019-04-11 08:11:56.274 10105-10105/datainfosec.developer.couchbasesample A/zygote: java_vm_ext.cc:534] from long com.couchbase.litecore.C4BlobStore.create(long, byte[])
2019-04-11 08:11:56.274 10105-10105/datainfosec.developer.couchbasesample A/zygote: java_vm_ext.cc:534] "main" prio=5 tid=1 Runnable
2019-04-11 08:11:56.274 10105-10105/datainfosec.developer.couchbasesample A/zygote: java_vm_ext.cc:534] | group="main" sCount=0 dsCount=0 flags=0 obj=0x734e7978 self=0xa784e000
2019-04-11 08:11:56.274 10105-10105/datainfosec.
View JustPlayingArroundGist.swift
var str = "10239485728"
var bankList = ["Bank 1", "Bank 2", "Bank 3"]
func getBanks(_ allbanks: [String],_ accountNo: String) -> [String]{
var result = ["1","2","3","4"]
let start = String.Index(encodedOffset: 0)
let end = String.Index(encodedOffset: accountNo.count - 1)
let sumsample = String(accountNo[start..<end])
View ByteToString
private String convertByteArrayToString(byte[] convertedTemplate) {
return new String(Base64.getEncoder().encode(convertedTemplate));
}
View Examples.java
public interface RegistrationAPI {
@FormUrlEncoded
@POST("/ServerBackyard/insert_details.php")
public void addUser(
@Field("email") String email,
@Field("name") String name,
@Field("username") String username,
@Field("password") String password,
Callback<Response> callback);
}
View jonathan.xml
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="50dp"
android:layout_alignParentBottom="true"
android:background="@color/colorPrimaryDark">
<LinearLayout
android:id="@+id/wrapper"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:weightSum="1.0"
View GPACalculator.py
the_num = int(raw_input("Enter number of courses ==> "))
total_course_unit=0.0
total_course_grade = 0.0
total_grade_point = 0.0
for a in range (0,the_num):
course_code = str(raw_input("Enter the course code ==> "))
course_unit = int(raw_input("Enter the course unit ==> "))
total_course_unit=total_course_unit+course_unit
course_grade = int(raw_input("Enter the course grade ==> "))
total_course_grade = total_course_grade + course_grade
View csc508.c
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main(){
char str[100];
int the_square;
int iterator, length, inputs;
char src[10];
@meshileya
meshileya / circle_with_opengl.cpp
Created Jan 2, 2016
Using opengl to create a 3D circle
View circle_with_opengl.cpp
// circle_assignment.cpp : Defines the entry point for the console application.
//to draw a circle using 3 dimentional graph style
#include "stdafx.h"
#include "glut.h"
GLfloat xRotated, yRotated, zRotated;
GLdouble radius=1;//to set the radius of the circle