Posts by OnoSendai • 36,218 points
614 posts
-
6
votes2
answers801
viewsA: How to change the value of a property given its name
You can use a combination of: PropertyInfo: Allows observation and handling of type characteristics; Convert.ChangeType: Allows the change of types who implement IConvertible between formats during…
-
7
votes2
answers822
viewsA: Web application running in background
Your question is composed of two parts. Processing in background This is one of the cases where threading can be an excellent tool for firing asynchronous methods. The idea is to start a thread…
-
57
votes3
answers4929
viewsA: What is the point of using double negation in Javascript?
This is a quick way to convert the result of an expression to a boolean value True/False (or in technical terms, offering a guarantee of Typecast for boolean), thus simplifying conditional…
javascriptanswered OnoSendai 36,218 -
29
votes3
answers10406
viewsA: How does HTTPS (SSL) work?
The protocol is considerably robust, but can greatly burden communication between client and server. The list of 'steps' ( and its code in a SSL Packet) for the establishment of an SSL connection is…
-
0
votes2
answers83
viewsA: Rotate CSS3 and Tables
Part of the fault may be the default property definition Display for elements P. Try the following: p { -webkit-transform: rotate(-90deg); white-space: nowrap; display:inline-block; } A Fiddle of…
-
1
votes3
answers800
viewsA: List every month in an intevalo, or in the query or in the programming?
My knowledge in PHP is very limited, but I can try to help with a bank-side solution. Set the period SELECT @mindate = MIN(dt_validade), @maxdate = MAX(dt_validade) FROM tabela Partial result: |…
-
39
votes3
answers10939
viewsA: How does the C#lock work?
Lock is a very useful tool when you need to ensure exclusive access to a given resource, or ensure Thread Safety. This function makes use of an object as a synchronization flag (in your example, the…
-
13
votes4
answers2869
viewsA: Is it recommended to use natural primary key?
Short version - No, it’s not recommended. Long version - I would understand your question as follows: The Benefit of Owning a Database without Process Artifices versus the cost of maintaining a…
-
2
votes2
answers256
viewsA: Is there any risk when disconnecting the android device during debugging?
TL;DR - Nothing you should worry about. Long answer: The risks involved in a disconnection from the USB port during debugging are exactly the same as what the device is subject to during everyday…
-
3
votes1
answer155
viewsA: Optimized approach of checking if there is a certain entry in Windows hosts file
If I may comment, this is an approach that can be considered fragile. A more experienced user will change the routes directly on the router and leave the file HOSTS untouched. Something more secure…
-
7
votes1
answer2096
viewsA: Algorithm for cutting plane
The name of this type of algorithm in English is Bin Packing, a variant of backpack problem. A binary tree is used to select, in several passes, the best distribution (optimal Distribution) content…
-
1
votes2
answers765
viewsA: How to turn a div with 4 images into just one?
[...] turn the div "contentFrente" into just an image, or pdf, or even turn the entire HTML page into a url[...] You can use the library Html2canvas to convert your page, or part of it, to a DataURL…
-
2
votes1
answer31
viewsA: Callback for CSS3 Transitions
Via Javascript you can use the event webkitTransitionEnd to determine when a transition ends. For example: meuElemento.addEventListener( 'webkitTransitionEnd', function( event ) { alert( "A…
-
11
votes2
answers958
viewsA: What is the difference between: Urlencode, Escapeuristring and Escapedatastring
All these methods relate to RFC 2396, that defines the syntax of Uniform Resource Identifiers (or URI) and, in the case of Urlencode, also the RFC 1738 (defining Uniform Resource Locators, or Urls).…
-
61
votes4
answers72185
viewsA: What is a callback?
Callback (or callback, in Portuguese) is a flow control mechanism that aims to benefit asynchronous processes. The main idea is to release the application so that other actions are taken without it…
-
14
votes3
answers29267
viewsA: Barcode Converter - Convert Barcode to Digitized Line
A complete description of the relationship between the two formats can be found here: What is the difference of the FEBRABAN barcode read for typed? for Leonardo Calandriello. I copy relevant…
-
9
votes1
answer826
viewsA: Is SQL Query in Loops a good practice?
TL;DR: No, it’s not good practice. Long answer: As a general rule assume that it is always best to insert as little as possible overhead in whatever process you are mapping. In the case of several…
-
1
votes1
answer106
viewsA: How to capture parameters by XSL?
In Sharepoint you can use ParameterBinding to associate a key from Querystring is a parameter. Thus, for a Querystring ?IDSelecionado=10, the following code: <ParameterBinding…
-
3
votes1
answer358
viewsA: "Geographic" location of devices in indoor environments
I’m working on a solution like this for the university where I work. It follows the @bfavaretto comment line, with NFC tags to facilitate individual localization (an individual can 'sign' in a…
-
11
votes1
answer999
viewsA: How to update data in real time?
The name of this type of technology is Push (English Push), where the server initiates a transaction with the client (in your case, the browser). It’s the opposite of what we normally use in web…
web-applicationanswered OnoSendai 36,218 -
3
votes5
answers801
viewsA: Is it possible to upload files without using PHP?
Remotestorage is a Javascript API that uses OAuth and Node.JS and in theory meets your client-only solution requirement: http://remotestorage.io/integrate/…
-
4
votes1
answer2819
viewsA: Minimum bits required to represent a natural number
First, the mathematical aspect: A positive and integer number n has b bits when 2b-1 < n < 2b-1. This means that as long as my integer does not exceed the value of a given power of 2, the…
-
4
votes3
answers1650
viewsA: How to make a POST that passes beyond the form, a file?
You will need to implement type requests Multipart, part of the specification HTTP 1.1. For demonstration purposes, I created the following webform, containing text fields and a fileupload: <%@…
-
2
votes1
answer82
viewsA: How to get the site’s user list from the Stack Overflow API?
To obtain the user list of one of the Stack Exchange sites: http://api.stackexchange.com/2.2/users?site=[SiteDesejado] Example: http://api.stackexchange.com/2.2/users?site=stackoverflow To obtain…
-
16
votes3
answers568
viewsA: Compute secure data randomly
Before directly answering your question, I would like to establish some parallels that will help in understanding the answer. First, evaluate the sequences below and their corresponding formulas:…
-
3
votes2
answers2983
viewsA: Run DOS commands in Visual Studio
THE COMMAND OF NET is an executable - net.exe. Thus, it can be invoked as an executable via class Process. Here is a wrapper that returns a string containing the result of the command. Example of…
-
4
votes1
answer772
viewsA: What does the crossDomain:false parameter in Ajax mean?
In the Jquery concept, the parameter crossDomain:false sets the behavior if redirects between domains occur on the page called by the method. For example: www.dominio.com/pagina.html invokes Ajax…
-
5
votes1
answer1537
viewsA: Difficulties writing a user friendly (global) web config url
One possibility is the implementation of a HTTP Module which will intercept all requests, and decide which page will be executed. Follow an example according to your need: public class LocaleParser…
-
3
votes2
answers7594
viewsA: Send objects via socket
Your problem lies in controlling your stream communication. Your initial method of reading string and reading from stream via nextLine is actually a very simple and widely used flow control…
-
3
votes4
answers313
viewsA: Changing a random string of characters using Stringbuilder
Since you explicitly mentioned one StringBuilder, here’s an example: var mascara = "12****3*59**100*"; var numero = "12345768".ToCharArray(); var mascarr = mascara.Split('*'); var buffer = new…
-
3
votes1
answer92
viewsA: Exception mapping . NET for HTTP status codes
Solution Exceptions may suffer cast for the guy HttpException, and from this type the method GetHttpCode() may be called: try { throw new FileNotFoundException("Teste"); } catch (Exception err) {…
-
3
votes1
answer92
viewsQ: Exception mapping . NET for HTTP status codes
Situation I’m working on one Httpmodule who is responsible for monitoring usage patterns and intercepting and managing untreated exceptions in ASP.NET applications via events BeginRequest,…
-
5
votes2
answers706
viewsA: How to control Javascript file type without capturing extension?
TL;DR: There’s no way at the moment. Long answer: Yes, it is possible, but not with the current tools. Most detection solutions for MIME Type are based on the file extension - Filetype.JS, for…
javascriptanswered OnoSendai 36,218 -
0
votes3
answers993
viewsA: How to simulate JSON responses?
Basically what you need is to serialize your collection of QueryStrings. In C#, you can create a Handler with the following content: public void ProcessRequest(HttpContext context) { string…
-
5
votes1
answer73
viewsA: Create 2 elements influencing the same CSS
I think I got it. You can define a same set for two or more rules, separating them with commas: #div:hover #elemento, #div2:hover #elemento { display:block; } In case I got it wrong, feel free to…
-
4
votes3
answers3787
viewsA: How to decompose a number into powers of 2
I have a sequence of numbers: 1, 2, 4, 8, 16, 32 and so on So 'so go', I’m assuming that your sequence represents powers of 2: 20 = 1 21 = 2 22 = 4 23 = 8 24 = 16 25 = 32 I can infer, then, that the…
javascriptanswered OnoSendai 36,218 -
3
votes1
answer1040
viewsA: Image recognition within a larger image
I don’t know any client-side (JS) solution that can perform, with a decent degree of accuracy, this type of functionality. You can, however, use a server-side solution. One of the possibilities is…
-
5
votes2
answers201
viewsA: Better/Secure way to transfer sensitive data to an android application through JSON
Encrypt your content after serialization, and before sending it; Decrypt when receiving on the server, and before passing the payload for your JSON interpreter. Use a strong, reversible…
-
20
votes4
answers12575
viewsA: What does "0x" mean at the beginning of hexadecimal numbers?
0x or 0X is a prefix that was initially used by AT&T Assembly compilers in the late 1960s to represent hexadecimal numerical values. Bell Laboratories, at the time a subsidiary of AT&T, was…
hexadecimalanswered OnoSendai 36,218 -
0
votes1
answer152
viewsA: Swap image with mouse over bit map field
There are some Jquery plug-ins that can help you in this regard: Maphilight Source: http://davidlynch.org/projects/maphilight/docs/ Example of use:…
-
1
votes2
answers422
viewsA: What are the possible cases of using a persistent connection?
This is exactly the same point that Client-Server developers, accustomed to permanent connections, raised when dynamic web applications began to popularize themselves using frameworks such as CGI,…
-
1
votes1
answer1512
viewsA: Insert Google Drive Spreadsheet into Website
You can force an element around the IFRAME in order to move the content you don’t want to see out of the viewport. Example: <style type="text/css"> #iframe-holder { overflow:hidden; position:…
-
6
votes1
answer523
viewsA: Using hexadecimal as ID in the database
What is the advantage of using hexadecimal values instead of whole? Hexadecimal is a slightly shorter representation. For example, the following two values are identical: 999999999 DEX 3B9AC9FF HEX…
-
1
votes2
answers311
viewsA: Maintain full size image - CSS
Use the property background-image to display your image, and the values contain and cover to the property background-size to set how the image will be displayed. Example: <html> <style>…
-
8
votes1
answer1726
viewsA: Difference between Stathread and Mtathread
TL;DR: MTA and STA are behavior specifications for threads of COM objects. Use STA on objects where you cannot guarantee thread Safety. Long version: There are two excellent responses in Stack…
-
3
votes2
answers459
viewsA: Access peripheral devices through the browser
Depending on your infrastructure, you can make your web application interact directly with your tax printer from your server. This requires access to the printer. This way you eliminate individual…
-
3
votes2
answers133
views -
0
votes3
answers1577
viewsA: Embed for my website content
Instead of making use of an IFRAME, you can try to dynamically load the rendered HTML from the remote page to an element of the current page. Here’s an example in jQuery:…
-
2
votes1
answer75
viewsA: Html button when mouse
The CSS selector :Hover I think the best option. Example: :Hover transitional HTML: <img class='dizzyimg'…
-
6
votes2
answers577
viewsA: Is it good practice to keep foreign key columns redundant?
My personal opinion is that the benefit does not outweigh the ripple effect of integrity updates and validations on a large mass of data. Several Dbmss implement execution plans where the dependency…