一个类似于Pl/SQL Developer的DateTime选择的Javascript日历控件

QT窗体大小控制全攻略:从setFixedSize到事件过滤器的进阶用法 本文深入探讨了QT窗体尺寸控制的进阶实践,从基础的setFixedSize方法到结合事件过滤器实现智能动态适配。通过分析窗口状态变化、多显示器环境处理以及布局策略,提供了实现禁止缩放但支持最大化、多屏智能适配及动态约束等复杂场景的完整解决方案与核心代码示例。 阅读详情

网上对于日期选择控件的开源程序很多,但好像找不到可以同时编辑日期和时间的程序。在平时开发的时候也遇到了这种问题,通常的解决方法都是直接编辑或分开为两个字段,实在不便。今天工作之余抽空写了这么一个程序,由于时间仓促,没有加入注释也没有对代码进行重构,所以代码没有什么可读性,不过需要使用的朋友可以直接copy使用,要修改外观只需改变样式表即可。

我把这个程序命名为RoyalCalendar,在使用的时候,我一般把css和js文件include进来。

用法:

样式表定义如下:

filename:RoyalCalendar.css

#RoyalCalendar{visibility:hidden;cursor:default;background-color:#E9E9E9;position:absolute;top:0;left:0;width:90px;height:200px;border:solid black 1px;font:normal normal lighter 9pt}
#RoyalCalendar_TopTable{background-color:transparent}
#RoyalCalendar_Month{background-color:#E9E9E9;font:normal normal lighter 9pt}
#RoyalCalendar_Year{background-color:#E9E9E9;font:normal normal lighter 9pt}
#RoyalCalendar_CalendarTable{background-color:transparent;font:normal normal lighter 9pt}
#RoyalCalendar_Hour{background-color:#E9E9E9;font:normal normal lighter 9pt}
#RoyalCalendar_Minute{background-color:#E9E9E9;font:normal normal lighter 9pt}
#RoyalCalendar_Second{background-color:#E9E9E9;font:normal normal lighter 9pt}
#RoyalCalendar_AMPM{background-color:#E9E9E9;font:normal normal lighter 9pt}
.RoyalSmallButton{font:normal normal lighter 8pt;height:8pt;line-height:6pt;width:15pt}
.RoyalSmallButton2{font:normal normal lighter 8pt;height:12pt;line-height:6pt;width:8pt}
.RoyalCalendar_Day_Normal{font:normal normal lighter 9pt;background-color:transparent;cursor:hand}
.RoyalCalendar_Day_MouseOver{font:normal normal lighter 9pt;background-color:#FF00FF;cursor:hand}

.RoyalCalendar_Sunday_Normal{border-left:solid black 1px;font:normal normal lighter 9pt;background-color:transparent;cursor:hand}
.RoyalCalendar_Sunday_MouseOver{border-left:solid black 1px;font:normal normal lighter 9pt;background-color:#FF00FF;cursor:hand}


#RoyalOKButton{font:normal normal lighter 8pt;height:12pt;line-height:10pt;width:20pt}
#RoyalCancelButton{font:normal normal lighter 8pt;height:12pt;line-height:10pt;width:20pt}

 

样式表的命名都很容易看懂,就不一一解释了。下面是Javascript程序

filename:RoyalCalendar.js

var RoyalCalendar_ISSHOW="0";
var RoyalCalendar_CurrentDay="1";

function $(id){
 return document.getElementById(id);
}
function RoyalCalendar(){
 this.obj=null;
}
function IsLeapYear(AYear)
{
 var b = ((AYear % 4)==0) && ((AYear % 100)!=0) || ((AYear % 400)==0) ;
 return (b);
}
function GetDaysOfMonth(AMonth,AYear) 
{
 monthdays = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30,31, 30, 31)
 days = -1;
 if ( AMonth>=1 && AMonth<=12 ) days = monthdays[AMonth -1 ]; 
 if (AMonth==2 && IsLeapYear(AYear) ) days=29;
 return (days);
}
function GetIntegerValue(Str, pos, len )
{
 result = 0;
 astr = Str.substring(pos, pos+len)
 if ( /^[-+]?([0-9]+)$/.test( astr ) )
 {
  result = astr ;
 } else { result = -1 }
 return result;
}
function CheckIsDateTime( ADtStr , FmtStr )
{
 res=true;
 if ( ADtStr=="" || FmtStr=="")  return false  
 fstr = FmtStr.toUpperCase();
 i =0 ; p = 0; Li = 0; Lp = 0;
 y = -1 ; m = -1; d = -1; h= -1; mi= -1; s=-1;
 while( i < fstr.length )
 {
  fmtch = fstr.substring(i,i+1);  // current
  fmtchn = fstr.substring(i+1,i+2); // next
  adtch = ADtStr.substring(p, p+1); // current
  adtchn = ADtStr.substring(p+1, p+2); // next
  if ( fmtch=="Y" )   // get year
  { 
   if ( fmtchn=="Y" )
   {
    y3=fstr.substring(i+2,i+3); // next
    y4=fstr.substring(i+3,i+4); // next
    if ( y3 =="Y" && y4 =="Y" ){ Li = 4; Lp = 4; }
    else { Li=2; Lp=2; }
    y = GetIntegerValue( ADtStr, p, Lp );
    if ( !( y>=0 && y<=9999 ) ) res = false;
   }else
   {
    if ( fmtch == adtch ) { Li=1; Lp=1 }
    else{ res =false; }
   }
  }else // get m .d . h .mi s
  {
   if ( fmtchn == fmtch ) Li = 2; else Li = 1;
   if ( adtchn >="0" && adtchn <="9") Lp = 2 ;else Lp = 1; 
   avalue = GetIntegerValue( ADtStr, p, Lp);
   if ( fmtch=="M" )
   {
    if ( fmtchn=="I" ) // Minute
    {
     Li=2;  // special
     mi = avalue;
     if ( !( mi>=0 && mi<=59 ) ) res = false;
    }else // default is as Month
    {
     m = avalue;
     if ( !( m>=1 && m<=12 ) ) res = false;
    }
   }else
   if ( fmtch=="D" )
   {
    d = avalue;
    if ( !( d>=1 && d<=31 ) ) res = false;
   }else
   if ( fmtch=="H" )
   {
    h = avalue;
    if ( !( h>=0 && h<=23 ) ) res = false;
   }else
   if ( fmtch=="S" )
   {
    s = avalue;
    if ( !( s>=0 && s<=59 ) ) res = false;
   }else
   {
    if ( fmtch == adtch ) { Li=1; Lp=1 }
    else{ res =false; }
   }
  }
  i += Li; p+=Lp; //==================>>>!!!
  if (! res ) return res;
 }
 if ( res && i != fstr.length || p != ADtStr.length ) res = false;
 if ( ! ( res &&  m!=-1 && d!=-1 && d<=GetDaysOfMonth(m, y ) ) )  res = false;
 return res;
} 
function RoyalCalendar_OK(){
 var add=0;
 var ampm=$("RoyalCalendar_AMPM").value;
 if(ampm=="PM"){
  add=12;
 }
 var calendar=RCalendar;
 var obj=calendar.obj;
 var year=$("RoyalCalendar_Year").value;
 var month=Number($("RoyalCalendar_Month").value);
 var day=RoyalCalendar_CurrentDay;
 var hour=Number($("RoyalCalendar_Hour").value);
 hour+=add;
 var minute=$("RoyalCalendar_Minute").value;
 var second=$("RoyalCalendar_Second").value;
 if(year<10){
  year="0"+year;
 }
 if(month<10){
  month="0"+month;
 }
 if(day<10){
  day="0"+day;
 }
 if(hour<10){
  hour="0"+hour;
 }
 if(minute<10){
  minute="0"+minute;
 }
 if(second<10){
  second="0"+second;
 }
 if(Number(hour)==0&&Number(minute)==0&&Number(second)==0){
  obj.value=year+"-"+month+"-"+day;
 }else{
  obj.value=year+"-"+month+"-"+day+" "+hour+":"+minute+":"+second;
 }
 RoyalCalendar_Cancel();
}
function RoyalCalendar_Cancel(){
 $("RoyalCalendar").style.visibility="hidden";
}
function RoyalCalendar_SetValue(date){
 var year=date.getFullYear();
 $("RoyalCalendar_Year").value=year;
 var month=date.getMonth();
 $("RoyalCalendar_Month").value=Number(month)+1;
 var hour=date.getHours();
 if(hour>12){
  hour=hour-12;
  $("RoyalCalendar_AMPM").value="PM";
 }else{
  $("RoyalCalendar_AMPM").value="AM";
 }
 $("RoyalCalendar_Hour").value=hour;
 var minute=date.getMinutes();
 $("RoyalCalendar_Minute").value=minute;
 var second=date.getSeconds();
 $("RoyalCalendar_Second").value=second;
 
}
function RoyalCalendar_IncYear(){
 var div=$("RoyalCalendar_Year");
 div.value++;
 RoyalCalendar_ReSetCalendar();
}
function RoyalCalendar_DecYear(){
 var div=$("RoyalCalendar_Year");
 div.value--;
 RoyalCalendar_ReSetCalendar();
}
function RoyalCalendar_IncHour(){
 var div=$("RoyalCalendar_Hour");
 var hour=div.value;
 hour=(hour)%12+1;
 div.value=hour;
}
function RoyalCalendar_DecHour(){
 var div=$("RoyalCalendar_Hour");
 var hour=div.value;
 hour=hour-1;
 if(hour<0){
  hour=11;
 }
 div.value=hour;
}
function RoyalCalendar_IncMinute(){
 var div=$("RoyalCalendar_Minute");
 var minute=div.value;
 minute++;
 if(minute>59){
  minute=0;
 }
 div.value=minute;
}
function RoyalCalendar_DecMinute(){
 var div=$("RoyalCalendar_Minute");
 var minute=div.value;
 minute--;
 if(minute<0){
  minute=59;
 }
 div.value=minute;
}
function RoyalCalendar_IncSecond(){
 var div=$("RoyalCalendar_Second");
 var second=div.value;
 second++;
 if(second>59){
  second=0;
 }
 div.value=second;
}
function RoyalCalendar_IncAMPM(){
 var div=$("RoyalCalendar_AMPM");
 if(div.value=="AM"){
  div.value="PM";
 }else{
  div.value="AM";
 }
}
function RoyalCalendar_DecAMPM(){
 var div=$("RoyalCalendar_AMPM");
 if(div.value=="AM"){
  div.value="PM";
 }else{
  div.value="AM";
 }
}
function RoyalCalendar_DecSecond(){
 var div=$("RoyalCalendar_Second");
 var second=div.value;
 second--;
 if(second<0){
  second=59;
 }
 div.value=second;
}
function RoyalCalendar_parseDate(str){
 var date=new Date();
 try{
 if(CheckIsDateTime(str,"YYYY-MM-DD HH:mi:ss")){
  var arr=str.split(" ");
  var datestr=arr[0];
  var timestr=arr[1];
  var datearr=datestr.split("-");
  var timearr=timestr.split(":");
  date.setYear(datearr[0]);
  date.setMonth(datearr[1]-1);
  date.setDate(datearr[2]);
  date.setHours(timearr[0]);
  date.setMinutes(timearr[1]);
  date.setSeconds(timearr[2]);
  return date;
 }
 if(CheckIsDateTime(str,"YYYY-MM-DD")){ 
  var datearr=str.split("-");
  date=new Date();
  date.setYear(datearr[0]);
  date.setMonth(datearr[1]-1);
  date.setDate(datearr[2]);
  date.setHours(0);
  date.setMinutes(0);
  date.setSeconds(0);
  return date;
 }
 }catch(e){}
 return date;
}
function RoyalCalendar_SetCalendar(date){
 var totalDays=GetDaysOfMonth(Number(date.getMonth()+1),date.getFullYear());
 var firstday=new Date(date.getYear(),date.getMonth(),1);
 var firstDiv=firstday.getDay()%7+1;
 for(var i=1;i<42;i++){
  $("RoyalCalendar_Day_"+i).innerHTML="";
 }
 for(var i=firstDiv;i<firstDiv+totalDays;i++){
  var t=i-firstDiv+1;
  if((i-firstDiv+1)==date.getDate()){
   $("RoyalCalendar_Day_"+i).innerHTML="<B><font color=blue><a onclick=javascript:RoyalCalendar_SelectDay("+t+")>"+t+"</a></font></B>";
  }else{
   $("RoyalCalendar_Day_"+i).innerHTML="<a onclick=javascript:RoyalCalendar_SelectDay("+t+")>"+t+"</a>";
  }
 }
}
function RoyalCalendar_ReSetCalendar(){
 var day=RoyalCalendar_CurrentDay;
 var month=$("RoyalCalendar_Month").value;
 var year=$("RoyalCalendar_Year").value;
 var date=new Date(year,month-1,day,0,0,0);
 RoyalCalendar_SetCalendar(date);
}
RoyalCalendar.prototype.show=function(obj){
 this.obj=obj;
 var date=RoyalCalendar_parseDate(obj.value);
 RoyalCalendar_SetValue(date);
 RoyalCalendar_SetCalendar(date);
// RoyalCalendar_ReSetCalendar();
 $("RoyalCalendar").style.left=event.x;
 $("RoyalCalendar").style.visibility="visible";
 RoyalCalendar_ISSHOW="1";
}
RoyalCalendar.prototype.init=function(){
 var text="";
 text+="<div id=/"RoyalCalendar/" align=center>";
 text+="<table border=0 id=/"RoyalCalendar_TopTable/" width=100%>";
 text+="<!----年月----->";
 text+="<tr>";
 text+="<td><select id=/"RoyalCalendar_Month/" onchange=/"RoyalCalendar_ReSetCalendar()/"><option value='1'>一月<option value='2'>二月<option value='3'>三月<option value='4'>四月<option value='5'>五月<option value='6'>六月<option value='7'>七月<option value='8'>八月<option value='9'>九月<option value='10'>十月<option value='11'>十一月<option value='12'>十二月</select></td>";
 text+="<td nowrap align=right>";
 text+="<input readonly onchange=/"RoyalCalendar_ReSetCalendar()/" type=text size=3 value=/"2006/" id=/"RoyalCalendar_Year/" onblur=/"if(this.value){}/">";
 text+="</td>";
 text+="<td align=left>";
 text+="<div><input type=button value=/"+/" class=/"RoyalSmallButton/" onclick=/"RoyalCalendar_IncYear()/"></div>";
 text+="<div><input type=button value=/"-/" class=/"RoyalSmallButton/" onclick=/"RoyalCalendar_DecYear()/"></div>";
 text+="</td>";
 text+="</tr>";
 text+="<!----年月----->";
 text+="<!----日历----->";
 text+="<td align=center colspan=3>";
 text+="<table border=0 id=/"RoyalCalendar_CalendarTable/" align=center>";
 text+="<Tr>";
 text+=" <td style=/"border-bottom:solid black 1px;cursor:crosshair/"><font color=red>日</font></td>";
 text+=" <td style=/"border-bottom:solid black 1px;cursor:crosshair/">一</td>";
 text+=" <td style=/"border-bottom:solid black 1px;cursor:crosshair/">二</td>";
 text+=" <td style=/"border-bottom:solid black 1px;cursor:crosshair/">三</td>";
 text+=" <td style=/"border-bottom:solid black 1px;cursor:crosshair/">四</td>";
 text+=" <td style=/"border-bottom:solid black 1px;cursor:crosshair/">五</td>";
 text+=" <td style=/"border-bottom:solid black 1px;cursor:crosshair/">六</td>";
 text+="</tr>";
 for(var i=0;i<6;i++){
 text+="<tr>";
 text+=" <td align=center class=/"RoyalCalendar_Sunday_Normal/" onmouseover='this.className=/"RoyalCalendar_Sunday_MouseOver/"' onmouseout='this.className=/"RoyalCalendar_Sunday_Normal/"'><font color=red><div id=/"RoyalCalendar_Day_"+(i*7+1)+"/">&nbsp;</div></font></td>";
 text+=" <td align=center class=/"RoyalCalendar_Day_Normal/" onmouseover='this.className=/"RoyalCalendar_Day_MouseOver/"' onmouseout='this.className=/"RoyalCalendar_Day_Normal/"'><div id=/"RoyalCalendar_Day_"+(i*7+2)+"/">&nbsp;</div></td>";
 text+=" <td align=center class=/"RoyalCalendar_Day_Normal/" onmouseover='this.className=/"RoyalCalendar_Day_MouseOver/"' onmouseout='this.className=/"RoyalCalendar_Day_Normal/"'><div id=/"RoyalCalendar_Day_"+(i*7+3)+"/">&nbsp;</div></td>";
 text+=" <td align=center class=/"RoyalCalendar_Day_Normal/" onmouseover='this.className=/"RoyalCalendar_Day_MouseOver/"' onmouseout='this.className=/"RoyalCalendar_Day_Normal/"'><div id=/"RoyalCalendar_Day_"+(i*7+4)+"/">&nbsp;</div></td>";
 text+=" <td align=center class=/"RoyalCalendar_Day_Normal/" onmouseover='this.className=/"RoyalCalendar_Day_MouseOver/"' onmouseout='this.className=/"RoyalCalendar_Day_Normal/"'><div id=/"RoyalCalendar_Day_"+(i*7+5)+"/">&nbsp;</div></td>";
 text+=" <td align=center class=/"RoyalCalendar_Day_Normal/" onmouseover='this.className=/"RoyalCalendar_Day_MouseOver/"' onmouseout='this.className=/"RoyalCalendar_Day_Normal/"'><div id=/"RoyalCalendar_Day_"+(i*7+6)+"/">&nbsp;</div></td>";
 text+=" <td align=center class=/"RoyalCalendar_Day_Normal/" onmouseover='this.className=/"RoyalCalendar_Day_MouseOver/"' onmouseout='this.className=/"RoyalCalendar_Day_Normal/"'><div id=/"RoyalCalendar_Day_"+(i*7+7)+"/">&nbsp;</div></td>";
 text+="</tr>";
 }
 text+="</table>";
 text+="</td>";
 text+="</tr>";
 text+="<!----日历----->";
 text+="<tr>";
 text+="<td colspan=3>";
 text+="<table width=100 border=0 cellspadding=1 cellspacing=1>";
 text+="<tr>";
 text+="<td align=center>";
 text+="<input type=text size=1 id=/"RoyalCalendar_Hour/" value=/"00/">";
 text+="</td>";
 text+="<td align=center style=/"font-size:9pt/">:</td>";
 text+="<td align=center>";
 text+="<input size=1 type=text id=/"RoyalCalendar_Minute/" value=/"00/">";
 text+="</td>";
 text+="<td align=center style=/"font-size:9pt/">:</td>";
 text+="<td align=center>";
 text+="<input type=text size=1 id=/"RoyalCalendar_Second/" value=/"00/">";
 text+="</td>";
 text+="<td align=center style=/"font-size:9pt/">&nbsp;</td>";
 text+="<td align=center>";
 text+="<input type=text size=1 id=/"RoyalCalendar_AMPM/" value=/"AM/">";
 text+="</td>";
 text+="<td>";
 text+="<input type=button id=/"RoyalOKButton/" value=/"确定/" onclick=/"RoyalCalendar_OK()/">";
 text+="</td>";
 text+="</tr>";
 text+="<tr>";
 text+="<td align=center><input type=button value=/"+/" class=/"RoyalSmallButton2/" onclick=/"RoyalCalendar_IncHour()/"><input type=button value=/"-/" class=/"RoyalSmallButton2/" onclick=/"RoyalCalendar_DecHour()/"></td>";
 text+="<td></td>";
 text+="<td align=center><input type=button value=/"+/" class=/"RoyalSmallButton2/" onclick=/"RoyalCalendar_IncMinute()/"><input type=button value=/"-/" class=/"RoyalSmallButton2/" onclick=/"RoyalCalendar_DecMinute()/"></td>";
 text+="<td></td>";
 text+="<td align=center><input type=button value=/"+/" class=/"RoyalSmallButton2/" onclick=/"RoyalCalendar_IncSecond()/"><input type=button value=/"-/" class=/"RoyalSmallButton2/" onclick=/"RoyalCalendar_DecSecond()/"></td>";
 text+="<td></td>";
 text+="<td align=center><input type=button value=/"+/" class=/"RoyalSmallButton2/" onclick=/"RoyalCalendar_IncAMPM()/"><input type=button value=/"-/" class=/"RoyalSmallButton2/" onclick=/"RoyalCalendar_DecAMPM()/"></td>";
 text+="<td align=center>";
 text+="<input type=button id=/"RoyalCancelButton/" value=/"取消/" onclick=/"RoyalCalendar_Cancel()/">";
 text+="</td>";
 text+="</tr>";
 text+="</table>";
 text+="</td>";
 text+="</tr>";
 text+="</table>";
 text+="</div>";
 document.writeln(text);
}
function RoyalCalendar_SelectDay(day){
 RoyalCalendar_CurrentDay=day;
 RoyalCalendar_OK();
}
var RCalendar=new RoyalCalendar();
RCalendar.init();

 

 

 

【PCIe DL_Feature详解】    Data Link Control and Management State Machine在PCIe Gen4引入了DL_Feature这个状态,该状态主要用来协商PCIe link 两端是否支持新的DL Feature,目前为止DL Feature只引入了Scaled Flow Control 来提高Gen4及以上的效率。   DL_Feature 这个状态是可选的,当 Data Link Feature Extended Capability中Data Link Feature Exchang 阅读详情

相关推荐

Selenium实战:突破反爬,自动化抓取国家知识产权局专利数据

网络爬虫是数据采集的核心技术,其原理是通过程序模拟浏览器行为,自动访问网页并提取结构化信息。在数据驱动决策的今天,高效获取公开数据对市场分析、技术调研和竞争情报至关重要。然而,面对广泛应用的JavaScript动态渲染和反爬虫机制,传统的静态页面抓取方法往往失效。Selenium作为浏览器自动化工具,通过驱动真实浏览器执行JavaScript,能够有效绕过前端反爬,实现“可见即可得”的数据抓取,在需要与页面进行复杂交互或处理动态内容的场景中价值显著。本文以【专利数据】抓取为例,结合【Selenium】工具,

weixin_33881140的博客 408

Oracle学习日历(十一)-PL/SQL 块的结构和实例

pl/sql的介绍   pl/sql是什么 pl/sql(procedural language/sql)是oracle在标准的sql语言上的扩展。pl/sql不仅允许嵌入sql语言,还可以定义变量和常量,允许使用条件语句和循环语句,允许使用例外处理各种错误,这样使得它的功能变得更加强大。 看图:   为什么学pl/sql    学习必要性n 1.提高应用程序的运行性能 2.模块化的设计思想...

zx03070723的专栏 228

实验记录 | 如何拆分scATAC-seq数据成为单个细胞?(1、解决barcode问题)

在师兄的帮助下,我得到了师兄筛选过的细胞的barcode的数据,那么接下来我想根据这些barcode,将来源于同一个barcode的细胞的reads提取出来,这个还是一个蛮有技术含量的事情的,因为上次我有使用过perl的脚本进行提取,最后的实验结果很糟糕,故而这件事情一直搁置到现在,没有继续去做(我的脚本的编写能力还是有待于加强,可能是刚刚喝了奶茶,和老妈弟弟聊了好多闲话,很开心,觉得在某种程度上休息够了,对于工作也是一种非常快乐和积极的状态了)。 0。前期失败尝试回顾 ...

weixin_40640700的博客 1890

环信 GitHub 仓库索引——全部SDK、UIKit 与 CallKit、Demo 与集成示例

本文档汇总环信官方及社区GitHub仓库,涵盖多端IM SDK、UIKit、CallKit组件及完整Demo,支持iOS、Android、Flutter、React Native、HarmonyOS等平台,提供快速集成与开发参考。

huan132456765的博客 217

A Mathematical Framework for Transformer Circuits—(二)

transformer数学理论框架

qq_42208244的博客 763

SRC漏洞挖掘实战指南:从零入门到月入过万的网络安全副业

网络安全的核心在于识别和修复系统缺陷,其中逻辑漏洞与信息泄露是常见的安全风险。其原理在于应用程序在业务逻辑设计或数据处理过程中存在缺陷,导致未授权访问或敏感数据暴露。掌握这些技术对于构建安全的应用体系至关重要,不仅能有效防范攻击,也为安全研究人员提供了将技术能力变现的合法途径。在漏洞赏金(Bug Bounty)和SRC(安全应急响应中心)等应用场景中,白帽子通过系统化的测试方法,挖掘此类漏洞,既能获得经济回报,又能积累宝贵的实战经验。本文聚焦于逻辑漏洞与信息泄露的实战挖掘技巧,为初学者提供清晰的入门路径和效

weixin_28568819的博客 360

JS 打印空白页:网页打印控件 iframe 时序排查与修复

从整页空白复现出发,定位 iframe onload 与 document.write 的时序竞争。本文结合具体场景讲清做法、常见问题与可复用的实现思路。

一天拉了7遍的博客 140

如何利用VS2017创建一个简单的窗口

#如何利用VS2017创建一个简单的窗口 1、新建->Windows桌面向导 2、应用程序类型->桌面应用程序,点击确定 3、点击调试->开始调试 可建立如下图的窗口 4、可以在生成的项目文件的中找到windows17_2的应用程序,打开界面如下: 注:新建空白项目也可以,注意在解决方案资源器中添加.cpp文件,如源.cpp文件,下载代码见博文 ...

weixin_46894139的博客 2917

基于Docker Compose 部署RuoYi-Vue 前后端分离后台管理系统

RuoYi-Vue是前后端分离的后台管理系统若依是一套全部开源的快速开发平台,毫无保留给个人及企业免费使用。是一个 Java EE 企业级快速开发平台,基于经典技术组合(Spring Boot、Spring Security、MyBatis、Jwt、Vue),内置模块如:部门管理、角色用户、菜单及按钮授权、数据权限、系统参数、日志管理、通知公告、代码生成等。在线定时任务配置,支持集群,支持多数据源,支持分布式事务等。

一直在努力学习的菜鸟 216

Android 13 内置xapk安装包的方法

安装xapk 内置xapk

安卓兼职framework和app工程师的博客 232

服务器取证——服务器基础知识

服务器基础知识

记录并分享学习安全的知识点.. 2491

靓车汽车销售网站设计与实现:SpringBoot 汽车销售 203 个接口,附论文与运行截图

# 靓车汽车销售网站设计与实现:SpringBoot 汽车销售 203 个接口,附论文与运行截图 ## 目录 - [一、你是不是也这样](#一你是不是也这样) - [二、这套是什么](#二这套是什么) - [三、对你具体有什么用](#三对你具体有什么用) - [四、怎么跑起来](#四怎么跑起来) - [五、里面有什么](#五里面有什么) --- ## 一、你是不是也这样 选题报到「销售网

面朝大海 354

【ComfyUI】QwenImageEdit OOTD角色与姿态匹配换装

本文介绍了一个基于Qwen Edit OOTD 2.0的ComfyUI工作流,能够实现角色与姿态匹配的智能穿搭生成。该工作流通过整合模型推理、姿态识别、图像拼接和渲染等节点,完成从角色图、姿态图到成品穿搭图的完整生成流程。核心采用Qwen Image系列模型进行图像理解和编辑,配合ControlNet进行姿态引导。用户只需提供角色图和姿态参考图,系统即可自动完成姿态解析、语义编码、采样生成等步骤,输出与输入姿态一致的穿搭图像。该方案适用于虚拟角色展示、电商试穿等场景,能保持角色特征一致的同时灵活变换姿态,显

Mr数据杨 1616

副队长 Vue3 教程(19)--组件 props 父传子

本文讲解Vue组件通信中的props机制,实现父组件向子组件传递数据。通过defineProps对象写法进行类型校验、必填判断与默认值设置,推荐用于正式项目。重点强调单向数据流原则:子组件不可直接修改props,避免数据污染。结合待办清单案例,演示如何循环渲染多条待办项,并指出常见错误如直接修改props、默认值未用函数返回等。最后提示后续学习defineEmits实现子传父。

编程副队长 316

Statistics and Machine Learning Toolbox

Statistics and Machine Learning Toolbox(带书签),MATLAB统计学习工具

visio安装包

Microsoft Office Visio 是一款专业的制图软件。利用经过更新的形状、协作工具和数据链接图表,创建专业级图表以简化复杂的信息。

javascript 基础 es6:4、Symbol,Symbol创建对象属性,Symbol内置属性,迭代器,迭代器自定义遍历对象

本文介绍了ES6中Symbol的创建与特性,包括Symbol()和Symbol.for()的区别,Symbol作为唯一属性名解决命名冲突;通过[Symbol()]方式安全添加对象属性;利用内置Symbol属性(如Symbol.isConcatSpreadable)自定义行为;最后讲解迭代器机制,通过Symbol.iterator实现自定义遍历逻辑,支持for...of循环。

狮子座的男孩 190

霍尼韦尔SoftMaster使用说明

霍尼韦尔SoftMaster使用说明

Vue 自定义事件

Vue中自定义事件通过“发布-订阅”模式实现子组件向父组件通信。父组件用@event监听,子组件用defineEmits触发事件并传递参数。支持动态事件名、.once修饰符及编程式绑定。推荐在Vue3中使用<script setup>与defineEmits,简洁高效。示例中子组件点击触发greet事件,父组件接收消息并更新状态,实现双向数据流动。

cccloveforever的博客 428

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

网页打印控件选型:LODOP 与 vue-print-designer 成本对比

不比功能清单,比授权方式、部署改动量和信创适配成本。本文结合具体场景讲清做法、常见问题与可复用的实现思路。

一天拉了7遍的博客 161

副队长 Vue3 教程(16)--Vue3项目样式管理方案

本文详解Vue组件中的样式作用域问题,重点介绍scoped实现局部样式隔离的原理与使用,避免样式污染。同时讲解全局样式、外部CSS引入及Sass预处理器的配置与应用。强调Sass为可选增强工具,原生CSS已足够开发,建议优先使用scoped提升代码可维护性。

编程副队长 397

用 Vue 3 和 Spring Boot 构建煤矿三屏驾驶舱

该调度室驾驶舱系统以Vue3与Vite构建,通过单一入口集成人员安全、生产监测与用电监测三类视图,实现数据统一展示。各视图共用导航与状态栏,支持通过URL切换并保留全屏与历史记录。人员安全页基于HTTP首屏与SSE推送实时更新井下人数、告警与定位;生产页区分班次与时段完成率,动态展示产量趋势;用电页联动拓扑图与负荷曲线,精准呈现回路负载与电量。采用版本号防覆盖机制保障数据一致性,布局使用CSS Grid优化空间分配,确保关键信息清晰可读。系统已通过多分辨率验证,后续将对接真实数据源,实现全场景应用。

王元帅的博客 294

GitHub 今日仓库推荐 #004:stitch-skills 如何让 Vue 页面改版不丢业务逻辑?

让 AI 给一个后台页面“换个高级设计”,看起来是个美术任务,其实首先是个工程任务。页面改漂亮之后,原来的搜索、分页、权限提示、加载失败重试是否还在?如果第二个页面生成出来又换了一套颜色和卡片圆角,怎么保持整个系统一致?今天推荐的 stitch-skills 提供了一个值得研究的思路:不要把设计和工程之间的交接压缩成一句“照着这张图写代码”,而是先提取原有设计约束,再构建可迭代的界面设计,并将生成结果交给现有项目的组件体系实现。

在北京 311

电商订单系统中CSS响应式布局与动画的反模式集锦

在现代Web开发中,电商订单系统作为最常见且最复杂的业务场景之一,对前端技术的依赖度极高。随着移动端访问比例持续上升,CSS响应式布局和动画效果成为不可或缺的技能。然而,在学习和实践中,很多初学者和零基础开发者常因概念模糊或错误实现而导致功能异常或体验不佳。本文将围绕这一具体业务场景,深入剖析过程中常遇到的“反模式”案例。针对这些常见错误进行分析并给出修正方案,帮助读者避免踩坑、提升代码质量和用户体验。

后台模板 186

雪花 ID 七个假设逐个验证:无锁测不出重号,JS 精度差 512

单线程 134.1-167.9 万 ids/s 零重号,但无锁的"零重号"是假安全感:放大竞争窗口后 4 线程 8000 个号重号 5719(71.5%),序列号只出现 138 种。8 线程加锁慢 4.1 倍。1970 纪年的 ID 是 2^53 的 834.6 倍,转 double 后 99.8% 变值、最大偏差 512;2026 纪年仍有 93.7% 变值、只够用 24.86 天。

CCbleach的专栏 262

副队长Vue3教程(24)--Vue父子组件通信方案汇总对比

本文系统梳理了Vue中父子组件通信的三种方式:props(父→子数据传递)、defineEmits(子→父事件通知)、defineExpose(父主动调用子组件方法)。通过对比表与场景化选型,强调优先使用props和emit,仅在需触发一次性动作且不便用状态控制时考虑defineExpose。重点提醒避免滥用defineExpose,坚守单向数据流原则,提升组件解耦性与可维护性。

编程副队长 545

GitHub 日榜趋势速报 | 2026-11-27

GitHub 日榜 2026-11-27:orca、VIctory-Belobug-AMD、portwatch-vi 等 20 个开源项目 24 小时 Star 增速领先,每日更新的开源趋势速报。

wfly blog 104

自动化运维-03Jenkins 构建环境排查

mvn help:effective-settings mvn -X clean package

weixin_52568278的博客 228

Python 爬虫扩展篇(一):APP 抓包与 JS 逆向入门——从看见流量到读懂签名

APP 抓包(mitmproxy / Charles 配置与 Android 7+ 证书策略)、SSL Pinning 的识别与合法测试环境下的处理思路、JS 逆向定位签名参数的四种核心方法、Python 本地复现。

810cheng 462
上一篇: 开张大吉
下一篇: 基于Ajax的MVC,I name it RoyalAjax (一)
jarez
博客等级 码龄21年 8粉丝 35原创
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址