All Questions

1
answer

Unit test of implementations of a generic class

Suppose we have the following Interface: public interface ICRUDService<T> { T Create(T entity); } Abstract Implementation: public abstract class CrudService<T> : ICRUDService<T> { IRe...
asked on 06.03.2015 / 00:10
1
answer

Injecting content into text copied from the page

I'd like to know how to inject content into text copied from the page. When I copied a text from a website, it came along with an institutional text and the site link. You can see this happening in this site .     
asked on 27.02.2015 / 22:04
2
answers

How to format datetime in YYYY-MM-DDThh format: mm: ss.sTZD in Django / Python?

I'm having a difficulty in Django in returning the datetime at the local timezone. In Django I set USE_TZ=True and TIME_ZONE = 'America/Sao_Paulo' When calling timezone.now() , return the datetime with time in utc, I do no...
asked on 27.02.2015 / 02:56
1
answer

Add Field Time MySql

Dear, I have a table with a TIME-type column, which stores the time worked on the day, and I'm trying to add these times to the end of a month, but with no success. I used the following query: Query 1: SELECT TIME_FORMAT((SELECT sum(TOTA...
asked on 03.03.2015 / 11:17
1
answer

Python - Test Read Permissions

Is there a function that returns, in Python, True if I have read permissions on the file in python?     
asked on 04.03.2015 / 00:31
1
answer

Applet does not run in browser

Does not run the Applet. Just give that feedback. Thisismyjavaclass.publicclassSiteSelectorextendsJApplet{privateHashMap<String,URL>sites;//nomeseURLsdesiteprivateArrayList<String>siteNames;//nomesdesitesprivateJListsiteChooser;//...
asked on 22.08.2014 / 01:28
1
answer

How to work with associative table with additional attributes in REST?

Imagine that you have 3 entities: Student, Discipline and Student Discipline. The AlunoDisciplina entity, in addition to relating Aluno to Disciplina , also includes other information, such as the student's final grade. So...
asked on 25.02.2015 / 20:53
1
answer

Non-static variable can not be referenced from non-static context

I'm using a context where I have a variable of type array with reference to another class. When trying to declare the object-instantiated class and declare its size this error is returned and I would like to understand why:    non-static vari...
asked on 09.09.2014 / 03:19
1
answer

Java interface layout

I'm developing a program for a friend and I'm using the Java language for this. I'm using the Netbeans IDE which has the feature of building the user interface (UI) by drag n 'drop, using Swing. I have a lot of trouble building UI, I'm pretty...
asked on 14.10.2014 / 21:36
1
answer

How to list a sample of all tables in a MySQL database?

I need to sample all the tables in a MySQL database, for example through SELECT * ... LIMIT 10 . I already have the code that returns all the tables in the current database: select table_name from information_schema.tables where table...
asked on 26.09.2014 / 19:08