久久久精品久久久久特色影视,精品国产91久久久久久久,国产精品99久久久精品无码 http://www.shnenglu.com/jpweiyi/ 心 勿噪zh-cnSun, 11 May 2025 07:25:57 GMTSun, 11 May 2025 07:25:57 GMT60fixed function pipelinehttp://www.shnenglu.com/jpweiyi/archive/2021/03/08/217624.htmlLSHLSHMon, 08 Mar 2021 14:05:00 GMThttp://www.shnenglu.com/jpweiyi/archive/2021/03/08/217624.htmlhttp://www.shnenglu.com/jpweiyi/comments/217624.htmlhttp://www.shnenglu.com/jpweiyi/archive/2021/03/08/217624.html#Feedback0http://www.shnenglu.com/jpweiyi/comments/commentRss/217624.htmlhttp://www.shnenglu.com/jpweiyi/services/trackbacks/217624.html//******************************************************************
//
// OpenGL ES 2.0 vertex shader that implements the following
// OpenGL ES 1.1 fixed function pipeline
//
// - compute lighting equation for up to eight directional/point/
// - spot lights
// - transform position to clip coordinates
// - texture coordinate transforms for up to two texture coordinates
// - compute fog factor
// - compute user clip plane dot product (stored as v_ucp_factor)
//
//******************************************************************
#define NUM_TEXTURES 2
#define GLI_FOG_MODE_LINEAR 0
#define GLI_FOG_MODE_EXP 1
#define GLI_FOG_MODE_EXP2 2
struct light {
    vec4 position;  // light position for a point/spot light or
                    // normalized dir. for a directional light
    vec4 ambient_color;
    vec4 diffuse_color;
    vec4 specular_color;
    vec3 spot_direction;
    vec3 attenuation_factors;
    float spot_exponent;
    float spot_cutoff_angle;
    bool compute_distance_attenuation;
};
struct material {
    vec4 ambient_color;
    vec4 diffuse_color;
    vec4 specular_color;
    vec4 emissive_color;
    float specular_exponent;
};
const float c_zero = 0.0;
const float c_one = 1.0;
const int indx_zero = 0;
const int indx_one = 1;
uniform mat4 mvp_matrix; // combined model-view + projection matrix
uniform mat4 modelview_matrix; // model view matrix
uniform mat3 inv_modelview_matrix; // inverse model-view
// matrix used
// to transform normal
uniform mat4 tex_matrix[NUM_TEXTURES]; // texture matrices
uniform bool enable_tex[NUM_TEXTURES]; // texture enables
uniform bool enable_tex_matrix[NUM_TEXTURES]; // texture matrix enables
uniform material material_state;
uniform vec4 ambient_scene_color;
uniform light light_state[8];
uniform bool light_enable_state[8]; // booleans to indicate which of eight
                                    // lights are enabled
uniform int num_lights; // number of lights enabled = sum of
                        // light_enable_state bools set to TRUE
uniform bool enable_lighting; // is lighting enabled
uniform bool light_model_two_sided; // is two-sided lighting enabled
uniform bool enable_color_material; // is color material enabled
uniform bool enable_fog; // is fog enabled
uniform float fog_density;
uniform float fog_start, fog_end;
uniform int fog_mode; // fog mode - linear, exp, or exp2
uniform bool xform_eye_p; // xform_eye_p is set if we need
                          // Peye for user clip plane,
                          // lighting, or fog
uniform bool rescale_normal; // is rescale normal enabled
uniform bool normalize_normal; // is normalize normal enabled
uniform float rescale_normal_factor; // rescale normal factor if
                                     // glEnable(GL_RESCALE_NORMAL)
uniform vec4 ucp_eqn; // user clip plane equation –
                      // - one user clip plane specified
