Posts by dark777 • 611 points
48 posts
-
-4
votes1
answer36
viewsQ: Shell script error while renaming a large set of folders
People were making a script to rename several folders in bulk that contains tabs+spaces+dots+dashes and many other characters in the name for something like: name_myname_folder. I made a script…
-
0
votes1
answer69
viewsQ: Editing file with shell script links
I have a file with 130 links to download via wget, all files are with the listed links such as:…
-
0
votes1
answer75
viewsQ: Get the latest version of Mozilla Firefox by script
I was making a script that searches for the latest version of Mozilla Firefox in the URL #!/bin/bash base_url="https://download-installer.cdn.mozilla.net/pub/firefox/releases/"…
shell-scriptasked dark777 611 -
-2
votes1
answer90
viewsQ: printing calendar with wrong days
good day galley I made an agoritimo that generates the calendar of a given year however for bisext years it is returning days correctly but for years not bisextos it brings dates for different days,…
-
-2
votes1
answer26
viewsQ: renaming file with Posix c
I have a file called Tempfile.txt I made the following script in c to rename file receiving the file name to be renamed and the new name, but it is returning this error: Error renaming file: Bad…
-
2
votes1
answer93
viewsQ: Calculating Easter Date in Postgresql
I was installing some functions in postgresql with mysqlcompact and I came up with the idea of developing a function that would calculate the day of Easter so I did a search, but how I convert this…
postgresqlasked dark777 611 -
0
votes1
answer55
viewsQ: Shell Script for Postgresql Download
I am writing a code in Shell Script to download the source code of the last updated version of Postgresql checking the current version automatically. So based on that I did the following: created…
-
3
votes2
answers198
viewsQ: Forcing backreference in regex
These days ago I asked here about a regex that validates dates and how to force the separators to regex validated the following format: dd/mm/yyyy So based on it was trying to force the separators…
-
0
votes1
answer1147
viewsQ: counting how many days left to finish the year
I was making a program in c++ to count how many days to finish the year from a date in the format dd/mm/yyyy but according to the date of the month I enter it always gives the same result type: if I…
-
-1
votes1
answer250
viewsQ: Validating only cpfs with different numbers
Good evening guys needed to do in the function below a way to invalidate typed cpfs with equal numbers by ex: 123456789 000000000 111111111 222222222222 333333333 444444444 555555555 666666666…
-
3
votes3
answers2037
viewsQ: Regex to validate certain date format
I was modifying a regex for a program in c++ that would validate the following date input form 29/feb/2000. Currently she was only accepting 29/02/2000 or 30/03/2017. I tried to add for the other…
-
2
votes0
answers377
viewsQ: Regex for name validation with Posix regex
I have a function in c++ validates name and surname with the following regex : "((?:[á-úA-Za-z]+[ ]+[á-úA-Za-z]{0,20})?)?" was taking a look to let learn to create regex otherwise based on what is…
-
0
votes1
answer64
viewsQ: formatting sql command export with sed
I have exported a table from my database as follows: "1";"Boi Preto";"2000-02-29";"2";"Sol Nascente";"2009-10-01";"3";"Parque Belo";"2007-03-15";"4";"Pedras…
-
0
votes1
answer26
viewsQ: importing backup by Mariadb terminal
Yesterday I was doing a test in Postgresql of insertion and backup import and export and Postgresql has an SQL import command as follows: psql# \i backup.sql Has something to do with that in…
-
-1
votes1
answer76
viewsQ: Implementing function of type Month
Good morning guys blz? was implementing a Month type function that returns Month I tried to use static_cast to convert to Month type but from conversion errors to same. The program is this below:…
-
0
votes1
answer83
viewsQ: Stack insertion vector returning all zero
These days I posted the algorithm of this address below here because I was having problems to pop and remove was solved so far. Destamping Dynamic Stack But as I was reviewing the code and therefore…
-
0
votes1
answer63
viewsQ: Fails when accessing a vector option that does not exist
I made a few years ago an algorithm of inheritance and polymorphism it is working correctly but if I type 7 that is a non-existent option in the menu it returns segmentation failure instead of…
-
0
votes1
answer637
viewsQ: Destamping Dynamic Stack
I have a dynamic stack algorithm. Only if I insert 10 elements into the stack and pop without removing the first element it from the segmentation failure. And if I remove the first element from the…
-
2
votes0
answers56
viewsQ: Activating cgi bin web c++ module
Personal I installed cgicc for the purpose of understanding how cgi works however I activated the include mod_cgi of my apache2 in Slackware but when creating a cgi and put in /var/www/cgi-bin the…
-
0
votes1
answer184
viewsQ: Changing field type Mariadb(Mysql)
Staff created a table called entries in a test database. In it was inserting data from a.txt register file. until then the id primary key when I created it was not auto_increment so for testing…
-
1
votes2
answers1112
viewsQ: regex for url validation
People made this regex to validate URL: const std::regex pattern( "(?:(ftp|http[s]?:[//])?)?([w]{3}[.])?" "(.*[.](com|php|net|org|br|dk|at|us|tv|info|uk|co.uk|biz|se)?)?"…
-
0
votes1
answer83
viewsQ: composition and validation
Guys I have a struct called Contact with variables Std::string and a ready-to-use email validation class using regex. I am creating a program and not need to create another validation function for…
-
1
votes1
answer77
viewsQ: Calculation of survival in C
Researching about calculating a person’s survival days through the days difference I found a program here that served as the basis for this then added the necessary calculations to know the amount…
-
0
votes0
answers83
viewsQ: The wrong date Julian calendar
I made the following program based on one of my scripts that makes other calculations but the same is returning wrong dates to the Julian calendar, because 14/March/1964 falls on Friday, and…
-
1
votes1
answer118
viewsQ: validating only .com.br regex
Staff was modifying a regex to validate only specific domains ending with yahoo.com.br, terra.com.br, bol.com.br, Hotmail.com.br. Then gmail.com, or provider.net.br would be invalid. So I did the…
-
1
votes1
answer529
viewsQ: histogram of a c++ phrase
I made the following program to make the histogram of a sentence counting the number of letters and consonants in it but this giving error because I’m trying to get him to print capital letters and…
-
0
votes1
answer9962
viewsQ: Converting int to string
I made a program that simulates a login and when converting the password that is int to string using sprintf it from segimentation falt, I tried to use itoa but it from the definition error #include…
-
6
votes1
answer169
viewsQ: Intelligent Pointers
I was studying smart pointers and based on this blog: https://murilo.wordpress.com/2008/12/15/smart-pointers-os-ponteiros-espertos-do-c/ #include <iostream> template <class T> class…
-
0
votes1
answer53
viewsQ: is repeating only once
Code: #include <iomanip> #include <iostream> int main() { auto time = std::time(nullptr); std::string…
-
3
votes2
answers334
viewsQ: Regex validating only normal and leap years in C++
I was trying to validate leap years using regex in C++. If the user type 28/02/1900, it would return valid. But if the same type 29/02/1900, he would return error. Searching, I found this regex that…
-
0
votes1
answer1026
viewsQ: Printing binary tree graphically in C
Last week I was working on this code that prints binary tree graphically but I didn’t understand very well its way of using or if there is a bug because I type in the amount of nodes and the…
-
2
votes2
answers130
viewsQ: split an integer number into c++
I made the following program below that guess the age of the person and the number that she thought, but the final result generates a number of 4 digits according to the calculations below suppose I…
-
4
votes2
answers1091
viewsQ: Operation of the new operator
I wanted to understand basically what the logic behind the objects of the classes that use the operator new for example, I have the following program in D: import std.stdio; class Hello { public…
-
2
votes1
answer51
viewsQ: program does not catch system date
I have a program that I am doing a test to see how it goes but I could not find the error that makes it does not return the date and time of the system, I thought it was the regex but it is also not…
-
1
votes1
answer89
viewsQ: Conversion to int with static_cast in c++
Doing a search found something related to this error. I have the following error below: ERROR: date.Cxx: In Member Function ːint Currentdatetime::Getmonth(const string&)': date.Cxx:125:18:…
-
2
votes1
answer574
viewsQ: Error generating C calendar
was working on a program that generates a calendar for a month however it is not working properly with long years as in March 1004 the first day begins Wednesday and the last on Friday. March 1004…
-
1
votes1
answer385
viewsQ: Error in Pascoa calendar algorithm
I was playing with programs that calculate dates, but I found a very precise python algorithm that returns me correctly the day that will fall and that already fell the holiday of Paris. The python…
-
1
votes1
answer192
viewsQ: Error while running python script
I made this program in python : //////////color.py #!/usr/bin/env python # -*- coding: utf-8 -*- class Color(object): string = { "RED": "\x1b[31m", "GREEN": "\x1b[32m", "BLUE": "\x1b[34m", "YELLOW":…
-
0
votes1
answer334
views -
1
votes1
answer188
viewsQ: Validating extensions of regex files in c++
personnel I made a function to validate extensions of files using the regex of c++ however it is validating extensions outside the regex I tried to do something to change it but could not get anyone…
-
-3
votes3
answers238
viewsQ: Error while trying to overload Operators with dates
I’m trying to overload operators for dates, but if I use a double overload it gives error. What I actually want to do is that if the user uses a separator defining a format he accepts and if the…
-
1
votes3
answers610
viewsA: Regular expression for email in C++
After so much snooping on the net, I ended up finding a regex that fits both cases in both validation and emails:…
-
0
votes1
answer317
viewsQ: printing memory junk
This program must load words from a file txt to a vector, Draw 10 words, put them in vector and then print on screen. The problem is that it is printing memory junk and do not know how to solve this…
-
-2
votes1
answer107
viewsQ: Overload of Operator in C++
I have the program below: #include <iostream> #include <sstream> namespace std { int bin(int n) { if(n!=0)bin(n/2); if(n!=0)std::cout<<n%2; } } int main() { int n;…
-
0
votes1
answer527
viewsQ: Eliminating spaces in excess of a text
I have the code of a function that should adjust space in the sentence, but it is not working. I’d like to do with input user the same way the function that removes works. Suppose I have the…
-
3
votes3
answers610
viewsQ: Regular expression for email in C++
I have the following regular expression in a C++ format validation function using regex, but it is validating non-standard formats that I want. b[A-Z0-9._%-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}b\\.[A-Z]{2,4}b…
-
1
votes1
answer141
viewsQ: Menu with Polymorphism
I’m creating some examples to learn polymorphism more deeply, but in the original code, all functions work correctly. Original code: #include <cstdlib> #include <iostream> class Mamifero…
-
2
votes1
answer69
viewsQ: Conversation from hexa to int and toupper do not work
I need help with this code because I believe three functions however hexToInt function is not properly converting only works conversation if hexa is an integer type 19 and not A or 1D. and the…