Skip to content

Instantly share code, notes, and snippets.

View deostroll's full-sized avatar
😄
indeed...!

arun.jayapal deostroll

😄
indeed...!
View GitHub Profile
@deostroll
deostroll / input-test10.txt
Last active August 29, 2015 14:16
Sample test input/output of 10 points for Pattern Recognition problem
10
7747 7747
10247 10247
12747 12747
15247 15247
@deostroll
deostroll / localclass.java
Created February 26, 2015 14:23
local class sample in java
public class LocalClassSample {
public static void main(String[] args) {
class Utils {
public void printHello(String name) {
System.out.println("Hello " + name);
}
}
Utils util = new Utils();
@deostroll
deostroll / math_prob.md
Last active April 14, 2017 02:50
Hello!

$f(x) = \dfrac{\log{x}}{x} - a$ $f'(x) = \dfrac{1 - \log{x}}{x^2}$

Compute $x_{n+1}$ given $x_n$ using expression $$x_{n+1} = x_n - \dfrac{f(x_n)}{f'(x_n)}$$

When $x_0 = 1, x_1 = 1 - \frac{(-a)}{1} = 1 + a$ $x_2 = (1+a) - \dfrac{\frac{\log{(1+a)}}{1+a} - a}{\frac{1 - \log{(1+a)}}{(1+a)^2}}$ $= (1+a) - \dfrac{\left\log{(1+a)} - a(1+a)\right}{1 - \log{(1+a)}}$ $\implies x_2 =(1+a)\left( 1- \dfrac{\log{(1+a)} - a(1+a)}{1 - \log{(1+a)}} \right)$

@deostroll
deostroll / report.txt
Last active August 29, 2015 14:17
Test report
The following files were submitted:
----------------------------------
total 24K
-rw-r--r-- 1 5.5K Mar 19 20:03 Brute.java
-rw-r--r-- 1 5.7K Mar 19 20:03 Fast.java
-rw-r--r-- 1 2.7K Mar 19 20:03 Point.java
-rw-r--r-- 1 4.0K Mar 19 20:03 studentSubmission.zip
******************************************************************************
RawSmtp Information: 0 : ---Session Started @ 11:59:52 AM
RawSmtp Information: 0 : << 220 BLREQX343539D Service ready
RawSmtp Information: 0 : >> EHLO BLREQX343539D
RawSmtp Information: 0 : << 500 Syntax error, command unrecognized
RawSmtp Information: 0 : >> HELO BLREQX343539D
RawSmtp Information: 0 : << 250 127.0.0.1
RawSmtp Information: 0 : >> MAIL FROM:<[email protected]>
RawSmtp Information: 0 : << 250 OK
RawSmtp Information: 0 : >> RCPT TO:<[email protected]>
RawSmtp Information: 0 : << 250 OK
bool listen = true;
TcpListener listener = GetListener();
listener.Start();
while(listen)
{
if(!listener.Pending())
{
Thread.Sleep(500); //why?! and why only 500
continue;
@deostroll
deostroll / kdtree.java
Last active August 29, 2015 14:18
kdtree
import java.util.ArrayList;
import java.util.Comparator;
public class KdTree {
private final static boolean HORIZONTAL = true;
private final static boolean VERTICAL = false;
private Node root;
private int size;
public class SMTPServer
{
TcpListener listener;
bool CancelRequested = false;
.
.
.
public void Start()
{
@deostroll
deostroll / UnitTest.cs
Created April 21, 2015 06:57
Email MimeKit
public void POCSaveEmailNormalWith64BitEncoding()
{
string file = @"D:\data\sample.eml";
string EmailBodyMessage = "Hello world. THis is am email with text file attached inline";
string textFileMessage = "this is message in a text file...hello world. This is a sample attachment.";
SaveEmailWithTextFileAttachment(
file,
textFileMessage,
EmailBodyMessage,
TransferEncoding.Base64);
void SomeMethod() {
tcpSource = new TcpListener();
//
//...
//
using(tcpSource) {