uniform bool enable_ucp; // is user clip plane enabled
//******************************************************
// vertex attributes - not all of them may be passed in
//******************************************************
attribute vec4 a_position; // this attribute is always specified
attribute vec4 a_texcoord0;// available if enable_tex[0] is true
attribute vec4 a_texcoord1;// available if enable_tex[1] is true
attribute vec4 a_color; // available if !enable_lighting or
                        // (enable_lighting && enable_color_material)
attribute vec3 a_normal; // available if xform_normal is set
                         // (required for lighting)
//************************************************
// varying variables output by the vertex shader
//************************************************
varying vec4 v_texcoord[NUM_TEXTURES];
varying vec4 v_front_color;
varying vec4 v_back_color;
varying float v_fog_factor;
varying float v_ucp_factor;
//************************************************
// temporary variables used by the vertex shader
//************************************************
vec4 p_eye;
vec3 n;
vec4 mat_ambient_color;
vec4 mat_diffuse_color;
vec4
lighting_equation(int i)
{
    vec4 computed_color = vec4(c_zero, c_zero, c_zero, c_zero);
    vec3 h_vec;
    float ndotl, ndoth;
    float att_factor;
    att_factor = c_one;
    if(light_state[i].position.w != c_zero)
    {
        float spot_factor;
        vec3 att_dist;
        vec3 VPpli;
        // this is a point or spot light
        // we assume "w" values for PPli and V are the same
        VPpli = light_state[i].position.xyz - p_eye.xyz;
        if(light_state[i].compute_distance_attenuation)
        {
            // compute distance attenuation
            att_dist.x = c_one;
            att_dist.z = dot(VPpli, VPpli);
            att_dist.y = sqrt(att_dist.z);
            att_factor = c_one / dot(att_dist,
            light_state[i].attenuation_factors);
        }
        VPpli = normalize(VPpli);
        if(light_state[i].spot_cutoff_angle < 180.0)
        {
            // compute spot factor
            spot_factor = dot(-VPpli, light_state[i].spot_direction);
            if(spot_factor >= cos(radians(light_state[i].spot_cutoff_angle)))
            {
                spot_factor = pow(spot_factor,light_state[i].spot_exponent);
            }
            else{
                spot_factor = c_zero;
            }
            att_factor *= spot_factor;
        }
    }
    else
    {
        // directional light
        VPpli = light_state[i].position.xyz;
    }
    if(att_factor > c_zero)
    {
        // process lighting equation --> compute the light color
        computed_color += (light_state[i].ambient_color * mat_ambient_color);
        ndotl = max(c_zero, dot(n, VPpli));
        computed_color += (ndotl * light_state[i].diffuse_color * mat_diffuse_color);
        h_vec = normalize(VPpli + vec3(c_zero, c_zero, c_one));
        ndoth = dot(n, h_vec);
        if (ndoth > c_zero)
        {
            computed_color += (pow(ndoth,material_state.specular_exponent) *
                               material_state.specular_color *
                               light_state[i].specular_color);
        }
        computed_color *= att_factor; // multiply color with
                                      // computed attenuation factor
                                      // * computed spot factor
    }
    return computed_color;
}
float compute_fog()
{
    float f;
    
    // use eye Z as approximation
    if(fog_mode == GLI_FOG_MODE_LINEAR)
    {
        f = (fog_end - p_eye.z) / (fog_end - fog_start);
    }
    else if(fog_mode == GLI_FOG_MODE_EXP)
    {
        f = exp(-(p_eye.z * fog_density));
    }
    else
    {
        f = (p_eye.z * fog_density);
        f = exp(-(f * f));
    }
    f = clamp(f, c_zero, c_one);
    return f;
}
vec4 do_lighting()
{
    vec4 vtx_color;
    int i, j;
    
    vtx_color = material_state.emissive_color +
                (mat_ambient_color * ambient_scene_color);
    j = (int)c_zero;
    for (i=(int)c_zero; i<8; i++)
    {
        if(j >= num_lights)
            break;
            
        if (light_enable_state[i])
        {
            j++;
            vtx_color += lighting_equation(i);
        }
    }
    vtx_color.a = mat_diffuse_color.a;
    return vtx_color;
}
void main(void)
{
    int i, j;
    // do we need to transform P
    if(xform_eye_p)
        p_eye = modelview_matrix * a_position;
        
    if(enable_lighting)
    {
        n = inv_modelview_matrix * a_normal;
        if(rescale_normal)
            n = rescale_normal_factor * n;
        if (normalize_normal)
            n = normalize(n);
        mat_ambient_color = enable_color_material ? a_color
                                                  : material_state.ambient_color;
        mat_diffuse_color = enable_color_material ? a_color
                                                  : material_state.diffuse_color;
        v_front_color = do_lighting();
        v_back_color = v_front_color;
        
        // do 2-sided lighting
        if(light_model_two_sided)
        {
            n = -n;
            v_back_color = do_lighting();
        }
    }
    else
    {
        // set the default output color to be the per-vertex /
        // per-primitive color
        v_front_color = a_color;
        v_back_color = a_color;
    }
    // do texture xforms
    v_texcoord[indx_zero] = vec4(c_zero, c_zero, c_zero, c_one);
    if(enable_tex[indx_zero])
    {
        if(enable_tex_matrix[indx_zero])
            v_texcoord[indx_zero] = tex_matrix[indx_zero] * a_texcoord0;
        else
            v_texcoord[indx_zero] = a_texcoord0;
    }
    v_texcoord[indx_one] = vec4(c_zero, c_zero, c_zero, c_one);
    if(enable_tex[indx_one])
    {
        if(enable_tex_matrix[indx_one])
            v_texcoord[indx_one] = tex_matrix[indx_one] * a_texcoord1;
        else
            v_texcoord[indx_one] = a_texcoord1;
    }
    v_ucp_factor = enable_ucp ? dot(p_eye, ucp_eqn) : c_zero;
    v_fog_factor = enable_fog ? compute_fog() : c_one;
    gl_Position = mvp_matrix * a_position;
}


