Skip to content

Instantly share code, notes, and snippets.

@harshityadav95
harshityadav95 / Error.log
Created May 31, 2018 12:53
Filebeat Error
c:\Program Files (x86)\ELK\filebeat>filebeat -e --modules=apache2 --setup -M "apache2.access.var.paths=[‪D:\EKL\examples-master\examples-master\Common Data Formats\apache_logs\apache_logs]"
2018-05-31T16:50:35.105+0530 INFO instance/beat.go:468 Home path: [c:\Program Files (x86)\ELK\filebeat] Config path: [c:\Program Files (x86)\ELK\filebeat] Data path: [c:\Program Files (x86)\ELK\filebeat\data] Logs path: [c:\Program Files (x86)\ELK\filebeat\logs]
2018-05-31T16:50:35.106+0530 INFO instance/beat.go:475 Beat UUID: 4f256bbb-e649-4518-a5ae-63f0e7b349c3
2018-05-31T16:50:35.106+0530 INFO instance/beat.go:213 Setup Beat: filebeat; Version: 6.2.4
2018-05-31T16:50:35.107+0530 INFO elasticsearch/client.go:145 Elasticsearch url: http://localhost:9200
2018-05-31T16:50:35.107+0530 INFO pipeline/module.go:76 Beat name: HarshitWin10
2018-05-31T16:50:35.110+0530 INFO beater/filebeat.go:62 Enabled modules/filesets: apache2 (access, error)
2018-05-31T16:50:35.111+0530 IN
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace calculatorApp
{
class operations
{
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Infragistics.Win.Misc;
@harshityadav95
harshityadav95 / code
Created December 9, 2017 11:10
Sandwhich String
/* A sandwich is two pieces of bread with something in between. Return the string that is between the first and last appearance of "bread" in the given string, or return the empty string "" if there are not two pieces of bread.
getSandwich("breadjambread") → "jam"
getSandwich("xxbreadjambreadyy") → "jam"
getSandwich("xxbreadyy") → ""
link: http://www.javaproblems.com/2013/11/java-string-2-getsandwich-codingbat.html
*/
static String getSandwich(String inputString) {
@harshityadav95
harshityadav95 / code.java
Created December 9, 2017 10:52
/* Return the "centered" average of an array of ints, which we'll say is the * mean average of the values, except ignoring the largest and smallest * values in the array. If there are multiple copies of the smallest value, * ignore just one copy, and likewise for the largest value. Use int division * to produce the final average. You may assume …
/* Return the "centered" average of an array of ints, which we'll say is the
* mean average of the values, except ignoring the largest and smallest
* values in the array. If there are multiple copies of the smallest value,
* ignore just one copy, and likewise for the largest value. Use int division
* to produce the final average. You may assume that the array is length 3
* or more.
*/
static int centeredAverage(int[] inputIntArray) {
Arrays.sort(inputIntArray);
@harshityadav95
harshityadav95 / file.java
Created December 9, 2017 10:41
Character having Highest Frequencey in string "aaabbabsssssssssssss" will give output "s"
static String findHighestFreqChar(String inputStr) {
// Create array to keep the count of individual
// characters and initialize the array as 0
int count[] = new int[256];
// Construct character count array from the input
// string.
int len = inputStr.length();
for (int i=0; i<len; i++)
@harshityadav95
harshityadav95 / code.java
Last active December 9, 2017 08:17
Differnce between the smallest and largest element in the array
int maxDiff(int arr[])
{
int arr_size = arr.length;
int max_diff = arr[1] - arr[0];
int i, j;
for (i = 0; i < arr_size; i++)
{
for (j = i + 1; j < arr_size; j++)
{
//metroLabel16.Text = "Running";
System.Net.WebClient wc = new System.Net.WebClient();
//DateTime Variable To Store Download Start Time.
DateTime dt1 = DateTime.Now;
//Number Of Bytes Downloaded Are Stored In ‘data’
byte[] data = wc.DownloadData("https://github.com/harshityadav95/static-file-storage/blob/master/text.txt");
//DateTime Variable To Store Download End Time.
using ClassLibrary1;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.NetworkInformation;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp1
{
from django.shortcuts import render
# Create your views here.
def home(request):
return render(request,'webapp/home.html',{})