Posts by LeoCBS • 1,139 points
28 posts
-
1
votes2
answers317
viewsQ: Persist JSON Postgres / Golang
Hello, is there any way to persist a JSON in postgres with the GO language? I don’t want to do a manual Insert, I want to map my JSON with a struct and persist, similar to Hibernate in Java. found…
-
9
votes1
answer5098
viewsQ: Funcionamento @classmethod
I would like to better understand the @classmethod annotation of Python. Briefly it works as a second alternative to constructor. But what are the benefits? When to use? @classmethod def…
-
3
votes1
answer1776
viewsQ: Unit test/ Mock of a JPA query
Hello, how do I generate a unit/mock test of a JPA/Criteria query ? What can I guarantee by mocking my objects? Table structure? What should I mock? The consultation is very simple, only one select…
-
6
votes1
answer1253
viewsQ: Thread Control in Java
I have a multi thread Java system that uses the class ThreadGroup which is deprecated. With my current implementation I can’t "kill" a thread in lock either. How to implement efficient code for…
-
2
votes2
answers286
viewsA: Convention for use of Pouchdb with Couchdb
Hello, the comparison between Mysql and Pouchdb is complicated, we are talking about different paradigms between databases. Mysql is a relational database (Entity/Relationship) and Puchdb is…
-
0
votes2
answers251
viewsA: Map.Keyset() method does not return all keys
Hello, try this way: Properties prop = new Properties(); InputStream input = null; try { String filename = "config.properties"; input = getClass().getClassLoader().getResourceAsStream(filename); if…
-
2
votes2
answers161
viewsA: Version Control Help - GIT/ SVN
Hello, I strongly advise you to use Git, as it is the most widely used version control tool today, and it’s never good to be out of date. Git is not the most used by chance. It follows the…
-
1
votes1
answer259
viewsA: Security in Domain driven design
Hello, The security part should stay before the creation of the domain events. It is not recommended to leave the security part to interface as you will have code repetition. We will use the…
-
3
votes1
answer4154
viewsA: How to convert a Java project to Eclipse for a Maven project?
The Eclipse "Convert to Maven project" action just creates Project Object Model (pom.xml) start. Eclipse does not change the folder structure of your project. To create a folder test just create a…
-
5
votes2
answers2783
viewsQ: Add new file to commit
How do I add new files to a commit already done in Git without creating a new commit? If you have already pushed to the remote server, like "re-commit"?
-
2
votes1
answer132
viewsQ: Import Python Reportlab
Hello, I’m trying to import the following lib in my Python project 2.7: from reportlab.lib.rparsexml import simpleparse Error: Import: No module named reportlab.lib.rparsexml I tried to install the…
-
1
votes1
answer69
views -
3
votes1
answer859
viewsA: How to use friendly Urls?
Hello, you use the . htaccess file to dynamically handle your urls. Below a friendly url scenario: .htaccess RewriteEngine On RewriteRule %{REQUEST_FILENAME} !-f RewriteRule %{REQUEST_FILENAME} !-d…
-
18
votes3
answers9801
viewsA: What’s the encoding for in Base64?
Base64 is a method for coding data for Internet transfer (MIME encoding for content transfer). It is often used to transmit binary data by transmission means that only deal with text, for example to…
-
0
votes1
answer187
viewsA: Doubts in the creation of the relationship
Make a relationship OneToMany. Class Venda: /** * @ORM\Entity * @ORM\Table(name="Venda") */ class Venda { /** * @ORM\Column(type="integer") * @ORM\Id * @ORM\GeneratedValue */ protected $id; /** *…
doctrine-2answered LeoCBS 1,139 -
1
votes1
answer1722
viewsA: Error Code: 1048, SQL State: 23000 Column 'colegiado_id' cannot be null
The "colegiado_id" column cannot be null. You have two alternatives: perform an alter table in the Special table chosen to accept null value or change the query (select) not to return null values…
-
4
votes1
answer1678
viewsA: Detached Entity passed to persist
This error happens when you try to persist an object with the ID already filled, and the ID is auto incrementable. You can always before persisting set to null the id, or try to merge, or use the…
-
10
votes2
answers2027
viewsA: What are operators for | & << >>?
Hello, these characters are binary operators in JS, that is, the operations are done at the bit level: Operator Description Example Same as Result Decimal & AND x = 5 & 1 0101 & 0001…
-
0
votes2
answers14029
viewsA: Mysql - Create temporary table according to dynamic SELECT
Try using the Mysql "CREATE TABLE AS" command CREATE TEMPORARY TABLE IF NOT EXISTS table2 AS (SELECT idCentroCusto, 'Dez/14', 'Jan/15', 'Fev/15', 'Mar/15', 'Abr/15', 'Mai/15', totalAnual FROM…
-
0
votes1
answer865
viewsA: Method copy text in javascript
Create two variables to store content: var firstDivContent = document.getElementById('mydiv1'); var secondDivContent = document.getElementById('mydiv2'); Now just set the value in the second div:…
-
1
votes1
answer601
viewsA: Mysql - How to Enable Federated?
Edit your file /etc/my.cnf and adds the line: federated Then just restart the server. Source…
-
2
votes1
answer972
viewsA: How to send data through the soapUI tool and how to do manual?
First, I recommend you study a little about Webservices. SOAP It is an XML format message transfer protocol for use in distributed environments. The SOAP standard works as a type of framework that…
-
3
votes3
answers1030
viewsA: Search Mongodb Array
Hello, to search for a specific history, use the $elemMatch operator: db.teste.find({HISTORICO: {$elemMatch: {DADOS_HISTORICO:"teste"}}}) Documentation of mongodb Similar question in English…
-
0
votes1
answer69
views -
2
votes1
answer5078
views -
3
votes4
answers1398
viewsQ: Tool to generate Xpath
Hello, I’m making a Spider to capture with Xpath some web data. But the creation of xpath is a bit laborious. Does anyone know any way to train Xpath? Example; I click 5 times on a link and some…
-
1
votes2
answers228
viewsA: Mobile site content with jQuery click
Uses jQuery’s . Animate() to move your Ivs. Example moving the first div down: $( "a.move" ).click(function() { $(".cont").animate({"bottom":"-=50px"},"slow"); }); You can move your div in all…
-
1
votes2
answers162
viewsA: Error trying to insert values in Mysql
The server is unable to access the database at "localhost" Connection to http://localhost refused 02-18 15:56:59.890: W/System.err(1067): at Try changing the server settings to the local ip…