Edgaras Karka

13

votes
5

answer
15.4k

views

spring data jpa utf-8 encoding not working

I use spring-data-jpa and mysql database. My tables character set is utf-8. Also I added ?useUnicode=yes&characterEncoding=utf8 to mysql url in application.properties file. Problem when I pass characters like 'ąčęėį' to controller to save it in mysql. In mysql I got ??? marks. But when I use my...
Edgaras Karka
1

votes
0

answer
192

views

How to get window scroll bar position using Cypress

I use Cypress for functional testing. And want to test or window vertical scrollbar has specific positions. I tried: cy.document().then((doc) => { cy.window().then(win => {...
Edgaras Karka
1

votes
0

answer
144

views

can`t configure/register dockerized gitlab runner

I have running container with gitlab. Also I try setup dockerized gitlab runner by this article. First i tried run gitlab runner by: docker run -d --name gitlab-runner --restart always -v /srv/gitlab-runner/config:/etc/gitlab-runner -v /var/run/docker.sock:/var/run/docker.sock gitlab/gitlab-runner:...
Edgaras Karka
1

votes
1

answer
497

views

Java hibernate. How to get a entity where a date field is oldest using the criteria?

I have entity DataStatus with the field date. My goal is get the oldest row by date field. public DataStatus getOldest(){ Criteria criteria = session.createCriteria(DataStatus.class); criteria.add(Restrictions.eq('date', MIN)); List results = criteria.list(); if(results.size()
Edgaras Karka
1

votes
1

answer
75

views

htaccess RewriteRule for found id in middle of url

I need get objectid from seo url e.g When I use this rule: RewriteRule ^company/([A-Za-z0-9-]+)$ /lt?openobjectid=$1 evrything is ok when I use example.com/company/12 but if use example.com/company/12/some-text I get server error.
Edgaras Karka
1

votes
1

answer
777

views

Run app to embedded jboss server using maven

I create the simple rest server application using resteasy and maven as build tool by this post http://buraktas.com/resteasy-example-without-using-a-web-xml/. Or it is possible to run created war to the embedded jboss server using maven? I want implement this scenario: 1. I push my project to git hu...
Edgaras Karka
1

votes
1

answer
838

views

Java Mockito how to set new value for property

I have Filter mock object and pass it to testing method. It method change Filter meta property value. But in my test I get old value. org.junit.ComparisonFailure: expected:item[28140f6f5a] but was:item[3abf441213] at org.junit.Assert.assertEquals(Assert.java:115) ... @Test public void testMetaValue(...
Edgaras Karka
1

votes
3

answer
58

views

Standalone light-weight javascript router for update content [closed]

I have simple web page with jquery and 4 page. Header, footer and all pages is static. I am looking the light-weight standalone javascript router for router of contents. My goal is update content without reloading page like angular ui.router do. Main requirements is change url when user click on lin...
Edgaras Karka
1

votes
2

answer
77

views

How to get elements from HTML document using JavaScript by specific tags reg expression?

I want to get all elements from document which starts with ge-. Example . var elements = document.getElementsByTagName('*'); //
Edgaras Karka
1

votes
1

answer
1.7k

views

webpack 2 ts-loader exclude node_modules not working

I try to use typescript 2.2.2 and babel loaders in webpack 2 and exclude node_modules, but when try webpack command still get errors from angular 4.0.0 which is in node_modules. webpack.congfig.js: var path = require('path'); var webpack = require('webpack'); var PROD = true; module.exports = { entr...
Edgaras Karka
1

votes
2

answer
94

views

Installing fontcustom on centos 7 returns error

I try to install font custom tool for generating font icons from svg. When I try to use sudo gem install fontcustom on my cento7 machine I get the error: ERROR: Error installing fontcustom: ruby_dep requires Ruby version >= 2.2.5, ~> 2.2. But my ruby version is 2.2.6. ruby --version ruby 2.2.6p396...
Edgaras Karka
1

votes
1

answer
867

views

How to pass TypeScript enum as array with all Enums?

I have method export const getMatchPicks = (match: IMatch, ends: EndType[]): IPick[] => ends.map(end => matchToPick(match, end)); Also, I have: enum EndType { HOME = 'home', DRAW = 'draw', AWAY = 'away', } My goal call getMatchesPicksList function passing EndType enums as array: getMatchesPicksLis...
Edgaras Karka
1

votes
1

answer
365

views

How to get cypress window size?

I use 'cypress': '2.1.0' for website functional test. Also I have condition in tests: if(WIDTH < 1025 && WIDTH > 480) { it('Open search sidebar', function() { cy.wait(500); cy.get('.FilterStroke_resultsLabel_7gBlM').safeClick(); }); } My question is how to get screen size (WIDTH, HEIGHT)?
Edgaras Karka
1

votes
2

answer
607

views

How to remove try/catch repetitions in class methods?

I have RESTeasy service. And have implemented simple error handling on methods using try catch and feel something is not very well with it. I've noticed try catch repetition on all my methods. So I want ask way how to avoid repetition (to reduce code size) of try catch but not lost functionality. @P...
Edgaras Karka
1

votes
1

answer
144

views

Hibernate @OrderBy anottation and MySQLSyntaxErrorException

I try implement @OrderBy hibernate annotation, but get error Unknown column 'matches0_.start' in 'order clause'. ... @Entity @Table(name ='algo') public class Algo{ ... @JsonView(Views.Internal.class) @ManyToMany(fetch = FetchType.LAZY ) @OrderBy(clause = 'start') // want order list by start protect...
Edgaras Karka
1

votes
2

answer
506

views

Angularjs check or word exist on url

My goal is get true on angularjs controller if url with #how htttp://www.example.com#how or false if url without #how htttp://www.example.com. webApp.controller('ctrl',function($scope){ $scope.showHow = ???; // if url with #how == true else false ...
Edgaras Karka
1

votes
3

answer
1.3k

views

Java object to URL params

I have Java POJO object and my goal is to convert it to URL parameters and use it in POST method. ... public class PayseraRequest { private int projectid = 123; private int orderid = 987; private String accepturl = 'http://www.test.com'; ... My goal is convert object PayseraRequest to String urlPara...
Edgaras Karka
1

votes
1

answer
830

views

Winston logger not write to file

I want to use winston logger in node app for log error to file. But winston not write to file. var logger = new (winston.Logger)({ transports: [ new (winston.transports.Console)(), new (winston.transports.File)({ filename: 'somefile.log' }) ] }); logger.error('test'); file somefile.log is created bu...
Edgaras Karka
1

votes
1

answer
1.4k

views

Import cheerio module to TypeScript app

I try to import cheerio to my typescript based app. import {cheerio} from 'cheerio'; console.log(cheerio); //undefined from package.json: ... '@types/cheerio': '^0.22.5 ...
Edgaras Karka
1

votes
2

answer
1.2k

views

Best practice translate long texts with Java Spring i18n

I use Java Spring i18n for translate my web page. I want to know what is best practice to translate long texts. Example: I have properties file usermsg_en.properties: short_text = short line long_text = post about something with lot of text lines... and jsp file: .... ....
Edgaras Karka
2

votes
2

answer
218

views

Hibernate OneToMany MySQLIntegrityConstraintViolationException: Duplicate entry

I have two java hibernate entities: @Entity public class Match_soccer extends Match{ @Id @GeneratedValue(strategy=GenerationType.AUTO) private int mid; ... And other one: @Entity public class Algo { @Id @GeneratedValue(strategy=GenerationType.AUTO) private int id; @OneToMany private List matches =...
Edgaras Karka
2

votes
2

answer
1.1k

views

Java hibernate get all Entities

I have two Java Hibernate entities user and userPick: @Entity @Table(name='users') public class User{ @Column(length=50) private String name; @OneToMany private List userPicks = new ArrayList(0); ... and @Entity @Table(name='usersPicks') public class UserPick { ... User user; // this line no exis...
Edgaras Karka
2

votes
2

answer
178

views

How replace replace all specific characters using PHP ereg_replace?

I want replace specific symbols with sign % using regular expressions on PHP. E.g. $result = ereg_replace('xlp','%','example')`. //$result = `'e%a%%me' It is possible or I should use other way?
Edgaras Karka
2

votes
1

answer
2.6k

views

Java Hibernate Filter not working

I try use Hibernate filters for get User entity with childs (Filter->Ad) entities by insertTime criteria. My goal is get user object with ads where insertTime > (now-7 days). On test mode I use in-memmory HSQLDB. But test not green: getNotOldAds(com.gecars.app.dao.DaoTester) java.lang.AssertionErro...
Edgaras Karka
1

votes
1

answer
211

views

How to tell Hibernate criteria to skip relations in deep level?

I have hibernate entity GeUser this entity have ManyToMany relation to Pick entity, this entity has OneToOne relations to ALgo entity and this entity has ManyToMany relation with DbMatch entity. My goal is get GeUser entity but without picks.algo.matches . I want use GeUser object on my web app, but...
Edgaras Karka
2

votes
2

answer
7.9k

views

Laravel: The use statement with non-compound name 'Cache' has no effect [duplicate]

This question already has an answer here: Laravel/Composer: The use statement with non-compound name 1 answer I have centos7 php56 laravel 5 and memcached but when try use Cache in routes.php I get: ErrorException in routes.php line 3: The use statement with non-compound name 'Cache' has no effect...
Edgaras Karka
2

votes
1

answer
1.7k

views

Can`t install angular2 material using npm install @angular/material

I try install angular2 material by npm install @angular/material command: [[email protected] quickstart]$ npm install @angular/material [email protected] /home/xxx/quickstart └── @angular/[email protected] npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected]^1.0.0 (node_modul...
Edgaras Karka
1

votes
2

answer
1.9k

views

Git .gitignore not working with log files

I have git repository on /var/www/html/projectx. My goal is to tell git ignore two files /var/www/html/projectx/error.log and /var/www/html/projectx/requsets.log. I try add .gitignore file [[email protected]]$ cd /var/www/html/projectx [[email protected] projectx]$ nano .gitignore .gitignore : *~ *.log
Edgaras Karka
2

votes
2

answer
768

views

org.hibernate.HibernateException: /hibernate.cfg.xml not found from resources

I have new spring-boot project. I use gradle as build manager and Eclpice IDE. I want to use hibernate and try to get configurations from hibernate.cfg.xml file, but get org.hibernate.HibernateException: /hibernate.cfg.xml not found I store this file in resources folder, also I tried put it into ME...
Edgaras Karka
2

votes
1

answer
360

views

Java Hibernate exception MySQLSyntaxErrorException: You have an error in your SQL syntax

I have hibernate entity and when I try insert it into MySQL database I get exception: @Entity public class Pick { @Id @GeneratedValue(strategy=GenerationType.AUTO) private int pid; @OneToOne private Match_soccer match; @OneToOne private Algo1 algo; @Column(length = 100) private String pick; @Column(...
Edgaras Karka
3

votes
1

answer
2.9k

views

How to pass array to AngularJS app via url using ui.router module

I use Angular 1.5 and ui.router module and want to pas int array to app throw url. www.example.com/#/filter?[1,2,5] or www.example.com/#/filter/[1,2,5] or something else. .state('cats', { url: '/filter?catsIds', // or /filter/{catsIds} templateUrl:'cats.html', controller: 'catsCtrl' }) goal: app.co...
Edgaras Karka
2

votes
2

answer
240

views

After install eclim cant find $ECLIPSE_HOME/eclimd file

I try install eclim using Graphical Installer by http://eclim.org/install.html tutorial. Installation process complited without errors, but eclim not working. Not found $ $ECLIPSE_HOME/eclimd file on my eclipse root directory, but $HOME/.vim was created succesful. Where I should look for eclimd?
Edgaras Karka
3

votes
1

answer
1.3k

views

Customize theme colors of eclipse TM terminal plugin

It is possible to change TM terminal color theme? https://marketplace.eclipse.org/content/tm-terminal#group-details
Edgaras Karka
1

votes
1

answer
29

views

Typescript not detecting type mismach

I have function findFlightRecommendation function. It returns Flight type. export const findFlightRecommendation = (state: IStore, sectorIds: T): Flight => { if (!state || !state.search || !state.search.results) { return undefined } ... return state.search.results.find(r => _.isEqual(r.sectorsId, se...
Edgaras Karka
1

votes
1

answer
40

views

Why TypeScript doesn't detect error when use undefined for boolean?

I have the interface: interface Example { foo: boolean } later I use something like: getFoo = (): Example => {foo: undefined} without ts error. It is normal? If it is valid, is it good a practice to use undefined in situations like that?
Edgaras Karka
2

votes
0

answer
1.2k

views

Laravel 5 cache on file not working

I have machine with php 5.6 laravel 5 centos 7.3 apache httpd 2.4. I try use laravel cache config/cache.php: ... 'default' => env('CACHE_DRIVER', 'file'), ... 'file' => [ 'driver' => 'file', 'path' => storage_path('framework/cache'), ], ... but get error: file_put_contents(/var/www/html/project/ap...
Edgaras Karka
24

votes
2

answer
20.8k

views

Logging request and response in one place with JAX-RS

I have a RESTEasy web server with lot of methods. I want implement logback to track all requests and responses, but I don't want add log.info() to every methods. Maybe there's way to catch requests and responses in one place and log it. Maybe something like a filter on HTTP request process chain o...
Edgaras Karka
2

votes
0

answer
88

views

Babel output file not exist

I try to compile es5 js file using Babel, but get file doesn`t exist error. command: npm run babel ./application/modules/js/seatMap/services/BabelTest.js --output-file ./application/modules/reservation_module/js/seatMap/services/babelOutput.js error after command execution: ./application/modules/res...
Edgaras Karka
2

votes
0

answer
117

views

How to use linting indent rule in tsx?

I use TypeScript and React TSX. For linting, I use tslint and tslint-react. How to write the rule for indent in TSX. // want to get 2 spaces indent error. vvv
Edgaras Karka
2

votes
1

answer
4.8k

views

Java Spring HttpMessageNotWritableException/JsonMappingException with Hibernate FetchType.LAZY in Jackson serialization process

I use Java Spring web controller And jackson for parsing responses. Also I have four Java Hibernate entities: User Filter Make Model, with bidirectional relation in Make -> Model(s): GeUser.getFilters().get(0).getModel().getMake().getModels().get(0).getMake()... I tried add @JsonIgnoreProperties(v...
Edgaras Karka

View additional