emplateName) {
            CONTRACT_TP_NAME_JAVA -> createContractTemplate(templateName, "java", TemplateCons.CONTRACT_TP_CONTENT_JAVA)
            CONTRACT_TP_NAME_KOTLIN -> createContractTemplate(templateName, "kt", TemplateCons.CONTRACT_TP_CONTENT_KOTLIN)
            CONTRACT_TP_NO_MODEL_NAME_JAVA -> createContractTemplate(templateName, "java", TemplateCons.CONTRACT_TP_CONTENT_NO_MODEL_JAVA)
            CONTRACT_TP_NO_MODEL_NAME_KOTLIN -> createContractTemplate(templateName, "kt", TemplateCons.CONTRACT_TP_CONTENT_NO_MODEL_KOTLIN)
            VIEW_IMPL_TP_ACTIVITY_JAVA -> createContractTemplate(templateName, "java", TemplateCons.COMMON_IMPL_TP_CONTENT_JAVA)
            VIEW_IMPL_TP_FRAGMENT_JAVA -> createContractTemplate(templateName, "java", TemplateCons.COMMON_IMPL_TP_CONTENT_JAVA)
            PRESENTER_IMPL_TP_JAVA -> createContractTemplate(templateName, "java", TemplateCons.COMMON_IMPL_TP_CONTENT_JAVA)
            MODEL_IMPL_TP_JAVA -> createContractTemplate(templateName, "java", TemplateCons.COMMON_IMPL_TP_CONTENT_JAVA)
            VIEW_IMPL_TP_ACTIVITY_KOTLIN -> createContractTemplate(templateName, "kt", TemplateCons.COMMON_IMPL_TP_CONTENT_KOTLIN)
            VIEW_IMPL_TP_FRAGMENT_KOTLIN -> createContractTemplate(templateName, "kt", TemplateCons.COMMON_IMPL_TP_CONTENT_KOTLIN)
            PRESENTER_IMPL_TP_KOTLIN -> createContractTemplate(templateName, "kt", TemplateCons.COMMON_IMPL_TP_CONTENT_KOTLIN)
            MODEL_IMPL_TP_KOTLIN -> createContractTemplate(templateName, "kt", TemplateCons.COMMON_IMPL_TP_CONTENT_KOTLIN)
        }

        return if (cacheTemplate.containsKey(templateName)) cacheTemplate[templateName] as FileTemplate else null
    }

}

package com.longforus.apidebugger

import com.google.gson.GsonBuilder
import com.longforus.apidebugger.bean.ApiBean
import com.longforus.apidebugger.bean.ProjectBean
import com.longforus.apidebugger.encrypt.DefaultEncryptHandler
import com.longforus.apidebugger.encrypt.IEncryptHandler
import java.awt.Toolkit
import java.awt.datatransfer.StringSelection

/**
 * Created by XQ Yang on 8/30/2018  5:24 PM.
 * Description :
 */

object MyValueHandler {

    val encryptImplList = listOf<IEncryptHandler>( DefaultEncryptHandler())
//    val encryptImplList = listOf<IEncryptHandler>( DefaultEncryptHandler())
    val mGson =GsonBuilder().setPrettyPrinting().disableHtmlEscaping().create()

    var curProject: ProjectBean? = null
        set(value) {
            if (value == field) {
                return
            }
            field = value
            value?.let {
                UILifecycleHandler.initProject(it, mainPanel)
            }
        }

    var curApi: ApiBean? = null
     set(value) {
         if (value == field) {
             return
         }
         field = value
         UILifecycleHandler.initApi(value)
     }

    var curBaseUrl = ""
    var curShowJsonStr   = ""

    fun encryptId2Index(id: Int): Int {
        encryptImplList.forEachIndexed { index, iEncryptHandler ->
            if (iEncryptHandler.typeCode == id) {
                return index
            }
        }
        return 0
    }
    fun encryptIndex2Id(index: Int)=encryptImplList[index].typeCode

    /**
     * 将字符串复制到剪切板。
     */
    fun setSysClipboardText(writeMe: String) {
        val clip = Toolkit.getDefaultToolkit().systemClipboard
        val tText = StringSelection(writeMe)
        clip


call    @std@#__distance.#move_iterator.ppc~~.q#move_iterator.ppc~#move_iterator.ppc~31@std@random_access_iterator_tag ; std::__distance<move_iterator<char**>>(move_iterator<char**>, move_iterator<char**>, std::random_access_iterator_tag)
        mov     ebx,eax
        lea     eax,[esp-04h+014h]
        push    eax
        call    @std@input_iterator_tag@.bdtr.qv ; std::input_iterator_tag::~input_iterator_tag()
        add     esp,byte 04h
L_145043:
L_145030:
L_145017:
        add     esp,byte 0ch
L_145059:
L_145073:
        mov     eax,ebx
; Line 701: }
L_145087:
L_145101:
L_144954:
        pop     ebx
        pop     ecx
        ret
section code
section code
        section vsc@std@#move_iterator.ppc~@.bctr.qrx#move_iterator.ppc~ virtual
        [bits 32]
; std::move_iterator<char**>::move_iterator( const move_iterator<char**>&)
@std@#move_iterator.ppc~@.bctr.qrx#move_iterator.ppc~:
L_145107:
        mov     ecx,dword [esp+08h]
        mov     eax,dword [esp+04h]
        mov     ecx,dword [ecx]
        mov     dword [eax],ecx
L_145108:
        ret
section code
section code
        section vsc@std@#__split_buffer.pcr#allocator.pc~~@_ConstructTransaction@.bdtr.qv virtual
        [bits 32]
; std::__split_buffer<char*, allocator<char*>&>::_ConstructTransaction::~_ConstructTransaction()
@std@#__split_buffer.pcr#allocator.pc~~@_ConstructTransaction@.bdtr.qv:
L_145115:
        mov     eax,dword [esp+04h]
; Line 170:         *__dest_ = __pos_;
        mov     ecx,dword [eax]
        mov     eax,dword [eax+08h]
        mov     dword [eax],ecx
; Line 171:       }
L_145116:
        ret
section code
section code
        section vsc@std@#allocator_traits.#allocator.pc~~@#__construct.pcpc~.q#integral_constant.4booln0?1?~r#allocator.pc~ppcRpc virtual
        [bits 32]
; std::allocator_traits<allocator<char*>>::__construct<char*, char*>(integral_constant<bool, bool=1>, allocator<char*>&, char**, char*&&)
@std@#allocator_traits.#allocator.pc~~@#__construct.pcpc~.q#integral_constant.4booln0?1?~r#allocator.pc~ppcRpc:
        push    ebp
        mov     ebp,esp
        add     esp,byte 0ffffffa0h
L_145123:
        mov     eax,dword [ebp+014h]
        mov     ecx,dword [ebp+010h]
        push    eax
        mov     eax,dword [fs:00h]
        mov     dword [ebp-048h],eax
        mov     dword [ebp-048h+04h],___cppexceptionhandle
        mov     dword [ebp-048h+08h],esp
        mov     dword [ebp-048h+0ch],ebp
        mov     dword [ebp-048h+010h],@.xc@std@#allocator_traits.#allocator.pc~~@#__construct.pcpc~.q#integral_constant.4booln0?1?~r#allocator.pc~ppcRpc
        mov     dword [ebp-


116360f,
                -0.9554812534f, -0.2950518163f,
                -0.9624344144f, -0.2715142685f,
                -0.9688078409f, -0.2478131705f,
                -0.9745976937f, -0.2239627992f,
                -0.9798004853f, -0.1999775211f,
                -0.9844130818f, -0.1758717840f,
                -0.9884327046f, -0.1516601083f,
                -0.9918569325f, -0.1273570782f,
                -0.9946837029f, -0.1029773330f,
                -0.9969113131f, -0.0785355581f,
                -0.9985384211f, -0.0540464763f,
        };

        /**
         * The 32 vertices of a rhombic triacontahedron,
         * normalized to lie on the unit sphere in 3D.
         * Each point is stored in 3 floats, and there is 1 float of padding after each point
         * (to allow easier access to points using bitwise operations). The distance from each
         * point to the origin should be 1.0, subject to rounding error.
         *

         * The points were randomly rotated to try to avoid correlation on any typical axis; all points used the same
         * rotation to keep their distance to each other and shape. Each group of 32 vertices is repeated 8 times, each time
         * shuffled differently within that group. That means this holds 256 points, with 8 repeats of each point included
         * in that. If you only look at the first 32 points, each point will be unique.
         *

         * This particular set of 32 gradient vectors is either optimal or very close to optimal for a power-of-two-sized
         * set of vectors (except for very small sets like the vertices of a tetrahedron).
         */
        public static final float[] GRADIENTS_3D = {
                -0.0752651785f, -0.7150730443f, +0.6949861108f, 0.0f,
                +0.3108026609f, +0.8973122849f, +0.3134204354f, 0.0f,
                -0.2868654574f, +0.8018987923f, +0.5240863825f, 0.0f,
                +0.8054770269f, -0.3120841869f, -0.5037958113f, 0.0f,
                +0.1282915969f, -0.1762626708f, +0.9759470975f, 0.0f,
                -0.5488958567f, -0.2924528438f, +0.7830610913f, 0.0f,
                +0.6888417674f, +0.0066053064f, +0.7248816383f, 0.0f,
                -0.1262089260f, +0.9809321878f, -0.1477949592f, 0.0f,
                +0.2902352898f, +0.5000838360f, +0.8158919252f, 0.0f,
                -0.5501830181f, -0.7897659550f, +0.2712349220f, 0.0f,
                -0.9653400724f, +0.1883955081f, -0.1806257930f, 0.0f,
                +0.9255483484f, +0.2703878154f, -0.2650484559f, 0.0f,
                +0.0752651785f, +0.7150730443f, -0.6949861108f, 0.0f,
                -0.8075596979f, -0.4925853301f, -0.32


 add_alias(&mut self, name: &str, value: &str) {
        self.alias.insert(name.to_string(), value.to_string());
    }
    */
    pub fn get_alias_content(&self, name: &str) -> Option<String> {
        let mut result;
        match self.alias.get(name) {
            Some(x) => {
                result = x.to_string();
            }
            None => {
                result = String::new();
            }
        }
        tools::pre_handle_cmd_line(self, &mut result);
        if result.is_empty() {
            None
        } else {
            Some(result)
        }
    }
}

/**
pub unsafe fn give_terminal_to(gid: i32) -> bool {
    let mut mask: libc::sigset_t = mem::zeroed();
    let mut old_mask: libc::sigset_t = mem::zeroed();

    libc::sigemptyset(&mut mask);
    libc::sigaddset(&mut mask, libc::SIGTSTP);
    libc::sigaddset(&mut mask, libc::SIGTTIN);
    libc::sigaddset(&mut mask, libc::SIGTTOU);
    libc::sigaddset(&mut mask, libc::SIGCHLD);

    let rcode = libc::pthread_sigmask(libc::SIG_BLOCK, &mask, &mut old_mask);
    if rcode != 0 {
        log!("failed to call pthread_sigmask");
    }
    let rcode = libc::tcsetpgrp(1, gid);
    let given;
    if rcode == -1 {
        given = false;
        let e = errno();
        let code = e.0;
        log!("Error {}: {}", code, e);
    } else {
        given = true;
    }
    let rcode = libc::pthread_sigmask(libc::SIG_SETMASK, &old_mask, &mut mask);
    if rcode != 0 {
        log!("failed to call pthread_sigmask");
    }
    given
}
**/