LSH 2021-03-08 22:05 發表評論
]]>
rayIntersect 重新修改http://www.shnenglu.com/jpweiyi/archive/2019/12/08/217018.htmlLSHLSHSat, 07 Dec 2019 16:59:00 GMThttp://www.shnenglu.com/jpweiyi/archive/2019/12/08/217018.htmlhttp://www.shnenglu.com/jpweiyi/comments/217018.htmlhttp://www.shnenglu.com/jpweiyi/archive/2019/12/08/217018.html#Feedback0http://www.shnenglu.com/jpweiyi/comments/commentRss/217018.htmlhttp://www.shnenglu.com/jpweiyi/services/trackbacks/217018.html

----------------------------------
一段光線求交的場景!
----------------------------------




LSH 2019-12-08 00:59 發表評論
]]>
350行路徑追蹤渲染器online demohttp://www.shnenglu.com/jpweiyi/archive/2019/12/07/217016.htmlLSHLSHSat, 07 Dec 2019 07:21:00 GMThttp://www.shnenglu.com/jpweiyi/archive/2019/12/07/217016.htmlhttp://www.shnenglu.com/jpweiyi/comments/217016.htmlhttp://www.shnenglu.com/jpweiyi/archive/2019/12/07/217016.html#Feedback0http://www.shnenglu.com/jpweiyi/comments/commentRss/217016.htmlhttp://www.shnenglu.com/jpweiyi/services/trackbacks/217016.html function CreateFPSCounter() { var mFrame; var mTo; var mFPS; var mLastTime; var mDeltaTime; var iReset = function (time) { time = time || 0; mFrame = 0; mTo = time; mFPS = 60.0; mLastTime = time; mDeltaTime = 0; } var iCount = function (time) { mFrame++; mDeltaTime = time - mLastTime; mLastTime = time; if ((time - mTo) > 500.0) { mFPS = 1000.0 * mFrame / (time - mTo); mFrame = 0; mTo = time; return true; } return false; } var iGetFPS = function () { return mFPS; } var iGetDeltaTime = function () { return mDeltaTime; } return { Reset: iReset, Count: iCount, GetFPS: iGetFPS, GetDeltaTime: iGetDeltaTime }; } function RequestFullScreen(ele) { if (ele == null) ele = document.documentElement; if (ele.requestFullscreen) ele.requestFullscreen(); else if (ele.msRequestFullscreen) ele.msRequestFullscreen(); else if (ele.mozRequestFullScreen) ele.mozRequestFullScreen(); else if (ele.webkitRequestFullscreen) ele.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT); } function Init() { if (window.init_flag === undefined) { console.log("init_flag"); var iMouse = window.iMouse = { x: 0, y: 0, z: 0, w: 0 }; var cv = document.getElementById("displayPort"); var fpsConter = CreateFPSCounter(); var context = cv.getContext('2d'); var W = cv.clientWidth; H = cv.clientHeight; var imageData = context.getImageData(0, 0, W, H); var pixels = imageData.data; for (var i = 0; i < W * H; ++i) pixels[4 * i + 3] = 255; function MainLoop(deltaTime) { var tracer = window.rayTracer; if (tracer == null) return; if (iMouse.z > 0.) tracer.ResetFrames(); var frames = tracer.CountFrames(); var i = 0, color; for (var y = 0; y < H; ++y) { for (var x = 0; x < W; ++x, ++i) { color = tracer.Render(x, y, W, H); pixels[i++] = (color.r * 255) | 0; pixels[i++] = (color.g * 255) | 0; pixels[i++] = (color.b * 255) | 0; } } context.putImageData(imageData, 0, 0); // console.log(deltaTime, fpsConter.GetFPS()) } function elementPos(element) { var x = 0, y = 0; while (element.offsetParent) { x += element.offsetLeft; y += element.offsetTop; element = element.offsetParent; } return { x: x, y: y }; } function getMouseCoords(ev, canvasElement) { var pos = elementPos(canvasElement); var mcx = (ev.pageX - pos.x) * canvasElement.width / canvasElement.offsetWidth; var mcy = (ev.pageY - pos.y) * canvasElement.height / canvasElement.offsetHeight; return { x: mcx, y: mcy }; } cv.onmousemove = function (ev) { var mouse = getMouseCoords(ev, cv); iMouse.x = mouse.x; iMouse.y = mouse.y; } cv.onmousedown = function (ev) { if (ev.button === 0) iMouse.z = 1; else if (ev.button === 2) { iMouse.w = 1; RequestFullScreen(cv); } } document.onmouseup = function (ev) { if (ev.button === 0) iMouse.z = 0; else if (ev.button === 2) iMouse.w = 0; } ; (function (loopFunc) { var fisrt = true; function L(timestamp) { if (fisrt) { fisrt = false, fpsConter.Reset(timestamp) } else { fpsConter.Count(timestamp); } loopFunc(fpsConter.GetDeltaTime()); requestAnimationFrame(L) }; requestAnimationFrame(L); })(MainLoop); window.init_flag = true; } } function CreateTracer() { try { (new Function(document.getElementById("codeEditor").value))(); window.rayTracer = new window.pt(); window.iMouse.x = window.iMouse.y = 0; var cv = document.getElementById("displayPort"); var W = cv.clientWidth; H = cv.clientHeight; window.rayTracer.CreateBackBuffer(W, H); } catch(e) { alert(e) } } Init(); CreateTracer();
這是一個簡單的路徑追蹤demo
移動視角:左鍵按下+鼠標移動
全屏查看:右鍵按下




