All Questions

3
answers

Unit test with the database

I have an application that uses JPA 2 with Hibernate behind and for unit tests, I use HSQLDB in memory with JUnit 4.11. The HSQLDB is configured in a persistence.xml file in a META-INF folder. My question is: How do I upload the clean databas...
asked on 13.12.2013 / 01:06
3
answers

Is it possible to get timestamps with fractional millisecond precision?

I have to calculate the runtime of a javascript function, I have my code ready and working, my only problem is the getMilliseconds() limit that only goes to 999 and the method execution is extremely fast, so it would need more homes....
asked on 26.03.2014 / 18:46
2
answers

Why is this loop "for" not infinite?

public class Loop { public static void main(String[] a) { int cont=0; for (int i=0; i>=0; i+=2, cont++); System.out.println("cont:"+cont); }} I was struck by the condition of the loop for i>=0 . At the time I thought: loop infini...
asked on 31.08.2018 / 21:04
2
answers

JavaScript Encryption

On my site I use the Facebook API, via ACCESS_TOKEN . This 'key' of access to everything that the corresponding application can provide, that is, it is not feasible to leave it public. In view of this, I would like to know the best way to...
asked on 09.03.2014 / 18:36
2
answers

How interesting is APC to use? Is it recommended to use it with objects?

I have read about the PHP opcode cache, the APC. Most of the materials I found to read, although good, only explain the installation / use of APC functions. What I would like to know is: How interesting is APC to use? Is it recommended...
asked on 11.02.2014 / 21:17
3
answers

Login system security

Hello, I've done a torrent file download and upload system, and this site has a login system with a database, and I'd like you to explain a little about security in PHP and mySql and what should I do to maintain the security of the site. If yo...
asked on 12.05.2015 / 02:12
3
answers

How do I get the last date of a weekday in a given month in SQL Server?

Using the SQL Server T-SQL language, how to get, for example, the last Wednesday of the month of May in a given year?     
asked on 13.12.2013 / 17:45
1
answer

Rails application with offline mode

In a new venture, I need a simple application to stay in place if the internet connection is lost. Can someone explain me how to do this? I had thought about using the HTML5 persistence features in case of connection loss, and somehow I still...
asked on 20.09.2014 / 14:10
2
answers

Order array for a property

I'm trying to sort an array by a specific property (weight), I found some possible solutions but they did not work for me, could anyone tell me where I'm doing something wrong or another way out of my need? How am I trying to sort: functio...
asked on 19.03.2014 / 15:52
1
answer

How / why to do variable chaining with operator = (equality)?

Sometimes I come across these statements threaded in source some libraries and there are usually many chained statements. For example: var foo = foo2 = foo3 = 'foovalue'; However I have never been able to understand the meaning of this, muc...
asked on 28.02.2015 / 23:11