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 mother_node = new node(null, null); | |
var string_to_store = "rupsa"; | |
var previous_node = mother_node; | |
var stored_nodes = []; | |
string_to_store.split('').forEach(function (element, index) { | |
var newNode = new node(element, previous_node); | |
stored_nodes.push(newNode); | |
previous_node = newNode; | |
}) | |
console.log(stored_nodes); |
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 mother_node = new node(null, null); | |
var string_to_store = "rupsa"; | |
var previous_node = mother_node; | |
var stored_nodes = []; | |
string_to_store.split('').forEach(function (element, index) { | |
var newNode = new node(element, previous_node); | |
stored_nodes.push(newNode); | |
previous_node = newNode; | |
}) | |
console.log(stored_nodes); |
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
#!/bin/bash | |
# call this using bash radio.sh Mirchi | |
# Start list of radio. If the link ends with m3u, then add it as pWhateverYoucallIt. else put it in as cName | |
pMajesticJukebox="http://uk3.internet-radio.com:8405/live.m3u" | |
cMirchi='http://peridot.streamguys.com:7150/Mirchi' | |
cBollywoodHits='http://50.7.77.115:8174/' | |
cAfsanaIndia='http://174.36.206.197:7019/stream/1/' | |
#end list of Radio Stations |
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
function catu(one, two) { | |
var returnu = []; | |
two.forEach(element => { | |
returnu.push(one + element); | |
returnu.push(element); | |
}); | |
return returnu; | |
} | |
function main_fun(stringu) { | |
if (stringu.length == 1) { |
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
<?php | |
foreach($_POST['outcome'] as $okey=>$oval){ | |
$rs = mysql_query("INSERT INTO form_quest_outcome_fqo (qid_fqo, idotc_fqo) VALUES ('{$q_id}','{$oval}')", $mx_shop); | |
$idfqo = mysql_insert_id(); | |
foreach($_POST['outcome_inctype'][$oval] as $ikey=>$ival){ | |
mysql_query("INSERT INTO form_quest_outcomeit_fqi (idfqo_fqi, qid_fqi, idit_fqi) VALUES ('{$idfqo}','{$q_id}','{$ival}')", $mx_shop); | |
} | |
} | |
?> |
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
#!/bin/ruby | |
def minimumAbsoluteDifference(n, arr) | |
b = arr.sort! | |
c = b.map.with_index {|a,i| a - (b[i+1]||0) } | |
d = c.map( &:abs ) | |
return d.sort[0] | |
end | |
n = gets.strip.to_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
=begin | |
This file will show many many ways of writing comments, | |
but it is mainly a demonstration of | |
making an array of numbers print in a spiral way using ruby language. | |
Have a look at the above representation of the array. | |
This is how the numbers should print spirally. | |
The first array is of the size 3X3. The second is 5X5. |
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
SELECT 1 as 'a' | |
UNION SELECT 2 | |
UNION SELECT 3 | |
UNION SELECT 4 | |
UNION SELECT 5 | |
UNION SELECT 6 | |
UNION SELECT 7 | |
UNION SELECT 8 | |
UNION SELECT 9 | |
UNION SELECT 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
SELECT * FROM (select * from | |
(select adddate('1970-01-01',t4.i*10000 + t3.i*1000 + t2.i*100 + t1.i*10 + t0.i) selected_date from | |
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t0, | |
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t1, | |
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t2, | |
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t3, | |
(select 0 i union select 1 union select 2 union select 3 union select 4 union select 5 union select 6 union select 7 union select 8 union select 9) t4) v | |
where selected_date between '2012-01-1' and '2012-05-15')x WHERE DATE_FORMAT( x.selected_date , '%w' ) = 5 |
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
function ajax_download(url, data, input_name) { | |
console.log( url, data, encodeURI( JSON.stringify(data) ) , input_name ); | |
var form = $('<form method="POST" action="' + url + '">'); | |
$.each(data, function(k, v) { | |
form.append($('<input type="hidden" name="' + k + | |
'" value="' + encodeURI( v ) + '">')); | |
}); | |
$('body').append(form); | |
form.submit(); | |
form.remove(); |