Git grep syntax with square brackets - regex

Why does git log --grep=\[92\] match the commit with the following message:
Author: Aston, Ben (Foo-UK) <Ben.Aston#foo.co.uk>
Date: Wed May 23 12:56:23 2012 +0000
[83] Favourites icon addition for release. <BA>
git-tfs-id: [http://fooppp012v:8080/tfs/TFS2010%20Collection]$/Foo/DnR;C210630
It seems that the correct regular expression format is not what I think?

Go with git log --grep=\\[92\\]. Now you get it, right? :)

The following worked for us:
git log --grep='\[92\]'

Related

Running Clojure 1.9.0 on Windows redux

Last month I asked this question about how to get the latest version of Clojure to run on Windows. #cfrick was kind enough to provide some guidance, but after following his suggestion and monkeying with it for a while now I'm still unable to get Clojure 1.9.0 to run on Windows. I know I must be doing something stupid, but here's what I've got:
I downloaded all the 1.9.0 jars from clojure.org and put them in a directory, along with the core.specs.alpha and spec.alpha jars:
01/12/2018 10:34 PM <DIR> .
01/12/2018 10:34 PM <DIR> ..
12/14/2017 05:55 PM 3,688,794 clojure-1.9.0.jar
12/14/2017 05:55 PM 2,816,528 clojure-1.9.0-javadoc.jar
12/14/2017 05:55 PM 1,052,237 clojure-1.9.0-slim.jar
12/14/2017 05:55 PM 606,466 clojure-1.9.0-sources.jar
01/12/2018 03:43 PM 4,236 core.specs.alpha-0.1.24.jar
01/12/2018 03:42 PM 591,287 spec.alpha-0.1.143.jar
I then tried the command line #cfrick suggested, substituting in the up-to-date version numbers of the specs.alpha and core.specs.alpha jars:
java -cp clojure-1.9.0.jar:spec.alpha-0.1.143.jar:core.specs.alpha-0.1.24.jar clojure.main
Unfortunately, this produces the following error message:
Error: Could not find or load main class clojure.main
That's all that it dumps, so at least that's an improvement over the long list of errors it threw when it couldn't find core.specs.alpha and spec.alpha. :-)
So I dug out the jar utility, dumped the contents of clojure-1.9.0.jar into a file, and found that the class clojure/main.class exists in the jar. I tried re-running the java command above specifying the class name as clojure/main instead of clojure.main but got exactly the same error, so I guess there's no difference between . and / in the class name.
Just for fun (?) I tried running it using clojure-1.9.0-slim.jar but got the same error. I also tried surrounding the specified class path in double quotes, just to try something else, but got the same results. I also tried fully-qualifying the names of the .jar files with the directory in which they reside, appropriately double-quoted - still, same error.
I'd appreciate further guidance on how to get Clojure 1.9.0 to run from the command line, without using something like Leiningen or Boot.
Instead of : use ; as the class path separator:
java -cp clojure-1.9.0.jar;spec.alpha-0.1.143.jar;core.specs.alpha-0.1.24.jar clojure.main
The answer is to install Boot or Lein, really you're not going to get far without those.

Understanding LD_LIBRARY_PATH and missing shared libraries (for Mujoco)

