Liu Sha

1

votes
0

answer
36

views

ubuntu: group chrome windows according to the profile used

I use ubuntu unity and chrome with multiple profiles. I also created desktop launchers for different profiles by (named chrome-xxx.desktop, where xxx is the profile name) specifying the command to use different profile like google-chrome --profile-directory=xxx change the StartupWMClass to chrome-xx...
Liu Sha
1

votes
1

answer
73

views

filetype and vim syntax highlighting for the output of ipython

In ipython, I can use ? to get the doc for the object preceding it, like os.path.join?. Then I get the output like this: Signature: os.path.join(a, *p) Docstring: Join two or more pathname components, inserting '/' as needed. If any component is an absolute path, all previous path components will be...
Liu Sha
1

votes
1

answer
242

views

zsh `history n` displays the first n entries instead of the last n entries

I read the doc for history and it says: history [n] history -c history -d offset history -anrw [filename] history -p arg [arg ...] history -s arg [arg ...] With no options, display the command history list with line numbers. Lines listed with a * have been modified. An argument of n lists o...
Liu Sha
1

votes
1

answer
0

views

does git push unreachable objects to the remote

If I use git commit --amend then the previous commit (say commit A) is overwritten, which is not completely reachable since git reflog remembers it. My questions are: If now I do a git push, will the commit A be pushed to the remote? If yes, how about completely unreachable objects (for example, aft...
Liu Sha
-2

votes
0

answer
41

views

clang++ fails to compile hello world

I installed clang in my conda environment along with gcc. Their versions are gcc 7.2.0 clang 7.0.0 libcxx 7.0.0 I then created an hello world src file a.cpp If I compile the file using clang++ a.cpp. The error reads a.cpp:1:10: fatal error: 'iostream' file not found #include ^~~~~~~~~~ 1 err...
Liu Sha
17

votes
3

answer
253

views

Unexpected behavior in assigning 2d numpy array to pandas DataFrame

I have the following code: x = pd.DataFrame(np.zeros((4, 1)), columns=['A']) y = np.random.randn(4, 2) x['A'] = y I expect it to throw an exception because of shape mismatch. But pandas silently accepted the assignment: y's first column is assigned to x. Is this an intentional design? If yes, what i...
Liu Sha
2

votes
1

answer
28

views

fail to capture random engine by value

I have this code that cannot be compiled by gcc 8, but I cannot understand why. #include #include #include using namespace std; template void diagnose(T... x); int main() { auto d = normal_distribution(0.0, 1.0); auto g = default_random_engine(); cout
Liu Sha
4

votes
1

answer
218

views

what is the relation and difference between ipython and jupyter console

After the ipython notebook project renamed to jupyter, I always think that ipython notebook is the same as jupyter notebook and ipython shell is just an alias of jupyter console. Today I realize that ipython does not have connect_info magic defined and therefore is not able to be connected to from d...
Liu Sha
2

votes
1

answer
1.1k

views

vdiskmanager for vmware workstation 12

I created a virtual system using VMWare Workstation 12 Player. I selected the hard disk type to be growable. Now I want to switch to preallocated. I learnt from google that this can be done using vmware-vdiskmanager.exe. However, it seems that this utility is not bundled with the vmware player. Is t...
Liu Sha
8

votes
2

answer
1.4k

views

python logging root logger does not show info even if I set the level to INFO

I created the following script. Could any of you explain to me why the output is like what shows below Source import logging logger = logging.getLogger() logger.setLevel(logging.DEBUG) print('debug', logger.isEnabledFor(logging.DEBUG)) print('info', logger.isEnabledFor(logging.INFO)) print('warning'...
Liu Sha
2

votes
0

answer
157

views

jupyter console and ipython

In my conda environment, I installed both jupyter and ipython. The result for conda list jupyter and conda list ipython are as follows: jupyter_client 5.1.0 py35_0 defaults jupyter_console 5.2.0 py35_0 defaults jupyter_contrib_core...
Liu Sha
2

votes
1

answer
48

views

zsh: refresh prompt after running zle widget

I have the following widget defined function cdd() { cd / } zle -N cdd{,} bindkey '^R' cdd After pressing the key combination the cwd is already changed, but the terminal prompt is not updated. Example, after doing this () ~/tmp/todelete$ | # press key ^R here; '~$' is the prompt; '|' denotes curso...
Liu Sha
1

votes
1

answer
1.2k

views

jupyter-notebook: add css class to output cell

Is it possible to add a class to the output cell using cell magic? For example: In [1]: %%css-class highlight display(pd.DataFrame(np.random.rand(3,4))) and then the the cell Out [1] will have the class 'highlight' so that I can change the format using css.
Liu Sha