Skip to content

Instantly share code, notes, and snippets.

View zaharidichev's full-sized avatar

Zahari Dichev zaharidichev

View GitHub Profile
object PlacingRooks {
sealed trait Color
case object White extends Color
case object Black extends Color
case class Rook(x:Int, y:Int, color: Color)
def main(args: Array[String]): Unit = {
val boardOfRooks = for {
x <- 1 to 2048
INFO] --- groovy-maven-plugin:2.0:execute (start-test-broker-A) @ amqp-client ---
erlang.mk:24: Please upgrade to GNU Make 4 or later: https://erlang.mk/guide/installation.html
GEN virgin-node-tmpdir
erlang.mk:24: Please upgrade to GNU Make 4 or later: https://erlang.mk/guide/installation.html
erlang.mk:24: Please upgrade to GNU Make 4 or later: https://erlang.mk/guide/installation.html
../rabbit_common/erlang.mk:24: Please upgrade to GNU Make 4 or later: https://erlang.mk/guide/installation.html
../rabbit_common/erlang.mk:24: Please upgrade to GNU Make 4 or later: https://erlang.mk/guide/installation.html
../rabbit_common/erlang.mk:24: Please upgrade to GNU Make 4 or later: https://erlang.mk/guide/installation.html
../rabbit_common/erlang.mk:24: Please upgrade to GNU Make 4 or later: https://erlang.mk/guide/installation.html
../rabbit_common/erlang.mk:24: Please upgrade to GNU Make 4 or later: https://erlang.mk/guide/installation.html

Discount Store Service

This is a simple REST service written in Spring Boot which returns a list of the popular purchases for a particular user. When the endpoint /api/recent_purchases/:username a response such as that is returned:

[
  {
    "id": 201074,
    "face": "(•◡•)/",
 "price": 604,
{
"id": "4302b00c-5aea-43d5-9967-54b5cbda3a92",
"alertTrigger": {
"id": "0d59d72b-41b7-43e5-bf7a-48aa4f34bd8d",
"userId": "dummyUserId",
"fromLocations": [
{
"locationName": "dummy",
"locationId": "dummy",
"type": "AIRPORT"
2017-01-04 08:09:06
Full thread dump OpenJDK 64-Bit Server VM (25.111-b14 mixed mode):
"Attach Listener" #118 daemon prio=9 os_prio=0 tid=0x00007f5038029800 nid=0xb3 waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"MqConsumer-getTokenInfo-22" #117 prio=5 os_prio=0 tid=0x00007f501ca37800 nid=0x7c waiting on condition [0x00007f4fd55d6000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x000000009519ddf0> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
2017-01-04 07:45:46
Full thread dump OpenJDK 64-Bit Server VM (25.111-b14 mixed mode):
"Attach Listener" #118 daemon prio=9 os_prio=0 tid=0x00007f5038029800 nid=0xb3 waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"MqConsumer-getTokenInfo-22" #117 prio=5 os_prio=0 tid=0x00007f501ca37800 nid=0x7c waiting on condition [0x00007f4fd55d6000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x000000009519ddf0> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
Hibernate: select useraccess0_.id as id1_9_, useraccess0_.is_valid as is_valid2_9_, useraccess0_.issued_at as issued_a3_9_, useraccess0_.uuid as uuid4_9_, useraccess0_.account_id as account_6_9_, useraccess0_.expiration as expirati5_9_ from user_access_token useraccess0_
2017-01-02 20:00:49.733 WARN 1 --- [ool-43-thread-1] o.h.engine.jdbc.spi.SqlExceptionHelper : SQL Error: 0, SQLState: 08006
2017-01-02 20:00:49.734 ERROR 1 --- [ool-43-thread-1] o.h.engine.jdbc.spi.SqlExceptionHelper : An I/O error occurred while sending to the backend.
2017-01-02 20:00:49.749 ERROR 1 --- [ool-43-thread-1] o.s.t.i.TransactionInterceptor : Application exception overridden by rollback exception
org.springframework.dao.DataAccessResourceFailureException: could not extract ResultSet; nested exception is org.hibernate.exception.JDBCConnectionException: could not extract ResultSet
at org.springframework.orm.jpa.vendor.HibernateJpaDialect.convertHibernateAccessException(HibernateJpaDialect.java:238) ~[spring-orm-4.2
.....Result From SkyPicker.....
{
"mapIdfrom": "london",
"duration": {
"return": null,
"departure": 1347
},
"flyTo": "EWR",
"conversion": {
Caused by: java.lang.IllegalArgumentException: Parameter value [7625] did not match expected type [java.lang.String (n/a)]
at org.hibernate.jpa.spi.BaseQueryImpl.validateBinding(BaseQueryImpl.java:897) ~[hibernate-entitymanager-5.0.7.Final.jar:5.0.7.Final]
at org.hibernate.jpa.internal.QueryImpl.access$000(QueryImpl.java:61) ~[hibernate-entitymanager-5.0.7.Final.jar:5.0.7.Final]
at org.hibernate.jpa.internal.QueryImpl$ParameterRegistrationImpl.bindValue(QueryImpl.java:235) ~[hibernate-entitymanager-5.0.7.Final.jar:5.0.7.Final]
at org.hibernate.jpa.spi.BaseQueryImpl.setParameter(BaseQueryImpl.java:638) ~[hibernate-entitymanager-5.0.7.Final.jar:5.0.7.Final]
at org.hibernate.jpa.spi.AbstractQueryImpl.setParameter(AbstractQueryImpl.java:163) ~[hibernate-entitymanager-5.0.7.Final.jar:5.0.7.Final]
at org.hibernate.jpa.criteria.compile.CriteriaQueryTypeQueryAdapter.setParameter(CriteriaQueryTypeQueryAdapter.java:150) ~[hibernate-entitymanager-5.0.7.Final.jar:5.0.7.Final]
at org.hibernate.jpa.criteria.compile
2016-09-27 13:52:33:128 ERROR NotificationTransformer - Get user accounts failed
java.util.concurrent.ExecutionException: org.springframework.web.client.HttpClientErrorException: 414 Request-URI Too Large
at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:357) ~[?:1.8.0_101]
at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1915) ~[?:1.8.0_101]
at com.airconomist.web.transformer.notification.NotificationTransformer.transformNotificationDTOToWeb(NotificationTransformer.java:82) ~[classes/:?]
at com.airconomist.web.transformer.notification.NotificationTransformer.lambda$null$60(NotificationTransformer.java:46) ~[classes/:?]
at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1590) [?:1.8.0_101]
at java.lang.Thread.run(Thread.java:745) [?:1.8.0_101]
Caused by: org.springframework.web.client.HttpClientErrorException: 414 Request-URI Too Large
at org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseError