Posts by Tuxpilgrim • 1,369 points
33 posts
-
3
votes1
answer123
viewsA: Alias created in shell-script does not work
The alias you are creating is only inside the shell that is running the script, to persist the aliases you are creating is to use the source ./script.sh.When you execute the command source the…
-
1
votes1
answer955
viewsA: Docker push - Send image to Docker Hub
Following the documentation: To push a Repository to the Docker Hub, you need to name your local image using your Docker Hub username, and the Repository name that you created in the Previous step…
-
0
votes1
answer72
viewsA: Redmine, Docker and container view
If you want your container "see" some directory of your machine, need to assemble a volume, where will map a local directory inside the container. Ex. (taken from official image of Redmine on Docker…
-
2
votes1
answer436
viewsA: FLASK - Changeable in template
To change/assign variables within the template is used: {% set variavel = valor %} Ex: {% set active_page = "index" %} References: Setting variables doc - Tricks…
-
3
votes1
answer53
viewsA: Full value in hours with Golang
As in other languages, using math.Round: Round Returns the Nearest integer, rounding half away from zero. This way, it will truncate to the nearest integer value, in your case 0.016666666666666666…
golanganswered Tuxpilgrim 1,369 -
1
votes1
answer388
viewsA: How to generate graphana container correctly?
In view of your scenario, I would recommend creating a custom image with the plugin(s) you need, make it easy instead of running this large command whenever it is startar your container. Configuring…
dockeranswered Tuxpilgrim 1,369 -
0
votes1
answer97
viewsA: Error installing Laravel 5.6 with Docker
Looking calmly, your mistake is identical an error reported in your reference: phpunit/php-code-coverage 6.0.7 requires ext-xmlwriter * -> the requested PHP extension xmlwriter is missing from…
-
4
votes1
answer119
viewsQ: Configuration file save directory with User C#scope
Regarding the configuration files in the C#, I’ve always used the App.config only to record strings connection and some read-only variables, but currently I needed to modify some data at runtime,…
-
1
votes1
answer1090
viewsA: Access database that is outside the Docker environment
How your bank is installed on your machine host, you need to tell the container to access the network on which your machine is, so it will see your host (the famous 127.0.0.1). Yes, it is possible.…
-
0
votes1
answer1362
viewsA: Exchange default address used by Docker (172.17.0.1)
The default network settings (bridge ) of Docker can be changed by editing the file daemon.json, in the directory /etc/docker/. Follow an example of the file daemon.json: { "bip": "192.168.1.5/24",…
-
4
votes1
answer932
viewsA: How to measure each individual element in a matrix
Using the function numpy.average you can average the values of a array for a given axle. Ex: matriz = np.array([ [5, 5, 5], [5, 5, 5], [10, 10, 10] ]) #media para o eixo Y media = np.average(matriz,…
-
2
votes1
answer157
viewsA: Measure time of a routine in Ruby
Option 1: You can do something very similar to the Python, using the class Team. Example: ini = Time.now #funcao fim = Time.now #tempo_resultante vai ser do tipo float tempo_resultante = fim - ini…
-
2
votes3
answers51
viewsA: send temp_var_node value to Mysql database
Let’s analyze the error outputs, by parts. The first error output says: AttributeError: 'MySQLConverter' object has no attribute '_node_to_mysql' And the second: TypeError: Python 'node' cannot be…
python-3.xanswered Tuxpilgrim 1,369 -
1
votes2
answers230
viewsA: Using MKDIR via shell script
How did not pass more details (nor the tests you’ve done, nor your script), I might end up suggesting something you’ve already done. In the script (using your example), you use: mkdir -m755…
-
0
votes1
answer35
viewsA: Connect a button with a pyqt4 lcd screen
You can do this by capturing the event of QPushButton the moment it is clicked. The event in question is the clicked. Ex: Assuming we want to display a message on lcd when the button um is clicked.…
-
1
votes1
answer3133
viewsA: sqlite3.Operationalerror: near " ": syntax error
I tried to reformat the part of your code that is giving error, to make it a little less confusing, it is just a syntax error related to quotes, so it should solve: self.c.execute(""" UPDATE turmas…
-
1
votes1
answer62
viewsA: Connection screen of adminMongo
To string connection data is very descriptive about what you need to contain. It is your database authentication data (Mongodb) which you will link with the Administration. Supposing that you have…
mongodbanswered Tuxpilgrim 1,369 -
2
votes1
answer399
viewsA: How to run Processlist periodically on the command line?
You can use the command mysqladmin -u root -p -i 1 processlist, where: -u user -p will be asked the password -i 1 interval in seconds The result will be something like this:…
-
2
votes5
answers1314
viewsA: How to turn a Pyqt5 project into an executable?
To Wiki Python recommends some tools that can do this. In particular there are two that suit what you want: fman build system Allows packaging executable applications in Pyqt5 and create installer…
-
0
votes2
answers183
viewsA: How to get the Exit code from a command block
Probably not the best option, but you can create a function with the $? and call after each command to check the exit_code, something like: #!/bin/bash captura_erro(){ if [ $? -eq 0 ]; then echo…
-
12
votes1
answer4999
viewsA: When to use Cin.ignore() in C++?
As its name already suggests, the cin.ignore() is used when you want to ignore one or more of the buffer incoming. When exactly to use Cin.ignore() in software written in C++? The cin.ignore()…
c++answered Tuxpilgrim 1,369 -
4
votes1
answer1142
viewsA: How to reference in LATEX text without parentheses
You can use the variations of \cite, in your case I believe that \citet{} (textual citation) would solve, something like: \citet{Erdos65} --> Erdős et al. (1965) There are other variations, you…
latexanswered Tuxpilgrim 1,369 -
2
votes1
answer916
viewsA: When is it valid to use XACT_ABORT() in a script that is already using TRY/CATCH?
TRY CATCH The TRY CATCH checks if the code inside the blockTRY was successful, otherwise the execution is transferred to the block CATCH and the error handling code is executed. But, it has a…
-
2
votes2
answers189
viewsA: What data can I get from a user?
Being very direct, if you use authentication via Oauth2 you have access to basic user profile information logged in (with the appropriate permissions), such as: Basicprofile.getId()…
-
1
votes1
answer244
viewsA: How to run background applications using Docker?
So you can start your application at the time the container is called, rather than using the RUN you use the CMD: Dockerfile altered: FROM python:3.6-alpine AS build-ev RUN apk add nodejs RUN apk…
dockeranswered Tuxpilgrim 1,369 -
1
votes2
answers708
viewsA: sort numerical data mongodb
I tried to set up a scenario as close as possible to yours, and I got some interesting results. 1. I created a database called dados 2. I created a Collection calling for grpdados And added 4…
mongodbanswered Tuxpilgrim 1,369 -
2
votes1
answer1163
viewsA: How to put sound in c++?
In the Soen there is a similar question, the answer being marked as correct, the use of the function Beep, as follows: #include <iostream> #include <windows.h> // header do WinApi using…
c++answered Tuxpilgrim 1,369 -
2
votes1
answer278
viewsQ: .NET Core and Mono: application development for Linux
Currently I have needed to develop applications (desktop) for Linux, and one of the requirements is that it would have to be using C#. And researching/testing, I got two options: .NET Core or Mono.…
-
8
votes2
answers1149
viewsA: Bhaskara formula in C# with VS 2017
I reworked your code with some fixes: 1. Verification in case of delta < 0; 2 . Formula correction of delta; Follow the code with the changes (I reused what I had already written): /*Fórmula de…
-
5
votes2
answers71
viewsA: Is it possible to manipulate the numbers of a randint?
From what I understand, what you want to do is generate numbers within a range and define the footstep. In that case you can use the random.randrange(), which takes by parameter the beginning, end,…
python-3.xanswered Tuxpilgrim 1,369 -
1
votes2
answers1183
viewsA: How to create a Python directory inside a server?
I had a similar problem, this error happened because it is running the command for a relative path and not a absolute path. The correct one would be to pass the whole server path by parameter. I…
-
5
votes1
answer378
viewsA: Download Files by web link C#
Using the method Webclient it is possible to do this in a simple way. Follow an example: using (var client = new WebClient()) { client.DownloadFile("http://exemplo.com/arquivo/foto/foto1.jpg",…
-
1
votes1
answer594
viewsA: Insert documents into Mongodb via pymongo
Hello, we are missing information about your problem, but I will try to help in the best way possible. First of all it would be interesting if you already understood the concepts of a non-relational…
pythonanswered Tuxpilgrim 1,369