Posts by M8n • 702 points
27 posts
-
1
votes3
answers646
viewsA: PYTHON FUNCTION(METHOD)
The Error is here: nome.append(cadastro(Nome)) You call registration again, remove cadastro nome.append(Nome)
-
0
votes1
answer138
viewsA: Problem with PHP and Html5 Sockets
After you have made Handshake, you can send the messages, need to mask before sending is receive. //Desmascara a mensagem recebida function unmask($text) { $length = ord($text[1]) & 127;…
-
2
votes8
answers955
viewsA: split/regex only on the first vertical bar "|"
var string = "João|||23anos|"; var ret = string.split(/\|(\|*\s*[\w.]+\s*\|*)/, 2); console.log(ret); Explaining: In the regexp the vertical bar(|) will be our separator and in parentheses what we…
-
3
votes1
answer1077
viewsA: Files . jar do not open
You forgot to indicate your main class in the jar. The 'c' flag indicates that you want to create a new jar file and 'f' the file name. The 'and' flag (for entrypoint) creates or replaces the…
-
1
votes1
answer246
viewsA: Object in java contains a JSON, I want to take the JSON information and popular my object attributes
There is already a library that does this, populate the objects and convert the object to json. To popular the object: Gson gson = new Gson(); Acessorio gps = gson.fromJson(json, Acessorio.class);…
-
3
votes1
answer353
viewsQ: How to pass response from one command as argument to another command?
In linux I do something like to take the answer of a command and pass as argument to another: ./program `ruby -e"puts 'Oh' * 3"` In case what is between the accents (ruby -e"puts 'Oh' * 3") will be…
-
1
votes1
answer1277
viewsA: Typeerror in python: source code string cannot contain null bytes
The file this corrupted tries to copy the code is to create a new file.
-
1
votes1
answer365
viewsA: Node.js sending GET command
var http = require("http").createServer(servidor); var io = require("socket.io").listen(http); var fs = require("fs"); function servidor(req, res){ if (req.url.indexOf('/') !=…
-
2
votes1
answer678
viewsA: First search Element inside another Element if it exists in jQuery
$('.form-group') returns an array containing all class elements. $('.form-group').each(function() { var primeiro = $(this).children().first(); if($(primeiro).is('label')) {…
-
0
votes4
answers5359
viewsA: Custom font in html/css does not work
src: url("font/source-sans-pro/SourceSansPro-Regular.ttf"); or so src: url("./font/source-sans-pro/SourceSansPro-Regular.ttf");
-
1
votes2
answers81
viewsA: How to use the LESS "when" operator?
when works as a if mixin will only be executed if the condition is true. box-shadow(@style, @c) when (iscolor(@c)) mixin will only be executed if the @c parameter is a color.…
-
1
votes2
answers226
viewsA: Why does the following code print 'None' instead of the list?
quantidade = int(raw_input()) inicio = 0 lista1 = list() while inicio < quantidade: valor = int(raw_input()) inicio = inicio + 1 lista1.append(valor) print lista1…
-
0
votes3
answers1999
viewsA: How to work with Table of Contents on Hymeleaf?
<div th:each="tipoPreco, status : ${tipos}"> <label th:text="${tipoPreco}"></label> <input type="text" th:name="'preco['${status.index}'].valor'"> <input type="hidden"…
-
7
votes2
answers1190
viewsA: The Operator != is Undefined for the argument type(s)
Primitive types cannot assume value null, only objects if(usuario.getIdUsuario() != 0){ aleterar(usuario); }else { cadastrar(usuario); }
-
1
votes2
answers679
viewsA: Use of instanceof
import java.util.*; class Conta {} class ContaF extends Conta {} class ContaJ extends Conta {} class InstanciaDe { public static void main(String[] args) { ContaF Rafael = new ContaF(); ContaJ…
-
0
votes1
answer98
viewsA: How to do the paralax effect horizontally and vertically at the same time
I think you meant presentation structure, if that’s what this framework is Reveal.js
-
0
votes3
answers821
viewsA: What is an object returned in parentheses?
Java parentheses are used to execute expressions separately. For example. That: return 5 + 5 * 2; And different from that: return (5 + 5) * 2; In the first case it will return 15 in the second it…
-
1
votes1
answer214
viewsA: Create slide down menu Responsive
I did different from your menu more and only you modify http://jsfiddle.net/xuw84x1s/
-
5
votes1
answer82
viewsA: Tools for color combination
Has the Coolors it generates a color palette automatically. You can lock the colors you liked is going changing the others. And can also save your palette, publish, export to different file types.…
-
4
votes4
answers12786
viewsA: How to create a java class?
class NomeDaClasse { // Atributo public int atributo; // Método construtor public NomeDaClasse() { } // Metodo public void metodo() { } } To create a class instance: NomeDaClasse objeto = new…
-
3
votes5
answers25409
viewsA: Shortcut to rename, overwrite, or replace words or variables alike in Sublime Text 3
CTRL + D selects one by one of the same name. Pressing several times, it selects one by one with the same name.
sublime-textanswered M8n 702 -
1
votes3
answers1748
viewsA: Test a constructor with more than one parameter
My suggestion and the Hibernate Validator. Hibernate Validator is an implementation of the specification Bean Validation. Validation Bean allows you to apply restriction rules in annotation form.…
-
0
votes3
answers22761
viewsA: Compile C in Sublime Text
If you are with the Mingw installed is just press Ctrl + B.
-
2
votes2
answers432
viewsA: Merge using Hibernate without erasing other Java data
Entitymanager’s refresh method updates the database instance, overriding the specified properties and keeping the others. The entity to be passed must be in the administered state (Managed).…
-
0
votes2
answers973
viewsA: Image does not appear after Gero o . jar
I opened the jar with Winrar and copy file or folder and just drag the file or folder to Winrar
-
0
votes3
answers512
viewsA: Python binary file saving error
Binary files have characters ASCII the file you are trying to record has characters Unicode you have convert before. def chamaProg(arquivo): var_file = open("C:\\Nitgen\\arquivo.rec","wb")…
-
2
votes1
answer739
viewsA: Video does not get 100% height and width correctly
#bgvid { position: fixed; top: 50%; left: 50%; min-width: 100%; min-height: 100%; width: auto; height: auto; z-index: -100; transform: translateX(-50%) translateY(-50%); } <body> <!-- Todos…