Getting started:
Related tutorials:
| # Hello World program in Python | |
| import random | |
| secret_number = random.randint(0, 100) | |
| guess = -1 | |
| counter = 0 | |
| while secret_number != guess and counter < 10: | |
| guess = int(input("Enter a number: ")) | |
| if 0 <= guess <= 100: | |
| if guess < secret_number: |
Getting started:
Related tutorials:
| class Show < ActiveRecord::Base | |
| def self.highest_rating | |
| Show.maximum(:rating) | |
| end | |
| def self.most_popular_show | |
| self.where("rating=?",self.highest_rating).first | |
| end |
| # | |
| # Install the MYSQL driver | |
| # gem install mysql2 | |
| # | |
| # Ensure the MySQL gem is defined in your Gemfile | |
| # gem 'mysql2' | |
| # | |
| # And be sure to use new-style password hashing: | |
| # http://dev.mysql.com/doc/refman/5.0/en/old-client.html | |
| development: |
| module.exports = function (grunt) { | |
| grunt.initConfig({ | |
| // jshint: { | |
| // browser: ["public/js/**/*.js"], | |
| // }, | |
| jshint: { | |
| client: ["public/js/**/*.js", "!public/js/vendor"], | |
| }, | |
| // less: { | |
| // compile: { |
| class Node{ | |
| constructor(val){ | |
| this.val = val; | |
| this.next = null; | |
| } | |
| } | |
| class SinglyLinkedList{ | |
| constructor(){ | |
| this.head = null; |
| class Node{ | |
| constructor(val){ | |
| this.val = val; | |
| this.next = null; | |
| this.prev = null; | |
| } | |
| } | |
| class DoublyLinkedList { |
| class Node { | |
| constructor(value){ | |
| this.value = value; | |
| this.next = null; | |
| } | |
| } | |
| class Queue { | |
| constructor(){ | |
| this.first = null; |
| class Node { | |
| constructor(value){ | |
| this.value = value; | |
| this.next = null; | |
| } | |
| } | |
| class Stack { | |
| constructor(){ | |
| this.first = null; |