Posts by Tobias Mesquita • 22,900 points
750 posts
-
2
votes1
answer1616
viewsA: Create a Web Api that calls another Web Api
First, two WebAPIs is no safer than just one, this approach will not protect your system from an attack such as MITM, Sql Injection or whatever other attack you might imagine. If your fear is that…
-
26
votes5
answers7326
viewsA: Is Javascript an Object-Oriented language?
Yure, this will depend somewhat on your interpretation of what object orientation is. for example, if you do a search on Dev Mozilla, you will see that according to their interpretation, Javascript…
-
6
votes2
answers680
viewsA: Disable css and image caching in the browser
Zack, unfortunately I’m not aware of any metatag that forces the cache clean. but you can use a hack to force the file update. The simplest would be to add extra information to the link to the file…
-
1
votes2
answers97
viewsA: Mechanics Caroussel bootstrap, slide show
Miguel, I’m just going to share a work of mine, maybe give you some ideas. var carousel = document.querySelector(".carousel"); var images = [ "http://www.w3schools.com/bootstrap/img_chania.jpg",…
-
0
votes1
answer255
viewsA: Send List of Objects to my wcf web service
CS, I advise you to generate the Webservice proxy using the "Add Service Reference..." option that appears when right-clicking on "References". try to use a "Metadata Exchange" endpoint when…
-
1
votes1
answer893
viewsA: how to get the value of a specific checkbox in Asp.net mvc using Jquery
you can add a class to your CheckBox, then use it as selector. @Html.CheckBoxFor(model => item.Ativo, new { @class = "ckAtivo" }) and in jQuery do the following.:…
-
2
votes3
answers7601
viewsA: Get time and date independent of system time
I tried to set an example using the ideas suggested by @Maniero, @Luizvieira and @Gustavotinoco var script = document.createElement("script"); script.type = "text/javascript"; script.src =…
-
4
votes4
answers94
viewsA: Table A data not contained in Table B
I don’t know about Mysql, but in SQL Server it is possible to write in 3 different ways: NOT IN SELECT usuarios.* FROM usuarios WHERE id NOT IN( SELECT IdUsuario FROM cartao ) NOT EXISTS SELECT…
-
2
votes3
answers656
viewsA: Generate password hash and save to database
the method below stores the password in two fields, a binary[16] and another binary[64], respectively salt and the password itself. private byte[] CreateSalt() { var salt = new byte[16]; using (var…
c#answered Tobias Mesquita 22,900 -
4
votes4
answers1313
viewsA: How to organize alphabetically a select obtained through a JSON?
unfortunately it is not possible to sort the keys of a JSON, but you can map your object to a array of objects, then you can use the function sort. var data = { "12": "Acre", "27": "Alagoas", "16":…
-
3
votes1
answer5856
viewsA: maskMoney without having to select input
you can force the formatting when firing the event mask.maskMoney. $(function() { var maxLength = '-0.000.000,00'.length; $("input").maskMoney({ allowNegative: true, thousands: '.', decimal: ',',…
-
2
votes1
answer837
viewsA: Create temporary file using C# and ASP.NET
I believe that to follow this path you will face some problems, in any case I have some suggestions. To return the file HTML to the user, you can convert the string for byte[] and return a…
-
1
votes1
answer285
viewsA: How to not duplicate items in a list returned from json with ajax
your problem is why this assigning a id fixed to a dynamic element. in the line below, as is informing a id, the jQuery should understand that there is only one element, then will remove only the…
-
12
votes3
answers1076
viewsA: Is it correct to prefix variable names with their type?
This type of conversion is known as Notação Húngara and was developed by Charles Simonyi and was used for many years in the internal projects of Microsoft. But the times were different, at that time…
-
2
votes5
answers19859
viewsA: Is it possible to include a Javascript file within another Javascript file?
Allan, as Bruno has already mentioned, there is currently no native implementation that does include other files JS. but you can define your scripts as modules and use a library AMD to manage your…
javascriptanswered Tobias Mesquita 22,900 -
1
votes1
answer216
viewsA: Special characters Webservice C# SQL X Base Firebird
Brian, I believe the Customer written in Delphi who consumes your Webservice is sending the ContentType incorrect, in this case you can contact your customer and ask to use the text/xml;…
-
0
votes2
answers479
viewsA: How to change status with AJAX?
I won’t be able to help with the PHP, but I’ll try to give an orientation when the request AJAX. first, try to put all the inputs that you plan to receive on the server within a form let’s take as…
-
1
votes2
answers945
viewsA: Compare values with different conditionals in the same table
Marcelo, since dataAgendamento takes precedence over dataprevista and only one of the two dates should be used in the comparison, so use the ISNULL. DECLARE @DataIni as DATE; DECLARE @DataFin as…
-
2
votes1
answer2400
viewsA: Webapi 2 Route Configuration web form application
Alex, first you do not need to register several routes in your Global.asax, s you need to customize a route using the attribute Route. I know you’ve done most of the work below, but just in case…
-
5
votes3
answers2619
viewsA: Can subqueries decrease performance? Myth or truth?
Wallace, this will depend a lot on the Database engine, taking as an example the two queries below: --Query A SELECT A.TabelaAID, A.Descricao as DescricaoA (SELECT Descricao FROM TabelaB B WHERE…
-
4
votes1
answer62
viewsA: Doubt regarding good practices with virtual properties
The modifier virtual serves to inform that this property can be modified by some class it inherits from this class, so it only makes sense for you to mark a property as virtual if you plan to create…
-
3
votes2
answers622
viewsA: Component for HTML text formatting
I know this question is old, but maybe the link below will help someone: TX Text Control . NET Express…
-
5
votes3
answers1764
viewsA: Compare two numbers and pick the biggest
you will need to include . and , its regular expression, then transform its string to a valid decimal. // lista de textos que contem um valor decimal. var textos = [ "18,97% - Promo Comprador",…
-
3
votes3
answers126
viewsA: Transition from Javascript Evolution to Cross Browser
Diego, I know that it is important to support the largest possible share of users, on the other hand it is difficult to maintain compatibility with older browsers. An example of this dilemma is…
-
2
votes1
answer76
viewsA: What is the compatibility with the browsers of using the tag template?
Ivan, according to the website Can I Use the template tag is not supported by IE, Opera Mini and the Android 4.3. but for these cases, you can use a Polyfill, as implemented by jeffcarp.: (function…
-
6
votes2
answers4231
viewsA: How to assign HTML code to a Javascript variable?
if you prefer, instead of concatenating strings in your code, you can use a resource from HTML5, templates. if you need a template more complex and keeping the code readable is important to you, I…
-
1
votes2
answers61
viewsA: How to Make Case/Swictch Paged Control
Diego, you can even do switch, but follows a more generic solution. to this end, all the button of the pagination must contain the property data-panel that must inform the page to be displayed,…
javascriptanswered Tobias Mesquita 22,900 -
1
votes1
answer511
viewsA: Combo box with colors
Marcos, the tag <select> and <option> allow few alternations, either through Markup html or using CSS, and when it does, there’s a lot that’s not cross-browser. If you really need to…
-
3
votes1
answer114
viewsA: Time Usage with EF 6
Berechit, the type Time in the Sql-Server was not designed to store time intervals, or relative time (as in your example: the product took 3 dias, 15 horas e 10 minutos to be delivered), but to…
-
0
votes2
answers119
viewsA: Access function object and use it anywhere
Robson, you can also use a template engine to build your HTML, below is an example with Handlebars I will use the following JSON in the example: var model = { Data: new Date(), Pessoas: […
-
0
votes1
answer102
viewsA: What are the options for Rest?
Pedro, an API does not necessarily need to be Web or follow some standard that is widely accepted by the community, such as SOAP or REST. For example, if you are a programmer. NET, you can create a…
-
1
votes2
answers97
viewsA: Loop in Constructor c#
Vitor, I will completely evade your problem, but I want to point out a basic error in your solution.: You are using MD5 to store a Password. Understand, No hash algorithm, no matter how large the…
-
0
votes1
answer301
viewsA: How to capture an object that has a modified attribute value
Bruno, you can use the API MutationObserver to capture mutations in the object DOM, among them, changes in attributes. In the example below I created an additional layer called AttributeObserver,…
jqueryanswered Tobias Mesquita 22,900 -
2
votes3
answers611
viewsA: Calculating in Table Fields with JS
Follow one more implementation. var percentual = document.querySelector("[name='percentual']"); var tabvenda = document.getElementById("tabvenda"); var linhas = tabvenda.querySelectorAll("tbody…
-
1
votes1
answer448
viewsA: Singleton standard
if you wish to reopen the window at some point, then do not use the Close, use the method Hide…
-
1
votes1
answer382
viewsA: Begintransaction vs Transactionscope
Jedais, if using Entity Framework version 5 or earlier, you will need to use TransactionScope if you want to use a single transaction for more than one transaction. From the EF6, the same went to…
-
2
votes2
answers561
viewsA: Create header and logs dynamically based on a json
you can go through the json keys of the first record to insert the header, after that, just insert the lines into tbody var json = { "employees":[ {"firstName":"John", "lastName":"Doe"},…
-
4
votes3
answers413
viewsA: How to replace dynamic chunk {{chunk}} of a string in C#?
first step, turn your parameter list into a dictionary, then assemble a regular expression to find all parameters in your input string, then replace. public static string InterpolarString(string…
-
0
votes2
answers73
viewsA: How do I make my Modal only appear on the customer’s first visit ?
You can store this information in the Customer, whether through Cookies, localStorage, sessionStorage or Indexeddb. Taking into account, that when storing in a cookie this information will traffic…
-
2
votes2
answers563
viewsA: Prompt Expression<Func<T, bool>> via parameter using object that is in a foreach
as a suggestion, you can try to make the .GroupJoin to make a Full Join between your entities in memory and those of the context. public static void Edit<T, TKey>(this DbContext _db,…
-
1
votes1
answer68
viewsA: Increase sql performance
Kevin, every time I saw an appointment with a subquery as a field of select, it presented performance problems. In your case, you have two subqueries per field. Then try moving them to the LEFT JOIN…
-
2
votes2
answers2328
viewsA: Generate XML based on XSD
First step, put all your xsd in the same place, here we call: Arquivo01.xsd // Não possui referencias Arquivo02.xsd // Possui referencia a um tipo declarado no arquivo 01 Arquivo03.xsd // Possui…
-
7
votes2
answers367
viewsA: Difference between . NET Framework for Entity Framework
Jedaias, every evolution of Framework, it brings new features, for example 4.5 introduced the async and the await and the Entity Framework 6 makes use of them through the Async Query & Save. So…
-
1
votes2
answers3686
viewsA: Download file via Ajax
Jedaias, the MVC has a ViewResult own to archives, in case the FileResult Below is a complete example with the Upload and the Download of the same file through AJAX. Model public class RequestModel…
-
2
votes1
answer94
viewsA: jquery to know if field was validity with correct default
No need for jQuery, the own validation API allows you to do this. You can use the method checkValidity to check if the input is valid, then you can access the property properties validity to know in…
jqueryanswered Tobias Mesquita 22,900 -
4
votes1
answer1553
viewsA: CSS - How to avoid multiple file conflicts?
William, when we have poorly structured CSS classes and we can’t change the organization of it, then we only have one option, to create a Shadow DOM and isolate the HTML/CSS part of the page. var…
cssanswered Tobias Mesquita 22,900 -
25
votes1
answer350
viewsQ: Openssl and ASP.NET Webapi
I am developing an internal application, but in a certain module I will need to travel a certain sensitive data. A priori I thought about using SSL, but due to limitations (non-technical) I won’t be…
-
4
votes1
answer131
viewsA: How can I make an image when passing the mouse it appears a text in the center of the image?
you can do it this way: figure { float: left; position: relative; } figure figcaption { display: none; color: white; font-size: 24px; font-weight: bold; } .center { position: absolute; top: 50%;…
-
1
votes1
answer497
viewsA: Change Connectionstring only in Runtime memory
First, you are not encrypting the password, nor are you protecting it. after all you can "decompile" your dll using tools like decompiler If you want to protect your sensitive data, you should move…
-
3
votes2
answers1476
viewsA: How to leave variables privately in Javascript?
Marcio, first you need to understand a little about the scope of the variables. So let’s start with the global scope: //se declarado fora de qual quer função/objeto. var variavel = "Hello World!";…