syntax   11112

« earlier    

vim, Ale, Syntastic and Perl::Critic | i hack on things
Setting up Ale syntax and linter on Vim with specific Perl bindings.
Perl  PerlCritic  Lint  Vi  vim  Ale  Syntax 
2 days ago by lost_in_space
stl - Iterate keys in a C++ map - Stack Overflow
What's difficult to discern from the STL documentation at, say,, is that the allocator is a std::pair. That gives you the clue that instead of "key" and "value" you need to be saying "it->first" and "it->second" when looping over the elements with a std::iterator.
cplusplus  stl  iterator  map  syntax  solution 
2 days ago by kme
The Unix Shell's Humble If |
This is a really good article, and it mentions things like not quoting regexes in double-square-brace tests.
unix  linux  bash  shellscripting  test  conditionals  newbie  quoting  syntax  tutorial 
4 days ago by kme
Basic AST Manipulation in Go - zupzup
Traversing an AST (Abstract Syntax Tree) is useful for analysing and understanding a code-base, but the real power comes when we are able to manipulate it, which allows us to build tools. This post shows a simple example of how to manipulate the AST in Go.
golang  ast  syntax  tree 
5 days ago by geetarista
How can I replace a newline (n) using sed? - Stack Overflow |
Note that you have to give each command as a separate `-e` in OS X and BSD. I thought that the `$!ba` was the problem (history expansion), and wasted a bunch of time trying to figure out why it wouldn't work on OS X. It was the semicolons!
Fast answer:

<code class="language-bash">sed ':a;N;$!ba;s/\n/ /g' file</code>

- :a create a label 'a'
- N append the next line to the pattern space
- $! if not the last line, ba branch (go to) label 'a'
- s substitute, /\n/ regex for new line, / / by a space, /g global match (as many times as it can)

sed will loop through step 1 to 3 until it reach the last line, getting all lines fit in the pattern space where sed will substitute all \n characters

All alternatives, unlike sed will not need to reach the last line to begin the process

with bash, slow

<code class="language-"bash>while read line; do printf "%s" "$line "; done < file</code>

with perl, sed-like speed

<code class="language-bash">perl -p -e 's/\n/ /' file</code>

with tr, faster than sed, can replace by one character only

<code class="language-bash">tr '\n' ' ' < file</code>

with paste, tr-like speed, can replace by one character only

<code class="language-bash">paste -s -d ' ' file</code>

with awk, tr-like speed

<code class="language-bash">awk 1 ORS=' ' file</code>
bash  shellscript  sed  syntax  newbie  textprocessing  fuckina  solution 
8 days ago by kme

« earlier    

related tags

2017  accdb  access  advanced  advantages  alanturing  ale  an  api  apl  arcgis  aristotle  arrays  article  artificialintelligence  ast  atom  awesome  axial  babel  bash  bashism  basic  beautifiers  bind  blog  boolean  buffers  built-in  butwhy  c#  c++  c  categorization  cheatsheet  cheatsheets  check  checker  circuit  claudeeshanon  cloud  code  codeconvention  codemod  coding  color  communication  comparison  compilation  compiler  computer  conceptscript  conditionals  conf  config  configfile  conversation  conversion  corpora  correspondence  corrupt  course  cplusplus  create  dammitbrain  daringfireball  dark  data  database  deep-learning  delete  delimiter  dev  development  device  digital  digitalocean  docker-pipeline  docker  documentation  dsl  editor  ejs  elm  emacs  entropy  es-2017  es-2018  es6  euclid  event  example  facebook  faq  feature  file  filemanagement  filetype  finite-state-machine  fold  for  format  formatting  fridayfrontend  fuckina  function  georgeboole  gis  github  go  godel  golang  google?  google  gottlobfrege  grammar  graphviz  guide  guided  handler  haskell  heredoc  highlight  highlighter  highlighting  history  howto  html  html5  ide  important  index  indexes  information  inspiration  interpret  interpreter  is  iteration  iterator  j  java  javascript  jenkins  job  keys  kotlin  lakota  lang  language  languages  library  linguistics  linguisticturn  link  linking  lint  linter  linting  linux  lists  logic  machine  manual  map  markdown  math  mechanical  mode  ms  mysql  mysql5.7  nap  negotiation  network  neuralnetwork  new  newbie  nginx  nlp  notation-as-a-tool-of-thought  object  operators  org  package  parser  parsing  perl  perlcritic  philosophy  php  plugin  plugins  png  presentation  prettier  processing  productivity  program  programming  proposal  protocol  pygments  python  quoting  react  reason  reference  regex  regexp  regularexpression  repository  roslyn  rouge  rounding  ruby  rules  rust  sample  screenshot  search  sed  semantics  shellscript  shellscripting  show  signal  site  site:  sketch  slides  solution  space  specification  splunk  sql  stackoverflow  stl  string  strings  sublime  swift  syllogism  symbol  syntax-checker  syntax-ejs  syntaxhighlighting  synthesis  templatetoolkit  terminal  test  text  textbook  textmate  textprocessing  theme  themes  there  time  tipsandtricks  tolearn  tool  tools  toread  totry  tounderstand  transistor  traversal  tree  trivia  tutorial  type  typescript  unix  vannevarbush  variables  verbs  vi  view  vim  virtualhost  vscode  webdev  webdevel  window-managers  writing  xml  xmobar  xmonad  xpath  yaml 

Copy this bookmark: