Posts by Luiz Vieira • 34,160 points
330 posts
-
19
votes3
answers8488
viewsA: What happens in a conversion from a char to an int?
What happens is that the type char in languages like C are actually integer types. No Wikipedia article on language types C this is the description of the type char: char -> smallest addressable…
-
10
votes4
answers2731
viewsA: Is it possible to change the mouse cursor color via CSS?
Just to add another cool information that I found (and a functional example!), I decided to create this answer. :) From of that OS thread(en), i learned that it is also possible to embed the cursor…
-
11
votes4
answers2731
viewsQ: Is it possible to change the mouse cursor color via CSS?
I know it is possible to change the style (type) of the mouse cursor via property cursor in CSS. But, does anyone know if it is possible to change the cursor color? In an application I would like to…
-
5
votes4
answers359
viewsQ: Difficulty storing object property in Javascript
I’m having a hard time (which is probably pretty silly) storing a value in a Javascript object property. I’ve done something similar recently using this.propriedade = valor within the "constructor"…
javascriptasked Luiz Vieira 34,160 -
2
votes5
answers48166
viewsA: How to increase or decrease the div proportional to 720x540?
With a little Javascript you can ensure that the element has a 4:3 ratio by fixing one of the dimensions (i.e., either the width or the height). I made an example (which can be tested in that…
-
2
votes2
answers186
viewsA: Make a group of lines remain compressed when opening and closing Sublime
Pedro Reis already replied that the Sublime Text 2 does not store compressed portions of text (this is called Folding) between sessions and that this can be done using plugins. Particularly I don’t…
sublime-text-2answered Luiz Vieira 34,160 -
6
votes3
answers15049
viewsA: How to check if a file exists using Python
Try it like this: import os.path print os.path.isfile(fname) There is the method os.path.exists() also, but note that it returns true to directories.…
-
220
votes5
answers6588
viewsA: Should error messages apologize?
This issue is complex and involves, in my view, two main aspects: The cultural context in which human-computer interaction is inserted. The usage context (error, informative alert, etc.) that made…
-
1
votes6
answers66760
viewsA: "foreach" in Javascript
This example (extracted of that original source in the OS(en)) uses the function forEach existing in objects of the type array from the Ecmascript5: var a = ["a", "b", "c"];…
-
3
votes2
answers1746
viewsA: Large figure disturbs the positioning of other
Figures and tables are floating elements (floating), and so Latex takes care of choosing the best place to place them according to the available space and the size of the element. An alternative…
latexanswered Luiz Vieira 34,160 -
16
votes3
answers4295
viewsA: How to count amount of Likes from a page?
The answer already provided by @mgibsonbr is perfect, but I would like to share another solution (a little more complex, it’s true) that I used at the end of last year to get the Ikes of a series of…
facebookanswered Luiz Vieira 34,160 -
0
votes4
answers4319
viewsA: String concatenation in SQL
The problem seems to me to be due to the fact that the first name ("Luitame") is in one column ("userNome") and the rest of the name ("de Oliveira") in another column (userSobrenome). Therefore,…
-
17
votes4
answers2589
viewsQ: Is it possible to create an 'abstract class' in Javascript?
When creating a Javascript class whose attributes and methods are all static (for example, for storing preset settings for a game), I wonder if it is possible to define the class as abstract in a…
-
3
votes1
answer492
viewsA: How do Visual Studio recognize the 'use Strict' directive?
The 'Strict mode' is an error checking mechanism at runtime, and so he is not identified by Intellisense. This information is available at documentation of the new features of Visual Studio 2012:…
-
50
votes3
answers12951
viewsA: Java += operator
This is a feature of language. How explained in the documentation, the use of operators of type op= includes a casting implicit: A compound assignment Expression of the form E1 op= E2 is equivalent…
-
6
votes1
answer130
viewsQ: getcontext reading error when inheriting the createjs. Sprite class
I started developing a HTML5 game using the library Easeljs. When creating a class called Bot, which will contain the code of the robot used in the game, got the following error: Uncaught TypeError:…
-
1
votes5
answers989
viewsA: How to remove an Element from an XML with Python?
I did a test here with your code and the elements 'Extensions' were not removed (maybe because they are not root? children). Anyway, the only difference I noticed is that your source file is encoded…
-
9
votes2
answers2852
viewsA: Plot differences in matplotlib for different parameter accuracies
The differences were in fact a little confusion (on my own, sorry! ) regarding the first parameter used in the gabor_kernel function call of the scikit-image package. THERE IS NO ERROR in…
-
7
votes2
answers2852
viewsA: Plot differences in matplotlib for different parameter accuracies
With the help of the comments made, it seems to me that there is a possible error in the calculation performed by the gabor_kernel function of the scikit-image package. The original function (thanks…
-
6
votes3
answers2326
viewsA: Problem accessing an accented file (matching character)
To me it seems to be just an encoding problem at the time of printing (called method print) of file/folder names. Try to use Unicode encoding by changing its print fution as follows (note the…
-
3
votes4
answers1385
viewsA: How to replace {vars} in a string?
If your "{User}" key is fixed, it might be better to simply replace text instead of regular expressions. The Ers are very cool and powerful, but there is a certain computational cost to be paid.…
-
14
votes2
answers2852
viewsQ: Plot differences in matplotlib for different parameter accuracies
For a course work, I built the following code in Python using the Matplotlib and scikit-image packages: #!/usr/bin/env python # -*- coding: utf-8 -*- import numpy as np from scipy import interpolate…
-
13
votes6
answers34688
viewsA: How to send emails only with HTML5 basics
I found an alternative using Google Docs. The procedure is as follows: Using your Google account, create a form in drive.google.com (if you have questions, see the Google Drive documentation) Open…
-
15
votes6
answers34688
viewsA: How to send emails only with HTML5 basics
Someone has already said that it is not possible. But, if you generate RSS (feeds) on your site, you can use a redirect service to send the email whenever the RSS is updated. There are some free…
-
8
votes2
answers1509
viewsA: Matplotlib + Latex: Writing Text on the Axes in English
If you use the escape characters from latex instead of the Unicode text directly with accentuation, the problem does not occur. Try trading your strings for the following: plt.xlabel('Di\^{a}metro…
-
11
votes2
answers1037
viewsA: How to use Qt translations directly with Qapplication::tr()
The problem actually stemmed from a flaw (my mistake, Sorry!) in updating the translation files (*.qm) in the build’s target directory. In the file. pro there were no instructions for the automated…
-
5
votes4
answers1969
viewsA: How to save Ctrl+S to Vim?
I think the problem is that Ctrl+S is the shortcut of the "Stop" command, which is why it is locking your terminal. You have already tried using the "stty" command"…
vimanswered Luiz Vieira 34,160 -
6
votes1
answer1452
viewsA: How do I copy an image to the clipboard (Clipboard)?
I had to do something like this in the recent past and I couldn’t come up with a solution either. Apparently browsers (with the exception of IE) do not support copying anything other than text for…
-
19
votes2
answers1037
viewsQ: How to use Qt translations directly with Qapplication::tr()
In an application developed in Qt I have a non-visual class (i.e., that is not inherited from a QWidget) but that handles text strings that must be presented to the user. To use the Qt translation…
-
3
votes5
answers20362
viewsA: Is there an algorithm to check the validity of a ID number in Brazil using check digits?
The RG check digit calculation uses module 11. The CPF uses the same algorithm twice. More details: http://en.wikipedia.org/wiki/Check_digit…