精华内容
下载资源
问答
  • VaR 与 CVaR

    万次阅读 2018-12-24 17:48:24
    VaR, value at risk, 风险价值,表示金融产品在给定置信水平 α\alphaα 下的最小损失。用 XXX 表示该随机波动的...VaRα(X)=inf⁡{t∣FX(t)≥α}\text{VaR}_\alpha(X)=\inf\{t\mid F_X(t)\geq \alpha\}VaRα​(X)...

    VaR, value at risk, 风险价值,表示金融产品在给定置信水平 α \alpha α 下的最大损失。用 X X X 表示该随机波动的金融产品收益, F X ( x ) F_X(x) FX(x) 为其累计概率分布,则 VAR 的数学表示式为:

    VaR α ( X ) = − inf ⁡ { t ∣ F X ( t ) ≥ α } \text{VaR}_\alpha(X)=-\inf\{t\mid F_X(t)\geq \alpha\} VaRα(X)=inf{tFX(t)α}

    或用概率表达式:
    VaR α ( X ) = − inf ⁡ { t ∣ Pr ⁡ ( x ≤ t ) ≥ α } \text{VaR}_\alpha(X)=-\inf\{t\mid \Pr(x\leq t)\geq \alpha\} VaRα(X)=inf{tPr(xt)α}

    CVaR, conditional value at risk. 表示金融产品在既定置信水平 α \alpha α 下,损失超过 VAR 的期望损失,数学表达式为:
    C V a R α = − ∫ 0 α V a R r ( X ) d r α CVaR_\alpha=-\frac{\int_0^\alpha VaR_r(X)dr}{\alpha} CVaRα=α0αVaRr(X)dr

    对于CVAR,Rockafellar 与 Uryasev 还提出了一个等价表达式:

    C V a R α = t + 1 1 − α ∫ t ∞ ( z − t ) d z CVaR_\alpha=t+\frac{1}{1-\alpha}\int_t^\infty(z-t)dz CVaRα=t+1α1t(zt)dz

    其中, t t t 就是 V a R VaR VaR,而 z z z 为金融产品的损失函数。

    展开全文
  • 使用var关键字声明变量不使用var关键字声明变量,这2者的区别 /* 说明: 1.使用var声明变量,在方法内部是局部变量,在方法外部是全局变量 2.没有使用var声明的变量,在方法内部或外部都是全局变量,但如果是在...

    使用var关键字声明变量和不使用var关键字声明变量,这2者的区别

    /*
    说明:
    1.使用var声明变量,在方法内部是局部变量,在方法外部是全局变量
    2.没有使用var声明的变量,在方法内部或外部都是全局变量,但如果是在方
    法内部声明,在方法外部使用之前需要先调用方法,告知系统声明了全局变量后方可在方法外部使用。
    
    在函数作用域内 加var定义的变量是局部变量,不加var定义的就成了全局变量
    在function内部, 加var的是局部变量, 不加var的则是全局变量;
    在function外部, 不管有没有使用var声明变量,都是全局变量,在function外部,var关
    键字一般可以省略,但是为了书写规范和维护方便以及可读性好,我个人不建议省略var关键字!
    */

    直接po代码

    <script type="text/javascript">
    
    //代码报错。可见没有var关键字,变量的声明不会提前,没有”预编译”的过程。
    	alert(a);//a is not defined
    	a = 1;
    	//var a = 1;
    	
    
    	//案例1(参考网址https://blog.csdn.net/aitangyong/article/details/40817587)
    	/*
    	 function TestClass() {  
    	 //没有使用var关键字定义的是全局变量  
    	 val = 1;  
    	 alert(val);  
    	 //全局变量会存放在window对象中  
    	 alert(window.val);  
    	
    	 }
    
    	 //调用TestClass构造函数  
    	 test = new TestClass();  
    	 //再次验证是一个全局变量  
    	 alert("val=" + val);
    	 */
    
    	function TestClass() {
    		val = 1;
    		alert(val);//1  
    		alert(window.val);//undefined  
    
    		var val = 10;
    		alert(val);//10  
    		alert(window.val);//undefined  
    	}
    
    	var test = new TestClass();
    
    	// 	alert(val);//js报错,变量未定义  
    
    	//案例2
    
    	var n1 = 1;
    	n2 = 2;
    
    	function f1() {
    		var n3 = 3;
    		n4 = 4;
    	}
    
    	console.log("n1=" + n1);
    	console.log("n2=" + n2);
    	// 	console.log("n3="+n3) //Error: n3 is not defined
    	// 	console.log("n4="+n4) //Error: n4 is not defined
    	console.log("=======================");
    	f1();
    	console.log("n1=" + n1);
    	console.log("n2=" + n2);
    	// 	console.log("n3="+n3); //Error: n3 is not defined
    	console.log("n4=" + n4);
    
    /*
    说明:
    1.使用var声明变量,在方法内部是局部变量,在方法外部是全局变量
    2.没有使用var声明的变量,在方法内部或外部都是全局变量,但如果是在方
    法内部声明,在方法外部使用之前需要先调用方法,告知系统声明了全局变量后方可在方法外部使用。
    
    在函数作用域内 加var定义的变量是局部变量,不加var定义的就成了全局变量
    在function内部, 加var的是局部变量, 不加var的则是全局变量;
    在function外部, 不管有没有使用var声明变量,都是全局变量,在function外部,var关
    键字一般可以省略,但是为了书写规范和维护方便以及可读性好,我个人不建议省略var关键字!
    */
    </script>

     

    展开全文
  • js实现问卷星根据答案自动填写2019年11月

    万次阅读 热门讨论 2019-11-13 09:21:29
    (过程需要翻墙,问卷星链接需要在浏览器打开,在微信直接打开的链接本... 油侯脚本是一款免费的浏览器扩展最为流行的用户脚本管理器,增强了用户对浏览体验的控制权。油侯脚本下载地址:http://www.tampermo...

    参考链接地址:https://www.cnblogs.com/FHC1994/p/11721723.html

     

    (过程需要翻墙,问卷星链接需要在浏览器打开,在微信直接打开的链接本脚本无法使用)

     

            ①安装脚本:

            油侯脚本是一款免费的浏览器扩展和最为流行的用户脚本管理器,增强了用户对浏览体验的控制权。油侯脚本下载地址:http://www.tampermonkey.net/

            ②点击图片中红框位置按钮(因为我已经下载了,所以显示的是已安装)

            ③拉到页面最下方,点击添加至Chrome按钮

            ④添加完成后,在Chrome浏览器的右上方有下图所示按钮,点击之后,选择添加新脚本

            ⑤复制如下代码至“添加新脚本”页面内

    // ==UserScript==
    // @name         问卷星测试——支持input radio checkbox
    // @version      1.1
    // @description  测试
    // @author       蛋片鸡
    // @match        https://www.wjx.top/*
    // @match        https://www.wjx.cn/*
    // @grant        none
    // @require      https://code.jquery.com/jquery-3.4.1.min.js
    // ==/UserScript==
    
    
    
    /*
    **info 第一个参数:对应的填入选项(字符串)
    **info 第二个参数:匹配的标题(正则表达式)
    **info 第三个参数:(可选),当答题框为单选|多选时匹配的选项(正则表达式)
    */
    
    (function() {
        'use strict';
        const info=[
            ["蛋片鸡",/(姓名)|(名字)/],
            ["单选框_年级",/(年级)/,/(18级)/],
            ["18711111",/(学号)/],
            ["11011001100",/(联系方式)|(电话)|(手机)|(手机号)/],
            ["多选框_你好呀",/(你好呀)/,/(开始)|(中间)|(结束)/]
        ];
        const ini={
            module:".field.ui-field-contain",//每个问题模块
            title:".field-label",//标题
            type:{                              //key对应别名,value对应html的节点
               "input_text":".ui-input-text",
               "radio":".ui-radio",
               "checkbox":".ui-checkbox"
            }
        };
        $(document).ready(function(){
            let itemNum = 0;
            $(ini.module).each(function(){
                itemNum += 1;
                let title=$(this).find(ini.title).text();
                console.log("each循环" + itemNum);
                //判断类别
                let count = 0 ;
                for(let i=0;i<info.length;i++){//匹配用户信息
                    if(info[i][1].test(title)){//匹配到一处信息,判断答题框类型,加break!
                       for(let tp in ini.type){
                           let dom=$(this).find(ini.type[tp]);
                           if(dom.length>0){
                               switch(tp){
                                   case "input_text":
                                       $("#q"+itemNum)[0].value = info[i][0]; //赋值
                                       break;
                                    case "radio":
                                       $(this).find(".ui-radio").each(function(){
                                            if(info[i].length>=3&&info[i][2].test($(this).text())){
                                                var id=$(this).find('input').attr('id');
                                                $("#"+id).prop("checked",true);
                                            }
                                        });
                                        break;
                                    case "checkbox":
                                        $(this).find(".ui-checkbox").each(function(){
                                           console.log("outsidebox" + count);
                                            if(info[i].length>=3&&info[i][2].test($(this).text())){
                                                var id=$(this).find('input').attr('id');
                                                $("#"+id).prop("checked",true);
                                            }
                                        });
                                        break;
                                    default:console.log("ini.type中没有匹配"+tp+"的键值");
                               }
                               break;
                           }
                       }
                        break;
                    }
                }
            });
           //$("#ctlNext")[0].click();
        });
    })();

            ⑥在“添加至新脚本”页面中,点击左上角的保存按钮

            ⑦打开问卷星地址,已经实现根据设定的答案,自动填写。

          ⑧额外说明:

            a、因为本人对js不太熟悉,所以有个问题要说明。当我们刷新页面的时候,发现填空题填写了,但是单选和多选是没有选上的,其实在js脚本里面,代码里是已经选上对应的选项了的,只不过不知道样式怎么不显示。(可以通过创建和我一样问题的问卷,然后做一下这份问卷,再提交问卷,最后到问卷后台查看提交的记录中是否有单选和多选记录即可)

            b、因为本js脚本是根据问卷星页面源代码进行编写的,有时候问卷星修改了html节点的命名,就需要去修改本例对应的节点名称,这边附上本例测试时间,问卷星的源代码和问卷星的链接地址(https://www.wjx.cn/m/49588636.aspx),供大家参考对照,修改节点名称。

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
     <head> 
      <title>测试使用</title> 
      <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> 
      <meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1,user-scalable=no" /> 
      <meta name="format-detection" content="telephone=no" /> 
      <link rel="canonical" href="https://www.wjx.cn/jq/49588636.aspx" /> 
      <meta property="og:type" content="article" /> 
      <meta property="og:release_date" content="2019-11-12" /> 
      <meta property="og:image" content="https://image.wjx.com/images/wlogo.png" /> 
      <meta property="og:title" content="测试使用" /> 
      <meta property="og:description" content="我在问卷星上发布了问卷《测试使用》,请帮忙填写,非常感谢!" /> 
      <meta name="applicable-device" content="mobile" /> 
      <link rel="dns-prefetch" href="//sojump.cn-hangzhou.log.aliyuncs.com" /> 
      <script type="text/javascript">
            var maxCheatTimes = 0;
            var activityId =49588636;
            if (window.location.hash) {
                window.location.hash = "";
                window.location.href = window.location.href.replace("#", "");
            }
            var isWeiXin=0;
        </script> 
      <link rel="stylesheet" href="/joinnew/css/jqmobo.css?v=973" /> 
      <script src="https://staticfile.qnssl.com/jquery/1.10.2/jquery.min.js"></script> 
      <script type="text/javascript">
            !window.jQuery && document.write('<script src="/js/jquery-1.10.2.min.js"><\/script>');
        </script> 
      <script src="/joinnew/js/hintinfo.js?v=2" type="text/javascript"></script> 
      <script src="/joinnew/js/jqmobo2.js?v=973" type="text/javascript"></script> 
      <style>
     
    
    
        </style> 
     </head> 
     <body> 
      <div id="divTip" style="position:absolute; left: 0; right: 0; z-index: 10; display: none; font-size: 14px; color: #ffffff; line-height: 24px; padding: 8px; background-color: #f95b5b;"></div> 
      <div id="tipHeight" style="height:40px;display:none;"></div> 
      <div style="background: #fff; position: fixed; top: 0px; left: 0px; right: 0px; bottom: 0px; z-index: 2; display: none;" id="divWorkError"> 
      </div> 
      <form id="form1" method="post" action="https://www.wjx.cn/joinnew/processjq.ashx?curid=49588636" style="overflow:hidden;"> 
       <div id="divLoadAnswer" style="display: none; font-size: 14px;line-height:24px;padding:6px 8px;background-color: #fff9f0;"> 
       </div> 
       <div id="toptitle"> 
        <h1 class="htitle" id="htitle"> 测试使用</h1> 
       </div> 
       <div id="divBackgroundWrap"></div> 
       <div id="divMaxTime" style="display: none; background: #FFEAEA; color: #FF5760; font-size: 16px; height: 40px; left: 0; line-height: 40px; position: fixed; text-align: center; top: 0; width: 100%; z-index: 100;"> 
        <span id="spanTimeTip"></span>&nbsp;
        <span id="spanMaxTime"></span> 
       </div> 
       <div id="divContent" class="divContent"> 
        <div class="checkInMode__head clearfix" id="divCheckInMode" style="display: none;"> 
         <div class="wjxCountDown__wrap game_time"> 
          <div class="countDown__hold"> 
           <div class="round round1"></div> 
          </div> 
          <div class="countDown__hold"> 
           <div class="round round2"></div> 
          </div> 
          <div class="countDown__bg"></div> 
          <div class="CountDown__frame"></div> 
          <div class="countDown__time"> 
           <div class="countDown__time--num" id="divCGMaxTime">
            10
           </div> 
           <div class="countDown__time--unit">
            秒
           </div> 
          </div> 
         </div> 
         <div class="icon decoration-icon pull-left"></div> 
         <div class="schedule-wrap pull-right"> 
          <div id="schedule">
           1
          </div> / 
          <span id="cgtotal">5</span>题 
         </div> 
        </div> 
        <div id="divDesc" class="formfield"> 
         <span class="description"> 哈哈哈</span> 
        </div> 
        <div id="divQuestion"> 
         <fieldset class="fieldset" style="" id="fieldset1">
          <div class="field ui-field-contain" id="div1" topic="1" data-role="fieldcontain" type="1">
           <div class="field-label">
            1. 姓名
           </div>
           <div class="ui-input-text" style="position:relative;">
            <input type="text" id="q1" value="" name="q1" />
           </div>
           <div class="errorMessage"></div>
          </div>
          <div class="field ui-field-contain" id="div2" req="1" topic="2" data-role="fieldcontain" type="3">
           <div class="field-label">
            2. 年级
            <span class="req">*</span>
           </div>
           <div class="ui-controlgroup">
            <div class="ui-radio">
             <span class="jqradiowrapper"><input type="radio" value="1" id="q2_1" name="q2" style="display:none;" /><a class="jqradio" href="javascript:;"></a></span>
             <div class="label" for="q2_1">
              16级
             </div>
            </div>
            <div class="ui-radio">
             <span class="jqradiowrapper"><input type="radio" value="2" id="q2_2" name="q2" style="display:none;" /><a class="jqradio" href="javascript:;"></a></span>
             <div class="label" for="q2_2">
              17级
             </div>
            </div>
            <div class="ui-radio">
             <span class="jqradiowrapper"><input type="radio" value="3" id="q2_3" name="q2" style="display:none;" /><a class="jqradio" href="javascript:;"></a></span>
             <div class="label" for="q2_3">
              18级
             </div>
            </div>
            <div class="ui-radio">
             <span class="jqradiowrapper"><input type="radio" value="4" id="q2_4" name="q2" style="display:none;" /><a class="jqradio" href="javascript:;"></a></span>
             <div class="label" for="q2_4">
              19级
             </div>
            </div>
           </div>
           <div class="errorMessage"></div>
          </div>
          <div class="field ui-field-contain" id="div3" topic="3" data-role="fieldcontain" type="1">
           <div class="field-label">
            3. 学号
           </div>
           <div class="ui-input-text" style="position:relative;">
            <input type="text" id="q3" value="" name="q3" />
           </div>
           <div class="errorMessage"></div>
          </div>
          <div class="field ui-field-contain" id="div4" topic="4" data-role="fieldcontain" type="1">
           <div class="field-label">
            4. 联系方式
           </div>
           <div class="ui-input-text" style="position:relative;">
            <input type="text" id="q4" value="" name="q4" />
           </div>
           <div class="errorMessage"></div>
          </div>
          <div class="field ui-field-contain" id="div5" req="1" topic="5" data-role="fieldcontain" type="4">
           <div class="field-label">
            5. 你好呀
            <span class="req">*</span>
            <span class="qtypetip">&nbsp;【多选题】</span>
           </div>
           <div class="ui-controlgroup">
            <div class="ui-checkbox">
             <span class="jqcheckwrapper"><input type="checkbox" value="1" id="q5_1" name="q5" style="display:none;" /><a class="jqcheck" href="javascript:;"></a></span>
             <div class="label" for="q5_1">
              开始
             </div>
            </div>
            <div class="ui-checkbox">
             <span class="jqcheckwrapper"><input type="checkbox" value="2" id="q5_2" name="q5" style="display:none;" /><a class="jqcheck" href="javascript:;"></a></span>
             <div class="label" for="q5_2">
              中间
             </div>
            </div>
            <div class="ui-checkbox">
             <span class="jqcheckwrapper"><input type="checkbox" value="3" id="q5_3" name="q5" style="display:none;" /><a class="jqcheck" href="javascript:;"></a></span>
             <div class="label" for="q5_3">
              加速
             </div>
            </div>
            <div class="ui-checkbox">
             <span class="jqcheckwrapper"><input type="checkbox" value="4" id="q5_4" name="q5" style="display:none;" /><a class="jqcheck" href="javascript:;"></a></span>
             <div class="label" for="q5_4">
              结束
             </div>
            </div>
           </div>
           <div class="errorMessage"></div>
          </div>
         </fieldset> 
        </div> 
        <div id="divMatrixRel" style="position: absolute; display: none; width: 80%; margin: 0 10%;" class="ui-input-text"> 
         <input type="text" placeholder="请注明..." id="matrixinput" style="min-height: 2em; width: 100%; padding: 0.3em 0.6em;" /> 
        </div> 
        <div id="divMatrixHeader" class="divMatrixHeader" style="position: absolute; display: none; font-size: 12px; color: #333"> 
        </div> 
        <div class="shopcart" id="shopcart" style="display: none;"> 
        </div> 
        <div class="footer"> 
         <div class="ValError" id="ValError"> 
         </div> 
         <div id="captchaOut"> 
          <div id="captchaWrap"> 
           <span id="captchaTit" style="display:none;color:#42B917;"></span> 
           <div id="captcha" style="margin: 0 auto;"></div> 
          </div> 
         </div> 
         <div id="divSubmit" style="padding: 0px 20px 10px; display: none;"> 
          <div id="tdCode" style="display: none; padding-bottom: 15px;"> 
           <table> 
            <tbody>
             <tr> 
              <td class="ui-input-text nofocus"> <input id="yucinput" size="14" maxlength="10" type="text" name="yucinput" /> </td> 
              <td> 
               <div id="divCaptcha" style="display: none;"> 
                <img alt="验证码" title="看不清吗?点击可以刷新" captchaid="" instanceid="" /> 
               </div> </td> 
              <td>&nbsp;&nbsp;<img id="imgCode" alt="验证码" title="看不清吗?点击可以刷新" style="vertical-align: bottom; cursor: pointer; display: none;" /> </td> 
             </tr> 
            </tbody>
           </table> 
          </div> 
          <div class="voteDiv"> 
           <a id="ctlNext" href="javascript:;" class="button blue"> 提交</a> 
           <a href="javascript:;" class="button white ctBack" style="display:none" onclick="location.href=getTpMainUrl()"> 返回</a> 
          </div> 
          <div style="margin: 0px 0 10px; padding-top: 10px;"> 
           <a href="/urlreport.aspx?url=49588636" style="float: right; color: #666; font-size: 14px;" class="reportto" rel="nofollow"> 举报</a> 
           <div style="clear: both;"> 
           </div> 
          </div> 
         </div> 
         <a href="javascript:;" id="cgstartbutton" style="display: none;"></a> 
         <div id="divSearch" style="background: #020d15; color: #7c7c7c; font-size: 18px; height: 50px; left: 0; line-height: 50px; position: fixed; text-align: center; bottom: 0; width: 100%; z-index: 100; display: none;"> 
         </div> 
        </div> 
       </div> 
       <div id="divPowerBy" style="margin: 0 auto;" class="logofooter">
        <div class="wjfooter">
         <span id="spanPower"><a href="https://www.wjx.cn/mobile/index.aspx" target="_blank" title="问卷星_不止问卷调查/在线考试">问卷星</a>&nbsp;提供技术支持</span>
        </div>
       </div> 
       <div class="result" id="outdiv"> 
        <div class="indiv" id="indiv"> 
         <i class="icon_close"></i> 
         <div id="preView_wrap"> 
          <img class="imgresult" id="bigimg" src="" alt="" /> 
         </div> 
        </div> 
       </div> 
       <div id="divTimeUp" style="display: none;"> 
        <div style="padding: 10px; overflow: auto; line-height: 20px; font-size: 16px; text-align: center;" id="divTimeUpTip"></div> 
       </div> 
       <input type="hidden" value="2019/11/13 9:36:22" id="starttime" name="starttime" /> 
       <input type="hidden" value="directphone" id="source" name="source" /> 
      </form> 
      <a id="lnkCity" style="display: none;"></a> 
      <script type="text/javascript">
            var isYdb=0;
            var isPub=0;
            var isQywx=0;
            var cqType=1;
            var isDingDing=0;
            var ddcorpid="";
            var sojumpParm='';
            var parmsign='';
            var isKaoShi=0;
            var lastTopic=0;
            var Password = "";
            var PasswordExt = "";
            var pwdExt="";
            var emailName="";
            var phoneName="";
            var guid = "";
            var udsid=0;var fromsour="";
            var langVer=0;
            var cProvince="";
            var cCity="";
            var cIp="";
            var divTip=document.getElementById("divTip");
            var displayPrevPage="none";
            var inviteid='';var jbkid='';
            var access_token="";
            var openid = "";
            var wxUserId = ""; 
            var ddUserId = ""; 
            var isQQLogin=0;
            var wxthird=0;
            var parterts="";
            var parterjoiner="";
            var partersign="";
            var parterrealname="";
            var parterextf="";
            var parterdept="";
            var parterpuser="";
            var relusername="";
            var relts="";
            var relsign="";
            var relrealname="";
            var reldept="";
            var relext="";
            var nbk=0;
            var corpId="";
            var flist=0;
            var isPvw=0;
            var user_token="";
            var IsSampleService=0;
            var hashb=0;
            var sjUser='';
            var sjts='';
            var sjsign='';
            var outuser='';
            var sourcelink='';
            var outsign='';
            var sourceurl = '';
            var sourcename="";
            var isSimple='';
            var jiFenBao=0;var cAlipayAccount="";
            var isRunning=1;
            var SJBack='';var jiFen="0";
            var FromSj=0;
            var ItemDicData="";
            var rndnum="3716597092.77891453";
            var totalPage=1;
            var totalCut=0;
            var cepingCandidate="";
            var allowPart=0;
            var cpid="";
            var needSaveJoin=0;
            var isChuangGuan=0;
            var jqnonce="4836f1d3-e5ad-42fa-a99f-48809b83a20a";
            var maxCgTime=0;
            var maxOpTime=0;
            var qBeginDate="1573528025483";
            var randomMode=0;
            var fisrtLoadTime=new Date().getTime();
            var canAward=1;
            var allowAward=1;
            var isVip=0;
            var LogStoreLocal=0;
            
            var needLogCompanyId=0;
            var needHBAlert=0;
            var isPromoteing=0;
            var prsjts = "";
            var  prsjsign = "";
            var  cityPeiEQues = "";
             
            if(needHBAlert && !window.needLogin){
                if(needHBAlert==-1){
                    var hbmsg=$("#spanTip").text();
                    alertNew(hbmsg);
                }
                else if(needHBAlert==-2)
                    alertNew("请注意:抽中红"+"包后答卷还需要发布者审核,通过审核后才能发放红"+"包!");
                else if(needHBAlert==-4){
                    var hbmsg=$("#spanTip").text();
                    alertNew(hbmsg);
                }
                else if(needHBAlert<0){
                    alertNew("请注意:每个参与者填完问卷后有"+(needHBAlert*-1)+"%的概率抽中红"+"包");
                }
                else
                    alertNew("请注意:每个参与者填完问卷后有1/" + needHBAlert + "的概率抽中红"+"包");
            }
            var needAwardAlert=0;
            var leftSeconds=0-10;
            if(needAwardAlert && !window.needLogin){
                var divawardalert=document.getElementById("divawardalert");
                var awt=$.trim($(divawardalert).text());
                if(awt)
                    alert(awt);
            }
            var hasChuangGuanEnd=false;
            var IsPar=0;
            var curProvince="";
            var curCity="";
            var curIp="221.176.33.49";
            var curFuHe=0;
            var curCheckResult=0;
            var addtoHis=0;
            var isForein=0;
        </script> 
      <script type="text/javascript">
            var needAvoidCrack=0;
            var tdCode="tdCode";
            var imgCode = $("#imgCode")[0];
            var submit_text = $("#yucinput")[0];
            var tCode = $("#"+tdCode)[0];
            var hasTouPiao =0
              
        </script> 
      <div style="display: none;">
       <script src="https://s13.cnzz.com/z_stat.php?id=4478442&amp;web_id=4478442" language="JavaScript" async="" onload="if(window.loadCzc)loadCzc();"></script>
       <script>var _hmt = _hmt || [];(function() {var hm = document.createElement("script");hm.src = "https://hm.baidu.com/hm.js?21be24c80829bd7a683b2c536fcf520b";var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s);})();</script>
      </div> 
      <script>
             
            function loadCzc(){
                if (window._czc) {
                    var evvtype="免费版";if(isVip)evvtype="企业版";
                    _czc.push(["_trackEvent", "移动端JQ", evvtype, cqType]);
                    if (window.isQywx) {
                        _czc.push(["_trackEvent", "企业微信", "打开问卷", ""]);
                    }
                }
            }
        </script> 
      <script>
            var awardkeylist="1§JLPT,JTEST,J.TEST,CATTI,50音,日语,韩语,Japan,Japanese,cosplay,の,な,ん,い,う,こ,し,せ,て,た,GRE,GMAT,offer,toefl,IELTS,LSAT,TEF§0┋2§美妆,化妆,护肤,小红书,HPV,内衣,玻尿酸,射频仪,肌肤测试,美容仪,瘦脸针,肉毒杆菌§1┋3§GRE,雅思,托福,G5,SAT,SSAT,ACTGMAT,jlpt,offer,toefl,IELTS,LSAT,TEF§1┋4§高中生,高一,高二,高三,高1,高2,高3,高中家长,高考§4┋5§初中生,初一,初二,初三,七年级,八年级,九年级,初1,初2,初3,7年级,8年级,9年级,中考,初升高§5┋7§小学生,附小,小学,小学家长,一年级,二年级,三年级,四年级,五年级,六年级,少先队,少先大队,1年级,2年级,3年级,4年级,5年级,6年级,小升初,低年级,口算,儿童节§7┋8§幼儿园,幼儿家长,园家长,大班,中班,大一班,大二班,大三班,小班幼儿,绘本,学前教育,学前儿童,早教,幼教中心,智力开发,睡前故事,蒙氏,积木,乐高,启蒙,拼音,幼儿,少儿,儿童,早教,幼稚园,幼教,育儿§8┋9§中学,中学生,中小学,附中,国际学校,中一班,中二班,中三班§6┋10§益智,托管所,托儿所,推车,童车,安全座椅,积木,巧虎,乐智小天地,§10┋11§家长,亲子,家教,孩子,家庭教育,共育,父母§11┋12§家访,培优,奥数,高年级,中年级,课堂作业,课后作业,家庭作业,苏教版,加减法,尖子班,人教版,提高班,青春期,冬令营,夏令营,课业,升学,考级,学籍,课外辅导,义务教育,补习,叛逆期,课业负担,提高班,校服§9┋13§大一,大二,大三,大四,考研,应届,奖学金,选修课,学生会,大学生,恋爱观,就业,择业,支教,打工,实习,留学生§2┋14§小语种,翻译,口译,外语,外教,听力,语种,真题,考研,口语,词汇,六级,英语,词汇,语法,the,and,that,for§12┋15§出国,部门,大区,职工,工号,跨国企业,国贸,报关,外贸,外企,海外,境外,国际部,签证,跨境,国际,航空,出境,空乘,进口,出口,海外,乘务,报关,外贸,外企,海外,境外,签证,跨境,出境,进口,出口,金融,出国,国贸,跨国企业,跨国公司,合资,出国,汽车,商城,酒店,购物,商场,商店,酒,咖啡,VIP,高尔夫,邮轮,相机,投资,炒股,股票,股市,金融,理财,财经,基金,财经,奢侈品,集团,企业,公司,员工,工会,旅游,旅行,购车,航班,证券,保险,银行,高层,部门,别墅,4S,红酒,财富,财务,高端,考察,海淘,海外,私募,贷款,私教,干红,健身,出境,境外,私家,ETC,车友,购房,房产,融资,花园,洋房,招商,地产,越野,轿车,度假,经理,总裁,研修,总监,私家车,会所,贵宾,MBA,物业,mall§14┋17§学历,受教育程度§3┋18§车位,车辆保养,4s店,车牌号,驾驶证,驾照,车险§1";
            var qukeylist="";
            var currJT=2;
            var isMobileFile =1;
    
        </script>   
     </body>
    </html>

     

    展开全文
  • ssr、订阅内容解析

    万次阅读 2019-07-19 12:14:53
    var ssrObj = new SSR.Server("ssr://xxx", ""); ssrObj.remarks = "ssr name"; var ssrUrl = ssrObj.GetSSRLinkForServer(); // ssr地址与订阅内容转换 var ssrUrls = new[] { "ssr:\\xxx","ssr:\\xxx"}; va...

     

    // ssr地址解析
    var ssrObj = new SSR.Server("ssr://xxx", "");
    ssrObj.remarks = "ssr name";
    var ssrUrl = ssrObj.GetSSRLinkForServer();
    
    // ssr地址与订阅内容转换
    var ssrUrls = new[] { "ssr:\\xxx","ssr:\\xxx"};
    var subscribeContent = SSR.Subscriber.ToSubscribeStr(ssrUrls);
    var ssrUrls2 = SSR.Subscriber.FromSubscribeStr(subscribeContent);

     

    using System;
    using System.Collections.Generic;
    using System.Diagnostics;
    using System.Linq;
    using System.Net;
    using System.Net.Sockets;
    using System.Security.Cryptography;
    using System.Text;
    using System.Text.RegularExpressions;
    
    namespace WebApplication1
    {
        public class SSR
        {
            /// <summary>
            /// SS、SSR地址编解码
            /// </summary>
            [Serializable]
            public class Server
            {
                public string id;
                public string server;
                public int server_port;
                public int server_udp_port;
                public string password;
                public string method;
                public string protocol;
                public string protocolparam;
                public string obfs;
                public string obfsparam;
                public string remarks_base64;
                public string group;
                public bool enable;
                public bool udp_over_tcp;
                public int latency;
                public static int LATENCY_ERROR = -2;
                public static int LATENCY_PENDING = -1;
                public static int LATENCY_TESTING = 0;
                private object protocoldata;
                private object obfsdata;
                private static Server forwardServer = new Server();
                public string remarks
                {
                    get
                    {
                        if (this.remarks_base64.Length == 0)
                        {
                            return string.Empty;
                        }
                        string result;
                        try
                        {
                            result = Base64.DecodeUrlSafeBase64(this.remarks_base64);
                        }
                        catch (FormatException)
                        {
                            string text = this.remarks_base64;
                            this.remarks = this.remarks_base64;
                            result = text;
                        }
                        return result;
                    }
                    set
                    {
                        this.remarks_base64 = Base64.EncodeUrlSafeBase64(value, true);
                    }
                }
                public void CopyServer(Server Server)
                {
                    this.protocoldata = Server.protocoldata;
                    this.obfsdata = Server.obfsdata;
                    this.enable = Server.enable;
                }
                public void CopyServerInfo(Server Server)
                {
                    this.remarks = Server.remarks;
                    this.group = Server.group;
                }
                public static Server GetForwardServerRef()
                {
                    return Server.forwardServer;
                }
                public string FriendlyName()
                {
                    if (string.IsNullOrEmpty(this.server))
                    {
                        return "New server";
                    }
                    if (string.IsNullOrEmpty(this.remarks_base64))
                    {
                        if (this.server.IndexOf(':') >= 0)
                        {
                            return string.Concat(new object[]
                            {
                            "[",
                            this.server,
                            "]:",
                            this.server_port
                            });
                        }
                        return this.server + ":" + this.server_port;
                    }
                    else
                    {
                        if (this.server.IndexOf(':') >= 0)
                        {
                            return string.Concat(new object[]
                            {
                            this.remarks,
                            " ([",
                            this.server,
                            "]:",
                            this.server_port,
                            ")"
                            });
                        }
                        return string.Concat(new object[]
                        {
                        this.remarks,
                        " (",
                        this.server,
                        ":",
                        this.server_port,
                        ")"
                        });
                    }
                }
                public string HiddenName(bool hide = true)
                {
                    if (string.IsNullOrEmpty(this.server))
                    {
                        return "New server";
                    }
                    string text = this.server;
                    if (hide)
                    {
                        text = ServerName.HideServerAddr(this.server);
                    }
                    if (string.IsNullOrEmpty(this.remarks_base64))
                    {
                        if (this.server.IndexOf(':') >= 0)
                        {
                            return string.Concat(new object[]
                            {
                            "[",
                            text,
                            "]:",
                            this.server_port
                            });
                        }
                        return text + ":" + this.server_port;
                    }
                    else
                    {
                        if (this.server.IndexOf(':') >= 0)
                        {
                            return string.Concat(new object[]
                            {
                            this.remarks,
                            " ([",
                            text,
                            "]:",
                            this.server_port,
                            ")"
                            });
                        }
                        return string.Concat(new object[]
                        {
                        this.remarks,
                        " (",
                        text,
                        ":",
                        this.server_port,
                        ")"
                        });
                    }
                }
                public Server Clone()
                {
                    return new Server
                    {
                        server = this.server,
                        server_port = this.server_port,
                        password = this.password,
                        method = this.method,
                        protocol = this.protocol,
                        obfs = this.obfs,
                        obfsparam = this.obfsparam ?? "",
                        remarks_base64 = this.remarks_base64,
                        group = this.group,
                        enable = this.enable,
                        udp_over_tcp = this.udp_over_tcp,
                        id = this.id,
                        protocoldata = this.protocoldata,
                        obfsdata = this.obfsdata
                    };
                }
                public Server()
                {
                    this.server = "server host";
                    this.server_port = 8388;
                    this.method = "aes-256-cfb";
                    this.protocol = "origin";
                    this.protocolparam = "";
                    this.obfs = "plain";
                    this.obfsparam = "";
                    this.password = "0";
                    this.remarks_base64 = "";
                    this.group = "FreeSSR-public";
                    this.udp_over_tcp = false;
                    this.enable = true;
                    this.latency = Server.LATENCY_PENDING;
                    byte[] array = new byte[16];
                    Utils.RandBytes(array, array.Length);
                    this.id = BitConverter.ToString(array).Replace("-", "");
                }
                public Server(string ssURL, string force_group) : this()
                {
                    if (ssURL.StartsWith("ss://", StringComparison.OrdinalIgnoreCase))
                    {
                        this.ServerFromSS(ssURL, force_group);
                        return;
                    }
                    if (ssURL.StartsWith("ssr://", StringComparison.OrdinalIgnoreCase))
                    {
                        this.ServerFromSSR(ssURL, force_group);
                        return;
                    }
                    throw new FormatException();
                }
                public bool isMatchServer(Server server)
                {
                    return this.server == server.server && this.server_port == server.server_port && this.server_udp_port == server.server_udp_port && this.method == server.method && this.protocol == server.protocol && this.protocolparam == server.protocolparam && this.obfs == server.obfs && this.obfsparam == server.obfsparam && this.password == server.password && this.udp_over_tcp == server.udp_over_tcp;
                }
                private Dictionary<string, string> ParseParam(string param_str)
                {
                    Dictionary<string, string> dictionary = new Dictionary<string, string>();
                    string[] array = param_str.Split(new char[]
                    {
                    '&'
                    });
                    string[] array2 = array;
                    for (int i = 0; i < array2.Length; i++)
                    {
                        string text = array2[i];
                        if (text.IndexOf('=') > 0)
                        {
                            int num = text.IndexOf('=');
                            string key = text.Substring(0, num);
                            string value = text.Substring(num + 1);
                            dictionary[key] = value;
                        }
                    }
                    return dictionary;
                }
                public void ServerFromSSR(string ssrURL, string force_group)
                {
                    Match match = Regex.Match(ssrURL, "ssr://([A-Za-z0-9_-]+)", RegexOptions.IgnoreCase);
                    if (!match.Success)
                    {
                        throw new FormatException();
                    }
                    string text = Base64.DecodeUrlSafeBase64(match.Groups[1].Value);
                    Dictionary<string, string> dictionary = new Dictionary<string, string>();
                    int num = text.IndexOf("?");
                    if (num > 0)
                    {
                        dictionary = this.ParseParam(text.Substring(num + 1));
                        text = text.Substring(0, num);
                    }
                    if (text.IndexOf("/") >= 0)
                    {
                        text = text.Substring(0, text.LastIndexOf("/"));
                    }
                    Regex regex = new Regex("^(.+):([^:]+):([^:]*):([^:]+):([^:]*):([^:]+)");
                    Match match2 = regex.Match(text);
                    if (match2 == null || !match2.Success)
                    {
                        throw new FormatException();
                    }
                    this.server = match2.Groups[1].Value;
                    this.server_port = int.Parse(match2.Groups[2].Value);
                    this.protocol = ((match2.Groups[3].Value.Length == 0) ? "origin" : match2.Groups[3].Value);
                    this.protocol = this.protocol.Replace("_compatible", "");
                    this.method = match2.Groups[4].Value;
                    this.obfs = ((match2.Groups[5].Value.Length == 0) ? "plain" : match2.Groups[5].Value);
                    this.obfs = this.obfs.Replace("_compatible", "");
                    this.password = Base64.DecodeStandardSSRUrlSafeBase64(match2.Groups[6].Value);
                    if (dictionary.ContainsKey("protoparam"))
                    {
                        this.protocolparam = Base64.DecodeStandardSSRUrlSafeBase64(dictionary["protoparam"]);
                    }
                    if (dictionary.ContainsKey("obfsparam"))
                    {
                        this.obfsparam = Base64.DecodeStandardSSRUrlSafeBase64(dictionary["obfsparam"]);
                    }
                    if (dictionary.ContainsKey("remarks"))
                    {
                        this.remarks = Base64.DecodeStandardSSRUrlSafeBase64(dictionary["remarks"]);
                    }
                    if (dictionary.ContainsKey("group"))
                    {
                        this.group = Base64.DecodeStandardSSRUrlSafeBase64(dictionary["group"]);
                    }
                    else
                    {
                        this.group = "";
                    }
                    if (dictionary.ContainsKey("uot"))
                    {
                        this.udp_over_tcp = (int.Parse(dictionary["uot"]) > 0);
                    }
                    if (dictionary.ContainsKey("udpport"))
                    {
                        this.server_udp_port = int.Parse(dictionary["udpport"]);
                    }
                    if (!string.IsNullOrEmpty(force_group))
                    {
                        this.group = force_group;
                    }
                }
                public void ServerFromSS(string ssURL, string force_group)
                {
                    Regex regex = new Regex("^(?i)ss://([A-Za-z0-9+-/=_]+)(#(.+))?", RegexOptions.IgnoreCase);
                    Regex regex2 = new Regex("^((?<method>.+):(?<password>.*)@(?<hostname>.+?):(?<port>\\d+?))$", RegexOptions.IgnoreCase);
                    Match match = regex.Match(ssURL);
                    if (!match.Success)
                    {
                        throw new FormatException();
                    }
                    string value = match.Groups[1].Value;
                    match = regex2.Match(Encoding.UTF8.GetString(Convert.FromBase64String(value.PadRight(value.Length + (4 - value.Length % 4) % 4, '='))));
                    this.protocol = "origin";
                    this.method = match.Groups["method"].Value;
                    this.password = match.Groups["password"].Value;
                    this.server = match.Groups["hostname"].Value;
                    this.server_port = int.Parse(match.Groups["port"].Value);
                    if (!string.IsNullOrEmpty(force_group))
                    {
                        this.group = force_group;
                        return;
                    }
                    this.group = "";
                }
                public string GetSSLinkForServer()
                {
                    string s = string.Concat(new object[]
                    {
                    this.method,
                    ":",
                    this.password,
                    "@",
                    this.server,
                    ":",
                    this.server_port
                    });
                    string str = Convert.ToBase64String(Encoding.UTF8.GetBytes(s)).Replace("=", "");
                    return "ss://" + str;
                }
                public string GetSSRLinkForServer()
                {
                    string str = string.Concat(new object[]
                    {
                    this.server,
                    ":",
                    this.server_port,
                    ":",
                    this.protocol,
                    ":",
                    this.method,
                    ":",
                    this.obfs,
                    ":",
                    Base64.EncodeUrlSafeBase64(this.password, true)
                    });
                    string text = "obfsparam=" + Base64.EncodeUrlSafeBase64(this.obfsparam ?? "", true);
                    if (!string.IsNullOrEmpty(this.protocolparam))
                    {
                        text = text + "&protoparam=" + Base64.EncodeUrlSafeBase64(this.protocolparam, true);
                    }
                    if (!string.IsNullOrEmpty(this.remarks))
                    {
                        text = text + "&remarks=" + Base64.EncodeUrlSafeBase64(this.remarks, true);
                    }
                    if (!string.IsNullOrEmpty(this.group))
                    {
                        text = text + "&group=" + Base64.EncodeUrlSafeBase64(this.group, true);
                    }
                    if (this.udp_over_tcp)
                    {
                        text += "&uot=1";
                    }
                    if (this.server_udp_port > 0)
                    {
                        text = text + "&udpport=" + this.server_udp_port.ToString();
                    }
                    string str2 = Base64.EncodeUrlSafeBase64(str + "/?" + text, true);
                    return "ssr://" + str2;
                }
                public bool isEnable()
                {
                    return this.enable;
                }
                public void setEnable(bool enable)
                {
                    this.enable = enable;
                }
                public object getObfsData()
                {
                    return this.obfsdata;
                }
                public void setObfsData(object data)
                {
                    this.obfsdata = data;
                }
                public object getProtocolData()
                {
                    return this.protocoldata;
                }
                public void setProtocolData(object data)
                {
                    this.protocoldata = data;
                }
                public void tcpingLatency()
                {
                    List<double> list = new List<double>();
                    TcpClient tcpClient = new TcpClient();
                    Stopwatch stopwatch = new Stopwatch();
                    stopwatch.Start();
                    try
                    {
                        Dns.GetHostAddresses(this.server);
                    }
                    catch (Exception)
                    {
                        this.latency = Server.LATENCY_ERROR;
                        return;
                    }
                    IAsyncResult asyncResult = tcpClient.BeginConnect(this.server, this.server_port, null, null);
                    if (asyncResult.AsyncWaitHandle.WaitOne(TimeSpan.FromSeconds(2.0)))
                    {
                        stopwatch.Stop();
                        list.Add(stopwatch.Elapsed.TotalMilliseconds);
                    }
                    else
                    {
                        stopwatch.Stop();
                    }
                    try
                    {
                        tcpClient.Close();
                    }
                    catch (Exception)
                    {
                    }
                    if (list.Count != 0)
                    {
                        this.latency = (int)list.Average();
                        return;
                    }
                    this.latency = Server.LATENCY_ERROR;
                }
            }
    
            /// <summary>
            /// SS、SSR订阅内容生成
            /// </summary>
            public static class Subscriber
            {
                /// <summary>
                /// 将多个ssr地址转换为订阅内容
                /// </summary>
                /// <param name="ssrs">ssr地址列表</param>
                /// <returns></returns>
                public static string ToSubscribeStr(IEnumerable<string> ssrs)
                {
                    // 多个ssr地址用换行符分割,最后用base64编码
                    var str = string.Join("\r\n", ssrs);
                    var base64 = Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(str));
                    return base64;
                }
    
                /// <summary>
                /// 从订阅内容中获取ssr地址列表
                /// </summary>
                /// <param name="subscribeContent">ssr订阅内容</param>
                /// <returns>ssr地址列表</returns>
                public static List<string> FromSubscribeStr(string subscribeContent)
                {
                    var str = System.Text.Encoding.UTF8.GetString(Convert.FromBase64String(subscribeContent));
                    var ssrs = str.Split("\r\n".ToCharArray(), StringSplitOptions.RemoveEmptyEntries)
                        .ToList()
                        .FindAll(m => m.StartsWith("ss", StringComparison.InvariantCultureIgnoreCase));
                    return ssrs;
                }
            }
    
            private static class Base64
            {
                public static string DecodeBase64(string val)
                {
                    return Encoding.UTF8.GetString(Base64.DecodeBase64ToBytes(val));
                }
                public static byte[] DecodeBase64ToBytes(string val)
                {
                    string s = val.PadRight(val.Length + (4 - val.Length % 4) % 4, '=');
                    return Convert.FromBase64String(s);
                }
                public static string EncodeUrlSafeBase64(byte[] val, bool trim)
                {
                    if (trim)
                    {
                        return Convert.ToBase64String(val).Replace('+', '-').Replace('/', '_').TrimEnd(new char[]
                        {
                        '='
                        });
                    }
                    return Convert.ToBase64String(val).Replace('+', '-').Replace('/', '_');
                }
                public static byte[] DecodeUrlSafeBase64ToBytes(string val)
                {
                    string s = val.Replace('-', '+').Replace('_', '/').PadRight(val.Length + (4 - val.Length % 4) % 4, '=');
                    return Convert.FromBase64String(s);
                }
                public static string EncodeUrlSafeBase64(string val, bool trim = true)
                {
                    return Base64.EncodeUrlSafeBase64(Encoding.UTF8.GetBytes(val), trim);
                }
                public static string DecodeUrlSafeBase64(string val)
                {
                    return Encoding.UTF8.GetString(Base64.DecodeUrlSafeBase64ToBytes(val));
                }
                public static string DecodeStandardSSRUrlSafeBase64(string val)
                {
                    return Encoding.UTF8.GetString(Base64.DecodeUrlSafeBase64ToBytes(val));
                }
            }
    
            private static class ServerName
            {
                public static string HideServerAddr(string addr)
                {
                    string result = addr;
                    IPAddress iPAddress;
                    bool flag = IPAddress.TryParse(addr, out iPAddress);
                    if (flag)
                    {
                        char separator;
                        if (AddressFamily.InterNetwork == iPAddress.AddressFamily)
                        {
                            separator = '.';
                        }
                        else
                        {
                            separator = ':';
                        }
                        result = ServerName.HideAddr(addr, separator);
                    }
                    else
                    {
                        int num = addr.IndexOf('.', 1);
                        if (num > 0)
                        {
                            result = "*" + addr.Substring(num);
                        }
                    }
                    return result;
                }
                private static string HideAddr(string addr, char separator)
                {
                    string text = "";
                    string[] array = addr.Split(new char[]
                    {
                    separator
                    });
                    string text2 = array[0];
                    string text3 = array[array.Length - 1];
                    if (0 < text2.Length)
                    {
                        text = text2 + separator.ToString();
                    }
                    text += "**";
                    if (0 < text3.Length)
                    {
                        text = text + separator.ToString() + text3;
                    }
                    return text;
                }
            }
    
            private static class Utils
            {
                public static void RandBytes(byte[] buf, int length)
                {
                    byte[] array = new byte[length];
                    RNGCryptoServiceProvider rNGCryptoServiceProvider = new RNGCryptoServiceProvider();
                    rNGCryptoServiceProvider.GetBytes(array);
                    array.CopyTo(buf, 0);
                }
            }
        }
    }
    

     

    展开全文
  • var txt2=$("<p></p>").text("Text."); // Create text with jQuery var txt3=document.createElement("p"); txt3.innerHTML="Text."; // Create text with DOM $("body").append(txt1,txt2,txt3); // Append new...
  • jquery变量var的使用

    万次阅读 2018-11-11 08:24:26
    变量var的使用 js的变量没有类型 var $li = $('#' + file.id), $percent = $li.find('.progress span'); //console.log("percentage:", percentage); ...
  • javaScript与java、c语言虽然有很多相同,但是也存在区别 JavaScript的变量没有块范围 ... var scope="全集变量"; function test(){ //全局变量被局部变量覆盖 document.writeln(scope+"") //定义scope
  • conformation_button = tk.Button(root,text= 'CONFIRM' ,command=self.verification,fg= 'white' ,bg= 'black' , activeforeground= 'white' , activebackground= 'navy' ,width= 8 ,height= 1 ) conformation_...
  • TK-StringVar

    千次阅读 2020-03-07 23:45:09
    1. StringVar属于Tkinter下的对象。 2、StringVar的作用 在使用界面编程的时候,有些时候是需要跟踪变量的值的变化,以保证值的变更随时可以显示在界面上。由于python无法做到这一点,所以使用了tcl的相应的对象,...
  • Text:文本小部件提供先进的功能,可以编辑多行文本格式,如改变颜色字体样式,这里主要是学习做一个将Entry中用户输入的字符串在Text文本框中显示,其中触发不同按钮,用户输入的内容将插入在与之相应的不同位置...
  • ExtJs之Text文本框Text和文本域TextArea

    万次阅读 2018-02-26 09:23:07
    文本框Text ...var creditCard = Ext.create('Ext.form.field.Text', { fieldLabel : '身份证号', name : 'creditCard', renderTo : 'creditCardDiv', labelAlign : 'right', emptyText: ...
  • 我想获取select选中的value,或者text,或者…… 比如这个: &lt;select id="select"&gt; &lt;option value="A" url="http://www.baidu.com"&gt;第一个option&...
  • type="text/javascript

    千次阅读 2018-07-18 19:26:18
    type=”text/javascript
  • 一.数据源实体,实体类
  • CSS中的变量使用,var()语法

    万次阅读 2016-12-16 10:52:49
    惯例先看代码: :root{ --white-max: #fff; --white-bright: #f5f5f5; --white-light: #eee; --white-dark: #ddd;...color: var(--white-max); font-size: 1.1em; font-weight: bol
  • content-Type:text/plain和text/html

    万次阅读 2016-10-20 16:22:19
    最近再看nodejs  建立服务的时候: var http = require("http"); +http.createServer(function (request, ...+ response.writeHead(200, {"Content-Type": "text/plain"}); + response.write("Hello
  • python基础知识-GUI编程-TK-StringVar

    万次阅读 2016-09-12 18:31:29
    1、如何引出StringVar   之前一直认为StringVar就是类似于Java的String类型的对象变量,今天在想要设置StringVar变量的值的时候,通过搜索发现StringVar并不是python内建的对象,而是属于Tkinter下的对象。这个...
  • 一:获取select2选中项option的value和text,多选用jsonarry格式返回  单选:  //该方法也可以获取多选的数据,但是val 是以list返回的,而text会以一条字符串返回。  var val= $('#company_kh').val();  ...
  • 之前有根据"如何优雅使用Sublime Text3(Sublime设置豆沙绿背景色自定义主题)"这篇文章修改过主题样式,我把作者的主题放入我的包内,但是打开后发现,连侧边栏按键按钮其他的都是绿的,真的是啥都绿的不行,我就改回...
  • 解决ie关于css var的适配问题

    千次阅读 热门讨论 2019-09-15 20:24:46
    方案 通过webpack的postcss-loader+postcss-css-css-variable编译生成固定的代码 例如: :root { ... border: 1px solid var(--white); } span { color: var(--black); } 通过webpack的pos...
  • 条件风险价值CVaR

    万次阅读 2019-07-05 20:59:19
    产生背景 &ThickSpace;&ThickSpace;...CVaR即条件风险价值,是由RockafeUarUryasev等于1997年提出的一种较VaR更优的风险计量技术,其含义为在投资组合的损失超过某个给定VaR值的条件下,该投...
  • JS获取/设置select下拉框的text和vlaue

    千次阅读 2018-11-07 13:21:31
    var text = obj.options[index].text;//选中的文本 var value = obj.options[index].value;//选中的value //通过遍历DOM对象获取 for (i = 0; i ; i++) { if (obj[i].selected == true) {//选中 var Index = i;//...
  • var QML基本类型

    千次阅读 2018-03-30 21:33:34
    基本介绍 ... 例如,var属性可以存储数字,字符串,对象,数组函数: Item { property var aNumber: 100 property var aBool: false property var aString: "Hello world!" p...
  • JavaScript里的var变量

    千次阅读 2018-09-13 11:06:10
    最近学了一点HTMLJavaScript。 在JavaScript里面有var变量,而且好像只有var变量。换句话说var就是个万精油,他没有确定的类型,他的类型取决于赋值给他的变量的类型。例如:   var a = 123; var b = "123...
  • 如果想利用.set的特性, 对text进行修改的话可以这样. str = StringVar ( ) label = Label ( root , text = str ) str . set ( "这里写要显示的内容" ) 就可以随时set随时显示 (别人是这样, 然而我...
  • 有的程序可能是通过Text属性来取值,因此会将修改Text的方法一并写下。 一、修改时间控件的Value 1. 注入js的方法: public void jsExe(WebDriver driver,String scroll) { JavascriptExecutor...
  • foreach中的循环var变量

    千次阅读 2019-01-05 12:24:35
    var="car"&gt; &lt;tr id="${car.carOrder}"&gt; &lt;td&gt;&lt;a href="&lt;%=path%&gt;product/productInfo?pid=${car.product.proID}"&...
  • 微信小程序开发使用rich-text组件渲染html格式的代码,常常因为不能自定义css导致文本不能缩进,以及图片不能居中等问题,这里可以考虑使用js的replace方法,替换字符串,然后在渲染的同时加载行内...var richtext= ...
  • 【ES6】var、let、const三者的区别

    万次阅读 多人点赞 2018-04-21 18:54:05
    首先,一个常见的问题是,ECMAScript JavaScript 到底是什么关系? ECMAScript是一个国际通过的标准化脚本语言。JavaScript由ECMAScriptDOM、BOM三者组成。可以简单理解为:ECMAScript是JavaScript的语言规范...
  • 今天在使用python的tkinter库时候...label2=tk.Label(winYuhun, text=a, font=('宋体', 9), width=12, height=3, bd=3) 查阅资料之后发现,这是不对的,我们要得到对应的值不能直接用,要调用get()方法 实名diss许多害

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 1,329,488
精华内容 531,795
关键字:

var和text