Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 pyspark.sql.functions import explode | |
from pyspark.sql.functions import split | |
from pyspark.streaming import StreamingContext | |
from pyspark.sql import SparkSession | |
import time | |
spark = SparkSession.builder \ | |
.appName('Streaming') \ | |
.getOrCreate() |
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
const express = require('express') | |
const path = require('path') | |
const httpPort = 1026 | |
const app = express() | |
app.use(express.static(path.join(__dirname, './'))) | |
app.get('/', function(req, 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
def callPreprocessData(fn='/home/someusr/Downloads/flows.csv'): | |
data=pd.read_csv(fn) | |
print(data.head(3)) | |
data['Bytes']=data['Bytes'].fillna(0) | |
data['Bytes']=data['Bytes'].astype(str) | |
#silly nfdump writes bytes as integer but sometimes it converts it to | |
#mb. The following finds those entries and converts them into bytes. | |
data.loc[data['Bytes'].str.contains('M'),'Bytes'] = data[data['Bytes'].str.contains('M')]['Bytes'].apply(lambda x: float(x[1:-2])*1024*1024) | |
data['Bytes']=data['Bytes'].astype(int) |
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
/** | |
* C program to explain address, pointer, reference, and dereference | |
* You can compile this with | |
* 'g++ pointers_program.c -o pointers' and then call it by typing | |
* './pointers' in your shell. | |
*/ | |
#include <stdio.h> | |
int main() |