LSH 2019-12-07 15:21 發表評論
]]>
關于向量的叉乘操作http://www.shnenglu.com/jpweiyi/archive/2019/11/03/216962.htmlLSHLSHSun, 03 Nov 2019 15:34:00 GMThttp://www.shnenglu.com/jpweiyi/archive/2019/11/03/216962.htmlhttp://www.shnenglu.com/jpweiyi/comments/216962.htmlhttp://www.shnenglu.com/jpweiyi/archive/2019/11/03/216962.html#Feedback0http://www.shnenglu.com/jpweiyi/comments/commentRss/216962.htmlhttp://www.shnenglu.com/jpweiyi/services/trackbacks/216962.html由于叉乘操作是有序的. 一般來說 : UxV不等于VxU, 
所有往往記不住到底是哪個左向量乘哪個右向量求出
第三個向量,由于吃了一些虧所以做了總結.
i,j,k三個基向量, 如果你使用的圖形引擎Z往屏幕外面,
右手邊X和上方向Y規定為正方向的一組正交向量,如果
你使用的模型的基向量組和它相同,那么放心用.
ixj=k, kxi=j, jxk=i 
但是你可能不總是那么幸運.也許你打算使用Z往屏幕里面,
右手邊X和上方向Y規定為正方向的一組正交向量,這時你就
需要改變叉乘方式了
jxi=k, ixk=j, kxj=i 
也就是統統反過來使用就可以了.
但是如果你想使用Z往屏幕里面,右手邊X和下方向Y規定
為正方向的一組正交向量時這時你又需要怎么弄呢?
其實還是:
ixj=k, kxi=j, jxk=i 
如果你想使用Z往屏幕里面,左手邊X和下方向Y規定
為正方向的一組正交向量時這時你又需要怎么弄呢?
這時又是:
jxi=k, ixk=j, kxj=i 
也是統統反過來使用.
這時怎么得到得結論?
其實就是通過計算得到的
以下都假設x右為正方向,y上為正方向,z往屏幕外為正方向設備的環境
測試.

