Posts by novic • 35,673 points
1,265 posts
-
3
votes1
answer24
viewsA: Sums and Reformatting db for a Datagridview
Basically: System.Data.DataTable dt = new System.Data.DataTable(); //DataTable string strConection = ""; // informe a string de conexao using (MySql.Data.MySqlClient.MySqlConnection db = new…
-
1
votes1
answer767
viewsA: Multi-Insert with Laravel 5.3 dynamic form
A array of information to be recorded with Laravel-eloquent, needs to be made a for for each item and records one to one as follows: public function store(DemandaFormRequest $request) { $dataForm =…
-
2
votes2
answers161
viewsA: Customized Viewbag, how to do?
At the time of the creation of the Selectlist, failed to place the two fields that are important elements in the assembly of the select of html, and made an adjustment to your ViewBag for…
-
0
votes2
answers1272
viewsA: Convert int to Hex
Valor decimal for hexadecimal utilize Tostring("X"): int value = 255; string hexValue = value.ToString("X"); Exit: FF Example References: Standard numeric character strings The Hexadecimal ("X")…
-
3
votes2
answers7812
viewsA: Accessing Components from Another Form
Within the MotorForm brood 3 methods that will assist in the recovery, since the TextBox the visibility is private and I don’t particularly like to change that. public class MotorForm: Form { public…
-
4
votes1
answer89
viewsA: Progress bar in angulajs
This plugin does not have to angular, have to use jquery or nay (I find it simpler with jQuery). Minimal example var app = angular.module('app', []); app.controller('ctrl', ['$scope',…
-
4
votes1
answer90
viewsA: bring menus and active submenus C#
You have to install a package to add filter functionality to the include, install: PM> Install-Package Z.EntityFramework.Plus.EF6 add the package reference: using Z.EntityFramework.Plus; then…
-
4
votes1
answer343
views -
4
votes3
answers196
viewsA: Remove from Integer List
The method remove of this structure (List<Integer> list = new ArrayList<>();) has two parameters for removal, one is of the type Object and the other is index (index) of position, in his…
-
4
votes3
answers234
viewsA: Global variables recursion
You do not need to use the variable int soma, only an adjustment in the logic of its recursive function to sum only the values that are positive: #include <stdio.h> int SomaPositivos(int…
-
1
votes3
answers2541
viewsA: Taking String values from Arraylist<Object>
Each line created in this list is of the type array of Object[], when you recover, you have to give a cast of the type (which in this case is Object[]) and to regain the positions which in their…
-
17
votes1
answer10928
viewsA: What’s the difference between @Yield and @include on Laravel?
@yield is used to display the contents of a particular section, which is defined by @section that is responsible for defining a content section. An example are the templates which will serve as a…
-
3
votes1
answer1102
viewsA: How to print text within a @if{ } condition in Asp.Net in cshtml file?
May be: For razor block <text>: <text>às</text> // pode ser varias linhas de texto entre a tag or @:, needs to be inside the code block @if(){ // } @while(){ // } etc.: @if (true)…
-
2
votes4
answers342
viewsA: Laravel 5.3 - Model that can be created by multiple Controllers
I would, so traits, which is a practice used in framework Larable, where the controllers can inherit this code. Example trait trait DuplicatasOfControllers { public function inserirDuplicata(Request…
-
5
votes1
answer9661
viewsA: htmlspecialchars() expects Parameter 1 to be string, Object Given
The data to work with Form::select needs to be a array with key and value, example: $array = [key1 => valor1, key2 => valor2]; then format the data so on your controller: public function…
-
2
votes2
answers184
viewsA: Do data received via Request using Doctrine need to be processed?
By code (source) of Request and consequently Parameterbag, can be used as follows which already get what is expected: $id = $request->request->getInt('id'); $nm =…
-
4
votes3
answers2397
viewsA: How to check if there is a certain number in a php variable?
Utilize strrpos or strripos if you don’t return falso was found: int strrpos ( string $haystack , string $needle [, int $offset ] ) Example in your code: <?php $numeros = "1 2 3 4 5 6 7 8 9";…
-
2
votes1
answer1592
viewsA: Change order of objects in the array by dragging rows from the JS angular table
Use one more javascript the ui.sortable, is responsible for the changes in its collection including changing the indexation of the elements according to the new position. Define the directive in…
-
2
votes2
answers1054
viewsA: Jquery Validate with Jquery-Price-Format
Should create a custom validation for that particular type and remove the prefix for only the test value, example: jQuery.validator.addMethod("valuethanmorezero", function(value, element) { var…
-
2
votes1
answer436
viewsA: Destroy(Logout) Session_id Codeigniter
You need to create a method and delete this user’s record by session_id table ci_sessions: Html <td> <a href="/login/deslogar/<?php echo $linha->session_id;?>" class="btn…
-
1
votes1
answer2169
viewsA: Confirmation message YES/NO
There is no way to change, customize it so it can be implemented with several plugins javascript: Jquery.ui $(function() { $("#whats").focus(function() { $("#dialog-confirm").dialog({ resizable:…
-
2
votes1
answer77
viewsA: Doubt about java.util.Date
There are problems in two lines: In that: java.util.Date date2 = (java.util.Date(date.clone())); it is right to make a cast for java.util.Date because clone() returns the type Object: java.util.Date…
-
3
votes1
answer178
viewsA: Jquery plugin does not work on github pages
Error in the debug: The request has been blocked because the link does not come from a secure address. Mixed Content: The page at 'https://fmm312.github.io/site/' was Loaded over HTTPS, but…
-
2
votes1
answer208
viewsA: Problem calling Drivemanager.getConnection?
I can’t understand, why cast with Connection if he’s a Connection? It happens because it has import wrong (import com.mysql.jdbc.Connection;) in your code the correct would be imports…
-
3
votes1
answer1176
viewsA: How to print file without opening?
A way to send direct to printer, but, have to install on the computer the Acrobat Reader (or similar). Example: Configure the first 4 lines using local settings on your computer string…
-
0
votes1
answer51
viewsA: Access nested JSON with Angularjs
Actually, your code has an error related to this tag: <div class="col-lg-2 col-lg-offset-4 col-md-2 col-sm-2 col-xs-2" ng-controller="ModalController as $ctrl"> <button type="submit"…
-
2
votes2
answers282
viewsA: Validate the return of select PHP
With rowCount() of Pdostatement: $stmt = $dbh->prepare($fat_ped_online_vende); $stmt->execute(); if($stmt->rowCount() > 0) // verificar se a SQL trouxe linhas { $result =…
-
6
votes1
answer1805
viewsA: How to pass parameter to MVC controller
The role of Controller must bear the same name as tag html generated in the case ddlListaUnidades: [HttpPost()] [ValidateAntiForgeryToken()] public ActionResult Pesquisar(string ddlListaUnidades) {…
asp.net-mvcanswered novic 35,673 -
1
votes2
answers291
viewsA: Problem with login in Laravel 5.3
This is the standard code for authentication documentation, Realize it’s the countryside email and password, in your case you’re using another field, that’s the problem. if (Auth::attempt(['email'…
laravel-5.3answered novic 35,673 -
2
votes1
answer412
viewsA: Class attribute with predetermined values
You can use a enum with defined values in the case of M = 1 and F = 2: public enum Sexo { Masculino = 1, Feminimo = 2 } [DisplayName("SEXO")] public Sexo Sexo { get; set; } Observing: In that link…
-
1
votes1
answer642
viewsA: Jquery Validate does not work with extension type - File Input
To work this type of validation is simple, add the Additional-methods.min.js along with jQuery and jQuery.Validation, and in its validation include extension with the types you want to check, in the…
-
2
votes2
answers1785
viewsA: Open second modal only after closing the first
Utilize hidden.bs.modal, that is to say, $('#myModal').on('hidden.bs.modal', function (e) { }); is the event that means the closing of the modal and in it calls the next modal with…
-
2
votes1
answer499
viewsA: Dynamic list in alphabetical order?
Utilize App\Categoria::orderBy('nome')->get(), although this is not a good recommendation. Should come the die ready to View of Controller, but there’s the way it should be. <div…
-
2
votes1
answer636
views -
4
votes2
answers1639
viewsA: Split values in Brazilian currency (R$) in php?
The error is in that line $valor = double(6.999,99); should be $valor = 6999.99;, that is, it should be put in place of the pennies . (dot) and in the thousand remove the , (comma). <?php…
-
3
votes1
answer63
viewsA: state' cannot be Assigned to -- it is read only - Entity Framework
Why doesn’t it work? It’s returning an object unknown (anonymity) and its elements are treated as readOnly (read-only), then to function bring the object in its entirety without Select, do so: var…
-
2
votes2
answers638
viewsA: Insert checkbox dynamically by returning Json does not display Text?
What you are developing is not the best solution, the best solution and make the Framework be responsible in the generation of this html (code snippet), but first I created a minimal example what…
-
5
votes3
answers543
viewsA: How to display a multidimensional array without looping?
By both codes forEach with lambda, how much the method deepToString of Arrays utilize foreach and for respectively internally in their codes, there is no other way to display a array (simple or…
-
5
votes1
answer324
viewsA: Get all classes that implement a generic interface
With Linnum to make a search for name: var types = System.Reflection.Assembly.GetExecutingAssembly().GetTypes() .Where(p => p.GetInterfaces().Where(c => c.Name.Contains("InterfaceA")) .Any())…
-
3
votes2
answers402
viewsA: How to make a span display the value of a range as you move it with your mouse?
Utilize oninput calling the function: With a function: function mostrarPorcentagem(novoValor) { document.getElementById("exibePercent").innerHTML = novoValor; } <input id="percent" type="range"…
-
5
votes3
answers4878
viewsA: How to use Laravel delete route?
First thing ever, (by no means) create a route so this can disturb the others and cause problems, crash routes, etc... A basic example in creating this type of route would be with Route::post (don’t…
-
2
votes3
answers566
viewsA: Same types but with different objects. What is the best way to use it?
Implement the class Icloneable in its class that will provide you to clone a copy of the class with the same values, but being distinct objects. Within the method created by the implementation…
-
2
votes1
answer85
viewsA: How to set the db variable in the Clientemodel?
To access protected $db from its base class remove static of the class methods ClienteModel and make access with $this->db: <?php namespace Application\Models; class Model { protected $db;…
-
2
votes1
answer487
viewsA: Validate Jquery does not work with Toggle Bootstrap
When using Bootstrap Toggle has a problem: messages do not appear (that plugin adds a div that obfuscates the validation message) by not getting a response from validated or nay, but has a friendly…
-
7
votes2
answers1625
viewsA: Lambda Groupby by year and month
Everything will depend on how and where you will use, emitting in a console application as a way of understanding the Linnum that’s how it is: var items = listaDeEventos.GroupBy(x => new…
-
6
votes2
answers4468
viewsA: Input mask with zeros on the left
You can use the jQuery.maskMoney with some changes in the settings of input for type="text" and maxlength="4", and in the maskMoney: precision:3 and decimal:'' : Sample code: $(function() {…
-
6
votes1
answer167
viewsA: Is it wrong to use stab wounds in the Laravel view to present elements to the master user?
Actually it’s not helpers that is using is the facade class Authentication. Well the scenario is summed up, I would do to improve a View that contains this code and would call with @include in View…
-
6
votes2
answers101
viewsA: How to get an item from a list randomly?
Answer Soen, use the Random.Choice import random frutas = ['abacate', 'mamão', 'laranja', 'uva', 'pêra'] print(random.choice(frutas)) Online Example Reference: Random.Choice…
-
1
votes2
answers1078
viewsA: Doubts about converting from Byte to Image in c# You are showing a strange and unusual error
Code of array of bytes (byte[]) for Image: public Image ByteToImage(byte[] image) { MemoryStream ms = new MemoryStream(image); return Image.FromStream(ms); } and this code with the class…
-
2
votes1
answer234
viewsA: Databinding for JSON.NET objects: how to implement?
As your problem is not very punctual, it seems to me that you have several files JSON, I shall then propose in its last edition JSON inserted in the question. The usual way to work with this would…