Skip to content

Instantly share code, notes, and snippets.

View AlexGabor's full-sized avatar

Alexandru Gabor AlexGabor

View GitHub Profile
@AlexGabor
AlexGabor / BookServiceTest.java
Created March 17, 2016 19:43
tests for Book
package ro.oneandonly.bookstore.service;
import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import ro.oneandonly.bookstore.domain.Book;
import ro.oneandonly.bookstore.domain.validators.ValidatorException;
import ro.oneandonly.bookstore.repository.Repository;
package ro.oneandonly.bookstore.service;
import ro.oneandonly.bookstore.domain.Book;
import ro.oneandonly.bookstore.domain.Client;
import ro.oneandonly.bookstore.domain.validators.ValidatorException;
import ro.oneandonly.bookstore.repository.Repository;
import java.util.Comparator;
import java.util.List;
import java.util.Set;
__author__ = 'alex'
def hamming(l1, l2):
distance = 0
for i in range(len(l1)):
if l1[i] != l2[i]:
distance += 1
return distance
package ro.oneandonly.bookstore.util;
import org.jdom2.Document;
import org.jdom2.Element;
import org.jdom2.JDOMException;
import org.jdom2.input.SAXBuilder;
import org.jdom2.output.Format;
import org.jdom2.output.XMLOutputter;
import ro.oneandonly.bookstore.domain.BaseEntity;
package ro.oneandonly.bookstore.util;
import org.jdom2.Document;
import org.jdom2.Element;
import org.jdom2.JDOMException;
import org.jdom2.input.SAXBuilder;
import org.jdom2.output.Format;
import org.jdom2.output.XMLOutputter;
import ro.oneandonly.bookstore.domain.BaseEntity;
package ro.oneandonly.bookstore.util;
import org.jdom2.Document;
import org.jdom2.Element;
import org.jdom2.JDOMException;
import org.jdom2.input.SAXBuilder;
import org.jdom2.output.Format;
import org.jdom2.output.XMLOutputter;
import ro.oneandonly.bookstore.domain.BaseEntity;
package ro.oneandonly.bookstore.service;
import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import ro.oneandonly.bookstore.domain.Book;
import ro.oneandonly.bookstore.domain.validators.ValidatorException;
import ro.oneandonly.bookstore.repository.Repository;
@AlexGabor
AlexGabor / scene.xml
Created August 16, 2019 16:53
ConstraintSet start
<ConstraintSet android:id="@+id/start">
<Constraint
android:id="@+id/header"
android:layout_width="0dp"
android:layout_height="wrap_content"
motion:layout_constraintEnd_toEndOf="parent"
motion:layout_constraintStart_toStartOf="parent"
motion:layout_constraintTop_toTopOf="parent" />
</ConstraintSet>
@AlexGabor
AlexGabor / scene.xml
Created August 16, 2019 16:56
ConstraintSet end
<ConstraintSet android:id="@+id/end">
<Constraint
android:id="@+id/header"
android:layout_width="0dp"
android:layout_height="wrap_content"
motion:layout_constraintEnd_toEndOf="parent"
motion:layout_constraintStart_toStartOf="parent"
motion:layout_constraintBottom_toTopOf="parent" />
</ConstraintSet>
@AlexGabor
AlexGabor / scene.xml
Created August 16, 2019 17:00
Transition
<Transition
motion:constraintSetEnd="@+id/end"
motion:constraintSetStart="@+id/start">
<OnSwipe
motion:onTouchUp="stop"
motion:dragDirection="dragUp"
motion:touchAnchorId="@+id/header" />
</Transition>