Posts by Miguel Angelo • 28,526 points
429 posts
-
5
votes2
answers201
viewsA: How do I return an existing item in my enumerable via Contains?
The method Contains usually returns a boolean value (true or false) and not an enumeration. You can use Where to create a filter over the Relacoes, and then use a condition for this filter, so that…
-
3
votes2
answers394
viewsA: How do I disable selecting text at the right click?
There are two ways using CSS (as far as I know): pointer-events: none: causes the interaction of the mouse pointer with the element to be passed to the back element. This makes it impossible to…
-
17
votes3
answers21628
viewsA: Definition of the "Big O" notation
Definition in a sentence: Serves to compare how much of a resource is used by a algorithm that processes a collection, when the number of elements in this collection tends to be very large. Analogy…
-
2
votes3
answers89
viewsA: How to make several projects have the same post-compilation event?
Create a program to open each project and then add the post-compilation section. It would look something like this: foreach (var caminhoDoProjeto in Directory.GetFiles( "caminho/da/solucao",…
-
1
votes2
answers361
viewsA: Centering #Menu #Nav on the circular shapes page?
On another matter, I’ve already given a reply to solve a similar problem. I adapted the code to center the circles. .master { border: solid 1px #000; font-size: 0; text-align: center; } .master div…
-
0
votes2
answers386
viewsA: LINQ to Entities does not recognize the 'Boolean Like' method?
Use SqlFunctions.PatIndex instead of SqlMethods.Like, if this is not available. The class SqlFunctions is defined in Assembly System.Data.Entity.dll whereas the class SqlMethods is defined in…
-
3
votes1
answer187
viewsA: Linq query with Count
Try doing a subquery and get the Count hers: IList<GrupoProjetoEntity> grupos = (from grupoProjeto in session.Query<GrupoProjetoEntity>() join projeto in…
-
3
votes2
answers207
viewsA: Do not load a CSS if it is IE8
There is no ELSE on conditional comments as far as I know... but it is possible to make a NOT: <![if !(IE 8)]> ... IE 8 vai ignorar este bloco, mas os outros navegadores vão aceitá-lo ...…
-
1
votes1
answer40
viewsA: Opencart Should I ignore the checked.cache file in GIT?
Add to your file .gitignore: */checked.cache # elimina somente arquivos com este nome *.cache # elimina todos os arquivos .cache If you’ve already committed some file you don’t want, it’s no use…
-
4
votes2
answers828
viewsA: Select input text by its value
Cannot do this. Selectors act similarly to CSS, on elements and attributes that are in the DOM. You will need to select the elements you want manually, as indicated in this reply in the SOEN: var…
-
4
votes2
answers1558
viewsA: Check if a parameter has been provided for the function
If you want to check by type, then you can use the operator typeof. typeof param1 == 'string' typeof param2 == 'number' typeof param3 == 'boolean' var div = document.getElementById("xx"); function…
-
1
votes1
answer597
viewsA: convert a string to Vb.net - Convert.toDouble
The problem is the culture being used to make the conversion. Probably, your operating system is configured for a culture that does not consider the point (i.e. .) as decimal separator. To make the…
-
20
votes1
answer3671
viewsA: Are there any other low-level languages besides assembly?
Machine language It is the language that the CPU understands, composed of a binary sequence, whose rules are defined by each architecture. The recommended is to generate through a compiler of…
-
1
votes1
answer1813
viewsA: Send image via post
When sending a file to the server it is necessary to use an encoding that allows sending binary data along with form data. Normally a POST without files in the form has a body with the following…
-
4
votes2
answers2748
viewsA: Group json data by a given object
I created an example that groups the array elements, by the property category of each item, creating an object in which each key is a group containing the corresponding elements: var dataString=…
-
2
votes2
answers743
viewsA: Communicating a Windows Service project with a Windows Form project
The name of it is inter-process communication (IPC: Interprocess Communications). Can be done in many ways: Sockets Named Pipes Files mapped in memory among others I will show you how to do using…
-
4
votes1
answer114
viewsA: How to know if the solution has been modified?
There is a class in . Net that is used to monitor file system changes: Filesystemwatcher With it you can make the following code to be notified whenever a file changes: // Criar uma instância do…
-
0
votes4
answers1160
viewsA: load datepicker plugin on page called with ajax
You will have to apply the plugin only to elements that have been loaded via AJAX into the modal container: $("#conteiner-do-modal .datepicker").datepicker({ dateFormat: 'dd/mm/yy', dayNames:…
-
1
votes1
answer961
viewsA: Fire event (F11)?
It is not possible to do this in modern browsers, other than within a keyboard or mouse event. In this case you can use this code to put it in full screen: <script…
javascriptanswered Miguel Angelo 28,526 -
2
votes1
answer1407
viewsA: Open links from iframe
Would that be... (but you’ll have to trade http://www.google.com because it will not load inside the Iframe.). I was able to find a Google URL that works inside Iframe, just so you can check how it…
-
2
votes1
answer86
viewsA: Webapi 2.0 - Apicontrollers in another Assembly do not suffer mapping if runAllManagedModulesForAllRequests="false"
According to the answer to this question in the SOEN, the problem is that the module is not being loaded. For this just call any method of the module to be able to ensure that it was loaded, before…
-
2
votes1
answer1887
viewsA: Download txt file with ASP.NET Web Forms including HTML of the page in the file
You are probably running some code even after writing the file in output. Use the method Response.Flush to ensure the writing of the Stream reply, and then call Response.End to terminate at once…
-
5
votes3
answers3224
viewsA: How big is the line break?
The tag br not a blank line, but a line break. With the code below it is easy to check that no visual attribute works with the br. You can’t change even the display... or anything.... I was wrong,…
-
2
votes1
answer3237
viewsA: Customize my modal bootstrap
Do the following: Utilize float: left to make the menu go left. Make the buttons stick display: block and put them inside the menu, so they will appear under each other. Create a container for the…
-
28
votes5
answers8000
viewsA: What is the difference between pointer and reference?
Both pointer and reference deal with something I’ll call "pointing phenomenon". Just as in electromagnetism we have a single foundation, and two ways of observing the effect of that foundation. I’m…
-
1
votes1
answer174
viewsA: Align Row at the bottom of a Section
If you use absolute positioning, within an element with relative positioning, then it will work. In this case, your Row specific would have position: absolute and its Section would have position:…
-
0
votes3
answers2375
viewsA: Grab part of the text that is between tags of a string
I know how to do this in C#... but I think you will not have problems in converting to VB.Net: string texto = "xpto <nome> abc </nome>"; var match = Regex.Match(texto,…
-
1
votes1
answer380
viewsA: How to insert values into a relational table when inserting a Row and get this ID?
EDIT: loading the lookups before processing the excel table This code loads all the lookup information beforehand, and only the elements will be added when they do not exist in the lookup…
-
1
votes2
answers194
viewsA: Retrieve jQuery instance within an iframe
I made a method to scan the object structure and try to find objects stored under the key $ and jQuery. Attention: here it took about 30 seconds to finish, but it may take longer. The search has a…
-
1
votes2
answers93
viewsA: Repeater for many lines
I think the question would be neither of performance, but of usability. Generally, it is more worthwhile to implement a good search engine than to do what you are proposing. Compromised usability…
-
11
votes7
answers1131
viewsA: Too many screens or a screen with too much information?
First an introduction Application x User Interface There is a relationship between application and user when lasting models both. First contact When the relationship is established, that is, when…
-
10
votes2
answers1689
viewsA: Find <tr> Element of a certain content
EDIT If the table structure doesn’t really change: no container tables inside tables the HTML is well formed then it is possible to use regex to find the opening tag of the TR that contains the TD…
-
2
votes1
answer7401
viewsA: Open maximized form on full screen
You can set the property WindowState for FormWindowState.Maximized. by code: namespace Projeto_Funcionario { public partial class Principal : Form { public Principal() { InitializeComponent();…
-
0
votes2
answers1716
viewsA: Get value from an iframe via Javascript
Chrome does not allow uploading a file from the file system using Xmlhttprequest (Ajax). I myself have had this problem while testing HTML files with Ajax calls. Each browser applies different rules…
-
2
votes4
answers191
viewsA: Doubt with CSS selector
If you want to ensure that you are selecting only the elements h2, every 2, the selector can be used :nth-of-type. So we can mix other elements together with the h2, and still select them two by…
-
1
votes3
answers719
viewsA: Adapt JS Code to IE8 and IE9
Moxie library I found a library capable of doing what you’re asking. It is a polyfill listed on modernizr’s Github called Moxie. The library is fantastic, except to start development. I had to…
-
0
votes2
answers123
viewsA: Have a loop run again
Put a while around everything, which only comes out when a boolean variable is set, and just put true on that variable when all is filled in correctly: boolean opcaoEscolhida = false; while…
-
1
votes1
answer781
viewsA: window.open is not opening the popup
I made an extension example that allows you to do what you asked. In the archive manifest.json it is necessary to add a permission to have access to the host, otherwise it will not be possible to…
-
2
votes3
answers1382
viewsA: How do I delete a file, which has quotes in the name, by CMD?
On the command line, and with the current directory where the files are, type: dir /x The names enclosed by the orange border are the 8.3 format names. With the short name of the file, you can…
-
0
votes2
answers2047
viewsA: Traverse components of form C#
I’ll suggest you the following: create Picturebox dynamically, instead of adding them one by one by the designer: public partial class Form1 : Form { private PictureBox[] pictures; public Form1() {…
-
7
votes1
answer1790
viewsA: Divide in circles with responsive layout
I was able to find two alternatives: Using inline-block Using inline-flex Using inline-block To have more coverage you can use the display inline-block thus: .master { border: solid 1px #000;…
-
1
votes1
answer673
viewsA: Search string in an array with jquery
I’ll highlight some problems: if you declare a table HTML without elements in it, a tbody will not be generated automatically. the method escreveNoticias should be receiving variables as argument,…
jqueryanswered Miguel Angelo 28,526 -
2
votes1
answer72
viewsA: Best way to design Classes from the database?
I don’t find a bad solution... actually that’s what many Orms recommend when in the intermediate table there is nothing but two FK, each pointing to an element of the relationship. Moreover, in this…
-
4
votes3
answers10876
viewsA: Recognize duplicate items in a list
First you can group all the items given a grouping criterion... and then you put each grouping inside a dictionary: var dicionarioDeArrays = lista .GroupBy(x => x) .ToDictionary(x => x.Key, x…
-
1
votes1
answer148
viewsA: Testing of variable content
Do so: $scope.estado.ldRedeBasica = @(Model.ldRedeBasica == null ? new MvcHtmlString("[]") // ou poderia ser `Html.Raw("[]")` : Html.Raw(Model.ldRedeBasica)); Documentation of Mvchtmlstring The…
-
14
votes1
answer261
viewsA: What is the difference between these two implementations?
Nothing changes in the example you gave... but it can be useful in other situations. When it makes a difference? This may be necessary if you want to refer to the object self from within the…
javascriptanswered Miguel Angelo 28,526 -
2
votes1
answer412
viewsA: Load dependencies on demand
It is possible yes, but it is not so in the example you gave. In your example, you create a function and then call the method require face, out of the ajax. You’ll have to move the call from require…
-
2
votes1
answer69
viewsA: How to obtain a limited number of occurrences with DOM?
You can’t use it array_unique? Example: $html = file_get_contents("http://exemplo.com"); $DOM = new DOMDocument(); $DOM->loadHTML('<meta charset="utf-8">'.$html); $xpath = new…
-
6
votes6
answers2106
viewsA: Smooth gradient color transition automatically
Damn life... they forgot about Webgl! Downside: old browsers do not support the code is a little bigger (because it needs to boot Webgl) requires some knowledge of Webgl (not to err in the order of…
-
4
votes2
answers1288
viewsA: replace using regular expressions
Can’t do that. When you reduce (\d{3})(\d{3})(\d{3}) for that reason (\d{3}){3}, you are eliminating two capture groups, the first capture group will be overwritten twice, causing it to take the…