精华内容
下载资源
问答
  • 定义一个Dog类,包括体重和年龄两个数据成员及其成员函数,声明一个实例dog1,体重5,年龄10,使用I/O流把dog1的状态写入磁盘文件。再声明一个实例dog2,通过读取文件dog1的状态赋给dog2。分别用文本方式和二进制...

    定义一个Dog类,包括体重和年龄两个数据成员及其成员函数,声明一个实例dog1,体重5,年龄10,使用I/O流把dog1的状态写入磁盘文件。再声明一个实例dog2,通过读取文件dog1的状态赋给dog2。分别用文本方式和二进制方式操作文件。

    #include<iostream>
    #include<fstream>
    using namespace std;
    class Dog{
    public:
    	int getdoga(){return a;}	
    	int getdogw(){return w;}
    void setdog(int x,int y){a=x;w=y;}
    private:
    	int a,w;
    };
    
    int main(){
    	int v1,v2;
    Dog dog1;
    dog1.setdog(10,5);
    ofstream
    	outFile("outfile.txt",ios::out);
    outFile<<dog1.getdoga()<<" "<<dog1.getdogw();
    outFile.close();
    Dog dog2;
    
    ifstream
    	inFile("outfile.txt",ios::in);
    inFile>>v1;inFile.seekg(1,ios::cur);inFile>>v2;
    dog2.setdog(v1,v2);
    outFile.close();
    
    cout<<"dog1's age:"<<dog1.getdoga()<<endl;
    cout<<"dog1's weight:"<<dog1.getdogw()<<endl;
    cout<<"dog2's age:"<<dog2.getdoga()<<endl;
    cout<<"dog2's weight:"<<dog1.getdogw()<<endl;
    
    }
    
    
    
    展开全文
  • dog

    2011-11-30 21:55:58
    Android 开机会出现3个画面: ...2. Android平台启动初始化,出现"A N D R I O D"文字字样画面; 3. Android平台图形系统启动,出现含闪动的ANDROID字样的动画图片(start)。 1、开机图片(Linux小企鹅) (Andr
    Android 开机会出现3个画面:
    1. Linux 系统启动,出现Linux小企鹅画面(reboot)(Android 1.5及以上版本已经取消加载图片);
    2. Android平台启动初始化,出现"A N D R I O D"文字字样画面;
    3. Android平台图形系统启动,出现含闪动的ANDROID字样的动画图片(start)。

    1、开机图片(Linux小企鹅) (Android 1.5及以上版本已经取消加载图片);
    Linux Kernel引导启动后,加载该图片。
    logo.c中定义nologo,在fb_find_logo(int depth)函数中根据nologo的值判断是否需要加载相应图片。
    代码如下:
    static int nologo;
    module_param(nologo, bool, 0);
    MODULE_PARM_DESC(nologo, "Disables startup logo");
    /* logo's are marked __initdata. Use __init_refok to tell
    * modpost that it is intended that this function uses data
    * marked __initdata.
    */
    const struct linux_logo * __init_refok fb_find_logo(int depth)
    {
    const struct linux_logo *logo = NULL;
    if (nologo)
    return NULL;
            ......
    }
    相关代码:
    /kernel/drivers/video/fbmem.c
    /kernel/drivers/video/logo/logo.c
    /kernel/drivers/video/logo/Kconfig
    /kernel/include/linux/linux_logo.h

    2、开机文字("A N D R I O D")
    Android 系统启动后,init.c中main()调用load_565rle_image()函数读取/initlogo.rle(一张565 rle压缩的位图),如果读取成功,则在/dev/graphics/fb0显示Logo图片;如果读取失败,则将/dev/tty0设为TEXT模式,并打开/dev/tty0,输出文本“A N D R I O D”字样。
    定义加载图片文件名称
    #define INIT_IMAGE_FILE "/initlogo.rle"
    int load_565rle_image( char *file_name );
    #endif
    init.c中main()加载/initlogo.rle文件。

    if( load_565rle_image(INIT_IMAGE_FILE) ) {//加载initlogo.rle文件
        fd = open("/dev/tty0", O_WRONLY);//将/dev/tty0设为text模式
        if (fd >= 0) {
            const char *msg;
                msg = "\n"
            "\n"
            "\n"
            "\n"
            "\n"
            "\n"
            "\n"  // console is 40 cols x 30 lines
            "\n"
            "\n"
            "\n"
            "\n"
            "\n"
            "\n"
            "\n"
            "             A N D R O I D ";
            write(fd, msg, strlen(msg));
            close(fd);
        }
    }
    相关代码:
    /system/core/init/init.c
       
    /system/core/init/init.h
    /system/core/init/init.rc
    /system/core/init/logo.c
    *.rle文件的制作步骤:
    a. 使用GIMP或者Advanced Batch Converter软件,将图象转换为RAW格式;
    b. 使用android自带的rgb2565工具,将RAW格式文件转换为RLE格式(如:rgb2565 -rle < initlogo.raw > initlogo.rle)。


    3、开机动画(闪动的ANDROID字样的动画图片)
    Android 1.5版本:Android的系统登录动画类似于Windows系统的滚动条,是由前景和背景两张PNG图片组成,这两张图片存在于手机或模拟器/system/framework /framework-res.apk文件当中,对应原文件位于/frameworks/base/core/res/assets/images/。前景图片(android-logo-mask.png)上的Android文字部分镂空,背景图片(android-logo-shine.png)则是简单的纹理。系统登录时,前景图片在最上层显示,程序代码(BootAnimation.android())控制背景图片连续滚动,透过前景图片文字镂空部分滚动显示背景纹理,从而实现动画效果。
    相关代码:
    /frameworks/base/libs/surfaceflinger/BootAnimation.h
    /frameworks/base/libs/surfaceflinger/BootAnimation.cpp
    /frameworks/base/core/res/assets/images/android-logo-mask.png  Android默认的前景图片,文字部分镂空,大小256×64
    /frameworks/base/core/res/assets/images/android-logo-shine.png Android默认的背景图片,有动感效果,大小512×64

    Android 1.6及以上版本:
    init.c解析init.rc(其中定义服务:“service bootanim /system/bin/bootanimation”),bootanim 服务由SurfaceFlinger.readyToRun()(property_set("ctl.start", "bootanim");)执行开机动画、bootFinished()(property_set("ctl.stop", "bootanim");)执行停止开机动画。
    BootAnimation.h和BootAnimation.cpp文件放到了/frameworks/base/cmds/bootanimation目录下了,增加了一个入口文件bootanimation_main.cpp。Android.mk文件中可以看到,将开机动画从原来的SurfaceFlinger里提取出来了,生成可执行文件:bootanimation。Android.mk代码如下:
    //=============Android.mk======================
    LOCAL_PATH:= $(call my-dir)
    include $(CLEAR_VARS)
    LOCAL_SRC_FILES:= \
        bootanimation_main.cpp \
        BootAnimation.cpp
    # need "-lrt" on Linux simulator to pick up clock_gettime
    ifeq ($(TARGET_SIMULATOR),true)
        ifeq ($(HOST_OS),linux)
            LOCAL_LDLIBS += -lrt
        endif
    endif
    LOCAL_SHARED_LIBRARIES := \
        libcutils \
        libutils \
        libui \
        libcorecg \
        libsgl \
        libEGL \
        libGLESv1_CM \
        libmedia  
    LOCAL_C_INCLUDES := \
        $(call include-path-for, corecg graphics)
    LOCAL_MODULE:= bootanimation
    include $(BUILD_EXECUTABLE)
    //==========================================
    (1)adb shell后,可以直接运行“bootanimation”来重新看开机动画,它会一直处于动画状态,而不会停止。
    (2)adb shell后,命令“setprop ctl.start bootanim”执行开机动画;命令“getprop ctl.start bootanim”停止开机动画。这两句命令分别对应SurfaceFlinger.cpp的两句语句:property_set("ctl.start", "bootanim");和property_set("ctl.stop", "bootanim");
    相关文件:
    /frameworks/base/cmds/bootanimation/BootAnimation.h
    /frameworks/base/cmds/bootanimation/BootAnimation.cpp
    /frameworks/base/cmds/bootanimation/bootanimation_main.cpp
    /system/core/init/init.c
    /system/core/rootdir/init.rc
    参考文档:
    图说Android开机画面和开机动画
    http://www.shudoo.com/09/1030/15/13418431.html
    initlogo.rle: display an image on boot
    http://forum.xda-developers.com/showthread.php?t=443431

    分析Android 根文件系统启动过程(init守护进程分析)
    http://crazier9527.iteye.com/blog/454635
    展开全文
  • Dog Names-crx插件

    2021-04-07 12:54:56
    可爱的狗名字999+最受欢迎的狗名字。 为您的新狗寻找完美的名字吗?...在这里,我们有男孩狗名,女性狗名,女孩狗名,男性狗名,可爱狗名,小狗名,A o Z格式的唯一狗名,您也可以轻松复制狗名。 语言:English
  • Person owns Dog...

    2019-10-07 10:58:39
    http://www.aspectprogrammer.org/blogs/adrian/2004/05/person_owns_dog.html 实际上,我一直在找寻这样的一个例子来说明类的应该就是一个独立的个体,不应该其他无关系的类有联系,今天看到...There's a famous O...

    http://www.aspectprogrammer.org/blogs/adrian/2004/05/person_owns_dog.html

    实际上,我一直在找寻这样的一个例子来说明类的应该就是一个独立的个体,不应该其他无关系的类有联系,今天看到这篇文章,一句话:正和我意!

    Person owns Dog...

    May 28, 2004

    There's a famous OO problem involving people and dogs that I first learnt about in Meilir Page-Jones' excellent book "Fundamentals of Object-Oriented Design in UML." It involves a class Person, with an attribute numOfDogsOwned and a simple accessor method getNumDogsOwned(). The argument goes that this may not neccessarily be good design, since Person and Dog are distinct concepts, and dog ownership is not an essential property of being a person.

    Page-Jones calls this mixed-role cohesion, and he explains the problem better than I can: "What if you wanted to reuse Person in an application that had no dogs? You could do so, but you'd have extra, useless baggage from the class, and you might get some pesky warnings about missing dogs from your compiler (or linker). And where should we stop with this design philosophy? Why not include these attributes in Person: numOfCarsOwned, numOfBoatsOwned, numOfCatsOwned, numOfFrogsOwned,... ?"

    It's an interesting problem, because there's no perfect solution in OO - Page-Jones discusses the pros and cons of four possible solutions including just adding the members directly to Person, using a PersonDogOwnership relationship class, using an abstract mix-in class, and using aggregation. Mixed-role cohesion sounds like the kind of problem that inter-type declarations in AspectJ should be able to help us address, so here's the world's first (AFAIK) aspect-oriented solution to the person-owns-dog problem:

    /** * not a dog in sight... */ public class Person { private String lastName; private Address address; ... public String getLastName() { return lastName; } ... }

    Some of you will have heard me use my adverb/adjective analogy for aspects before, and that's exactly what we've got here. We want to create a dog-owning person, which we could do by creating a DogOwningPerson class (a bit like creating a new noun), but dog-owning isn't limited to people, maybe an Organisation can own dogs too? What we've got is a concept (a compound adjective, dog-owning) that stands in its own right independent of any one class, and that could be applied to many different classes. I'm thinking interface, and I'm thinking aspect...

    /** * not a person in sight... */ public aspect DogOwnership { public interface IDogOwner {}; private int IDogOwner.numDogsOwned; public int IDogOwner.getNumDogsOwned() { return numDogsOwned; } }

    This aspect represents in a single module the concept of dog ownership. It defines an IDogOwner interface (it doesn't have to be an inner-interface, but making it so helps to keep the whole thing together), and uses inter-type declarations to define a numDogsOwned attribute and a getNumDogsOwned() method on behalf of all dog owners.

    We still haven't quite got to person-owns-dog - I wanted to keep the concept of dog ownership independent of any one kind of dog owner. If we have an application where we need person-owns-dog, we can write the following:

    public aspect PersonOwnsDog { declare parents : Person implements DogOwnership.IDogOwner; }

    I like this solution because Person and DogOwnership are independently reusable, and represent cohesive abstractions in their own right. The PersonOwnsDog aspect that binds the two together is also very clear and simple.

    With these aspects in place, you could call the getNumDogsOwned method on a Person as follows:

    Person person = new Person(); person.getNumDogsOwned();

     

    this will compile happily and execute without any problems. If ever you build the application without the PersonOwnsDog aspect though, you'll get a compile-time error about missing dogs. If you don't want that to happen, you could code the client this way (and I probably would in this particular circumstance):

    ... if (person instanceof DogOwnership.IDogOwner) { ((DogOwnership.IDogOwner)person).getNumDogsOwned(); } ...

     

    but it's just a matter of personal taste, the compiler doesn't require it.

    Posted by adrian at May 28, 2004 12:21 PM [permalink]

    转载于:https://www.cnblogs.com/Dabay/archive/2006/10/17/PersonOwnsDog.html

    展开全文
  • 1 Object o = myArrayList.get(0)...2 Dog d1 = (Dog) o; //将类型转换成Dog 3 d1.eat(); 4 if (o instanceof Dog) { 5 Dog d2 = (Dog) o; 6 d2.eat(); 7 } 转载于:https://www.cnblogs.com/popjohn/p/3314...
    1 Object o = myArrayList.get(0);
    2 Dog d1 = (Dog) o; //将类型转换成Dog
    3 d1.eat();
    4 if (o instanceof Dog) {
    5    Dog d2 = (Dog) o;
    6    d2.eat();
    7 }

     

    转载于:https://www.cnblogs.com/popjohn/p/3314679.html

    展开全文
  • LOG和DOG的差别

    千次阅读 2014-09-22 18:51:52
    【计算机视觉】SIFT中LoG和DoG比较 在实际计算时,三种方法计算的金字塔组数noctaves,尺度空间坐标σ,以及每组金字塔内的层数S是一样的。同时,假设图像为640*480的标准图像。 金字塔层数: 其中...
  • watch dog 应用层接口

    2013-05-31 15:09:12
    watch dog驱动编写好后,通过下面的API来操作看门狗: 打开看门狗设备:  fd = open("/dev/watchdog", O_WRONLY); 关闭看门狗功能 //flags = WDIOS_DISABLECARD; //ioctl(fd, WDIOC_SETOPTIONS, &flags)
  • !... wifidog运行时出现的错误,请求大牛分析一下是...当我单独执行iptables -t filter -A WiFiDog_wlan0_Internet -o ettcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu命令时,会报bad argument "SYN,RST"的错误
  • hdu 5449 Robot Dog(期望+lca)

    千次阅读 2015-09-29 16:09:34
    hdu 5449 Robot Dog解题思路n有50000,询问次数有100,每次询问的路径点数最多有100,对于不同询问去做动态规划,开一个dp[u][i]dp[u][i]表示在第u个节点匹配了i个的期望,显然最坏情况下dp数组的每个状态都要遍历到...
  • The Bluedog version has 3 engine modules, one using stock LF/O, one using kerolox, and one using kerolox + HTP.</p><p>该提问来源于开源项目:KSP-RO/RealismOverhaul</p></div>
  • <div><p>This commit adds a new command ... I/O performance, multicore scalability). <p>Signed-off-by: Hitoshi Mitake mitake.hitoshi.ntt.co.jp</p><p>该提问来源于开源项目:sheepdog/sheepdog</p></div>
  • 已知字母序列【d, g, e, c, f, b, o, a】,请实现一个函数针对输入的一组字符串 input[] = {"bed", "dog", "dear", "eye"},按照字母顺序排序并打印。 本例的输出顺序为:dear, dog, eye, bed。 #...
  • SIFT中LoG和DoG比较

    2018-03-12 11:20:44
    原博客地址:http://blog.csdn.net/xiaowei_cqu/article/details/27692123在实际计算时,三种方法...金字塔层数:其中o_min = 0,对于分辨率为640*480的图像N=5。每组金字塔内图像数:S=3,即在做极值检测时使用金...
  • 现场esina o公交车上的susprópriosustento,buscando se alimentar,se refrescar,tomar seu banho e fazer suas necessidades de forma inteligentetambémtreinaria por meio de图像上的音频和音频从虚拟动物中...
  • Just open Dog's Life PAL, start a new game and after the intro sequence it immediatly crashes. (when the game enter Smell-O-Vision) This doesn't happen with internal resolution set to 1x - 3x,...
  • 【计算机视觉】SIFT中LoG和DoG比較 在实际计算时,三种方法计算的金字塔组数noctaves,尺度空间坐标σ,以及每组金字塔内的层数S是一样的。同一时候,如果图像为640*480的标准图像。金字塔层数:...
  • │ Current version: O1126A │ Update Error: No vendor ID set │ GUIDs: c412ef5c-5ac6-50c8-878c-1ce86250a59d │ b484bd6a-4236-5b2b-8746-1fa2b5fc9cac │ 3cffb78c-f0a0-5f55-8e40-5535137af6c8 │ Device ...
  • http://twvideo01.ubm-us.net/o1/vault/gdc2015/presentations/Gyrling_Christian_Parallelizing_The_Naughty.pdf</p> <p><strong>NOTE:</strong> Engine should still work and be compatible with non-fibered/...
  • doggo是用Golang编写的现代命令行DNS客户端(例如dig)。 它以简洁简洁的方式输出信息,并且还支持DoH,DoT等协议。 doggo human人类的命令行DNS客户端doggo是用Golang编写的现代命令行DNS客户端(例如...特点易读的o
  • 在实际计算时,三种方法计算的金字塔组数noctaves,尺度空间坐标σ,以及每组金字塔内的层数S是一样的。同时,假设图像为640*480的标准...其中o_min = 0,对于分辨率为640*480的图像N=5。 每组金字塔内图像数:S=...
  • 【图像算法】SIFT中LoG和DoG比较

    千次阅读 2016-01-26 20:35:59
    转载自: 小魏的修行路 ...其中o_min = 0,对于分辨率为640*480的图像N=5。每组金字塔内图像数: S=3,即在做极值检测时使用金子塔内中间3张图像。 对于LoG每组金字塔内有S+2张图像(S=-1,0,1,2,
  • linux中chmod更改文件权限命令...其中的 u、g、o 分别代表的就是 user、group、others,"+"代表赋予权限,x (executable)代表可执行权。 2、sudo chmod 777 代表什么: 三位数字分别代表 user、group、others 的权...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 496
精华内容 198
关键字:

dogo