Posts by Jonathan Barcela • 1,824 points
45 posts
-
0
votes1
answer41
viewsQ: Replace values of an object based on Keys
I have an object with settings that return from a server in the following format: { "example-url": "http://examples.com", "example2-url": "${example-url}/examples", "example3-url":…
-
1
votes0
answers59
viewsQ: Angularjs and Angular in the same project
Currently I have a project that is in Angularjs that we decided to upgrade to Angular 6. However, making this update at once is only impracticable due to the size of the project. Is there a way to…
-
0
votes2
answers38
viewsQ: Render css when transforming view into string
I’m using the method: protected string RenderPartialViewToString(string viewName, object model) { if (string.IsNullOrEmpty(viewName)) viewName =…
-
1
votes2
answers105
viewsQ: Concatenate varchar2 PLSQL
I have 2 tables with relationship 1 to many and I need to concatenate all the values in the column Nome table 2 in only one select column. Ex.: In the example, the return of what I need would be…
-
0
votes1
answer102
viewsQ: Where de query using multiple list properties
I have the following scenario public Teste[] GetTestes(List<TesteDTO> testeDTOs){ IQueryble<Teste> query = GetAll<Teste>(); //where ... } public class Teste() { public int Prop1{…
-
9
votes2
answers1951
viewsQ: App - Xamarin or Ionic?
I need to create an App and would like to know which of your technologies is the most suitable for mobile development. What is the main difference between Xamarin and Ionic? Which of the…
-
8
votes1
answer1041
viewsQ: CQRS - When to use and why to use?
What are the advantages of using the CQRS (Command/Query Responsibility Segregation) standard? What would be the disadvantages ?
-
1
votes2
answers1776
viewsQ: Ajax request url point to a route
I set the following route in my route file: Route::post('order/productsByCategory', ['uses'=>'OrderController@productsByCategory']); How do I use it in my Ajax request ? $.ajax({ url: "", type:…
-
0
votes1
answer1593
viewsQ: How do I set the url for a route in Laravel?
I am using Laravel 5.4 and controllers in Restful standard. I configured the route file as follows: Route::resource('entryRegistry', 'EntryRegistryController'); In view: {{…
-
0
votes3
answers9343
viewsQ: Check if a date is valid
I’m getting a date in format: string: "01/03/2010 23:00" How can I verify that this date is valid? By validity, disregard questions of days or months being with wrong numbers. The validation would…
-
2
votes1
answer1039
viewsQ: Sort list by a string property with number
I have an object of the type Ata where I own the property NroAta which corresponds to the number of the minutes in question, but in grid when I sort by this number, it ends up putting the numbers in…
-
1
votes2
answers1274
viewsQ: Compare properties of an object with properties of a list
I have a method: public void MetodoAleatorio(List<RequisicaoFisicaDTO> lstRequisicaoFisicaDtos) { RequisicaoFisicaDTO requisicao = lstRequisicaoFisicaDtos.FirstOrDefault(); } Where I get a…
-
16
votes3
answers1076
viewsQ: Is it correct to prefix variable names with their type?
It is usual/correct to use variables where the first letter references their typing? Ex.: string sVariavel; int iVariavel;, etc.... EDIT: The name of it is hungarian notation. Is that good practice?…
-
1
votes1
answer33
viewsQ: Unidentified tenum in html
I created the following helper: public static HtmlString DropDownListEnum<TEnum>(this HtmlHelper htmlHelper, string name, int? valorSelecionado = null) { List<SelectListItem> lstEnum =…
-
0
votes0
answers677
viewsQ: Dropdownlist with data from an Enum
I need to make a Helper where I pass an Enum and it mounts a Dropdownlist based on all values of Enum, I tried to do as follows: C#: public static HtmlString DropDownListEnumFor(this HtmlHelper…
-
3
votes4
answers3023
viewsQ: Rand between numbers with comma
How to generate a number float between two numbers? Ex.: A random number between -270.33 and -47.5.
-
2
votes1
answer508
viewsQ: Update console without using system("cls") on Windows
I am creating a text game, where will have an initial menu, follow the code I already have: #include <iostream> #include <Windows.h> using namespace std; void setTamanhoConsole(int x,…
-
3
votes1
answer1532
viewsQ: How do I get the mouse position (x and y) on the console? C++
I have the following code: #include<windows.h> #include<iostream> #include <cmath> using namespace std; int main() { HWND myconsole = GetConsoleWindow(); HDC mydc =…
-
4
votes3
answers5814
viewsA: Datetime Picker in Portuguese
I managed to solve my problem with: $.datetimepicker.setLocale('pt-BR'); after the definition of Datetimepicker. function atualizarCalendariosHora() {…
-
2
votes3
answers5814
viewsQ: Datetime Picker in Portuguese
I added the component of DateTimePicker to my project. But the same is all in English, I added the option of pt-BR in Function that creates it in the field, and even so it remains in English. How do…
-
2
votes2
answers1086
viewsQ: Transform Json return to list of C#objects
I have a request for an API that returns the following JSON:…
-
0
votes2
answers224
viewsQ: Date Filtering - Month Verification 31 and February
I have the following code: Code example, must debug and follow the variable "lstItem" to understand its functioning using System; using System.Collections.Generic; using System.ComponentModel;…
-
5
votes5
answers3375
viewsQ: Console Application without showing console window
I have a Console Application in which I use to run routines of my system. I am running this console from the Task Scheduler, every time it runs it flashes on the screen. It opens, executes the…
-
2
votes1
answer41
viewsQ: Post com form + string
I own the following Function: var form = $("#formEditarCompra"); var meioPublicacao = $("#MeioPublicacao").val(); if (form.valid() && setarFocoErro()) { mostrarAguarde();…
-
2
votes1
answer73
viewsQ: Summary in classes and methods
How important the use of <summary> in methods and classes? How impactful this is at the level of development? Which is the good side and which is the bad side of its use?…
-
1
votes1
answer213
viewsQ: How to improve string comparison and concatenation C#
I have the following code: private static string MontarDescricaoOrgaoUoUe(RequisicaoFisica requisicao) { return !string.IsNullOrEmpty(MontarNomeOrgao(requisicao)) ? MontarNomeOrgao(requisicao) :…
-
17
votes1
answer11086
viewsQ: How to check the execution time of a method?
Example: I have the Metodo1 and the Metodo2 both have different processing and actions. I want to check how long each takes to run. How do I do that?
-
11
votes5
answers1656
viewsQ: Create objects within a list without for/foreach C#
private List<Compra> CriarCompras(int numComprasParaGerar) { List<Compra> lstCompras = new List<Compra>(); for (int i = 0; i < numComprasParaGerar; i++) lstCompras.Add(new…
-
3
votes2
answers468
viewsA: Checkbook batch sum, total value and validation
The error is here: printf("Digite a quantidade de cheques: "); scanf("%d", somaLote); where the correct would be: printf("Digite a quantidade de cheques: "); scanf("%d", &somaLote); To store…
-
1
votes2
answers49
viewsA: Make a new framework based on another open source with GPL license
Following what is described here: In general terms, the GPL is based on 4 freedoms: The freedom to run the program for any purpose (freedom paragraph 0) The freedom to study how the program works…
-
5
votes4
answers2109
viewsQ: "Filter" equal records into a list by adding their quantitative
namespace ConsoleApplication10 { class Program { static void Main(string[] args) { List<Teste> lstTeste = new List<Teste> { new Teste {Codigo = 1, Quantidade = 10}, new Teste {Codigo =…
-
1
votes2
answers97
viewsQ: Tag HTML in Helper Razor
I have HTML code: <label class="labelinput">Nº Compra<em>*</em></label> Passing to the Helper was as follows: @Html.Label("Nº Compra:", new {@class = "labelinput"}) But I…
-
6
votes1
answer7802
viewsQ: Voice recognition in Pt-BR
How do I use Speech Recognition when my OS(Windows 8 x64) is in En-BR? I want to use commands in English. I’m using the following code: private void Form1_Load(object sender, EventArgs e) {…
-
3
votes1
answer516
viewsQ: Console cursor coordinates in C
Taking the following code as an example: #include <stdio.h> int main(void) { printf("Hello world"); return 0; } Where "Hello World" will be written in row 1 and column 1 of the console. How do…
-
3
votes1
answer2021
viewsQ: How to program GUI in C?
What Apis give me to create GUI using C? I searched and found a GTK+ call, but I want to know the name of other libraries to create GUI using C in the same style as GTK+ but facing Windows. If…
-
19
votes2
answers9703
viewsQ: Is it possible to program object oriented in C?
There is the possibility to build a C program using POO? I have looked on several websites for examples of this, but I have found nothing concrete, which tells me whether or not it really gives. If…
-
2
votes1
answer292
viewsQ: Tabulation via Jquery
I have a field with the class "codigoBarra" where will be used barcode reader to fill it, at the end of reading with the reader it generates an n, I already managed to capture this and treat,…
-
2
votes1
answer182
viewsA: Can you calculate the diagonal on canvas?
If you have the height and width, you can calculate the diagonal from this. It can be solved using the Pythagorean theorem as follows: Diagonal² = height² + width²; In js: var diagonal =…
-
3
votes1
answer412
viewsQ: Dragdrop for files . txt Windows Forms
I wonder if it is possible to use Drag and Drop in Windows Forms for files outside the application, in this case, a . txt(As is possible in WPF). I only found examples using Listbox. If possible,…
-
3
votes1
answer21
viewsQ: Folderdialog in Consoleapplication C#
I am with a question related to Console Application, as I do to open a window similar to this where it is possible to select a FOLDER? It would be a resource like the one in Windowsforms where it is…
-
2
votes1
answer183
viewsQ: Fetch phrase within files . Cs from a specific folder using C#
I would like to know how I can find a phrase inside files . Cs of a specific folder. You don’t need to develop code, I just want to know what/what functions to use and how to use them. I couldn’t…
-
7
votes2
answers718
viewsQ: How do I add two strings in C#?
I have a method that will take two strings and return the sum of them in string format. I use string because there will be +-30 digit numbers. I’m having trouble converting to add. :/
-
6
votes2
answers830
viewsQ: Conversion from date string to datetime C#
I have a method that will receive a string in the "June 15, 2001" format, for example, which is equivalent to the date to be compared, I need to pass this string to a Datetime, as I would do this…
-
1
votes1
answer108
viewsQ: SQL database for multiple users
Well, I have a question. I am developing a web application that will suit more than one user, however each user has different data recorded in the database, and this volume will be great, since the…
-
3
votes1
answer433
viewsQ: How to use a theme in wpf?
I’m trying to use a package of WPF themes, but I can’t call it, when I use it says it lacks the reference and I can’t find any tutorial or anything current about it. I tried to install using nuget…