when use zim frame for zsh,read-only variable: _zim_fpath error - zsh

env:
zsh 5.8.1 (arm-apple-darwin21.3.0)
zimfw
when source ~/.zshrc,occur
/Users/username/.zim/init.zsh:3: read-only variable: _zim_fpath
I have not find any question for it!
I tried to annotation this code,but will refresh and recover this line.

Related

iTerm2 now starts up listing profile configuration

Recently, when I load iTerm2 on my mac, it lists out the configuration of my profile (or possibly its something different).
This is what I see:
Last login: Tue Jun 21 19:54:38 on ttys000COLORFGBG='15;0'
COLORTERM=truecolor
COMMAND_MODE=unix2003
HOME=/Users/me
ITERM_PROFILE=Default
ITERM_SESSION_ID=w0t0p0:FD9764B1-4535-4FE2-932A-97AFD9D6C804
LANG=en_GB.UTF-8
LC_TERMINAL=iTerm2
LC_TERMINAL_VERSION=3.4.15
LOGNAME=me
OLDPWD=/Users/me
PATH=/usr/bin:/bin:/usr/sbin:/sbin
PWD=/Users/me
SHELL=/bin/zsh
SHLVL=1
SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.u21pRFo1wk/Listeners
TERM=xterm
TERM_PROGRAM=iTerm.app
TERM_PROGRAM_VERSION=3.4.15
TERM_SESSION_ID=w0t0p0:FD9764B1-4535-4FE2-932A-97AFD9D6C804
TMPDIR=/var/folders/dz/wvb1lxq56wg_wk3ppwqw4mdc0000gn/T/
USER=me
XPC_FLAGS=0x0
XPC_SERVICE_NAME=0
__CFBundleIdentifier=com.googlecode.iterm2
__CF_USER_TEXT_ENCODING=0x0:0:0
me#my-iMac ~ %
I don't really like this behaviour. I can't find where that has been set to happen. I can't see anything in .zshenv, .zshrc, .bashrc and can't see where in iTerm such a thing might be triggered. I've tried creating a new profile, but that also results in the same output.
Any other suggestions to how I can get back to the way it was a few weeks back where it just told me the last time I logged in?
If you add set -x to ~/.zshenv, the shell will print every line it runs with file names and line numbers. You can then find the offending command and remove or fix it. My best guess would be a call to export without any arguments: something like export $foo, where $foo is empty?

How to create a Anatomic Regions in Study Code Sequence

I'd like to edit a DICOM file with dcmodify to add an 'Anatomic Regions in Study Code Sequence' element (TAG: 0008,0063) but I'm unsure how to do this.
I can add the tag but what do I then add as its children? Is is it a list of (0018,0015) tags?
That should work:
$ dcmodify -i "(0008,0063)[0].(0018,0015)=FOOBAR" test.dcm
If you get something like:
E: modifying tag in file test.dcm: Invalid Path: Non-sequence tag found with rest path following
E: There was 1 error
This indicate that the attribute 0008,0063 is not declared in your dicom.dic file. Eg:
$ grep 0008,0063 /usr/share/dcmtk/dicom.dic
-> returns nothing
In that case simply update your dcmtk package.
ref:
DCMTK: dcmodify: Modify DICOM files

Use bash_profile aliases in jupyter notebook

It looks like my Jupyter notebook picks up everything that I export in my .bash_profile, but nothing that I alias.
I think ! uses bin/sh, so it's understandable that the aliases from the bash profile don't port over, but the %%bash magic also does not pick up the aliases I've written.
Is there a way to make the aliases in my bash profile available through ! (ideally) or, at the least, using %%bash?
This seems to work (python3, modified from a hack I found in a jupyter issue)
import subprocess
lines = subprocess.check_output('source ~/.bash_profile; alias',shell=True).split(b'\n')
manager = get_ipython().alias_manager
for line in lines:
line = line.decode("utf-8")
split_index = line.find('=')
cmd = line[split_index+1:]
alias = line[:split_index]
cmd = cmd[1:-1]
print ("ALIAS:{}\t\tCMD:{}".format(alias,cmd))
manager.soft_define_alias(alias, cmd)
Here's another alternative, which is less a solution than a workaround: you can define aliases locally to the notebook using the %alias magic, and make those aliases available in the future using the %store magic. More alias trickiness here: https://github.com/ipython/ipython/wiki/Cookbook:-Storing-aliases
More on the %store magic here: http://ipython.readthedocs.io/en/stable/config/extensions/storemagic.html
The next step is hacking the %store magic to persist these aliases: https://github.com/ipython/ipython/blob/master/IPython/extensions/storemagic.py
For posterity, here are the results of some experiments I ran before finally finding a solution:
I sourced my .bash_profile in a %%bash cell. From within that cell, I was able to interrogate the values of variables I defined in my .bash_profile, and was able to list aliased commands by invoking alias. However, I was still not able to use aliased commands. Additionally, variables defined in my .bash_profile were only accessible inside the cell with the source call: trying to access them in subsequent %%bash cell didn't work, and the alias command also failed. More interesting still: if I sourced using !, I wasn't able to interrogate variables defined in my bash profile nor list my aliases with ! shell commands in the same cell.
Suffice it say, the %%bash magic is finicky.

