精华内容
下载资源
问答
  • Compass

    2016-10-30 12:11:09
    解释 compass create 创建新Compass项目 compass init 为已存在项目添加compass compass clean 移除已生成的文件和缓存 compass compile 生成样式表文件 compass watch 监视sass文件并自动编译 compass ...

    Compass

    compass常用命令

    命令 解释
    compass create 创建新Compass项目
    compass init 为已存在项目添加compass
    compass clean 移除已生成的文件和缓存
    compass compile 生成样式表文件
    compass watch 监视sass文件并自动编译
    compass stats 查看样式表统计数据
    compass validate 验证生成的CSS文件

    Gulp监听Compass

    var gulp = require('gulp'),
        compass = require('gulp-compass'),
        mincss=require('gulp-minify-css');
    
    gulp.task('css',function(){
        //编译css
        //压缩css
         gulp.src('./sass/*.scss')
            .pipe(compass({
              config_file: './config.rb',
              css: 'stylesheets',
              sass: 'sass'
            }))
            .pipe(mincss())
            .pipe(gulp.dest('stylesheets'));
    });
    
    gulp.task('watch',function(){
        gulp.watch('./sass/*.scss',['css'])
    });
    
    gulp.task('default',['watch'],function() {
      // 将你的默认的任务代码放在这
      console.log("task default");
    });

    gulp-compass
    npm插件

    展开全文
  • compass

    2019-10-01 12:03:38
    cmd下 dir可查看文件夹目录rd 删除文件夹 md 新建文件夹  images文件夹要和config里的配置相吻合  config里的relative_assets = ...创建compass  项目目录下 compass create name 叹号 " !"  require ...

        cmd下  dir可查看文件夹目录 rd 删除文件夹  md 新建文件夹

         images文件夹要和config里的配置相吻合

        config里的relative_assets = true  取消注释  就会使用相对路径

    创建compass

        项目目录下  compass create name  

     

    叹号 " ! "

        require 'compass/import-once/activate'      如果多次引用一个文件 只插入一次

        如果需要多次引入  在后面加上叹号即可   require ' compass-normalize! '  

        

        confing.rb 文件output_style 设置为 :compressed 的时候,可以在注释前加让他在编译的时候不被压缩

        /*! ... */            //双斜线的注释本身就不会打包到css文件中

     

    引入模块

    使用@impot "compass",就默认包含了其他的5大模块   layout和reset需要明确指定引入

    layout  提升页面布局的控制能力

    reset 重置

     

    normalize模块

        gem install compass-normalize      使用compass的normalize插件

        npm install normalize.css     安装normalize包

        安装好之后再config文件中  require ' compass-normalize '   引入即可

     

        包含base,html5,links,typography,embeds,groups,forms,tables 等8个子模块 

        通过@import "normalize/base" 这样的子路径引入   

        如果只引入子模块,需要同时引入 "normalize-version" 模块

     

    reset模块

     

    layout模块

        layout / stretching

        @include stretch();   占满整个父元素  ,设置为absolute,上右下左都为0,可加参数为上右下左到页面的距离

        @include stretch-x();   @include stretch-y(); 

     

        layout / sticky-footer    

        @include sticky-footer()  让footer处于页面底部(如果内容高度不够就为窗口底部)

     

    css3模块

        @include box-shadow(1px 1px 1px 1px  #ccc)    盒子阴影

     

    typography模块

        typography / links

        @include hover-link;  去除下划线。光标移动上去后和获取焦点后 显示下划线

        @include link-colors('normal','hover','active','visited','focus');      第一个为必选参数

        @include  unstyled-link;    抹平超链接样式 和文本一样

     

        typography / lists

        @include no-bullets;    去除自己的list-style和下面li的list-style和margin-left

        @include no-bullet;    没有“s”,去除单个li的list-style样式

        @include pretty-bullets()    将自定义图片设置为list-style样式

        @include inline-list;    去除本身的list-style,和里面li元素的margin,padding; 然后display设置为inline

        @include horizontal-list('padding','float');  本身margin,padding设置为0,overflow为hidden,里面li去除样式然后float:left,有4px的padding-lfet和right

     

                @include horizontal-list(false,right);    填false就是不需要padding,否则是设置padding为0,不支持ie8;

        @include inline-block-list('padding');    本身margin,padding设置为0,overflow为hidden,里面li去除样式然后设置为inline-block 不需要padding可以不写

        

        typography / text

        @include force-wrap;    强制换行

        @include ellipsis;      不换行,多余部分用省略号表示

        @include hide-text;    将里面文字隐藏  text-indent方式

           @include squish-text;  将里面文字隐藏  fontsize为0,颜色透明方式

        @include replace-text( ' https://url ','background-position-x','background-position-y' )   将图片替换成背景

        @include replace-text-with-dimensions('url')    自动计算本地图片的宽高  不会有背景色漏出

        

        typography / vertical_rhythm

        垂直韵律

     

    helpers模块

        函数 不是mixin  不用添加@include  直接调用

        background-image:inline-image('config里image配置的文件夹里的图片的url')    减少链接数 将图片转成base64编码形式放在css文件里随css进行返回

        background-image:image-url('config里image配置的文件夹里的图片的url')    自动生成cache buster(路径后面添加?和一串数字) 解决缓存问题 

        @include font-face()    字体  不用写format那些

     

    Utitilities模块

        Utitilities / gennral

         @include clearfix();  设置overflow:hidden来清除浮动

        @include pie-clearfix();  使用伪类方式清除浮动

        @include legacy-pie-clearfix();  

     

        Utitilities / sprites

          在images下创建一个logo文件夹    新建一个_icons.scss的文件 里面放入以下代码 (在原scss文件中要用@import引入) 

        @import "compass/utilities/sprites";

          $logo-sprite-dimensions:true;   // 生成的时候会同时给logo-a这个类加上宽高  数值为图片的宽高

        @import " logo/*.png";

          假设是items/logo/*.png  也是取最后一个值 也就是logo作为mixin  然后调用

        @include all-logo-sprites();

          就会生成一个精灵图  使用.logo-图片名 引用   比如 logo-a

          其他类名通过 @include logo-sprite("a")  来调用    括号内为图片名

     

        a.png    a_hover.png  a_active.png    图片使用另外两个类名命名的时候  compass会自动在hover和active状态下  更改图片

        $disable-magic-sprite-selectors:true    可以关闭这一特性

         

    转载于:https://www.cnblogs.com/xiumumi/p/9744021.html

    展开全文
  • Compass

    2011-05-12 12:35:48
    Compass    1. 概述  已加入Opensymphony的Compass 是对Lucene搜索引擎在企业应用(数据库相关应用)中的封装和增强。 Lucene本身的API已经非常简单,那Compass还能做什么样的增强呢?  心里数一下还是挺多...

    Compass 

     

    1. 概述

        已加入Opensymphony的Compass 是对Lucene搜索引擎在企业应用(数据库相关应用)中的封装和增强。 Lucene本身的API已经非常简单,那Compass还能做什么样的增强呢?

        心里数一下还是挺多的,不过可能只有一小部分适合自己的项目,在我的项目里最实际的增强就是索引的建立与Data Change Mirror的功能,其他功能用不用的上就要看缘分了。

    1.1 参考资料

        InfoQ:Compass: Integrate Search into your apps

     1.2 What SpringSide Done

        SpringSide在core中仿照Compass的Spring MVC Controller封装了SearchService与Advanced SearchService,方便不使用Spring MVC的同志

        同时在书店示例中演示了图书搜索及结果关键字高亮,在Spring启动时建立索引并基于Hibernate event机制的自动索引更新。

    2. Data Change Mirror功能

        DataMirror会把数据库的增删改变化实时映射到索引文件中。

        如果你采用Hibernate等ORM方案,Compass就会与Hibernate的event机制结合,或者使用AOP的方式,自动在数据库增删改时变更索引;如果你只是采用JDBC,也可以在XML文件配置Table Mapping或ResultSet Mapping,指定version列,Compasss定时对version列变化了的数据进行索引更新。

        而且,Compass还支持事务,在查询数据库遍历结果集的过程中如果出现异常,会在Index Segments 文件一级进行事务控制。

        如果没有Compass,我们一般会在每天深夜重建一次索引。相比Compass的做法,
        一来反应迟缓,平均延时半天;
        二来效率没有Compass高。如果采用完全重建索引,效率就不用说了。如果进行增量索引,就要增加一个字段,在数据更新时进行特殊的处理,删除时也不能直接删除数据,要等lucene删完索引数据才能删除,这样Lucene对应用就非常不透明了。
        三来不支持事务,如果建立索引过程中出现异常,索引文件的状态是不可控的。

    3. Compass 下简化的索引建立过程

        在lucene 下建立索引的过程是自己用JDBC 跑.SQL 获得ResultSet,遍历ResultSet建立Document对象并用IndexWriter写入文件目录。

        在Compass下就变成一个宣告的过程:

    3.1 宣告待搜索的POJO

       @SearchableId 宣告Document的id列;

       @SearchableProperty 宣告要索引的field;

       @SearchableComponent宣告关联其他对象如Category分类。

    public   class  Product  {
      @SearchableId
      private  Integer id;
    
      @SearchableProperty
      private String name;
    
      @SearchableComponent
      private Category category;
     }

    3.2 定义CompassGps

          CompassGps是Compass下用来建立索引,Mirror Data Change的类。

          在ApplicationContext.xml定义了Compass与Spring的集成,配置参数,并让GPS随ApplicationContext启动开始监控Hibernate的DataChange :

    • Compass:核心定义类,定义要搜索的POJO 和 索引存储的路径。
    • CompassGPS: 定义使用了Hibernate3GPS,定义了init-method 和destory-method,会自动随ApplicaitonContext的启动,开始监控Hibernate的变化。
    <bean id="compass" class="org.compass.spring.LocalCompassBean">
    	<!-- anontaition式设置 -->
    	<property name="classMappings">
    		<list>
    			<value>org.springside.bookstore.model.Book</value>
    			<value>org.springside.bookstore.model.Category</value>
    		</list>
    	</property>
    
    	<property name="compassConfiguration">
    		<bean class="org.compass.annotations.config.CompassAnnotationsConfiguration"/>
    	</property>
    
    	<property name="compassSettings">
    		<props>
    			<prop key="compass.engine.connection">
    				file://${user.home}/springside/compass
    			</prop>
    			<prop key="compass.transaction.factory">
    				org.compass.spring.transaction.SpringSyncTransactionFactory
    			</prop>
    		</props>
    	</property>
    
    	<property name="transactionManager" ref="transactionManager"/>
    </bean>
    
    <!-- Compass中建立索引与mirror database change的部件 -->
    <bean id="compassGps" class="org.compass.gps.impl.SingleCompassGps"
    		  init-method="start" destroy-method="stop">
    	<property name="compass" ref="compass"/>
    	<property name="gpsDevices">
    		<list>
    			<bean class="org.compass.spring.device.hibernate.SpringHibernate3GpsDevice">
    					<property name="name" value="hibernateDevice"/>
    					<property name="sessionFactory" ref="sessionFactory"/>
    			</bean>
    		</list>
    	</property>
    </bean>

      只需要在AdvancedSearchCommand 上将需要highlighting 的Fields 加入即可。

    searchCommand.setHighlightFields(new String[] {"name"});

    4.2 定义高亮的样式

    另外,如果对高亮显示的效果不满意的话,可以在applicationContext-compass.xml 文件里配置:

    <prop key="compass.engine.highlighter.default.formatter.simple.pre">
         <![CDATA[<font color="red"><b>]]>
        </prop>
        <prop key="compass.engine.highlighter.default.formatter.simple.post">
         <![CDATA[</b></font>]]>
    
    展开全文
  • Compass-源码

    2021-03-17 22:02:21
    Compass
  • Compass Compass 是一个简约的指南针应用。 Compass is a simple compass app. 其目标是让用户在手机上也能够使用罗盘。 Its intention is to enable users to use the luopan on their mobile phones. 功能和特性 ...
  • COMPASS介绍

    2011-11-16 20:04:08
    COMPASS介绍COMPASS介绍COMPASS介绍COMPASS介绍COMPASS介绍
  • compass 笔记

    2012-10-25 16:53:30
    compass API部分翻译 compass心得
  • MongoDB Compass

    2018-06-13 09:52:54
    MongoDB Compass图形界面管理工具,没有积分到我博客下发邮箱获取。
  • IntroductionThis article explains how we can create our own compass app using the built-in magnetic sensor of our mobile device.The foremost thing to remember is that a compass app works by using the ...

    fe554079bcfdd355f305524f0e8a85ed.png

    Introduction

    This article explains how we can create our own compass app using the built-in magnetic sensor of our mobile device.

    The foremost thing to remember is that a compass app works by using the data provided by the magnetometer sensor on a mobile device. So if our mobile device does not have this sensor, a compass app cannot run on it.

    Also magnetometers are very sensitive to magnetic or electrical signals. So be careful that you are holding the device away from any such signals to get accurate direction from the compass app.

    I have used the following image from cliparts.co for my compass app:

    pi5op9qyT.png

    Background

    In this article, I have used a TextView control to display the angle at which the device is oriented. Also, I have used an image of a compass to point to the North-South direction. In order for all this to work, the sensor manager of the device needs to be initialized when the app is initialized.

    Also, we need to register the orientation sensor of the device when the app is activated and unregister it when the app is paused, to conserve battery.

    Using the code

    Following is the main layout file which defines a TextView control and an ImageView control in a relative layout:

    Copy Code

    android:layout_width="fill_parent"

    android:layout_height="fill_parent"

    android:gravity="center"

    android:orientation="vertical" >

    android:layout_width="wrap_content"

    android:layout_height="wrap_content" />

    android:layout_width="wrap_content"

    android:layout_height="wrap_content"

    android:layout_below="@+id/txtDegrees"

    android:src="@drawable/compass" />

    The following code is used to initialize the image for our compass.

    Copy Code

    imgCompass=(ImageView)findViewById(R.id.imgCompass);

    The following code is used to initialize the textview to display the degree of rotation.

    Copy Code

    txtDegrees=(TextView)findViewById(R.id.txtDegrees);

    The getSystemService() method can be used to initialize the sensor manager of our device as follows:

    Copy Code

    sensorManager=(SensorManager)getSystemService(SENSOR_SERVICE);

    Following is the full code of the onCreate() method which is called once when the app is started:

    Copy Code

    @Override

    public void onCreate(Bundle savedInstanceState)

    {

    super.onCreate(savedInstanceState);

    setContentView(R.layout.main);

    imgCompass=(ImageView)findViewById(R.id.imgCompass);

    txtDegrees=(TextView)findViewById(R.id.txtDegrees);

    sensorManager=(SensorManager)getSystemService(SENSOR_SERVICE);

    }

    Following is the code of the onResume() method which is automatically called whenever the activity comes to the foreground:

    Copy Code

    @Override

    protected void onResume()

    {

    super.onResume();

    sensorManager.registerListener(this,sensorManager.getDefaultSensor(Sensor.TYPE_ORIENTATION),SensorManager.SENSOR_DELAY_GAME);

    }

    The above code registers a SensorEventListener for the orientation sensor of our device at the sampling frequency specified by the parameter SensorManager.SENSOR_DELAY_GAME, which represents a rate suitable for games.

    The following code unregisters the SensorEventListener when the activity is paused.

    Copy Code

    @Override

    protected void onPause()

    {

    super.onPause();

    sensorManager.unregisterListener(this);

    }

    The main action occurs in the following onSensorChanged() method. The onSensorChanged() method gets executed whenever sensor values have changed.

    Copy Code

    @Override

    public void onSensorChanged(SensorEvent event)

    {

    float degree=Math.round(event.values[0]);

    txtDegrees.setText("Rotation: "+Float.toString(degree)+"degrees");

    RotateAnimation ra=new RotateAnimation(currentDegree,-degree,Animation.RELATIVE_TO_SELF,0.5f,Animation.RELATIVE_TO_SELF,0.5f);

    ra.setDuration(120);

    ra.setFillAfter(true);

    imgCompass.startAnimation(ra);

    currentDegree=-degree;

    }

    In the above code, the SensorEvent is the parameter to the onSensorChanged() method.

    The degree of rotation is determined by the code float degree=Math.round(event.values[0]); and is displayed on the TextView using the setText() method.

    The size and data of the values array depends on the sensor type.

    In case of the orientation sensor, the values array contains the following values:

    values[0]: Angle between the magnetic north direction and the y-axis around the z-axis (0 to 359), where 0=North, 90=East, 180=South, 270=West.

    values[1]: Rotation around x-axis (-180 to 180), with positive values when the z-axis moves towards the y-axis.

    values[2]: Rotation around x-axis, (-90 to 90), increasing as the device moves clockwise.

    After that a RotateAnimation object is used to rotate the compass as the device is rotated. The constructor of the RotateAnimation class takes the following parameters:

    fromDegrees: Rotation offset at the start of the animation.

    toDegrees: Rotation offset at the end of the animation.

    pivotXType: Interpretation of pivotXValue. Can be Animation.ABSOLUTE, Animation.RELATIVE_TO_SELF or Animation.RELATIVE_TO_PARENT.

    pivotXValue: X coordinate of the point about which the object is being rotated.

    pivotYType: Interpretation of pivotYValue. Can be Animation.ABSOLUTE, Animation.RELATIVE_TO_SELF or Animation.RELATIVE_TO_PARENT.

    pivotYValue: Y coordinate of the point about which the object is being rotated.

    The setDuration() method of the Animation class is used to specify the duration in milliseconds for which the animation should last.

    The setFillAfter() method of the Animation class is used to persist the transformation produced by this animation.

    The startAnimation() method of the Animation class is used to start the animation.

    Finally, the currentDegree is updated with the value of -degree so that the next animation will start from the new position.

    The following function is not used but is required to be specified because our activity class implements the SensorEventListener interface:

    Copy Code

    @Override

    public void onAccuracyChanged(Sensor p1, int p2)

    {

    }

    Following is the output of the execution of the compass app on my Samsung Galaxy Note 3 Neo mobile:

    fe554079bcfdd355f305524f0e8a85ed.png

    Points of Interest

    I hope this article will help readers in understanding how easy it is to create our own compass app.

    展开全文
  • - starting compass - starting talking compass function - switching to another app or blanking the screen by pressing the power button - switching back to c:geo - now the compass is frozen and does not...
  • compass_使用详解.pdf compass_教程 compass_试用案例。
  • 样品罗盘 此应用程序演示了 Compass Cordova API 的用法。 有关更多信息,请参阅。
  • the Compass

    2014-10-29 17:44:10
    this resourse is about compass, if you need more information about it, palease contact me.
  • Compass-开源

    2021-06-08 16:40:13
    Compass 框架以声明方式为您的应用程序堆栈启用了搜索引擎语义的强大功能。 Compass 建立在令人惊叹的 Lucene 搜索引擎之上,无缝集成到流行的开发框架,如 Hibernate 和 Spring。
  • MongoDB compass 1.12.4

    2018-03-30 13:49:43
    MongoDB compass 1.12.4 下载 MongoDB 图形界面管理工具
  • compass2000 汉化

    2018-05-04 20:07:31
    compass软件,定向井专用。里面含有汉化包。直接安装复制汉化包可以使用。
  • Compass config

    2020-12-09 00:28:34
    <div><p>Is it possible to configure compass in my wagon project?</p><p>该提问来源于开源项目:locomotivecms/wagon</p></div>
  • mongodb-compass

    2020-07-14 23:59:49
    mongodb-compass,mongo可视化工具!
  • Compass 扩展支持使用 Sass 创建 WordPress 主题和使用 WordPress 主题框架。 安装 假设您没有安装 Haml 或 Compass。 sudo gem install gemcutter gem tumble sudo gem haml sudo gem install compass sudo ...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 23,949
精华内容 9,579
关键字:

compass