This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<style> | |
#box { | |
width: 100px; | |
height: 100px; | |
border: 10px solid green; | |
padding: 25px; | |
margin: 25px; |
This file contains hidden or 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
#SurveyController Class | |
class Api::V1::SurveysController < Api::V1::BaseController | |
before_action :set_survey, only: [:show, :questions] | |
def index | |
# Api to get all current user schedules for the current time | |
@schedules = @account.schedules.includes(:survey, survey_version: :departments).joins(:survey) | |
.where(surveys: { status: 1 }, completed_at: nil).where(ignore: false) | |
.where('schedules.start_time <= :time AND schedules.buffer_time >= :time', time: Time.current) | |
.order('schedules.start_time asc') |
This file contains hidden or 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> | |
var tempStr = "",prevNumber=1,i,depth=10; | |
for(i=0;i<depth;i++){ | |
tempStr = "";j=0; | |
while(j<= i){ | |
tempStr = tempStr + " " + prevNumber; | |
j++; | |
prevNumber++; | |
} | |
console.log(tempStr); |
This file contains hidden or 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> | |
var a = prompt("Enter"); | |
var f = 1; | |
for (var c = 1; c <= a; ++c) f *= c; | |
alert(f); | |
</script> |
This file contains hidden or 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
var i; | |
var fib = []; | |
fib[0] = 0; | |
fib[1] = 1; | |
for(i=2; i<=10; i++) | |
{ | |
fib[i] = fib[i-2] + fib[i-1]; | |
} | |
alert(fib); |
This file contains hidden or 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> | |
var a = prompt("Enter Value"); | |
b = a.toString(); | |
rev = b.split("").reverse().join(""); | |
if(a == rev) | |
{ | |
alert("Palindrome"); | |
} | |
else | |
{ |
This file contains hidden or 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> | |
var a=prompt("Enter a value"); | |
if(a%2==0) | |
{ | |
alert("Given number is even"); | |
} | |
else { | |
alert("Give number is odd"); | |
} | |
</script> |
This file contains hidden or 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> | |
var a=prompt("Enter a value"); | |
z=a; | |
e = d = 0; | |
while(z > 0) | |
{ | |
e = z % 10; | |
d = d + fact(e); | |
z = parseInt(z/10); | |
} |
This file contains hidden or 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> | |
var a=prompt("enter a value"); | |
var count=0; | |
for(var i=2;i<a;i++) | |
{ | |
if(a%i==0) | |
{ | |
count=i; | |
} |
This file contains hidden or 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> | |
var e,x,d=0; | |
var b=prompt("Enter a number"); | |
x=b; | |
while(x>0) | |
{ | |
e=x%10; | |
d=d+(e*e*e); | |
x=parseInt(x/10); | |
} |
NewerOlder