« first day (3742 days earlier)      last day (1227 days later) » 

3:31 PM
Hi there
I noticed someone is shooting downvote on my answer and questions recently, and well like as always with no comment for the reason. and I don't find anything wrong in my question or answer at all
 
Welcome to U&L :)
 
:D
thank you @jesse_b
 
Heyo everyone :) Hope all is alive - good n kickin!
//Stay away from Corona btw
 
 
2 hours later…
5:15 PM
@αғsнιη sorry to hear! Happily, it won't affect any of the privileges you've earned at U&L, and hopefully the "fraudulent vote" script reverses it within the next 24 hours.
 
6:11 PM
@JeffSchaller thank you for your kindness
I guess someone is unhappy with my downvotes when I leave comments when reviewing from the review queue or saw a bad or wrong answers/questions and I think they ended uphappy from my downvotes for their posts
and I think 'these are kind of revenge for them, don't know
 
@αғsнιη yeah, don't worry about it, you did the right thing: you checked your answer to see if there's anything you can improve. That's all you can do.
And I will repeat the advice I gave a while back to another user:
Dec 1 '14 at 13:05, by terdon
@cuonglm Maybe they don't like your username. Perhaps they didn't understand your answer. Maybe they are having a bad day. Or they thought they were clicking a different post. They might have done it by accident. They might have thought you were someone else. They might always downvote users whose name starts with a c. Who knows? It's never worth it to worry about downvotes unless there is something wrong with your answer.
Just 's/c/α/' :)
 
6:33 PM
right; we each only get one vote per post, so the damage is somewhat limited. If they're targeting you, let us know and we can raise a ticket to have it investigated by the people who have access to the votes, and take it from there
(targeting = the downvotes continue across your posts)
 
Are you sure about this @αғsнιη? You seem to have almost no downvotes at all! Looking at your profile, there is one downvote today and one yesterday. The next downvote before that is all the way on December 19th!
You also have two "unupvotes", which would appear like negative rep changes, but are just someone removing an existing upvote, but not actually downvoting.
 
7:13 PM
thank you dears, I'm not unhappy with downvotes, the only thing that it makes me upset is that I think they do downvote as result of because I downvoted for them (but I said my downvote reason)
@terdon yes, one yesterday and one today and downvote for some older posts immediately (or very close) after I had a downvote for someone's post. I won't ever say downvotes are from them because nothing is visible to me
and that removed 10 is for my deleted answer I deleted by myself because another answer was good
thank you @JeffSchaller @terdon to hearing me, appreciated.
 
 
1 hour later…
8:24 PM
the United States of America is a failed state.
 
