Posts by novic • 35,673 points
1,265 posts
-
1
votes1
answer326
viewsA: Carbon diffInDays does not bring the negative value between two dates (only positive)
The date has to be the highest, for the data to take the negative difference, example: Code: $datNow = Carbon::parse('2018-10-23 18:40:11.000000'); $datSuspensao = Carbon::parse('2018-10-18…
-
4
votes1
answer985
viewsA: Page number with DOMPDF and LARAVEL
A basic example: <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport"…
-
1
votes1
answer316
viewsA: Format array of dates
In the simplest way, I’d make a appends and a method for this field to pick up the date and move to format d/m/Y H:i:s (or d/m/Y), example: Model <?php namespace App\Models; use…
-
2
votes1
answer441
views -
0
votes1
answer170
viewsA: Desirializing complex json
Create two classes with the following code: public class Rootobject { public RECORD[] RECORDS { get; set; } } public class RECORD { public string Codigo { get; set; } public string Descricao { get;…
-
4
votes2
answers89
viewsA: Rename field in a lambda
Only match the property with a name of your preference, for example: empId = syn.sol.sol.sol.user.EmployeeID in your code something like this: var qry = db.User.Join(db.Solicitation, user =>…
-
1
votes1
answer132
viewsA: Help in VB.NET using Newtonsoft.Json
Well I don’t know why the code is inside a Timer, there must be a reason for this, but the question relates to json to take each value points and name and pass respectively to Label1 and Label2,…
-
6
votes7
answers1322
viewsA: Push element from one array to another array
I believe that there are some solutions I ended up implementing on top of their own code that was almost right, and I preferred to pass the array by parameter and have the result right after…
javascriptanswered novic 35,673 -
0
votes3
answers1367
viewsA: Placing spaces between letters of a text
Make a foreach that will read every position of this string, example: using System; public class Program { public static void Main() { string frase = "Alguma coisa".Replace(" ",""); string result =…
-
2
votes2
answers611
viewsA: How do I filter a list in Vue with response ignoring accents and uppercase/lowercase?
I made a junction of that answer How to do a search ignoring Javascript accent?, to normalize accented text (by removing accents) and also by lowering all values, and this resulted in a minimal…
-
4
votes1
answer669
viewsA: Laravel find() function giving error
Analyzing your code has some problems, example: when using the find which is the return of information by primary key of your table if the data is not found is returned null and right after you make…
-
1
votes1
answer47
viewsA: Orderly list return at BLL?
In the implementation of its interface (IGenericRepository<T>) create another method with the following signature: IQueryable<T>…
-
2
votes1
answer400
viewsA: How to receive a form with file and form in controller ? C #
Good is very simple, just put the two in the same method: public JsonResult Import(FormCollection form, HttpPostedFileBase file) Minimal example: HTML <form name="formUpdate" id="formUpdate">…
-
0
votes1
answer27
viewsA: Problem with Reading Attribute in c#
The code to recover atributos of a property is done by recovering its properties and in each property seeking its attribute (by the method GetCustomAttribute), example: ConnectionModel obj = new…
-
2
votes1
answer48
viewsA: SQL with data associated with Laravel?
The method may be used Join and at the end a Where to filter users, example: $p = Produto::join('consultas_produtos','produtos.id','=','consultas_produtos.produto_id')…
-
1
votes1
answer192
viewsA: How to implement a Person repository function for the Generic - Asp.net MVC and EF Core repository
You will need to create a Expression<Func<TEntity, int>> to work your expression by choosing the desired field, example: In his class of Interface create a method: int…
-
1
votes1
answer34
viewsA: Filter using N2-smart-table masks
There is an item in the documentation that can be prepared a custom filter function, in the question says that the value must be searched without the points, dash and bar, so inside the settings in…
-
11
votes1
answer147
viewsA: PHP 7 - Why does a method that returns the primitive String type not generate an error when returning a Boolean value?
By default all code in PHP has checking Weak, and to enable put a line at the top of the file including before the namespace that will ensure and check the types rigorously (checking Strong):…
-
3
votes2
answers3993
viewsA: Momentjs - How to add/subtract datetime?
It has to be passed on subtract a corresponding duration which in your case is 03:00:00 (3 hours) with the command moment.duration, example: var value = '/Date(1533227866063)/'; var datetime0 =…
-
1
votes1
answer366
viewsA: Import style React
It can be done like this: import '../style/style.css'; // ou import '../style/style.js'; where the two dots means exit the current directory and fall at the root and then type the path of the other…
-
2
votes2
answers82
viewsA: Capture the last PHP characters of an XML file
You have to take the size of string and decrease by $length: function esquerda($str, $length) { return substr($str, (strlen($str) - $length), $length); } ONLINE EXAMPLE Ideone <?php function…
-
1
votes2
answers400
viewsA: Filter combobox search Angularjs
I decided to create an example, where the grouping of information is made a filter in the SELECT with the property multiple: var app = angular.module('app', []); app.controller('ctrl',…
-
1
votes1
answer72
viewsA: Laravel Image Intervention does not save extension
It is necessary to take the extension ($extension = Input::file('photo')->getClientOriginalExtension();) and move to the variable that is building the name of the photo and also pass the same…
-
1
votes1
answer138
viewsA: Filter date in en format in Angularjs?
You have to make a custom filter, and test the text in the format that is on your screen, because, what is coming is in another format and so does not work. Example: var app = angular.module('app',…
-
2
votes1
answer226
viewsA: How to use the between command in codeigniter to generate report
Some modifications: If your date is in the correct format the date coming from the screen is not, it needs to be converted to Date and then in SQL passes the corresponding formatting, example:…
-
1
votes1
answer2505
viewsA: Change attribute of an object array in the state in the application
I decided to make a minimal example to change a list: class ListApp extends React.Component { constructor(props) { super(props); } render() { return ( <div…
-
0
votes1
answer81
viewsA: How to remove disabled from a button in different tables using ng-repeat in Javascript?
The example below adds and removes in a company and to facilitate this was created an extra field in people with the name of status to control the measure that is added and/or removed, example: var…
-
1
votes2
answers184
viewsA: How to call a parent window method when another daughter window is closed with WPF
If you call the method Showdialog() that opens a window and returns only when the newly opened window is closed, and of course call right after the method, example: private void AddRegra(object…
-
2
votes2
answers357
viewsA: Concatenating the elements of an array
It’s simple, you need to save the first position and mount in the second what you have in the previous one so on. Using a for starting from 1 onwards, example: var array_soma = [ "parte 1", "parte…
-
0
votes2
answers596
viewsA: Color RGB in Visual Studio 2017?
In addition to the answer so you can change the value RGB by programming path, in that box you opened just type the RGB separated by ; which is automatically generated, example: All components that…
-
3
votes1
answer618
viewsA: Pass two parameters - ASP.NET CORE
Place asp-route- the name of the route parameter, example: <a asp-page="/ContaReceber/Edit" asp-route-id="@item.Id" asp-route-PessoaId="item.PessoaId" class="btn btn-sm btn-success"> Editar…
-
0
votes1
answer141
viewsA: Browse input ng-repeat fields Angularjs
I made a minimal example where a filter on array as follows: $scope.produtos.filter(function(it){ return (it.Quant > 0); }); Full example: var app = angular.module('app', []);…
-
1
votes1
answer53
viewsA: How do checkbox behave like radio in ng-repeat?
Create a control variable, where the value of the selected item will be default and after the click only the selected item is the only one with selection. This only happens if the selection click is…
-
2
votes1
answer274
viewsA: Codeigniter routes
There is a configuration in the folder application/config in the archive config.php which shall be configured as follows: /*…
-
1
votes1
answer199
viewsA: How to read a json using Gson when the class contains Arraylist’s in JAVA
It needs to be created the class that will carry this information, but, what I could realize that the array of subscribers does not have a standard and this causes the data to not be loaded causing…
-
1
votes1
answer136
viewsA: Condition for table relationship in the Standard
To work, you need to get to the table product_provider with a join and making relation with the table produto, and then a filter where country provider_id, example:…
-
2
votes1
answer97
viewsA: Problem with matrices
As I said in the commentary, there is no position regarding 2 (new int[0,2]) because the C# begins its content of 0 and in the case of your array waiter goes up to the 1. Correct code through the…
-
1
votes1
answer62
viewsA: Linkbutton with Eval Listview Asp.net
You can use the property Visible of Linkbutton to criticize whether or not it will be present, example: <asp:ListView ID="ListView1" runat="server"> <ItemTemplate> <div>…
-
3
votes5
answers2296
viewsA: What good is a C#?
It is a modifier that prevents other classes from inheriting from this class. This modifier can also be used in properties or methods. A basic example that exemplifies this: class B {} sealed class…
-
1
votes1
answer181
viewsA: How do I sort the "Timeline" array in descending date order in PHP?
The answer is simple, nothing complicated since the layout of your date suggests using the function strtotime as follows, a basic example: <?php var_dump(strtotime("1999-01-01") >…
-
0
votes1
answer1444
viewsA: Javascript input mask with negative decimal
In the mask you need to have the identification of the sign as optional and this is identified with the letter N in configuration translation, and thus have the option to type numbers with the…
javascriptanswered novic 35,673 -
1
votes1
answer55
viewsA: How to take the Schema of a Model in a Dbcontext made in the Entity Framework Core
It has these two ways, one referring to the instance of a class and the other to the class type: Example: [Table("Login", Schema = "dbo")] public class Login { [Key]…
-
0
votes2
answers368
viewsA: EF core called the Procedure
To call a Stored Procedure in the Entity Framework Core there are two options in the method Fromsql and Database.Executesqlcommand. The Fromsql is used for return (SELECT) and already the…
-
0
votes1
answer85
viewsA: Increment in one field and Decrement in another
Basically just put in the function of menos who will be awarded with another, example: function id(el) { return document.getElementById(el); } function menos(id_qnt, id_add_qnt) { var qnt =…
javascriptanswered novic 35,673 -
2
votes6
answers6079
viewsA: My function that returns a true/false boolean if it exists or not, is that correct?
1) Write a function that checks whether the past skill vector has the "Javascript" ability and returns a true/false boolean if it exists or not? Utilize index if the return is greater than or equal…
javascriptanswered novic 35,673 -
2
votes3
answers120
viewsA: Property defined in constructor only returns zero value
If I have the values defined in the List products.Cs (in the Precocusto properties), the value should not be captured in the code above? The answer is no through your code: new Produto() { Id = 1,…
-
0
votes1
answer65
viewsA: Clauses wherein and whereNotIn
The wherein and the whereInNot in the first parameter the field name and in the second parameter the array simples, example [1,2,3]. In your code you need an adjustment because the get returns a…
-
2
votes2
answers1192
viewsA: How to apply a zip code mask to a datatable column using Javascript?
Use the settings columnDefs, inform which column you want to format by targets and in render receives a formatting function that can be applied, example: "render": function(data, type, row) { return…
-
1
votes1
answer50
viewsA: Key keys in session
To create a die in session in the Larable is as follows $value['dado']['dado1'] = "1"; $request->session()->put('key',$value); or $value['dado']['dado1'] = "1"; session('key', $value); //…
-
4
votes3
answers546
viewsA: Convert char to integer in C#
All char is a corresponding integer of the table ASCII, and the '0' is the base value of this table, that is, all characters have a corresponding integer value and in a subtraction operation the…