var vec3 = glMatrix.vec3;
console.log("-------------------->z軸往屏幕里為正的坐標系");
var u = vec3.fromValues(1,0,0)
var v = vec3.fromValues(0,1,0)
var w = vec3.fromValues(0,0,-1)

console.log(vec3.cross(vec3.create(), w,v));
console.log(vec3.cross(vec3.create(), u,w));
console.log(vec3.cross(vec3.create(), v,u));
console.log("-------------------->y軸向下為正的坐標系");
var u = vec3.fromValues(1,0,0)
var v = vec3.fromValues(0,-1,0)
var w = vec3.fromValues(0,0,1)

console.log(vec3.cross(vec3.create(), w,v));
console.log(vec3.cross(vec3.create(), u,w));
console.log(vec3.cross(vec3.create(), v,u));
console.log("-------------------->x軸向左為正的坐標系");
var u = vec3.fromValues(-1,0,0)
var v = vec3.fromValues(0,1,0)
var w = vec3.fromValues(0,0,1)

console.log(vec3.cross(vec3.create(), w,v));
console.log(vec3.cross(vec3.create(), u,w));
console.log(vec3.cross(vec3.create(), v,u));
console.log("-------------------->全部反為正坐標系");
var u = vec3.fromValues(-1,0,0)
var v = vec3.fromValues(0,-1,0)
var w = vec3.fromValues(0,0,-1)
console.log(vec3.cross(vec3.create(), w,v));
console.log(vec3.cross(vec3.create(), u,w));
console.log(vec3.cross(vec3.create(), v,u));

以上都能得到正確的向量組

