Posts by André Leria • 5,047 points
44 posts
-
0
votes1
answer269
viewsQ: Footer buttons like the old Symbian with Twitter Bootstrap
I’ve been tasked with making a mobile web app, and I’m trying to do it with the help of Twitter Bootstrap. One of the tasks is to make a pair of buttons in the footer, both of equal size, each…
-
7
votes7
answers21565
viewsA: Why is the use of frames and iframes considered bad practice?
As already answered here, there are several technical problems (such as accessibility). I will put here several possible substitutes for frames and iframes: div: making good use of CSS and DOM…
-
1
votes2
answers444
viewsQ: Streaming data over HTTP in Javascript
There is some way to send data over Http, but instead of all the information at once, send one part at a time? For example: I make an HTTP request to GET /produtos. This will return all my products…
-
1
votes1
answer765
viewsQ: Upload multiple files with Node.js
I’m trying to upload multiple files with Node.js, but I can’t do the server part. I am using Expressjs as a framework, and if necessary I can use other packages to facilitate this task. For now, I’m…
-
10
votes1
answer133
viewsQ: Is there any strategy for a "de-collapsible" database?
I’ve seen on some sites (like even Stack Exchange) a possibility to "undo" an action in the database (like in Question Edits / Answers). I’ve been thinking about some possible solutions, but I’m…
-
34
votes7
answers14277
viewsQ: What can C++ do that C# can’t?
Being a programmer . Net but with an old passion for C++ (which has grown since C++11), I was with this curiosity. I know . Net can be "extended" with C++/CLI, but I would like to know what C# pure…
-
1
votes3
answers2713
viewsA: ASP.NET MVC5 - Asynchronous Methods in Controller
I think the asynchronous execution gets more interesting in the data call part of the database: [Authorize] public async Task<JsonResult> IndexAsync() { var pessoas = await Task.Run(() =>…
-
7
votes1
answer146
viewsQ: Is there a specific type for passwords other than String in . Net?
I see very commonly the use of strings to store passwords in the program memory, not only on . Net, but in all the programming languages I’ve used. At first, I don’t see a problem in it. But as I…
-
4
votes2
answers521
viewsQ: Can I use any programming language in Windows Azure? How?
The Windows Azure website makes it clear and explains how to use multiple programming languages. But still, it doesn’t explain how to use some simpler languages, such as C itself++. I know Amazon…
windows-azureasked André Leria 5,047 -
2
votes1
answer651
viewsQ: How to access child items in a Boundfield of a Gridview in Asp.Net Web Forms?
I know in the middle of a GridView, an immediate item can be read with the tag BoundField: <asp:BoundField DataField="MeuItem" HeaderText="Meu item" /> But I get a mistake trying to do that:…
-
4
votes1
answer83
viewsQ: Charset problem with Postmodern no Common Lisp (SLIME)
I am trying to prepare an environment to study the development of web applications in Common Lisp. As I am without a personal computer at the moment, I am trying to learn from the Lispbox to have a…
-
1
votes2
answers969
viewsA: HTML Desktop app with Node.JS + Socket.IO
It’s really a problem to be a web application? See: Node.js was made for the web. Html5 is being developed to improve web applications. While Html5 is not fully equivalent to the potential of a…
-
2
votes8
answers2292
viewsA: Why create an object using the superclass?
There are other advantages. The difference is implied and, if you look at it well, it’s almost obvious: A Musico can be a Baterista or a Violonista, but a Baterista can’t be a Violonista and vice…
-
76
votes6
answers42802
viewsA: What is the difference between . on("click", Function() {}) and . click(Function() {})?
It is basically how the association to the element is made. .click applies to the current FOD, while the .on (using delegation) will continue to be valid for new elements added to the DOM after the…
jqueryanswered André Leria 5,047 -
1
votes5
answers2130
viewsA: How to add a class to a <li> by clicking on it, leaving only it with this class?
First, give your class uls. We will name them tipoRadio. And the class of selected items will be selecionado. $(function() { $(".tipoRadio").on("click", "li", function() { var ul =…
-
5
votes4
answers8200
viewsA: How to send text to the printer with PHP and Javascript?
I don’t think it’s possible the way you want it. PHP is a server language. She never talks directly to the client; the only way she can "say" anything to the client is through an interface (which is…
-
2
votes2
answers111
viewsA: Send data to Database
This error is a database message saying that you are trying to provide a null value to a field that cannot be null. From what I understand, you’re trying to put a record in the equipment table, and…
-
8
votes2
answers205
viewsQ: What is the difference between Scheme sequels and other languages?
I have heard that Scheme has "first-class sequels", while other Lisps (and other languages) do not. I researched it, but the material I found was not specific. What I understand is that sequels are…
functional-programmingasked André Leria 5,047 -
1
votes5
answers2480
viewsA: Check if day exists in month
Simple, try to create the date and see if it fails: DateTime dia; try { dia = new DateTime(year: 2014, month: 02, day: 31); } catch (ArgumentOutOfRangeException ex) { // A data não existe, tratar }…
-
7
votes8
answers5453
viewsA: Why in some if’s situations are considered bad?
This depends a lot on the languages. In that reply the other question, I gave an example of how ifs can be abused in languages that support Interfaces (such as C#, Visual Basic.NET and Java). In…
-
11
votes3
answers17410
viewsQ: How to create a Javascript function that accepts an arbitrary number of arguments?
Functions of the type console.log take any number of arguments. How to specify this for a Javascript function?
-
13
votes3
answers17410
viewsA: How to create a Javascript function that accepts an arbitrary number of arguments?
In Javascript, every function, regardless of the arguments specified in its signature, has an object arguments. This object contains all arguments passed to the function. But at first it is of type…
-
19
votes2
answers6496
viewsQ: What is the difference between recursion and tail recursion?
In functional programming languages, it is said that it is possible to avoid stack bursts using "tail recursion". But what is the difference between normal recursion and tail recursion?
-
25
votes2
answers6496
viewsA: What is the difference between recursion and tail recursion?
The difference is precisely where the recursive call is called: If it is called in the "tail" of the function, it is a recursive tail call. The "tail" of the function is its last call. It is the…
-
32
votes3
answers6231
viewsA: What does "??!?!" mean in C language?
The C compiler, when viewing the characters ??! in sequence, transforms them into |. If I’m not mistaken this is due to the fact that formerly were not very common computers with the key |. That is…
canswered André Leria 5,047 -
15
votes4
answers1141
viewsQ: How to simulate "tail recursion" in C#?
No. Net, I know it is possible to make cause calls because the compiler of F#, when optimizing code, transforms a function with tail recursion into a function with a loop, thus avoiding stack…
-
5
votes3
answers5030
viewsA: Keep zero after comma using the float type?
Simple, use ToString: resultado.ToString("N2"); Where 2 is the number of decimal places. Reference…
-
14
votes4
answers2252
viewsQ: What is the advantage of hiding the class constructor in favor of a static method (no .NET)?
My leader uses this pattern in ALL his classes (I’ll give the examples in C#, but it goes for any . NET language): public class MeuTipo { private MeuTipo() { } // esconder o construtor public static…
-
1
votes1
answer97
viewsQ: How do you model 1x0 relations. 1 (optional one-to-one) in the Entity Framework Code First?
When an Entity CAN have one (and only one) instance of another Entity, but the second entity must have the first, as the Entities modeling is done?
-
10
votes6
answers32712
viewsA: Abstract Class X Interface
An abstract class, in C#, is a class that defines a basic but not self-sufficient behavior. Because it’s not enough, you need to create a class that you inherit from it in order to use it. I don’t…
-
33
votes8
answers45010
viewsA: What is the difference between C# and ASP.NET?
The C# you use is always the same, both for desktop and web (Asp.Net). Asp.Net is the Microsoft technology you use to do the server-side part of web applications. Don’t confuse this with ASP…
-
9
votes6
answers1227
viewsA: Property readonly . NET
Just use the modifier readonly in a field: public readonly int Numero; For example. So, Numero only one value can be assigned in the Constructor of the class. Note that it is not used readonly…
-
1
votes2
answers67
viewsA: How to convert Sender to a Form?
You’re using the wrong syntax. Right: sender as Form sender(as Form) would be an attempt to call sender as a function, and then an ugly compilation error because the compiler has no idea what to do…
-
1
votes1
answer2484
viewsA: How to create a dynamic Gridview?
That’s perfectly possible, but it’s not the easiest thing to do. In fact, anything to do in Web Forms that is not directly provided by the platform has its complications. As such, this can be…
-
12
votes3
answers1088
viewsA: Where to put this logic? Controller or Model?
According to the MVC standard, all logic, mainly related to database, should be placed in the Model. Consider the MVC standard as a computer. The Model is the CPU, the View is your monitor and the…
ruby-on-railsanswered André Leria 5,047 -
10
votes5
answers24456
viewsA: AJAX request with pure Javascript (no Apis)
The pure Javascript AJAX request is made with the object XMLHttpRequest. Unless you want to use an older version of Internet Explorer, for example, that used an object ActiveX. So, one usually…
-
2
votes6
answers6049
viewsA: How to make a textbox that updates every time you change the content?
As I understand it, you work with Asp.Net Web Forms. The solution is simple: add the property AutoPostBack and listen to the event TextChanged. ASPX: <asp:TextBox runat="server" ID="MinhaTextBox"…
-
24
votes7
answers6727
viewsA: In object orientation, why are interfaces useful?
Interfaces should, as the name says, provide interfaces for manipulating objects. If a group of different objects has the same kind of action required, you implement an interface in all these…
-
24
votes7
answers20675
viewsA: What are lambda Expressions? And what’s the point of using them?
In essence, the advantage (in C#) of using them is being able to carry small functions as values. In essence. Because they involve several other advantages. In fact, x => x * x is not ONLY a…
-
26
votes7
answers9251
viewsA: In C#, what is the await keyword for?
The keywords async and await are used for asynchronous programming. For reference, see: Asynchronous programming with Async and Await. In essence, you use the keyword async in the declaration of a…
-
3
votes4
answers271
viewsA: Does the secure API depend entirely on the developer or platform?
If I understand correctly, it depends on both. The API is often the differential of each language: I, for example, find C++ superior to Java as a language. But the Java API is extensively more…
-
1
votes5
answers4549
viewsA: How to pick up images on the internet through Java?
Using java.net.URL, java.awt.Image and javax.imageio.ImageIO: Url url = new URL("http://www.tempoagr/tempo/irati/temp1"); Image imagem = ImageIO.read(url); Remember that for this to work the URL…
-
0
votes4
answers1069
viewsA: Select and drag Swing component
If you want to do it by hand... it’s been a while since I work with Java, but I’ll try to give you some tips. Whenever the user draws a polygon, keep in memory the coordinates of this polygon. It is…
-
9
votes2
answers4107
viewsA: Dictionary Search
If I understand correctly, you just want to return the Keys whose value is "AAA". I would do this with LINQ, available from the . NET 3.5 (if you could specify which one you use would be better).…