Posts by novic • 35,673 points
1,265 posts
-
1
votes1
answer504
viewsA: extract data from a json
I did a key reading process and if it is confirmed that it exists it is read to the $scope.ItensReceitaModel = []; creating a array of information. Code for creating the new array:…
-
3
votes1
answer1199
viewsA: How to get filename within folders in WEB API server
Utilize Enumeratefiles to get the files from a given directory by configuring the third parameter System.IO.SearchOption.AllDirectories so that the search is done in all directories. string path =…
-
2
votes2
answers4762
viewsA: ng-repeat in an array within an array of objects
Must be accessed the objeto contained in the list to then access the array of sizes. var app = angular.module('app', []); app.controller('ctrl', ['$scope', function($scope) { $scope.listaProdutos =…
-
2
votes1
answer1002
viewsA: Save Relationship 1:1 on Laravel 5.3
Relationship 1:1 Laravel Following the documentation and comments, the models and migrations need to be changed to fit the relationship 1:1 proposed by eloquent. Relação Migrations Usuario (Users)…
-
2
votes1
answer210
viewsA: Simplexml does not return the file data
To get to print out only the film need to navigate to the correct point: $xml->CINEMAS->CINEMA->FILMES->FILME For example: <?php $url =…
-
2
votes4
answers8807
viewsA: How to convert a date variable to the Brazilian format within a view?
With class only use DB does not have all the features offered by Eloquent, so do it right on SQL: DATE_FORMAT(dataplanejamento,'%d/%m/%Y') as dataplanejamentobr DB::select("SELECT tabela.*,…
-
3
votes1
answer341
viewsA: Sort an object’s keys by simulating ORDER BY ASC NAME
By command Sort making the comparison as follows: var obj = [{nome: "Batista"}, {nome: "Thiago"}, {nome: "Joana"},{nome: "Ana"}]; //console.log(obj); // antes obj.sort(function(a, b){ var aa =…
-
2
votes2
answers4321
viewsA: Formatting date and time with Javascript?
You can use the momentjs who does all the work of date formatting, calculations, etc.: moment.locale('pt-br'); console.log(moment('2017-01-05T14:35:17.437').format('DD-MM-YYYY')); <script…
-
1
votes3
answers341
viewsA: How to render an html that came from a json response?
With this type of response in HTML format would be necessary to click on the ngSanitize and use the tag for loading ng-bind-html (angular.module('app', ['ngSanitize']);). Minimal example: var app =…
-
3
votes1
answer800
viewsA: How to check if the LINQ expression does not come null
Utilize FirstOrDefault, if there is no return it returns the default value of the class that is null (This varies according to type, if it is a int for example the return is 0 as default value).…
-
3
votes2
answers1111
viewsA: I am unable to configure the sqlsrv drivers in php7
Download the package Microsoft Drivers for PHP for SQL Server and unzip into a folder and take these two files to the folder ext of php: To x86: extension=php_sqlsrv_7_nts_x86.dll…
-
2
votes3
answers1955
viewsA: How to scan data from an Excel spreadsheet
There is a basic way to do this reading of Excel spreadsheets (*.xls and *.xlsx) but, the provider must be installed on the machine to work. In this example of two ConnectionString one for xls and…
-
2
votes1
answer186
views -
1
votes2
answers26
viewsA: Hide in an Actionlink, is it possible?
Instead: $(this).parent().find("a.siteFancybox fancybox.iframe").show(); put this: $('a.siteFancybox').parent().show(); I believe he is not finding the correct item even because in your question you…
-
2
votes1
answer757
viewsA: How to resize image independent of size?
With class Webimage and the command Resize can successfully resize your image. Minimal Example: public FileContentResult Imagem() { byte[] content =…
-
0
votes1
answer64
viewsA: Error when displaying the sum in a SELECT
The correct is for you to record these values in decimal so that you don’t keep converting the data this way below: <?php $numerocontrato = trim($_GET["numerocontrato"]); $sql =" SELECT…
-
1
votes2
answers56
viewsA: How to check input text before post?
Using jquery at the end of page loading: $(function(){ var status = !($("input[name=lastname]").length == 1); $("input[type=submit]").attr('disabled', status); }); <script…
-
2
votes1
answer31
viewsA: Items are not shown in dataGridView
Change this: gridPedido.DataSource = pedido; therefore: gridPedido.DataSource = pedido.ToList(); forcing the type of data sent to DataSource of DataGridView List<T>. That one DataSource can…
-
2
votes2
answers239
viewsA: How to pass command line arguments in PHP?
Utilize $argv that are predefined variables: <?php var_dump($argv); Command line: php args.php -email [email protected] Exit: array(3) { [0]=> string(8) "args.php" [1]=>…
-
9
votes2
answers1142
viewsA: Undefined index: PATH_INFO
In this case there is no information to generate the PATH_INFO of $_SERVER, because, it rescues the additional information in a URL from a script php, disregarding in question the Query String…
-
4
votes2
answers9699
viewsA: How to get the values of a textbox?
The correct property of Textbox is Text to retrieve or define a text in this control: Reclaim: string grava = textBox1.Text; Define: textBox1.Text = "Novo Texto"; References: Textbox class Property…
-
4
votes3
answers1336
viewsA: Why can’t I center image using text-align:center?
#image { display: table; margin-left:auto; margin-right:auto; } <div class="panel panel-default" style="width:500px;…
-
0
votes1
answer74
viewsA: Display clickable link coming from the database
Place: <a href="@HttpUtility.HtmlDecode(item.Facebook)">Texto do Link</a>
-
1
votes2
answers116
viewsA: Dbcontext finds Connection String in Web Project, but not in Console App project
Force him to search for a particular name in your ConnectionStrings thus: name=SiteBanco, this will serve so much to app.config and web.config: Final code: public class SiteContext : DbContext {…
-
3
votes1
answer38
viewsA: Is there a way to do these assignments more cleanly?
For example: makes a foreach sweeping the array and passing it on to your class properties in a dynamic manner. Observing: the keys to the array has to have the same name as the itens class <?php…
-
2
votes2
answers1555
viewsA: How to get the bootstrap value toggle true or false?
Utilize jquery with prop in the loading event of the GIFT and at the event change of the element. $(function() { $('#toggle-event').change(function() { $('#console-event').html('Toggle: ' +…
bootstrap-3answered novic 35,673 -
2
votes1
answer466
viewsA: Remove Report Viewer Edge
A iframe, then add this setting to htmlAttributes: @style = "border:0" to remove the embroidery. @Html.ReportViewer(ViewBag.ReportViewer as Microsoft.Reporting.WebForms.ReportViewer, htmlAttributes:…
-
4
votes1
answer151
viewsA: MVC Helper with List Energy
Not it is directly possible to make the @helper have generic vestments (at least until the moment), of course there are other means that may not match what you need but, an example of how you could…
-
5
votes1
answer48
viewsA: Error There are no comments for in the schema
It wouldn’t just be: return oDB.LicitacaoOfflines.ToList(); public static List<LicitacaoOffline> Buscar() { DatabaseEstoqueOfflineDataContext oDB = new DatabaseEstoqueOfflineDataContext();…
-
1
votes1
answer94
viewsA: Error limit Codeigniter
Use in this way: public function exibeSugestaoHome() { $this->db->limit(3); $this->db->select("*"); $this->db->from("anuncios"); $this->db->where("vip > ",0);…
codeigniteranswered novic 35,673 -
6
votes1
answer5387
viewsA: How to use hasmany relationship in Laravel 5.2?
Relationship 1:N Laravel Relationships: Apontamentos class Apontamentos extends Model { protected $fillable = array('apontamento'); protected $table = 'apontamentos'; public $timestamps = true;…
-
3
votes3
answers310
viewsA: Add variables to Auth 4.2
Remarks: The link you are using as a reference have errors in the code do not use, always use the official documentation of Larable Missed the return in the method public function empresa() { return…
-
1
votes1
answer177
viewsA: Get Dropdown value when Textbox receives focus
Minimal example $(document).ready(function(e) { $('#txt1').on('focus', function() { var element = $("#select1 option:selected"); var text = $(element).text(); var value = $(element).val(); if (text…
-
1
votes1
answer73
viewsA: remote request with php jQuery-autocomplete
The jQuery-autocomplete, has a basic request template ajax that can be done so: Html <input type="text" name="q" /> Javascript $('input[name="aj"]').autoComplete({ source: function(term,…
-
2
votes1
answer547
viewsA: What are the shortcut keys in Phpstorm to remove Namespaces that are not in use in a Class?
Yes there are the keys that are responsible in optimizing your code by removing the namespaces unused: CTRL+ALT+The. There is a difference if the operating system for MAC OS X the keys are:…
-
2
votes1
answer969
viewsA: Error : The Response content must be a string or Object implementing __toString(), "Object" Given
Problem: Missed importing the namespace of class Response: use Illuminate\Http\Response; or, then it can be used like this: public function getImage($filename) { $file =…
-
1
votes1
answer74
viewsA: HTML 5 Bootstrap System Grid
Use the plugin Jquery.Sotope: $(document).ready(function() { $('.grid').isotope({ itemSelector: '.rows', sortBy : 'original-order' }); }); .rows { margin: 2px 2px 2px 2px; width: 192px; } <link…
-
8
votes2
answers38101
viewsA: Checking if value exists in an array via search field
If you can use your first example, you should only change its function verifica(): function verifica() { var chaves = ['wmv', '3gp', 'mp4', 'mp3', 'avi']; var item =…
-
2
votes1
answer563
viewsA: What is the difference between [Acceptverbs(Httpverbs.Get)] and [Httpget]?
There is no difference in this two snippets of code, they have the same purpose, so that the method only accepts requests from verb GET, in fact one is abbreviation of the other. In the code source…
asp.net-mvc-5answered novic 35,673 -
2
votes3
answers782
viewsA: How to group INPUTS in Bootstrap?
Was used the class row of bootstrap and column settings col-md-* and col-sm-* to work: Sample code: Visually in the answer has not check, but in a larger region it fits the way you expect. <link…
-
3
votes4
answers5749
viewsA: Input type NUMBER does not consider maxlength
You can use your own Angular to create a directive: var app = angular.module("app", []); app.directive('ngMax', function() { return function(scope, element, attrs) {…
-
1
votes1
answer678
viewsA: Fill class with bank result
Ideal solution, is to make the list of the type you need with the code below: List<Cliente> clientes = new List<Cliente>(); SqlConnection conexao = new SqlConnection("STRING_CONEXAO");…
-
1
votes2
answers554
viewsA: Taking information from a select and passing an array
1) In the click one-button: var items = []; $(function(){ $('#btn1').on('click', function(){ $('#select1 option').each(function(i,v) { items.push( {value: $(v).val(), text: $(v).text() } ); });…
-
1
votes1
answer369
viewsA: Manual authentication of a table field in the Laravel Framework 5.3
Create a middleware and configure your project on the administration routes whether you can or not, follow the step by step: On the console type: php artisan make:middleware CheckStatus will be…
-
4
votes2
answers185
viewsA: How to pass a lambda expression as argument of a parameter in a method?
Code: Public Class Prj Public Sub Metodo(Of T)(Where As Func(Of T, Boolean)) Lista = Lista.Where(Where) End Sub End Class How to use? Dim c As New Prj c.Metodo(Function(a) a = 1); References How to…
-
3
votes1
answer2266
views -
18
votes2
answers5046
viewsA: What is the difference between Isnullorempty and Isnullorwhitespace?
The string.IsNullOrEmpty is the same thing as: result = s == null || s == String.Empty; and the string.IsNullOrWhiteSpace is the same thing as: result = string.IsNullOrEmpty(s) || s.Trim().Length ==…
-
2
votes1
answer42
viewsA: Is it possible to see the Entity execution order?
So, is it possible for me to look at the execution order of the Querys that the Entity Framework mount? Yes, it is possible to audit sql with Database.Log: var db = new Contexto(); db.Database.Log =…
entity-frameworkanswered novic 35,673 -
4
votes4
answers978
viewsA: Loop autoincrementing date
To always catch the last date of the month use date with mktime(): date('t', mktime()); Generate plots by the last day of the month according to the information of the year: function…
-
2
votes1
answer83
viewsA: How to identify in the constructor the method that was called?
In the route files, it is configured: Route::get('/paginas', 'PaginasController@index'); and in the builder utilize: $controlerAndAction = \Route::currentRouteAction(); exit: string(44)…