Posts by Jéf Bueno • 67,331 points
1,254 posts
-
2
votes3
answers227
viewsA: Hyphenate when value is 0 in select
You can use a IF in consultation. The IF receives three "parameters", the first is the condition, the second is the value that the column will assume if the condition is met and the third is the…
-
9
votes1
answer4100
viewsA: The ADO.NET Provider with invariant name 'Mysql.Data.Mysqlclient' is either not Registered in the machine or application config file
To make the Entity Framework work with Mysql is not as simple as with SQL Server. Before it is necessary to make some settings. Install the package Mysql.Data.Entity.EF6 Install-Package…
-
6
votes2
answers849
viewsA: What is the difference between SET and SETX?
Set Modifies the environment variables of shell (window) that is running. The new value is available immediately, but it is temporary. The modification will not affect the rest of the operating…
-
1
votes1
answer313
viewsA: The getPreventDefault() method should no longer be used. Instead, use defaultPrevented - Browserlink
No. The browser link is a Visual Studio feature that works by injecting Javascript code into pages. If you want to continue using the feature, you will continue to receive the message. If this is a…
-
9
votes5
answers15150
viewsA: How to avoid "Cannot read Property ... of Undefined" error?
The name of this resource is null Propagation and this does not exist in Javascript. You can use the lodash to do something similar. It has a function called get, that takes as parameter the object,…
-
6
votes1
answer73
viewsA: Is it possible to make the browser flag a user action?
There are several ways to implement this, only you can define which is the best or most suitable for your project. My tip is to save this setting to localStorage function ativarModoNoturno(){…
javascriptanswered Jéf Bueno 67,331 -
1
votes1
answer32
viewsA: How not to select lines with values from an informed list of values
Use Not In Select from Tabela where Coluna Not In ('x', 'y', 'a', 'g')
-
1
votes2
answers77
viewsA: Align DIV of type=text
I’ll answer because the problem is simple, but please get used to at all times create an example, minimum, complete and verifiable and not just point the link to your website. All the…
-
11
votes2
answers586
views -
3
votes1
answer220
viewsA: Empty generated migration after Scaffolding
The problem has nothing to do with Scaffolding. Certainly just need to add the model in context. In the project there must be a class that inherits from DbContext. This class must contain all models…
-
1
votes1
answer587
viewsA: Angular ng-repeat and $sce.trustAsHtml
I can’t quite understand your problem, but it’s pretty easy to do what you need. First of all it is necessary to have the module ngSanitize referenced, then just use the directive ng-bind-html with…
-
4
votes2
answers473
viewsA: Insert 1000 records into table with uniqueidentifier as primary key
Use the function Newid() declare @contador int select @contador = 1 while @contador >=1 and @contador <= 1000 begin insert into client values (NewId(), 'jack' + convert(varchar(5), @contador),…
-
20
votes4
answers7473
viewsA: How do I display the same phone number from the OLX site?
One of the many ways to do this is to keep the full number in an attribute data- and putting this value in place of the "cut" number when the user clicks some button. Example: Pure Javascript…
-
3
votes1
answer218
viewsA: How to customize error 404 using Httpnotfound?
So you can test locally, the mode of customErrors needs to be On. That’s because the RemoteOnly only serves to make these pages appear outside the development environment. I’m not sure if the…
asp.net-mvc-5answered Jéf Bueno 67,331 -
2
votes1
answer429
viewsA: Parse error: syntax error, Unexpected end of file
Missing a key at the end of the code <?php mysqli_connect("localhost", "root", "") or die(mysql_error()); if(isset($_POST['seunome']) && isset($_POST['suasenha']) &&…
-
16
votes4
answers3293
viewsA: Separate String Number Letters
Check if the character is a number, using Character.isDigit(). It is good to note that other symbols can be used. So it would be good to use also the method Character.isLetter() to validate if the…
-
1
votes1
answer562
viewsA: Error conversion type Object to int
According to comments, the return of ConnectionPostgres.ExecScalar(sql) is a long boxed in a object. Like long accepts numbers much larger than int, the cast explicit is unfeasible. So you can try…
-
2
votes1
answer117
viewsA: Remove Cpfs at the bottom of the Javascript page that validates CPF
Remove the end of the script, that part: $("#input").keypress(function(){ $("#resposta").html(CPF.valida($(this).val())); }); $("#input").blur(function(){…
javascriptanswered Jéf Bueno 67,331 -
3
votes1
answer485
viewsA: Pass the (integer) Return from a Controller method to the View
Views do not call from actions, at least not directly. It seems to me that you are trying to summarize a desktop application behavior for a web application. What you can do is request a server and…
-
72
votes2
answers126902
viewsA: What is the difference between $(Document). ready() and window.onload?
The event ready is fired after the HTML document has been loaded. The onload is only fired when whole the content is loaded (including images, videos, etc). Note that the ready is jQuery specific.…
-
4
votes1
answer1123
viewsA: Add value with Angularjs no ng-repeat
There are several ways to do this. If you just want to show the value in the view, you can take advantage of the dynamicity of Javascript and create a variable in the view itself using the ng-init.…
-
4
votes2
answers189
viewsA: Convert Type to List
Are you trying to make a variable of the type List<ProdutoAmortizacaoCreditoDias> receive the value of another kind, ProdutoAmortizacaoCreditoDiasSearch, in the case. Behold var…
-
4
votes2
answers223
viewsQ: How to get all constants of a class?
My project has a class helper with several constants representing roles predefined. public static class RolesHelper { public const string ModuloUsuarios = "Usuarios"; public const string ModuloMenus…
-
8
votes1
answer1804
viewsA: The Entity or Complex type '*' cannot be constructed in a LINQ to Entities query
That’s right, you can’t. The mistake itself says The Entity or Complex type 'Ccvalemixef.Infra.Data.Context.Affiliate' cannot be constructed in a LINQ to Entities query. Free translation The entity…
-
36
votes5
answers991
viewsQ: What is UX (User Experience)?
I see some questions on the site with the UX tag about positioning controls, colors, etc. This usually seems to me to be part of the choices of designer (or even the user). What is UX? And how can…
-
1
votes3
answers243
viewsA: List error with null reference in Java
Calling any method in any null reference will always result in an exception. How could I resolve this? Checking whether the list is null or not before trying to access anything on it Ex.:…
-
1
votes2
answers132
viewsA: Restsharp connected with Firebase but shows no result
This is the default output for type List<T>. If you want to specify what should be written in the file, do this public static void restAPI() { var client = new…
-
1
votes1
answer138
viewsA: Find a uppercase letter in the text
It is possible to do this using the Any of LINQ also. In VB.NET With LINQ Dim existeMaiuscula As Boolean = senha.Any(Function(c) Char.IsUpper(c)) With Regex Dim existeMaiuscula As Boolean =…
-
6
votes2
answers382
viewsA: Which means [] in angular.module
It is the dependency set of this module that is being created. Say you create your module myapp and need to use the standard Angular route mechanism. Then, it will be necessary to install the module…
-
4
votes2
answers7812
viewsA: Accessing Components from Another Form
Yes. Just create these members with public visibility and access the other form. You can change the visibility of the form controls in the box properties (the same as where the name, text, etc. of…
-
1
votes3
answers655
viewsA: How to manipulate part of the href attribute of a link using Javascript in Wordpress?
Yes, you can do this by capturing the value of the attribute href and manipulating him. Functional example document.getElementById('bt-remover-hashs').addEventListener('click', removerHashtags);…
-
3
votes2
answers522
viewsA: Native HTML 5 Progressibar Animation
Simple. Just increment the attribute value of the element. Functional example document.getElementById('bt-iniciar').addEventListener('click', iniciarProgressBar); function iniciarProgressBar(){ var…
-
3
votes1
answer201
viewsA: Capture file creation date
The date of creation itself has no way to recover, at least not "natively". However, it is possible to recover the date of last file modification by using the property lastModifiedDate. function…
javascriptanswered Jéf Bueno 67,331 -
4
votes1
answer167
viewsA: Doubt with Join between two classes
Missed using the DefaultIfEmpty in Join. This makes a left Join between the lists. See how your query Obs.: I took some properties and that Join that was not part of the scope of the question…
-
2
votes4
answers110
viewsA: Why this division in the class instantiation in C#?
Farmer farmer; nonhaste nothing. This just declares a variable of type Farmer. The instance of this variable is done in the second example (farmer = new Farmer() { NumberOfCows = 15 };). Obviously I…
-
0
votes2
answers304
viewsA: How to access an HTML page and return your HTML using Xamarin.Forms?
Simple. Using the class WebClient of System.Net using (var client = new WebClient()) { string htmlCode = client.DownloadString("http://uol.com.br"); } Or using HttpClient of System.Net.Http using…
-
12
votes2
answers487
viewsA: How to sort by two properties in Linq
It happens that whenever OrderBy is executed, he orders the entire collection, that is, the previous ordination is disregarded. So we need to use the method ThenByDescending() trabalhos.Where(a…
-
1
votes2
answers181
viewsA: Links in strip menu
Natively this does not exist, but it is relatively simple to work on a solution using the class Process and the click event MenuItem. As long as the links start with http:// the Process.Start() will…
-
6
votes2
answers791
viewsA: javascript paste command
Basically, you cannot access the clipboard content in most browsers. Because obviously this is considered a security problem, since any Javascript code could have access to things that may not not…
-
1
votes1
answer71
viewsA: Alternatives to beforeunload Event Switch in FF
The onbeforeunload should work. Code example - IE >= 7 compliant too var myEvent = window.attachEvent || window.addEventListener; var chkevent = window.attachEvent ? 'onbeforeunload' :…
-
1
votes1
answer73
viewsA: Visual Studio 2013: How to reference project folders in Using
You do not add a reference to the folder but to the projects. If the folder has 5 projects, there will be 5 "includes". You need to click the button on References, then in Add and go on tab…
-
4
votes2
answers855
viewsQ: Make comparison using String.Contains() disregarding Casing
I need to check if a given term exists within a string (in SQL is something like like '%termo%'). The point is, I need this done without considering Casing of the two strings. How can I do that?…
-
0
votes3
answers386
viewsA: Call a single time method within an Event Handler that is called several times?
The right thing would be to avoid these "extra" calls. Without more details it is impossible to tell you with certainty what should be done, but in accordance with your request. Just create a…
-
0
votes1
answer1815
viewsA: Static method has no access to class variable
It is because static members are not part of the object scope, but part of the class. Assuming there is a class Game with the following members string Nome string Produtor static string Versao So,…
-
1
votes1
answer108
viewsA: Error while logging in using Facebook
See the method ConfigureAuth() in class Startup, in it has the following commented line app.CreatePerOwinContext<ApplicationSignInManager>(ApplicationSignInManager.Create);. Realize that the…
-
6
votes2
answers332
viewsA: Designs of a C#Solution
It is correct that I have two "exe" projects in a solution that uses the same class library? Yes, it’s super normal. In fact, I’ve participated in a project that had 5 executables and a few more web…
-
1
votes2
answers3407
viewsA: Error: 'Executereader: Connection property has not been initialized. '
As the error message itself says, the property Connection was not incialized. Any and all instances of SqlCommand accurate have the connection set. This can be done on its own builder var sqlCommand…
-
3
votes2
answers1053
viewsA: How to fill a list C#
I need an appeal similar to the one made below email ListaEmail = new email(); while … { email Email = new email(); Email.email1 = adoDR["email"].ToString(); Email.tipo = adoDR["tipo"].ToString();…
-
8
votes1
answer741
viewsA: Subtract 2 weeks from a full date in Pyhton
You can use the timedelta and pass as a parameter the number of days you want to replace from a date. from datetime import datetime, timedelta hoje = datetime.today() - timedelta(days=14)…
-
15
votes4
answers6341
viewsQ: What is the Assembler?
I always read things related to the Assembler and get confused. At first, I thought this was a mess and that Assembler was the same thing as Assembly. But it turns out that’s not it. What is…