pub fn extend_env_blindly(sh: &Shell, token: &str) -> String {
    let re;
    if let Ok(x) = Regex::new(r"([^\$]*)\$\{?([A-Za-z0-9\?\$_]+)\}?(.*)") {
        re = x;
    } else {
        println!("cicada: re new error");
        return String::new();
    }
    if !re.is_match(token) {
        return token.to_string();
    }
    let mut result = String::new();
    let mut _token = token.to_string();
    let mut _head = String::new();
    let mut _output = String::new();
    let mut _tail = String::new();
    loop {
        if !re.is_match(&_token) {
            if !_token.is_empty() {
                result.push_str(&_token);
            }
            break;
        }
        for cap in re.captures_iter(&_token) {
            _head = cap[1].to_string();
            _tail = cap[3].to_string();
            let _key = cap[2].to_string();
            if _key == "?" {
                result.push_str(format!("{}{}", _head, sh.previous_status).as_str());
            } else if _key == "$" {
                unsafe {
                    let val = libc::getpid();
                    result.push_str(format!("{}{}", _head, val).as_str());
                }
            } else if let Ok(val) = env::var(_key) {
                result.push_str(format!("{}{}", _head, val).as_str());
            } else {
                result.push_str(&_head);
            }
        }
        if _tail.is_empty() {
            break;
        }
        _token = _tail.clone();


                 │   ├─ Eq\n" +
			"     │                   │   │   ├─ uv.v:4\n" +
			"     │                   │   │   └─ xy2.x:0!null\n" +
			"     │                   │   └─ Eq\n" +
			"     │                   │       ├─ uv.v:4\n" +
			"     │                   │       └─ xy.x:2!null\n" +
			"     │                   └─ Table\n" +
			"     │                       ├─ name: uv\n" +
			"     │                       ├─ columns: [v]\n" +
			"     │                       ├─ colSet: (5,6)\n" +
			"     │                       └─ tableId: 3\n" +
			"     ├─ TableAlias(xy2)\n" +
			"     │   └─ ProcessTable\n" +
			"     │       └─ Table\n" +
			"     │           ├─ name: xy\n" +
			"     │           └─ columns: [x y]\n" +
			"     └─ Table\n" +
			"         ├─ name: xy\n" +
			"         ├─ columns: [x y]\n" +
			"         ├─ colSet: (3,4)\n" +
			"         └─ tableId: 2\n" +
			"",
		ExpectedEstimates: "Sort(xy2.x ASC, xy2.y ASC)\n" +
			" └─ SemiJoin\n" +
			"     ├─ (xy.y = Subquery(select max(v) from uv where uv.v = xy2.x and uv.v = xy.x))\n" +
			"     ├─ TableAlias(xy2)\n" +
			"     │   └─ Table\n" +
			"     │       └─ name: xy\n" +
			"     └─ Table\n" +
			"         └─ name: xy\n" +
			"",
		ExpectedAnalysis: "Sort(xy2.x ASC, xy2.y ASC)\n" +
			" └─ SemiJoin\n" +
			"     ├─ (xy.y = Subquery(select max(v) from uv where uv.v = xy2.x and uv.v = xy.x))\n" +
			"     ├─ TableAlias(xy2)\n" +
			"     │   └─ Table\n" +
			"     │       └─ name: xy\n" +
			"     └─ Table\n" +
			"         └─ name: xy\n" +
			"",
	},
	{
		Query: `select * from (select 'k' as k) sq join bigtable on t = k join xy where x between n and n;`,
		ExpectedPlan: "Project\n" +
			" ├─ columns: [sq.k:0!null, bigtable.t:3!null, bigtable.n:4, xy.x:1!null, xy.y:2]\n" +
			" └─ HashJoin\n" +
			"     ├─ Eq\n" +
			"     │   ├─ bigtable.t:3!null\n" +
			"     │   └─ sq.k:0!null\n" +
			"     ├─ SubqueryAlias\n" +
			"     │   ├─ name: sq\n" +
			"     │   ├─ outerVisibility: false\n" +
			"     │   ├─ isLateral: false\n" +
			"     │   ├─ cacheable: true\n" +
			"     │   ├─ colSet: (2)\n" +
			"     │   ├─ tableId: 1\n" +
			"     │   └─ Project\n" +
			"     �


ive appearance and impressive tusks, whose mission it is to deliver gifts all across Tibia. They are good-natured beings, spreading joy wherever they go, but you best not cross them - a mammoth never forgets.",
				type = GameStore.OfferTypes.OFFER_TYPE_MOUNT,
			},
			{
				icons = { "Festive_Snowman.png" },
				name = "Festive Snowman",
				price = 900,
				id = 135,
				description = "{character}\n{speedboost}\n\nWhen the nights are getting longer and freezing wind brings driving snow into the land, snowmen rise and shine on every corner. Lately, a peaceful, arcane creature has found shelter in one of them and used its magical power to call the Festive Snowman into being. Wrap yourself up well and warmly and jump on the back of your new frosty companion.",
				type = GameStore.OfferTypes.OFFER_TYPE_MOUNT,
			},
			{
				icons = { "Flamesteed.png" },
				name = "Flamesteed",
				price = 900,
				id = 47,
				description = "{character}\n{speedboost}\n\nOnce a majestic and proud warhorse, the Flamesteed has fallen in a horrible battle many years ago. Driven by agony and pain, its spirit once again took possession of its rotten corpse to avenge its death. Stronger than ever, it seeks a master to join the battlefield, aiming for nothing but death and destruction.",
				type = GameStore.OfferTypes.OFFER_TYPE_MOUNT,
			},
			{
				icons = { "Flitterkatzen.png" },
				name = "Flitterkatzen",
				price = 870,
				id = 75,
				description = "{character}\n{speedboost}\n\nRumour has it that many years ago elder witches had gathered to hold a magical feast high up in the mountains. They had crossbred Flitterkatzen to easily conquer rocky canyons and deep valleys. Nobody knows what happened on their way up but only the mount has been seen ever since.",
				type = GameStore.OfferTypes.OFFER_TYPE_MOUNT,
			},
			{
				icons = { "Floating_Augur.png" },
				name = "Floating Augur",
				price = 870,
				id = 155,
				description = "{character}\n{speedboost}\n\nThese creatures are Floating Savants whose mind has been warped and bent to focus their extraordinary mental capabilities on one single goal: to do their master's bidding. Instead of being filled with an endless pursuit of knowledge, their live is now one of continuous thralldom and serfhood. The Floating Sage, the Floating Scholar and the Floating Augur are at your disposal.",
				type = GameStore.OfferTypes.OFFER_TYPE_MOUNT,
			},
			{
				icons = { "Floating_Kashmir.png" },
				name = "Floating Kashmir",
				price = 900,
				id = 67,
				description = "{character}\n{speedboost}\n\nThe Floating Kashmir is the perfect mount for those who are too busy to take care of an animal mount or simply like to travel on a beautiful, magic hand-woven carpet.",
				type = GameStore.OfferTypes.OFFER_TYPE_MOUNT,
			},
			{
				icons = { "Floating_Sage.png" },
				name = "Floating Sage",
				price = 870,
				id = 153,
				description = "{character}\n{speedboost}\n\nThese creatures are Floating Savants whose mind has been warped and bent to focus their extraordinary mental capabilities on one single goal: to do their master's bidding. Instead of being filled with an endless pursuit of knowledge, their live is now one of continuous thralldom and serfhood. The Floating Sage, the Floating Scholar and the Floating Augur are at your disposal.",
				type = GameStore.OfferTypes.OFFER_TYPE_MOUNT,
			},
			{
				icons = { "


636e\u4eba\u6c11\u51fa\u7248\u793e\u4e00\u4e5d\u516d\u56db\u5e74\u516d\u6708\u51fa\u7248\u7684\u300a\u6bdb\u6cfd\u4e1c\u8457\u4f5c\u9009\u8bfb\u300b\u7532\u79cd\u672c\u3002", "type": "paragraph"}]}
  </script>

    [返回索引页面]

   毛泽东在中国共产党全国宣传工作会议上的讲话

   日期：1957-3-12 作者：[待确定]

   各位同志!这次会议开得很好。会议中间提出了很多问题，使我们知道了很多事情。我现在就同志们所讨论的问题讲几点意见。

   我们现在是处在一个社会大变动的时期。中国社会很久以来就处在大变动中间了。抗日战争时期是大变动，解放战争时期也是大变动。但是就性质说来，现在的变动比过去的变动深刻得多。我们正在建设社会主义。有几亿人口进入社会主义的改造运动。全国各个阶级的相互关系都在起变化。农业和手工业方面的小资产阶级和工商业资产阶级，都发生了变化。社会经济制度变化了，个体经济变为集体经济，资本主义私有制正在变为社会主义公有制。这样的大变动当然要反映到人们的思想上来。存在决定意识。在不同的阶级、阶层、社会集团的人们中间，对于这个社会制度的大变动，有各种不同的反映。广大人民群众热烈地拥护这个大变动，因为现实生活证明，社会主义是中国的唯一的出路。推翻旧的社会制度，建立新的社会制度，即社会主义制度，这是一场伟大的斗争，是社会制度和人的相互关系的一场大变动。应该说，情况基本上是健康的。但是，新的社会制度还刚刚建立，还需要有一个巩固的时间。不能认为新制度一旦建立起来就完全巩固了，那是不可能的。需要逐步地巩固。要使它最后巩固起来，必须实现


        val episode = if (guid != null) realm.query(Episode::class).query("identifier == $0", guid).first().find()
        else realm.query(Episode::class).query("downloadUrl == $0", episodeUrl).first().find()
        if (!copy) return episode
        return if (episode != null) realm.copyFromRealm(episode) else null
    }

    fun getEpisodeMedia(mediaId: Long, copy: Boolean = true): Episode? {
        Logd(TAG, "getEpisodeMedia called $mediaId")
        val media = realm.query(Episode::class).query("id == $0", mediaId).first().find()
        if (!copy) return media
        return if (media != null) realm.copyFromRealm(media) else null
    }

    fun deleteEpisodesWarnLocal(context: Context, items: Iterable<Episode>) {
        val localItems: MutableList<Episode> = mutableListOf()
        for (item in items) {
            if (item.feed?.isLocalFeed == true) localItems.add(item)
            else deleteEpisodeMedia(context, item)
        }

        if (localItems.isNotEmpty()) {
            MaterialAlertDialogBuilder(context)
                .setTitle(R.string.delete_episode_label)
                .setMessage(R.string.delete_local_feed_warning_body)
                .setPositiveButton(R.string.delete_label) { dialog: DialogInterface?, which: Int -> for (item in localItems) deleteEpisodeMedia(context, item) }
                .setNegativeButton(R.string.cancel_label, null)
                .show()
        }
    }

    // @JvmStatic is needed because some Runnable blocks call this
    @JvmStatic
    fun deleteEpisodeMedia(context: Context, episode: Episode) : Job {
        Logd(TAG, "deleteMediaOfEpisode called ${episode.title}")
        return runOnIOScope {
            val episode_ = deleteMediaSync(context, episode)
            if (getPref(AppPrefs.prefDeleteRemovesFromQueue, false)) removeFromAllQueuesSync(episode_)
        }
    }

    fun deleteMediaSync(context: Context, episode: Episode): Episode {
        Logd(TAG, "deleteMediaSync called")
        Logd(TAG, String.format(Locale.US, "Requested to delete EpisodeMedia [id=%d, title=%s, downloaded=%s", episode.id, episode.getEpisodeTitle(), episode.downloaded))
        var localDelete = false
        val url = episode.fileUrl
        Logd(TAG, "deleteMediaSync $url")
        var episode = episode
        when {
            url != null && url.startsWith("content://") -> {
                // Local feed
                val documentFile = DocumentFile.fromSingleUri(context, Uri.parse(url))
                if (documentFile == null || !documentFile.exists() || !documentFile.delete()) {
                    Log.e(TAG, "deleteMediaSync delete media file failed: $url")
                    EventFlow.postEvent(FlowEvent.MessageEvent(getAppContext().getString(R.string.delete_local_failed)))
                    return episode
                }
                episode = upsertBlk(episode) {
                    it.setfileUrlOrNull(null)
                    if (it.playState < PlayState.SKIPPED.code) it.playState = PlayState.SKIPPED.code
                }
                EventFlow.postEvent(FlowEvent.EpisodePlayedEvent(episode))
                localDelete = true
            }
            url != null -> {
                // delete downloaded media file
                val path = Uri.parse(url).path
                if (path == null) {
                    EventFlow.postEvent(FlowEvent.MessageEvent(getAppContext().getString(R.string.delete_local_failed)))
                    return


j_cry_compound_interest = {
				name = "Interés compuesto",
				text = {
					"Gana {C:money}#1#%{} de tu dinero total",
					"al final de la ronda,",
					"aumenta por {C:money}#2#%{} por cada",
					"pago consecutivo",
				},
			},
			j_cry_copypaste = {
				name = "Copiar y pegar",
				text = {
					"{C:green}#1# in #2#{} probabilidades de",
					"duplicar cartas de {C:cry_code}código{} usadas",
					"{C:red}Funciona 1 vez por ronda{}",
					"{C:inactive}(debe haber espacio)",
				},
			},
			j_cry_copypaste_modest = {
				name = "Copiar y pegar",
				text = {
					"Duplica las cartas de ",
					"{C:cry_code}código{} tiradas",
					"{C:inactive}(debe haber espacio)",
				},
			},
			j_cry_copypaste_madness = {
				name = "Copiar y pegar",
				text = {
					"{C:green}#1# in #2#{} probabilidades de",
					"duplicar cartas de {C:cry_code}código{} usadas",
					"{C:inactive}(debe haber espacio)",
				},
			},
			j_cry_cotton_candy = {
				name = "Algodón de azúcar",
				text = {
					"Al venderse, los {C:attention}comodines{}",
					"adyacentes se vuelven {C:dark_edition}negativos{}",
				},
			},
			j_cry_crustulum = {
				name = "Crustulum",
				text = {
					"Este comodín gana {C:chips}+#2#{} ficha#<s>2#",
					"por cada {C:attention}renovación{} en la tienda",
					"{C:green}Todas las renovaciones son gratis{}",
					"{C:inactive}(Actual: {C:chips}+#1#{C:inactive} ficha#<s>1#)",
				},
			},
			j_cry_cryptidmoment = {
				name = "Cadena M",
				text = {
					"Vende esta carta para",
					"añadir {C:money}$#1#{} de {C:attention}valor de venta{}",
					"a cada {C:attention}comodín{}",
				},
			},
			j_cry_cube = {
				name = "Cubo",
				text = {
					"{C:chips}+#1#{} ficha#<s>1#",
				},
			},
			j_cry_curse_sob = {
				name = "Sollozo",
				text = {
					"{C:edition,E:1}no puedes{} {C:cry_ascendant,E:1}correr...{}",
					"{C:edition,E:1}no puedes{} {C:cry_ascendant,E:1}esconderte...{}",
					"{C:dark_edition,E:1}no puedes escapar...{}",
					"{C:inactive}(debe haber espacio){}",
				},
				unlock = {
					"Consigue un {C:attention}Obelisco",
					"{C:purple}eterno{}",
				},
			},
			j_cry_cursor = {
				name = "Cursor",
				text = {
					"Este comodín gana {C:chips}+#2#{} ficha#<s>2#",
					"por cada carta {C:attention}comprada{}",
					"{C:inactive}(Actual: {C:chips}+#1#{C:inactive} ficha#<s>1#)",
				},


Text()} this block is too long 110100110", false),
            DiktatError(7, 16, ruleId, "${Warnings.LONG_NUMERICAL_VALUES_SEPARATED.warnText()} this block is too long 01101001", false),
            DiktatError(7, 16, ruleId, "${Warnings.LONG_NUMERICAL_VALUES_SEPARATED.warnText()} this block is too long 10010100", false),
            DiktatError(7, 16, ruleId, "${Warnings.LONG_NUMERICAL_VALUES_SEPARATED.warnText()} this block is too long 10010010", false),
            DiktatError(8, 14, ruleId, "${Warnings.LONG_NUMERICAL_VALUES_SEPARATED.warnText()} 192.312341341344355345", true),
            DiktatError(9, 15, ruleId, "${Warnings.LONG_NUMERICAL_VALUES_SEPARATED.warnText()} this block is too long 31234134134435", false),
            DiktatError(9, 15, ruleId, "${Warnings.LONG_NUMERICAL_VALUES_SEPARATED.warnText()} this block is too long 5345", false)

        )
    }

    @Test
    @Tag(LONG_NUMERICAL_VALUES_SEPARATED)
    fun `check properties test good`() {
        lintMethod(
            """
                    |fun foo() {
                    |   val oneMillion = 1_000_000_000_000
                    |   val creditCardNumber = 1_234_567_890_123_456L
                    |   val socialSecurityNumber = 999_999_999L
                    |   val hexBytes = 0xFF_EC_DE_5E
                    |   val bytes = 0b11_010_010_011_010_011_001_010_010_010_010
                    |   val flo = 192.312_341_341_345
                    |   val ten = 10
                    |}
            """.trimMargin()
        )
    }

    @Test
    @Tag(LONG_NUMERICAL_VALUES_SEPARATED)
    fun `check properties test bad 2`() {
        lintMethod(
            """
                    |fun foo() {
                    |   val oneMillion = 100
                    |   val creditCardNumber = 1234566L
                    |   val socialSecurityNumber = 999L
                    |   val hexBytes = 0xFFE
                    |   val bytes = 0b110100
                    |   val flo = 192.312
                    |}
            """.trimMargin(),
            DiktatError(2, 21, ruleId, "${Warnings.LONG_NUMERICAL_VALUES_SEPARATED.warnText()} 100", true),
            DiktatError(3, 27, ruleId, "${Warnings.LONG_NUMERICAL_VALUES_SEPARATED.warnText()} 1234566L", true),
            DiktatError(4, 31, ruleId, "${Warnings.LONG_NUMERICAL_VALUES_SEPARATED.warnText()} 999L", true),
            DiktatError(5, 19, ruleId, "${Warnings.LONG_NUMERICAL_VALUES_SEPARATED.warnText()} 0xFFE", true),
            DiktatError(6, 16, ruleId, "${Warnings.LONG_NUMERICAL_VALUES_SEPARATED.warnText()} 0b110100", true),
            DiktatError(7, 14, ruleId, "${Warnings.LONG_NUMERICAL_VALUES_SEPARATED.warnText()} 192.312", true),
            rulesConfigList = rulesConfig
        )
    }

    @Test
    @Tag(LONG_NUMERICAL_VALUES_SEPARATED)
    fun `check func params test good`() {
        lintMethod(
            """
                    |fun foo(val one = 100_000_000) {
                    |
                    |}
            """.trimMargin()
        )
    }

    @Test
    @Tag(LONG_NUMERICAL_VALUES_SEPARATED)
    fun `check func params test bad`() {
        lintMethod(
            """


 std::time::Duration;

#[cfg(target_arch = "wasm32")]
use js_sys::Date;
#[cfg(not(target_arch = "wasm32"))]
use std::time::{Instant as SystemInstant, SystemTime, UNIX_EPOCH};

/// Return the current timestamp in seconds
#[cfg(not(target_arch = "wasm32"))]
pub fn get_timestamp() -> u64 {
    SystemTime::now()
        .duration_since(UNIX_EPOCH)
        .unwrap()
        .as_secs()
}
/// Return the current timestamp in seconds
#[cfg(target_arch = "wasm32")]
pub fn get_timestamp() -> u64 {
    let millis = Date::now();

    (millis / 1000.0) as u64
}

#[cfg(not(target_arch = "wasm32"))]
pub(crate) struct Instant(SystemInstant);
#[cfg(target_arch = "wasm32")]
pub(crate) struct Instant(Duration);

impl Instant {
    #[cfg(not(target_arch = "wasm32"))]
    pub fn new() -> Self {
        Instant(SystemInstant::now())
    }
    #[cfg(target_arch = "wasm32")]
    pub fn new() -> Self {
        let millis = Date::now();

        let secs = millis / 1000.0;
        let nanos = (millis % 1000.0) * 1e6;

        Instant(Duration::new(secs as u64, nanos as u32))
    }

    #[cfg(not(target_arch = "wasm32"))]
    pub fn elapsed(&self) -> Duration {
        self.0.elapsed()
    }
    #[cfg(target_arch = "wasm32")]
    pub fn elapsed(&self) -> Duration {
        let now = Instant::new();

        now.0.checked_sub(self.0).unwrap_or(Duration::new(0, 0))
    }
}
<filename>contracts/token/psp22/utils/token_timelock.rs
// Copyright (c) 2012-2022 Supercolony
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the"Software"),
// to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

/// Extension of [`PSP22`] which allows the beneficiary to extract tokens after given time
pub use crate::traits::psp22::utils::token_timelock::*;
use ink_env::CallFlags;

pub use crate::traits::psp22::PSP22Ref;
use brush::{
    declare_storage_trait,
    traits::{
        AccountId,
        Balance,
        Timestamp,
    },
};
pub use derive::PSP22TokenTimelockStorage;
use ink_prelude::vec::Vec;

pub const STORAGE_KEY: [u8; 32] = ink_lang::blake2x256!("brush::PSP22TokenTimelockData");

#[derive(Default, Debug)]
#[brush::storage(STORAGE_KEY)]
pub struct PSP22TokenTimelockData {
    token: AccountId,
    beneficiary: AccountId,
    release_time: Timestamp,
}

declare_storage_trait!(PSP22TokenTimelockStorage, PSP22TokenTimelock


Until(MCExecContext& ctxt, MCStringRef p_sentinel, double p_max_wait, int p_time_units)
{
	MCFilesExecReadFromStdin(ctxt, p_sentinel, 0, 0, p_max_wait, p_time_units, RF_UNTIL);
}

void MCFilesExecReadGetStream(MCExecContext& ctxt, MCNameRef p_name, bool p_is_end, int64_t p_at, bool p_has_at, IO_handle &r_stream, intenum_t &r_encoding, IO_stat &r_stat)
{
	uindex_t t_index;
	if (!IO_findfile(p_name, t_index) || MCfiles[t_index].mode == OM_APPEND
	        || MCfiles[t_index].mode == OM_WRITE)
	{
		ctxt . SetTheResultToStaticCString("file is not open for read");
		return;
	}
	r_stream = MCfiles[t_index].ihandle;
    r_encoding = MCfiles[t_index].encoding;

	if (p_has_at)
    {
		if (p_is_end)
			r_stat = MCS_seek_end(r_stream, p_at);
		else
			r_stat = MCS_seek_set(r_stream, p_at);
	}
    else
        MCS_sync(r_stream);
}

void MCFilesExecReadFromFileOrDriverFor(MCExecContext& ctxt, bool p_driver, bool p_is_end, MCNameRef p_file, int64_t p_at, bool p_has_at, uint4 p_count, int p_unit_type, double p_max_wait, int p_time_units)
{
	IO_handle t_stream = NULL;
    MCFileEncodingType t_encoding;
	IO_stat t_stat = IO_NORMAL;

    MCFilesExecReadGetStream(ctxt, p_file, p_is_end, p_at, p_has_at, t_stream, (intenum_t&)t_encoding, t_stat);

	if (t_stream == NULL)
		return;

	if (t_stat != IO_NORMAL)
	{
		ctxt . SetTheResultToStaticCString("error seeking in file");
		return;
	}

	MCAutoValueRef t_output;

    MCFilesExecReadFor(ctxt, t_stream, -1, p_count, p_unit_type, p_max_wait, p_time_units, t_encoding, &t_output, t_stat);
    MCFilesReadComplete(ctxt, *t_output, t_stat, t_encoding != kMCFileEncodingBinary);

#if !defined _WIN32 && !defined _MACOSX
	MCS_sync(t_stream);
#endif
}

void MCFilesExecReadFromFileOrDriverUntil(MCExecContext& ctxt, bool p_driver, bool p_is_end, MCNameRef p_file, MCStringRef p_sentinel, int64_t p_at, bool p_has_at, double p_max_wait, int p_time_units)
{
	IO_handle t_stream = NULL;
    MCFileEncodingType t_encoding;
	IO_stat t_stat = IO_NORMAL;

    MCFilesExecReadGetStream(ctxt, p_file, p_is_end, p_at, p_has_at, t_stream, (intenum_t&)t_encoding, t_stat);

	if (t_stream == NULL)
		return;

	if (t_stat != IO_NORMAL)
	{
		ctxt . SetTheResultToStaticCString("error seeking in file");
		return;
	}

    MCValueRef t_output;
    t_output = nil;
	if (MCStringGetLength(p_sentinel) == 1 && MCStringGetNativeCharAtIndex(p_sentinel, 0) == '\004')
	{
		MCAutoDataRef t_data;
        t_stat = IO_read_to_eof(t_stream, &t_data);

        if (t_stat == IO_NORMAL)
        {
            t_stat =


// <copyright file="RealTimeRoomConfig.cs" company="Google Inc.">
// Copyright (C) 2014 Google Inc.
//
//  Licensed under the Apache License, Version 2.0 (the "License");
//  you may not use this file except in compliance with the License.
//  You may obtain a copy of the License at
//
//  http://www.apache.org/licenses/LICENSE-2.0
//
//  Unless required by applicable law or agreed to in writing, software
//  distributed under the License is distributed on an "AS IS" BASIS,
//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//  See the License for the specific language governing permissions and
//    limitations under the License.
// </copyright>

#if (UNITY_ANDROID || (UNITY_IPHONE && !NO_GPGS))

namespace GooglePlayGames.Native.Cwrapper
{
    using System;
    using System.Runtime.InteropServices;
    using System.Text;

    internal static class RealTimeRoomConfig
    {
        [DllImport(SymbolLocation.NativeSymbolLocation)]
        internal static extern /* from(size_t) */ UIntPtr RealTimeRoomConfig_PlayerIdsToInvite_Length(
            HandleRef self);

        [DllImport(SymbolLocation.NativeSymbolLocation)]
        internal static extern /* from(size_t) */ UIntPtr RealTimeRoomConfig_PlayerIdsToInvite_GetElement(
            HandleRef se


using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MyBoxDrawObject
{
    #region Drawing Support
    private MyXZPlane[,] Faces = new MyXZPlane[3,2] {
            {new MyXZPlane(),  new MyXZPlane()},
            {new MyXZPlane(),  new MyXZPlane()},
            {new MyXZPlane(),  new MyXZPlane()}
        };
                // The 6 faces of the box: 0 is +, 1 is -
                    // 0: + and - Y/Z ==> Move in X
                    // 1: + and - X/Z ==> Move in Y
                    // 2: + and - X/Y ==> Move in Z

    private Vector3 BoxCenter = Vector3.zero;
    private Vector3 BoxSize = Vector3.zero;
    #endregion

    public Vector3 Center {
        get { return BoxCenter; }
        set
        {
            BoxCenter = value;
            UpdateBoxDraw();
        }
    }
    public Vector3 Size
    {
        get { return BoxSize; }
        set {
            BoxSize = value;
            UpdateBoxDraw();
        }
    }
    public float SizeX
    {
        get { return Size.x; }
        set
        {
            Vector3 s = Size;
            s.x = value;
            Size = s;
        }
    }
    public float SizeY
    {
        get { return Size.y; }
        set
        {
            Vector3 s = Size;
            s.y = value;
            Size = s;
        }
    }
    public float SizeZ
    {
        get { return Size.z; }
        set
        {
            Vector3 s = Size;
            s.z = value;
            Size = s;
        }
    }
    public Vector3 MinPosition
    {
        get { return Center - (Size / 2.0f); }
        set
        {
            Vector3 max = Center + (Size / 2.0f);  // current max
            Size = max - value;
            Center = 0.5f * (max + value);
        }
    }
    public Vector3 MaxPosition
    {
        get { return Center + (Size / 2.0f); }
        set
        {
            Vector3 min = Center - (Size / 2.0f); // current min
            Size = value - min;
            Center = 0.5f * (min + value);
        }
    }

    // index: 0=>X, 1=>Y, 2=>Z
    protected void SetPlaneColor(int index, Color c)
    {
        Faces[index, 0].PlaneColor = c;
        Faces[index, 1].PlaneColor = c;
    }

    protected void ResetBoxColor()
    {
        SetPlaneColor(0, MyDrawObject.NoCollisionColor);
        SetPlaneColor(1


�₄₂.
    'bcafkdeadbacebaaaaahd1ekgbadgbbi,'
    // #243: 70 fonts: Noto Sans₁, Arabic₄, Avestan₆, Balinese₇, Batak₁₀, Bengali₁₁, Brahmi₁₃, Buginese₁₄, Buhid₁₅, Chakma₁₉, Cham₂₀, Devanagari₂₆, Duployan₂₇, Egyptian Hieroglyphs₂₈, Grantha₃₅, Gujarati₃₆, Gunjala Gondi₃₇, Gurmukhi₃₈, Hanunoo₄₀, Hatran₄₁, Hebrew₄₂, Javanese₄₈, Kaithi₅₀, Kannada₅₁, Kayah Li₅₂, Kharoshthi₅₃, Khmer₅₄, Khojki₅₅, Khudawadi₅₆, Lao₅₇, Lepcha₅₈, Limbu₅₉, Mahajani₆₅, Malayalam₆₆, Mandaic₆₇, Manichaean₆₈, Meetei Mayek₇₄, Modi₇₇, Mongolian₇₈, Myanmar₈₁, NKo₈₂, New Tai Lue₈₄, Newa₈₅, Oriya₉₇, Pahawh Hmong₁₀₀, Phags Pa₁₀₃, Psalter Pahlavi₁₀₅, Rejang₁₀₆, Saurashtra₁₀₉, Sharada₁₁₀, Siddham₁₁₂, Sinhala₁₁₃, Sogdian₁₁₄, Sundanese₁₁₇, Syloti Nagri₁₁₈, Syriac₁₂₁, Tagalog₁₂₃, Tagbanwa₁₂₄, Tai Le₁₂₅, Tai Tham₁₂₆, Tai Viet₁₂₇, Takri₁₂₈, Tamil₁₂₉, Telugu₁₃₁, Thaana₁₃₂, Thai₁₃₃, Tifinagh₁₃₄, Tirhuta₁₃₅, Warang Citi₁₃₉, Noto Serif Tibetan₁₄₂.
    'bcbacabaadafaagaaabaafbaaaaaaaaafaaafcacabalccbacabaacacbaaaaaabaaaadc,'
    // #244: 75 fonts: Noto Sans₁, Arabic₄, Avestan₆, Balinese₇, Batak₁₀, Bengali₁₁, Brahmi₁₃, Buginese₁₄, Buhid₁₅, Chakma₁₉, Cham₂₀, Devanagari₂₆, Egyptian Hieroglyphs₂₈, Grantha₃₅, Gujarati₃₆, Gunjala Gondi₃₇, Gurmukhi₃₈, Hanunoo₄₀, Hebrew₄₂, Javanese₄₈, Kaithi₅₀, Kannada₅₁, Kayah Li₅₂, Kharoshthi₅₃, Khmer₅₄, Khojki₅₅, Khudawadi₅₆, Lao₅₇, Lepcha₅₈, Limbu₅₉, Mahajani₆₅, Malayalam₆₆, Mandaic₆₇, Manichaean₆₈, Meetei Mayek₇₄, Modi₇₇, Mongolian₇₈, Myanmar₈₁, NKo₈₂, New Tai Lue₈₄, Newa₈₅, Old Hungarian₈₉, Old Turkic₉₆, Oriya₉₇, Pahawh Hmong₁₀


CodedInputStream.newInstance(is).skipRawBytes(Integer.MAX_VALUE);
  }

  public void testReadHugeBlob() throws Exception {
    // Allocate and initialize a 1MB blob.
    byte[] blob = new byte[1 << 20];
    for (int i = 0; i < blob.length; i++) {
      blob[i] = (byte) i;
    }

    // Make a message containing it.
    TestAllTypes.Builder builder = TestAllTypes.newBuilder();
    TestUtil.setAllFields(builder);
    builder.setOptionalBytes(ByteString.copyFrom(blob));
    TestAllTypes message = builder.build();

    byte[] data = message.toByteArray();
    for (InputType inputType : InputType.values()) {
      // Serialize and parse it.  Make sure to parse from an InputStream, not
      // directly from a ByteString, so that CodedInputStream uses buffered
      // reading.
      TestAllTypes message2 = TestAllTypes.parseFrom(inputType.newDecoder(data));

      assertEquals(inputType.name(), message.getOptionalBytes(), message2.getOptionalBytes());

      // Make sure all the other fields were parsed correctly.
      TestAllTypes message3 =
          TestAllTypes.newBuilder(message2)
              .setOptionalBytes(TestUtil.getAllSet().getOptionalBytes())
              .build();
      TestUtil.assertAllFieldsSet(message3);
    }
  }

  public void testReadMaliciouslyLargeBlob() throws Exception {
    ByteString.Output rawOutput = ByteString.newOutput();
    CodedOutputStream output = CodedOutputStream.newInstance(rawOutput);

    int tag = WireFormat.makeTag(1, WireFormat.WIRETYPE_LENGTH_DELIMITED);
    output.writeRawVarint32(tag);
    output.writeRawVarint32(0x7FFFFFFF);
    output.writeRawBytes(new byte[32]); // Pad with a few random bytes.
    output.flush();

    byte[] data = rawOutput.toByteString().toByteArray();
    for (InputType inputType : InputType.values()) {
      CodedInputStream input = inputType.newDecoder(data);
      assertEquals(tag, input.readTag());
      try {
        input.readBytes();
        fail(inputType.name() + ": Should have thrown an exception!");
      } catch (InvalidProtocolBufferException e) {
        // success.
      }
    }
  }

  /**
   * Test we can do messages that are up to CodedInputStream#DEFAULT_SIZE_LIMIT in size (2G or
   * Integer#MAX_SIZE).
   *
   * @throws IOException
   */
  public void testParseMessagesCloseTo2G() throws IOException {
    byte[] serializedMessage = getBigSerializedMessage();
    // How many of these big messages do we need to take us near our 2G limit?
    int count = Integer.MAX_VALUE / serializedMessage.length;
    // Now make an inputstream that will fake a near 2G message of messages
    // returning our big serialized message 'count' times.
    InputStream is = new RepeatingInputStream(serializedMessage, count);
    // Parse should succeed!
    TestAllTypes.parseFrom(is);
  }

  /**
   * Test there is an exception if a message exceeds CodedInputStream#DEFAULT_SIZE_LIMIT in size (2G
   * or Integer#MAX_SIZE).
   *
   * @throws IOException
   */
  public void testParseMessagesOver2G() throws IOException {
    byte[] serializedMessage = getBigSerializedMessage();
    // How many of these big messages do we need to take us near our 2G limit?
    int count = Integer.MAX_VALUE / serializedMessage.length;
    // Now add one to take us over the limit
    count++;
    // Now make an inputstream that will fake a near 2G message of messages
    // returning our big serialized message 'count' times.
    InputStream is = new RepeatingInputStream(serializedMessage, count);
    try {
      TestAllTypes.parseFrom(is);
      fail("Should have thrown an exception!");
    } catch (InvalidProtocolBufferException e) {
      assertTrue(e.getMessage().


在设计方面是出了名地喜欢「帮用户做决定」，虽然用户体验确实不错，但自定义性差得不是一星半点。

之前用旧电脑装过 Linux，用于做作业和~~上课摸鱼~~，发行版是 [Manjaro](posts/manjaro-桌面折腾记/)，桌面环境是 KDE。大部分 Linux 发行版对比 MacOS 而言是另一个极端，可玩性非常高。*说来有点好笑，装好 Manjaro 之后，我毫不犹豫地找了各种主题、插件和应用程序，把它改造成了 MacOS Big Sur 的样式*。

这或许是人们对苹果的设计，评价褒贬不一的原因之一。我对苹果设计风格的印象是「性冷淡」「高级感」和「非常干净」。虽然 Windows 11 的 Fluent Design 我也挺喜欢，但 Windows 上的应用程序风格各异，很难有统一的用户体验。

并不是所有人都能接受这样一板一眼的设计，我见过许多安卓用户会把自己的手机个性化得非常可爱，又或是科技感十足。但是你很难用苹果的产品实现偏离其设计风格太远的效果，至少在系统级的 UI 层面不能。

除了图形设计，苹果在交互设计方面也是如此。我记得我换成 iPhone 之后，花了好长时间才适应「在屏幕边缘滑动以返回」这个功能的缺失，只能乖乖地用屏幕左上角的返回键。虽然苹果的许多交互手势非常好用，比如 MacBook 上的触控板，简直是世界上最好用的触控板，但有不少方面的确不如安卓灵活。

另外一个有些难适应的点，就是鼠标的滚动。在 Windows 和 Linux 上，鼠标滚轮向上滚就是向上滑动，但对于 MacOS 来说，向上滚类似于触控屏幕上，手指向上滑动，所以画面反而向下运动。这个设计其实在触控板上很符合逻辑，但对鼠标来说，就需要花更多的时间适应。

最值得吐槽的就是 MacOS 会在每个目录下面「拉屎」的操作，每一级目录下几乎都会有一个名叫 `.DS_STORE` 的文件夹配置文件，这个平时看不到还好，拷贝到 Windows 上被其他人看到也还好，但如果创建 Git 仓库忘记


lderInfo.Content = null;
        label.TextContent = slider.Default.ToString(label.Format);
        list.AddListItem(slider);
        list.AddListItem(label);
        return list;
    }
}


creen.enterDeviceName(device, DEVICE_NAME)
    HomeScreen.verifyDeviceShown(DEVICE_NAME)

    // Toggle the on/off state of the device.
    // Good idea to visually check that the device's state is indeed toggled.
    Thread.sleep(2000)
    HomeScreen.toggleOnOffState()
    Thread.sleep(2000)
    HomeScreen.toggleOnOffState()
    Thread.sleep(2000)
    HomeScreen.toggleOnOffState()
    Thread.sleep(5000)
  }
}
/*
 * Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.google.homesampleapp

import android.app.Application
import dagger.hilt.android.HiltAndroidApp
import timber.log.Timber

/** Google Home Sample Application for Matter (GHSAFM) */
@HiltAndroidApp
class GHSAFM3pEcoApplication : Application() {
  override fun onCreate() {
    super.onCreate()

    // Setup Timber for logging.
    Timber.plant(
        object : Timber.DebugTree() {
          // Override [log] to add a "global prefix" prefix to the tag.
          override fun log(priority: Int, tag: String?, message: String, t: Throwable?) {
            super.log(priority, "${APP_NAME}-$tag", message, t)
          }

          // Override [createStackElementTag] to include additional information to the tag.
          // (e.g. a "method name" to the tag).
          /**
           * Not enabled for now, but leaving here since it may be useful when debugging. override
           * fun createStackElementTag(element: StackTraceElement): String { return String.format(
           * "%s:%s", super.createStackElementTag(element), element.methodName, ) }
           */
        })
  }
}
/*
 * Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.google.homesampleapp.chip

object MatterConstants {
  val DeviceTypesMap =
      mapOf<Long, String>(
          22L to "Root Node",
          256L to "On/Off Light",
          266L to "Outlet",
      )

  val ClustersMap =
      mapOf<Long, String>(
          3L to "Identify",
          4L to "Groups",
          5L to "Scenes",
          6L to "On/Off",
          8L to "Level Control",
          29L to "Descriptor",
          30L to "Binding",
          31L to "Access Control",
          40L to "Basic Information",
          41L to "OTA Software Update Provider",
          42L to "OTA Software Update Requestor",
          43L to "Localization Configuration",
          44L to "Time Format Localization",
          45L to "Unit Localization",
          48L to "General Commissioning",
          49L to "Network Commissioning",
          50L to "Diagnostics Logs",
          51L to "General Diagnostics",
          52L to "Software Diagnostics",
          53L to "Thread Network Diagnostics",
          54L to "Wi-Fi Network Diagnostics",


nreturn_as	\nDefines what this keyword returns. Possible values are documented in ScreenshotReturnType. It can be either a path to the screenshot file as string or Path object, or the image data as bytes or base64 encoded string.	\n
\n
\ntimeout	\nMaximum time how long taking screenshot can last, defaults to library timeout. Supports Robot Framework time format, like 10s or 1 min, pass 0 to disable timeout. The default value can be changed by using the Set Browser Timeout keyword.	\n
\n
\n
Keyword uses strict mode if selector is defined. See Finding elements for more details about strict mode.
\n
Old deprecated argument order: fullPage, fileType, quality, timeout, crop, disableAnimations, mask, omitBackground
\n
Example
\n
\nTake Screenshot                                 # Takes screenshot from page with default filename\nTake Screenshot   selector=id=username_field    # Captures element in image\n# Takes screenshot with jpeg extension, defines image quality and timeout how long taking screenhost should last\nTake Screenshot   fullPage=True    fileType=jpeg    quality=50    timeout=10s\nTake Screenshot   EMBED                         # Screenshot is embedded as Base64 image to the log.html.\n
\n
Comment >>
", "shortdoc": "Takes a screenshot of the current window or element and saves it to disk.", "tags": ["PageContent"], "source": "/Users/kerkko/Code/robotframework-browser/Browser/keywords/browser_control.py", "lineno": 107}, {"name": "Type Secret", "args": [{"name": "selector", "types": ["str"], "typedocs": {"str": "string"}, "defaultValue": null, "kind": "POSITIONAL_OR_NAMED", "required": true, "repr": "selector: str"}, {"name": "secret", "types": ["str"], "typedocs": {"str": "string"}, "defaultValue": null, "kind": "POSITIONAL_OR_NAMED", "required": true, "repr": "secret: str"}, {"name": "delay", "types": ["timedelta"], "typedocs": {"timedelta": "timedelta"}, "defaultValue": "0:00:00", "kind": "POSITIONAL_OR_NAMED", "required": false, "repr": "delay: timedelta = 0:00:00"}, {"name": "clear", "types": ["bool"], "typedocs": {"bool": "boolean"}, "defaultValue": "True", "kind": "POSITIONAL_OR_NAMED", "required": false, "repr": "clear: bool = True"}], "doc": "
Types the given secret from variable_name into the text field found by selector.
\n
This keyword does not log secret in Robot Framework logs, if keyword resolves the variable value internally. If enable_playwright_debug is enabled in the library import, secret will be always visible as plain text in the playwright debug logs, regardless of the Robot Framework log level.
\n
\n
\nArguments	\nDescription	\n
\n
\nselector


 at current position
offset_loop:			    ;loop start to calculate offsets
	move.b	(a1)+,d1		;d1 = next offset byte
	beq.s	done_reloc		;if none, relocation done
	cmpi.b	#1,d1			;is it 1 ?  (impossible real offset)
	bne.s	next_offset		;if not, go use it
	lea	254(a0),a0		;else step ahead 254 bytes
	bra.s	offset_loop	    ;loop back for another offset
;
next_offset:
	adda.w	d1,a0		    ;step ahead by d1 bytes
	bra.s	patch_loop	;loop back to patch at position
;
done_reloc:
	lea	(a2),a1			;a1 -> bss_beg
	move.l	ph_bss_len(a3),d0	;d0 =  bss_len
	tst.l	d0			;BSS empty ?
	ble.s	done_BSS		;then goto done_BSS
	lea	(a1,d0.l),a0		;a0 -> bss_end
clear_BSS_lp:				;loop start to clear BSS
	clr.l	(a1)+				;clear a long
	cmpa.l	a0,a1				;a1 past or at end ?
	blt.s	clear_BSS_lp		;loop back to clear all of BSS
done_BSS:
	rts
;----------------------------------------------------------------------------
;End of file:	RELOCATE.S
;----------------------------------------------------------------------------


struct {
		blockNumber rpc.BlockNumber
		config      *TraceConfig
		expect      interface{}
		expectErr   error
	}{
		// Trace genesis block, expect error
		{
			blockNumber: rpc.BlockNumber(0),
			config:      nil,
			expect:      nil,
			expectErr:   errors.New("genesis is not traceable"),
		},
		// Trace head block
		{
			blockNumber: rpc.BlockNumber(genBlocks),
			config:      nil,
			expectErr:   nil,
			expect: []*txTraceResult{
				{
					Result: &kaiaapi.ExecutionResult{
						Gas:         params.TxGas,
						Failed:      false,
						ReturnValue: "",
						StructLogs:  []kaiaapi.StructLogRes{},
					},
				},
			},
		},
		// Trace non-existent block
		{
			blockNumber: rpc.BlockNumber(genBlocks + 1),
			config:      nil,
			expectErr:   fmt.Errorf("the block does not exist (block number: %d)", genBlocks+1),
			expect:      nil,
		},
		// Trace latest block
		{
			blockNumber: rpc.LatestBlockNumber,
			config:      nil,
			expectErr:   nil,
			expect: []*txTraceResult{
				{
					Result: &kaiaapi.ExecutionResult{
						Gas:         params.TxGas,
						Failed:      false,
						ReturnValue: "",
						StructLogs:  []kaiaapi.StructLogRes{},
					},
				},
			},
		},
		// Trace pending block
		{
			blockNumber: rpc.PendingBlockNumber,
			config:      nil,
			expectErr:   nil,
			expect: []*txTraceResult{
				{
					Result: &kaiaapi.ExecutionResult{
						Gas:         params.TxGas,
						Failed:      false,
						ReturnValue: "",
						StructLogs:  []kaiaapi.StructLogRes{},
					},
				},
			},
		},
	}
	for _, testspec := range testSuite {
		result, err := api.TraceBlockByNumber(context.Background(), testspec.blockNumber, testspec.config)
		if testspec.expectErr != nil {
			if err == nil {
				t.Errorf("Expect error %v, get nothing", testspec.expectErr)
				continue
			}
			if !reflect.DeepEqual(err, testspec.expectErr) {
				t.Errorf("Error mismatch, want %v, get %v", testspec.expectErr, err)
			}
		} else {
			if err != nil {
				t.Errorf("Expect no error, get %v", err)
				continue
			}
			if len(result) != len(testspec.expect.([]*txTraceResult)) {
				t.Errorf("Result length mismatch, want %v, get %v", len(result), len(testspec.expect.([]*txTraceResult)))
			}
			for idx, r := range result {
				if !reflect.DeepEqual(r.Result, testspec.expect.([]*txTraceResult)[idx].Result) {
					t.Errorf("Result mismatch, want %v, get %v", testspec.expect, result)
				}
			}
		}
	}
}

type Account struct {
	key  *ecdsa.PrivateKey
	addr common.Address
}

type Accounts []Account

func (a Accounts) Len() int           { return len(a) }
func (a Accounts) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }
func (a Accounts) Less(i, j int) bool { return bytes.Compare(a[i].addr.Bytes(), a[j].addr.Bytes()) < 0 }

func newAccounts(n int) (accounts Accounts) {
	for i := 0; i < n; i++ {
		key, _ := crypto.GenerateKey()


ion_snapping(GrabberID axis, const ColorRGBA& color);
    void render_grabber_connection(const ColorRGBA& color, Transform3d view_matrix, double line_len_koef = 1.0);
    void render_cut_plane_grabbers();
    void render_cut_line();
    void perform_cut(const Selection&selection);
    void set_center_pos(const Vec3d&center_pos, bool update_tbb = false);
    void update_bb();
    void init_picking_models();
    void init_rendering_items();
    void render_clipper_cut();
    void clear_selection();
    void reset_connectors();
    void init_connector_shapes();
    void update_connector_shape();
    void validate_connector_settings();
    bool process_cut_line(SLAGizmoEventType action, const Vec2d& mouse_position);
    void check_and_update_connectors_state();

    void toggle_model_objects_visibility();

    indexed_triangle_set its_make_groove_plane();

    indexed_triangle_set get_connector_mesh(CutConnectorAttributes connector_attributes);
    void apply_cut_connectors(ModelObject* mo, const std::string& connector_name);
};

} // namespace GUI
} // namespace Slic3r

#endif // slic3r_GLGizmoCut_hpp_
///|/ Copyright (c) Prusa Research 2021 - 2023 Oleksandra Iushchenko @YuSanka, Enrico Turri @enricoturri1966, Vojtěch Bubník @bubnikv, Filip Sykala @Jony01, Lukáš Hejl @hejllukas, Lukáš Matěna @lukasmatena
///|/
///|/ PrusaSlicer is released under the terms of the AGPLv3 or higher
///|/
#ifndef slic3r_GLGizmoSimplify_hpp_
#define slic3r_GLGizmoSimplify_hpp_

#include "GLGizmoBase.hpp"
#include "slic3r/GUI/3DScene.hpp"
#include "slic3r/GUI/I18N.hpp"
#include "admesh/stl.h" // indexed_triangle_set
#include <mutex>
#include <thread>

namespace Slic3r {
class ModelObject;
class Model;
class ObjectID;

namespace GUI {
class NotificationManager; // for simplify suggestion

class GLGizmoSimplify: public GLGizmoBase
{
public:
    GLGizmoSimplify(GLCanvas3D& parent);
    virtual ~GLGizmoSimplify();
    bool on_esc_key_down();
    static void add_simplify_suggestion_notification(
        const std::vector<size_t> &object_ids,
        const std::vector<ModelObject*> &    objects,
        NotificationManager &      manager);

protected:
    virtual std::string on_get_name() const override;
    virtual void on_render_input_window(float x, float y, float bottom_limit) override;
    virtual bool on_is_activable() const override;
    virtual bool on_is_selectable() const override { return false; }
    virtual void on_set_state() override;

    // must implement
    virtual bool on_init() override { return true;};
    virtual void on_render() override;

    CommonGizmosDataID on_get_requirements() const override;

private:
    void apply_simplify();
    void close();

    void process();
    bool stop_worker_thread_request();
    void worker_finished();

    void create_gui_cfg();
    void request_rerender(bool force = false);

    void set_center_position();

    struct Configuration
    {
        bool use_count = false;
        float    decimate_ratio = 50.f; // in percent
        uint32_t wanted_count = 0; // initialize by percents
        float max_error = 1.; // maximal quadric error

        void fix_count_by_ratio(size_t triangle_count);
        bool operator==(const Configuration& rhs) {


TOS versions
        	move.w  	(a0),d0
	cmpi.w  	#$100,d0		100 = tos 1.0 (1986)
        	beq.s    	tos1
        	cmpi.w  	#$102,d0		102 = tos 1.2 + blitter (1987)
        	beq.s    	tos2
        	cmpi.w  	#$104,d0		104 = tos 1.4 (1988)
        	beq.s    	tos3
        	cmpi.w  	#$106,d0		106 = STE tos 1.6 with blitter
        	beq.s    	tos4
        	bra     	no_recog 	  if we are here the tos was not recognised !

tos1	lea  	tos_v1,a0		this bit puts the correct message
        	bra    	cont		in a0 so it can be printed
tos2	lea  	tos_v2,a0
        	bra    	cont
tos3	lea  	tos_v3,a0
        	bra    	cont
tos4	lea  	tos_v4,a0
	bra	cont
no_recog	lea	not_tos,a0
	bra	cont

; sys_base check by T.S.C.
; We really only need to check one part of d0 for the valid sys_base but
; lets do both anyway.

base_ok?	cmpi.w	#$4321,d0		check 1st part
	bne.s	badnews		oh oh  invalid sys_base !
	swap	d0

; swap high and low order words so we can get at the rest of the number.

	cmpi.w	#$8765,d0		check 2nd part
	beq.s	itsok		ok?  so its a valid sys_base
	bra	badnews		oh oh  invalid sys_base !
	rts

badnews	lea	bad_base,a0
	bra	cont		exit cos invalid sys_base
itsok	lea	ok_base,a0
	bsr	print
	rts
***************************************************************************
* Check for STE

ste_hard	cmp.l	#$e00000,$4.w
	bge.s	notste
	lea	bugger,a0
	bsr	print
	bra	ian
notste	lea	no_e_in_it,a0
	bsr	print
ian	rts

***************************************************************************
print	move.l  	a0,-(sp)  	print message
       	move.w  	#9,-(sp)
       	trap    	#1
       	addq.l  	#6,sp
	rts
wait	move.w	#7,-(sp)		wait for a key
	trap	#1
	addq.l	#2,sp
	rts

	section data

sys_base	ds.l	1
meg_mess	dc.b	"1 Meg Memory",13,10,0
half_meg	dc.b	"512k Memory",13,10,0
bad_base	dc.b	"Invald System Base!!!",0
ok_base	dc.b	"Valid System Base",13,10,0
tos_v1	dc.b	"TOS Version 1.00",0
tos_v2	dc.b	"TOS Version 1.2",0
tos_v3	dc.b	"TOS Version 1.4",0
tos_v4	dc.b	"TOS Version STE 1.6",0
not_tos	dc.b	"TOS not recognised!!!",0
no_e_in_it	dc.b	"This Is An STF/STFM",13,10,0
bugger	dc.b	"This Is An STE",13,10,0
nostix	dc.b	"There Is A Diagnostic Cartridge Plugged In",13,10,0
ripper	dc.b	"There Is A User Cartridge Plugged In And Active",13,10,0
cartless	dc.b	"No Cartridges Detected/Active",13,10,0
	even


er: 16px solid #F8F8F8;
    padding: 20px 30px;
  }
  .ec-newsRole .ec-newsRole__newsItem:last-of-type {
    margin-bottom: 0;
  }
  .ec-newsRole .ec-newsRole__newsItem {
    padding: 20px 0;
  }
  .ec-newsRole .ec-newsRole__newsHeading {
    display: flex;
  }
  .ec-newsRole .ec-newsRole__newsDate {
    display: inline-block;
    margin: 0;
    min-width: 120px;
    font-size: 14px;
  }
  .ec-newsRole .ec-newsRole__newsColumn {
    display: inline-flex;
    min-width: calc(100% - 120px);
  }
  .ec-newsRole .ec-newsRole__newsTitle {
    margin-bottom: 0;
    line-height: 1.8;
  }
  .ec-newsRole .ec-newsRole__newsDescription {
    margin: 20px 0 0;
    line-height: 1.8;
  }
  .ec-newsRole__newsItem.is_active .ec-newsRole__newsDescription {
    margin: 20px 0 0;
  }
  .ec-searchnavRole {
    margin: 0 auto;
    padding-left: 20px;
    padding-right: 20px;
    box-sizing: border-box;
    font-size: 16px;
    line-height: 1.4;
    color: #525263;
    -webkit-text-size-adjust: 100%;
    width: 100%;
    max-width: 1130px;
  }
  .ec-searchnavRole:after {
    content: " ";
    display: table;
  }
  .ec-searchnavRole:after {
    clear: both;
  }
  .ec-searchnavRole textarea { /* for chrome fontsize bug */
    font-family: sans-serif;
  }
  .ec-searchnavRole img {
    max-width: 100%;
  }
  .ec-searchnavRole html {
    box-sizing: border-box;
  }
  .ec-searchnavRole *,
  .ec-searchnavRole *::before,
  .ec-searchnavRole *::after {
    box-sizing: inherit;
  }
  .ec-searchnavRole img {
    width: 100%;
  }
  .ec-searchnavRole .ec-searchnavRole__infos {
    padding-left: 0;
    padding-right: 0;
    border-top: 1px solid #ccc;
    padding-top: 16px;
    flex-direction: row;
  }
  .ec-searchnavRole .ec-searchnavRole__counter {
    margin-bottom: 0;
    width: 50%;
  }
  .ec-searchnavRole .ec-searchnavRole__actions {
    width: 50%;
  }
  .ec-shelfGrid {
    margin-left: -16px;
    margin-right: -16px;
  }
  .ec-shelfGrid .ec-shelfGrid__item {
    padding: 0 16px;
    width: 25%;
  }
  .ec-shelfGrid .ec-shelfGrid__item:nth-child(odd) {
    padding: 0 16px;
  }
  .ec-shelfGrid .ec-shelfGrid__item:nth-child(even) {
    padding: 0 16px;
  }
  .ec-shelfGridCenter {
    margin-left: -16px;
    margin-right: -16px;
  }
  .ec-shelfGridCenter .ec-shelfGridCenter__item {
    padding: 0 16px;
    width: 25%;
  }
  .ec-shelfGridCenter .ec-shelfGridCenter__item:nth-child(odd) {
    padding: 0 16px;
  }
  .ec-shelfGridCenter .ec-shelfGridCenter__item:nth-child(even) {


        return SUCCESS(dict_data)
            else:
                return ID_NOT_FOUND()
        else:
            PARAMETER_ERR()
    if request.method == "PUT":
        id = res_dir.get("id")
        dict_id = res_dir.get("dict_id")
        dict_label = res_dir.get("dict_label")
        dict_number = res_dir.get("dict_number")
        css_class = res_dir.get("css_class")
        list_class = res_dir.get("list_class")
        is_default = res_dir.get("is_default")
        dict_sort = res_dir.get("dict_sort")
        status = res_dir.get("status")
        remark = res_dir.get("remark")
        if id and dict_id and dict_label and dict_number:
            model = Dict_Data.query.get(id)
            if model:
                token = request.headers["Authorization"]
                user = verify_token(token)
                model.dict_id = dict_id
                model.dict_label = dict_label
                model.dict_number = dict_number
                model.css_class = css_class
                model.list_class = list_class
                model.is_default = is_default
                model.dict_sort = dict_sort
                model.remark = remark
                model.status = status
                model.update_by = user['name']
                try:
                    model.update()
                    return SUCCESS()
                except Exception as e:
                    app.logger.error(f"更新字典数据失败:{e}")
                    return UPDATE_ERROR()
            else:
                return ID_NOT_FOUND()
        else:
            return NO_PARAMETER()

@dictData.route('/delete', methods=["DELETE"])
def delete():
    '''
    根据id删除字典数据
    :return:
    '''
    res_dir = request.get_json()
    if res_dir is None:
        return NO_PARAMETER()
    dict_id = res_dir.get("id")
    if dict_id:
        try:
            model = Dict_Data.query.get(dict_id)
            if model:
                model.delete()
                return SUCCESS()
            else:
                return ID_NOT_FOUND()
        except Exception as e:
            app.logger.error(f"删除失败:{e}")
            return DELETE_ERROR()
    else:
        return PARAMETER_ERR()


::RgbKeyboard, Key};
        ///
        /// let mut keyboard = RgbKeyboard::default();
        /// // Modify the keyboard array so QWERTY will be set to white..
        /// keyboard.array_set_single(Key::Q, 255, 255, 255);
        /// keyboard.array_set_single(Key::W, 255, 255, 255);
        /// keyboard.array_set_single(Key::E, 255, 255, 255);
        /// keyboard.array_set_single(Key::R, 255, 255, 255);
        /// keyboard.array_set_single(Key::T, 255, 255, 255);
        /// keyboard.array_set_single(Key::Y, 255, 255, 255);
        /// // ..and apply the change.
        /// keyboard.array_update();
        /// ```
        pub fn array_set_single<K: IntoMatrixRowColumn>(
            &mut self,
            key: K,
            red: u8,
            green: u8,
            blue: u8,
        ) -> bool {
            let (row, column) = key.into_matrix_row_and_column();
            unsafe {
                wooting_rgb_sdk_sys::wooting_rgb_array_set_single(row, column, red, green, blue)
            }
        }

        /// Set a complete color array. This will not directly update the keyboard unless the auto
        /// update flag is set (see `array_auto_update`). Returns `true` if the colors have
        /// changed.
        ///
        /// ```rust,no_run
        /// use wooting_sdk::{rgb::RgbKeyboard, Key};
        ///
        /// let mut keyboard = RgbKeyboard::default();
        /// // Modify the keyboard array so QWERTY will be set to white..
        /// keyboard.array_set_full(&[
        ///     (Key::Q, (255, 255, 255)),
        ///     (Key::W, (255, 255, 255)),
        ///     (Key::E, (255, 255, 255)),
        ///     (Key::R, (255, 255, 255)),
        ///     (Key::T, (255, 255, 255)),
        ///     (Key::Y, (255, 255, 255)),
        /// ]);
        /// // ..and apply the change.
        /// keyboard.array_update();
        /// ```
        pub fn array_set_full<K: IntoMatrixRowColumn>(
            &mut self,
            array: &[(K, (u8, u8, u8))],
        ) -> bool {
            let mut flattened: [u8; COMPONENTS * COLUMNS * ROWS] = [0; COMPONENTS * COLUMNS * ROWS];
            for (key, (red, green, blue)) in array {
                let (row, column) = key.into_matrix_row_and_column();
                let index: usize =
                    (row as usize) * (COLUMNS * COMPONENTS) + (column as usize) * COMPONENTS;
                flattened[index] = *red;
                flattened[index + 1] = *green;
                flattened[index + 2] = *blue;
            }
            unsafe { wooting_rgb_sdk_sys::wooting_rgb_array_set_full(flattened.as_ptr()) }
        }

        /// Restore all colors to those that were originally on the keyboard. Must be called when
        /// application is closed (this will be invoked when this struct is dropped).
        ///
        /// ```rust,no_run
        /// use wooting_sdk::{rgb::RgbKeyboard, Key};
        ///
        /// let mut keyboard = RgbKeyboard::default();
        /// /


on(m_resolutionLevel);
    updateData();
    m_statusArea->append(QStringLiteral("<b>Started<\b>"));
}

void Data::stop()
{
    m_started = false;
    clearData();
    m_statusArea->append(QStringLiteral("<b>Stopped<\b>"));
}

ContainerChanger::ContainerChanger(QWidget *surface, QWidget *scatter, QWidget *bars,
                                   QWidget *buttonOne, QWidget *buttonTwo)
    : m_surface(surface),
      m_scatter(scatter),
      m_bars(bars),
      m_button1(buttonOne),
      m_button2(buttonTwo)
{
}

ContainerChanger::~ContainerChanger()
{
}

void ContainerChanger::changeContainer(int container)
{
    switch (container) {
    case 0: {
        m_scatter->setVisible(false);
        m_bars->setVisible(false);
        m_surface->setVisible(true);
        m_button1->setEnabled(true);
        m_button2->setEnabled(true);
        break;
    }
    case 1: {
        m_surface->setVisible(false);
        m_bars->setVisible(false);
        m_scatter->setVisible(true);
        m_button1->setEnabled(false);
        m_button2->setEnabled(false);
        break;
    }
    case 2: {
        m_surface->setVisible(false);
        m_scatter->setVisible(false);
        m_bars->setVisible(true);
        m_button1->setEnabled(false);
        m_button2->setEnabled(false);
        break;
    }
    }
}
// Copyright (C) 2019 Klaralvdalens Datakonsult AB (KDAB).
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only

#include "qtexturedataupdate.h"
#include "qtexturedataupdate_p.h"
#include <iostream>

QT_BEGIN_NAMESPACE

namespace Qt3DRender
{

static bool operator==(const QTextureDataUpdatePrivate &lhs, const QTextureDataUpdatePrivate &rhs) noexcept
{
    return lhs.m_x == rhs.m_x &&
           lhs.m_y == rhs.m_y &&
           lhs.m_z == rhs.m_z &&
           lhs.m_layer == rhs.m_layer &&
           lhs.m_mipLevel == rhs.m_mipLevel &&
           lhs.m_face == rhs.m_face &&
           lhs.m_data == rhs.m_data;
}

/*!
    \class Qt3DRender::QTextureDataUpdate
    \inmodule Qt3DRender
    \brief QTextureDataUpdate holds content and information required to perform
    partial updates of a texture content.

    The actual data content is contained in a QTextureImageDataPtr member.
    Additional members allow to specify the x, y, z offset of the content update
    as well as the eventual layer, mipLevel and face.

    \sa QAbstractTexture
    \since 5.14
 */

QTextureDataUpdate::QTextureDataUpdate()
    : d_ptr(new QTextureDataUpdatePrivate())
{
}

QTextureDataUpdate::QTextureDataUpdate(const QTextureDataUpdate &other)
    = default;

QTextureDataUpdate &QTextureDataUpdate::operator=(const QTextureDataUpdate &other)
    = default;

QTextureDataUpdate::~QTextureDataUpdate()
    = default;

bool operator==(const QTextureDataUpdate &lhs, const QTextureDataUpdate &rhs) noexcept
{
    return *lhs.d_func() == *rhs.d_func();
}

int QTextureDataUpdate::x() const
{
    Q_D(const QTextureDataUpdate);
    return d->m_x;
}

int QTextureDataUpdate::y() const
{
    Q_D(const QTextureDataUpdate);
    return d->m_y;
}

int QTextureDataUpdate::z


// User already exists, update DID if necessary
			if user.DID == "" {
				user.DID = did
				if err := db.Save(&user).Error; err != nil {
					utils.SendJSONError(w, fmt.Sprintf("Error updating user: %v", err), http.StatusInternalServerError)
					fmt.Println("Error updating user in database:", err)
					return
				}
				fmt.Printf("Successfully updated user with WalletAddress: %s with new DID\n", user.WalletAddress)
			} else {
				fmt.Printf("User already exists with WalletAddress: %s and has a DID\n", user.WalletAddress)
			}
		}

		// Prepare response
		response := struct {
			WalletAddress      string      `json:"walletAddress"`
			DID                string      `json:"did"`
			IsAdmin            bool        `json:"isAdmin"`
			Tier               models.Tier `json:"tier"`
			SubscriptionStatus string      `json:"subscriptionStatus"`
		}{
			WalletAddress:      user.WalletAddress,
			DID:                user.DID,
			IsAdmin:            user.Admin,
			Tier:               user.Tier,
			SubscriptionStatus: user.SubscriptionStatus,
		}

		w.Header().Set("Content-Type", "application/json")
		if err == gorm.ErrRecordNotFound {
			w.WriteHeader(http.StatusCreated)
		} else {
			w.WriteHeader(http.StatusOK)
		}
		json.NewEncoder(w).Encode(response)
	}
}

func GetUserHandler(db *gorm.DB) http.HandlerFunc {
	return func(w http.ResponseWriter, r *http.Request) {
		user, ok := r.Context().Value(middleware.UserContextKey).(*models.User)
		if !ok {
			utils.SendJSONError(w, "User not found in context", http.StatusInternalServerError)
			return
		}

		response := struct {
			WalletAddress      string      `json:"walletAddress"`
			DID                string      `json:"did"`
			IsAdmin            bool        `json:"isAdmin"`
			Tier               models.Tier `json:"tier"`
			SubscriptionStatus string      `json:"subscriptionStatus"`
		}{
			WalletAddress:      user.WalletAddress,
			DID:                user.DID,
			IsAdmin:            user.Admin,
			Tier:               user.Tier,
			SubscriptionStatus: user.SubscriptionStatus,
		}

		w.Header().Set("Content-Type", "application/json")
		json.NewEncoder(w).Encode(response)
	}
}

func UpdateUserTier(db *gorm.DB, walletAddress string, threshold int) error {
	var user models.User
	err := db.Where("wallet_address = ?", walletAddress).First(&user).Error
	if err != nil {
		return err
	}

	if user.ComputeTally >= threshold && user.Tier != models.TierPaid {
		user.Tier = models.TierPaid

		if err := db.Save(&user).Error; err != nil {
			fmt.Printf("Error updating tier for user with WalletAddress: %s: %v\n", walletAddress, err)
			return err
		}
		fmt.Printf("Successfully updated tier for user with WalletAddress: %s\n", walletAddress)
	} else {
		fmt.Printf("No need to update tier for user with WalletAddress: %s\n", walletAddress)
	}

	return nil
}
package web3

import (
	"bytes"
	"encoding/json"
	"fmt"
	"io/ioutil"
	"net/http"
	"os"

	"github.com/labdao/ple


//套路 自动计数的枚举
#include <stdio.h>
enum color{red=1,green,yellow=5 ,num};
int main()
{int color=-1;
char*colornames[num]={"red","green","yellow",};//一个二维数组
char *name=NULL;
printf("write down your color\n");
scanf("%d",&color);
if (color>=0&&color<num){
    name=colornames[color];

}else {
    name="unknown";
}printf("your color is %s\n",name);
    return 0;
}


obj.y + obj.height/2 + 8);
            });

            // Draw lives
            ctx.font = '16px Arial';
            ctx.fillStyle = '#333';
            ctx.textAlign = 'left';
            ctx.fillText(`Lives: ${'❤'.repeat(lives)}`, 10, 25);
        }

        // Game loop
        function gameLoop() {
            if (!gameRunning) return;

            updateBasket();
            updateFallingObjects();

            // Create new objects randomly
            if (Math.random() < 0.02) {
                createFallingObject();
            }

            draw();
            requestAnimationFrame(gameLoop);
        }

        // Start game
        function startGame() {
            if (gameRunning) return;

            gameRunning = true;
            score = 0;
            lives = 3;
            fallingObjects = [];
            scoreElement.textContent = `Score: ${score}`;
            gameOverElement.style.display = 'none';

            gameLoop();
        }

        // End game
        function endGame() {
            gameRunning = false;
            finalScoreElement.textContent = score;
            gameOverElement.style.display = 'block';
        }

        // Reset game
        function resetGame() {
            gameRunning = false;
            score = 0;
            lives = 3;
            fallingObjects = [];
            basket.x = canvas.width / 2 - 40;
            scoreElement.textContent = `Score: ${score}`;
            gameOverElement.style.display = 'none';
            draw();
        }

        // Initial draw
        draw();
    </script>

<!DOCTYPE html>

    <meta charset="utf-8" />
    <title>Novo livro cadastrado - Sharebook</title>

        Olá Administrador(a),

        Um novo livro foi cadastrado. Veja mais informações abaixo:

Livro: {Book.Title}

Autor: {Book.Author}

Usuário: {Book.User.Name}

        Informações sobre o usuário:

Data de Cadastro: {UserStats.CreationDate}

Total doações concluídas: {UserStats.TotalOk}

Total doações canceladas: {UserStats.TotalCanceled}

Total doações em atraso: {UserStats.TotalLate}

Total doações em aguardando aprovação: {UserStats.TotalWaitingApproval}

Total doações na vitrine: {UserStats.TotalAvailable}

        Use esse link para revisar e aprovar: https://www.sharebook.com.br/book/form/{Book.Id}

        Cuidado. Geralmente nã


 value `0` assigned more than once
    Au64 = 0,
    //~^NOTE first assignment of `0`
    Bu64 = 0x8000_0000_0000_0000
    //~^NOTE second assignment of `0` (overflowed from `9223372036854775808`)
}

fn main() {}
use {
    super::*,
    crate::{
        browser::BrowserState,
        errors::TreeBuildError,
        launchable::Launchable,
        verb::Internal,
    },
    std::fmt,
};

/// Either left or right
#[derive(Debug, Clone, Copy, PartialEq)]
pub enum HDir {
    Left,
    Right,
}

/// Result of applying a command to a state
pub enum AppStateCmdResult {
    ClosePanel {
        validate_purpose: bool,
    },
    DisplayError(String),
    Keep,
    Launch(Box<Launchable>),
    NewPanel {
        state: Box<dyn AppState>,
        purpose: PanelPurpose,
        direction: HDir,
    },
    NewState(Box<dyn AppState>),
    PopStateAndReapply, // the state asks the command be executed on a previous state
    PopState,
    Propagate(Internal), // command must be handled at a upper level
    Quit,
    RefreshState {
        clear_cache: bool,
    },
}

impl AppStateCmdResult {
    pub fn verb_not_found(text: &str) -> AppStateCmdResult {
        AppStateCmdResult::DisplayError(format!("verb not found: {:?}", &text))
    }
    pub fn from_optional_state(
        os: Result<Option<BrowserState>, TreeBuildError>,
        in_new_panel: bool,
    ) -> AppStateCmdResult {
        match os {
            Ok(Some(os)) => {
                if in_new_panel {
                    AppStateCmdResult::NewPanel {
                        state: Box::new(os),
                        purpose: PanelPurpose::None,
                        direction: HDir::Right,
                    }
                } else {
                    AppStateCmdResult::NewState(Box::new(os))
                }
            }
            Ok(None) => AppStateCmdResult::Keep,
            Err(e) => AppStateCmdResult::DisplayError(e.to_string()),
        }
    }
}

impl From<Launchable> for AppStateCmdResult {
    fn from(launchable: Launchable) -> Self {
        AppStateCmdResult::Launch(Box::new(launchable))
    }
}

impl fmt::Debug for AppStateCmdResult {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(
            f,
            "{}",
            match self {
                AppStateCmdResult::ClosePanel {
                    validate_purpose: false,
                } => "CancelPanel",
                AppStateCmdResult::ClosePanel {
                    validate_purpose: true,
                } => "OkPanel",
                AppStateCmdResult::DisplayError(_) => "DisplayError",
                AppStateCmdResult::Keep => "Keep",
                AppStateCmdResult::Launch(_) => "Launch",
                AppStateCmdResult::NewState { .. } => "NewState",
                AppStateCmdResult::NewPanel { .. } => "NewPanel",
                AppStateCmdResult::PopStateAndReapply => "PopStateAndReapply",
                AppStateCmdResult::PopState => "PopState",
                AppStateCmdResult::Propagate(_) => "Propagate",
                AppStateCmdResult::Quit => "Quit",
                AppStateCmdResult::RefreshState { .. } => "RefreshState",
            }
        )
    }
}
<gh_stars>1-10
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

use super::*;

#[test]
fn mss() {
    let mut options = TcpSegmentOptions::new();
    options.set_mss(0x1234);
    l


0,0.3) inset,1px 1px 2px rgba(0,0,0,0.5);box-shadow:-1px -1px 2px rgba(0,0,0,0.3) inset,1px 1px 2px rgba(0,0,0,0.5);background:#dddbd4;background:-moz-radial-gradient(30% 30% 0deg,circle farthest-side,#999c9c 24%,#898989 41%,#535555 87%) repeat scroll 0 0 transparent;background:-webkit-gradient(radial,15 15,15,30 30,40,from(#999c9c),to(#535555),color-stop(.2,#898989));cursor:pointer;opacity:.7}.yui3-skin-night .yui3-dial-reset-string{color:#fff;font-size:72%;text-decoration:none}.yui3-skin-night .yui3-dial-label{color:#cbcbcb;margin-bottom:.8em}.yui3-skin-night .yui3-dial-value-string{margin-left:.5em;color:#dcdcdc;font-size:130%}.yui3-skin-night .yui3-dial-value{visibility:hidden;position:absolute;top:0;left:102%;width:4em}.yui3-skin-night .yui3-dial-north-mark{position:absolute;border-left:2px solid #434343;height:5px;left:50%;top:-7px;font-size:1px}.yui3-skin-night .yui3-dial-marker{background-color:#a0d8ff;opacity:.2;font-size:1px}.yui3-skin-night .yui3-dial-marker-max-min{background-color:#ff0404;opacity:.6}.yui3-skin-night .yui3-dial-ring-vml,.yui3-skin-night .yui3-dial-center-button-vml,.yui3-skin-night .yui3-dial-marker v\:oval.yui3-dial-marker-max-min,.yui3-skin-night v\:oval.yui3-dial-marker-max-min,.yui3-skin-night .yui3-dial-marker-vml,.yui3-skin-night .yui3-dial-handle-vml{background:0;opacity:1}#yui3-css-stamp.skin-night-dial{display:none}
/*
YUI 3.17.0 (build ce55cc9)
Copyright 2014 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/

.yui3-datatable-sortable-column{z-index:1}.yui3-datatable-sortable-column:focus,.yui3-datatable-sortable-column:active{z-index:2}.yui3-datatable-sort-liner{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.yui3-skin-night .yui3-datatable-sortable-column{cursor:pointer}.yui3-skin-night .yui3-datatable-columns .yui3-datatable-sorted,.yui3-skin-night .yui3-datatable-sortable-column:hover{background-color:#4d4e4f;*background:#505152 url(../../../../assets/skins/night/sprite.png) repeat-x 0 -100px;background-image:-webkit-gradient(linear,0 0,0 100%,from(rgba(255,255,255,0.2)),color-stop(40%,rgba(255,255,255,0.1)),color-stop(80%,rgba(255,255,255,0.01)),to(transparent));background-image:-webkit-linear-gradient(rgba(255,255,255,0.2),rgba(255,255,255,0.1)


ek
		return Math.floor(cellOffset / cellsPerWeek) * 7 // # of days from full weeks
			+ cellToDayMap[ // # of days from partial last week
				(cellOffset % cellsPerWeek + cellsPerWeek) % cellsPerWeek // crazy math to handle negative cellOffsets
			]
			- day0; // adjustment for beginning-of-week normalization
	}

	// day offset -> date (JavaScript Date object)
	function dayOffsetToDate(dayOffset) {
		var date = cloneDate(t.visStart);
		addDays(date, dayOffset);
		return date;
	}

	//
	// TRANSFORMATIONS: date -> day offset -> cell offset -> cell
	//

	// date -> cell (combines all transformations)
	function dateToCell(date) {
		var dayOffset = dateToDayOffset(date);
		var cellOffset = dayOffsetToCellOffset(dayOffset);
		var cell = cellOffsetToCell(cellOffset);
		return cell;
	}

	// date -> day offset
	function dateToDayOffset(date) {
		return dayDiff(date, t.visStart);
	}

	// day offset -> cell offset
	function dayOffsetToCellOffset(dayOffset) {
		var day0 = t.visStart.getDay(); // first date's day of week
		dayOffset += day0; // normalize dayOffset to beginning-of-week
		return Math.floor(dayOffset / 7) * cellsPerWeek // # of cells from full weeks
			+ dayToCellMap[ // # of cells from partial last week
				(dayOffset % 7 + 7) % 7 // crazy math to handle negative dayOffsets
			]
			- dayToCellMap[day0]; // adjustment for beginning-of-week normalization
	}

	// cell offset -> cell (object with row & col keys)
	function cellOffsetToCell(cellOffset) {
		var colCnt = t.getColCnt();

		// rtl variables. wish we could pre-populate these. but where?
		var dis = isRTL ? -1 : 1;
		var dit = isRTL ? colCnt - 1 : 0;

		var row = Math.floor(cellOffset / colCnt);
		var col = ((cellOffset % colCnt + colCnt) % colCnt) * dis + dit; // column, adjusted for RTL (dis & dit)
		return {
			row: row,
			col: col
		};
	}

	//
	// Converts a date range into an array of segment objects.
	// "Segments" are horizontal stretches of time, sliced up by row.
	// A segment object has the following properties:
	// - row
	// - cols
	// - isStart
	// - isEnd
	//
	function rangeToSegments(startDate, endDate) {
		var rowCnt = t.getRowCnt();
		var colCnt = t.getColCnt();
		var segments = []; // array of segments to return

		// day offset for given date range
		var rangeDayOffsetStart = dateToDayOffset(startDate);
		var rangeDayOffsetEnd = dateToDayOffset(endDate); // exclusive

		// first and last cell offset for the given date range
		// "last" implies inclusivity
		var rangeCellOffsetFirst = dayOffsetToCellOffset(rangeDayOffsetStart);
		var rangeCellOffsetLast = dayOffsetToCellOffset(rangeDayOffsetEnd) - 1;

		// loop through all the rows in the view
		for (var row=0; row<rowCnt; row++) {

			// first and last cell offset for the row
			var rowCellOffsetFirst = row * colCnt;
			var rowCellOffsetLast = rowCellOffsetFirst + colCnt - 1;

			// get the segment's cell offsets by constraining the range's cell offsets to the bounds of the row
			var segmentCellOffsetFirst = Math.max(rangeCellOffsetFirst, rowCellOffsetFirst);
			var segmentCellOffsetLast = Math.min(rangeCellOffsetLast, rowCell


protonvpn.android.redesign.countries.Translator
import com.protonvpn.android.redesign.vpn.ConnectIntent
import com.protonvpn.android.redesign.vpn.ServerFeature
import com.protonvpn.android.redesign.vpn.ui.ConnectIntentLabels
import com.protonvpn.android.redesign.vpn.ui.GetConnectIntentViewState
import com.protonvpn.android.servers.ServerManager2
import com.protonvpn.mocks.FakeGetProfileById
import com.protonvpn.test.shared.createServer
import com.protonvpn.testRules.setVpnContent
import io.mockk.MockKAnnotations
import io.mockk.coEvery
import io.mockk.every
import io.mockk.impl.annotations.MockK
import kotlinx.coroutines.test.runTest
import me.proton.core.domain.entity.UserId
import me.proton.test.fusion.Fusion.node
import me.proton.test.fusion.ui.compose.FusionComposeTest
import org.junit.Before
import org.junit.Test
import java.util.EnumSet

// These tests use mocking of final classes that's not available on API < 28
@SdkSuppress(minSdkVersion = 28)
class GetConnectIntentViewStateTestsCompose : FusionComposeTest() {

    @MockK
    private lateinit var mockServerManager: ServerManager2

    @MockK
    private lateinit var mockTranslator: Translator

    private lateinit var getConnectIntentViewState: GetConnectIntentViewState

    private val noServerFeatures = EnumSet.noneOf(ServerFeature::class.java)
    private val p2pServerFeatures = EnumSet.of(ServerFeature.P2P)

    private val serverCh =
        createServer("serverCh1", serverName = "CH#1", exitCountry = "CH", city = "Zurich", tier = 2)
    private val serverChState =
        createServer("serverChState1", serverName = "CH-R#1", exitCountry = "CH", city = "Zurich", tier = 2, state = "Canton Zurich")
    private val serverChFree =
        createServer("serverCh1Free", serverName = "CH-FREE#1", exitCountry = "CH", city = "Zurich", tier = 0)
    private val serverPl = createServer(
        "serverPl1",
        serverName = "PL#1",
        exitCountry = "PL",
        city = "Warsaw",
        tier = 2,
        features = SERVER_FEATURE_P2P
    )
    private val serverPlNoFeatures =
        createServer("serverPl2", serverName = "PL#2", exitCountry = "PL", city = "Warsaw", tier = 2)
    private val serverPlViaCh =
        createServer("serverPlViaCh", serverName = "CH-PL#1", exitCountry = "PL", entryCountry = "CH", tier = 2)
    private val serverLtViaSe =
        createServer("serverLtViaSe", serverName = "SE-LT#1", exitCountry = "LT", entryCountry = "SE", tier = 2)
    private val serverGateway =
        createServer(
            "serverGateway",
            serverName = "VPN#1",
            exitCountry = "US",
            gatewayName = "Gateway Name",
            tier = 2,
            features = SERVER_FEATURE_RESTRICTED
        )

    private val switzerland = CountryId("ch")
    private val poland = CountryId("pl")

    private lateinit var profiles: FakeGetProfileById

    @Before
    fun setup() {
        MockKAnnotations.init(this)

        val allServers = listOf(serverCh, serverChFree, serverPl, serverPlNoFeatures, serverLtViaSe, serverPlViaCh, serverGateway)
        coEvery { mockServerManager.getServerById(any()) } answers {
            allServers.find { it.serverId == firstArg() }
        }
        coEvery { mockServerManager.getFreeCountries() } returns listOf(Vpn


БО-01 (RU000A100YE6): цена=95.69%, доходность=9.87%, дюрация=21.53 мес.

Строка 870 из 2235: МЕТАЛЛОИНВЕСТ БО-03 (RU000A100YF3): цена=91.05%, доходность=9.73%, дюрация=34.23 мес.

Строка 871 из 2235: ГК Самолет БО-П07 (RU000A100YG1): цена=100.33%, доходность=12.08%, дюрация=7.96 мес.

Поиск оборота. Ссылка: https://iss.moex.com/iss/history/engines/stock/markets/bonds/boards/TQCB/securities/RU000A100YG1.json?iss.meta=off&iss.only=history&history.columns=SECID,TRADEDATE,VOLUME,NUMTRADES&limit=20&from=2022-01-30.

Поиск оборота. Во всех 10 днях оборот по бумаге RU000A100YG1 был больше, чем 550 шт каждый день.

Поиск оборота. Итоговый оборот в бумагах (объем сделок, шт) за 10 дней: 186189 шт нарастающим итогом.

Поиск выплат. Купоны для RU000A100YG1 выплачиваются в 4,7,10 месяцы.

Для ГК Самолет БО-П07 все даты будущих платежей с известным значением выплат.

Результат № 32: ["ГК Самолет БО-П07","RU000A100YG1",100.33,186189,12.08,7.96,"–––-–––-–––-апр-–––-–––-июл-–––-–––-окт-–––-–––"].

Строка 872 из 2235: КАМАЗ ПАО БО-П05 (RU000A100YK3): цена=99.02%, доходность=10.88%, дюрация=5.5 мес.

Поиск оборота. Ссылка: https://iss.moex.com/iss/history/engines/stock/markets/bonds/boards/TQCB/securities/RU000A100YK3.json?iss.meta=off&iss.only=history&history.columns=SECID,TRADEDATE,VOLUME,NUMTRADES&limit=20&from=2022-01-30.

Поиск оборота. На 10-й день из 10 оборот по бумаге RU


.random(5, 15) },
		{ x = 485, y = globals.ground_level + math.random(5, 15) },
		{ x = 497, y = globals.ground_level + math.random(5, 15) },
		{ x = 533, y = globals.ground_level + math.random(5, 15) },
		{ x = 555, y = globals.ground_level + math.random(5, 15) },
		{ x = 585, y = globals.ground_level + math.random(5, 15) },
		{ x = 621, y = globals.ground_level + math.random(5, 15) },
		{ x = 635, y = globals.ground_level + math.random(5, 15) },
	}

	function ground:draw()
		frame.display.bitmap(
			1,
			globals.ground_level,
			sprites.ground.width,
			2,
			globals.colors.brown,
			sprites.ground.image
		)
		for i = 1, #self.__dirt_pos, 1 do
			frame.display.bitmap(
				self.__dirt_pos[i].x,
				self.__dirt_pos[i].y,
				5,
				2,
				globals.colors.brown,
				self.__dirt_data
			)
		end
		for i = 1, #self.__bumps, 1 do
			frame.display.bitmap(
				self.__bumps[i].pos.x,
				self.__bumps[i].pos.y,
				sprites.bump.width,
				2,
				globals.colors.brown,
				self.__bumps[i].sprite
			)
		end
	end

	function ground:__update_pos(pos, reset)
		pos.x = pos.x + self.__vel_x
		if pos.x <= self.__min_x and reset then
			pos.x = globals.screenwidth
		end
		return pos
	end

	function ground:__update_dirt_pos()
		for i = 1, #self.__dirt_pos, 1 do
			self.__dirt_pos[i] = self:__update_pos(self.__dirt_pos[i], true)
		end
	end

	function ground:__update_bump_pos_and_clean()
		local bumps_to_remove = {}
		for i = 1, #self.__bumps, 1 do
			self.__bumps[i].pos = self:__update_pos(self.__bumps[i].pos, false)

			if self.__bumps[i].pos.x <= 1 then
				table.insert(bumps_to_remove, i)
			end
		end

		for _, i in ipairs(bumps_to_remove) do
			table.remove(self.__bumps, i)
		end
	end

	function ground:__add_new_bumps(frames)
		if frames % self.__bump_freq == 17 and math.random(1, 2) == 1 then
			local bump_idx = math.random(1, 2)
			table.insert(self.__bumps, {
				sprite = sprites.bump.images[bump_idx],
				pos = { x = globals.screenwidth, y = globals.ground_level - sprites.bump.offset[bump_idx] },
			})
		end
	end

	function ground:increase_difficulty(score)
		if score > 100 then
			self:set_speed(25)
		elseif score > 200 then
			self:set_speed(30)
		elseif score > 400 then
			self:set_speed(45)
		end
	end

	function ground:update(dino, frames, score)
		if not dino.hit then
			self:__update_dirt_pos()
			self:__add_new_bumps(frames)
			self:__update_bump_pos_and_clean()
			self:increase_difficulty(score)
		end
	end

	function ground:set_speed(new_speed)
		self.__vel_x = -new_speed
	end

	return ground
end

Ground = {
	new_ground = _new_ground,
}
return Ground


;   do j=5 to ceil(ranuni(111)*30); </tt>

<tt>      ptr=ceil(ranuni(222)*nobsadv); </tt>

<tt>      set adv point=ptr nobs=nobsadv; </tt>

<tt>      output; </tt>

<tt>    end; </tt>

<tt>  end; </tt>

<tt>  stop; </tt>

<tt>  drop j; </tt>

<tt>run; </tt>

Now I'll run the code.

<tt>Roland@DELL1 /cygdrive/c/pharma/xenuyama/tokyo/DRUG001/DRUG001C3001/24weeks/progs</tt>

<tt>$ echo $prog</tt>

<tt>d01_demog</tt>

<tt>Roland@DELL1 /cygdrive/c/pharma/xenuyama/tokyo/DRUG001/DRUG001C3001/24weeks/progs</tt>

<tt>$ sasb</tt>

<tt>sas program "d01_demog" ended with return code 0:</tt>

<tt>0 ERROR(s)</tt>

<tt>0 WARNING(s)</tt>

<tt>Roland@DELL1 /cygdrive/c/pharma/xenuyama/tokyo/DRUG001/DRUG001C3001/24weeks/progs</tt>

<tt>$ sasb d02_adv</tt>

<tt>sas program "d02_adv" ended with return code 0:</tt>

<tt>0 ERROR(s)</tt>

<tt>0 WARNING(s)</tt>

<tt>Roland@DELL1 /cygdrive/c/pharma/xenuyama/tokyo/DRUG001/DRUG001C3001/24weeks/progs</tt>

<tt>$</tt>

The programs ran without any problems. Time for another "find ." from
the pharma directory to see what we have now.

<tt>Roland@DELL1 /cygdrive/c/pharma/xenuyama/tokyo/DRUG001/DRUG001C3001/24weeks/progs</tt>

<tt>$ cd /cygdrive/c/pharma</tt>

<tt>Roland@DELL1 /cygdrive/c/pharma</tt>

<tt>$ find .</tt>

<tt>.</tt>

<tt>./mk_ifmts.sas</tt>

<tt>./xenuyama</tt>

<tt>./xenuyama/formats</tt>

<tt>./xenuyama/macros</tt>

<tt>./xenuyama/tokyo</tt>

<tt>./xenuyama/tokyo/DRUG001</tt>

<tt>./xenuyama/tokyo/DRUG001/DRUG001C3001</tt>

<tt>./xenuyama/tokyo/DRUG001/DRUG001C3001/24weeks</tt>

<tt>./xenuyama/tokyo/DRUG001/DRUG001C3001/24weeks/data</tt>

<tt>./xenuyama/tokyo/DRUG001/DRUG001C3001/24weeks/data/analysis</tt>

<tt>./xenuyama/tokyo/DRUG001/DRUG001C3001/24weeks/data/derived</tt>

<tt>./xenuyama/tokyo/DRUG001/DRUG001C3001/24weeks/data/derived/adv.sas7bdat</tt>

<tt>./xenuyama/tokyo/DRUG001/DRUG001C3001/24weeks/data/derived/demog.sas7bdat


;----------------------------------------------------------------------------------------
;	gemdos.s, part of TOS Linker for CodeWarrier
;
;	Gemdos system calls for TOS
;	Pure Asm version
;
;	16.11.1998 by Daniel Hpfl, Manfred Lippert
;   based on CodeWarrior-Version by Manfred Lippert
;
;	last change: 26.11.1998
;
;	Don't edit this file.
;
;	If you have to make any changes on this file, please contact:
;	mani@mani.de
;----------------------------------------------------------------------------------------

.export Cauxin, Cauxis, Cauxos, Cauxout, Cconin
.export Cconis, Cconos, Cconout, Cconrs, Cconws
.export Cnecin, Cprnos, Cprnout, Crawcin, Crawio

.export Dclosedir, Dcntl, Dcreate, Ddelete, Dfree
.export Dgetcwd, Dgetdrv, Dgetpath, Dlock, Dopendir
.export Dpathconf, Dreaddir, Dreadlabel, Drewinddir, Dsetdrv
.export Dsetpath, Dwritelabel, Dxreaddir

.export Fattrib, Fchmod, Fchown, Fclose, Fcntl
.export Fcreate, Fdatime, Fdelete, Fdup, Fforce
.export Fgetchar, Fgetdta, Finstat, Flink, Flock
.export Fmidipipe, Fopen, Foutstat, Fpipe, Fputchar
.export Fread, Freadlink, Frename, Fseek, Fselect
.export Fsetdta, Fsfirst, Fsnext, Fsymlink, Fwrite
.export Fxattr

.export Maddalt, Malloc, Mfree, Mshrink, Mxalloc

.export Pause, Pdomain, Pexec, Pfork, Pgetauid
.export Pgetegid, Pgeteuid, Pgetgid, Pgetpgrp, Pgetpid
.export Pgetppid, Pgetuid, Pkill, Pmsg, Pnice
.export Prenice, Prusage, Psemaphore, Psetauid, Psetgid
.export Psetlimit, Psetpgrp, Psetuid, Psigaction, Psigblock
.export Psignal, Psigpause, Psigpending, Psigreturn, Psigsetmask
.export Pterm, Pterm0, Ptermres, Pumask, Pusrval
.export Pvfork, Pwait, Pwait3, Pwaitpid

.export Salert, Slbopen, Slbclose, Sconfig, Srealloc
.export Super, Ssystem, Sversion, Syield, Sysconf

.export Talarm, Tgetdate, Tgettime, Tsetdate, Tsetitimer
.export Tsettime

MACRO GEMDOS_0 nr
		pea (a2)
		move.w #nr,-(sp)
		trap #1
		addq.l #2,sp
		move.l (sp)+,a2
ENDM

MACRO GEMDOS_2 nr
		pea (a2)
		move.w 8(sp),-(sp)
		move.w #nr,-(sp)
		trap #1
		addq.l #4,sp
		move.l (sp)+,a


#define FT5x06_DISTANCE_ZOOM_REG          (0x96) /* Maximum distance */
#define FT5x06_LIB_VER_H_REG              (0xa1) /* MS LIB version */
#define FT5x06_LIB_VER_L_REG              (0xa2) /* LS LIB version */
#define FT5x06_CIPHER_REG                 (0xa3) /* Chip selecting */
#define FT5x06_GMODE_REG                  (0xa4) /* Interrupt mode */
#define FT5x06_PWR_MODE_REG               (0xa5) /* Power mode */
#define FT5x06_FIRMID_REG                 (0xa6) /* Firmware version */
#define FT5x06_CHIP_ID_REG                (0xa8) /* Chip ID */
#define FT5x06_RELEASE_CODE_ID_REG        (0xaf) /* Release code version */
#define FT5x06_STATE_REG                  (0xbc) /* Current operating mode */

#define FT5x06_TOUCH_DATA_STARTREG        (1)  /* Address where data begins */

/* Possible values of the DEV_MODE register */

#define FT5x06_DEV_MODE_WORKING           (0x00)
#define FT5x06_DEV_MODE_FACTORY           (0x04)

/* Possible values of the GEST_ID register */

#define FT5x06_GEST_ID_NO_GESTURE         (0x00)
#define FT5x06_GEST_ID_MOVE_UP            (0x10)
#define FT5x06_GEST_ID_MOVE_RIGHT         (0x14)
#define FT5x06_GEST_ID_MOVE_DOWN          (0x18)
#define FT5x06_GEST_ID_MOVE_LEFT          (0x1C)
#define FT5x06_GEST_ID_SINGLE_CLICK       (0x20)
#define FT5x06_GEST_ID_DOUBLE_CLICK       (0x22)
#define FT5x06_GEST_ID_ROTATE_CLOCKWISE   (0x28)
#define FT5x06_GEST_ID_ROTATE_C_CLOCKWISE (0x29)
#define FT5x06_GEST_ID_ZOOM_IN            (0x40)
#define FT5x06_GEST_ID_ZOOM_OUT           (0x49)

/* Values related to FT5x06_CTRL_REG */

#define FT5x06_CTRL_KEEP_ACTIVE_MODE      (0x00)
#define FT5x06_CTRL_KEEP_AUTO_SWITCH_MONITOR_MODE (0x01)

/* Possible values of FT5x06_GMODE_REG */

#define FT5x06_G_MODE_INTERRUPT_POLLING   (0x00)
#define FT5x06_G_MODE_INTERRUPT_TRIGGER   (0x01)

/* Possible values of FT5x06_CHIP_ID_REG */

#define FT5x06_ID_VALUE                   (0x51)

/* Operations on struct ft5x06_touch_point_s */

#define TOUCH_POINT_GET_EVENT(t)          ((t).xh >> 6)
#define TOUCH_POINT_GET_ID(t)             ((t).yh >> 4)
#define TOUCH_POINT_GET_X(t)              ((((t).xh & 0x0f) << 8) | (t).xl)
#define TOUCH_POINT_GET_Y(t)              ((((t).yh & 0x0f) << 8) | (t).yl)

/****************************************************************************
 * Public Types
 ****************************************************************************/

enum touch_event_e
{
  FT5x06_DOWN    = 0,  /* The state changed to touched */
  FT5x06_UP      = 1,  /* The state changed to not touched */
  FT5x06_CONTACT = 2,  /* There is a continuous touch being detected */
  FT5x06_INVALID = 3   /* No touch information available */
};

/* Describes on touchpoint returned by the FT5x06 */

struct ft5x06_touch_point_s
{
  uint8_t xh;
  uint8_t xl;
  uint8_t yh;
  uint8_t yl;
  uint8_t weight;
  uint8_t area;
};

/* Describes all touch data returned by the FT5x06 */

struct ft5x06_touch_data_s
{
  uint8_t gestid;      /* Gesture ID */
  uint8_t tdstatus;    /* Touch status */
  struct ft5x06_touch_point_s touch[FT5x06_MAX_TOUCHES];
};

/****************************************************************************
 * Public Function Prototypes
 ****************************************************************************/

#ifdef __cplusplus
#define EXTERN extern "C"
extern "C"
{
#else
#define EXTERN extern
#endif

#undef EXTERN
#ifdef __cplusplus
}
#endif

#endif /* __DRIVERS_INPUT_FT5X06_H */