console.log("-------------------->z軸往屏幕外為正坐標系");
var u = vec3.fromValues(1,0,0)
var v = vec3.fromValues(0,1,0)
var w = vec3.fromValues(0,0,1)
console.log(vec3.cross(vec3.create(), v,w));
console.log(vec3.cross(vec3.create(), w,u));
console.log(vec3.cross(vec3.create(), u,v));
console.log("-------------------->任意兩個是為負數的坐標系");
var u = vec3.fromValues(-1,0,0)
var v = vec3.fromValues(0,1,0)
var w = vec3.fromValues(0,0,-1)
console.log(vec3.cross(vec3.create(), v,w));
console.log(vec3.cross(vec3.create(), w,u));
console.log(vec3.cross(vec3.create(), u,v));

以上也都能得到正確的向量組.
結論就是如果偶數相反就正常使用,如果是奇數相反就
用反過來用.


LSH 2019-11-03 23:34 發表評論
]]>
排列組合http://www.shnenglu.com/jpweiyi/archive/2019/06/26/216460.htmlLSHLSHWed, 26 Jun 2019 04:57:00 GMThttp://www.shnenglu.com/jpweiyi/archive/2019/06/26/216460.htmlhttp://www.shnenglu.com/jpweiyi/comments/216460.htmlhttp://www.shnenglu.com/jpweiyi/archive/2019/06/26/216460.html#Feedback0http://www.shnenglu.com/jpweiyi/comments/commentRss/216460.htmlhttp://www.shnenglu.com/jpweiyi/services/trackbacks/216460.html
// 排列:正數n的全排列
// n 正數n
// return 數值
function A(n) {
if (n <= 0) return n;
var sum = 1;
for (var i = n; i > 0; --i) {
sum *= i;
}
return sum;
}

// 組合:從n個中選擇m個來組合
// n 正數n
// m 正數m
// return 數值
function C(n, m) {
return A(n) / (A(m) * A(n - m));
}

// 數組組合: 從array中選擇n個元素來組合
// array 數組
// n 正數n
// return 多少種組合
function ArrayComb(array, n) {
var result = [], t = [], e;

function Recursion(index, array, n, t, result) {
if (t.length === n) { result.push(t.slice()); return };

for (var i = index; i < array.length; ++i) {
e = array[i];
t.push(e);
Recursion(i + 1, array, n, t, result);
t.pop();
}
}

Recursion(0, array, n, t, result);
return result;
}


LSH 2019-06-26 12:57 發表評論
]]>
rayIntersecthttp://www.shnenglu.com/jpweiyi/archive/2018/03/23/215560.htmlLSHLSHThu, 22 Mar 2018 16:27:00 GMThttp://www.shnenglu.com/jpweiyi/archive/2018/03/23/215560.htmlhttp://www.shnenglu.com/jpweiyi/comments/215560.htmlhttp://www.shnenglu.com/jpweiyi/archive/2018/03/23/215560.html#Feedback0http://www.shnenglu.com/jpweiyi/comments/commentRss/215560.htmlhttp://www.shnenglu.com/jpweiyi/services/trackbacks/215560.html閱讀全文

LSH 2018-03-23 00:27 發表評論
]]>
矩陣計算器http://www.shnenglu.com/jpweiyi/archive/2017/01/19/214612.htmlLSHLSHThu, 19 Jan 2017 15:36:00 GMThttp://www.shnenglu.com/jpweiyi/archive/2017/01/19/214612.htmlhttp://www.shnenglu.com/jpweiyi/comments/214612.htmlhttp://www.shnenglu.com/jpweiyi/archive/2017/01/19/214612.html#Feedback0http://www.shnenglu.com/jpweiyi/comments/commentRss/214612.htmlhttp://www.shnenglu.com/jpweiyi/services/trackbacks/214612.html<html><head><title>矩陣計算器 (1.0)</title><meta charset="utf-8">&l...  閱讀全文

