Posts by Miguel Angelo • 28,526 points
429 posts
-
40
votes4
answers10375
viewsA: Difference between Object, Dynamic and var
Object Refers to the type System.Object which is the basis for all other types, whether reference types or value types. Such a variable/parameter allows associating any type of data, where if it is…
c#answered Miguel Angelo 28,526 -
16
votes4
answers17158
viewsA: Include another HTML file in an HTML file
I don’t know if I got it right, but if that’s right, and how did you tag jquery, then why not use the load: $("#idElemento").load('xpto.html'); If the content is static, however, it is better to…
-
10
votes3
answers5730
viewsA: When should we declare a method static?
It is not static methods that are bad practice, but the use that is made of them. Using static methods in any code makes this code more coupled, because static methods cannot be replaced. But is…
-
3
votes3
answers497
viewsA: Take matrix size with EQ() - Jquery
If your goal is to apply some style to the latter div found inside the body, can do this using jquery selector :last: $( "body div:last" ).css( "background-color","blue"); or $( "body div"…
-
24
votes7
answers11287
viewsA: Is it wrong to write byte of images into the database?
It’s not wrong... most developers avoid doing this because usually the cost of database space is usually much higher than the cost of Storage. So ideally you use Storage to store large masses of…
-
3
votes2
answers181
viewsA: How to show the changes made in a SVN review?
Try to use --verbose next to the command you used: svn log --verbose -r XXXX Reference: simple command to show changes made in a Revision…
-
7
votes4
answers8606
viewsA: popup open only 1 time after being closed, even after reloading page
You will need to control if the popup display has already been made for a given user, and for that there are some ways: To display the popup you can use a ready-made library: jquery ui dialog - my…
-
1
votes2
answers500
viewsA: Extend a specific jQuery method in ASP.NET MVC jquery.unobtrusive-ajax.js
Analyzing the code of jquery.unobstrusive-ajax.js, I was able to verify that there are some points that can be extended by placing attributes in the form generated by Ajax.BeginForm:…
-
4
votes2
answers2412
viewsA: How to implement an abstract method in a daughter class?
The base class method cannot be called because it has no implementation in the base class. The call to the base class method should be made when the method is virtual in the base class, not when the…
-
4
votes1
answer1406
viewsA: C# Receiving Serialized Objects on a Webmethod
Your javascript must be making the call the wrong way. Assuming you’re using jQuery, do so: var oItem = { Codig: 0, Desc: "", Unid: "KG", Quant: 0, Custo: 0, IL: "", Centro: "", Saldo: 0 }…
-
6
votes3
answers4237
viewsA: Date field 01/01/0001
You must set the property to nullable, and put the date-Annotation Required over the field. As there is already another answer saying this, I will explain it in the most detailed way I can.…
-
4
votes2
answers397
viewsA: Increase an index to a certain number and then decrease until reset with jquery
You need a control variable indicating whether to increment or decrement, or to use some modular arithmetic: Using a control variable: var index = 0; var inc = +1; var handle = setInterval(teste,…
-
3
votes2
answers1836
viewsA: Duplicate column value, how to avoid?
You’d have to group over the field valorAuxilio and use aggregation functions on top of the other columns. SELECT GROUP_CONCAT(p.nome SEPARATOR ';'), GROUP_CONCAT(d.nome SEPARATOR ';'),…
-
3
votes1
answer1976
viewsA: Calling an executable other than Process in c#
You can run an application through the executable path: Process.Start("c:\\caminho do executável.exe");
-
4
votes2
answers2456
viewsA: End a C# process with WPF
There is no way inside the main program, itself close, before calling the Updater? // verifica se existe uma atualização // e se existir, inicia o Updater.exe e depois se fecha if…
-
3
votes1
answer449
viewsA: Problem with builder
This mistake is happening because ContaPoupanca who inherits from the class Conta is implemented without constructor, which causes C# to generate a default constructor that calls the base…
c#answered Miguel Angelo 28,526 -
6
votes2
answers195
viewsA: Jquery display: name
You cannot animate the display property. Before changing to display none (that you wrote wrong), you must animate another property whatever makes the element disappear: width or height: animate to…
jqueryanswered Miguel Angelo 28,526 -
5
votes2
answers2231
viewsA: Show image and upload an input
It doesn’t work that way. What you have access to is the contents of the file, not its path. To show an image that corresponds to the file do so: $(document).on("change", "#Upload", function(e) {…
-
9
votes3
answers5346
viewsA: Clone class objects using Icloneable
My dear, unfortunately the . Net does not have the feature of cloning an object in a controlled way. The only standard form given by the . Net is the method itself MemberwiseClone, that does what is…
c#answered Miguel Angelo 28,526 -
5
votes1
answer133
viewsA: Is there any strategy for a "de-collapsible" database?
What is operation undo? The concept of undo, has its best description in the systems of versioning of files. Of the behavior variants between the different versioning systems, I will highlight some…
-
3
votes4
answers1241
viewsA: Problem in CSS and JS path in MVC project
You’re probably using relative paths to reference the CSS and JS files. <link rel="stylesheet" href="css/file.css"> Ideally do not use relative paths for these files. Example: <link…
phpanswered Miguel Angelo 28,526 -
6
votes3
answers26168
viewsA: What is meta charset in HTML?
This serves to indicate which is the encoding of the html file served. In this case is indicating the encoding utf-8, which is a pattern defined by Unicode: Unicode UTF-8 The Unicode UTF-8 is an…
-
4
votes2
answers4041
viewsA: Image preview before Upload + Imageresizing.net
You can do this using the element canvas HTML5. function showThumbnail(files) { loadImage(files[0]); counter = 0; function loadImage( file ) { var canvas = document.createElement("canvas"), img =…
-
24
votes4
answers22728
viewsQ: What are the definitions of method, function and procedure?
I always thought the definitions were those, but it seems I’m wrong: function: every procedure that returns something methods: every procedure that returns nothing procedure: would be the…
terminologyasked Miguel Angelo 28,526 -
2
votes2
answers2905
viewsA: Automato for navigation in a Webforms application
Use the Phantomjs You can use the Phantomjs to simulate a browser, and do almost everything with it: take screenshots convert page to PDF navigation automation website testing The project uses…
-
0
votes3
answers3432
viewsA: How to take values from a Session and download them into variables?
I hadn’t noticed, but thanks to @Roger’s comment, I noticed you’re using anonymous class objects. It is not possible to read the properties of an anonymous class outside the method that created it.…
-
1
votes1
answer674
viewsA: Problem with javascript method coming from controller by Session
Not knowing exactly the code in which the error occurs(OP added error line), what I can do is try to explain in which situations this error occurs. If a variable is defined, but has no value in it,…
-
1
votes1
answer820
viewsA: How to create a query with Union using Nhibernate
If you have control over the database, you could create a view in the database, which makes Union, and then map a class of yours to the view. This would solve the problem. If it’s not that way, I…
-
2
votes5
answers501
viewsA: Hover only on some columns
To the better compatibility with browsers, recommend you do this using the following CSS: table tr td:first-child:hover, table tr td:first-child + td:hover, table tr td:first-child + td + td:hover,…
-
0
votes4
answers6360
viewsA: Break row into table cell in CSV format to be read by Excel
Suffice save an Excel table in CVS format, with a line return inside the cell. I did it in excel 2007 and what he saved was a '\n'. Also, you put the value of the cell inside double quotes. Example…
-
3
votes1
answer2741
viewsA: Move files between folders with C#
The . Net has a specific method for moving files: System.IO.File.Move("c:\\origem.txt", "c:\\diretorio\\destino.txt"); Note that this method is able to move and also rename the file... to move only,…
-
0
votes1
answer27
viewsA: Modify website from 1290px to 960px
You could conditionally set a class to the body of your page according to the window size. EDIT It’s just that I’ve already answered a similar question here at SOPT: /a/6911/1925…
-
2
votes1
answer1213
viewsA: Recover textarea value in form . serialize()
You have to update the fields related to Ckeditor, before using the serialize: for ( instance in CKEDITOR.instances ) CKEDITOR.instances[instance].updateElement(); After that, the Ckeditor field…
-
8
votes7
answers3901
viewsA: What does incrementing mean?
Short answer Increment is a common term in programming, which refers to adding 1 to a variable, and storing the value in the variable itself. It would be the same as doing so: valor = valor + 1…
terminologyanswered Miguel Angelo 28,526 -
1
votes2
answers884
viewsA: How to call an ASPX page function in another project?
You could pass the method to be caller for BLL as a delegate, and then use the delegate to call the method. Example: Code of the BLL: public void RegraInserir(Action metodo) { metodo(); // chamando…
-
1
votes1
answer256
viewsA: Get Weekday through a LINQ date
Use the method SqlFunctions.DatePart, that allows you to obtain the parts of a date within a LINQ-To-Entities query: I think it would look something like this: var resultado = db.P .Where(x =>…
-
19
votes1
answer5340
viewsA: Difference between high-order and first-class functions
A language has first class functions, when functions can be treated as values that can be passed, manipulated, returned... that is, it is possible to operate functions. This concept is an attribute…
-
10
votes3
answers4914
viewsA: Run VBA code from text file
Have you tried creating a file vbs (VB Script)? In this file you can use VB Script to do whatever you want, independent of excel. There are probably some differences, but nothing that can’t be…
vbaanswered Miguel Angelo 28,526 -
5
votes2
answers4328
viewsA: Use of multiple classes in a single CSS declaration
This means that the style will be applied to an element that has the class "style-font" and that is inside an element with the class "menu" and that in turn is inside another element, finally with…
cssanswered Miguel Angelo 28,526 -
58
votes3
answers6437
viewsA: Inaccurate result in broken numbers calculation
Short answer This occurs because of an inaccuracy in converting the value 1067.11 to the representation of the number in memory... this inaccuracy, which is revealed to the subtract the value 1000.…
-
11
votes1
answer2170
viewsA: What does 1e+24 Chrome console mean?
That’s an exponential representation. It is not possible to differentiate the two because these numbers extrapolate the maximum precision of the numeric type used by javascript, which is below the…
-
1
votes1
answer64
viewsA: Dynamically manipulate webcontrol element
You yourself almost answered the question. Using yourself FindControl can find a control in the context in which it is, you can then find the other controls, making a for and concatenating strings…
-
6
votes7
answers13788
viewsA: How to represent money in Javascript?
Instead of storing the value with decimal separator, because do not store the amount of cents for example, ie just determine the minimum amount of money to be stored, and store the multiples of that…
-
27
votes4
answers6910
viewsA: How does namespaces work in C#?
Namespaces are for two things in my view: organize the code by grouping classes, structures and the like avoid class name conflicts, structures, delegates, etc.. What the namespace means When you…
-
5
votes4
answers37227
viewsA: Calling one function inside the other, through a string
Just a hint, you can put the functions inside an object, and call it by name: <script> function a() { var nomeDaFuncao = [função a ser chamada]; var fncObj = { b: function(objeto) { . . . } c:…
-
1
votes3
answers122
viewsA: Jquery does not return the minimum value when using Math.min( )
You use the function map to take the values of all elements, and then take the minimum of all using Math.min: var valores = $(this.SubOfferGroups).map(function () { return…
-
4
votes5
answers35057
viewsA: How to define the border color of a table without CSS?
One of the ways (and that works consistently across all browsers) is to set the background of the table to a color, place a cellspacing, and then color the background of each white cell (or the…
htmlanswered Miguel Angelo 28,526 -
1
votes1
answer100
viewsA: Doing research inside a Session
Create in your controller a method responsible for doing the research, and then call this method via ajax, and reconstruct the list of hotels with the items returned from the call: Controller…
-
4
votes3
answers216
viewsA: CSS selector for tables
You can use the pseudo-selector :not thus: :not(.tabela-isolada) As it has several styles, and wants to delete by table, it will get a little extensive: table:not(.tabela-isolada),…
-
3
votes1
answer724
viewsA: Notification Chrome
You’re writing it wrong: window.webkitNotifications // correto: letra 'k' minúscula window.webKitNotifications // errado (letra 'k' maiúscula está errada) The official API name is Notifications, and…