This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Write a program that prints the numbers from 1 to 100. But for multiples of | |
# three print “Fizz” instead of the number and for the multiples of five print | |
# “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”. | |
def fizzbuzz x | |
fizz = (x % 3) == 0 ? 'fizz' : '' | |
buzz = (x % 5) == 0 ? 'buzz' : '' | |
unless "#{fizz}#{buzz}" == '' | |
puts "#{fizz}#{buzz}" | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int fizzBuzz(int x) { | |
if((x % 3) == 0) cout << "fizz"; | |
if((x % 5) == 0) cout << "buzz"; | |
if(( (x % 3) && (x % 5) ) != 0) cout << x; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() { | |
for(int i = 0; i <= 100; i++) | |
(i % 15) == 0 ? printf("FizzBuzz\n"): | |
(i % 3) == 0 ? printf("Fizz\n"): | |
(i % 5) == 0 ? printf("Buzz\n"): | |
printf("%i\n", i); | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
X = 0 | |
Y = 0 | |
Z = 0 | |
C$ = " " | |
input "Enter first number: ", X | |
print "Input: ", X | |
input "Enter second number: ", Y | |
print "Input: ", Y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() { | |
double x = 0; | |
double y = 0; | |
double z = 0; | |
char c = ' '; | |
WHILE: | |
printf("Enter First Number: "); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// My quick hack to making a typing animation on screen, without silly JQuery... | |
// typeOut takes the: | |
// element: DOM element to manipulate | |
// string: string to type out | |
// delay: time between keystrokes | |
function typeOut (element, string, delay) { | |
for(var i = 0; i < string.length; i++){ | |
(function(){ | |
var tempI = i; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'celluloid/autostart' | |
require 'twitter' | |
class TweetActor | |
include Celluloid | |
include Celluloid::Notifications | |
attr_reader :twitter_client | |
def initialize | |
now = Time.now.to_f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create an app that completes the following: | |
# - Leap Years | |
# - if x is divisible by 4, but not 100 | |
def leap(number) | |
(((number % 4) == 0) && !((number % 100) == 0)) | |
end | |
puts leap(4) | |
puts leap(100) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.center-hor { | |
position: absolute; | |
right: 50px; | |
left: 50px; | |
text-align: center; | |
} | |
.center-ver { | |
position: absolute; | |
top: 50%; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (!kore_pgsql_query(&sql, "SELECT * FROM devices")) { | |
kore_pgsql_logerror(&sql); | |
goto out; | |
} |
OlderNewer