Posts by Oralista de Sistemas • 23,115 points
435 posts
-
1
votes1
answer602
viewsA: How to convert RGBA pixels to characters?
If you want a ratio of one character per pixel, you must break the line each x characters, where x is the width of the image. Consider inserting a line break in the multiple indexes of x. Or, as you…
-
2
votes2
answers88
viewsA: Is it possible to develop with Codename One for Windows Phone 8?
Last month a preliminary build of Codename One came out with WP8 support. More details in this post on the website itself. Attention to various details, such as the fact that XNA is not supported…
codename-oneanswered Oralista de Sistemas 23,115 -
0
votes1
answer168
viewsA: SQL does not work on another device after publishing to the web
First of all, it is generally not good practice to give direct access to the database on a mobile phone unless you have a very peculiar problem to solve. The ideal is usually that the mobile…
-
6
votes3
answers1211
viewsA: Concepts of Mesomorphic Allocation and Liberation in C#
Your variable imageArquivo is the type System.Drawing.Bitmap. That kind inherits from System.Drawing.Image, implementing the interface IDIsposable. Hence you don’t call the method Dispose of these…
-
2
votes2
answers8876
viewsA: Accents and Special Characters in Ajax jQuery
When making Ajax requests that may have encoding problems (because they contain accents, Tils, cedillas, or non-Latin characters (i.e.: Japanese, Arabic characters, etc.)), use the method…
-
13
votes2
answers73740
viewsA: How to access the print screen image?
When you use the key Print Screen, a copy of what’s on the screen goes to the Clipboard. It’s the same place where any information you copy or cut goes. Under . NET, you can access and interact with…
-
11
votes5
answers17141
viewsQ: Ignore CSS on a particular page snippet
Let’s assume I have some CSS of the type: #foo input { background-color: black; color: white; /* seguem mais um milhão de propriedades */ text-align: center; z-index: 9000; } All input son of foo…
-
1
votes3
answers285
viewsA: "Gambiarra" in C# with XML, I would like suggestions for improvement
Once you use LINQ, the method Distinct might come in handy. I.e.: lista.ItemsSource = s.GroupBy(t => t.NomeConsulado).Distinct().ToList(); Note that this method uses the standard comparison…
-
23
votes5
answers573
viewsQ: Why are you wearing shorts?
The guy short corresponds to a 16-bit integer - it is literally syntactic sugar for type Int16. The current processors are all 64 bits, even on the most machines low-end. Some older machines still…
-
4
votes4
answers6284
viewsA: How does an empty constructor work?
Every object is initially constructed with default values for all its members. This is a null reference for all members whose types are by reference, and the standard value of the type for all other…
-
11
votes4
answers10375
viewsA: Difference between Object, Dynamic and var
The guy object is the parent type of all other types in .NET. This is why you can use a variable of type object to point out or store all kinds of information on .NET. For those who have doubts…
c#answered Oralista de Sistemas 23,115 -
15
votes8
answers61967
viewsA: Should I use input type="Submit" or button type="Submit" in forms?
Functionally, with respect to the click, there is no difference - assuming a button whose property type has the value submit, which is the standard. If the button has another value for the property…
htmlanswered Oralista de Sistemas 23,115 -
11
votes2
answers7533
viewsA: The sequence contains no elements
This error happens in the method call First() of Linq, when the collection in which you call him is empty. You have two options: Review the passage that says Select(a=> a.ProductId).First() -…
asp.net-mvc-5answered Oralista de Sistemas 23,115 -
2
votes2
answers1613
viewsA: Simulate a keyboard key when losing focus
Use the event blur in the element that fires "Enter" when losing focus. And in the event capture, fire an event keypress with own information through the method trigger. Sort of like this:…
jqueryanswered Oralista de Sistemas 23,115 -
2
votes2
answers241
viewsA: Popular programmatically x data manually
There must be no difference. What Visual Studio does when you select a Datasource through its graphical interface is to generate the association code automatically. You could write that code…
-
8
votes1
answer862
viewsQ: Capture buttons pressed on video game control reliably
I want to use an Xbox controller to control a program. It’s not a game, it’s just an app Windows Forms. I don’t want to use XNA because I don’t want to force the redistributables to download when…
-
1
votes2
answers143
viewsA: Function with jQuery recording in two tables does not persist in BD
There seems to be no error in the Ajax calls, at least nothing that draws attention and indicates a wrong construction. Note that the code that uses jQuery in your example only executes posts. It is…
-
9
votes6
answers14419
viewsA: Which database should I use in a small desktop application?
Since this is not a question of the type "which database is better" at all, but rather one of the type "how can I solve a problem" (and a very common problem), I think the question is valid. That…
-
6
votes2
answers476
viewsQ: Versioning scheme
In . NET, the assemblies generated have four version numbers. I’ve heard a lot about larger version and smaller version (major version and minor version), and that those would be the first two…
-
9
votes6
answers2374
viewsQ: How to select all "empty" elements
Is there any way to select all the empty elements of a page? For some reason that I cannot explain, the code below does not select the input without text on my page: $("input[value=''],…
-
12
votes2
answers1950
viewsA: Close connection to database c#
In this line: bool resultado = usuaExiste.ExecuteReader().HasRows; You are creating a Data Reader. A Data Reader is an object that you use to take quick readings of the result of a query. As long as…
-
5
votes1
answer308
viewsA: Automatic reading routine between 2 C#databases
The answer depends on the type of hosting your app might have. If you’re staying somewhere that gives you accommodation web shared (Shared web hosting), you are limited to ASP.NET. In this case you…
-
14
votes3
answers24198
viewsQ: Wait for Ajax return in synchronous function
I have an operation that I need to perform synchronously, but part of the information I need can only be obtained via Ajax. I tried to synchronise everything with a wait for Ajax to return. The…
-
6
votes3
answers54
viewsA: Remove margin with jquery
You are using the symbol #, that selects elements by their attribute id. Use a dot instead of this character, and you will get the elements that have that class. Would look like this:…
-
2
votes4
answers3127
viewsA: How to prevent the input-text focus from being lost by clicking on another element?
If you click on another element, you going lose the focus of the text box. This is controlled by the browser. The most you can do is use the table row click event (or whatever event you already use…
-
25
votes8
answers95476
viewsA: How to check with jQuery if there is a checkbox checked?
Use the method prop instead of attr. Elaborating the answer: there is a certain difference between attributes and properties of HTML elements. I leave it to you to study this difference ;) checked…
-
4
votes6
answers6055
viewsA: Part of the Label in Bold?
Cannot do this with a single type control Label, since all he does is render a single string no formatting information. You need two or more controls to visually assemble your text if you are going…
-
10
votes2
answers275
viewsQ: Performance of string substitution
I need to do some bulk replacement operations with Javascript. For my specific problem, let’s assume that I need to replace a specific substring. I need to replace each occurrence of "blue" with…
javascriptasked Oralista de Sistemas 23,115 -
8
votes3
answers2418
viewsQ: Force jQuery event execution order
Suppose a page has several events being associated via jQuery. For example, in a given section, I have: $().ready(function() { foo(); }); And further ahead I have: $().ready(function() { bar(); });…
-
11
votes4
answers3950
viewsA: When to use ternary condition?
Robert Cecil Martin, author of the book Clean Code, suggests in the first chapter the following metric for the quality of a source code: the amount of times you hear your colleagues say "WTF" while…
-
8
votes3
answers243
viewsQ: "Unclosure" a closure
I understand the great powers and the great consequences of the closures. But suppose I have the following code... function foo () { var x = 1; function bar () { return x++; } return bar; } ... And…
-
1
votes7
answers9251
viewsA: In C#, what is the await keyword for?
According to the official documentation, this keyword suspends the execution of a method called asynchronously until a given task is completed. The text in the link goes deeper. It also follows the…
-
6
votes3
answers2363
viewsA: What does it mean: "functions are first class objects in Javascript"?
In languages like Java, C# and Visual Basic, you program everything in classes - they are the "citizens" of first class. The method Main that starts your program is a member of a class. The objects…
-
0
votes2
answers4107
viewsA: Dictionary Search
You can assemble a dictionary part just for that. You can populate it as follows: Dictionary<string, string> newDic = new Dictionary<string, string>(); Dictionary<string, string>…
-
4
votes2
answers299
viewsQ: Debug associated events via jQuery
When I want to debug an event associated with an element via jQuery, I can currently do it in the following ways: in Chrome, you can enable the debugger specifically for certain types of events.…