Skip to content

Instantly share code, notes, and snippets.

View meshileya's full-sized avatar
🏠
Working from home

meshileya

🏠
Working from home
  • Lagos, Nigeria
View GitHub Profile
@meshileya
meshileya / circle_with_opengl.cpp
Created January 2, 2016 16:41
Using opengl to create a 3D circle
// 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
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main(){
char str[100];
int the_square;
int iterator, length, inputs;
char src[10];
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
<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"
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);
}
private String convertByteArrayToString(byte[] convertedTemplate) {
return new String(Base64.getEncoder().encode(convertedTemplate));
}
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])
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.
@meshileya
meshileya / JSONStringify.swift
Created September 6, 2020 17:55 — forked from santoshrajan/JSONStringify.swift
JSON Stringify in 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 {
fun fixAppend(displayStr: StringBuilder, digit: String, txtView: TextView): Boolean {
if (displayStr.length <= 11) {
displayStr.append(digit)
var newAmount = displayStr.toString().toDouble()
// fix new input
newAmount *= 10.00
if ("00" == digit) newAmount *= 10.00
val updatedAmount = DecimalFormat("0.00").format(newAmount)