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
$( document ).ready(function() { | |
// hide spinner | |
$("#spinner").hide(); | |
// show spinner on AJAX start | |
$(document).ajaxStart(function(){ | |
$("#spinner").show(); |
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
<script type="text/javascript"> | |
var Q = Quintus({development: false}) | |
.include("Sprites, Scenes, Input, 2D, Anim, Touch, UI") | |
.setup("myGame") | |
.controls().touch() | |
var flag=0;//score | |
var l=1;// current level | |
var newscore=0;// | |
var disp=0;//diplay score | |
var comp=1,pflag=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
from collections import Counter | |
from itertools import groupby | |
strs=raw_input() | |
count = 0 | |
answer = '' | |
for k, g in groupby(strs): | |
count = len(list(g)) | |
if (count > 1) and (k != ' '): | |
answer = answer + k + str(count) | |
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
import json | |
import requests | |
from constants import SEND_MESSAGE_URL, PAT as token | |
from random import randint | |
import random | |
import math | |
def send_typing_status(recipient): | |
r = requests.post(SEND_MESSAGE_URL, | |
params={"access_token": token}, |
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
def quadeasy(): | |
a = randint(1,7) | |
c = randint(1,40) | |
b = 2 * math.sqrt(a*c) | |
while(math.sqrt(a*c).is_integer() == False): | |
c = c+1 | |
b = int(2 * math.sqrt(a*c)) | |
answer = float(-1 * b )/(2*a) | |
question = "Solve the Equation %sx^2 + %sx + %s = 0" %(a ,b ,c ) | |
return question |
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
from random import randint | |
import random | |
import math | |
def quadeasy(): | |
a = randint(1,7) | |
c = randint(1,40) | |
b = 2 * math.sqrt(a*c) | |
while(math.sqrt(a*c).is_integer() == False): | |
c = c+1 |
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
import json | |
import requests | |
from constants import SEND_MESSAGE_URL, PAT as token | |
from random import randint | |
import random | |
import xml.etree.ElementTree | |
import math | |
def send_typing_status(recipient): |
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
def advacned_operation(): | |
dic_mult = easy_multiply() | |
dic_div = easy_divide() | |
dic_add = easy_addition() | |
dic_sub = easy_subtraction() | |
question = 'Solve the expression ( %s + %s ) + ( %s - %s ) + ( %s * %s ) + ( %s / %s )' %(dic_add["param1"], dic_add['param2'],dic_sub['param1'],dic_sub['param2'],dic_mult['param1'],dic_mult['param2'],dic_div['param1'],dic_div['param2']) | |
answer = int(dic_add['param1']) + int(dic_add['param2']) + int(dic_sub['param1']) - int(dic_sub['param2']) + ( int(dic_mult['param1']) * int(dic_mult['param2'])) + ( int(dic_div['param1'])/int(dic_div['param2']) ) | |
option1 = answer + 3 | |
option2 = answer + 5 |
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
# == Schema Information | |
# | |
# Table name: notewidgets | |
# | |
# id :integer not null, primary key | |
# note_id :integer | |
# tag_one :string question_text || content | |
# tag_two :string option1 | |
# tag_three :string option2 | |
# tag_four :string option3 |
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
<div class="col-md-8 col-md-offset-2 questions"> | |
<div class="well"> | |
<h3><%= @toload.tag_one %> </h3> | |
<ul class="list-group"> | |
<label><li class="list-group-item" onclick = '$(".questions .active").removeClass("active");$(this).addClass("active");' ><%= radio_button_tag 'option', "option1" %> <%= @toload.tag_four %> </li> </label> | |
<label><li class="list-group-item" onclick = '$(".questions .active").removeClass("active");$(this).addClass("active");'><%= radio_button_tag 'option', "option2" %> <%= @toload.tag_five %></li></label> | |
<label><li class="list-group-item" onclick = '$(".questions .active").removeClass("active");$(this).addClass("active");'> <%= radio_button_tag 'option' , "option3" %> <%= @toload.tag_six %></li></label> | |
<label><li class="list-group-item" onclick = '$(".questions .active").removeClass("active");$(this).addClass("active");'> <%= radio_button_tag 'option' , "option4" %> <%= @toload.tag_seven %> </li></label> |
OlderNewer