Unix SQLLDR scipt gives 'Unexpected End of File' error

All, I am running the following script to load the data on to the Oracle Server using unix box and sqlldr. Earlier it gave me an error saying sqlldr: command not found. I added "SQLPLUS < EOF", it still gives me an error for unexpected end of file syntax error on line 12 but it is only 11 line of code. What seems to be the problem according to you.
#!/bin/bash
FILES='ls *.txt'
CTL='/blah/blah1/blah2/name/filename.ctl'
for f in $FILES
do
cat $CTL | sed "s/:FILE/$f/g" >$f.ctl
sqlplus ID/'PASSWORD'#SERVERNAME << EOF sqlldr SCHEMA_NAME/SCHEMA_PASSWORD control=$f.ctl data=$f EOF
done
sqlplus will never know what to do with the command sqlldr. They are two complementary cmd-line utilities for interfacing with Oracle DB.
Note NO sqlplus or EOF etc required to load data into a schema:
#!/bin/bash
#you dont want this FILES='ls *.txt'
CTL_PATH=/blah/blah1/blah2/name/'
CTL_FILE="$CTL_PATH/filename.ctl"
SCHEMA_NM=SCHEMA_NAME
SCHEMA_PSWD=SCHEMA_PASSWORD
for f in *.txt
do
# don't need cat! cat $CTL | sed "s/:FILE/$f/g" >"$f".ctl
sed "s/:FILE/$f/g" "$CTL_FILE" > "$CTL_PATH/$f.ctl"
#myBad sqlldr "$SCHEMA_NAME/$SCHEMA_PASSWORD" control="$CTL_PATH/$f.ctl" data="$f"
sqlldr $SCHEMA_USER/$SCHEMA_PASSWORD#$SERVER_NAME control="$CTL_PATH/$f.ctl" data="$f" rows=10000 direct=true errors=999
done
Without getting too philosophical, using assignments like FILES=$(ls *.txt) is a bad habit to get into. By contrast, for f in *.txt will deal correctly for files with odd characters in them (like spaces or other syntax breaking values). BUT the other habit you do want to get into is to quote all variable references (like $f), with dbl-quotes : "$f", OK? ;-) This is the otherside of protection for files with spaces etc embedded in them.
In the edit update, I've varibalized your CTL_PATH and CTL_FILE. I think I understand your intent, that you have 1 std CTL_FILE that you pass thru sed to create a table specific .ctl file (a good approach in my experience). Note that you don't need to use cat to send a file to sed, but your use to create a altered file via redirection (> $f.ctl) is very shell-like too.
In 2nd edit update, I looked here on S.O. and found an example sqlldr cmdline that has the correct syntax and have modified to work with your variable names.
To finish up,
A. Are you sure the Oracle Client package is installed on the machine
that you are running your script on?
B. Is the /path/to/oracle/client/tools/bin included in your working
$PATH?
C. try which sqlldr. If you don't get anything, either its not
installed or its not in the path.
D. If not installed, you'll have to get it installed.
E. Once installed, note the directory that contains the sqlldr cmd.
find / -name 'sqlldr*' will take a long time to run, but it will
print out the path you want to use.
F. Take the "path" part of what is returned (like
/opt/oracle/11.2/client/bin/ (but not the sqlldr at the end), and
edit script at 2nd line with
(Txt added to appease the S.O. Formatter ;-) )
export ORCL_PATH="/path/you/found/to/oracle/client"
export PATH="$ORCL_PATH:$PATH"
These steps should solve any remaining issues. If this doesn't work, see if there is someone where you work that understands your local computing environment that can help explain any missing or different steps.
IHTH

XCode4 can not Watch value of variables

It's a bit annoying that when I hit a break point in XCode 4, values of Watch Expressions are always grayed out. I have to create dummy variables pointing to the thing I want to watch in order to get around it.
The log says the following errors when I run the app:
warning: Unable to read symbols for /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.3.3 (8J2)/Symbols/System/Library/Frameworks/IOKit.framework/IOKit (file not found).
warning: Tried to remove a non-existent library: /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.3.3 (8J2)/Symbols/System/Library/Frameworks/IOKit.framework/IOKit
Current language: auto; currently objective-c++
warning: Unable to read symbols for /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.3.3 (8J2)/Symbols/Developer/usr/lib/libXcodeDebuggerSupport.dylib (file not found).
How can I fix this?
As for myself, I debug variables using two handy GDB console commands. You can enter them when in debug mode in debug console after GDB mark. I use "p" command for printing basic C type variables:
p [[[self pointerToMyClass] anotherPointerToOtherClass] someIntValue]
And I use "po" command for printing content of arrays, for checking objects:
po [[[self pointerToMyClass] anotherPointerToOtherClass] someNSArray]
po [[[self pointerToMyClass] anotherPointerToOtherClass] myUIImageView]

Resources