Skip to content

Instantly share code, notes, and snippets.

@bhavjot
bhavjot / reverseArray.cs
Created March 10, 2017 05:14
Reverese Array- Hacker Rank
using System;
namespace HackerRank
{
class Program
{
static void Main(string[] args)
{
int n = Convert.ToInt32(Console.ReadLine());
string[] arr_temp = Console.ReadLine().Split(' ');
@bhavjot
bhavjot / List_binarysearch_minLoss.cs
Created March 10, 2017 05:37
Minimum Loss - Binary Search - some test cases still fail - not a solution
using System;
using System.Collections.Generic;
using System.IO;
class Solution {
static void Main(String[] args) {
/* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution */
int n = Convert.ToInt32(Console.ReadLine());
string[] arr_temp = Console.ReadLine().Split(' ');
long[] arr = Array.ConvertAll(arr_temp,Int64.Parse);
@bhavjot
bhavjot / sortedSet_minimumLoss.cs
Created March 10, 2017 05:46
Minimum Loss - Sorted Set - Perfect Solution - Hacker Rank
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
class Solution {
static void Main(String[] args) {
/* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution */
int n = Convert.ToInt32(Console.ReadLine());
string[] arr_temp = Console.ReadLine().Split(' ');
long[] arr = Array.ConvertAll(arr_temp,Int64.Parse);
############ These can be changed ########################
#Homepage to start the crawl - n.b. the / forwardslash matters....
$homepage = "qds.html"
#Used as validation for relative links, this also stops the site crawling outside of this domain (by breaking the URL for anythign other #than $rawdomain)
$rawdomain = ""
$outputfile = "E:\scripts\listofURLs.txt"
$secretfile = "E:\scripts\secret1.txt"
$(document).ready(function(){
function resultCb(res){
console.log(res);
res.sort(function(a, b){
if(a < b) return -1;
if(a > b) return 1;
return 0;
});
$.each(res,function(title){
$(".news-body").append("<div>" + title+"</div");
@section Scripts {
<script src="~/Scripts/tcp/pdfmake.min.js"></script>
<script src="~/Scripts/tcp/vfs_fonts.js"></script>
<script type="text/javascript">
$(function () {
$('.form-horizontal :input').attr('disabled', 'disabled');
});
function printPdfMake() {
const nsfw = require('nsfw');
const path = require('path');
function watch(pathParam,fnName) {
console.log(pathParam);
const absolutePath = pathParam;// path.resolve(pathParam)
console.log(`Watching ${absolutePath}`)
nsfw(absolutePath,
function(events) {
public class CustomContractResolver : DefaultContractResolver
{
private Dictionary<string, string[]> PropertyMappings { get; set; }
public CustomContractResolver()
{
this.PropertyMappings = new Dictionary<string, string[]>
{
{"Values", new string[]{"AU", "EU" } }
};
$targetDir= "C:\data"
get-ChildItem $targetDir | select name | OUT-File "C:\log\files.txt"
let userRValue = toastr.warning("This query name already exists. Query will be saved as name_copy. <br /><button type='button' value='yes' class='btn clear'>Yes</button><button type='button' value='no' >No</button>",
'Are you sure to continue?',
{
allowHtml: true,
timeOut: 0,
extendedTimeOut: 0,
onclick: function (toast) {
let userResponseValue = toast.target.value;
if (userResponseValue == 'yes') {
console.log(toast.target.value, 'carai');