Skip to content

Instantly share code, notes, and snippets.

View LordRahl90's full-sized avatar

Alugbin Abiodun Olutola LordRahl90

  • CodeBoulevard systems Inc
  • Nigeria, West Africa
  • X @LordRahl90
View GitHub Profile
@LordRahl90
LordRahl90 / main.go
Created March 20, 2019 14:30
Testing Psql With console go application. This is a simple console address book. I know the db details aren't supposed to be in the code. I'm just trying it out,
package main
import (
"bufio"
"database/sql"
"fmt"
"os"
"strconv"
_ "github.com/lib/pq"
@LordRahl90
LordRahl90 / main.go
Created March 5, 2019 13:32
10001's Prime Number, Project Euler #7
package main
import "fmt"
func solution(index int) int {
num, counter, val := 2, 0, 0
for {
var clean = true
for i := 2; i <= num-1; i++ {
@LordRahl90
LordRahl90 / main.go
Last active March 5, 2019 13:04
Sum Square Difference project euler #6
package main
import "fmt"
func solution(limit int) int {
sum, ssq := 0, 0
for i := 1; i <= limit; i++ {
square := i * i
ssq += square
sum += i
@LordRahl90
LordRahl90 / main.go
Last active March 5, 2019 13:03
Smallest Multiple Problem. Project Eular #5
package main
import "fmt"
func solution() int {
var min int
num := 21
found := false
for !found {
var clean bool
@LordRahl90
LordRahl90 / main.go
Last active March 5, 2019 12:32
Biggest Palindrome, Project Euler #4
package main
import "fmt"
func flip(n int) int {
var v int
for n != 0 { //to make it cater for negative numbers
remainder := n % 10
v = v*10 + remainder
n /= 10
@LordRahl90
LordRahl90 / main.go
Created March 5, 2019 11:51
Project Euler #3 Implementation in golang.
package main
import (
"fmt"
)
func primeNumbers(n int, pChan chan int) {
defer close(pChan)
for i := 2; i <= n; i++ {
prime := true
@LordRahl90
LordRahl90 / main.go
Last active March 5, 2019 10:28
Even Fibonacci Implementation Project Euler #2
func chanFib(n int, f chan int) {
fmt.Println("N is: ", n)
defer close(f)
i, j := 0, 1
for {
temp := i + j
f <- i + j
j, i = i+j, j
if temp >= n {
@LordRahl90
LordRahl90 / main.go
Created March 4, 2019 22:41
Producer consumer Implementation in go-lang
package main
import "fmt"
func producer(p chan int, items int) {
defer close(p)
for i := 1; i <= items; i++ {
fmt.Println("Produer Producing ", i)
p <- i
}
@LordRahl90
LordRahl90 / README-Template.md
Created November 21, 2018 13:40 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@LordRahl90
LordRahl90 / Node.java
Created November 1, 2018 10:50
This is a node for a singly linked list. It only has information about the next value.
public class Node{
int data;
Node next;
Node(int d){
data=d;
}
}