This file contains hidden or 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
| <project name="myproject" default="dist" basedir="."> | |
| <property name="src.dir" value="src" /> | |
| <property name="build.dir" value="build" /> | |
| <property name="dist.dir" value="dist" /> | |
| <path id="project.classpath"> | |
| <pathelement location="${build.dir}"/> | |
| </path> | |
| <target name="compile" description="Compile the project"> | |
| <mkdir dir="${build.dir}" /> |
This file contains hidden or 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
| package com.myproject; | |
| public class Foo { | |
| public int bar(int a) { | |
| return a+1; | |
| } | |
| } |
This file contains hidden or 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
| <project name="myproject-test" default="test" basedir="."> | |
| <property name="src.dir" value="src" /> | |
| <property name="build.dir" value="build" /> | |
| <property name="reports.dir" value="reports"/> | |
| <property name="tested.jar.file" value="myproject.jar"/> | |
| <property name="junit.reports.dir" value="${reports.dir}/junit"/> | |
| <path id="project.classpath"> | |
| <pathelement location="lib/junit-4.4.jar"/> | |
| <pathelement location="${tested.jar.file}"/> | |
| <pathelement location="${build.dir}"/> |
This file contains hidden or 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
| package com.myproject; | |
| import org.junit.Test; | |
| public class FooTest { | |
| @Test | |
| public void test1() throws Exception { | |
| Foo f = new Foo(); | |
| assert f.bar(1) == 2; | |
| Thread.sleep(60000); // Just to simulate long tests |
This file contains hidden or 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
| m = int(input("enter a positive integer to check if it's a**2 + b**2: ")) | |
| for a in range(1, m): | |
| for b in range(1 ,m): | |
| if a**2 + b**2 == m: | |
| print (a, b, m) |
This file contains hidden or 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 random | |
| def is_prime(num): | |
| for i in range(1000): | |
| a = random.randint(2, num - 1) | |
| if pow(a, num - 1, num) != 1: | |
| return False | |
| return True | |
| def dh_exchange(p): | |
| g = random.randint(1, p - 1) |
This file contains hidden or 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 socket | |
| client = socket.socket() | |
| client.connect(("127.0.0.1", 5678)) | |
| print("Connected! I'm the man/woman!") | |
| client.send("Hey you!".encode()) | |
| message = client.recv(2000).decode() | |
| print("Server sent " + message) |
This file contains hidden or 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
| class Point: | |
| """ this point is... | |
| bnla ba lba | |
| """ | |
| def __init__(self, x = 0, y = 0): | |
| self.x = x | |
| self.y = y | |
| def __repr__(self): | |
| return "(" + str(self.x) + "," + str(self.y) + ")" |
This file contains hidden or 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
| {% extends 'includes/base_header.html' %} | |
| {% from 'includes/links.html' import course_link %} | |
| {% block window_title %}אנשים{% endblock %} | |
| {% block stylesheets %}{{ super() }} | |
| <link rel="stylesheet" type="text/css" href="/static/css/people-list.css" /> | |
| {% endblock %} |
This file contains hidden or 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 my_max(lst): | |
| mv = lst[0] | |
| for i in lst: | |
| if i > mv: | |
| mv = i | |
| return mv | |
| def rmax_oz(lst): | |
| if len(lst) == 1: | |
| return lst[0] |
OlderNewer