ASP.NET MVC 3: Layouts with Razor

 

ASP.NET MVC 3 ships with a new view-engine option called “Razor” (in addition to continuing to support/enhance the existing .aspx view engine).

You can learn more about Razor, why we are introducing it, and the syntax it supports from my Introducing Razor blog post. If you haven’t read that post yet, take a few minutes and read it now (since the rest of this post will assume you have read it). Once you’ve read the Introducing Razor post, also read my ASP.NET MVC 3 Preview post and look over the ASP.NET MVC 3 Razor sample I included in it.

What are Layouts?

You typically want to maintain a consistent look and feel across all of the pages within your web-site/application. ASP.NET 2.0 introduced the concept of “master pages” which helps enable this when using .aspx based pages or templates. Razor also supports this concept with a feature called “layouts” – which allow you to define a common site template, and then inherit its look and feel across all the views/pages on your site.

Using Layouts with Razor

In my last blog post I walked through a simple example of how to implement a /Products URL that renders a list of product categories:

ASP.NET MVC 3: Layouts with Razor_第1张图片

Below is a simple ProductsController implementation that implements the /Products URL above. It retrieves a list of product categories from a database, and then passes them off to a view file to render an appropriate HTML response back to the browser:

ASP.NET MVC 3: Layouts with Razor_第2张图片

Here is what the Index.cshtml view file (implemented using Razor) looks like:

ASP.NET MVC 3: Layouts with Razor_第3张图片

The above view file does not yet use a layout page – which means that as we add additional URLs and pages to the site we’ll end up duplicating our core site layout in multiple places. Using a layout will allow us to avoid this duplication and make it much easier to manage our site design going forward. Let’s update our sample to use one now.

Refactoring to use a Layout

Razor makes it really easy to start from an existing page and refactor it to use a layout. Let’s do that with our simple sample above. Our first step will be to add a “SiteLayout.cshtml” file to our project under the \Views\Shared folder of our project (which is the default place where common view files/templates go):

ASP.NET MVC 3: Layouts with Razor_第4张图片

SiteLayout.cshtml

We’ll use the SiteLayout.cshtml file to define the common content of our site. Below is an example of what it might look like:

ASP.NET MVC 3: Layouts with Razor_第5张图片

