Posts by Guilherme Bernal • 20,024 points
220 posts
-
9
votes2
answers126
viewsA: Ruby application that keeps reloading source files
You can use Gem Rerun. Install with: gem install rerun And if your show’s called script.rb, execute with: rerun script.rb It will monitor the file system and re-export the command whenever a file is…
rubyanswered Guilherme Bernal 20,024 -
29
votes5
answers3496
viewsA: What are the main advantages and disadvantages of using an LL parser or an LR?
LL LL works by trying foresee what will be the next production rule, and then applying this rule to the next read input symbols. If the forecast fails, it is necessary to return to the state before…
-
34
votes2
answers998
viewsA: A C compiler can generate a 64-bit executable where pointers are 32-bit?
Yes, that is possible. However, understand that this is not as simple as it seems. 32-bit libraries expect you to pass arguments through records in a given format, and pointers to be 4 bytes. The…
-
4
votes2
answers967
viewsA: How to create a test with Rspec to verify user feedback?
Assuming the result is in JSON format, as a list of objects, each representing a user, example: [{"nome": "João", "idade": 26}, {"nome": "Maria", "idade": 19}] You can get the body of the answer…
-
7
votes2
answers245
viewsQ: Infinite loop when walking recursively through DOM nodes
I have a div with contenteditable=true in my document and I intend to do Highlight in certain parts of the text while the user type (add spans). For this I first need to extract the text typed by…
-
9
votes1
answer550
viewsA: How do I validate an email field on Dart?
The problem here was the use of property text in the expectation that it would return the text typed by the user. What this property does, however, is to read the content within the node, similar to…
-
8
votes2
answers1431
viewsA: After all Phonegap (Apache Cordova) actually compiles the applications in PURE native code?
Phonegap produces a static application composed of a native webview and code to expose the functionality of each system to a javascript API. Your HTML/CSS/JS code will be packaged without…
-
36
votes7
answers58283
viewsA: Regular expression for e-mail validation
First you need to accept that you will not be able to process all possible emails. Their specification is long and complicated. For example, here is a regex that accepts all emails and nothing else:…
-
6
votes2
answers345
viewsA: How do I catch an error alert generated by the Google Maps API?
In the absence of a better solution (see Talles response), here is a workaround: (function() { var original = window.alert; window.alert = function() { if (arguments[0].match(/Google has disabled…
-
20
votes3
answers4153
viewsQ: Why are local variables avoided in Arduino?
In several code examples for the Arduino I note that there is almost no use of variables in local scope. One of the examples present in the IDE: Analog > AnalogInput: int sensorPin = A0; int…
-
12
votes2
answers1381
viewsA: Why does Google Chrome accuse you that jquery.min.map is missing?
The minified file loses information that may be useful at the time of displaying details of an error, such as the backtrace. Jquery comes with a file .map which gives this additional information to…
-
11
votes7
answers4242
viewsA: How to reset CSS formatting?
There is no standard and absolute solution to remove browser interference, but you can upgrade the standards to a certain standard by inserting a CSS normalization file that sets all CSS rules to a…
cssanswered Guilherme Bernal 20,024 -
4
votes1
answer197
viewsA: Display a dynamically loaded text/photo pad with QML for Android
I found a solution while browsing the documentation. The element Text supports more than just text, it can also display a subset of HTML, including image and all required formatting. An example:…
-
5
votes1
answer256
viewsA: How to make a Help equivalent to Microsoft Help Viewer, but in Visual Studio 2012/2013?
In fact Help Viewer seems discontinued. But there is a new version that came with Visual Studio 2012: Microsoft Help Viewer 2.0 (in English). More details: Blog: Introducing Microsoft Help Viewer…
-
6
votes1
answer197
viewsQ: Display a dynamically loaded text/photo pad with QML for Android
I’m writing an app using the newly released Qt 5.2 QML for Android. On one of the screens I need to display an article that is loaded from a server and may change after the launch of the…
-
13
votes1
answer560
viewsQ: Problems decoding Assembly x86 from binary
I have written a program whose goal is to read a binary executable file compiled for the x86 (intel) architecture and interpret the Assembly code contained therein by executing instruction by…
-
17
votes2
answers1354
viewsA: In which situations should I dynamically allocate a vector to C++?
I can’t see any real advantage in allocating one std::vector dynamically. But one should be careful when returning a vector as a result of a function. Even though it is small (typically 12 bytes on…
-
4
votes3
answers227
viewsA: Is there a dialect of LISP/Logo in Portuguese?
Other relevant alternatives to start programming with a child target audience or who are unfamiliar with English are: G-Portugol G-Portugol is a structured programming language, entirely in…
-
28
votes10
answers68840
viewsA: How to make a <div> occupy the entire page width but leave a gap of a few pixels on each side in CSS?
The image shows four distinct regions, the content, the spacing, the edge and the edges. What is important to note here is that the spacing is within element and will only reduce the area used by…
-
15
votes3
answers4221
viewsA: Take only the values before the character "=" using regular expression?
You can capture regex groups after you match. Example: (\w+)=(\w+) So the first group will be your identifier and the second will be the value. If you still prefer to do a regex that only recognizes…