LSH 2017-01-19 23:36 發表評論
]]>
Quine programhttp://www.shnenglu.com/jpweiyi/archive/2016/12/16/214505.htmlLSHLSHFri, 16 Dec 2016 08:44:00 GMThttp://www.shnenglu.com/jpweiyi/archive/2016/12/16/214505.htmlhttp://www.shnenglu.com/jpweiyi/comments/214505.htmlhttp://www.shnenglu.com/jpweiyi/archive/2016/12/16/214505.html#Feedback0http://www.shnenglu.com/jpweiyi/comments/commentRss/214505.htmlhttp://www.shnenglu.com/jpweiyi/services/trackbacks/214505.html
//>this is a Quine program implement by c language.
//>reference http://www.madore.org/~david/computers/quine.html
#include <stdio.h>
int main(void){
  char n='\n'; char g='\\'; char q='"'; char s=';';
  char*s1="http://>this is a Quine program implement by c language.%c//>reference http://www.madore.org/~david/computers/quine.html%c#include <stdio.h>%cint main(void){%c  char n='%cn'; char g='%c%c'; char q='%c'; char s=';';%c  char*s1=%c%s%c;%c  printf(s1,n,n,n,n,g,g,g,q,n,q,s1,q,n,s,n,s,n)%c%c  return 0%c%c}";
  printf(s1,n,n,n,n,g,g,g,q,n,q,s1,q,n,s,n,s,n);
  return 0;
}
javascript
var c1='"'; var c2='\n'; var c3='\\'; var c4=';';
var s1="var c1='%c1'; var c2='%c3n'; var c3='%c3%c3'; var c4=';';%c2var s1=%c1%s1%c1%c4%c2console.log((((((((((s1.replace('%c1', c1)).replace('%c1', c1)).replace('%c1', c1)).replace('%c2', c2)).replace('%c2', c2)).replace('%c3', c3)).replace('%c3', c3)).replace('%c3', c3)).replace('%c4', c4)).replace('%s1', s1))";
console.log((((((((((s1.replace('%c1', c1)).replace('%c1', c1)).replace('%c1', c1)).replace('%c2', c2)).replace('%c2', c2)).replace('%c3', c3)).replace('%c3', c3)).replace('%c3', c3)).replace('%c4', c4)).replace('%s1', s1))


LSH 2016-12-16 16:44 發表評論
]]>
js模塊編程http://www.shnenglu.com/jpweiyi/archive/2016/10/02/214312.htmlLSHLSHSun, 02 Oct 2016 12:33:00 GMThttp://www.shnenglu.com/jpweiyi/archive/2016/10/02/214312.htmlhttp://www.shnenglu.com/jpweiyi/comments/214312.htmlhttp://www.shnenglu.com/jpweiyi/archive/2016/10/02/214312.html#Feedback0http://www.shnenglu.com/jpweiyi/comments/commentRss/214312.htmlhttp://www.shnenglu.com/jpweiyi/services/trackbacks/214312.html
<script type="text/javascript">
 
        void function(global)
        {
            var mapping = {}, cache = {};
            global.define = function(id, func){
                mapping[id] = func;
            };
            
            global.require = function(id){
                if(cache[id])
                    return cache[id];
                else
                    return cache[id] = mapping[id]({});
            };
        }(this);
        
        define("moduleA", function(exports)
        {
            function ClassA(){
            }
            
            ClassA.prototype.print = function(){
                alert("moduleA.ClassA")
            }
            
            exports.New = function(){
                return new ClassA();
            }
        
            return exports;
            
        });
        
        define("moduleB", function(exports)
        {
            function ClassB(){
            }
        
            ClassB.prototype.print = function(){
                alert("moduleB.ClassB")
            }
            
            exports.New = function(){
                return new ClassB();
            }
            
            return exports;
        });
        
        define("moduleC", function(exports)
        {
            function ClassC(){
            }
        
            ClassC.prototype.print = function(){
                var classA = require("moduleA").New();
                classA.print();
                    
                var classB = require("moduleB").New();
                classB.print();
                    
                alert("moduleC.ClassC")
            }
            
            exports.New = function(){
                return new ClassC();
            }
            
            return exports;
        });
        
        var classC = require("moduleC").New();
        classC.print();
        
      </script>


