Posts by Matheus Miranda • 5,375 points
290 posts
-
1
votes1
answer45
viewsQ: Blueimp Gallery CSS does not work with Bootstrap 4
See the code below: document.getElementById('links').onclick = function(event) { event = event || window.event; var target = event.target || event.srcElement, link = target.src ? target.parentNode :…
-
2
votes1
answer77
viewsQ: How to upload multiple images to Cloudinary?
I use Cloudinary to upload files to the cloud. The following code works with 1 image, example: var uploadParams = new ImageUploadParams() { File = new FileDescription(@"C:\Users\Matheus…
c#asked Matheus Miranda 5,375 -
1
votes1
answer39
viewsQ: Reload video element with external link
Follow code jQuery: var el = $('#embed_video video').get(0); var urlVideo = 'https://res.cloudinary.com/matheus/video/upload/ferrari.mp4'; urlVideo = urlVideo + '?t=' + new Date().getTime();…
-
1
votes0
answers31
viewsQ: How to upload a file to Cloudflare?
I want to upload a file to cloudflare, but before that, it uses protocol tus. Follow the code below: var cloudflare = new HttpClient(); var zoneId = "xxxxxxxxxxxxxxx"; var email =…
-
5
votes1
answer70
viewsQ: How to stream video with interval request?
I have a video saved in the database with type VARBINARY(MAX). How can I make a request range ? The following code gets the full video from the database and plays in the variable video_byte; This is…
-
0
votes1
answer26
viewsQ: You are not accepting special characters via javascript
I created a file _Scriptspartial and inside that file is javascript code. Follows file _Layout: <!DOCTYPE html> <html> <head> <partial name="_Favicons" /> <meta…
-
1
votes1
answer79
viewsA: How to clear a Modelstate error with specific property?
I found the solution: if (ModelState.ContainsKey("Input.Card")) ModelState.Remove("Input.Card");
-
1
votes1
answer79
viewsQ: How to clear a Modelstate error with specific property?
I created Asp.net mvc core 2.2 project with individual account. Follows code: [BindProperty] public InputModel Input { get; set; } public class InputModel { [Required(ErrorMessage = "O campo…
-
2
votes1
answer75
viewsQ: How to add a description in the column?
I am using Firts Migration to update in MS SQL SERVER Database. In class ApplicationDBContext, has a method OnModelCreating where you can rename table, change data type, set your keys, etc... In…
-
2
votes1
answer62
viewsQ: Asp.Net Core does not support System.Data.Entity.Spatial.Dbgeography?
Follows the project’s created property Asp.Net: public System.Data.Entity.Spatial.DbGeography Geo { get; set; } How can I do this in design Asp.Net Core 2.2 ?…
-
0
votes1
answer26
viewsA: Generating Script and saving to a specific folder?
You can get detailed information with command: get-help Script-Migration -detailed To generate script and save to a specific folder, run the following command: Script-Migration -Output…
-
0
votes1
answer26
viewsQ: Generating Script and saving to a specific folder?
Looking at an example of how Generate SQL scripts. So I executed the following command: PM> Script-Migration The above command works fine, however I want to save in a specific folder, I tried…
-
2
votes1
answer86
viewsQ: Does not accept Enum parameter with non-zero integer
Follows code: class Program { public enum Enum { Casa = 0, Apartamento = 5 } public static string MinhaFuncao(Enum @enum) => "MinhaFuncao"; static void Main(string[] args) { var r =…
-
0
votes2
answers411
viewsA: Is there any way to create a moip account through moip’s api?
Recalling that the Moip turned Wirecard. Yes it is possible to create account as Marketplace. See an example below of how to create transparent account: $account = $moip->accounts()…
-
0
votes2
answers3021
viewsA: HTTP Status 415 - Unsupported Media Type
I found another solution: HttpRequestMessage httpRequest = new HttpRequestMessage(HttpMethod.Delete, "URL do Site ...") { Content = new StringContent(string.Empty, Encoding.UTF8, "application/json")…
-
1
votes2
answers3021
viewsQ: HTTP Status 415 - Unsupported Media Type
Follows code: var httpClient = new HttpClient(); httpClient.DefaultRequestHeaders.Add("Accept", "application/json"); httpClient.DefaultRequestHeaders.Add("Authorization", $"Bearer {accessToken}");…
-
0
votes1
answer40
viewsQ: Cannot Rename a null token Parameter name: token
Follow the extension: public static void Rename(this JToken token, string newName) { if (token == null) throw new ArgumentNullException("token", "Cannot rename a null token"); JProperty property; if…
-
8
votes3
answers22536
viewsA: How to make a Mask in pure Javascript?
Already has library vanilla-Masker ready for it and see in codepen.io. In your case see an example of code below: function inputHandler(masks, max, event) { var c = event.target; var v =…
-
1
votes2
answers84
viewsA: Error running Savechanges EF6
Alternative for those who can’t touch the server. Install a package from Nuget: PM> Install-Package Microsoft.SqlServer.Types -Version 14.0.1016.290 Then it goes in the file Global.asax.Cs: using…
-
1
votes0
answers87
viewsQ: Error 500.19 - Internal Server Error - requestFiltering
I have application that allows to upload with large files. I already went up my site in the hosting, try to navigate the main page and get error: Detailed Error Information: Module…
asp.net-mvcasked Matheus Miranda 5,375 -
0
votes0
answers38
viewsQ: .NET Standard 1.2 - Fileversioninfo does not exist
Follows code: public static string GetVersion() { return FileVersionInfo .GetVersionInfo(Assembly.GetExecutingAssembly().Location) .ProductVersion; } I get error: CS0103 The name "Fileversioninfo"…
-
2
votes1
answer56
viewsQ: Problem when deserialize json with $
Follows code json: { "_id": { "$oid": "5b0f4a926724c71d945299f9" }, "_class": "notificador.domain.entity.mongodb.WebhookNotification", "externalId": "EVE-XXXXXXXXXXXX", "resourceId":…
-
5
votes3
answers193
viewsQ: Regex for this format xxxxxxxxxxxx_v2
How can I make a regex that accepts in this format below: 1q2e5g6s4t5s2u1i5dy1s9u14i2s5u9o_v2 1q2e5g6s4t5s2u1i5dy1s9u14i2s5u9o has 32 characters and then has _v2 - the last 3 are always _v2.…
regexasked Matheus Miranda 5,375 -
0
votes1
answer393
viewsA: MOIP consumes Json Web Api MVC
There’s a library ready for that: Wirecardcsharp. Example of how to consult a customer: var result = await WC.Customer.Consult("CUS-XXXXXXXXXXXX");…
-
6
votes1
answer486
viewsA: Convert Byte to Normal Text c#
For ASCII: string result = System.Text.Encoding.ASCII.GetString(byteArray); For Hexadecimal String (Method 1): string result = BitConverter.ToString(byteArray); For Hexadecimal String (Method 2):…
c#answered Matheus Miranda 5,375 -
5
votes2
answers103
viewsQ: Httpstatuscode does not exist code 207, 208 and 226
What to do when class HttpStatusCode there is no code 207, 208 and 226 ? Someone already asked the question on Github: https://github.com/dotnet/corefx/issues/4382, I don’t think they did an…
-
3
votes1
answer328
viewsQ: How to validate the JSON schema in C#?
Follows json (has only 1 error, may have several errors): { "errors": [ { "code": "XX-55", "path": "customer.id", "description": "Cliente não encontrado" } ] } Another example of the return:…
-
2
votes1
answer156
viewsQ: Jsonconvert.Deserializeobject returns null
Segue json: [ { "id":"BKA-EU8IED8ZD21Q", "agencyNumber":"1", "accountNumber":"1", "holder":{ "thirdParty":false, "taxDocument":{ "number":"783.121.360-02", "type":"CPF" }, "fullname":"Leandro da…
-
2
votes1
answer560
viewsA: Textbox masks value from 2 to 4 decimal places in WPF C#
Follow the example of the code: <TextBox Text="{Binding Value, StringFormat=N2}" /> <TextBox Text="{Binding Value, StringFormat={}{0:#,#.00}}" /> Original response: Stackoverflow English…
-
1
votes4
answers283
viewsA: Create list with more than one element as if it were multidimensional
Dude I really like the class Tuple, take the example: //Definindo o valor com a inicialização de coleção simplificada List<(string ADMIN_ID, string USER_GROUP_ID)> tuples = new…
-
0
votes0
answers153
viewsQ: Favicon in microsoft edge does not show
Follows code: <link href="~/favicon/icon.png" rel="shortcut icon" type="image/x-icon" /> Follow picture: Only appears as "Home - My ASP Application", other browsers work well. Only works when…
-
3
votes2
answers2020
viewsA: Split String with . Split - C#
.Split() does not accept double quotes, single quotes only, ex: string caminho = @"C:\Users\Usuario\Arquivo-2018.txt"; string[] texto = caminho.Split('\\'); string resultado = texto[3];…
-
0
votes1
answer52
viewsQ: Selectionbrush property with only edge and no padding
It is possible to make the property SelectionBrush same as the image below: 'Cause she’s like this now: Follows code: <TextBox SelectionBrush="Red" FontSize="12pt"/> I want it only the border…
-
1
votes2
answers3993
viewsQ: Momentjs - How to add/subtract datetime?
Follows code: var value = '/Date(1533227866063)/'; var utc = moment().utcOffset() / 60; // -180 / 60 = -3 var datetime_utc = moment(value).format("DD/MM/YYYY HH:mm"); // 02/08/2018 13:37 var…
-
5
votes1
answer1890
viewsQ: Datetime.Now or Datetime.Utcnow
What’s the difference between DateTime.Now and DateTime.UtcNow ? DateTime dateNow = DateTime.Now; // retorna {01/08/2018 18:28:15} DateTime dateUtfNow = DateTime.UtcNow; // retorna {01/08/2018…
c#asked Matheus Miranda 5,375 -
10
votes4
answers271
viewsQ: Javascript equivalent of "Date.now()" in C#?
Here speaks how to get milliseconds using Date.now();, that returns something like 1533144170651. Follows his documentation: The method now() returns the milliseconds since January 1 1970 00:00:00…
-
-1
votes3
answers299
viewsQ: How to get the amount of "true"?
Follows code: int total_true = ctx .MinhaTabela .Where(x => x.id == 5) .Select(x => new Tabela_DTO { Campo1 = x.Campo1, // database está como true Campo2 = x.Campo2, //database está como false…
-
1
votes2
answers59
viewsQ: Event does not work after running replaceWith
I use this plugin: http://bootstrap-confirmation.js.org/ Segue Jsfiddle: https://jsfiddle.net/oq0zcn94/79/ After clicking the "replaceWith" button, the "Confirmation" button no longer works. Follows…
jqueryasked Matheus Miranda 5,375 -
0
votes2
answers54
viewsA: Change button value without showing alert
See the example you want: $("#id_do_botao").click(function() { var valor = this.value -= 1; $(this).text(valor); }); <script…
-
1
votes1
answer1405
viewsQ: Place a button next to the input
Segue jsfiddle: https://jsfiddle.net/oq0zcn94/8/ The first code is correct, but in the second code I put a button on the side and the input became smaller. Because this happens ? I want to leave the…
-
-1
votes2
answers100
viewsA: How to recover address ID?
You can recover last segment, for example: // http://usuario/1 string url = Request.Url.AbsoluteUri; string id = url.Substring(url.LastIndexOf('/') + 1); //resultado: 1…
-
3
votes3
answers1448
viewsA: Converting word file to pdf
I’ll leave my answer here to help the people who need to convert you. In my logic I am converting (word, excel and Powerpoint) to PDF and returns bytes[]: Before going to logic, you need to install…
-
5
votes3
answers1448
viewsQ: Converting word file to pdf
There is a free library that I can convert word file to pdf ? I have word file saved database with type varbinary(MAX) and I recover as byte[] in C# and I want to convert word to pdf to show on HTML…
-
1
votes1
answer537
viewsA: How to show PDF using server Viewer.js?
Problem solved, follow code: Html: <iframe src="/Scripts/ViewerJS/#/home/getpdf" width='400' height='300' allowfullscreen webkitallowfullscreen></iframe> Controller: public ActionResult…
-
1
votes2
answers88
viewsA: Rename error message
I managed to solve it that way: @Html.TextBoxFor(model => model.Date, new { @class = "form-control", data_val_date = "Personaliza a sua mensagem aqui !"}) Or you could try it that way:…
-
1
votes2
answers88
viewsQ: Rename error message
Follows model: [DisplayName("Data:")] [ValueParser("ptdateparser")] [AssertThat("DeadLine > Today()", ErrorMessage = "* Data deverá ser superior a data de hoje")]…
-
3
votes2
answers397
viewsQ: Jquery.get() asynchronous or synchronous?
I’ve seen the official documentation here and I do not see mention that the default value is asynchronous or synchronous, I see no example of how to use both (in the second code below). I know it…
-
1
votes1
answer284
viewsQ: Button with loading animation - Bootstrap v4.1.1
Segue Jsfiddle: https://jsfiddle.net/x3w4861v/3/ Follows code: .sk-cube-grid { width: 30px; height: 30px; margin: 16px auto; } .sk-cube-grid .sk-cube { width: 33%; height: 33%; background-color:…
css3asked Matheus Miranda 5,375 -
1
votes1
answer602
viewsA: How to use Javascript with Bootstrap4?
Follow where the error is: <html> <head> <title>AgileHub - Parafernalia</title> <meta charset="UTF-8"> <link rel="stylesheet" type="text/css"…
-
0
votes0
answers349
viewsQ: How to run a javascript function on the server side?
On the server side: return JavaScript("Callback()"); On the client side: function Callback(){ // } The result is displayed as "Callback()" on the web page, I took the example here. Some solution ?…