11.17.2017

make DSSP 3.0.0 on mac osx 10.13.1 with xcode 9.1

anyway
DSSP 3.0.0 (http://swift.cmbi.ru.nl/gv/dssp/) has been released...but it cannot be built on macosx, some issues

1. the latest boost library (1.65 and later?) changed the location for tuple.hpp, removing "tr1"
//#include

#include
2. many codes... to be fixed, eg
(in primitives-3d.hpp)
//std::tr1::tuple QuaternionToAngleAxis(MQuaternion q);

boost::tuple<double,MPoint> QuaternionToAngleAxis(MQuaternion q);

(in dssp.cpp)
//  std::tr1::tie(alpha,chirality) = residue.Alpha();
  boost::tie(alpha,chirality) = residue.Alpha();
.
.
.

3. edit make.config (you can use old boost library to solve tr1 issues... )
# Set local options for make here
BOOST_LIB_SUFFIX = -mt
BOOST_LIB_DIR     =/usr/local/Cellar/boost/1.65.1/lib
BOOST_INC_DIR     =/usr/local/Cellar/boost/1.65.1/include

4. modify makefile
from
@ $(CXX) -v -static -o $@ $^ $(LDOPTS)
to
@ $(CXX) -v -o $@ $^ $(LDOPTS)

because  xcode doesn't support -static

9.05.2016

connect apple tv with eduroam, use eduroam wifi with apple tv, configure eduroam profile in apple tv

first, i'm a lonely man in f___ing BNE...

1. please visit https://grok.lsu.edu/Article.aspx?articleid=16895 to understand what is
"apple configurator2" and any hardware that you need to connect your apple tv (ATV) to your laptop, sure! you need a computer with mac os

2. remove your ATV from your computer via USB, start your ATV, connect your ATV with USB

3. open apple configurator2, new a profile, go to wifi to configure




4. open go to https://cat.eduroam.org/ to check/get your configure profile under your university/institute

5. download your eduroam installer from "https://cat.eduroam.org/" cause you will never know how to it works in your uni...


6. use text editor (perhaps iso-8559-1 is a good encoding) to open the configure profile, 
and you will see something dala as follow~~ this is from my uni
                      EAPFASTProvisionPAC ==> yes it accepts EAPFAST...
                           
                      EAPFASTUsePAC ==> yes it accepts EAPFAST...
                           
                      EAPFastProvisionPACAnonymously ==> reject EAPFast...anonymous
                           
                      OneTimeUserPassword ==> reject onetime userpwd
                           
                      TLSAllowTrustExceptions 
                         
                      TLSTrustedServerNames==> oh my uni actually accpts TLS..server
                         
"sorry i don't want your know" ==> and the server name is "sorry i don't want your know"
                         
                      TTLSInnerAuthentication
                         MSCHAPv2 ==> this is important too
                   
               EncryptionType ==> yes WPA
                  WPA
               HIDDEN_NETWORK

7. try to understand/map the above options to the wifi configuration page in the "apple configuretor 2", and don't forget to fill out your eduroam username/pwd from your uni/institute

8. enjoy it :)

9. this is my profile in my uni for example





11.26.2010

how to quickly rename file in MATLAB?how to change file extension quickly in batch?

how to quickly rename file in MATLAB?

how to change file extension quickly in batch?

method 1.

by movefile

eg.

movefile(‘test.txt’,’test.test’); rename file test.txt to test.test.test

but this is a very inefficient function

method 2.

invoke java machine

eg.

java.io.File('test.txt ').renameTo(java.io.File('test.test '));

this is super faster than movefile function

then … using java to do file extension rename

usage:

DirStruct=dir('*.txt');

ChangeFileExtension(DirStruct,'.m');

change all *.txt file to *.m

function ChangeFileExtension(DirStruct,NewExtension)

% author Laiso Taiwan

% extension ,such as '.txt'

% if no extension then append

% else remove old extension and appent the new one

% 'name' char

% 'date' char

% 'bytes' 1*1 double

% 'isdir' 1*1 logic

% 'datenum' 1*1 double

StructFields={'name'

'date'

'bytes'

'isdir'

'datenum'};

if(~isequal(fieldnames(DirStruct),StructFields))

error('input is not dir struct');

end

if ~(ischar(DirStruct(1).name)&&ischar(DirStruct(1).date)&&isa(DirStruct(1).bytes,'double') ...

&&numel(DirStruct(1).bytes)==1&&isa(DirStruct(1).isdir,'logical')...

&&numel(DirStruct(1).isdir)==1&&isa(DirStruct(1).datenum,'double')&&numel(DirStruct(1).datenum)==1)

error('input is not dir struct');

end

for i=1:numel(DirStruct)

Dot=find(DirStruct(i).name=='.',1,'last');

if ~isempty(Dot)

%movefile(DirStruct(i).name,[DirStruct(i).name(1:Dot-1) NewExtension]);

java.io.File(DirStruct(i).name).renameTo(java.io.File([DirStruct(i).name(1:Dot-1) NewExtension]));

else

% movefile(DirStruct(i).name,[DirStruct(i).name NewExtension]);

java.io.File(DirStruct(i).name).renameTo(java.io.File([DirStruct(i).name NewExtension]));

end

end