Posts by Felipe Paetzold • 4,527 points
126 posts
-
3
votes2
answers315
viewsQ: Problem in a foreach
I’m using Laravel 5.3, and by making a foreach in the view, it does not recognize as an object, but if I print only what is in the variable $user it prints an object json. Controller: public…
-
2
votes1
answer160
viewsA: What is the best way to query a user’s data in Laravel?
This is a matter of opinion and need, but I usually like to return by the controller, not to leave too large attribute calls in the view: $usuario = Auth::user(); return…
-
1
votes2
answers2344
viewsA: Is there any way to send image by JSON to an api?
I decided by converting the image to Base64, used angular-Base64-upload, was like this: Input: <input type="file" ng-model="image" base-sixty-four-input> Controller: $scope.register = function…
-
3
votes2
answers2344
viewsQ: Is there any way to send image by JSON to an api?
I want to send an image (I will save it in bank), but I do not know how to send it together on POST. I’m using AngularJs: <input type="file" ng-model="user.imageProfile"> $scope.register =…
-
0
votes1
answer27
viewsA: How to set up a repository I created for Spring Security (Basic)
I used authentication with JWT as follows: public class CustomAuthenticationManager implements AuthenticationManager { @Autowired private UserRepository repository; @Override public Authentication…
-
2
votes2
answers10962
viewsA: Laravel 5.3 Trying to get Property of non-object
I think it’s best to use the Query Builder of Eloquent. Try it this way. public function select_cursos_disciplinas() { $curso = new Curso(); $cursos = $curso->all(); $disciplina = new…
-
4
votes2
answers2249
viewsA: How to release CORS to a particular address?
I decided as follows. @Bean CorsConfigurationSource corsConfigurationSource() { CorsConfiguration configuration = new CorsConfiguration(); configuration.setAllowCredentials(true);…
-
2
votes2
answers2249
viewsQ: How to release CORS to a particular address?
I’m not getting the release CORS for http://localhost:8080, am using Spring Security. I find the following error: Xmlhttprequest cannot load http://localhost:9991/login. Response to preflight…
-
5
votes1
answer3871
viewsQ: Local Storage or Cookie, where is it best to store an authorization token?
We have a project and we will use a token de autorização, we’re using AngularJs to the front end and the back we develop in Java using Spring Framework and Spring Security, and send the token for…
-
2
votes2
answers72
viewsQ: Is it possible to upload an image and rename it only with Java Script?
Have some way to grab the image file of the request, save it in some directory and change the name of the server using JavaScript? Obs: It can be either way, or use any framework (AngularJS, jQuery)…
-
2
votes1
answer288
viewsQ: How to limit a relationship 1 to many JPA?
I’m using JPA with Spring Framework on a project, I would like to limit a relationship 1:n, want to do 1:5, how do I do that? This is the relationship: @ManyToOne private Task task;…
-
4
votes1
answer391
viewsA: Validation of scanf in c
Create a float variable and an integer to compare one to the other, that way. #include<stdlib.h> #include<stdio.h> int lerInteiro(); int main() { int numero=0; numero=lerInteiro();…
-
2
votes1
answer1294
viewsQ: How to bring only the latest records with Laravel 5.2
I need to return the last 10 records to a view.. return view('home.home', [ 'data' => $this->sale->get(), //aqui eu quero pegar os 10 últimos 'nav' => 'dashboard' ]); There’s some…
-
0
votes1
answer472
viewsA: Authentification Laravel
To start with scaffold for Laravel authentication, run the following command on the console: php artisan make:auth This will create standard views for registration and login, as well as a middleware…
-
1
votes1
answer46
viewsA: Class Row with image
You thought of using one table? <div class="row" style="background-color: #ffffff"> <table> <tr> <td><img width="100"…
-
1
votes1
answer229
viewsA: Checkbox not clickable
Use your own HTML, with the appeal disabled. <form action=""> <input type="checkbox" disabled name="1" value="">Desabilitado<br> <input type="checkbox" name="2"…
-
4
votes5
answers819
viewsA: Is the rest of the code inside Try executed after finding Exception?
Code execution is stopped at the time the exception is found, so the answer is no. The rest of the code below Exception is not executed. This is one of the objectives of the structure try/catch. You…
-
1
votes1
answer27
viewsQ: How to set up a repository I created for Spring Security (Basic)
I’m on a project and we’ll use Basic Auth of Spring Security, I would like to know how to make the configuration so that it uses the users created with my Repository. Entity: @Entity public class…
-
7
votes4
answers8013
viewsA: Software to Create Class Diagram
There are many, among them stands out: Astah --> I prefer him Agrouml There is even a tool that allows you to create diagrams from Java code called: Bluej --> I haven’t used it in a while but…
-
31
votes3
answers1336
viewsQ: Is it ideal to use primitive types in Java?
Java has several wrapper’s who help us (Integer, Double, BigDecimal), and also gives us the possibility to use primitive types (int, float, char). A teacher told my college class that Java should…
-
8
votes3
answers1779
viewsA: Many tables with little data or few tables with lots of data?
In accordance with the standards of the database: It is better to have more tables with less attributes in each, and to make association by foreign keys. 1st Normal Form: all attributes of a table…
-
5
votes3
answers245
viewsQ: Error doing Join with Laravel Query Builder
I’m doing the following Join: public function getStockDanger() { $data = DB::table('product') ->join('stock', 'product.id', '=', 'stock.product_id') ->where('stock.stock', '<=', 0)…
-
4
votes2
answers1355
viewsQ: Is there a way to redirect to another page by clicking on a div?
I have a div: <div class="col-lg-4 col-sm-6"> //Essa aqui <section class="panel div-border-red"> <div class="symbol red"> <i class="fa fa-eye"></i> </div> <div…
-
4
votes8
answers2113
viewsA: Is using customer validation enough?
Client-side and server-side validation serve separate purposes: You see, suppose the client has a certain knowledge and tries to circumvent the integrity of his bank. If you only validate on the…
-
5
votes1
answer545
viewsQ: How to install php-5 in Ubuntu?
I’m a new user on Ubuntu, and I’m unable to install the PHP-5 via apt-get, since the stable version is PHP-7, get an error saying no package was found. I tried using the following commands sudo…
-
2
votes2
answers2146
viewsQ: Is it possible to connect a C-based application to a database?
We usually use files to save data using language C (at least). It is possible to connect a relational database to any application made in C? If yes, do you need a library for this and how is this…
-
13
votes3
answers4045
viewsQ: How to add <li> dynamically in <ul> with jQuery?
I’m bringing back notifications and need to dynamically add the path to them, how do I add a <li> to each element of the response? Javascript $(document).ready(function () { $.ajax({ url:…
-
2
votes1
answer814
viewsQ: Collapse bootstrap is not closing
I’m using the following code to make a Collapse with bootstrap, it opens normally but does not close when clicking again, someone can help me? <div class="well"> <button href="#task"…
-
3
votes3
answers379
viewsA: How to convert database timestamp to fill a datetime-local field?
I got it, I used it that way: <input id="date" type="datetime-local" class="form-control" value="{{date("Y-m-d\TH:i:s", strtotime($task->date))}}" name="date" placeholder="Data">…
-
3
votes3
answers379
viewsQ: How to convert database timestamp to fill a datetime-local field?
I need to fill in a field: <input id="date" type="datetime-local" class="form-control" value="{{$task->date}}" name="date"> The return comes in format timestamp ("2016-09-20 10:00:00"), is…
-
0
votes2
answers620
viewsA: Convert View with CSS, JS and PDF Images
I used the barryvdh/Laravel-dompdf, it has a simple use, and I rendered in pdf using including the bootstrap, another option is the barryvdh/Laravel-Snappy, liked less and is a little more complex,…
-
7
votes1
answer146
viewsQ: Can Observer be considered encapsulation break?
Observer use of abstraction and interfaces. Let’s assume that a Observer "assists" the state changes of certain classe and informs them to another external agent, we may consider this a…
-
4
votes1
answer290
viewsA: Material angular datepicker not working
I managed to solve it. In my case I was using a wrong version of material, follows the Imports I made: <link rel="stylesheet"…
-
0
votes1
answer290
viewsQ: Material angular datepicker not working
I’m using Angular Material in a project and need to collect the user’s date of birth in the register, I am trying to use the Datepicker of Material, but the field doesn’t even appear on the screen.…
-
10
votes1
answer4872
viewsQ: How to subtract dates in the Laravel?
I need to calculate the working time on a call. For this I need to do operations with date, how do I do this in the laravel? Code: public function ticketsByUserSearch(Request $request) { $user = new…
-
3
votes1
answer919
viewsQ: How to use Laravel paginate with a manual query?
I have a query manual on my model, and I want to return to view of blade the result of this paging query. Is there any way? Model class Ticket extends Model { protected $fillable = [ 'id', 'title',…
-
2
votes1
answer175
viewsQ: Is it possible to reverse the changes from just one commit file?
Suppose it was made a commit and that a file has been modified erroneously. Is there any way to reverse this commit only for the file you want?
-
1
votes1
answer110
viewsQ: It is possible to put an Animation in the Chart pie
Is it possible to use some Animation in google’s pie-Chart? I put it like this, but it’s not working: var options = { title: 'Tickets por prazo', series: { 0: {"color": '#57c8f2'}, 1: {"color":…
-
1
votes1
answer58
viewsA: How to make the Line Chart stand at ground zero
I managed to solve it, I added it here in the options. vAxis: { minValue:0, viewWindow: { min: 0 } }
google-chartsanswered Felipe Paetzold 4,527 -
1
votes1
answer58
viewsQ: How to make the Line Chart stand at ground zero
My Chart line is starting from -5, I would like the base to be 0, someone knows which configuration to use?…
google-chartsasked Felipe Paetzold 4,527 -
3
votes3
answers792
viewsQ: How do Apache (wamp) stop killing the session by itself?
I developed an application with laravel and left her spinning in the wamp, but after a while it ends up killing the user session, I wonder if there is any setting for it to stop doing this? Thank…
-
3
votes1
answer811
viewsQ: Authentication with Spring Security
Hello, I am doing a project using the Spring Framework, and I need to do a very simple authentication, using users created in the user table even (without any integration with social networks). But…
-
13
votes1
answer1507
viewsA: Focus, when starting the page
You can use an html resource called autofocus <input autofocus type="text" name="Com Foco" placeholder="Com foco"> <input type="text" name"Sem foco" placeholder="Sem foco">…
-
1
votes1
answer122
viewsQ: Is there an API to collect indicators in Redmine?
Is there any API that sets me charts of indicators like each developer’s work time, delivery punctuality among others? I’m on a project with a team and we’re stuck with Redmine, and I think…
-
0
votes1
answer23
viewsA: Select manual in repository using Spring?
I found the solution, I create methods with specific names, like this: List<Answer> findByQuestionIdAndDeadIsFalse(String questionId); I created inside the Repository and call him, making an…
-
0
votes1
answer23
viewsQ: Select manual in repository using Spring?
Hello, I wonder if there is a way to make a select within the Repository, I’m using Spring and REST, I need to return all entities that have another entity, I would take them by id, and I need to…
-
2
votes2
answers5344
viewsQ: Is it possible to capture the current url in the Blade view?
I would like to capture the example url, /user/** (everything that starts with /user), I am using Laravel and Blade, using Request::url() I get localhost:8000 but I need something that can capture…
-
3
votes1
answer1423
viewsA: Doubt about CRUD Use Cases
The term is usually used keep up to indicate the CRUD’s, there are many ways to make use case, there is no right way. For cases like this I usually create the use case administer for example,…
-
8
votes1
answer396
viewsQ: Proposal from the Clojure?
Recently I heard about this programming language, Clojure, it uses only functions, is not typed, and appears to be quite complex, this is an example of a function that takes a parameter and does the…
-
1
votes1
answer226
viewsQ: Mobile responsiveness with bootstrap-material?
I’m using bootstrap-materialon a system, if I use the browser not maximized responsiveness works. But on mobile devices not. Someone knows what might be? Styles <link href="{{…