oh dear, what'd I miss? Nevermind, I avoid most news. The local situation seems under control (but then, I'm helping someone with grade-school math).
(I'll repeat my previous inclination to keep "politics" to a minimum here)
 
@JeffSchaller every time there is an election people suddenly become intimately concerned with all the issues that have remained constant and ignored for the previous 3 years
 
defining a violent coup as "politics" is, um, a statement
 
sounds like French politics to me
ducks
 
8:34 PM
 
oh my
 
this is your "politics"
 
seems more like a criminal event but okay
 
well, you'll have to take that view up with Jeff
 
Is Jeff one of the armed criminals?
 
8:38 PM
yeah, that's unfortunate violence in the middle of a political event, I suppose. hard to distentangle, but I hope no one was/will be hurt. I sure hope it's not the end of America.
 
Well to be fair we are only a country due to a violent and armed protest
 
at least one person is already shot
 
@jesse_b I have two arms, but I'm just here doing math.
 
shockingly few, considering usual practice
 
@JeffSchaller Well at least you have an above average number of arms
@MichaelHomer those (presumably secret service) officers are not defending that position very well
their fields of fire are not ideal and could easily result in friendly fire if a high stress situation, such as a gunfight, were to break out
 
8:43 PM
they failed to defend it entirely
 
it's also suspicious that there are 3 people standing right in front of the door trying to get a better view of what's going on
Presumably if there was gunfire coming into the building any reasonable person would dive behind cover not try to get a better view of the action
two of those agents have only a single hand on their firearm, it's all a little sus
 
fwiw jesse I wasn't arguing with you, I was objecting to the disgrace of classifying this as "politics" not to be mentioned
 
But who is classifying it as politics? Certainly nobody with any credibility
 
I was just trying to be fair and keep political discussions to a minimum (per the previous November US Election hubbub). I was blissfully unaware of this recent violence.
 
@jesse_b well, as I said, you'd have to take that view up with Jeff
 
8:55 PM
my "no politics" statement was in reply to "the United States of America is a failed state", which sounded like it was heading in a political direction
 
The news site I was just watching was showing a detailed floor plan of the capitol building
probably not a smart move when there are people actively trying to overrun it
hopefully none of them are watching the news
 
Hello everyone.
Can a vim power user tell me why the substitute command s/$HOME\/directory\/subdirectory\//\/run\/media\/user\/drive\/directory\/subdirectory\// causes the error E486: Pattern not found: $HOME\/directory\/subdirectory\/ when lines such as destDir=$HOME/directory/subdirectory/"another_subdirectory" in the file clearly contain that pattern?
 
@BlackPanther the $ is special to "vim", as the "end of line" marker. There can't be text after the end of the line, so that's why it doesn't match anything.
Escape the $ with s/\$HOME...
 
Aah, I see, thanks. I didn't think I needed to escape it because searching with regular expressions in vim using / includes $ without me having to escape it
@JeffSchaller is ~ (tilde) also special to vim?
 
it'll let you type it because you might want to tell vim to look for text that's explicitly at the end of the line
@BlackPanther :help search-pattern
but no, ~ is not special in this case
(it also doesn't expand to $HOME, which you might be used to from the shell)
 
9:11 PM
@JeffSchaller I tried escaping $, but I'm getting the same E486 vim error
E486: Pattern not found: \$HOME\/directory\/subdirectory\/
 
you may find it easier to use some other delimiter instead of /. I like to use !
 
@MichaelHomer You mean to delimit directories and files in a path?
 
then you can copy the source pattern in exactly, without having to escape things. though what you have looks ok, if it's on the current line
@BlackPanther s!/var/run!/tmp!
 
@BlackPanther worked fine for me, given your data above. As Mr. Homer suggested, you could make it more readable by avoiding "leaning toothpick syndrome" and do something like s!\$HOME/directory/subdirectory/!/run/media/user/drive/directory/subdirectory/!
 
it works for me with just the \$ change, but you do have to have the cursor on the same line for a bare s command to work
if you want to replace in the whole file, you want %s
 
9:16 PM
exactly; or in a range, with line numbers (1,10s...) or markers ('a,'bs...)
(or, I believe, in a search range /start/,/end/s...)
 
@MichaelHomer it worked, I forgot to prepend the substitute command with the % symbol that tells it to perform a find and replace in all lines in the file
 
nice!
 
@JeffSchaller Now I use the % prefix before the substitute command, I don't even have to escape the dollar sign in the search part of the regular expression
@MichaelHomer Thanks
 
@BlackPanther I wouldn't have expected it to work, but maybe the vim code recognizes the situation where you've used $ with text after it.
maybe so -- github.com/vim/vim/blob/master/src/regexp.c#L771 says "// '$' is only magic as the very last char"
when the code literally has ...else if (magic)...
 
@JeffSchaller That makes sense
I did have to escape ~
 
9:28 PM
> Short explanation of the tilde: It stands for the previous replacement pattern.
so you may want to escape it on the right-hand side
... unless there's magic? I get lost: if ((*p == '~' && magic) ...
or is this carrying over the previous search/replacement text into the next search?
indeed; using s/search/replace followed by s/~/elsewise turns search -> replace and replace -> elsewise
 
I am logging the output of cp to a log file using tee:
cp -v -r "$1"/* "$dest" | tee -a "$log_file"
If I want to replace tee, is the following code correct:
cp -v -r "$1"/* "$dest" >> "$log_file"
The code is inside a foreach loop, and in each iteration of the for loop it logs the output of cp to a log file
 
9:46 PM
that looks equivalent; I'd offer two suggestions: (1) any errors from cp will escape both the |tee and the >>; (2) consider putting the >> redirection outside of the loop so that the shell doesn't have to reopen the file each time -- but only if you want to capture all of the command output inside the loop.
 
@JeffSchaller I see, is that because tee and >> don't deal with the standard error stream?
> that looks equivalent; I'd offer two suggestions: (1) any errors from cp will escape both the |tee and the >>;
Does any error output end up on the command line when the script is executed?
> (2) consider putting the >> redirection outside of the loop so that the shell doesn't have to reopen the file each time -- but only if you want to capture all of the command output inside the loop.
The only other command in the loop is the shift shell built-in. Does this also create an output? I'm not sure whether shell built-ins create an output.
If I redirect the output of cp to a file using the command:
cp -v -r "$1"/* "$dest" >> "$log_file"
Will the verbose ouput of the cp command called in the bash script be printed to the standard output in addition to being redirected to a log file?
 
@BlackPanther they don't even see the stderr stream; shift should not create any output, no. (2) is just a minor performance improvement suggestion; do it only if you care about speeding up the I/O a bit
 
10:03 PM
@JeffSchaller I want the output of cp to be persisted to a file, and I also want to follow the same output in the terminal. tee does this, I'm guessing that replacing tee with >> does not achieve this goal since >> redirects the output of a command, >> does not duplicate the output of a command like tee does. Is this right?
 
Correct; tee duplicates its input, while >> simply moves it to the file
 
@JeffSchaller Great information. To implement (2), do I just put >> (i.e. move >> "$log_file") after the done keyword of the loop?
@JeffSchaller Thanks. So cp -v -r "$1"/* "$dest" >> "$log_file" would not print cp's output to the terminal, but cp -v -r "$1"/* "$dest" | tee -a "$log_file" would?
 
10:20 PM
@BlackPanther right
@BlackPanther yes
 

« first day (3742 days earlier)      last day (1227 days later) »