Posts by Jéf Bueno • 67,331 points
1,254 posts
-
1
votes1
answer106
viewsQ: How to make Web Publish from nested applications to IIS?
I am developing a project consisting of a portal and an administration interface. In Visual Studio I have two ASP.NET projects, where one is the Portal and the other is the administration interface.…
-
3
votes3
answers1169
viewsA: Map with dynamic size at div height
Just change the attribute height of iframe to 100%. If you want to follow the same idea for width, just change the attribute width. <div style="width:500px; height:550px; border: solid 1px;">…
-
3
votes4
answers961
viewsA: how to generate an xml in memory
Saving in a string Instead of passing a path by instantiating a XmlTextWriter, pass an instance of StringBuilder. var strBuilder = new StringBuilder(); var writer = new XmlTextWriter(strBuilder ,…
-
1
votes1
answer902
viewsA: Take variable value in another basic visual form
Create a public property on form2 and access it through form1. Example: Public Partial Class form2 Inherits Form Public Property Informacao() As String Get Return m_Informacao End Get Private Set…
-
5
votes1
answer6570
viewsA: Path access error denied
Path.GetDirectoryName returns the directory of a given path. So that Path.GetDirectoryName(AppDomain.CurrentDomain.BaseDirectory.ToString() + "\tb_cid.txt"); will return the way without the file…
-
3
votes2
answers734
viewsA: How to hide and re-view taskbar in C#?
Hiding the task is a very complicated thing, mainly because it’s not something that applications can just go around doing. Otherwise it would be easy to make it a mess. What you want, is to keep the…
-
5
votes1
answer267
viewsA: How to repeat content on multiple static pages?
Yes, it is possible. Using the load() jQuery Example: load the contents of header.html for the div with id header. $("#header").load("public/header.html");…
-
8
votes2
answers3355
viewsA: Search item in a list using LINQ
Of course. Using the method Where of LINQ. It is applicable in any enumerable collection (that implements IEnumerable). Assuming you have a list of the kind string. var filtrado = lista.Where(str…
-
7
votes2
answers1791
viewsA: How do I detect if PHP is running on a command line or server?
Use the function php_sapi_name(), if the return is "cli", is running on the command line. The PHP documentation says: string php_sapi_name(void) Returns a lowercase string describing the type of…
-
1
votes2
answers266
viewsA: Association 1 to 1 Entity
from what I understand, Entity doesn’t know how to define who is the main one between the two classes. Exactly. And he needs to know. The "main" is the model that can exist independent of the other…
-
5
votes5
answers1463
viewsA: Beginner in Python, Else and Elif
You need to understand the flow of things. if Runs a code block if a certain condition is met. elif Is an abbreviation for else if. That is to say, senão, e se or caso contrário, e se. Executes a…
-
4
votes1
answer89
viewsA: How do the text of a cell occupy two lines within the same cell in Crystal Reports with C# winForms?
Mark the cell as CanGrow (or PodeCrescer, if in English) right-clicking on the cell.
-
4
votes1
answer89
viewsA: How do I view an image hosted in my App?
Just define the property ImageLocation of PictureBox with the image address. Ex.: pictureBox1.ImageLocation = "https://www.site.com/images-winforms/promocao-principal.jpg";…
-
0
votes1
answer477
viewsA: How to adjust the Form according to the size of the Picturebox?
It is necessary to change the size of the form "at hand". It will not resize itself. Size = new Size(novaLargura, novaAltura);
-
3
votes1
answer1215
views -
4
votes1
answer2184
viewsA: Convert a 'System.Collections.Generic.List' object to 'System.Data.Dataset'?
Tip I honestly don’t see a good reason to do that. I mean, it’s possible to just make a list Binding of a DataGridView, then why take the trouble to make all this conversion? Ex.: dg.DataSource =…
-
6
votes2
answers347
viewsA: Ignore a specific Exception
Just know what kind of Exception who wants to ignore. If you want to ignore one DbException, do the following try { } catch (DbException ex) { //ignorar }…
-
9
votes4
answers31300
viewsA: How to disable resize from textarea?
Setting ownership resize for none. Ex.: (All TextArea) textarea { resize: none; } <textarea></textarea> Ex.: Defining by class .resize-none { resize: none; } <textarea…
-
9
votes1
answer289
viewsA: Dropdown filter using C# MVC 4
Add a filter using .Where(). Something like .Where(x => x != NfeStatus.Ok). Or .Where(x => x.Description() != "OK") if you prefer to search for the description, although I think there is no…
-
1
votes1
answer264
viewsA: Exchange of XML between service and client
The shortest answer is: you don’t implement. The framework does all this for you. This "simplification", which makes it look like you are calling local methods, is called RPC (remote Procedure call)…
-
3
votes1
answer83
viewsA: ASP.NET MVC with Angularjs and Layoutpage
Of documentation of Angularjs Angularjs Applications cannot be nested Within each other. Translation Angularjs applications cannot be nested together. So don’t use a ng-app within another ng-app.…
-
4
votes1
answer1460
viewsA: How to use Ajax with Antiforgerytoken?
You will need to capture the value of the token before sending, this way var form = $('#Id-do-Formulario'); //Tanto faz a forma de capturar var token = $('input[name="__RequestVerificationToken"]',…
-
13
votes2
answers1625
viewsA: Lambda Groupby by year and month
Basically, there are two ways to do this. The complicated way, where it is necessary to make one grouping per year and another month, being this second within the first (Okay, it’s not that…
-
3
votes2
answers342
viewsA: Filter for the next 90 days ASP.NET MVC
Get all events with date equal to or greater than today and less than or equal to (today + 90 days). It is important to use the function TrucateTime() to disregard the hours. _con.SiteContexto…
-
4
votes2
answers714
viewsA: How do I know if a value is eternal in Python?
Two Pythonic Ways to Check This. With try-except try: iterator = iter(var) except TypeError: # não iterável else: # iterável Checking by abstract class Only works with classes new style - which do…
-
7
votes1
answer242
viewsA: Are cloned objects not equal when comparing to Object.equals()?
Cloned objects not equal for the Object.equals method()? No, certainly not. At least for the standard implementation of equals. According to the Java documentation: The equals method for class…
-
2
votes1
answer56
viewsA: Insert data with related objects
By default, items marked with disabled will not send values to the server-side. Your mistake says The INSERT statement conflicted with the FOREIGN KEY Constraint "[...]Usuarioid" I mean, he didn’t…
-
8
votes2
answers1007
viewsA: Blade and Angular JS Incompatibility in Laravel 5
Both Angularjs and Blade give you the option to change the "interpolator". In the example, I’m changing to <% variavel %>. No Angularjs Just create a config injecting $interpolateProvider…
-
5
votes1
answer112
viewsA: Entity Framework Error | not handled in user code
This is a generic error saying that some validation failed. To capture the specific error, you can do the following try { Classe.VariavelInteira = numInt; db.SaveChanges(); } catch…
entity-frameworkanswered Jéf Bueno 67,331 -
25
votes1
answer1890
viewsA: What is __all__ in Python for?
The __all__ should be a list of strings defining which symbols will be exported from a module when used from <module> import *. It also serves to facilitate the reading of the code. Anyone…
-
13
votes5
answers23915
viewsA: How do I know if the variable is an integer in Python?
Valid for Python 2 and 3 Using isinstance Pass as first parameter the variable you want to validate and as second parameter the "type". Example: isinstance(numero, int) # True Observing If you…
-
15
votes2
answers23324
viewsA: Count the number of occurrences of a value in a list
Using Python 2 or 3 Only use the method count() numeros = [5, 3, 1, 2, 3, 4, 5, 5, 5] numeros.count(5)…
-
5
votes2
answers1078
viewsA: Doubts about converting from Byte to Image in c# You are showing a strange and unusual error
You don’t need all this to convert an array of byte for an object Image. You can do it this way: public Image byteArrayToImage(byte[] img) { using (var ms = new MemoryStream(img)) { return…
-
3
votes1
answer437
viewsA: Add a new value to a list
Yes. Using append lista.append(Entrada)
-
6
votes2
answers512
viewsA: Sort Datetime field only by Date part
Entity Framework 6 Use DbFunctions.TruncateTime. contexto.Contas.OrderBy(c => DbFunctions.TruncateTime(c.Data)).ThenBy(c => c.Codigo); Entity Framework <= 5 Use…
-
3
votes2
answers55
viewsA: Best Way to Implement Dataannotations
For the record, the answer is valid for all types of Attributes and not only DataAnnotations. There is no functional difference between the two statements. It’s more a matter of liking "style"…
-
3
votes2
answers190
viewsA: Connection String Error in Visual Studio 2015
The message Represents text as a series of Unicode characters is not a mistake, is the description of string. The code actually has an error which is to use the \ as literal, this character needs to…
-
3
votes2
answers119
viewsA: Calling an Accountcontroller function
If the method needs to be used in several controllers he shouldn’t be in AccountController, at least not logically. I think it is possible to do this by instantiating the controller in question and…
-
3
votes1
answer422
viewsA: How to pick up object in php
You got some problems there. First, the verb GET has no body, data must be passed to the URL via querystring. So much so that if you open the documentation of $http.get will realize that the second…
-
11
votes3
answers935
viewsQ: Why does Javascript allow using variables without declaring?
I was doing a test on Jsfiddle, with the code below. In it I did not declare the variable i, but still, I can use it normally. Is that intentional or is it a flaw? So, I can just go out using…
-
4
votes1
answer45
viewsA: How to "escape" the @ in Razor
Ironically (or not) who makes the escape from @ is the very @. Use @@ should work.
-
10
votes1
answer2349
viewsA: What is the reference to Httpcontext.Getowincontext() ?
None. HttpContext.GetOwinContext() is an extension method in System.Net.Http. Possibly missing the bundle Microsoft.Owin.Host.Systemweb, it contains that extension. PM> Install-Package…
-
1
votes1
answer81
viewsA: Error while disconnecting from Postgresql
It happens that at the time of finally the variable pgsqlConnection is void because the using takes charge of making Dispose variable for you. Directly speaking, this block operation is not required…
-
4
votes1
answer127
viewsA: background-image: url( with a URL that has parentheses with Django template
Escape the parentheses by using %28 (() and %29 ()).
-
4
votes1
answer1532
viewsA: How to make a variable to store each number that a counter divides by a given number?
There are some ways to do that. If it is necessary to do some operation with these numbers, the best would be to create an array (or list) and save these values. If the only intention is to display…
-
2
votes2
answers390
viewsA: How to get a json value from a string.string
First, to access properties using a string, if you wear clasps ([]) and not point. The function getJson returns an object, you only need to do data["HOME"].["INTRODUCAO"] to access this property.…
-
2
votes3
answers460
viewsA: How do I create a directory through the Harbour language?
One way is by using the function MAKEDIR MAKEDIR("temp")…
-
16
votes3
answers7080
viewsA: In a list, what is the difference between append and extend?
extend() Gets a "iterable" as parameter and extends the list by adding its elements lista = [1, 2, 3] lista.extend([4, 5]) print(lista) # Saída: [1, 2, 3, 4, 5] append() adds an element at the end…
-
7
votes4
answers2097
viewsA: Print arraylist information on the screen
There’s a lot of things wrong there. First that this code should not even compile since on this line List<String> dog = new ArrayList<>(); a list of String and in the line below tries to…
-
12
votes5
answers15940
viewsA: How to create a directory in Python?
Reply using Python 3.* It is possible to use os.makedirs or os.mkdir. os.makedirs Creates all directories that are specified in the parameter, recursively. Ex.: os.makedir('./temp/2016/12/09') will…