I recently installed the free trial version of Mujoco 1.31. (This question is more general than this, though; Mujoco is a commercial physics library where one needs to obtain a computer-specific mjkey.txt file to run it.) I have been observing some behavior with the $LD_LIBRARY_PATH which is puzzling me.
Here's the directory of relevant stuff. I'm inside the directory /home/daniel/mjpro131. The mjkey.txt text appears in two places since I had to have a copy in the bin directory to run the code.
$ ls
bin doc include LICENSE.txt mjkey.txt model sample
$ ls -lh bin/
total 2.1M
-rwxrwxr-x 1 daniel daniel 14K Apr 23 2016 compile
-rwxr-xr-x 1 daniel daniel 123K Apr 23 2016 libglfw.so.3
-rwxrwxr-x 1 daniel daniel 1.8M Apr 23 2016 libmujoco131.so
-rw-rw-r-- 1 daniel daniel 876 Apr 3 14:52 mjkey.txt
-rw-rw-r-- 1 daniel daniel 156 Apr 3 14:52 MUJOCO_LOG.TXT
-rwxrwxr-x 1 daniel daniel 30K Apr 23 2016 simulate
-rwxrwxr-x 1 daniel daniel 51K Apr 23 2016 test
$ ls -lh model/
total 12K
-rwxr-xr-x 1 daniel daniel 9.4K Apr 23 2016 humanoid.xml
The getting started instructions say to try the simulator code. (These instructions are for version 1.40 but should still work for 1.31.) I attempted to run the following commands, but it does not work:
$ ./bin/simulate model/humanoid.xml
./bin/simulate: error while loading shared libraries: ../bin/libmujoco131.so: cannot open shared object file: No such file or directory
Yet when I go inside the bin directory, the simulator code works:
$ cd bin/
$ ./simulate ../model/humanoid.xml
MuJoCo Pro library version 1.31
This works, and I'd be happy to continue with this, but I really want to understand why my first attempt at this failed. From looking on StackOverflow, I see that the error I got probably deals with the LD_LIBRARY_PATH variable. Here it is:
$ echo $LD_LIBRARY_PATH
/usr/local/cuda-8.0/lib64:/home/daniel/mjpro131/bin:/home/daniel/mjpro131
$ pwd
/home/daniel/mjpro131
$ ls
bin doc include LICENSE.txt mjkey.txt model sample
Here are the relevant lines of my .bashrc:
export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/daniel/mjpro131/bin:/home/daniel/mjpro131
And I made sure to source it before attempting to run the simulator code. Also, before attempting to run the simulator, I ran sudo ldconfig which was advised by some other StackOverflow questions. Unfortunately, I'm still unable to run the Mujoco simulator when I'm at the top-level directory of mjpro131.
Question: I thought the LD_LIBRARY_PATH should be able to find /home/daniel/mjpro131/bin and any library inside it. However, this doesn't seem to be the case as it can't find libmujoco131.so. Am I missing something obvious here?
I'm using Ubuntu 16.04.
You may not be dealing with an LD_LIBRARY_PATH behavior, but instead a characteristic of the library you're testing.
Here's a quote from the page for which you provided a link:
The code samples expect the activation key to be named mjkey.txt and to be in the same directory as the executable, but this can also be changed.
If you didn't do whatever it takes to change that default behavior, the behavior you are seeing seems pretty consistent with the noted policy.

Xlwings mac office 2016 - Not a directory error

When I try to run an excel workbook in office 2016, i get the following error message:
sh: /usr/local/bin/python3.4/python: Not a directory
It work's in 2011 - what is wrong? Please see details below:
xlwings: 0.7,
Office: 2016,
OS: Mac,
PYTHON_MAC = "/usr/local/bin/python3.4"
That's currently a bug really, as PYTHON_MAC should accept the path including the interpreter instead of the path only, see here.
Update: This has been fixed with the release of v0.7.1

OTRS 4.0 Error No config option found for the view 'Custom'

I was using version 3.3 of the otrs and decided to upgrade to 4.0.9. I took to first uninstall all the modules that are not official (KIX4OTRS, complement and others), but after the upgrade by following the steps of the official documentation, without mistakes, I'm in trouble while trying to access the overview in the CMDB . The error occurs only in the overview, the creation and modification of items usually works.
Even after removing the KIX4OTRS still contained some messages it.
Error:
Backend ERROR: OTRS-CGI-10 Perl: 5.16.0 OS: linux Time: Wed Oct 21 14:26:45 2015 Message: No config option found for the view 'Custom'! RemoteAddress: 191.1.200.123 RequestURI: /otrs/index.pl?Action=AgentITSMConfigItem Traceback (3255): Module: Kernel::Output::HTML::LayoutITSMConfigItem::ITSMConfigItemListShow Line: 332 Module: Kernel::Modules::AgentITSMConfigItem::Run Line: 302 Module: Kernel::System::Web::InterfaceAgent::Run Line: 996 Module: ModPerl::ROOT::ModPerl::Registry::opt_otrs_bin_cgi_2dbin_index_2epl::handler Line: 41 Module: (eval) (v1.99) Line: 204 Module: ModPerl::RegistryCooker::run (v1.99) Line: 204 Module: ModPerl::RegistryCooker::default_handler (v1.99) Line: 170 Module: ModPerl::Registry::handler (v1.99) Line: 31
*I checked the Perl modules are all Okay
*My ITSM is version 4.0.9
It worked! Finally ... I used DataBase Browser software and deleted some entries and now I can access the CMDB. I deleted some entries referring to my ID in the table "user_preferences" session_id and session_profile. I'm not sure with was responsible for solving the problem.

Github search using regex

Is there any way to search code in a github repo using regular expressions?
Currently, I clone the repo and search.
But I want to type something like
s/foo/gi
and find all occurances of foo in the code:
foo.create
foo.extend
fooBar
barFoo
bar.foo
Is this possible? Am I missing something in the docs?
Livegrep allows for interactive regex search of ~gigabyte-scale source repositories.
This is now possible with GitHub Code Search.
Since it's a Git repo, why not just clone it locally, and then use git grep with one of it's regex options?:
git grep [-w | --word-regexp]
[-E | --extended-regexp] [-G | --basic-regexp]
[-P | --perl-regexp]
So maybe something along the lines of
$ git clone repo
$ git grep -w foo
Using the keyword "OR"?
foo.create OR foo.extend OR fooBar OR barFoo OR bar.foo
edit: Oops, I answer next to your needs. sorry.