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
#include <iostream> | |
#include <stdio.h> | |
#include <curl/curl.h> | |
int main(void) | |
{ | |
CURL *curl; | |
CURLcode res; |
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
var Header = GC.load('google/dif-header'); | |
var SlidingWindow = GC.load('google/slider-generic-27'); | |
var Blocks = GC.load('mebjas/cool-blocks-21'); | |
var Footer = GC.load('facebook/footer/v3.4.2'); | |
// @assumption: json data is loaded into a hidden element by | |
// server with ID: jsonData | |
var jsonString = document.getElementById('jsonData').innerHTML(); | |
// TODO (mebjas): remove this element with ID: jsonData |
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
var PQ = function() { | |
this.comparator = function(e1, e2) { | |
return e1.votes - e2.votes; | |
}; | |
this.elems = []; | |
this.length = this.elems.length; | |
// ID to rank indexing | |
this.elemPosition = {}; |
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
<?php | |
if ( isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' && $_COOKIE["usessl"]==0) { | |
$host = $_SERVER['HTTP_HOST']; | |
$request_uri = $_SERVER['REQUEST_URI']; | |
$good_url = "http://" . $host . $request_uri; | |
echo $good_url; | |
header( "HTTP/1.1 301 Moved Permanently" ); | |
header( "Location: $good_url" ); | |
exit; | |
} |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Net; | |
using System.Net.Http; | |
using System.Web.Http; | |
using System.Net.Http.Headers; | |
namespace testwebapp.Controllers | |
{ |
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
/** | |
* ================================================================= | |
* Javascript code for OWASP CSRF Protector | |
* Task it does: Fetch csrftoken from cookie, and attach it to every | |
* POST request | |
* Allowed GET url | |
* -- XHR | |
* -- Static Forms | |
* -- URLS (GET only) | |
* -- dynamic forms |
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, sys | |
from sklearn import cross_validation | |
from sklearn.feature_extraction.text import TfidfVectorizer | |
from sklearn.feature_selection import SelectPercentile, f_classif | |
from sklearn.naive_bayes import GaussianNB | |
from sklearn.metrics import accuracy_score | |
print("MAX SIZE = ", sys.maxsize) | |
MAXCOUNTPERLABEL = 30000 |
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
<?php | |
if (!defined('__CSRF_PROTECTOR__')) { | |
define('__CSRF_PROTECTOR__', true); // to avoid multiple declaration errors | |
// name of HTTP POST variable for authentication | |
define("CSRFP_TOKEN","csrfp_token"); | |
// We insert token name and list of url patterns for which | |
// GET requests are validated against CSRF as hidden input fields | |
// these are the names of the input fields |
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
load("C:\\Users\\minhazv\\Downloads\\bos_final.Rdata", ex <- new.env()) | |
rows <- nrow(bos_final) | |
cols <- ncol(bos_final) | |
columns <- colnames(bos_final) | |
for (colId in 2: length(columns)) { | |
if (columns[colId] == "chas") { | |
countY <- 0 | |
countN <- 0 | |
for (i in 1:rows) { | |
if (!is.na(bos_final[columns[colId]][i, 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
param ( | |
[Parameter(Mandatory=$true)][string] $dataFile, | |
[Parameter(Mandatory=$true)][string] $param1, | |
[string] $disableCache = "false" | |
) | |
# --------------- CODE RELATED TO DVC ---------------------- | |
$dvcFileName = ".\.dvc.dat" | |
$dvcBreached = $false | |
$dvcMetaData = @{} |