A couple of things to note with the above file:

  • It is no longer necessary (as of the ASP.NET MVC 3 Beta) to have an @inherits directive at the top of the file. You can optionally still have one if you want (for example: if you want a custom base class), but it isn’t required. This helps keep the file nice and clean. It also makes it easier to have designers and non-developers work on the file and not get confused about concepts they don’t understand.
  • We are calling the @RenderBody() method within the layout file above to indicate where we want the views based on this layout to “fill in” their core content at that location in the HTML.
  • We are outputting the “View.Title” property within the element of our <head> section. I’ll discuss how this is used in a bit. </li> </ul> <p>And now we have a common layout template that we can use to maintain a consistent look and feel across any number of pages on our site.</p> <p><u>Index.cshtml</u></p> <p>Let’s now update our Index.cshtml view to be based on the SiteLayout.cshtml file we just created. Below is an first-cut of what it might look like:</p> <p><a href="http://img.e-com-net.com/image/info8/58c46a7a70bd457d9cf9d293af0953d8.png" target="_blank"><img title="image" alt="ASP.NET MVC 3: Layouts with Razor_第6张图片" src="http://img.e-com-net.com/image/info8/58c46a7a70bd457d9cf9d293af0953d8.png" width="474" height="310" style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;;border:1px solid black;"></a> </p> <p>A couple of things to note about the above file:</p> <ul> <li> <p>We did not need to wrap our main body content within a tag or element – by default Razor will automatically treat the content of Index.cshtml as the “body” section of the layout page. We <em>can</em> optionally define “named sections” if our layout has multiple replaceable regions. But Razor makes the 90% case (where you only have a body section) super clean and simple.</p> </li> </ul> <ul> <li> <p>We are programmatically setting the View.Title value within our Index.cshtml page above. The code within our Index.cshtml file will run <em>before</em> the SiteLayout.cshtml code runs – and so we can write view code that programmatically sets values we want to pass to our layout to render. This is particularly useful for things like setting the page’s title, as well as <meta> elements within the <head> for search engine optimization (SEO).</p> </li> </ul> <ul> <li> <p>At the moment, we are programmatically setting the Layout template to use within our Index.cshtml page. We can do this by setting the Layout property on the View (note: in the first preview this property was called “LayoutPage” – we changed it to just be “Layout” with the ASP.NET MVC 3 Beta). I’ll discuss some alternative ways (new with the ASP.NET MVC 3 Beta) that we can set this property shortly.</p> </li> </ul> <p>And now when we request the /Products URL within our site, we’ll get the following HTML returned:</p> <p><a href="http://img.e-com-net.com/image/info8/33892388621945c99d16337a38b4a977.png" target="_blank"><img title="image" alt="ASP.NET MVC 3: Layouts with Razor_第7张图片" src="http://img.e-com-net.com/image/info8/33892388621945c99d16337a38b4a977.png" width="525" height="569" style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;;border:1px solid black;"></a> </p> <p>Notice above how the returned HTML content is a merge of the SiteLayout.cshtmk and Index.cshtml. The “Product Categories” title at the top is set correctly based on the view, and our dynamic list of categories is populated in the correct place.</p> <h3><u>DRYing things up with _ViewStart</u></h3> <p>Currently we are programmatically setting the layout file to use at the top of our Index.cshtml file. This is fine for cases where we have some view-specific logic where the layout file will vary depending on the specific view. But setting it this way can end up being redundant and duplicative for most web applications – where either all of the views use the same layout, or if they have different layouts (for example: for mobile devices or localized sites) the logic for which layout to pick is common across all of the views.</p> <p>The good news is that Razor (starting with the ASP.NET MVC 3 Beta release) includes a new feature that enables us to remove the need to explicitly set the Layout in each view – and instead allows us to define the layout logic once for all views in the site – making our view files even cleaner and more maintainable (and ensuring we keep to the DRY principle: Don’t Repeat Yourself):</p> <p><a href="http://img.e-com-net.com/image/info8/1680372ba75a4a17b5bc15405217c93d.png" target="_blank"><img title="image" alt="ASP.NET MVC 3: Layouts with Razor_第8张图片" src="http://img.e-com-net.com/image/info8/1680372ba75a4a17b5bc15405217c93d.png" width="553" height="300" style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;;border:1px solid black;"></a> </p> <p>Starting with the ASP.NET MVC 3 Beta release, you can now add a file called _ViewStart.cshtml (or _ViewStart.vbhtml for VB) underneath the \Views folder of your project:</p> <p><a href="http://img.e-com-net.com/image/info8/2dcbc8496ae74355bc2756e10dd10b27.png" target="_blank"><img title="image" alt="ASP.NET MVC 3: Layouts with Razor_第9张图片" src="http://img.e-com-net.com/image/info8/2dcbc8496ae74355bc2756e10dd10b27.png" width="226" height="357" style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;;border:1px solid black;"></a> </p> <p>The _ViewStart file can be used to define common view code that you want to execute at the start of each View’s rendering. For example, we could write code like below within our _ViewStart.cshtml file to programmatically set the Layout property for each View to be the SiteLayout.cshtml file by default:</p> <p><a href="http://img.e-com-net.com/image/info8/61e315f8192d44b1bfb72ce62e414a90.png" target="_blank"><img title="image" alt="ASP.NET MVC 3: Layouts with Razor_第10张图片" src="http://img.e-com-net.com/image/info8/61e315f8192d44b1bfb72ce62e414a90.png" width="560" height="121" style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;;border:1px solid black;"></a> </p> <p>Because this code executes at the start of each View, we no longer need to explicitly set the Layout in any of our individual view files (except if we wanted to override the default value above).</p> <p><strong>Important</strong>: Because the _ViewStart.cshtml allows us to write code, we can optionally make our Layout selection logic richer than just a basic property set. For example: we could vary the Layout template that we use depending on what type of device is accessing the site – and have a phone or tablet optimized layout for those devices, and a desktop optimized layout for PCs/Laptops. Or if we were building a CMS system or common shared app that is used across multiple customers we could select different layouts to use depending on the customer (or their role) when accessing the site.</p> <p>This enables a lot of UI flexibility. It also allows you to more easily write view logic once, and avoid repeating it in multiple places.</p> <blockquote> <p><em>Note: You can also specify layouts within a Controller or an Action Filter. So if you prefer to keep the layout selection logic there you can do that as well.</em></p> </blockquote> <h3><u>Finished Sample</u></h3> <p>Below is a screen-shot of the simple application we have been building:</p> <p><a href="http://img.e-com-net.com/image/info8/53744ae6b6874db68787caabe87f9f55.jpg" target="_blank"><img title="image" alt="ASP.NET MVC 3: Layouts with Razor_第11张图片" src="http://img.e-com-net.com/image/info8/53744ae6b6874db68787caabe87f9f55.jpg" width="556" height="354" style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;;border:1px solid black;"></a> </p> <p>Here is the ProductsControllers that implements the /Products URL and retrieves the categories from a database and passes them to a view template to render:</p> <p><a href="http://img.e-com-net.com/image/info8/21cbaec449ba44ba95aad73b9fae3628.png" target="_blank"><img title="image_thumb_579C4852[1]" alt="ASP.NET MVC 3: Layouts with Razor_第12张图片" src="http://img.e-com-net.com/image/info8/21cbaec449ba44ba95aad73b9fae3628.png" width="449" height="263" style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;;border:1px solid black;"></a> </p> <p>Here is the Index.cshtml view that we are using the render the /Products response:</p> <p><a href="http://img.e-com-net.com/image/info8/aad6fff21daa42958a99b2153b4e9f68.png" target="_blank"><img title="image" alt="ASP.NET MVC 3: Layouts with Razor_第13张图片" src="http://img.e-com-net.com/image/info8/aad6fff21daa42958a99b2153b4e9f68.png" width="560" height="289" style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;;border:1px solid black;"></a> </p> <p>Here is the SiteLayout.cshtml layout file we are using to implement a consistent look and feel across our site:</p> <p><a href="http://img.e-com-net.com/image/info8/2fde4063af90415ba9e35076e9658676.png" target="_blank"><img title="image" alt="ASP.NET MVC 3: Layouts with Razor_第14张图片" src="http://img.e-com-net.com/image/info8/2fde4063af90415ba9e35076e9658676.png" width="579" height="395" style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;;border:1px solid black;"></a> </p> <p>Here is the _ViewStart.cshtml file that we are using to specify that all views in our site by default use the SiteLayout.cshtml file:</p> <p><a href="http://img.e-com-net.com/image/info8/61e315f8192d44b1bfb72ce62e414a90.png" target="_blank"><img title="image" alt="ASP.NET MVC 3: Layouts with Razor_第15张图片" src="http://img.e-com-net.com/image/info8/61e315f8192d44b1bfb72ce62e414a90.png" width="560" height="121" style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;;border:1px solid black;"></a> </p> <p>And here is the generated HTML from the /Products URL:</p> <p><a href="http://img.e-com-net.com/image/info8/33892388621945c99d16337a38b4a977.png" target="_blank"><img title="image" alt="ASP.NET MVC 3: Layouts with Razor_第16张图片" src="http://img.e-com-net.com/image/info8/33892388621945c99d16337a38b4a977.png" width="525" height="569" style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;;border:1px solid black;"></a> </p> <p>And because we now have a common layout file for our site, we can build out more functionality, controllers and views within our application - and have a site UI experience that is both consistent and very easy to maintain.</p> <h3><u>More Advanced Stuff</u></h3> <p>Two common questions people often ask are:</p> <p>1) Can I have nested layout files?</p> <p>2) Can I have multiple, non-contiguous, replaceable regions within a layout file – so that I can “fill in” multiple different sections within my view files.</p> <p>The answer to both of these questions is YES! I’ll blog some samples of how to do this in the future.</p> <h3><u>Summary</u></h3> <p>As I’ve mentioned before, one of the themes we’ve focused on with the ASP.NET MVC 3 and Razor releases has been to make the code you write cleaner and more concise. We think the new layout functionality coming with this release contributes nicely towards making view files even easier to read and write. I’ll be covering other nice improvements like this that are new to the ASP.NET MVC 3 Beta in future posts.</p> </div> </div> </div> </div> </div> <!--PC和WAP自适应版--> <div id="SOHUCS" sid="1276313864832565248"></div> <script type="text/javascript" src="/views/front/js/chanyan.js"></script> <!-- 文章页-底部 动态广告位 --> <div class="youdao-fixed-ad" id="detail_ad_bottom"></div> </div> <div class="col-md-3"> <div class="row" id="ad"> <!-- 文章页-右侧1 动态广告位 --> <div id="right-1" class="col-lg-12 col-md-12 col-sm-4 col-xs-4 ad"> <div class="youdao-fixed-ad" id="detail_ad_1"> </div> </div> <!-- 文章页-右侧2 动态广告位 --> <div id="right-2" class="col-lg-12 col-md-12 col-sm-4 col-xs-4 ad"> <div class="youdao-fixed-ad" id="detail_ad_2"></div> </div> <!-- 文章页-右侧3 动态广告位 --> <div id="right-3" class="col-lg-12 col-md-12 col-sm-4 col-xs-4 ad"> <div class="youdao-fixed-ad" id="detail_ad_3"></div> </div> </div> </div> </div> </div> </div> <div class="container"> <h4 class="pt20 mb15 mt0 border-top">你可能感兴趣的:(asp.net,mvc,Razor,razor,asp.net,mvc,layout,file,optimization)</h4> <div id="paradigm-article-related"> <div class="recommend-post mb30"> <ul class="widget-links"> <li><a href="/article/1950230804957294592.htm" title="SpringMVC执行流程(原理),通俗易懂" target="_blank">SpringMVC执行流程(原理),通俗易懂</a> <span class="text-muted">国服冰</span> <a class="tag" taget="_blank" href="/search/SpringMVC/1.htm">SpringMVC</a><a class="tag" taget="_blank" href="/search/spring/1.htm">spring</a><a class="tag" taget="_blank" href="/search/mvc/1.htm">mvc</a> <div>SpringMVC执行流程(原理),通俗易懂一、图解SpringMVC流程二、进一步理解Springmvc的执行流程1、导入依赖2、建立展示的视图3、web.xml4、spring配置文件springmvc-servlet5、Controller6、tomcat配置7、访问的url8、视图页面一、图解SpringMVC流程图为SpringMVC的一个较完整的流程图,实线表示SpringMVC框架提</div> </li> <li><a href="/article/1950228031524106240.htm" title="Spring进阶 - SpringMVC实现原理之DispatcherServlet处理请求的过程" target="_blank">Spring进阶 - SpringMVC实现原理之DispatcherServlet处理请求的过程</a> <span class="text-muted">倾听铃的声</span> <a class="tag" taget="_blank" href="/search/%E5%90%8E%E7%AB%AF/1.htm">后端</a><a class="tag" taget="_blank" href="/search/spring/1.htm">spring</a><a class="tag" taget="_blank" href="/search/java/1.htm">java</a><a class="tag" taget="_blank" href="/search/mvc/1.htm">mvc</a><a class="tag" taget="_blank" href="/search/%E5%BC%80%E5%8F%91%E8%AF%AD%E8%A8%80/1.htm">开发语言</a><a class="tag" taget="_blank" href="/search/%E5%88%86%E5%B8%83%E5%BC%8F/1.htm">分布式</a> <div>前文我们有了IOC的源码基础以及SpringMVC的基础,我们便可以进一步深入理解SpringMVC主要实现原理,包含DispatcherServlet的初始化过程和DispatcherServlet处理请求的过程的源码解析。本文是第二篇:DispatcherServlet处理请求的过程的源码解析。@pdaiSpring进阶-SpringMVC实现原理之DispatcherServlet处理请求的</div> </li> <li><a href="/article/1950226643771518976.htm" title="关于流媒体播放器EasyPlayer和EasyPlayerPro的介绍以及其区别" target="_blank">关于流媒体播放器EasyPlayer和EasyPlayerPro的介绍以及其区别</a> <span class="text-muted">EasyDarwin</span> <a class="tag" taget="_blank" href="/search/EasyDarwin/1.htm">EasyDarwin</a><a class="tag" taget="_blank" href="/search/%E9%9F%B3%E8%A7%86%E9%A2%91/1.htm">音视频</a><a class="tag" taget="_blank" href="/search/ffmpeg/1.htm">ffmpeg</a><a class="tag" taget="_blank" href="/search/%E4%BA%BA%E5%B7%A5%E6%99%BA%E8%83%BD/1.htm">人工智能</a><a class="tag" taget="_blank" href="/search/%E5%A4%A7%E6%95%B0%E6%8D%AE/1.htm">大数据</a><a class="tag" taget="_blank" href="/search/ar/1.htm">ar</a> <div>EasyPlayer是一款流媒体播放器系列项目,它支持多种流媒体协议的播放,包括但不限于RTSP、RTMP、HTTP、HLS、UDP、RTP、File等。除此之外,EasyPlayer还支持本地文件播放和多种功能特性,包括本地抓拍、本地录像、播放旋转、多屏播放、倍数播放等。EasyPlayer核心基于ffmpeg,稳定、高效、可靠、可控。随着多年的不断发展和迭代,EasyPlayer基于成功的实践</div> </li> <li><a href="/article/1950225381961297920.htm" title="SpringMVC的执行流程" target="_blank">SpringMVC的执行流程</a> <span class="text-muted"></span> <div>1、什么是MVCMVC是一种设计模式。MVC的原理图如下所示M-Model模型(完成业务逻辑:有javaBean构成,service+dao+entity)V-View视图(做界面的展示jsp,html……)C-Controller控制器(接收请求—>调用模型—>根据结果派发页面2、SpringMVC是什么SpringMVC是一个MVC的开源框架,SpringMVC=Struts2+Spring,</div> </li> <li><a href="/article/1950208107430866944.htm" title="python笔记14介绍几个魔法方法" target="_blank">python笔记14介绍几个魔法方法</a> <span class="text-muted">抢公主的大魔王</span> <a class="tag" taget="_blank" href="/search/python/1.htm">python</a><a class="tag" taget="_blank" href="/search/python/1.htm">python</a> <div>python笔记14介绍几个魔法方法先声明一下各位大佬,这是我的笔记。如有错误,恳请指正。另外,感谢您的观看,谢谢啦!(1).__doc__输出对应的函数,类的说明文档print(print.__doc__)print(value,...,sep='',end='\n',file=sys.stdout,flush=False)Printsthevaluestoastream,ortosys.std</div> </li> <li><a href="/article/1950202684451647488.htm" title="[spring6: Mvc-网关]-源码解析" target="_blank">[spring6: Mvc-网关]-源码解析</a> <span class="text-muted"></span> <div>推荐阅读:[spring6:Mvc-函数式编程]-源码解析GatewayServerMvcAutoConfiguration@AutoConfiguration(after={HttpClientAutoConfiguration.class,RestTemplateAutoConfiguration.class,RestClientAutoConfiguration.class,FilterAu</div> </li> <li><a href="/article/1950202054219722752.htm" title="Pandas:数据科学的超级瑞士军刀" target="_blank">Pandas:数据科学的超级瑞士军刀</a> <span class="text-muted">科技林总</span> <a class="tag" taget="_blank" href="/search/DeepSeek%E5%AD%A6AI/1.htm">DeepSeek学AI</a><a class="tag" taget="_blank" href="/search/%E4%BA%BA%E5%B7%A5%E6%99%BA%E8%83%BD/1.htm">人工智能</a> <div>**——从零基础到高效分析的进化指南**###**一、Pandas诞生:数据革命的救世主****2010年前的数据分析噩梦**:```python#传统Python处理表格数据data=[]forrowincsv_file:ifrow[3]>100androw[2]=="China":data.append(float(row[5])#代码冗长易错!```**核心痛点**:-Excel处理百万行崩</div> </li> <li><a href="/article/1950195876991397888.htm" title="【Jupyter】个人开发常见命令" target="_blank">【Jupyter】个人开发常见命令</a> <span class="text-muted">TIM老师</span> <a class="tag" taget="_blank" href="/search/%23/1.htm">#</a><a class="tag" taget="_blank" href="/search/Pycharm/1.htm">Pycharm</a><a class="tag" taget="_blank" href="/search/%26amp%3B/1.htm">&</a><a class="tag" taget="_blank" href="/search/VSCode/1.htm">VSCode</a><a class="tag" taget="_blank" href="/search/python/1.htm">python</a><a class="tag" taget="_blank" href="/search/Jupyter/1.htm">Jupyter</a> <div>1.查看python版本importsysprint(sys.version)2.ipynb/py文件转换jupyternbconvert--topythonmy_file.ipynbipynb转换为mdjupyternbconvert--tomdmy_file.ipynbipynb转为htmljupyternbconvert--tohtmlmy_file.ipynbipython转换为pdfju</div> </li> <li><a href="/article/1950164102068367360.htm" title="Makefile if语句用法" target="_blank">Makefile if语句用法</a> <span class="text-muted">java叶新东老师</span> <a class="tag" taget="_blank" href="/search/c%2B%2B/1.htm">c++</a><a class="tag" taget="_blank" href="/search/makefile/1.htm">makefile</a> <div>文章目录语法1.BasicExpressions:2.LogicOperators:3.ExistenceChecks4.FileOperations5.Comparisons示例1、判断两个字符串是否相等2、判断文件路径是否目录完语法CMake中的if命令用于有条件地执行一组命令,其格式如下:if()elseif()#optionalblock,canberepeatedelse()#optio</div> </li> <li><a href="/article/1950121744408834048.htm" title="蚂蚁在觅食过程中通过释放信息素来引导同伴的行为,这种自然现象确实为蚂蚁算法(Ant Colony Optimization, ACO)的设计提供了灵感" target="_blank">蚂蚁在觅食过程中通过释放信息素来引导同伴的行为,这种自然现象确实为蚂蚁算法(Ant Colony Optimization, ACO)的设计提供了灵感</a> <span class="text-muted">Bol5261</span> <a class="tag" taget="_blank" href="/search/engineering%29/1.htm">engineering)</a><a class="tag" taget="_blank" href="/search/ACO%28Ant/1.htm">ACO(Ant</a><a class="tag" taget="_blank" href="/search/Colony/1.htm">Colony</a><a class="tag" taget="_blank" href="/search/Optimization%29/1.htm">Optimization)</a><a class="tag" taget="_blank" href="/search/Data%28Structures/1.htm">Data(Structures</a><a class="tag" taget="_blank" href="/search/Algorithms%29/1.htm">Algorithms)</a><a class="tag" taget="_blank" href="/search/%E7%AE%97%E6%B3%95/1.htm">算法</a> <div>蚂蚁在觅食过程中通过释放信息素来引导同伴的行为,这种自然现象确实为蚂蚁算法(AntColonyOptimization,ACO)的设计提供了灵感。以下是关于蚂蚁算法的一些详细解释:蚂蚁算法的基本原理模拟蚂蚁的行为:每只蚂蚁在路径上移动时,会根据路径上的信息素浓度来选择下一步的移动方向。信息素浓度越高,选择该路径的概率越大。蚂蚁在找到食物后返回蚁巢时,会在路径上释放信息素,增强该路径的信息素浓度。随</div> </li> <li><a href="/article/1950121240370933760.htm" title="群晖 File Station:集中浏览与管理 NAS 文件的工具" target="_blank">群晖 File Station:集中浏览与管理 NAS 文件的工具</a> <span class="text-muted">Trihawk宇麦科技</span> <a class="tag" taget="_blank" href="/search/%E7%BE%A4%E6%99%96NAS/1.htm">群晖NAS</a> <div>FileStation是SynologyDSM(DiskStationManager)操作系统中的核心内建应用,以网页形式提供友好的图形界面,供用户在浏览器中管理NAS上的文件和共享资料核心功能特色1.文件浏览与管理Navigate文件夹、执行拖放上传、剪贴、重命名、移动、删除等常用操作,类似WindowsExplorer或macOSFinder的使用体验,直观且便捷支持批量操作、压缩与解压、多文</div> </li> <li><a href="/article/1950117078799282176.htm" title="Redis反弹Shell" target="_blank">Redis反弹Shell</a> <span class="text-muted">波吉爱睡觉</span> <a class="tag" taget="_blank" href="/search/web%E5%AE%89%E5%85%A8/1.htm">web安全</a><a class="tag" taget="_blank" href="/search/%23%E6%9C%AA%E6%8E%88%E6%9D%83%E8%AE%BF%E9%97%AE%E6%BC%8F%E6%B4%9E/1.htm">#未授权访问漏洞</a><a class="tag" taget="_blank" href="/search/%23SSRF/1.htm">#SSRF</a><a class="tag" taget="_blank" href="/search/redis/1.htm">redis</a><a class="tag" taget="_blank" href="/search/%E7%BD%91%E7%BB%9C%E5%AE%89%E5%85%A8/1.htm">网络安全</a><a class="tag" taget="_blank" href="/search/web%E5%AE%89%E5%85%A8/1.htm">web安全</a> <div>这里我来总结几种Redis反弹Shell的方法一、利用Redis写WebShell前提条件开了web服务器,并且知道路径,还需要有文件读写增删改查的权限条件比较苛刻,但是满足条件上传就会简单一点,我们直接将文件写入www目录下,完了使用工具连接即可。语句:redis:6379>configsetdir/var/www/html/redis:6379>configsetdbfilenameshell</div> </li> <li><a href="/article/1950110624126136320.htm" title="pod 命令" target="_blank">pod 命令</a> <span class="text-muted">你飞跃俊杰</span> <div>创建默认的Podfile$podinit第一次使用安装框架$podinstall安装框架,不更新本地索引,速度快,但是不会升级本地代码库$podinstall--no-repo-update今后升级、添加、删除框架$podupdate更新框架,不更新本地索引,速度快可以安装新框架或者删除不用的框架,但是不会升级项目已经安装的框架$podupdate--no-repo-update查看哪些框架有更新</div> </li> <li><a href="/article/1950102202521546752.htm" title="基本服务 FTP & SMB" target="_blank">基本服务 FTP & SMB</a> <span class="text-muted">会飞的灰大狼</span> <a class="tag" taget="_blank" href="/search/Centos7/1.htm">Centos7</a><a class="tag" taget="_blank" href="/search/linux/1.htm">linux</a> <div>基本服务FTP&SMB前言:FTP简称为文件传输协议前面说的他可以做到备份的功能那么它可以做到文件传输的过程smb我们简单来说共享文件夹‍NFSNFS(NetworkFileSystem,网络文件系统)是一种分布式文件系统协议,允许不同计算机之间通过网络共享文件和目录,使远程文件系统像本地文件系统一样被访问。它最初由SunMicrosystems开发,现在已成为UNIX/Linux系统中常用的网络</div> </li> <li><a href="/article/1950096152460324864.htm" title="使用OpenCV对视频进行处理:视频读取、视频显示和视频保存,视频追踪等" target="_blank">使用OpenCV对视频进行处理:视频读取、视频显示和视频保存,视频追踪等</a> <span class="text-muted">无规则ai</span> <a class="tag" taget="_blank" href="/search/OpenCV/1.htm">OpenCV</a><a class="tag" taget="_blank" href="/search/opencv/1.htm">opencv</a><a class="tag" taget="_blank" href="/search/%E4%BA%BA%E5%B7%A5%E6%99%BA%E8%83%BD/1.htm">人工智能</a><a class="tag" taget="_blank" href="/search/%E8%AE%A1%E7%AE%97%E6%9C%BA%E8%A7%86%E8%A7%89/1.htm">计算机视觉</a><a class="tag" taget="_blank" href="/search/python/1.htm">python</a> <div>一.视频的读写1.从文件中读取视频并播放(1)创建读取视频的对象cap=cv2.VideoCapture(filepath)filepath:视频文件的路径(2)视频的属性信息a.获取视频的某些属性retval=cap.get(propId)propId:从0到18的数字,每个数字表示视频的属性常用的属性有属性名对应数值功能描述CAP_PROP_POS_MSEC0视频当前的播放位置,单位为毫秒。C</div> </li> <li><a href="/article/1950090479861297152.htm" title="Gradient-Adaptive Policy Optimization:Towards Multi-Objective Alignment of Large Language Models" target="_blank">Gradient-Adaptive Policy Optimization:Towards Multi-Objective Alignment of Large Language Models</a> <span class="text-muted">樱花的浪漫</span> <a class="tag" taget="_blank" href="/search/%E5%A4%A7%E6%A8%A1%E5%9E%8B%E4%B8%8E%E6%99%BA%E8%83%BD%E4%BD%93/1.htm">大模型与智能体</a><a class="tag" taget="_blank" href="/search/%E5%AF%B9%E6%8A%97%E7%94%9F%E6%88%90%E7%BD%91%E7%BB%9C%E4%B8%8E%E5%8A%A8%E4%BD%9C%E8%AF%86%E5%88%AB/1.htm">对抗生成网络与动作识别</a><a class="tag" taget="_blank" href="/search/%E5%BC%BA%E5%8C%96%E5%AD%A6%E4%B9%A0/1.htm">强化学习</a><a class="tag" taget="_blank" href="/search/%E8%AF%AD%E8%A8%80%E6%A8%A1%E5%9E%8B/1.htm">语言模型</a><a class="tag" taget="_blank" href="/search/%E4%BA%BA%E5%B7%A5%E6%99%BA%E8%83%BD/1.htm">人工智能</a><a class="tag" taget="_blank" href="/search/%E8%87%AA%E7%84%B6%E8%AF%AD%E8%A8%80%E5%A4%84%E7%90%86/1.htm">自然语言处理</a><a class="tag" taget="_blank" href="/search/%E6%B7%B1%E5%BA%A6%E5%AD%A6%E4%B9%A0/1.htm">深度学习</a><a class="tag" taget="_blank" href="/search/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/1.htm">机器学习</a> <div>2025.acl-long.549.pdfhttps://aclanthology.org/2025.acl-long.549.pdf1.概述大型语言模型(LLMs)(Anthropic,2023;OpenAI,2024)已经在广泛的实际应用中展示了显著的能力(Bubecketal.,2023),包括内容创作(Yuanetal.,2022)、编程辅助(Chenetal.,2021;Gaoetal.</div> </li> <li><a href="/article/1950078384721686528.htm" title="Could not extract GUID in text file UserSettings\Layouts\CurrentMaximizeLayout.dwlt at line 924." target="_blank">Could not extract GUID in text file UserSettings\Layouts\CurrentMaximizeLayout.dwlt at line 924.</a> <span class="text-muted">zhannghong2003</span> <a class="tag" taget="_blank" href="/search/Unity/1.htm">Unity</a><a class="tag" taget="_blank" href="/search/unity/1.htm">unity</a><a class="tag" taget="_blank" href="/search/%E6%B8%B8%E6%88%8F%E5%BC%95%E6%93%8E/1.htm">游戏引擎</a> <div>错误提示:无法在文本文件UserSettings\Layouts\CurrentMaximizeLayout.dwlt的第924行提取GUID。UnityEngine.GUIUtility:ProcessEvent(int,intptr,bool&)这个错误发生在Unity无法解析一个损坏或格式错误的布局文件(CurrentMaximizeLayout.dwlt)时。以下是解决方法:解决方案:关闭</div> </li> <li><a href="/article/1950057579757498368.htm" title="零基础入门uniapp Vue3组合式API版本" target="_blank">零基础入门uniapp Vue3组合式API版本</a> <span class="text-muted">鹤早早</span> <a class="tag" taget="_blank" href="/search/uni-app/1.htm">uni-app</a> <div>前言:小程序学习笔记,课程来源up主咸虾米_。仅记录笔记,大家想学习可以去关注他。1.已安装HBuiderX(目前是4.36版本),微信开发者工具(但还没注册小程序码),相关配置OK了。1.16相关架构学习1.pages-index-index.vuebox1box2.layout{border:1pxsolidred;.box1{border:1pxsolidgreen;}.box2{borde</div> </li> <li><a href="/article/1950050391693520896.htm" title="Moviepy怎样使用?" target="_blank">Moviepy怎样使用?</a> <span class="text-muted"></span> <div>MoviePy是一个用于视频编辑和视频脚本编写的Python库。以下是使用MoviePy的步骤:安装MoviePy:在命令行中运行pipinstallmoviepy来安装MoviePy库。导入MoviePy:在Python脚本中导入MoviePy库,通常使用importmoviepy.editorasmp。创建视频对象:使用mp.VideoFileClip('视频文件路径')来创建一个视频对象。视</div> </li> <li><a href="/article/1950045222088011776.htm" title="moviepy用法大全" target="_blank">moviepy用法大全</a> <span class="text-muted"></span> <div>1.引用frommoviepy.editorimport*2.载入2.1载入视频video=VideoFileClip(filePath)2.2载入音频audio=AudioFileClip(filePath)2.3载入图片img=(ImageClip(videopath+videofengpi)#水印持续时间.set_duration(start_video_clip_begin.duratio</div> </li> <li><a href="/article/1950043393522462720.htm" title="Error: C++14 standard requested but CXX14 is not defined" target="_blank">Error: C++14 standard requested but CXX14 is not defined</a> <span class="text-muted">闹钟又响了</span> <div>在R中安装包如果遇到上述问题,基本上去修改一下Makevars文件即可。可以用vim编辑,也可以在R中编辑,如下dotR<-file.path(Sys.getenv("HOME"),".R")if(!file.exists(dotR))dir.create(dotR)M<-file.path(dotR,"Makevars")if(!file.exists(M))file.create(M)cat(</div> </li> <li><a href="/article/1950036646590214144.htm" title="Python操作excel,工作效率提高篇_python对xlsx文档进行操作怎么提速" target="_blank">Python操作excel,工作效率提高篇_python对xlsx文档进行操作怎么提速</a> <span class="text-muted">2401_84266286</span> <a class="tag" taget="_blank" href="/search/%E7%A8%8B%E5%BA%8F%E5%91%98/1.htm">程序员</a><a class="tag" taget="_blank" href="/search/python/1.htm">python</a><a class="tag" taget="_blank" href="/search/excel/1.htm">excel</a><a class="tag" taget="_blank" href="/search/%E7%BD%91%E7%BB%9C/1.htm">网络</a> <div>上面的代码是对工作簿最基本的操作,新建工作簿和保存工作簿,还有关闭当前工作簿。importosfile_path='table'file_list=os.listdir(file_path)foriinfile_list:print(i)列出文件夹下所有文件和子文件夹的名称,这是方便总结和查看文件的。importxlwingsasxwapp=xw.App(visible=False,add_boo</div> </li> <li><a href="/article/1950032073859330048.htm" title="用 automake 来构建项目" target="_blank">用 automake 来构建项目</a> <span class="text-muted">守拙圆</span> <div>author:守拙圆一般而言,对于小项目通常自己来编写Makefile即可。但对于大型项目,手动编写维护大型项目,编写makefile将是一项费力费时的工作。1工具介绍gnu提供了一套autotools工具来辅助用户来生成makefile,完成编译工作。此工具集包括:autoscan:此命令能够对于一个软件包或目录创建或者维护一个configure.ac文件。aclocal:此命令将configu</div> </li> <li><a href="/article/1950030347316031488.htm" title="2x002 MacOS X里的Python环境变量设置" target="_blank">2x002 MacOS X里的Python环境变量设置</a> <span class="text-muted"></span> <div>2x002MacOSX里的Python环境变量设置MacOSX里的Python环境变量设置略说:SHELL类型环境变量配置文件添加环境变量系统环境变量/etc/paths系统环境变量/etc/profile和/etc/bashrc设置NODE_ENV环境变量。退出SHELL时失效查看当前所有环境变量MacOSX里的Python环境变量设置略说:当我们安装一个软件后,然后得以使用一些与该软件相关的命</div> </li> <li><a href="/article/1950007019847086080.htm" title="开源TTS" target="_blank">开源TTS</a> <span class="text-muted">vanloswang</span> <a class="tag" taget="_blank" href="/search/%E7%BB%BC%E5%90%88/1.htm">综合</a><a class="tag" taget="_blank" href="/search/TTS/1.htm">TTS</a> <div>Ekhohttp://sourceforge.net/projects/e-guidedog/files/Ekho/http://www.eguidedog.net/ekho.phpflitehttp://www.speech.cs.cmu.edu/flite/</div> </li> <li><a href="/article/1950005757441273856.htm" title="【WRF-Chem教程第六期】WRF-Chem KPP Coupler 简介" target="_blank">【WRF-Chem教程第六期】WRF-Chem KPP Coupler 简介</a> <span class="text-muted">WW、forever</span> <a class="tag" taget="_blank" href="/search/WRF/1.htm">WRF</a><a class="tag" taget="_blank" href="/search/WRF-Chem/1.htm">WRF-Chem</a> <div>WRF-ChemKPPCoupler简介6.1介绍(Introduction)6.2KPP编译所需的系统环境(KPPRequirements)6.3编译WKC(CompilingtheWKC)6.4使用WKC实现化学机制(ImplementingchemicalmechanismswithWKC)当前可用机制(基于WKC的KPP实现)6.5WKC的目录组织结构(LayoutofWKC)WKC所在目</div> </li> <li><a href="/article/1950001343095697408.htm" title="OpenCV读取视频帧卡死的BUG修复" target="_blank">OpenCV读取视频帧卡死的BUG修复</a> <span class="text-muted">henysugar</span> <a class="tag" taget="_blank" href="/search/opencv/1.htm">opencv</a><a class="tag" taget="_blank" href="/search/%E9%9F%B3%E8%A7%86%E9%A2%91/1.htm">音视频</a><a class="tag" taget="_blank" href="/search/bug/1.htm">bug</a> <div>OpenCV读取指定视频文件如果异常的时候,会卡死一直不退出,问题是卡在CvCapture_MSMF::grabVideoFrame函数内,跟了一下,发现有个判断有点问题,其下面的源码:while(!stopFlag)  {    for(;;)    {      CV_TRACE_REGION("ReadSample");      if(!SUCCEEDED(hr=videoFileSour</div> </li> <li><a href="/article/1949988730517385216.htm" title="go: go.mod file not found in current directory or any parent directory.如何解决?" target="_blank">go: go.mod file not found in current directory or any parent directory.如何解决?</a> <span class="text-muted"></span> <div>这个错误表明你正在执行goget命令,但是当前目录或任何父目录中都找不到go.mod文件。这可能是因为你的项目还没有使用GoModules进行管理。要解决这个问题,有几种方法:gomodinit其中是你的项目名称,这将创建一个新的go.mod文件。再次执行goget-ufyne.io/fyne/v2/cmd/fyne@v2.3.0正常。</div> </li> <li><a href="/article/1949987093027549184.htm" title="UE5 自动生成插件汇总:提升创作效率的得力助手" target="_blank">UE5 自动生成插件汇总:提升创作效率的得力助手</a> <span class="text-muted">阿贾克斯的黎明</span> <a class="tag" taget="_blank" href="/search/%E6%B8%B8%E6%88%8F%E5%BC%80%E5%8F%91/1.htm">游戏开发</a><a class="tag" taget="_blank" href="/search/ue5/1.htm">ue5</a> <div>目录UE5自动生成插件汇总:提升创作效率的得力助手目录一、地形生成插件1.Polycam2.M4电影级地形工具包3.WorldCreatortoUnrealEngine插件二、场景生成插件1.PrometheanAI2.physicallayout(物理布局)三、动画生成插件1.CasterAI2.blender骨骼绑定模型一键导入UE5场景插件MagicBoneUE5RigCreator四、特效</div> </li> <li><a href="/article/1949966789882474496.htm" title="Android布局文件中的xmlns:tools" target="_blank">Android布局文件中的xmlns:tools</a> <span class="text-muted">Huang兄</span> <a class="tag" taget="_blank" href="/search/android/1.htm">android</a><a class="tag" taget="_blank" href="/search/android/1.htm">android</a> <div>2018-01-04文章目录androidapptoolstools可以干什么ErrorhandlingattributesDesign-timeviewattributes(设计时试图属性)tools:insteadofandroidtools:contexttools:itemCounttools:layouttools:listitem/tools:listheader/tools:list</div> </li> <li><a href="/article/128.htm" title="scala的option和some" target="_blank">scala的option和some</a> <span class="text-muted">矮蛋蛋</span> <a class="tag" taget="_blank" href="/search/%E7%BC%96%E7%A8%8B/1.htm">编程</a><a class="tag" taget="_blank" href="/search/scala/1.htm">scala</a> <div>原文地址: http://blog.sina.com.cn/s/blog_68af3f090100qkt8.html 对于学习 Scala 的 Java™ 开发人员来说,对象是一个比较自然、简单的入口点。在 本系列 前几期文章中,我介绍了 Scala 中一些面向对象的编程方法,这些方法实际上与 Java 编程的区别不是很大。我还向您展示了 Scala 如何重新应用传统的面向对象概念,找到其缺点</div> </li> <li><a href="/article/255.htm" title="NullPointerException" target="_blank">NullPointerException</a> <span class="text-muted">Cb123456</span> <a class="tag" taget="_blank" href="/search/android/1.htm">android</a><a class="tag" taget="_blank" href="/search/BaseAdapter/1.htm">BaseAdapter</a> <div>    java.lang.NullPointerException: Attempt to invoke virtual method 'int android.view.View.getImportantForAccessibility()' on a null object reference     出现以上异常.然后就在baidu上</div> </li> <li><a href="/article/382.htm" title="PHP使用文件和目录" target="_blank">PHP使用文件和目录</a> <span class="text-muted">天子之骄</span> <a class="tag" taget="_blank" href="/search/php%E6%96%87%E4%BB%B6%E5%92%8C%E7%9B%AE%E5%BD%95/1.htm">php文件和目录</a><a class="tag" taget="_blank" href="/search/%E8%AF%BB%E5%8F%96%E5%92%8C%E5%86%99%E5%85%A5/1.htm">读取和写入</a><a class="tag" taget="_blank" href="/search/php%E9%AA%8C%E8%AF%81%E6%96%87%E4%BB%B6/1.htm">php验证文件</a><a class="tag" taget="_blank" href="/search/php%E9%94%81%E5%AE%9A%E6%96%87%E4%BB%B6/1.htm">php锁定文件</a> <div>PHP使用文件和目录 1.使用include()包含文件 (1):使用include()从一个被包含文档返回一个值 (2):在控制结构中使用include()   include_once()函数需要一个包含文件的路径,此外,第一次调用它的情况和include()一样,如果在脚本执行中再次对同一个文件调用,那么这个文件不会再次包含。   在php.ini文件中设置</div> </li> <li><a href="/article/509.htm" title="SQL SELECT DISTINCT 语句" target="_blank">SQL SELECT DISTINCT 语句</a> <span class="text-muted">何必如此</span> <a class="tag" taget="_blank" href="/search/sql/1.htm">sql</a> <div>SELECT DISTINCT 语句用于返回唯一不同的值。 SQL SELECT DISTINCT 语句 在表中,一个列可能会包含多个重复值,有时您也许希望仅仅列出不同(distinct)的值。 DISTINCT 关键词用于返回唯一不同的值。 SQL SELECT DISTINCT 语法 SELECT DISTINCT column_name,column_name F</div> </li> <li><a href="/article/636.htm" title="java冒泡排序" target="_blank">java冒泡排序</a> <span class="text-muted">3213213333332132</span> <a class="tag" taget="_blank" href="/search/java/1.htm">java</a><a class="tag" taget="_blank" href="/search/%E5%86%92%E6%B3%A1%E6%8E%92%E5%BA%8F/1.htm">冒泡排序</a> <div>package com.algorithm; /** * @Description 冒泡 * @author FuJianyong * 2015-1-22上午09:58:39 */ public class MaoPao { public static void main(String[] args) { int[] mao = {17,50,26,18,9,10</div> </li> <li><a href="/article/763.htm" title="struts2.18 +json,struts2-json-plugin-2.1.8.1.jar配置及问题!" target="_blank">struts2.18 +json,struts2-json-plugin-2.1.8.1.jar配置及问题!</a> <span class="text-muted">7454103</span> <a class="tag" taget="_blank" href="/search/DAO/1.htm">DAO</a><a class="tag" taget="_blank" href="/search/spring/1.htm">spring</a><a class="tag" taget="_blank" href="/search/Ajax/1.htm">Ajax</a><a class="tag" taget="_blank" href="/search/json/1.htm">json</a><a class="tag" taget="_blank" href="/search/qq/1.htm">qq</a> <div>struts2.18  出来有段时间了! (貌似是 稳定版)   闲时研究下下!  貌似 sruts2 搭配 json 做 ajax 很吃香!   实践了下下! 不当之处请绕过! 呵呵   网上一大堆 struts2+json  不过大多的json 插件 都是 jsonplugin.34.jar   strut</div> </li> <li><a href="/article/890.htm" title="struts2 数据标签说明" target="_blank">struts2 数据标签说明</a> <span class="text-muted">darkranger</span> <a class="tag" taget="_blank" href="/search/jsp/1.htm">jsp</a><a class="tag" taget="_blank" href="/search/bean/1.htm">bean</a><a class="tag" taget="_blank" href="/search/struts/1.htm">struts</a><a class="tag" taget="_blank" href="/search/servlet/1.htm">servlet</a><a class="tag" taget="_blank" href="/search/Scheme/1.htm">Scheme</a> <div>数据标签主要用于提供各种数据访问相关的功能,包括显示一个Action里的属性,以及生成国际化输出等功能 数据标签主要包括: action :该标签用于在JSP页面中直接调用一个Action,通过指定executeResult参数,还可将该Action的处理结果包含到本页面来。 bean :该标签用于创建一个javabean实例。如果指定了id属性,则可以将创建的javabean实例放入Sta</div> </li> <li><a href="/article/1017.htm" title="链表.简单的链表节点构建" target="_blank">链表.简单的链表节点构建</a> <span class="text-muted">aijuans</span> <a class="tag" taget="_blank" href="/search/%E7%BC%96%E7%A8%8B%E6%8A%80%E5%B7%A7/1.htm">编程技巧</a> <div>/*编程环境WIN-TC*/ #include "stdio.h" #include "conio.h" #define NODE(name, key_word, help) \  Node name[1]={{NULL, NULL, NULL, key_word, help}} typedef struct node {  &nbs</div> </li> <li><a href="/article/1144.htm" title="tomcat下jndi的三种配置方式" target="_blank">tomcat下jndi的三种配置方式</a> <span class="text-muted">avords</span> <a class="tag" taget="_blank" href="/search/tomcat/1.htm">tomcat</a> <div>jndi(Java Naming and Directory Interface,Java命名和目录接口)是一组在Java应用中访问命名和目录服务的API。命名服务将名称和对象联系起来,使得我们可以用名称 访问对象。目录服务是一种命名服务,在这种服务里,对象不但有名称,还有属性。          tomcat配置</div> </li> <li><a href="/article/1271.htm" title="关于敏捷的一些想法" target="_blank">关于敏捷的一些想法</a> <span class="text-muted">houxinyou</span> <a class="tag" taget="_blank" href="/search/%E6%95%8F%E6%8D%B7/1.htm">敏捷</a> <div>从网上看到这样一句话:“敏捷开发的最重要目标就是:满足用户多变的需求,说白了就是最大程度的让客户满意。” 感觉表达的不太清楚。 感觉容易被人误解的地方主要在“用户多变的需求”上。 第一种多变,实际上就是没有从根本上了解了用户的需求。用户的需求实际是稳定的,只是比较多,也比较混乱,用户一般只能了解自己的那一小部分,所以没有用户能清楚的表达出整体需求。而由于各种条件的,用户表达自己那一部分时也有</div> </li> <li><a href="/article/1398.htm" title="富养还是穷养,决定孩子的一生" target="_blank">富养还是穷养,决定孩子的一生</a> <span class="text-muted">bijian1013</span> <a class="tag" taget="_blank" href="/search/%E6%95%99%E8%82%B2/1.htm">教育</a><a class="tag" taget="_blank" href="/search/%E4%BA%BA%E7%94%9F/1.htm">人生</a> <div> 是什么决定孩子未来物质能否丰盛?为什么说寒门很难出贵子,三代才能出贵族?真的是父母必须有钱,才能大概率保证孩子未来富有吗?-----作者:@李雪爱与自由 事实并非由物质决定,而是由心灵决定。一朋友富有而且修养气质很好,兄弟姐妹也都如此。她的童年时代,物质上大家都很贫乏,但妈妈总是保持生活中的美感,时不时给孩子们带回一些美好小玩意,从来不对孩子传递生活艰辛、金钱来之不易、要懂得珍惜</div> </li> <li><a href="/article/1525.htm" title="oracle 日期时间格式转化" target="_blank">oracle 日期时间格式转化</a> <span class="text-muted">征客丶</span> <a class="tag" taget="_blank" href="/search/oracle/1.htm">oracle</a> <div>oracle 系统时间有 SYSDATE 与 SYSTIMESTAMP; SYSDATE:不支持毫秒,取的是系统时间; SYSTIMESTAMP:支持毫秒,日期,时间是给时区转换的,秒和毫秒是取的系统的。 日期转字符窜: 一、不取毫秒: TO_CHAR(SYSDATE, 'YYYY-MM-DD HH24:MI:SS') 简要说明, YYYY 年 MM   月</div> </li> <li><a href="/article/1652.htm" title="【Scala六】分析Spark源代码总结的Scala语法四" target="_blank">【Scala六】分析Spark源代码总结的Scala语法四</a> <span class="text-muted">bit1129</span> <a class="tag" taget="_blank" href="/search/scala/1.htm">scala</a> <div>1. apply语法   FileShuffleBlockManager中定义的类ShuffleFileGroup,定义:   private class ShuffleFileGroup(val shuffleId: Int, val fileId: Int, val files: Array[File]) { ... def apply(bucketId</div> </li> <li><a href="/article/1779.htm" title="Erlang中有意思的bug" target="_blank">Erlang中有意思的bug</a> <span class="text-muted">bookjovi</span> <a class="tag" taget="_blank" href="/search/erlang/1.htm">erlang</a> <div>  代码中常有一些很搞笑的bug,如下面的一行代码被调用两次(Erlang beam) commit f667e4a47b07b07ed035073b94d699ff5fe0ba9b Author: Jovi Zhang <bookjovi@gmail.com> Date: Fri Dec 2 16:19:22 2011 +0100 erts:</div> </li> <li><a href="/article/1906.htm" title="移位打印10进制数转16进制-2008-08-18" target="_blank">移位打印10进制数转16进制-2008-08-18</a> <span class="text-muted">ljy325</span> <a class="tag" taget="_blank" href="/search/java/1.htm">java</a><a class="tag" taget="_blank" href="/search/%E5%9F%BA%E7%A1%80/1.htm">基础</a> <div> /** * Description 移位打印10进制的16进制形式 * Creation Date 15-08-2008 9:00 * @author 卢俊宇 * @version 1.0 * */ public class PrintHex { // 备选字符 static final char di</div> </li> <li><a href="/article/2033.htm" title="读《研磨设计模式》-代码笔记-组合模式" target="_blank">读《研磨设计模式》-代码笔记-组合模式</a> <span class="text-muted">bylijinnan</span> <a class="tag" taget="_blank" href="/search/java/1.htm">java</a><a class="tag" taget="_blank" href="/search/%E8%AE%BE%E8%AE%A1%E6%A8%A1%E5%BC%8F/1.htm">设计模式</a> <div>声明: 本文只为方便我个人查阅和理解,详细的分析以及源代码请移步 原作者的博客http://chjavach.iteye.com/ import java.util.ArrayList; import java.util.List; abstract class Component { public abstract void printStruct(Str</div> </li> <li><a href="/article/2160.htm" title="利用cmd命令将.class文件打包成jar" target="_blank">利用cmd命令将.class文件打包成jar</a> <span class="text-muted">chenyu19891124</span> <a class="tag" taget="_blank" href="/search/cmd/1.htm">cmd</a><a class="tag" taget="_blank" href="/search/jar/1.htm">jar</a> <div>cmd命令打jar是如下实现: 在运行里输入cmd,利用cmd命令进入到本地的工作盘符。(如我的是D盘下的文件有此路径 D:\workspace\prpall\WEB-INF\classes) 现在是想把D:\workspace\prpall\WEB-INF\classes路径下所有的文件打包成prpall.jar。然后继续如下操作: cd D: 回车 cd workspace/prpal</div> </li> <li><a href="/article/2287.htm" title="[原创]JWFD v0.96 工作流系统二次开发包 for Eclipse 简要说明" target="_blank">[原创]JWFD v0.96 工作流系统二次开发包 for Eclipse 简要说明</a> <span class="text-muted">comsci</span> <a class="tag" taget="_blank" href="/search/eclipse/1.htm">eclipse</a><a class="tag" taget="_blank" href="/search/%E8%AE%BE%E8%AE%A1%E6%A8%A1%E5%BC%8F/1.htm">设计模式</a><a class="tag" taget="_blank" href="/search/%E7%AE%97%E6%B3%95/1.htm">算法</a><a class="tag" taget="_blank" href="/search/%E5%B7%A5%E4%BD%9C/1.htm">工作</a><a class="tag" taget="_blank" href="/search/swing/1.htm">swing</a> <div>                       JWFD v0.96 工作流系统二次开发包 for Eclipse 简要说明     &nb</div> </li> <li><a href="/article/2414.htm" title="SecureCRT右键粘贴的设置" target="_blank">SecureCRT右键粘贴的设置</a> <span class="text-muted">daizj</span> <a class="tag" taget="_blank" href="/search/secureCRT/1.htm">secureCRT</a><a class="tag" taget="_blank" href="/search/%E5%8F%B3%E9%94%AE/1.htm">右键</a><a class="tag" taget="_blank" href="/search/%E7%B2%98%E8%B4%B4/1.htm">粘贴</a> <div>一般都习惯鼠标右键自动粘贴的功能,对于SecureCRT6.7.5 ,这个功能也已经是默认配置了。 老版本的SecureCRT其实也有这个功能,只是不是默认设置,很多人不知道罢了。 菜单: Options->Global Options ...->Terminal 右边有个Mouse的选项块。 Copy on Select Paste on Right/Middle</div> </li> <li><a href="/article/2541.htm" title="Linux 软链接和硬链接" target="_blank">Linux 软链接和硬链接</a> <span class="text-muted">dongwei_6688</span> <a class="tag" taget="_blank" href="/search/linux/1.htm">linux</a> <div>1.Linux链接概念Linux链接分两种,一种被称为硬链接(Hard Link),另一种被称为符号链接(Symbolic Link)。默认情况下,ln命令产生硬链接。 【硬连接】硬连接指通过索引节点来进行连接。在Linux的文件系统中,保存在磁盘分区中的文件不管是什么类型都给它分配一个编号,称为索引节点号(Inode Index)。在Linux中,多个文件名指向同一索引节点是存在的。一般这种连</div> </li> <li><a href="/article/2668.htm" title="DIV底部自适应" target="_blank">DIV底部自适应</a> <span class="text-muted">dcj3sjt126com</span> <a class="tag" taget="_blank" href="/search/JavaScript/1.htm">JavaScript</a> <div><!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&q</div> </li> <li><a href="/article/2795.htm" title="Centos6.5使用yum安装mysql——快速上手必备" target="_blank">Centos6.5使用yum安装mysql——快速上手必备</a> <span class="text-muted">dcj3sjt126com</span> <a class="tag" taget="_blank" href="/search/mysql/1.htm">mysql</a> <div>第1步、yum安装mysql [root@stonex ~]#  yum -y install mysql-server 安装结果: Installed:     mysql-server.x86_64 0:5.1.73-3.el6_5                   &nb</div> </li> <li><a href="/article/2922.htm" title="如何调试JDK源码" target="_blank">如何调试JDK源码</a> <span class="text-muted">frank1234</span> <a class="tag" taget="_blank" href="/search/jdk/1.htm">jdk</a> <div>相信各位小伙伴们跟我一样,想通过JDK源码来学习Java,比如collections包,java.util.concurrent包。 可惜的是sun提供的jdk并不能查看运行中的局部变量,需要重新编译一下rt.jar。 下面是编译jdk的具体步骤:         1.把C:\java\jdk1.6.0_26\sr</div> </li> <li><a href="/article/3049.htm" title="Maximal Rectangle" target="_blank">Maximal Rectangle</a> <span class="text-muted">hcx2013</span> <a class="tag" taget="_blank" href="/search/max/1.htm">max</a> <div>Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing all ones and return its area.   public class Solution { public int maximalRectangle(char[][] matrix)</div> </li> <li><a href="/article/3176.htm" title="Spring MVC测试框架详解——服务端测试" target="_blank">Spring MVC测试框架详解——服务端测试</a> <span class="text-muted">jinnianshilongnian</span> <a class="tag" taget="_blank" href="/search/spring+mvc+test/1.htm">spring mvc test</a> <div>随着RESTful Web Service的流行,测试对外的Service是否满足期望也变的必要的。从Spring 3.2开始Spring了Spring Web测试框架,如果版本低于3.2,请使用spring-test-mvc项目(合并到spring3.2中了)。   Spring MVC测试框架提供了对服务器端和客户端(基于RestTemplate的客户端)提供了支持。 &nbs</div> </li> <li><a href="/article/3303.htm" title="Linux64位操作系统(CentOS6.6)上如何编译hadoop2.4.0" target="_blank">Linux64位操作系统(CentOS6.6)上如何编译hadoop2.4.0</a> <span class="text-muted">liyong0802</span> <a class="tag" taget="_blank" href="/search/hadoop/1.htm">hadoop</a> <div>一、准备编译软件   1.在官网下载jdk1.7、maven3.2.1、ant1.9.4,解压设置好环境变量就可以用。     环境变量设置如下:   (1)执行vim /etc/profile (2)在文件尾部加入: export JAVA_HOME=/home/spark/jdk1.7 export MAVEN_HOME=/ho</div> </li> <li><a href="/article/3430.htm" title="StatusBar 字体白色" target="_blank">StatusBar 字体白色</a> <span class="text-muted">pangyulei</span> <a class="tag" taget="_blank" href="/search/status/1.htm">status</a> <div> [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent]; /*you'll also need to set UIViewControllerBasedStatusBarAppearance to NO in the plist file if you use this method</div> </li> <li><a href="/article/3557.htm" title="如何分析Java虚拟机死锁" target="_blank">如何分析Java虚拟机死锁</a> <span class="text-muted">sesame</span> <a class="tag" taget="_blank" href="/search/java/1.htm">java</a><a class="tag" taget="_blank" href="/search/thread/1.htm">thread</a><a class="tag" taget="_blank" href="/search/oracle/1.htm">oracle</a><a class="tag" taget="_blank" href="/search/%E8%99%9A%E6%8B%9F%E6%9C%BA/1.htm">虚拟机</a><a class="tag" taget="_blank" href="/search/jdbc/1.htm">jdbc</a> <div>英文资料: Thread Dump and Concurrency Locks   Thread dumps are very useful for diagnosing synchronization related problems such as deadlocks on object monitors. Ctrl-\ on Solaris/Linux or Ctrl-B</div> </li> <li><a href="/article/3684.htm" title="位运算简介及实用技巧(一):基础篇" target="_blank">位运算简介及实用技巧(一):基础篇</a> <span class="text-muted">tw_wangzhengquan</span> <a class="tag" taget="_blank" href="/search/%E4%BD%8D%E8%BF%90%E7%AE%97/1.htm">位运算</a> <div>http://www.matrix67.com/blog/archives/263    去年年底写的关于位运算的日志是这个Blog里少数大受欢迎的文章之一,很多人都希望我能不断完善那篇文章。后来我看到了不少其它的资料,学习到了更多关于位运算的知识,有了重新整理位运算技巧的想法。从今天起我就开始写这一系列位运算讲解文章,与其说是原来那篇文章的follow-up,不如说是一个r</div> </li> <li><a href="/article/3811.htm" title="jsearch的索引文件结构" target="_blank">jsearch的索引文件结构</a> <span class="text-muted">yangshangchuan</span> <a class="tag" taget="_blank" href="/search/%E6%90%9C%E7%B4%A2%E5%BC%95%E6%93%8E/1.htm">搜索引擎</a><a class="tag" taget="_blank" href="/search/jsearch/1.htm">jsearch</a><a class="tag" taget="_blank" href="/search/%E5%85%A8%E6%96%87%E6%A3%80%E7%B4%A2/1.htm">全文检索</a><a class="tag" taget="_blank" href="/search/%E4%BF%A1%E6%81%AF%E6%A3%80%E7%B4%A2/1.htm">信息检索</a><a class="tag" taget="_blank" href="/search/word%E5%88%86%E8%AF%8D/1.htm">word分词</a> <div>jsearch是一个高性能的全文检索工具包,基于倒排索引,基于java8,类似于lucene,但更轻量级。   jsearch的索引文件结构定义如下:     1、一个词的索引由=分割的三部分组成:        第一部分是词        第二部分是这个词在多少</div> </li> </ul> </div> </div> </div> <div> <div class="container"> <div class="indexes"> <strong>按字母分类:</strong> <a href="/tags/A/1.htm" target="_blank">A</a><a href="/tags/B/1.htm" target="_blank">B</a><a href="/tags/C/1.htm" target="_blank">C</a><a href="/tags/D/1.htm" target="_blank">D</a><a href="/tags/E/1.htm" target="_blank">E</a><a href="/tags/F/1.htm" target="_blank">F</a><a href="/tags/G/1.htm" target="_blank">G</a><a href="/tags/H/1.htm" target="_blank">H</a><a href="/tags/I/1.htm" target="_blank">I</a><a href="/tags/J/1.htm" target="_blank">J</a><a href="/tags/K/1.htm" target="_blank">K</a><a href="/tags/L/1.htm" target="_blank">L</a><a href="/tags/M/1.htm" target="_blank">M</a><a href="/tags/N/1.htm" target="_blank">N</a><a href="/tags/O/1.htm" target="_blank">O</a><a href="/tags/P/1.htm" target="_blank">P</a><a href="/tags/Q/1.htm" target="_blank">Q</a><a href="/tags/R/1.htm" target="_blank">R</a><a href="/tags/S/1.htm" target="_blank">S</a><a href="/tags/T/1.htm" target="_blank">T</a><a href="/tags/U/1.htm" target="_blank">U</a><a href="/tags/V/1.htm" target="_blank">V</a><a href="/tags/W/1.htm" target="_blank">W</a><a href="/tags/X/1.htm" target="_blank">X</a><a href="/tags/Y/1.htm" target="_blank">Y</a><a href="/tags/Z/1.htm" target="_blank">Z</a><a href="/tags/0/1.htm" target="_blank">其他</a> </div> </div> </div> <footer id="footer" class="mb30 mt30"> <div class="container"> <div class="footBglm"> <a target="_blank" href="/">首页</a> - <a target="_blank" href="/custom/about.htm">关于我们</a> - <a target="_blank" href="/search/Java/1.htm">站内搜索</a> - <a target="_blank" href="/sitemap.txt">Sitemap</a> - <a target="_blank" href="/custom/delete.htm">侵权投诉</a> </div> <div class="copyright">版权所有 IT知识库 CopyRight © 2000-2050 E-COM-NET.COM , All Rights Reserved. <!-- <a href="https://beian.miit.gov.cn/" rel="nofollow" target="_blank">京ICP备09083238号</a><br>--> </div> </div> </footer> <!-- 代码高亮 --> <script type="text/javascript" src="/static/syntaxhighlighter/scripts/shCore.js"></script> <script type="text/javascript" src="/static/syntaxhighlighter/scripts/shLegacy.js"></script> <script type="text/javascript" src="/static/syntaxhighlighter/scripts/shAutoloader.js"></script> <link type="text/css" rel="stylesheet" href="/static/syntaxhighlighter/styles/shCoreDefault.css"/> <script type="text/javascript" src="/static/syntaxhighlighter/src/my_start_1.js"></script> </body> </html>