Skip to content

Instantly share code, notes, and snippets.

void rusiuoti(int mas[], int n)
{
int laik;
for(int i = 0; i < n; i++)
{
for(int j = 0; j < n - 1; j++)
{
//Pakeisti > i < jei nori kad rusiuotu mazejimo tvarka
if(mas[j] > mas[j+1])
{
#!/usr/bin/env ruby
require 'redditkit'
class User
def initialize
puts "Enter username"
@username = gets.chomp
@user_content = RedditKit.user_content(@username)
puts "Downvote or upvote?"
if gets.chomp == "upvote"
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
ifstream d ("Duomenys.txt");
ofstream r ("Rezultatai.txt");
struct krepsininkas {
require 'googl'
require 'open-uri'
require 'google/apis/urlshortener_v1'
ip = open('http://icanhazip.com', &:read).strip
api_key = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
urls = ["www.facebook.com",
"www.youtube.com",
"www.reddit.com",
require 'google/apis/youtube_v3'
require 'youtube-dl.rb'
api_key = "xxx"
youtube = Google::Apis::YoutubeV3::YouTubeService.new
youtube.key = api_key
videos = ["https://www.youtube.com/watch?v=G-Vg2YS-sFE",
namespace Uzduotis2
{
class BasketballPlayer : Player
{
public int Rebounds { get; private set; }
public int Assists { get; private set; }
public BasketballPlayer(string firstName, string lastName, int gameCount, int rebounds, int assists)
: base(firstName, lastName, gameCount)
{
using System;
using System.Collections;
using System.IO;
using System.Text;
namespace Utilities.LinkedList
{
public class HDDLinkedList : IEnumerable, IDisposable
{
readonly FileStream stream;
@KristupasSavickas
KristupasSavickas / RadixSortLinkedList.cs
Created May 30, 2017 16:01
Radix sort for a linked list in C#
static LinkedList<int> RadixSort(LinkedList<int> linkedList)
{
bool isFinished = false;
int digitPosition = 0;
var buckets = new List<Queue<int>>();
InitializeBuckets(buckets);
{
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"preLaunchTask": "Build (Makefile)",
"program": "${cwd}/bin/load_manager",
"args": [],
@KristupasSavickas
KristupasSavickas / binaries.m
Last active September 28, 2017 20:28
Generates all n bit long binary numbers
clc; clear all;
function generate_binaries(n)
B = zeros(2^n, n);
for i = n:-1:1
st = 2 ^ (n - i);
for j = st:2 * st:2^n
for k = 1:st
B(j + k, i) = 1;
end