LSH 2016-10-02 20:33 發表評論
]]>
trace.bathttp://www.shnenglu.com/jpweiyi/archive/2016/09/19/214281.htmlLSHLSHSun, 18 Sep 2016 19:07:00 GMThttp://www.shnenglu.com/jpweiyi/archive/2016/09/19/214281.htmlhttp://www.shnenglu.com/jpweiyi/comments/214281.htmlhttp://www.shnenglu.com/jpweiyi/archive/2016/09/19/214281.html#Feedback0http://www.shnenglu.com/jpweiyi/comments/commentRss/214281.htmlhttp://www.shnenglu.com/jpweiyi/services/trackbacks/214281.html
@echo off
:Main
setlocal EnableDelayedExpansion
call :ShowInputIP
call :CheckIP
if %errorlevel% == 1 (
    call :TrackIP !IP! 1
)
setlocal DisableDelayedExpansion
goto :Main
::---------------------------------------------------------------
:TrackIP
ping %1 -n 2 -i %2 >rs.txt
set /a c=%2+1
if %c% geq 65 (
    echo 超出TTL限制[65]
    ping %1 -n 1
    goto :eof
)
for /f "tokens=1-5* delims= " %%i in (rs.txt) do (
    if "%%i" == "來自" (
        echo    追蹤到IP[%%j] TTL=%2
        if %%j == !IP! (
            echo 追蹤完成!!! 
        ) else (
            call :TrackIP %1 %c%
        )
        goto :eof
    ) else (
        if "%%i" == "請求超時。" ( 
            echo 跳躍TTL  [TTL=%2%] 
            call :TrackIP %1 %c% 
            goto :eof
        )
    )
)
goto :eof
::---------------------------------------------------------------
:ShowInputIP
echo 請輸入要跟蹤 ip/域名 地址:
set /p IP=
goto :eof
::---------------------------------------------------------------
:CheckIP
ping %IP% -n 1 >temp.txt
set context=
for /f "tokens=1-5* delims= " %%i in (temp.txt) do (
    if "%%m" == "具有" (
        set context=%%l
        set IP=!context:~1,-1!
        echo 解析域名 [%IP%] → IP [!IP!]
        goto :CheckEnd
    )
)
:CheckEnd
del temp.txt
exit /b 1


LSH 2016-09-19 03:07 發表評論
]]>
久久久久综合网久久| 四虎国产永久免费久久| 国产成人精品久久一区二区三区av | 久久亚洲私人国产精品vA | 精品久久8x国产免费观看| 久久99精品九九九久久婷婷| 亚洲国产精品久久电影欧美| 久久国产V一级毛多内射| 久久午夜无码鲁丝片| 亚洲乱码日产精品a级毛片久久| 国内精品久久久久久野外| 成人久久免费网站| 久久男人AV资源网站| 久久99热国产这有精品| 色狠狠久久AV五月综合| 亚洲国产精品狼友中文久久久| 国产精品九九久久精品女同亚洲欧美日韩综合区 | 九九久久精品国产| 久久精品国产秦先生| 久久偷看各类wc女厕嘘嘘| 精品人妻伦九区久久AAA片69| 久久青青草原精品国产软件| 99久久精品久久久久久清纯| 1000部精品久久久久久久久| 蜜臀久久99精品久久久久久小说| 久久久免费观成人影院| 国产精品女同一区二区久久| 四虎国产精品免费久久久| 久久精品国产影库免费看 | 热综合一本伊人久久精品| 99久久综合国产精品二区| 久久99热只有频精品8| 久久综合狠狠综合久久综合88| 国产成人精品综合久久久| 综合久久精品色| 2021国内精品久久久久久影院| 美女久久久久久| 久久亚洲中文字幕精品一区四| 久久国产高清一区二区三区| 精品久久久久久国产三级 | 久久久综合香蕉尹人综合网|