Posts by OnoSendai • 36,218 points
614 posts
-
3
votes1
answer4093
viewsA: How to correct serrated source in Chrome?
This behavior has been corrected in Chrome 37. To simulate a result comparable to Antialias, you can use text-shadow, as in the following example: .teste { color: black; font-size: 50px; text-align:…
-
5
votes3
answers42289
viewsA: Is it possible to emulate a single ticket with mobile NFC?
Yes, it is possible. Indeed, there are already solutions implemented. Links: 'SPTRANS approves the recharge of the single ticket by mobile phone', sptrans.com.br Right Point Unico Ticket app, in…
-
1
votes1
answer316
viewsA: How to delete cookies from a website?
This code forces the expiration of all cookies whose scope is the current website: function apagaCookies() { var cookies = document.cookie.split(";"); for (var i = 0; i < cookies.length; i++) {…
javascriptanswered OnoSendai 36,218 -
5
votes2
answers718
viewsA: Entity Framework or Stored Procedure
I would like to know if Stored Procedures are really better at performing than EF. Short Version: YMMV, Your Mileage may Vary (or, your experience may differ from mine.) Long Version: Performance,…
-
11
votes8
answers13920
viewsA: Is <br> or <br/> or <br />right?
(The original title of the question seemed to me a question between two formats - <br></br> and <br />. The following answer takes this premise into account.) <br></br>…
-
1
votes4
answers542
viewsA: Subsequent Calls in Ajax
Pure Ajax can solve your problem. The term varies - Cascading calls or Sequential async calls: $.getJSON("http://example.com/jsoncall", function(data) { process(data);…
-
2
votes3
answers4720
viewsA: Implement HTTP POST and GET Requests on Android
Passing parameters via URL (GET) 1) Use the format http[s]://servidor/pagina.php?chave1=valor1[&chave2=valor2][&chaveN=valorN] 2) read the contents of your keys using $_GET var_dump(…
-
5
votes3
answers1392
viewsA: How to integrate Angularjs with common scripts?
First of all, answers to your questions: 1) Not. But it’s interesting that you know how Angularjs works, thus avoiding conflicts between the ways different Javascript plugins interact with each…
-
3
votes3
answers129
viewsA: How to share access between directives?
The recommended way is implementing a service that you should inject into the directives/controls where you want to share your variable. (The idea is that you can share the value and control access…
-
5
votes2
answers7885
viewsA: Grab parameters passed by url on another page
Utlizing Request.Querystring: string CdProcesso = Request.QueryString["CdProcesso"]; string CdTipoUsuario = Request["CdTipoUsuario"]; The first line demonstrates the capture of the value directly…
-
2
votes1
answer2186
viewsA: How to filter, with angular, objects of a JSON by an id that belongs to another object within the array
Correct me if I’m wrong, but if I understand correctly what you want is to filter a collection of objects according to a shared value between controllers. One of the possible ways is to implement a…
-
1
votes2
answers2250
viewsA: CRUD with Angularjs
Unfortunately I believe this is not possible using only technologies client-side (using file:// as repository) - Angularjs will need valid Urls. Establish a local HTTP service (Nodejs, IIS and…
-
5
votes2
answers1301
viewsA: How to Save and Recover All Sessions of a User
You can store the list of sessions enabled as an Application item. So: public void Session_OnStart() { if (Application["SessionList"] == null) Application["SessionList"] = new…
-
2
votes1
answer45
viewsA: How to compress my Resources files
A possible suggestion is that you implement a Custom Resource Provider that functions as a Broker between your files marked as Resources and the points of its application that consume these…
-
1
votes2
answers750
viewsA: How to apply colors to an image through a color palette without Flash?
A purely Javascript solution would be the jsColor plugin (http://jscolor.com/). Example: <script…
-
4
votes1
answer77
viewsQ: Sense/NET: Installation and programmatic configuration
I am currently working on solutions that require the storage of files uploaded by users, associated with these files and making them available to other users and common maintenance tasks (clean-up,…
-
6
votes2
answers1364
views -
7
votes4
answers4816
viewsA: Check Old Play Winner
Use bit maps (bitmaps). Your 'board' can be expressed in a sequence of bits, thus: Posições 2 | 1 | 0 5 | 4 | 3 8 | 7 | 6 Is equivalent to: Posição 876543210 Bit 000000000 The following condition of…
-
4
votes1
answer153
viewsQ: Httpmodule: How to handle Httpapplication errors without Httpcontext?
I have been finding a particularly interesting situation. I have a generic error handling routine implemented within a HttpModule, and recently I noticed a strange behavior: The event…
-
13
votes4
answers1502
viewsA: How to make a layout ready for all resolutions
Some considerations: Resolution The first, and most obvious, rendering difference between devices you need to pay attention to is the resolution, usually measured in pixels - the number of points on…
-
19
votes8
answers309745
viewsA: Reduce image size and maintain CSS aspect ratio
'Solution' using Jquery: Replace the element IMG by another that supports background, such as DIV. Pass the value of src for background-image, as well as tag width and height values IMG original:…
-
3
votes3
answers462
viewsA: JSON serialization and deserialization in desktop application
Natively, you can use the class System.Web.Script.Serialization.JavaScriptSerializer. new JavaScriptSerializer().Serialize(obj); Serialize the object obj. new…
-
3
votes2
answers1410
viewsA: How to effectively test and locate application security holes?
If you have no idea which exploit is being used, starting at the lowest level layer: the database. Identify the patterns. 'Invasions' always happen at the same time? Is there any similar content…
-
1
votes2
answers883
viewsA: When to convert a bitmap to string Base64?
What is the use of this practice today? Portability. In some cases you need to ensure that the feature will be available in any situation: If your HTML content is being generated dynamically in…
-
9
votes3
answers3275
viewsA: Algorithm for faster route calculation between two points in parallel Cartesian layers (3D)
Disclaimer: This is not an answer per se, just a compilation of the answers/possibilities so far. I imagine that the final result will be a combination of the suggestions presented. A* 3D…
-
30
votes3
answers3275
viewsQ: Algorithm for faster route calculation between two points in parallel Cartesian layers (3D)
I’m working on a solution that involves determining the least effort route between two points in a building. (Imagine students on their first day of university, and they need to know where it is and…
-
8
votes2
answers1671
viewsA: Is it possible to add an overflow behavior with scroll only in tbody of a table?
It is possible, but the solution is half convoluted because of the behavior of elements related to the element <TABLE>. By default, tbody owns the property display:row-group. This allows…
-
6
votes3
answers233
viewsA: nullable on the models?
[...] if there is the possibility of the value being null because it does not only leave without the ? A Nullable Type allows the possibility of a nonvalue (Null in this case) for a Value Type (or…
-
9
votes2
answers256
viewsA: How to solve special situations of unnatural value for a domain?
The answer describing the decision of the ideal procedure will depend on two factors: How resistant your model is to changes, and How resistant to change dependent processes are. Let’s go to a…
-
6
votes4
answers425
viewsA: Is it not recommended to use scaffolding?
If the only tool you have is a hammer, all the problems look like nails. Abraham Maslow Scaffolding is only one tool - useful in some cases and unnecessary in others. However, in saying that a…
software-engineeringanswered OnoSendai 36,218 -
9
votes3
answers739
viewsA: Can a video accelerator card improve non-fiction performance?
Video operations are costly. Gamers who criticize breaking artifacts (tearing) the 60FPS have no idea of the complexity of the operations being carried out by the GPU. But we are victims of this…
performanceanswered OnoSendai 36,218 -
3
votes3
answers15502
viewsA: SQL Server command to list active transactions
Via Transact-SQL: SELECT * FROM sysprocesses WHERE open_tran = 1 (Source.)…
sql-serveranswered OnoSendai 36,218 -
16
votes5
answers680
viewsA: What to do when a UI element cannot be used by a user?
It depends on the desired user experience philosophy. In general, some rules are used as default[Citation Needed]: Available function: When your procedural validation needs to be atomic and at the…
-
5
votes6
answers2305
viewsA: Transform results combination function into a dynamic function
Forget, for a moment, that we are talking about combinations of numbers. Let’s say we have N elements, and that I want to calculate how many possibilities of combinations containing M elements are…
-
59
votes4
answers3803
viewsA: What is spaghetti code?
So said the Master Programmer: A well-written program is its own paradise; a poorly written program is its own hell. The code Spaghetti is the antithesis of the code Zen. It is the process noise…
-
1
votes2
answers366
views -
3
votes3
answers140
viewsA: Sort images by height of each one
You have available, via Jquery, the function sort(). A possible solution would be the following: $lista = $('div.row div.parceiros').sort(function (itm1, itm2) { return $('.well',itm1).height() >…
-
3
votes3
answers831
viewsA: Tempdata["Message"] error in Runtime saying the object is null
Let’s look at the following line from the compiler’s point of view: TempData["Mensagem"].ToString() != "" It translates as follows: Get the value of the indexed property relative to the collection’s…
-
2
votes6
answers1855
viewsA: How to create link with Hover showing strokes on the sides
The response of Fernando is basically correct. Some properties have been added to allow adjustment of line sizes: ul > li > a { display: inline-block; background-color: #ccc; text-align:…
-
1
votes4
answers2358
viewsA: How to count how many times a value appears in a table
This is a case where you can benefit from associative arrays. //Array associativo var histograma = {}; // A função abaixo é chamada para cada célula: $('table#table tr td').each(function() { var…
-
1
votes3
answers281
viewsA: How to remove a word created by a plugin from the site
Original content: My content. (Free) Original HTML code: <div>Meu conteúdo. (Grátis)</div> Javascript to insert: <body onload="document.body.innerHTML =…
-
6
votes2
answers2117
viewsA: Procedural generation
Attention: This is not an answer, just a complement to Rogerio Barreto’s answer. Practical example of procedural generation, using seeding: var seed = 25; //Escolha um valor numérico positivo e…
-
5
votes2
answers2098
viewsA: Recognize if user is using iOS or Android
Server-side, you can check the header contents user-agent: // Match user agent string with operating systems Windows 3.11 => Win16, Windows 95 => (Windows 95)|(Win95)|(Windows_95), Windows 98…
-
2
votes5
answers1449
viewsA: Sorting in query - Leave last registration in first and then sort by a field
SELECT usr.* FROM usuario AS usr, (SELECT Max(id) AS maxid FROM usuario) AS src ORDER BY src.maxid != usr.id, usr.nome Explanation: First we define in a subquery which is the largest ID, and make it…
-
6
votes3
answers8188
viewsA: Validity of a QR Code
Most solutions of this kind[Citation needed] involve the definition of expiration in the database, the code being present in QR Code only one ID pointing to the record. The expiration encoding…
-
1
votes2
answers275
viewsA: Mount html by c#
Via Javascript: function formatarBloco(conteudo) { var resultado = ''; var blocos = conteudo.split('\n\n'); blocos.forEach(function(bloco) { var partes = bloco.split('\n');…
-
9
votes2
answers311
viewsA: How to check if it is a URL in input text?
As you have specified HTML5, you can define the type of a input of the kind Text. In your case, url: <!DOCTYPE html> <html> <body> <form action="demo_form.aspx"> URL:…
-
2
votes1
answer414
viewsA: Refresh on page when giving resize
There are several possible ways. These are a few: Via DOM window.onresize = function(event) { resizeGrid(); }; Via Event Listener window.addEventListener('resize', function(event){ resizeGrid(); });…
-
6
votes3
answers7963
viewsA: Making an OCR with no dependencies in PHP
If you have the possibility of installing on your server, Tesseract is an opensource OCR engine provided by Google. It has an wrapper for PHP. Otherwise, you can try webservices like the Google Docs…
-
7
votes5
answers7129
viewsA: Number of weeks in a month
According to your documentation, the function Date() allows the parameter W, which returns the week number of a given day. Then, to calculate the number of weeks, subtract the Week Number the last…